1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035 |
- /*! axe v4.7.0
- * Copyright (c) 2023 Deque Systems, Inc.
- *
- * Your use of this Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This entire copyright notice must appear in every copy of this file you
- * distribute or in any file that contains substantial portions of this source
- * code.
- */
- (function axeFunction(window) {
- var global = window;
- var document = window.document;
- 'use strict';
- function _typeof(obj) {
- '@babel/helpers - typeof';
- return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
- }, _typeof(obj);
- }
- var axe = axe || {};
- axe.version = '4.7.0';
- if (typeof define === 'function' && define.amd) {
- define('axe-core', [], function() {
- return axe;
- });
- }
- if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports && typeof axeFunction.toString === 'function') {
- axe.source = '(' + axeFunction.toString() + ')(typeof window === "object" ? window : this);';
- module.exports = axe;
- }
- if (typeof window.getComputedStyle === 'function') {
- window.axe = axe;
- }
- var commons;
- function SupportError(error) {
- this.name = 'SupportError';
- this.cause = error.cause;
- this.message = '`'.concat(error.cause, '` - feature unsupported in your environment.');
- if (error.ruleId) {
- this.ruleId = error.ruleId;
- this.message += ' Skipping '.concat(this.ruleId, ' rule.');
- }
- this.stack = new Error().stack;
- }
- SupportError.prototype = Object.create(Error.prototype);
- SupportError.prototype.constructor = SupportError;
- 'use strict';
- var _excluded = [ 'node' ], _excluded2 = [ 'variant' ], _excluded3 = [ 'matches' ], _excluded4 = [ 'chromium' ], _excluded5 = [ 'noImplicit' ], _excluded6 = [ 'noPresentational' ], _excluded7 = [ 'node' ], _excluded8 = [ 'nodes' ], _excluded9 = [ 'node' ], _excluded10 = [ 'relatedNodes' ], _excluded11 = [ 'environmentData' ], _excluded12 = [ 'environmentData' ], _excluded13 = [ 'node' ], _excluded14 = [ 'environmentData' ], _excluded15 = [ 'environmentData' ], _excluded16 = [ 'environmentData' ];
- function _toArray(arr) {
- return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
- }
- function _defineProperty(obj, key, value) {
- key = _toPropertyKey(key);
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- function _inherits(subClass, superClass) {
- if (typeof superClass !== 'function' && superClass !== null) {
- throw new TypeError('Super expression must either be null or a function');
- }
- subClass.prototype = Object.create(superClass && superClass.prototype, {
- constructor: {
- value: subClass,
- writable: true,
- configurable: true
- }
- });
- Object.defineProperty(subClass, 'prototype', {
- writable: false
- });
- if (superClass) {
- _setPrototypeOf(subClass, superClass);
- }
- }
- function _setPrototypeOf(o, p) {
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- };
- return _setPrototypeOf(o, p);
- }
- function _createSuper(Derived) {
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
- return function _createSuperInternal() {
- var Super = _getPrototypeOf(Derived), result;
- if (hasNativeReflectConstruct) {
- var NewTarget = _getPrototypeOf(this).constructor;
- result = Reflect.construct(Super, arguments, NewTarget);
- } else {
- result = Super.apply(this, arguments);
- }
- return _possibleConstructorReturn(this, result);
- };
- }
- function _possibleConstructorReturn(self, call) {
- if (call && (_typeof(call) === 'object' || typeof call === 'function')) {
- return call;
- } else if (call !== void 0) {
- throw new TypeError('Derived constructors may only return object or undefined');
- }
- return _assertThisInitialized(self);
- }
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- }
- return self;
- }
- function _isNativeReflectConstruct() {
- if (typeof Reflect === 'undefined' || !Reflect.construct) {
- return false;
- }
- if (Reflect.construct.sham) {
- return false;
- }
- if (typeof Proxy === 'function') {
- return true;
- }
- try {
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
- return true;
- } catch (e) {
- return false;
- }
- }
- function _getPrototypeOf(o) {
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
- return o.__proto__ || Object.getPrototypeOf(o);
- };
- return _getPrototypeOf(o);
- }
- function _objectWithoutProperties(source, excluded) {
- if (source == null) {
- return {};
- }
- var target = _objectWithoutPropertiesLoose(source, excluded);
- var key, i;
- if (Object.getOwnPropertySymbols) {
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
- for (i = 0; i < sourceSymbolKeys.length; i++) {
- key = sourceSymbolKeys[i];
- if (excluded.indexOf(key) >= 0) {
- continue;
- }
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) {
- continue;
- }
- target[key] = source[key];
- }
- }
- return target;
- }
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) {
- return {};
- }
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) {
- continue;
- }
- target[key] = source[key];
- }
- return target;
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
- }
- function _nonIterableSpread() {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
- }
- function _iterableToArray(iter) {
- if (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null || iter['@@iterator'] != null) {
- return Array.from(iter);
- }
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- return _arrayLikeToArray(arr);
- }
- }
- function _extends() {
- _extends = Object.assign ? Object.assign.bind() : function(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- return _extends.apply(this, arguments);
- }
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
- }
- function _nonIterableRest() {
- throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
- }
- function _iterableToArrayLimit(arr, i) {
- var _i = null == arr ? null : 'undefined' != typeof Symbol && arr[Symbol.iterator] || arr['@@iterator'];
- if (null != _i) {
- var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1;
- try {
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
- if (Object(_i) !== _i) {
- return;
- }
- _n = !1;
- } else {
- for (;!(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
- }
- }
- } catch (err) {
- _d = !0, _e = err;
- } finally {
- try {
- if (!_n && null != _i['return'] && (_r = _i['return'](), Object(_r) !== _r)) {
- return;
- }
- } finally {
- if (_d) {
- throw _e;
- }
- }
- }
- return _arr;
- }
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) {
- return arr;
- }
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError('Cannot call a class as a function');
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ('value' in descriptor) {
- descriptor.writable = true;
- }
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) {
- _defineProperties(Constructor.prototype, protoProps);
- }
- if (staticProps) {
- _defineProperties(Constructor, staticProps);
- }
- Object.defineProperty(Constructor, 'prototype', {
- writable: false
- });
- return Constructor;
- }
- function _toPropertyKey(arg) {
- var key = _toPrimitive(arg, 'string');
- return _typeof(key) === 'symbol' ? key : String(key);
- }
- function _toPrimitive(input, hint) {
- if (_typeof(input) !== 'object' || input === null) {
- return input;
- }
- var prim = input[Symbol.toPrimitive];
- if (prim !== undefined) {
- var res = prim.call(input, hint || 'default');
- if (_typeof(res) !== 'object') {
- return res;
- }
- throw new TypeError('@@toPrimitive must return a primitive value.');
- }
- return (hint === 'string' ? String : Number)(input);
- }
- function _createForOfIteratorHelper(o, allowArrayLike) {
- var it = typeof Symbol !== 'undefined' && o[Symbol.iterator] || o['@@iterator'];
- if (!it) {
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') {
- if (it) {
- o = it;
- }
- var i = 0;
- var F = function F() {};
- return {
- s: F,
- n: function n() {
- if (i >= o.length) {
- return {
- done: true
- };
- }
- return {
- done: false,
- value: o[i++]
- };
- },
- e: function e(_e2) {
- throw _e2;
- },
- f: F
- };
- }
- throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
- }
- var normalCompletion = true, didErr = false, err;
- return {
- s: function s() {
- it = it.call(o);
- },
- n: function n() {
- var step = it.next();
- normalCompletion = step.done;
- return step;
- },
- e: function e(_e3) {
- didErr = true;
- err = _e3;
- },
- f: function f() {
- try {
- if (!normalCompletion && it['return'] != null) {
- it['return']();
- }
- } finally {
- if (didErr) {
- throw err;
- }
- }
- }
- };
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) {
- return;
- }
- if (typeof o === 'string') {
- return _arrayLikeToArray(o, minLen);
- }
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === 'Object' && o.constructor) {
- n = o.constructor.name;
- }
- if (n === 'Map' || n === 'Set') {
- return Array.from(o);
- }
- if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
- return _arrayLikeToArray(o, minLen);
- }
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) {
- len = arr.length;
- }
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i];
- }
- return arr2;
- }
- function _typeof(obj) {
- '@babel/helpers - typeof';
- return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
- return typeof obj;
- } : function(obj) {
- return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
- }, _typeof(obj);
- }
- (function() {
- var __create = Object.create;
- var __defProp = Object.defineProperty;
- var __getProtoOf = Object.getPrototypeOf;
- var __hasOwnProp = Object.prototype.hasOwnProperty;
- var __getOwnPropNames = Object.getOwnPropertyNames;
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
- var __markAsModule = function __markAsModule(target) {
- return __defProp(target, '__esModule', {
- value: true
- });
- };
- var __commonJS = function __commonJS(cb, mod) {
- return function() {
- return mod || cb((mod = {
- exports: {}
- }).exports, mod), mod.exports;
- };
- };
- var __export = function __export(target, all) {
- for (var name in all) {
- __defProp(target, name, {
- get: all[name],
- enumerable: true
- });
- }
- };
- var __exportStar = function __exportStar(target, module, desc) {
- if (module && _typeof(module) === 'object' || typeof module === 'function') {
- var _iterator = _createForOfIteratorHelper(__getOwnPropNames(module)), _step;
- try {
- var _loop = function _loop() {
- var key = _step.value;
- if (!__hasOwnProp.call(target, key) && key !== 'default') {
- __defProp(target, key, {
- get: function get() {
- return module[key];
- },
- enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable
- });
- }
- };
- for (_iterator.s(); !(_step = _iterator.n()).done; ) {
- _loop();
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- }
- return target;
- };
- var __toModule = function __toModule(module) {
- return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, 'default', module && module.__esModule && 'default' in module ? {
- get: function get() {
- return module['default'];
- },
- enumerable: true
- } : {
- value: module,
- enumerable: true
- })), module);
- };
- var require_utils = __commonJS(function(exports) {
- 'use strict';
- Object.defineProperty(exports, '__esModule', {
- value: true
- });
- function isIdentStart(c) {
- return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-' || c === '_';
- }
- exports.isIdentStart = isIdentStart;
- function isIdent(c) {
- return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '-' || c === '_';
- }
- exports.isIdent = isIdent;
- function isHex(c) {
- return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || c >= '0' && c <= '9';
- }
- exports.isHex = isHex;
- function escapeIdentifier(s) {
- var len = s.length;
- var result = '';
- var i = 0;
- while (i < len) {
- var chr = s.charAt(i);
- if (exports.identSpecialChars[chr]) {
- result += '\\' + chr;
- } else {
- if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
- var charCode = chr.charCodeAt(0);
- if ((charCode & 63488) === 55296) {
- var extraCharCode = s.charCodeAt(i++);
- if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
- throw Error('UCS-2(decode): illegal sequence');
- }
- charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
- }
- result += '\\' + charCode.toString(16) + ' ';
- } else {
- result += chr;
- }
- }
- i++;
- }
- return result;
- }
- exports.escapeIdentifier = escapeIdentifier;
- function escapeStr(s) {
- var len = s.length;
- var result = '';
- var i = 0;
- var replacement;
- while (i < len) {
- var chr = s.charAt(i);
- if (chr === '"') {
- chr = '\\"';
- } else if (chr === '\\') {
- chr = '\\\\';
- } else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
- chr = replacement;
- }
- result += chr;
- i++;
- }
- return '"' + result + '"';
- }
- exports.escapeStr = escapeStr;
- exports.identSpecialChars = {
- '!': true,
- '"': true,
- '#': true,
- $: true,
- '%': true,
- '&': true,
- '\'': true,
- '(': true,
- ')': true,
- '*': true,
- '+': true,
- ',': true,
- '.': true,
- '/': true,
- ';': true,
- '<': true,
- '=': true,
- '>': true,
- '?': true,
- '@': true,
- '[': true,
- '\\': true,
- ']': true,
- '^': true,
- '`': true,
- '{': true,
- '|': true,
- '}': true,
- '~': true
- };
- exports.strReplacementsRev = {
- '\n': '\\n',
- '\r': '\\r',
- '\t': '\\t',
- '\f': '\\f',
- '\v': '\\v'
- };
- exports.singleQuoteEscapeChars = {
- n: '\n',
- r: '\r',
- t: '\t',
- f: '\f',
- '\\': '\\',
- '\'': '\''
- };
- exports.doubleQuotesEscapeChars = {
- n: '\n',
- r: '\r',
- t: '\t',
- f: '\f',
- '\\': '\\',
- '"': '"'
- };
- });
- var require_parser_context = __commonJS(function(exports) {
- 'use strict';
- Object.defineProperty(exports, '__esModule', {
- value: true
- });
- var utils_1 = require_utils();
- function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
- var l = str.length;
- var chr = '';
- function getStr(quote, escapeTable) {
- var result = '';
- pos++;
- chr = str.charAt(pos);
- while (pos < l) {
- if (chr === quote) {
- pos++;
- return result;
- } else if (chr === '\\') {
- pos++;
- chr = str.charAt(pos);
- var esc = void 0;
- if (chr === quote) {
- result += quote;
- } else if ((esc = escapeTable[chr]) !== void 0) {
- result += esc;
- } else if (utils_1.isHex(chr)) {
- var hex = chr;
- pos++;
- chr = str.charAt(pos);
- while (utils_1.isHex(chr)) {
- hex += chr;
- pos++;
- chr = str.charAt(pos);
- }
- if (chr === ' ') {
- pos++;
- chr = str.charAt(pos);
- }
- result += String.fromCharCode(parseInt(hex, 16));
- continue;
- } else {
- result += chr;
- }
- } else {
- result += chr;
- }
- pos++;
- chr = str.charAt(pos);
- }
- return result;
- }
- function getIdent() {
- var result = '';
- chr = str.charAt(pos);
- while (pos < l) {
- if (utils_1.isIdent(chr)) {
- result += chr;
- } else if (chr === '\\') {
- pos++;
- if (pos >= l) {
- throw Error('Expected symbol but end of file reached.');
- }
- chr = str.charAt(pos);
- if (utils_1.identSpecialChars[chr]) {
- result += chr;
- } else if (utils_1.isHex(chr)) {
- var hex = chr;
- pos++;
- chr = str.charAt(pos);
- while (utils_1.isHex(chr)) {
- hex += chr;
- pos++;
- chr = str.charAt(pos);
- }
- if (chr === ' ') {
- pos++;
- chr = str.charAt(pos);
- }
- result += String.fromCharCode(parseInt(hex, 16));
- continue;
- } else {
- result += chr;
- }
- } else {
- return result;
- }
- pos++;
- chr = str.charAt(pos);
- }
- return result;
- }
- function skipWhitespace() {
- chr = str.charAt(pos);
- var result = false;
- while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
- result = true;
- pos++;
- chr = str.charAt(pos);
- }
- return result;
- }
- function parse2() {
- var res = parseSelector();
- if (pos < l) {
- throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
- }
- return res;
- }
- function parseSelector() {
- var selector = parseSingleSelector();
- if (!selector) {
- return null;
- }
- var res = selector;
- chr = str.charAt(pos);
- while (chr === ',') {
- pos++;
- skipWhitespace();
- if (res.type !== 'selectors') {
- res = {
- type: 'selectors',
- selectors: [ selector ]
- };
- }
- selector = parseSingleSelector();
- if (!selector) {
- throw Error('Rule expected after ",".');
- }
- res.selectors.push(selector);
- }
- return res;
- }
- function parseSingleSelector() {
- skipWhitespace();
- var selector = {
- type: 'ruleSet'
- };
- var rule = parseRule();
- if (!rule) {
- return null;
- }
- var currentRule = selector;
- while (rule) {
- rule.type = 'rule';
- currentRule.rule = rule;
- currentRule = rule;
- skipWhitespace();
- chr = str.charAt(pos);
- if (pos >= l || chr === ',' || chr === ')') {
- break;
- }
- if (ruleNestingOperators[chr]) {
- var op = chr;
- pos++;
- skipWhitespace();
- rule = parseRule();
- if (!rule) {
- throw Error('Rule expected after "' + op + '".');
- }
- rule.nestingOperator = op;
- } else {
- rule = parseRule();
- if (rule) {
- rule.nestingOperator = null;
- }
- }
- }
- return selector;
- }
- function parseRule() {
- var rule = null;
- while (pos < l) {
- chr = str.charAt(pos);
- if (chr === '*') {
- pos++;
- (rule = rule || {}).tagName = '*';
- } else if (utils_1.isIdentStart(chr) || chr === '\\') {
- (rule = rule || {}).tagName = getIdent();
- } else if (chr === '.') {
- pos++;
- rule = rule || {};
- (rule.classNames = rule.classNames || []).push(getIdent());
- } else if (chr === '#') {
- pos++;
- (rule = rule || {}).id = getIdent();
- } else if (chr === '[') {
- pos++;
- skipWhitespace();
- var attr = {
- name: getIdent()
- };
- skipWhitespace();
- if (chr === ']') {
- pos++;
- } else {
- var operator = '';
- if (attrEqualityMods[chr]) {
- operator = chr;
- pos++;
- chr = str.charAt(pos);
- }
- if (pos >= l) {
- throw Error('Expected "=" but end of file reached.');
- }
- if (chr !== '=') {
- throw Error('Expected "=" but "' + chr + '" found.');
- }
- attr.operator = operator + '=';
- pos++;
- skipWhitespace();
- var attrValue = '';
- attr.valueType = 'string';
- if (chr === '"') {
- attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
- } else if (chr === '\'') {
- attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
- } else if (substitutesEnabled && chr === '$') {
- pos++;
- attrValue = getIdent();
- attr.valueType = 'substitute';
- } else {
- while (pos < l) {
- if (chr === ']') {
- break;
- }
- attrValue += chr;
- pos++;
- chr = str.charAt(pos);
- }
- attrValue = attrValue.trim();
- }
- skipWhitespace();
- if (pos >= l) {
- throw Error('Expected "]" but end of file reached.');
- }
- if (chr !== ']') {
- throw Error('Expected "]" but "' + chr + '" found.');
- }
- pos++;
- attr.value = attrValue;
- }
- rule = rule || {};
- (rule.attrs = rule.attrs || []).push(attr);
- } else if (chr === ':') {
- pos++;
- var pseudoName = getIdent();
- var pseudo = {
- name: pseudoName
- };
- if (chr === '(') {
- pos++;
- var value = '';
- skipWhitespace();
- if (pseudos[pseudoName] === 'selector') {
- pseudo.valueType = 'selector';
- value = parseSelector();
- } else {
- pseudo.valueType = pseudos[pseudoName] || 'string';
- if (chr === '"') {
- value = getStr('"', utils_1.doubleQuotesEscapeChars);
- } else if (chr === '\'') {
- value = getStr('\'', utils_1.singleQuoteEscapeChars);
- } else if (substitutesEnabled && chr === '$') {
- pos++;
- value = getIdent();
- pseudo.valueType = 'substitute';
- } else {
- while (pos < l) {
- if (chr === ')') {
- break;
- }
- value += chr;
- pos++;
- chr = str.charAt(pos);
- }
- value = value.trim();
- }
- skipWhitespace();
- }
- if (pos >= l) {
- throw Error('Expected ")" but end of file reached.');
- }
- if (chr !== ')') {
- throw Error('Expected ")" but "' + chr + '" found.');
- }
- pos++;
- pseudo.value = value;
- }
- rule = rule || {};
- (rule.pseudos = rule.pseudos || []).push(pseudo);
- } else {
- break;
- }
- }
- return rule;
- }
- return parse2();
- }
- exports.parseCssSelector = parseCssSelector;
- });
- var require_render = __commonJS(function(exports) {
- 'use strict';
- Object.defineProperty(exports, '__esModule', {
- value: true
- });
- var utils_1 = require_utils();
- function renderEntity(entity) {
- var res = '';
- switch (entity.type) {
- case 'ruleSet':
- var currentEntity = entity.rule;
- var parts = [];
- while (currentEntity) {
- if (currentEntity.nestingOperator) {
- parts.push(currentEntity.nestingOperator);
- }
- parts.push(renderEntity(currentEntity));
- currentEntity = currentEntity.rule;
- }
- res = parts.join(' ');
- break;
- case 'selectors':
- res = entity.selectors.map(renderEntity).join(', ');
- break;
- case 'rule':
- if (entity.tagName) {
- if (entity.tagName === '*') {
- res = '*';
- } else {
- res = utils_1.escapeIdentifier(entity.tagName);
- }
- }
- if (entity.id) {
- res += '#' + utils_1.escapeIdentifier(entity.id);
- }
- if (entity.classNames) {
- res += entity.classNames.map(function(cn) {
- return '.' + utils_1.escapeIdentifier(cn);
- }).join('');
- }
- if (entity.attrs) {
- res += entity.attrs.map(function(attr) {
- if ('operator' in attr) {
- if (attr.valueType === 'substitute') {
- return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
- } else {
- return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
- }
- } else {
- return '[' + utils_1.escapeIdentifier(attr.name) + ']';
- }
- }).join('');
- }
- if (entity.pseudos) {
- res += entity.pseudos.map(function(pseudo) {
- if (pseudo.valueType) {
- if (pseudo.valueType === 'selector') {
- return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
- } else if (pseudo.valueType === 'substitute') {
- return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
- } else if (pseudo.valueType === 'numeric') {
- return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
- } else {
- return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
- }
- } else {
- return ':' + utils_1.escapeIdentifier(pseudo.name);
- }
- }).join('');
- }
- break;
- default:
- throw Error('Unknown entity type: "' + entity.type + '".');
- }
- return res;
- }
- exports.renderEntity = renderEntity;
- });
- var require_lib = __commonJS(function(exports) {
- 'use strict';
- Object.defineProperty(exports, '__esModule', {
- value: true
- });
- var parser_context_1 = require_parser_context();
- var render_1 = require_render();
- var CssSelectorParser3 = function() {
- function CssSelectorParser4() {
- this.pseudos = {};
- this.attrEqualityMods = {};
- this.ruleNestingOperators = {};
- this.substitutesEnabled = false;
- }
- CssSelectorParser4.prototype.registerSelectorPseudos = function() {
- var pseudos = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- pseudos[_i] = arguments[_i];
- }
- for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
- var pseudo = pseudos_1[_a];
- this.pseudos[pseudo] = 'selector';
- }
- return this;
- };
- CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
- var pseudos = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- pseudos[_i] = arguments[_i];
- }
- for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
- var pseudo = pseudos_2[_a];
- delete this.pseudos[pseudo];
- }
- return this;
- };
- CssSelectorParser4.prototype.registerNumericPseudos = function() {
- var pseudos = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- pseudos[_i] = arguments[_i];
- }
- for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
- var pseudo = pseudos_3[_a];
- this.pseudos[pseudo] = 'numeric';
- }
- return this;
- };
- CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
- var pseudos = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- pseudos[_i] = arguments[_i];
- }
- for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
- var pseudo = pseudos_4[_a];
- delete this.pseudos[pseudo];
- }
- return this;
- };
- CssSelectorParser4.prototype.registerNestingOperators = function() {
- var operators = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- operators[_i] = arguments[_i];
- }
- for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
- var operator = operators_1[_a];
- this.ruleNestingOperators[operator] = true;
- }
- return this;
- };
- CssSelectorParser4.prototype.unregisterNestingOperators = function() {
- var operators = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- operators[_i] = arguments[_i];
- }
- for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
- var operator = operators_2[_a];
- delete this.ruleNestingOperators[operator];
- }
- return this;
- };
- CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
- var mods = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- mods[_i] = arguments[_i];
- }
- for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
- var mod = mods_1[_a];
- this.attrEqualityMods[mod] = true;
- }
- return this;
- };
- CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
- var mods = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- mods[_i] = arguments[_i];
- }
- for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
- var mod = mods_2[_a];
- delete this.attrEqualityMods[mod];
- }
- return this;
- };
- CssSelectorParser4.prototype.enableSubstitutes = function() {
- this.substitutesEnabled = true;
- return this;
- };
- CssSelectorParser4.prototype.disableSubstitutes = function() {
- this.substitutesEnabled = false;
- return this;
- };
- CssSelectorParser4.prototype.parse = function(str) {
- return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
- };
- CssSelectorParser4.prototype.render = function(path) {
- return render_1.renderEntity(path).trim();
- };
- return CssSelectorParser4;
- }();
- exports.CssSelectorParser = CssSelectorParser3;
- });
- var require_noop = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {};
- });
- var require_is_value = __commonJS(function(exports, module) {
- 'use strict';
- var _undefined = require_noop()();
- module.exports = function(val) {
- return val !== _undefined && val !== null;
- };
- });
- var require_normalize_options = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is_value();
- var forEach = Array.prototype.forEach;
- var create = Object.create;
- var process2 = function process2(src, obj) {
- var key;
- for (key in src) {
- obj[key] = src[key];
- }
- };
- module.exports = function(opts1) {
- var result = create(null);
- forEach.call(arguments, function(options) {
- if (!isValue(options)) {
- return;
- }
- process2(Object(options), result);
- });
- return result;
- };
- });
- var require_is_implemented = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- var sign = Math.sign;
- if (typeof sign !== 'function') {
- return false;
- }
- return sign(10) === 1 && sign(-20) === -1;
- };
- });
- var require_shim = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(value) {
- value = Number(value);
- if (isNaN(value) || value === 0) {
- return value;
- }
- return value > 0 ? 1 : -1;
- };
- });
- var require_sign = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented()() ? Math.sign : require_shim();
- });
- var require_to_integer = __commonJS(function(exports, module) {
- 'use strict';
- var sign = require_sign();
- var abs = Math.abs;
- var floor = Math.floor;
- module.exports = function(value) {
- if (isNaN(value)) {
- return 0;
- }
- value = Number(value);
- if (value === 0 || !isFinite(value)) {
- return value;
- }
- return sign(value) * floor(abs(value));
- };
- });
- var require_to_pos_integer = __commonJS(function(exports, module) {
- 'use strict';
- var toInteger = require_to_integer();
- var max = Math.max;
- module.exports = function(value) {
- return max(0, toInteger(value));
- };
- });
- var require_resolve_length = __commonJS(function(exports, module) {
- 'use strict';
- var toPosInt = require_to_pos_integer();
- module.exports = function(optsLength, fnLength, isAsync) {
- var length;
- if (isNaN(optsLength)) {
- length = fnLength;
- if (!(length >= 0)) {
- return 1;
- }
- if (isAsync && length) {
- return length - 1;
- }
- return length;
- }
- if (optsLength === false) {
- return false;
- }
- return toPosInt(optsLength);
- };
- });
- var require_valid_callable = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(fn) {
- if (typeof fn !== 'function') {
- throw new TypeError(fn + ' is not a function');
- }
- return fn;
- };
- });
- var require_valid_value = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is_value();
- module.exports = function(value) {
- if (!isValue(value)) {
- throw new TypeError('Cannot use null or undefined');
- }
- return value;
- };
- });
- var require_iterate = __commonJS(function(exports, module) {
- 'use strict';
- var callable = require_valid_callable();
- var value = require_valid_value();
- var bind = Function.prototype.bind;
- var call = Function.prototype.call;
- var keys = Object.keys;
- var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
- module.exports = function(method, defVal) {
- return function(obj, cb) {
- var list, thisArg = arguments[2], compareFn = arguments[3];
- obj = Object(value(obj));
- callable(cb);
- list = keys(obj);
- if (compareFn) {
- list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
- }
- if (typeof method !== 'function') {
- method = list[method];
- }
- return call.call(method, list, function(key, index) {
- if (!objPropertyIsEnumerable.call(obj, key)) {
- return defVal;
- }
- return call.call(cb, thisArg, obj[key], key, obj, index);
- });
- };
- };
- });
- var require_for_each = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_iterate()('forEach');
- });
- var require_registered_extensions = __commonJS(function() {
- 'use strict';
- });
- var require_is_implemented2 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- var assign = Object.assign, obj;
- if (typeof assign !== 'function') {
- return false;
- }
- obj = {
- foo: 'raz'
- };
- assign(obj, {
- bar: 'dwa'
- }, {
- trzy: 'trzy'
- });
- return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
- };
- });
- var require_is_implemented3 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- try {
- Object.keys('primitive');
- return true;
- } catch (e) {
- return false;
- }
- };
- });
- var require_shim2 = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is_value();
- var keys = Object.keys;
- module.exports = function(object) {
- return keys(isValue(object) ? Object(object) : object);
- };
- });
- var require_keys = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
- });
- var require_shim3 = __commonJS(function(exports, module) {
- 'use strict';
- var keys = require_keys();
- var value = require_valid_value();
- var max = Math.max;
- module.exports = function(dest, src) {
- var error, i, length = max(arguments.length, 2), assign;
- dest = Object(value(dest));
- assign = function assign(key) {
- try {
- dest[key] = src[key];
- } catch (e) {
- if (!error) {
- error = e;
- }
- }
- };
- for (i = 1; i < length; ++i) {
- src = arguments[i];
- keys(src).forEach(assign);
- }
- if (error !== void 0) {
- throw error;
- }
- return dest;
- };
- });
- var require_assign = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
- });
- var require_is_object = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is_value();
- var map = {
- function: true,
- object: true
- };
- module.exports = function(value) {
- return isValue(value) && map[_typeof(value)] || false;
- };
- });
- var require_custom = __commonJS(function(exports, module) {
- 'use strict';
- var assign = require_assign();
- var isObject = require_is_object();
- var isValue = require_is_value();
- var captureStackTrace = Error.captureStackTrace;
- module.exports = function(message) {
- var err2 = new Error(message), code = arguments[1], ext = arguments[2];
- if (!isValue(ext)) {
- if (isObject(code)) {
- ext = code;
- code = null;
- }
- }
- if (isValue(ext)) {
- assign(err2, ext);
- }
- if (isValue(code)) {
- err2.code = code;
- }
- if (captureStackTrace) {
- captureStackTrace(err2, module.exports);
- }
- return err2;
- };
- });
- var require_mixin = __commonJS(function(exports, module) {
- 'use strict';
- var value = require_valid_value();
- var defineProperty = Object.defineProperty;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var getOwnPropertyNames = Object.getOwnPropertyNames;
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- module.exports = function(target, source) {
- var error, sourceObject = Object(value(source));
- target = Object(value(target));
- getOwnPropertyNames(sourceObject).forEach(function(name) {
- try {
- defineProperty(target, name, getOwnPropertyDescriptor(source, name));
- } catch (e) {
- error = e;
- }
- });
- if (typeof getOwnPropertySymbols === 'function') {
- getOwnPropertySymbols(sourceObject).forEach(function(symbol) {
- try {
- defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
- } catch (e) {
- error = e;
- }
- });
- }
- if (error !== void 0) {
- throw error;
- }
- return target;
- };
- });
- var require_define_length = __commonJS(function(exports, module) {
- 'use strict';
- var toPosInt = require_to_pos_integer();
- var test = function test(arg1, arg2) {
- return arg2;
- };
- var desc;
- var defineProperty;
- var generate;
- var mixin;
- try {
- Object.defineProperty(test, 'length', {
- configurable: true,
- writable: false,
- enumerable: false,
- value: 1
- });
- } catch (ignore) {}
- if (test.length === 1) {
- desc = {
- configurable: true,
- writable: false,
- enumerable: false
- };
- defineProperty = Object.defineProperty;
- module.exports = function(fn, length) {
- length = toPosInt(length);
- if (fn.length === length) {
- return fn;
- }
- desc.value = length;
- return defineProperty(fn, 'length', desc);
- };
- } else {
- mixin = require_mixin();
- generate = function() {
- var cache2 = [];
- return function(length) {
- var args, i = 0;
- if (cache2[length]) {
- return cache2[length];
- }
- args = [];
- while (length--) {
- args.push('a' + (++i).toString(36));
- }
- return new Function('fn', 'return function (' + args.join(', ') + ') { return fn.apply(this, arguments); };');
- };
- }();
- module.exports = function(src, length) {
- var target;
- length = toPosInt(length);
- if (src.length === length) {
- return src;
- }
- target = generate(length)(src);
- try {
- mixin(target, src);
- } catch (ignore) {}
- return target;
- };
- }
- });
- var require_is = __commonJS(function(exports, module) {
- 'use strict';
- var _undefined = void 0;
- module.exports = function(value) {
- return value !== _undefined && value !== null;
- };
- });
- var require_is2 = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is();
- var possibleTypes = {
- object: true,
- function: true,
- undefined: true
- };
- module.exports = function(value) {
- if (!isValue(value)) {
- return false;
- }
- return hasOwnProperty.call(possibleTypes, _typeof(value));
- };
- });
- var require_is3 = __commonJS(function(exports, module) {
- 'use strict';
- var isObject = require_is2();
- module.exports = function(value) {
- if (!isObject(value)) {
- return false;
- }
- try {
- if (!value.constructor) {
- return false;
- }
- return value.constructor.prototype === value;
- } catch (error) {
- return false;
- }
- };
- });
- var require_is4 = __commonJS(function(exports, module) {
- 'use strict';
- var isPrototype = require_is3();
- module.exports = function(value) {
- if (typeof value !== 'function') {
- return false;
- }
- if (!hasOwnProperty.call(value, 'length')) {
- return false;
- }
- try {
- if (typeof value.length !== 'number') {
- return false;
- }
- if (typeof value.call !== 'function') {
- return false;
- }
- if (typeof value.apply !== 'function') {
- return false;
- }
- } catch (error) {
- return false;
- }
- return !isPrototype(value);
- };
- });
- var require_is5 = __commonJS(function(exports, module) {
- 'use strict';
- var isFunction = require_is4();
- var classRe = /^\s*class[\s{/}]/;
- var functionToString = Function.prototype.toString;
- module.exports = function(value) {
- if (!isFunction(value)) {
- return false;
- }
- if (classRe.test(functionToString.call(value))) {
- return false;
- }
- return true;
- };
- });
- var require_is_implemented4 = __commonJS(function(exports, module) {
- 'use strict';
- var str = 'razdwatrzy';
- module.exports = function() {
- if (typeof str.contains !== 'function') {
- return false;
- }
- return str.contains('dwa') === true && str.contains('foo') === false;
- };
- });
- var require_shim4 = __commonJS(function(exports, module) {
- 'use strict';
- var indexOf = String.prototype.indexOf;
- module.exports = function(searchString) {
- return indexOf.call(this, searchString, arguments[1]) > -1;
- };
- });
- var require_contains = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented4()() ? String.prototype.contains : require_shim4();
- });
- var require_d = __commonJS(function(exports, module) {
- 'use strict';
- var isValue = require_is();
- var isPlainFunction = require_is5();
- var assign = require_assign();
- var normalizeOpts = require_normalize_options();
- var contains3 = require_contains();
- var d = module.exports = function(dscr, value) {
- var c, e, w, options, desc;
- if (arguments.length < 2 || typeof dscr !== 'string') {
- options = value;
- value = dscr;
- dscr = null;
- } else {
- options = arguments[2];
- }
- if (isValue(dscr)) {
- c = contains3.call(dscr, 'c');
- e = contains3.call(dscr, 'e');
- w = contains3.call(dscr, 'w');
- } else {
- c = w = true;
- e = false;
- }
- desc = {
- value: value,
- configurable: c,
- enumerable: e,
- writable: w
- };
- return !options ? desc : assign(normalizeOpts(options), desc);
- };
- d.gs = function(dscr, get, set) {
- var c, e, options, desc;
- if (typeof dscr !== 'string') {
- options = set;
- set = get;
- get = dscr;
- dscr = null;
- } else {
- options = arguments[3];
- }
- if (!isValue(get)) {
- get = void 0;
- } else if (!isPlainFunction(get)) {
- options = get;
- get = set = void 0;
- } else if (!isValue(set)) {
- set = void 0;
- } else if (!isPlainFunction(set)) {
- options = set;
- set = void 0;
- }
- if (isValue(dscr)) {
- c = contains3.call(dscr, 'c');
- e = contains3.call(dscr, 'e');
- } else {
- c = true;
- e = false;
- }
- desc = {
- get: get,
- set: set,
- configurable: c,
- enumerable: e
- };
- return !options ? desc : assign(normalizeOpts(options), desc);
- };
- });
- var require_event_emitter = __commonJS(function(exports, module) {
- 'use strict';
- var d = require_d();
- var callable = require_valid_callable();
- var apply = Function.prototype.apply;
- var call = Function.prototype.call;
- var create = Object.create;
- var defineProperty = Object.defineProperty;
- var defineProperties = Object.defineProperties;
- var hasOwnProperty2 = Object.prototype.hasOwnProperty;
- var descriptor = {
- configurable: true,
- enumerable: false,
- writable: true
- };
- var on;
- var once;
- var off;
- var emit;
- var methods;
- var descriptors;
- var base;
- on = function on(type, listener) {
- var data2;
- callable(listener);
- if (!hasOwnProperty2.call(this, '__ee__')) {
- data2 = descriptor.value = create(null);
- defineProperty(this, '__ee__', descriptor);
- descriptor.value = null;
- } else {
- data2 = this.__ee__;
- }
- if (!data2[type]) {
- data2[type] = listener;
- } else if (_typeof(data2[type]) === 'object') {
- data2[type].push(listener);
- } else {
- data2[type] = [ data2[type], listener ];
- }
- return this;
- };
- once = function once(type, listener) {
- var _once, self2;
- callable(listener);
- self2 = this;
- on.call(this, type, _once = function once2() {
- off.call(self2, type, _once);
- apply.call(listener, this, arguments);
- });
- _once.__eeOnceListener__ = listener;
- return this;
- };
- off = function off(type, listener) {
- var data2, listeners, candidate, i;
- callable(listener);
- if (!hasOwnProperty2.call(this, '__ee__')) {
- return this;
- }
- data2 = this.__ee__;
- if (!data2[type]) {
- return this;
- }
- listeners = data2[type];
- if (_typeof(listeners) === 'object') {
- for (i = 0; candidate = listeners[i]; ++i) {
- if (candidate === listener || candidate.__eeOnceListener__ === listener) {
- if (listeners.length === 2) {
- data2[type] = listeners[i ? 0 : 1];
- } else {
- listeners.splice(i, 1);
- }
- }
- }
- } else {
- if (listeners === listener || listeners.__eeOnceListener__ === listener) {
- delete data2[type];
- }
- }
- return this;
- };
- emit = function emit(type) {
- var i, l, listener, listeners, args;
- if (!hasOwnProperty2.call(this, '__ee__')) {
- return;
- }
- listeners = this.__ee__[type];
- if (!listeners) {
- return;
- }
- if (_typeof(listeners) === 'object') {
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) {
- args[i - 1] = arguments[i];
- }
- listeners = listeners.slice();
- for (i = 0; listener = listeners[i]; ++i) {
- apply.call(listener, this, args);
- }
- } else {
- switch (arguments.length) {
- case 1:
- call.call(listeners, this);
- break;
- case 2:
- call.call(listeners, this, arguments[1]);
- break;
- case 3:
- call.call(listeners, this, arguments[1], arguments[2]);
- break;
- default:
- l = arguments.length;
- args = new Array(l - 1);
- for (i = 1; i < l; ++i) {
- args[i - 1] = arguments[i];
- }
- apply.call(listeners, this, args);
- }
- }
- };
- methods = {
- on: on,
- once: once,
- off: off,
- emit: emit
- };
- descriptors = {
- on: d(on),
- once: d(once),
- off: d(off),
- emit: d(emit)
- };
- base = defineProperties({}, descriptors);
- module.exports = exports = function exports(o) {
- return o == null ? create(base) : defineProperties(Object(o), descriptors);
- };
- exports.methods = methods;
- });
- var require_is_implemented5 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- var from = Array.from, arr, result;
- if (typeof from !== 'function') {
- return false;
- }
- arr = [ 'raz', 'dwa' ];
- result = from(arr);
- return Boolean(result && result !== arr && result[1] === 'dwa');
- };
- });
- var require_is_implemented6 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) !== 'object') {
- return false;
- }
- if (!globalThis) {
- return false;
- }
- return globalThis.Array === Array;
- };
- });
- var require_implementation = __commonJS(function(exports, module) {
- var naiveFallback = function naiveFallback() {
- if ((typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self) {
- return self;
- }
- if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window) {
- return window;
- }
- throw new Error('Unable to resolve global `this`');
- };
- module.exports = function() {
- if (this) {
- return this;
- }
- try {
- Object.defineProperty(Object.prototype, '__global__', {
- get: function get() {
- return this;
- },
- configurable: true
- });
- } catch (error) {
- return naiveFallback();
- }
- try {
- if (!__global__) {
- return naiveFallback();
- }
- return __global__;
- } finally {
- delete Object.prototype.__global__;
- }
- }();
- });
- var require_global_this = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented6()() ? globalThis : require_implementation();
- });
- var require_is_implemented7 = __commonJS(function(exports, module) {
- 'use strict';
- var global2 = require_global_this();
- var validTypes = {
- object: true,
- symbol: true
- };
- module.exports = function() {
- var _Symbol = global2.Symbol;
- var symbol;
- if (typeof _Symbol !== 'function') {
- return false;
- }
- symbol = _Symbol('test symbol');
- try {
- String(symbol);
- } catch (e) {
- return false;
- }
- if (!validTypes[_typeof(_Symbol.iterator)]) {
- return false;
- }
- if (!validTypes[_typeof(_Symbol.toPrimitive)]) {
- return false;
- }
- if (!validTypes[_typeof(_Symbol.toStringTag)]) {
- return false;
- }
- return true;
- };
- });
- var require_is_symbol = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(value) {
- if (!value) {
- return false;
- }
- if (_typeof(value) === 'symbol') {
- return true;
- }
- if (!value.constructor) {
- return false;
- }
- if (value.constructor.name !== 'Symbol') {
- return false;
- }
- return value[value.constructor.toStringTag] === 'Symbol';
- };
- });
- var require_validate_symbol = __commonJS(function(exports, module) {
- 'use strict';
- var isSymbol = require_is_symbol();
- module.exports = function(value) {
- if (!isSymbol(value)) {
- throw new TypeError(value + ' is not a symbol');
- }
- return value;
- };
- });
- var require_generate_name = __commonJS(function(exports, module) {
- 'use strict';
- var d = require_d();
- var create = Object.create;
- var defineProperty = Object.defineProperty;
- var objPrototype = Object.prototype;
- var created = create(null);
- module.exports = function(desc) {
- var postfix = 0, name, ie11BugWorkaround;
- while (created[desc + (postfix || '')]) {
- ++postfix;
- }
- desc += postfix || '';
- created[desc] = true;
- name = '@@' + desc;
- defineProperty(objPrototype, name, d.gs(null, function(value) {
- if (ie11BugWorkaround) {
- return;
- }
- ie11BugWorkaround = true;
- defineProperty(this, name, d(value));
- ie11BugWorkaround = false;
- }));
- return name;
- };
- });
- var require_standard_symbols = __commonJS(function(exports, module) {
- 'use strict';
- var d = require_d();
- var NativeSymbol = require_global_this().Symbol;
- module.exports = function(SymbolPolyfill) {
- return Object.defineProperties(SymbolPolyfill, {
- hasInstance: d('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')),
- isConcatSpreadable: d('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')),
- iterator: d('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')),
- match: d('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')),
- replace: d('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')),
- search: d('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')),
- species: d('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')),
- split: d('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')),
- toPrimitive: d('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')),
- toStringTag: d('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')),
- unscopables: d('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables'))
- });
- };
- });
- var require_symbol_registry = __commonJS(function(exports, module) {
- 'use strict';
- var d = require_d();
- var validateSymbol = require_validate_symbol();
- var registry = Object.create(null);
- module.exports = function(SymbolPolyfill) {
- return Object.defineProperties(SymbolPolyfill, {
- for: d(function(key) {
- if (registry[key]) {
- return registry[key];
- }
- return registry[key] = SymbolPolyfill(String(key));
- }),
- keyFor: d(function(symbol) {
- var key;
- validateSymbol(symbol);
- for (key in registry) {
- if (registry[key] === symbol) {
- return key;
- }
- }
- return void 0;
- })
- });
- };
- });
- var require_polyfill = __commonJS(function(exports, module) {
- 'use strict';
- var d = require_d();
- var validateSymbol = require_validate_symbol();
- var NativeSymbol = require_global_this().Symbol;
- var generateName = require_generate_name();
- var setupStandardSymbols = require_standard_symbols();
- var setupSymbolRegistry = require_symbol_registry();
- var create = Object.create;
- var defineProperties = Object.defineProperties;
- var defineProperty = Object.defineProperty;
- var SymbolPolyfill;
- var HiddenSymbol;
- var isNativeSafe;
- if (typeof NativeSymbol === 'function') {
- try {
- String(NativeSymbol());
- isNativeSafe = true;
- } catch (ignore) {}
- } else {
- NativeSymbol = null;
- }
- HiddenSymbol = function _Symbol2(description) {
- if (this instanceof HiddenSymbol) {
- throw new TypeError('Symbol is not a constructor');
- }
- return SymbolPolyfill(description);
- };
- module.exports = SymbolPolyfill = function _Symbol3(description) {
- var symbol;
- if (this instanceof _Symbol3) {
- throw new TypeError('Symbol is not a constructor');
- }
- if (isNativeSafe) {
- return NativeSymbol(description);
- }
- symbol = create(HiddenSymbol.prototype);
- description = description === void 0 ? '' : String(description);
- return defineProperties(symbol, {
- __description__: d('', description),
- __name__: d('', generateName(description))
- });
- };
- setupStandardSymbols(SymbolPolyfill);
- setupSymbolRegistry(SymbolPolyfill);
- defineProperties(HiddenSymbol.prototype, {
- constructor: d(SymbolPolyfill),
- toString: d('', function() {
- return this.__name__;
- })
- });
- defineProperties(SymbolPolyfill.prototype, {
- toString: d(function() {
- return 'Symbol (' + validateSymbol(this).__description__ + ')';
- }),
- valueOf: d(function() {
- return validateSymbol(this);
- })
- });
- defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function() {
- var symbol = validateSymbol(this);
- if (_typeof(symbol) === 'symbol') {
- return symbol;
- }
- return symbol.toString();
- }));
- defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
- defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
- defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
- });
- var require_es6_symbol = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented7()() ? require_global_this().Symbol : require_polyfill();
- });
- var require_is_arguments = __commonJS(function(exports, module) {
- 'use strict';
- var objToString = Object.prototype.toString;
- var id = objToString.call(function() {
- return arguments;
- }());
- module.exports = function(value) {
- return objToString.call(value) === id;
- };
- });
- var require_is_function = __commonJS(function(exports, module) {
- 'use strict';
- var objToString = Object.prototype.toString;
- var isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
- module.exports = function(value) {
- return typeof value === 'function' && isFunctionStringTag(objToString.call(value));
- };
- });
- var require_is_string = __commonJS(function(exports, module) {
- 'use strict';
- var objToString = Object.prototype.toString;
- var id = objToString.call('');
- module.exports = function(value) {
- return typeof value === 'string' || value && _typeof(value) === 'object' && (value instanceof String || objToString.call(value) === id) || false;
- };
- });
- var require_shim5 = __commonJS(function(exports, module) {
- 'use strict';
- var iteratorSymbol = require_es6_symbol().iterator;
- var isArguments = require_is_arguments();
- var isFunction = require_is_function();
- var toPosInt = require_to_pos_integer();
- var callable = require_valid_callable();
- var validValue = require_valid_value();
- var isValue = require_is_value();
- var isString = require_is_string();
- var isArray = Array.isArray;
- var call = Function.prototype.call;
- var desc = {
- configurable: true,
- enumerable: true,
- writable: true,
- value: null
- };
- var defineProperty = Object.defineProperty;
- module.exports = function(arrayLike) {
- var mapFn = arguments[1], thisArg = arguments[2], Context2, i, j, arr, length, code, iterator, result, getIterator, value;
- arrayLike = Object(validValue(arrayLike));
- if (isValue(mapFn)) {
- callable(mapFn);
- }
- if (!this || this === Array || !isFunction(this)) {
- if (!mapFn) {
- if (isArguments(arrayLike)) {
- length = arrayLike.length;
- if (length !== 1) {
- return Array.apply(null, arrayLike);
- }
- arr = new Array(1);
- arr[0] = arrayLike[0];
- return arr;
- }
- if (isArray(arrayLike)) {
- arr = new Array(length = arrayLike.length);
- for (i = 0; i < length; ++i) {
- arr[i] = arrayLike[i];
- }
- return arr;
- }
- }
- arr = [];
- } else {
- Context2 = this;
- }
- if (!isArray(arrayLike)) {
- if ((getIterator = arrayLike[iteratorSymbol]) !== void 0) {
- iterator = callable(getIterator).call(arrayLike);
- if (Context2) {
- arr = new Context2();
- }
- result = iterator.next();
- i = 0;
- while (!result.done) {
- value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
- if (Context2) {
- desc.value = value;
- defineProperty(arr, i, desc);
- } else {
- arr[i] = value;
- }
- result = iterator.next();
- ++i;
- }
- length = i;
- } else if (isString(arrayLike)) {
- length = arrayLike.length;
- if (Context2) {
- arr = new Context2();
- }
- for (i = 0, j = 0; i < length; ++i) {
- value = arrayLike[i];
- if (i + 1 < length) {
- code = value.charCodeAt(0);
- if (code >= 55296 && code <= 56319) {
- value += arrayLike[++i];
- }
- }
- value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
- if (Context2) {
- desc.value = value;
- defineProperty(arr, j, desc);
- } else {
- arr[j] = value;
- }
- ++j;
- }
- length = j;
- }
- }
- if (length === void 0) {
- length = toPosInt(arrayLike.length);
- if (Context2) {
- arr = new Context2(length);
- }
- for (i = 0; i < length; ++i) {
- value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
- if (Context2) {
- desc.value = value;
- defineProperty(arr, i, desc);
- } else {
- arr[i] = value;
- }
- }
- }
- if (Context2) {
- desc.value = null;
- arr.length = length;
- }
- return arr;
- };
- });
- var require_from = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented5()() ? Array.from : require_shim5();
- });
- var require_to_array = __commonJS(function(exports, module) {
- 'use strict';
- var from = require_from();
- var isArray = Array.isArray;
- module.exports = function(arrayLike) {
- return isArray(arrayLike) ? arrayLike : from(arrayLike);
- };
- });
- var require_resolve_resolve = __commonJS(function(exports, module) {
- 'use strict';
- var toArray2 = require_to_array();
- var isValue = require_is_value();
- var callable = require_valid_callable();
- var slice = Array.prototype.slice;
- var resolveArgs;
- resolveArgs = function resolveArgs(args) {
- return this.map(function(resolve, i) {
- return resolve ? resolve(args[i]) : args[i];
- }).concat(slice.call(args, this.length));
- };
- module.exports = function(resolvers) {
- resolvers = toArray2(resolvers);
- resolvers.forEach(function(resolve) {
- if (isValue(resolve)) {
- callable(resolve);
- }
- });
- return resolveArgs.bind(resolvers);
- };
- });
- var require_resolve_normalize = __commonJS(function(exports, module) {
- 'use strict';
- var callable = require_valid_callable();
- module.exports = function(userNormalizer) {
- var normalizer;
- if (typeof userNormalizer === 'function') {
- return {
- set: userNormalizer,
- get: userNormalizer
- };
- }
- normalizer = {
- get: callable(userNormalizer.get)
- };
- if (userNormalizer.set !== void 0) {
- normalizer.set = callable(userNormalizer.set);
- if (userNormalizer['delete']) {
- normalizer['delete'] = callable(userNormalizer['delete']);
- }
- if (userNormalizer.clear) {
- normalizer.clear = callable(userNormalizer.clear);
- }
- return normalizer;
- }
- normalizer.set = normalizer.get;
- return normalizer;
- };
- });
- var require_configure_map = __commonJS(function(exports, module) {
- 'use strict';
- var customError = require_custom();
- var defineLength = require_define_length();
- var d = require_d();
- var ee = require_event_emitter().methods;
- var resolveResolve = require_resolve_resolve();
- var resolveNormalize = require_resolve_normalize();
- var apply = Function.prototype.apply;
- var call = Function.prototype.call;
- var create = Object.create;
- var defineProperties = Object.defineProperties;
- var _on = ee.on;
- var emit = ee.emit;
- module.exports = function(original, length, options) {
- var cache2 = create(null), conf, memLength, _get, set, del, _clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve;
- if (length !== false) {
- memLength = length;
- } else if (isNaN(original.length)) {
- memLength = 1;
- } else {
- memLength = original.length;
- }
- if (options.normalizer) {
- normalizer = resolveNormalize(options.normalizer);
- _get = normalizer.get;
- set = normalizer.set;
- del = normalizer['delete'];
- _clear = normalizer.clear;
- }
- if (options.resolvers != null) {
- resolve = resolveResolve(options.resolvers);
- }
- if (_get) {
- memoized = defineLength(function(arg) {
- var id, result, args = arguments;
- if (resolve) {
- args = resolve(args);
- }
- id = _get(args);
- if (id !== null) {
- if (hasOwnProperty.call(cache2, id)) {
- if (getListeners) {
- conf.emit('get', id, args, this);
- }
- return cache2[id];
- }
- }
- if (args.length === 1) {
- result = call.call(original, this, args[0]);
- } else {
- result = apply.call(original, this, args);
- }
- if (id === null) {
- id = _get(args);
- if (id !== null) {
- throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
- }
- id = set(args);
- } else if (hasOwnProperty.call(cache2, id)) {
- throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
- }
- cache2[id] = result;
- if (setListeners) {
- conf.emit('set', id, null, result);
- }
- return result;
- }, memLength);
- } else if (length === 0) {
- memoized = function memoized() {
- var result;
- if (hasOwnProperty.call(cache2, 'data')) {
- if (getListeners) {
- conf.emit('get', 'data', arguments, this);
- }
- return cache2.data;
- }
- if (arguments.length) {
- result = apply.call(original, this, arguments);
- } else {
- result = call.call(original, this);
- }
- if (hasOwnProperty.call(cache2, 'data')) {
- throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
- }
- cache2.data = result;
- if (setListeners) {
- conf.emit('set', 'data', null, result);
- }
- return result;
- };
- } else {
- memoized = function memoized(arg) {
- var result, args = arguments, id;
- if (resolve) {
- args = resolve(arguments);
- }
- id = String(args[0]);
- if (hasOwnProperty.call(cache2, id)) {
- if (getListeners) {
- conf.emit('get', id, args, this);
- }
- return cache2[id];
- }
- if (args.length === 1) {
- result = call.call(original, this, args[0]);
- } else {
- result = apply.call(original, this, args);
- }
- if (hasOwnProperty.call(cache2, id)) {
- throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
- }
- cache2[id] = result;
- if (setListeners) {
- conf.emit('set', id, null, result);
- }
- return result;
- };
- }
- conf = {
- original: original,
- memoized: memoized,
- profileName: options.profileName,
- get: function get(args) {
- if (resolve) {
- args = resolve(args);
- }
- if (_get) {
- return _get(args);
- }
- return String(args[0]);
- },
- has: function has(id) {
- return hasOwnProperty.call(cache2, id);
- },
- delete: function _delete(id) {
- var result;
- if (!hasOwnProperty.call(cache2, id)) {
- return;
- }
- if (del) {
- del(id);
- }
- result = cache2[id];
- delete cache2[id];
- if (deleteListeners) {
- conf.emit('delete', id, result);
- }
- },
- clear: function clear() {
- var oldCache = cache2;
- if (_clear) {
- _clear();
- }
- cache2 = create(null);
- conf.emit('clear', oldCache);
- },
- on: function on(type, listener) {
- if (type === 'get') {
- getListeners = true;
- } else if (type === 'set') {
- setListeners = true;
- } else if (type === 'delete') {
- deleteListeners = true;
- }
- return _on.call(this, type, listener);
- },
- emit: emit,
- updateEnv: function updateEnv() {
- original = conf.original;
- }
- };
- if (_get) {
- extDel = defineLength(function(arg) {
- var id, args = arguments;
- if (resolve) {
- args = resolve(args);
- }
- id = _get(args);
- if (id === null) {
- return;
- }
- conf['delete'](id);
- }, memLength);
- } else if (length === 0) {
- extDel = function extDel() {
- return conf['delete']('data');
- };
- } else {
- extDel = function extDel(arg) {
- if (resolve) {
- arg = resolve(arguments)[0];
- }
- return conf['delete'](arg);
- };
- }
- extGet = defineLength(function() {
- var id, args = arguments;
- if (length === 0) {
- return cache2.data;
- }
- if (resolve) {
- args = resolve(args);
- }
- if (_get) {
- id = _get(args);
- } else {
- id = String(args[0]);
- }
- return cache2[id];
- });
- extHas = defineLength(function() {
- var id, args = arguments;
- if (length === 0) {
- return conf.has('data');
- }
- if (resolve) {
- args = resolve(args);
- }
- if (_get) {
- id = _get(args);
- } else {
- id = String(args[0]);
- }
- if (id === null) {
- return false;
- }
- return conf.has(id);
- });
- defineProperties(memoized, {
- __memoized__: d(true),
- delete: d(extDel),
- clear: d(conf.clear),
- _get: d(extGet),
- _has: d(extHas)
- });
- return conf;
- };
- });
- var require_plain = __commonJS(function(exports, module) {
- 'use strict';
- var callable = require_valid_callable();
- var forEach = require_for_each();
- var extensions = require_registered_extensions();
- var configure4 = require_configure_map();
- var resolveLength = require_resolve_length();
- module.exports = function self2(fn) {
- var options, length, conf;
- callable(fn);
- options = Object(arguments[1]);
- if (options.async && options.promise) {
- throw new Error('Options \'async\' and \'promise\' cannot be used together');
- }
- if (hasOwnProperty.call(fn, '__memoized__') && !options.force) {
- return fn;
- }
- length = resolveLength(options.length, fn.length, options.async && extensions.async);
- conf = configure4(fn, length, options);
- forEach(extensions, function(extFn, name) {
- if (options[name]) {
- extFn(options[name], conf, options);
- }
- });
- if (self2.__profiler__) {
- self2.__profiler__(conf);
- }
- conf.updateEnv();
- return conf.memoized;
- };
- });
- var require_primitive = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(args) {
- var id, i, length = args.length;
- if (!length) {
- return '\x02';
- }
- id = String(args[i = 0]);
- while (--length) {
- id += '\x01' + args[++i];
- }
- return id;
- };
- });
- var require_get_primitive_fixed = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(length) {
- if (!length) {
- return function() {
- return '';
- };
- }
- return function(args) {
- var id = String(args[0]), i = 0, currentLength = length;
- while (--currentLength) {
- id += '\x01' + args[++i];
- }
- return id;
- };
- };
- });
- var require_is_implemented8 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function() {
- var numberIsNaN = Number.isNaN;
- if (typeof numberIsNaN !== 'function') {
- return false;
- }
- return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
- };
- });
- var require_shim6 = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(value) {
- return value !== value;
- };
- });
- var require_is_nan = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = require_is_implemented8()() ? Number.isNaN : require_shim6();
- });
- var require_e_index_of = __commonJS(function(exports, module) {
- 'use strict';
- var numberIsNaN = require_is_nan();
- var toPosInt = require_to_pos_integer();
- var value = require_valid_value();
- var indexOf = Array.prototype.indexOf;
- var objHasOwnProperty = Object.prototype.hasOwnProperty;
- var abs = Math.abs;
- var floor = Math.floor;
- module.exports = function(searchElement) {
- var i, length, fromIndex, val;
- if (!numberIsNaN(searchElement)) {
- return indexOf.apply(this, arguments);
- }
- length = toPosInt(value(this).length);
- fromIndex = arguments[1];
- if (isNaN(fromIndex)) {
- fromIndex = 0;
- } else if (fromIndex >= 0) {
- fromIndex = floor(fromIndex);
- } else {
- fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
- }
- for (i = fromIndex; i < length; ++i) {
- if (objHasOwnProperty.call(this, i)) {
- val = this[i];
- if (numberIsNaN(val)) {
- return i;
- }
- }
- }
- return -1;
- };
- });
- var require_get = __commonJS(function(exports, module) {
- 'use strict';
- var indexOf = require_e_index_of();
- var create = Object.create;
- module.exports = function() {
- var lastId = 0, map = [], cache2 = create(null);
- return {
- get: function get(args) {
- var index = 0, set = map, i, length = args.length;
- if (length === 0) {
- return set[length] || null;
- }
- if (set = set[length]) {
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return null;
- }
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return null;
- }
- return set[1][i] || null;
- }
- return null;
- },
- set: function set(args) {
- var index = 0, set = map, i, length = args.length;
- if (length === 0) {
- set[length] = ++lastId;
- } else {
- if (!set[length]) {
- set[length] = [ [], [] ];
- }
- set = set[length];
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- i = set[0].push(args[index]) - 1;
- set[1].push([ [], [] ]);
- }
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- i = set[0].push(args[index]) - 1;
- }
- set[1][i] = ++lastId;
- }
- cache2[lastId] = args;
- return lastId;
- },
- delete: function _delete(id) {
- var index = 0, set = map, i, args = cache2[id], length = args.length, path = [];
- if (length === 0) {
- delete set[length];
- } else if (set = set[length]) {
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return;
- }
- path.push(set, i);
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return;
- }
- id = set[1][i];
- set[0].splice(i, 1);
- set[1].splice(i, 1);
- while (!set[0].length && path.length) {
- i = path.pop();
- set = path.pop();
- set[0].splice(i, 1);
- set[1].splice(i, 1);
- }
- }
- delete cache2[id];
- },
- clear: function clear() {
- map = [];
- cache2 = create(null);
- }
- };
- };
- });
- var require_get_1 = __commonJS(function(exports, module) {
- 'use strict';
- var indexOf = require_e_index_of();
- module.exports = function() {
- var lastId = 0, argsMap = [], cache2 = [];
- return {
- get: function get(args) {
- var index = indexOf.call(argsMap, args[0]);
- return index === -1 ? null : cache2[index];
- },
- set: function set(args) {
- argsMap.push(args[0]);
- cache2.push(++lastId);
- return lastId;
- },
- delete: function _delete(id) {
- var index = indexOf.call(cache2, id);
- if (index !== -1) {
- argsMap.splice(index, 1);
- cache2.splice(index, 1);
- }
- },
- clear: function clear() {
- argsMap = [];
- cache2 = [];
- }
- };
- };
- });
- var require_get_fixed = __commonJS(function(exports, module) {
- 'use strict';
- var indexOf = require_e_index_of();
- var create = Object.create;
- module.exports = function(length) {
- var lastId = 0, map = [ [], [] ], cache2 = create(null);
- return {
- get: function get(args) {
- var index = 0, set = map, i;
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return null;
- }
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return null;
- }
- return set[1][i] || null;
- },
- set: function set(args) {
- var index = 0, set = map, i;
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- i = set[0].push(args[index]) - 1;
- set[1].push([ [], [] ]);
- }
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- i = set[0].push(args[index]) - 1;
- }
- set[1][i] = ++lastId;
- cache2[lastId] = args;
- return lastId;
- },
- delete: function _delete(id) {
- var index = 0, set = map, i, path = [], args = cache2[id];
- while (index < length - 1) {
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return;
- }
- path.push(set, i);
- set = set[1][i];
- ++index;
- }
- i = indexOf.call(set[0], args[index]);
- if (i === -1) {
- return;
- }
- id = set[1][i];
- set[0].splice(i, 1);
- set[1].splice(i, 1);
- while (!set[0].length && path.length) {
- i = path.pop();
- set = path.pop();
- set[0].splice(i, 1);
- set[1].splice(i, 1);
- }
- delete cache2[id];
- },
- clear: function clear() {
- map = [ [], [] ];
- cache2 = create(null);
- }
- };
- };
- });
- var require_map = __commonJS(function(exports, module) {
- 'use strict';
- var callable = require_valid_callable();
- var forEach = require_for_each();
- var call = Function.prototype.call;
- module.exports = function(obj, cb) {
- var result = {}, thisArg = arguments[2];
- callable(cb);
- forEach(obj, function(value, key, targetObj, index) {
- result[key] = call.call(cb, thisArg, value, key, targetObj, index);
- });
- return result;
- };
- });
- var require_next_tick = __commonJS(function(exports, module) {
- 'use strict';
- var ensureCallable = function ensureCallable(fn) {
- if (typeof fn !== 'function') {
- throw new TypeError(fn + ' is not a function');
- }
- return fn;
- };
- var byObserver = function byObserver(Observer) {
- var node = document.createTextNode(''), queue2, currentQueue, i = 0;
- new Observer(function() {
- var callback;
- if (!queue2) {
- if (!currentQueue) {
- return;
- }
- queue2 = currentQueue;
- } else if (currentQueue) {
- queue2 = currentQueue.concat(queue2);
- }
- currentQueue = queue2;
- queue2 = null;
- if (typeof currentQueue === 'function') {
- callback = currentQueue;
- currentQueue = null;
- callback();
- return;
- }
- node.data = i = ++i % 2;
- while (currentQueue) {
- callback = currentQueue.shift();
- if (!currentQueue.length) {
- currentQueue = null;
- }
- callback();
- }
- }).observe(node, {
- characterData: true
- });
- return function(fn) {
- ensureCallable(fn);
- if (queue2) {
- if (typeof queue2 === 'function') {
- queue2 = [ queue2, fn ];
- } else {
- queue2.push(fn);
- }
- return;
- }
- queue2 = fn;
- node.data = i = ++i % 2;
- };
- };
- module.exports = function() {
- if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
- return process.nextTick;
- }
- if (typeof queueMicrotask === 'function') {
- return function(cb) {
- queueMicrotask(ensureCallable(cb));
- };
- }
- if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
- if (typeof MutationObserver === 'function') {
- return byObserver(MutationObserver);
- }
- if (typeof WebKitMutationObserver === 'function') {
- return byObserver(WebKitMutationObserver);
- }
- }
- if (typeof setImmediate === 'function') {
- return function(cb) {
- setImmediate(ensureCallable(cb));
- };
- }
- if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
- return function(cb) {
- setTimeout(ensureCallable(cb), 0);
- };
- }
- return null;
- }();
- });
- var require_async = __commonJS(function() {
- 'use strict';
- var aFrom = require_from();
- var objectMap = require_map();
- var mixin = require_mixin();
- var defineLength = require_define_length();
- var nextTick = require_next_tick();
- var slice = Array.prototype.slice;
- var apply = Function.prototype.apply;
- var create = Object.create;
- require_registered_extensions().async = function(tbi, conf) {
- var waiting = create(null), cache2 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
- conf.memoized = defineLength(function(arg) {
- var args = arguments, last = args[args.length - 1];
- if (typeof last === 'function') {
- currentCallback = last;
- args = slice.call(args, 0, -1);
- }
- return base.apply(currentContext = this, currentArgs = args);
- }, base);
- try {
- mixin(conf.memoized, base);
- } catch (ignore) {}
- conf.on('get', function(id) {
- var cb, context, args;
- if (!currentCallback) {
- return;
- }
- if (waiting[id]) {
- if (typeof waiting[id] === 'function') {
- waiting[id] = [ waiting[id], currentCallback ];
- } else {
- waiting[id].push(currentCallback);
- }
- currentCallback = null;
- return;
- }
- cb = currentCallback;
- context = currentContext;
- args = currentArgs;
- currentCallback = currentContext = currentArgs = null;
- nextTick(function() {
- var data2;
- if (hasOwnProperty.call(cache2, id)) {
- data2 = cache2[id];
- conf.emit('getasync', id, args, context);
- apply.call(cb, data2.context, data2.args);
- } else {
- currentCallback = cb;
- currentContext = context;
- currentArgs = args;
- base.apply(context, args);
- }
- });
- });
- conf.original = function() {
- var args, cb, origCb, result;
- if (!currentCallback) {
- return apply.call(original, this, arguments);
- }
- args = aFrom(arguments);
- cb = function self2(err2) {
- var cb2, args2, id = self2.id;
- if (id == null) {
- nextTick(apply.bind(self2, this, arguments));
- return void 0;
- }
- delete self2.id;
- cb2 = waiting[id];
- delete waiting[id];
- if (!cb2) {
- return void 0;
- }
- args2 = aFrom(arguments);
- if (conf.has(id)) {
- if (err2) {
- conf['delete'](id);
- } else {
- cache2[id] = {
- context: this,
- args: args2
- };
- conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
- }
- }
- if (typeof cb2 === 'function') {
- result = apply.call(cb2, this, args2);
- } else {
- cb2.forEach(function(cb3) {
- result = apply.call(cb3, this, args2);
- }, this);
- }
- return result;
- };
- origCb = currentCallback;
- currentCallback = currentContext = currentArgs = null;
- args.push(cb);
- result = apply.call(original, this, args);
- cb.cb = origCb;
- currentCallback = cb;
- return result;
- };
- conf.on('set', function(id) {
- if (!currentCallback) {
- conf['delete'](id);
- return;
- }
- if (waiting[id]) {
- if (typeof waiting[id] === 'function') {
- waiting[id] = [ waiting[id], currentCallback.cb ];
- } else {
- waiting[id].push(currentCallback.cb);
- }
- } else {
- waiting[id] = currentCallback.cb;
- }
- delete currentCallback.cb;
- currentCallback.id = id;
- currentCallback = null;
- });
- conf.on('delete', function(id) {
- var result;
- if (hasOwnProperty.call(waiting, id)) {
- return;
- }
- if (!cache2[id]) {
- return;
- }
- result = cache2[id];
- delete cache2[id];
- conf.emit('deleteasync', id, slice.call(result.args, 1));
- });
- conf.on('clear', function() {
- var oldCache = cache2;
- cache2 = create(null);
- conf.emit('clearasync', objectMap(oldCache, function(data2) {
- return slice.call(data2.args, 1);
- }));
- });
- };
- });
- var require_primitive_set = __commonJS(function(exports, module) {
- 'use strict';
- var forEach = Array.prototype.forEach;
- var create = Object.create;
- module.exports = function(arg) {
- var set = create(null);
- forEach.call(arguments, function(name) {
- set[name] = true;
- });
- return set;
- };
- });
- var require_is_callable = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = function(obj) {
- return typeof obj === 'function';
- };
- });
- var require_validate_stringifiable = __commonJS(function(exports, module) {
- 'use strict';
- var isCallable = require_is_callable();
- module.exports = function(stringifiable) {
- try {
- if (stringifiable && isCallable(stringifiable.toString)) {
- return stringifiable.toString();
- }
- return String(stringifiable);
- } catch (e) {
- throw new TypeError('Passed argument cannot be stringifed');
- }
- };
- });
- var require_validate_stringifiable_value = __commonJS(function(exports, module) {
- 'use strict';
- var ensureValue = require_valid_value();
- var stringifiable = require_validate_stringifiable();
- module.exports = function(value) {
- return stringifiable(ensureValue(value));
- };
- });
- var require_safe_to_string = __commonJS(function(exports, module) {
- 'use strict';
- var isCallable = require_is_callable();
- module.exports = function(value) {
- try {
- if (value && isCallable(value.toString)) {
- return value.toString();
- }
- return String(value);
- } catch (e) {
- return '<Non-coercible to string value>';
- }
- };
- });
- var require_to_short_string_representation = __commonJS(function(exports, module) {
- 'use strict';
- var safeToString = require_safe_to_string();
- var reNewLine = /[\n\r\u2028\u2029]/g;
- module.exports = function(value) {
- var string = safeToString(value);
- if (string.length > 100) {
- string = string.slice(0, 99) + '\u2026';
- }
- string = string.replace(reNewLine, function(_char) {
- return JSON.stringify(_char).slice(1, -1);
- });
- return string;
- };
- });
- var require_is_promise = __commonJS(function(exports, module) {
- module.exports = isPromise;
- module.exports['default'] = isPromise;
- function isPromise(obj) {
- return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
- }
- });
- var require_promise = __commonJS(function() {
- 'use strict';
- var objectMap = require_map();
- var primitiveSet = require_primitive_set();
- var ensureString = require_validate_stringifiable_value();
- var toShortString = require_to_short_string_representation();
- var isPromise = require_is_promise();
- var nextTick = require_next_tick();
- var create = Object.create;
- var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
- require_registered_extensions().promise = function(mode, conf) {
- var waiting = create(null), cache2 = create(null), promises = create(null);
- if (mode === true) {
- mode = null;
- } else {
- mode = ensureString(mode);
- if (!supportedModes[mode]) {
- throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
- }
- }
- conf.on('set', function(id, ignore, promise) {
- var isFailed = false;
- if (!isPromise(promise)) {
- cache2[id] = promise;
- conf.emit('setasync', id, 1);
- return;
- }
- waiting[id] = 1;
- promises[id] = promise;
- var onSuccess = function onSuccess(result) {
- var count = waiting[id];
- if (isFailed) {
- 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.');
- }
- if (!count) {
- return;
- }
- delete waiting[id];
- cache2[id] = result;
- conf.emit('setasync', id, count);
- };
- var onFailure = function onFailure() {
- isFailed = true;
- if (!waiting[id]) {
- return;
- }
- delete waiting[id];
- delete promises[id];
- conf['delete'](id);
- };
- var resolvedMode = mode;
- if (!resolvedMode) {
- resolvedMode = 'then';
- }
- if (resolvedMode === 'then') {
- var nextTickFailure = function nextTickFailure() {
- nextTick(onFailure);
- };
- promise = promise.then(function(result) {
- nextTick(onSuccess.bind(this, result));
- }, nextTickFailure);
- if (typeof promise['finally'] === 'function') {
- promise['finally'](nextTickFailure);
- }
- } else if (resolvedMode === 'done') {
- if (typeof promise.done !== 'function') {
- throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
- }
- promise.done(onSuccess, onFailure);
- } else if (resolvedMode === 'done:finally') {
- if (typeof promise.done !== 'function') {
- throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
- }
- if (typeof promise['finally'] !== 'function') {
- throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
- }
- promise.done(onSuccess);
- promise['finally'](onFailure);
- }
- });
- conf.on('get', function(id, args, context) {
- var promise;
- if (waiting[id]) {
- ++waiting[id];
- return;
- }
- promise = promises[id];
- var emit = function emit() {
- conf.emit('getasync', id, args, context);
- };
- if (isPromise(promise)) {
- if (typeof promise.done === 'function') {
- promise.done(emit);
- } else {
- promise.then(function() {
- nextTick(emit);
- });
- }
- } else {
- emit();
- }
- });
- conf.on('delete', function(id) {
- delete promises[id];
- if (waiting[id]) {
- delete waiting[id];
- return;
- }
- if (!hasOwnProperty.call(cache2, id)) {
- return;
- }
- var result = cache2[id];
- delete cache2[id];
- conf.emit('deleteasync', id, [ result ]);
- });
- conf.on('clear', function() {
- var oldCache = cache2;
- cache2 = create(null);
- waiting = create(null);
- promises = create(null);
- conf.emit('clearasync', objectMap(oldCache, function(data2) {
- return [ data2 ];
- }));
- });
- };
- });
- var require_dispose = __commonJS(function() {
- 'use strict';
- var callable = require_valid_callable();
- var forEach = require_for_each();
- var extensions = require_registered_extensions();
- var apply = Function.prototype.apply;
- extensions.dispose = function(dispose, conf, options) {
- var del;
- callable(dispose);
- if (options.async && extensions.async || options.promise && extensions.promise) {
- conf.on('deleteasync', del = function del(id, resultArray) {
- apply.call(dispose, null, resultArray);
- });
- conf.on('clearasync', function(cache2) {
- forEach(cache2, function(result, id) {
- del(id, result);
- });
- });
- return;
- }
- conf.on('delete', del = function del(id, result) {
- dispose(result);
- });
- conf.on('clear', function(cache2) {
- forEach(cache2, function(result, id) {
- del(id, result);
- });
- });
- };
- });
- var require_max_timeout = __commonJS(function(exports, module) {
- 'use strict';
- module.exports = 2147483647;
- });
- var require_valid_timeout = __commonJS(function(exports, module) {
- 'use strict';
- var toPosInt = require_to_pos_integer();
- var maxTimeout = require_max_timeout();
- module.exports = function(value) {
- value = toPosInt(value);
- if (value > maxTimeout) {
- throw new TypeError(value + ' exceeds maximum possible timeout');
- }
- return value;
- };
- });
- var require_max_age = __commonJS(function() {
- 'use strict';
- var aFrom = require_from();
- var forEach = require_for_each();
- var nextTick = require_next_tick();
- var isPromise = require_is_promise();
- var timeout = require_valid_timeout();
- var extensions = require_registered_extensions();
- var noop3 = Function.prototype;
- var max = Math.max;
- var min = Math.min;
- var create = Object.create;
- extensions.maxAge = function(maxAge, conf, options) {
- var timeouts, postfix, preFetchAge, preFetchTimeouts;
- maxAge = timeout(maxAge);
- if (!maxAge) {
- return;
- }
- timeouts = create(null);
- postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
- conf.on('set' + postfix, function(id) {
- timeouts[id] = setTimeout(function() {
- conf['delete'](id);
- }, maxAge);
- if (typeof timeouts[id].unref === 'function') {
- timeouts[id].unref();
- }
- if (!preFetchTimeouts) {
- return;
- }
- if (preFetchTimeouts[id]) {
- if (preFetchTimeouts[id] !== 'nextTick') {
- clearTimeout(preFetchTimeouts[id]);
- }
- }
- preFetchTimeouts[id] = setTimeout(function() {
- delete preFetchTimeouts[id];
- }, preFetchAge);
- if (typeof preFetchTimeouts[id].unref === 'function') {
- preFetchTimeouts[id].unref();
- }
- });
- conf.on('delete' + postfix, function(id) {
- clearTimeout(timeouts[id]);
- delete timeouts[id];
- if (!preFetchTimeouts) {
- return;
- }
- if (preFetchTimeouts[id] !== 'nextTick') {
- clearTimeout(preFetchTimeouts[id]);
- }
- delete preFetchTimeouts[id];
- });
- if (options.preFetch) {
- if (options.preFetch === true || isNaN(options.preFetch)) {
- preFetchAge = .333;
- } else {
- preFetchAge = max(min(Number(options.preFetch), 1), 0);
- }
- if (preFetchAge) {
- preFetchTimeouts = {};
- preFetchAge = (1 - preFetchAge) * maxAge;
- conf.on('get' + postfix, function(id, args, context) {
- if (!preFetchTimeouts[id]) {
- preFetchTimeouts[id] = 'nextTick';
- nextTick(function() {
- var result;
- if (preFetchTimeouts[id] !== 'nextTick') {
- return;
- }
- delete preFetchTimeouts[id];
- conf['delete'](id);
- if (options.async) {
- args = aFrom(args);
- args.push(noop3);
- }
- result = conf.memoized.apply(context, args);
- if (options.promise) {
- if (isPromise(result)) {
- if (typeof result.done === 'function') {
- result.done(noop3, noop3);
- } else {
- result.then(noop3, noop3);
- }
- }
- }
- });
- }
- });
- }
- }
- conf.on('clear' + postfix, function() {
- forEach(timeouts, function(id) {
- clearTimeout(id);
- });
- timeouts = {};
- if (preFetchTimeouts) {
- forEach(preFetchTimeouts, function(id) {
- if (id !== 'nextTick') {
- clearTimeout(id);
- }
- });
- preFetchTimeouts = {};
- }
- });
- };
- });
- var require_lru_queue = __commonJS(function(exports, module) {
- 'use strict';
- var toPosInt = require_to_pos_integer();
- var create = Object.create;
- var hasOwnProperty2 = Object.prototype.hasOwnProperty;
- module.exports = function(limit) {
- var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
- limit = toPosInt(limit);
- return {
- hit: function hit(id) {
- var oldIndex = map[id], nuIndex = ++index;
- queue2[nuIndex] = id;
- map[id] = nuIndex;
- if (!oldIndex) {
- ++size;
- if (size <= limit) {
- return;
- }
- id = queue2[base];
- del(id);
- return id;
- }
- delete queue2[oldIndex];
- if (base !== oldIndex) {
- return;
- }
- while (!hasOwnProperty2.call(queue2, ++base)) {
- continue;
- }
- },
- delete: del = function del(id) {
- var oldIndex = map[id];
- if (!oldIndex) {
- return;
- }
- delete queue2[oldIndex];
- delete map[id];
- --size;
- if (base !== oldIndex) {
- return;
- }
- if (!size) {
- index = 0;
- base = 1;
- return;
- }
- while (!hasOwnProperty2.call(queue2, ++base)) {
- continue;
- }
- },
- clear: function clear() {
- size = 0;
- base = 1;
- queue2 = create(null);
- map = create(null);
- index = 0;
- }
- };
- };
- });
- var require_max = __commonJS(function() {
- 'use strict';
- var toPosInteger = require_to_pos_integer();
- var lruQueue = require_lru_queue();
- var extensions = require_registered_extensions();
- extensions.max = function(max, conf, options) {
- var postfix, queue2, hit;
- max = toPosInteger(max);
- if (!max) {
- return;
- }
- queue2 = lruQueue(max);
- postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
- conf.on('set' + postfix, hit = function hit(id) {
- id = queue2.hit(id);
- if (id === void 0) {
- return;
- }
- conf['delete'](id);
- });
- conf.on('get' + postfix, hit);
- conf.on('delete' + postfix, queue2['delete']);
- conf.on('clear' + postfix, queue2.clear);
- };
- });
- var require_ref_counter = __commonJS(function() {
- 'use strict';
- var d = require_d();
- var extensions = require_registered_extensions();
- var create = Object.create;
- var defineProperties = Object.defineProperties;
- extensions.refCounter = function(ignore, conf, options) {
- var cache2, postfix;
- cache2 = create(null);
- postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
- conf.on('set' + postfix, function(id, length) {
- cache2[id] = length || 1;
- });
- conf.on('get' + postfix, function(id) {
- ++cache2[id];
- });
- conf.on('delete' + postfix, function(id) {
- delete cache2[id];
- });
- conf.on('clear' + postfix, function() {
- cache2 = {};
- });
- defineProperties(conf.memoized, {
- deleteRef: d(function() {
- var id = conf.get(arguments);
- if (id === null) {
- return null;
- }
- if (!cache2[id]) {
- return null;
- }
- if (!--cache2[id]) {
- conf['delete'](id);
- return true;
- }
- return false;
- }),
- getRefCount: d(function() {
- var id = conf.get(arguments);
- if (id === null) {
- return 0;
- }
- if (!cache2[id]) {
- return 0;
- }
- return cache2[id];
- })
- });
- };
- });
- var require_memoizee = __commonJS(function(exports, module) {
- 'use strict';
- var normalizeOpts = require_normalize_options();
- var resolveLength = require_resolve_length();
- var plain = require_plain();
- module.exports = function(fn) {
- var options = normalizeOpts(arguments[1]), length;
- if (!options.normalizer) {
- length = options.length = resolveLength(options.length, fn.length, options.async);
- if (length !== 0) {
- if (options.primitive) {
- if (length === false) {
- options.normalizer = require_primitive();
- } else if (length > 1) {
- options.normalizer = require_get_primitive_fixed()(length);
- }
- } else if (length === false) {
- options.normalizer = require_get()();
- } else if (length === 1) {
- options.normalizer = require_get_1()();
- } else {
- options.normalizer = require_get_fixed()(length);
- }
- }
- }
- if (options.async) {
- require_async();
- }
- if (options.promise) {
- require_promise();
- }
- if (options.dispose) {
- require_dispose();
- }
- if (options.maxAge) {
- require_max_age();
- }
- if (options.max) {
- require_max();
- }
- if (options.refCounter) {
- require_ref_counter();
- }
- return plain(fn, options);
- };
- });
- var require_doT = __commonJS(function(exports, module) {
- (function() {
- 'use strict';
- var doT3 = {
- name: 'doT',
- version: '1.1.1',
- templateSettings: {
- evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
- interpolate: /\{\{=([\s\S]+?)\}\}/g,
- encode: /\{\{!([\s\S]+?)\}\}/g,
- use: /\{\{#([\s\S]+?)\}\}/g,
- useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
- define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
- defineParams: /^\s*([\w$]+):([\s\S]+)/,
- conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
- iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
- varname: 'it',
- strip: true,
- append: true,
- selfcontained: false,
- doNotSkipEncoded: false
- },
- template: void 0,
- compile: void 0,
- log: true
- };
- (function() {
- if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) === 'object') {
- return;
- }
- try {
- Object.defineProperty(Object.prototype, '__magic__', {
- get: function get() {
- return this;
- },
- configurable: true
- });
- __magic__.globalThis = __magic__;
- delete Object.prototype.__magic__;
- } catch (e) {
- window.globalThis = function() {
- if (typeof self !== 'undefined') {
- return self;
- }
- if (typeof window !== 'undefined') {
- return window;
- }
- if (typeof global !== 'undefined') {
- return global;
- }
- if (typeof this !== 'undefined') {
- return this;
- }
- throw new Error('Unable to locate global `this`');
- }();
- }
- })();
- doT3.encodeHTMLSource = function(doNotSkipEncoded) {
- var encodeHTMLRules = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- '\'': ''',
- '/': '/'
- }, matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g;
- return function(code) {
- return code ? code.toString().replace(matchHTML, function(m) {
- return encodeHTMLRules[m] || m;
- }) : '';
- };
- };
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = doT3;
- } else if (typeof define === 'function' && define.amd) {
- define(function() {
- return doT3;
- });
- } else {
- globalThis.doT = doT3;
- }
- var startend = {
- append: {
- start: '\'+(',
- end: ')+\'',
- startencode: '\'+encodeHTML('
- },
- split: {
- start: '\';out+=(',
- end: ');out+=\'',
- startencode: '\';out+=encodeHTML('
- }
- }, skip = /$^/;
- function resolveDefs(c, block, def) {
- return (typeof block === 'string' ? block : block.toString()).replace(c.define || skip, function(m, code, assign, value) {
- if (code.indexOf('def.') === 0) {
- code = code.substring(4);
- }
- if (!(code in def)) {
- if (assign === ':') {
- if (c.defineParams) {
- value.replace(c.defineParams, function(m2, param, v) {
- def[code] = {
- arg: param,
- text: v
- };
- });
- }
- if (!(code in def)) {
- def[code] = value;
- }
- } else {
- new Function('def', 'def[\'' + code + '\']=' + value)(def);
- }
- }
- return '';
- }).replace(c.use || skip, function(m, code) {
- if (c.useParams) {
- code = code.replace(c.useParams, function(m2, s, d, param) {
- if (def[d] && def[d].arg && param) {
- var rw = (d + ':' + param).replace(/'|\\/g, '_');
- def.__exp = def.__exp || {};
- def.__exp[rw] = def[d].text.replace(new RegExp('(^|[^\\w$])' + def[d].arg + '([^\\w$])', 'g'), '$1' + param + '$2');
- return s + 'def.__exp[\'' + rw + '\']';
- }
- });
- }
- var v = new Function('def', 'return ' + code)(def);
- return v ? resolveDefs(c, v, def) : v;
- });
- }
- function unescape(code) {
- return code.replace(/\\('|\\)/g, '$1').replace(/[\r\t\n]/g, ' ');
- }
- doT3.template = function(tmpl, c, def) {
- c = c || doT3.templateSettings;
- var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = c.use || c.define ? resolveDefs(c, tmpl, def || {}) : tmpl;
- str = ('var out=\'' + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ').replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str).replace(/'|\\/g, '\\$&').replace(c.interpolate || skip, function(m, code) {
- return cse.start + unescape(code) + cse.end;
- }).replace(c.encode || skip, function(m, code) {
- needhtmlencode = true;
- return cse.startencode + unescape(code) + cse.end;
- }).replace(c.conditional || skip, function(m, elsecase, code) {
- return elsecase ? code ? '\';}else if(' + unescape(code) + '){out+=\'' : '\';}else{out+=\'' : code ? '\';if(' + unescape(code) + '){out+=\'' : '\';}out+=\'';
- }).replace(c.iterate || skip, function(m, iterate, vname, iname) {
- if (!iterate) {
- return '\';} } out+=\'';
- }
- sid += 1;
- indv = iname || 'i' + sid;
- iterate = unescape(iterate);
- 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+=\'';
- }).replace(c.evaluate || skip, function(m, code) {
- return '\';' + unescape(code) + 'out+=\'';
- }) + '\';return out;').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '');
- if (needhtmlencode) {
- if (!c.selfcontained && globalThis && !globalThis._encodeHTML) {
- globalThis._encodeHTML = doT3.encodeHTMLSource(c.doNotSkipEncoded);
- }
- str = 'var encodeHTML = typeof _encodeHTML !== \'undefined\' ? _encodeHTML : (' + doT3.encodeHTMLSource.toString() + '(' + (c.doNotSkipEncoded || '') + '));' + str;
- }
- try {
- return new Function(c.varname, str);
- } catch (e) {
- if (typeof console !== 'undefined') {
- console.log('Could not create a template function: ' + str);
- }
- throw e;
- }
- };
- doT3.compile = function(tmpl, def) {
- return doT3.template(tmpl, null, def);
- };
- })();
- });
- var require_es6_promise = __commonJS(function(exports, module) {
- (function(global2, factory) {
- _typeof(exports) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global2.ES6Promise = factory();
- })(exports, function() {
- 'use strict';
- function objectOrFunction(x) {
- var type = _typeof(x);
- return x !== null && (type === 'object' || type === 'function');
- }
- function isFunction(x) {
- return typeof x === 'function';
- }
- var _isArray = void 0;
- if (Array.isArray) {
- _isArray = Array.isArray;
- } else {
- _isArray = function _isArray(x) {
- return Object.prototype.toString.call(x) === '[object Array]';
- };
- }
- var isArray = _isArray;
- var len = 0;
- var vertxNext = void 0;
- var customSchedulerFn = void 0;
- var asap = function asap2(callback, arg) {
- queue2[len] = callback;
- queue2[len + 1] = arg;
- len += 2;
- if (len === 2) {
- if (customSchedulerFn) {
- customSchedulerFn(flush);
- } else {
- scheduleFlush();
- }
- }
- };
- function setScheduler(scheduleFn) {
- customSchedulerFn = scheduleFn;
- }
- function setAsap(asapFn) {
- asap = asapFn;
- }
- var browserWindow = typeof window !== 'undefined' ? window : void 0;
- var browserGlobal = browserWindow || {};
- var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
- var isNode2 = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
- var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
- function useNextTick() {
- return function() {
- return process.nextTick(flush);
- };
- }
- function useVertxTimer() {
- if (typeof vertxNext !== 'undefined') {
- return function() {
- vertxNext(flush);
- };
- }
- return useSetTimeout();
- }
- function useMutationObserver() {
- var iterations = 0;
- var observer = new BrowserMutationObserver(flush);
- var node = document.createTextNode('');
- observer.observe(node, {
- characterData: true
- });
- return function() {
- node.data = iterations = ++iterations % 2;
- };
- }
- function useMessageChannel() {
- var channel = new MessageChannel();
- channel.port1.onmessage = flush;
- return function() {
- return channel.port2.postMessage(0);
- };
- }
- function useSetTimeout() {
- var globalSetTimeout = setTimeout;
- return function() {
- return globalSetTimeout(flush, 1);
- };
- }
- var queue2 = new Array(1e3);
- function flush() {
- for (var i = 0; i < len; i += 2) {
- var callback = queue2[i];
- var arg = queue2[i + 1];
- callback(arg);
- queue2[i] = void 0;
- queue2[i + 1] = void 0;
- }
- len = 0;
- }
- function attemptVertx() {
- try {
- var vertx = Function('return this')().require('vertx');
- vertxNext = vertx.runOnLoop || vertx.runOnContext;
- return useVertxTimer();
- } catch (e) {
- return useSetTimeout();
- }
- }
- var scheduleFlush = void 0;
- if (isNode2) {
- scheduleFlush = useNextTick();
- } else if (BrowserMutationObserver) {
- scheduleFlush = useMutationObserver();
- } else if (isWorker) {
- scheduleFlush = useMessageChannel();
- } else if (browserWindow === void 0 && true) {
- scheduleFlush = attemptVertx();
- } else {
- scheduleFlush = useSetTimeout();
- }
- function then(onFulfillment, onRejection) {
- var parent = this;
- var child = new this.constructor(noop3);
- if (child[PROMISE_ID] === void 0) {
- makePromise(child);
- }
- var _state = parent._state;
- if (_state) {
- var callback = arguments[_state - 1];
- asap(function() {
- return invokeCallback(_state, child, callback, parent._result);
- });
- } else {
- subscribe2(parent, child, onFulfillment, onRejection);
- }
- return child;
- }
- function resolve$1(object) {
- var Constructor = this;
- if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
- return object;
- }
- var promise = new Constructor(noop3);
- resolve(promise, object);
- return promise;
- }
- var PROMISE_ID = Math.random().toString(36).substring(2);
- function noop3() {}
- var PENDING = void 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- function selfFulfillment() {
- return new TypeError('You cannot resolve a promise with itself');
- }
- function cannotReturnOwn() {
- return new TypeError('A promises callback cannot return that same promise.');
- }
- function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
- try {
- then$$1.call(value, fulfillmentHandler, rejectionHandler);
- } catch (e) {
- return e;
- }
- }
- function handleForeignThenable(promise, thenable, then$$1) {
- asap(function(promise2) {
- var sealed = false;
- var error = tryThen(then$$1, thenable, function(value) {
- if (sealed) {
- return;
- }
- sealed = true;
- if (thenable !== value) {
- resolve(promise2, value);
- } else {
- fulfill(promise2, value);
- }
- }, function(reason) {
- if (sealed) {
- return;
- }
- sealed = true;
- reject(promise2, reason);
- }, 'Settle: ' + (promise2._label || ' unknown promise'));
- if (!sealed && error) {
- sealed = true;
- reject(promise2, error);
- }
- }, promise);
- }
- function handleOwnThenable(promise, thenable) {
- if (thenable._state === FULFILLED) {
- fulfill(promise, thenable._result);
- } else if (thenable._state === REJECTED) {
- reject(promise, thenable._result);
- } else {
- subscribe2(thenable, void 0, function(value) {
- return resolve(promise, value);
- }, function(reason) {
- return reject(promise, reason);
- });
- }
- }
- function handleMaybeThenable(promise, maybeThenable, then$$1) {
- if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
- handleOwnThenable(promise, maybeThenable);
- } else {
- if (then$$1 === void 0) {
- fulfill(promise, maybeThenable);
- } else if (isFunction(then$$1)) {
- handleForeignThenable(promise, maybeThenable, then$$1);
- } else {
- fulfill(promise, maybeThenable);
- }
- }
- }
- function resolve(promise, value) {
- if (promise === value) {
- reject(promise, selfFulfillment());
- } else if (objectOrFunction(value)) {
- var then$$1 = void 0;
- try {
- then$$1 = value.then;
- } catch (error) {
- reject(promise, error);
- return;
- }
- handleMaybeThenable(promise, value, then$$1);
- } else {
- fulfill(promise, value);
- }
- }
- function publishRejection(promise) {
- if (promise._onerror) {
- promise._onerror(promise._result);
- }
- publish(promise);
- }
- function fulfill(promise, value) {
- if (promise._state !== PENDING) {
- return;
- }
- promise._result = value;
- promise._state = FULFILLED;
- if (promise._subscribers.length !== 0) {
- asap(publish, promise);
- }
- }
- function reject(promise, reason) {
- if (promise._state !== PENDING) {
- return;
- }
- promise._state = REJECTED;
- promise._result = reason;
- asap(publishRejection, promise);
- }
- function subscribe2(parent, child, onFulfillment, onRejection) {
- var _subscribers = parent._subscribers;
- var length = _subscribers.length;
- parent._onerror = null;
- _subscribers[length] = child;
- _subscribers[length + FULFILLED] = onFulfillment;
- _subscribers[length + REJECTED] = onRejection;
- if (length === 0 && parent._state) {
- asap(publish, parent);
- }
- }
- function publish(promise) {
- var subscribers = promise._subscribers;
- var settled = promise._state;
- if (subscribers.length === 0) {
- return;
- }
- var child = void 0, callback = void 0, detail = promise._result;
- for (var i = 0; i < subscribers.length; i += 3) {
- child = subscribers[i];
- callback = subscribers[i + settled];
- if (child) {
- invokeCallback(settled, child, callback, detail);
- } else {
- callback(detail);
- }
- }
- promise._subscribers.length = 0;
- }
- function invokeCallback(settled, promise, callback, detail) {
- var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = true;
- if (hasCallback) {
- try {
- value = callback(detail);
- } catch (e) {
- succeeded = false;
- error = e;
- }
- if (promise === value) {
- reject(promise, cannotReturnOwn());
- return;
- }
- } else {
- value = detail;
- }
- if (promise._state !== PENDING) {} else if (hasCallback && succeeded) {
- resolve(promise, value);
- } else if (succeeded === false) {
- reject(promise, error);
- } else if (settled === FULFILLED) {
- fulfill(promise, value);
- } else if (settled === REJECTED) {
- reject(promise, value);
- }
- }
- function initializePromise(promise, resolver) {
- try {
- resolver(function resolvePromise(value) {
- resolve(promise, value);
- }, function rejectPromise(reason) {
- reject(promise, reason);
- });
- } catch (e) {
- reject(promise, e);
- }
- }
- var id = 0;
- function nextId() {
- return id++;
- }
- function makePromise(promise) {
- promise[PROMISE_ID] = id++;
- promise._state = void 0;
- promise._result = void 0;
- promise._subscribers = [];
- }
- function validationError() {
- return new Error('Array Methods must be provided an Array');
- }
- var Enumerator = function() {
- function Enumerator2(Constructor, input) {
- this._instanceConstructor = Constructor;
- this.promise = new Constructor(noop3);
- if (!this.promise[PROMISE_ID]) {
- makePromise(this.promise);
- }
- if (isArray(input)) {
- this.length = input.length;
- this._remaining = input.length;
- this._result = new Array(this.length);
- if (this.length === 0) {
- fulfill(this.promise, this._result);
- } else {
- this.length = this.length || 0;
- this._enumerate(input);
- if (this._remaining === 0) {
- fulfill(this.promise, this._result);
- }
- }
- } else {
- reject(this.promise, validationError());
- }
- }
- Enumerator2.prototype._enumerate = function _enumerate(input) {
- for (var i = 0; this._state === PENDING && i < input.length; i++) {
- this._eachEntry(input[i], i);
- }
- };
- Enumerator2.prototype._eachEntry = function _eachEntry(entry, i) {
- var c = this._instanceConstructor;
- var resolve$$1 = c.resolve;
- if (resolve$$1 === resolve$1) {
- var _then = void 0;
- var error = void 0;
- var didError = false;
- try {
- _then = entry.then;
- } catch (e) {
- didError = true;
- error = e;
- }
- if (_then === then && entry._state !== PENDING) {
- this._settledAt(entry._state, i, entry._result);
- } else if (typeof _then !== 'function') {
- this._remaining--;
- this._result[i] = entry;
- } else if (c === Promise$1) {
- var promise = new c(noop3);
- if (didError) {
- reject(promise, error);
- } else {
- handleMaybeThenable(promise, entry, _then);
- }
- this._willSettleAt(promise, i);
- } else {
- this._willSettleAt(new c(function(resolve$$12) {
- return resolve$$12(entry);
- }), i);
- }
- } else {
- this._willSettleAt(resolve$$1(entry), i);
- }
- };
- Enumerator2.prototype._settledAt = function _settledAt(state, i, value) {
- var promise = this.promise;
- if (promise._state === PENDING) {
- this._remaining--;
- if (state === REJECTED) {
- reject(promise, value);
- } else {
- this._result[i] = value;
- }
- }
- if (this._remaining === 0) {
- fulfill(promise, this._result);
- }
- };
- Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i) {
- var enumerator = this;
- subscribe2(promise, void 0, function(value) {
- return enumerator._settledAt(FULFILLED, i, value);
- }, function(reason) {
- return enumerator._settledAt(REJECTED, i, reason);
- });
- };
- return Enumerator2;
- }();
- function all(entries) {
- return new Enumerator(this, entries).promise;
- }
- function race(entries) {
- var Constructor = this;
- if (!isArray(entries)) {
- return new Constructor(function(_, reject2) {
- return reject2(new TypeError('You must pass an array to race.'));
- });
- } else {
- return new Constructor(function(resolve2, reject2) {
- var length = entries.length;
- for (var i = 0; i < length; i++) {
- Constructor.resolve(entries[i]).then(resolve2, reject2);
- }
- });
- }
- }
- function reject$1(reason) {
- var Constructor = this;
- var promise = new Constructor(noop3);
- reject(promise, reason);
- return promise;
- }
- function needsResolver() {
- throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
- }
- function needsNew() {
- throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
- }
- var Promise$1 = function() {
- function Promise2(resolver) {
- this[PROMISE_ID] = nextId();
- this._result = this._state = void 0;
- this._subscribers = [];
- if (noop3 !== resolver) {
- typeof resolver !== 'function' && needsResolver();
- this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
- }
- }
- Promise2.prototype['catch'] = function _catch(onRejection) {
- return this.then(null, onRejection);
- };
- Promise2.prototype['finally'] = function _finally(callback) {
- var promise = this;
- var constructor = promise.constructor;
- if (isFunction(callback)) {
- return promise.then(function(value) {
- return constructor.resolve(callback()).then(function() {
- return value;
- });
- }, function(reason) {
- return constructor.resolve(callback()).then(function() {
- throw reason;
- });
- });
- }
- return promise.then(callback, callback);
- };
- return Promise2;
- }();
- Promise$1.prototype.then = then;
- Promise$1.all = all;
- Promise$1.race = race;
- Promise$1.resolve = resolve$1;
- Promise$1.reject = reject$1;
- Promise$1._setScheduler = setScheduler;
- Promise$1._setAsap = setAsap;
- Promise$1._asap = asap;
- function polyfill() {
- var local = void 0;
- if (typeof global !== 'undefined') {
- local = global;
- } else if (typeof self !== 'undefined') {
- local = self;
- } else {
- try {
- local = Function('return this')();
- } catch (e) {
- throw new Error('polyfill failed because global object is unavailable in this environment');
- }
- }
- var P = local.Promise;
- if (P) {
- var promiseToString = null;
- try {
- promiseToString = Object.prototype.toString.call(P.resolve());
- } catch (e) {}
- if (promiseToString === '[object Promise]' && !P.cast) {
- return;
- }
- }
- local.Promise = Promise$1;
- }
- Promise$1.polyfill = polyfill;
- Promise$1.Promise = Promise$1;
- return Promise$1;
- });
- });
- var require_typedarray = __commonJS(function(exports) {
- var MAX_ARRAY_LENGTH = 1e5;
- var ECMAScript = function() {
- var opts = Object.prototype.toString;
- var ophop = Object.prototype.hasOwnProperty;
- return {
- Class: function Class(v) {
- return opts.call(v).replace(/^\[object *|\]$/g, '');
- },
- HasProperty: function HasProperty(o, p) {
- return p in o;
- },
- HasOwnProperty: function HasOwnProperty(o, p) {
- return ophop.call(o, p);
- },
- IsCallable: function IsCallable(o) {
- return typeof o === 'function';
- },
- ToInt32: function ToInt32(v) {
- return v >> 0;
- },
- ToUint32: function ToUint32(v) {
- return v >>> 0;
- }
- };
- }();
- var LN2 = Math.LN2;
- var abs = Math.abs;
- var floor = Math.floor;
- var log2 = Math.log;
- var min = Math.min;
- var pow = Math.pow;
- var round = Math.round;
- function clamp2(v, minimum, max) {
- return v < minimum ? minimum : v > max ? max : v;
- }
- var getOwnPropNames = Object.getOwnPropertyNames || function(o) {
- if (o !== Object(o)) {
- throw new TypeError('Object.getOwnPropertyNames called on non-object');
- }
- var props = [], p;
- for (p in o) {
- if (ECMAScript.HasOwnProperty(o, p)) {
- props.push(p);
- }
- }
- return props;
- };
- var defineProp;
- if (Object.defineProperty && function() {
- try {
- Object.defineProperty({}, 'x', {});
- return true;
- } catch (e) {
- return false;
- }
- }()) {
- defineProp = Object.defineProperty;
- } else {
- defineProp = function defineProp(o, p, desc) {
- if (!o === Object(o)) {
- throw new TypeError('Object.defineProperty called on non-object');
- }
- if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) {
- Object.prototype.__defineGetter__.call(o, p, desc.get);
- }
- if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) {
- Object.prototype.__defineSetter__.call(o, p, desc.set);
- }
- if (ECMAScript.HasProperty(desc, 'value')) {
- o[p] = desc.value;
- }
- return o;
- };
- }
- function configureProperties(obj) {
- if (getOwnPropNames && defineProp) {
- var props = getOwnPropNames(obj), i;
- for (i = 0; i < props.length; i += 1) {
- defineProp(obj, props[i], {
- value: obj[props[i]],
- writable: false,
- enumerable: false,
- configurable: false
- });
- }
- }
- }
- function makeArrayAccessors(obj) {
- if (!defineProp) {
- return;
- }
- if (obj.length > MAX_ARRAY_LENGTH) {
- throw new RangeError('Array too large for polyfill');
- }
- function makeArrayAccessor(index) {
- defineProp(obj, index, {
- get: function get() {
- return obj._getter(index);
- },
- set: function set(v) {
- obj._setter(index, v);
- },
- enumerable: true,
- configurable: false
- });
- }
- var i;
- for (i = 0; i < obj.length; i += 1) {
- makeArrayAccessor(i);
- }
- }
- function as_signed(value, bits) {
- var s = 32 - bits;
- return value << s >> s;
- }
- function as_unsigned(value, bits) {
- var s = 32 - bits;
- return value << s >>> s;
- }
- function packI8(n) {
- return [ n & 255 ];
- }
- function unpackI8(bytes) {
- return as_signed(bytes[0], 8);
- }
- function packU8(n) {
- return [ n & 255 ];
- }
- function unpackU8(bytes) {
- return as_unsigned(bytes[0], 8);
- }
- function packU8Clamped(n) {
- n = round(Number(n));
- return [ n < 0 ? 0 : n > 255 ? 255 : n & 255 ];
- }
- function packI16(n) {
- return [ n >> 8 & 255, n & 255 ];
- }
- function unpackI16(bytes) {
- return as_signed(bytes[0] << 8 | bytes[1], 16);
- }
- function packU16(n) {
- return [ n >> 8 & 255, n & 255 ];
- }
- function unpackU16(bytes) {
- return as_unsigned(bytes[0] << 8 | bytes[1], 16);
- }
- function packI32(n) {
- return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
- }
- function unpackI32(bytes) {
- return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
- }
- function packU32(n) {
- return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
- }
- function unpackU32(bytes) {
- return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
- }
- function packIEEE754(v, ebits, fbits) {
- var bias = (1 << ebits - 1) - 1;
- var s, e, f, i, bits, str, bytes;
- function roundToEven(n) {
- var w = floor(n);
- var fl = n - w;
- if (fl < .5) {
- return w;
- }
- if (fl > .5) {
- return w + 1;
- }
- return w % 2 ? w + 1 : w;
- }
- if (v !== v) {
- e = (1 << ebits) - 1;
- f = pow(2, fbits - 1);
- s = 0;
- } else if (v === Infinity || v === -Infinity) {
- e = (1 << ebits) - 1;
- f = 0;
- s = v < 0 ? 1 : 0;
- } else if (v === 0) {
- e = 0;
- f = 0;
- s = 1 / v === -Infinity ? 1 : 0;
- } else {
- s = v < 0;
- v = abs(v);
- if (v >= pow(2, 1 - bias)) {
- e = min(floor(log2(v) / LN2), 1023);
- f = roundToEven(v / pow(2, e) * pow(2, fbits));
- if (f / pow(2, fbits) >= 2) {
- e = e + 1;
- f = 1;
- }
- if (e > bias) {
- e = (1 << ebits) - 1;
- f = 0;
- } else {
- e = e + bias;
- f = f - pow(2, fbits);
- }
- } else {
- e = 0;
- f = roundToEven(v / pow(2, 1 - bias - fbits));
- }
- }
- bits = [];
- for (i = fbits; i; i -= 1) {
- bits.push(f % 2 ? 1 : 0);
- f = floor(f / 2);
- }
- for (i = ebits; i; i -= 1) {
- bits.push(e % 2 ? 1 : 0);
- e = floor(e / 2);
- }
- bits.push(s ? 1 : 0);
- bits.reverse();
- str = bits.join('');
- bytes = [];
- while (str.length) {
- bytes.push(parseInt(str.substring(0, 8), 2));
- str = str.substring(8);
- }
- return bytes;
- }
- function unpackIEEE754(bytes, ebits, fbits) {
- var bits = [], i, j, b, str, bias, s, e, f;
- for (i = bytes.length; i; i -= 1) {
- b = bytes[i - 1];
- for (j = 8; j; j -= 1) {
- bits.push(b % 2 ? 1 : 0);
- b = b >> 1;
- }
- }
- bits.reverse();
- str = bits.join('');
- bias = (1 << ebits - 1) - 1;
- s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
- e = parseInt(str.substring(1, 1 + ebits), 2);
- f = parseInt(str.substring(1 + ebits), 2);
- if (e === (1 << ebits) - 1) {
- return f === 0 ? s * Infinity : NaN;
- } else if (e > 0) {
- return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
- } else if (f !== 0) {
- return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
- }
- return s < 0 ? -0 : 0;
- }
- function unpackF64(b) {
- return unpackIEEE754(b, 11, 52);
- }
- function packF64(v) {
- return packIEEE754(v, 11, 52);
- }
- function unpackF32(b) {
- return unpackIEEE754(b, 8, 23);
- }
- function packF32(v) {
- return packIEEE754(v, 8, 23);
- }
- (function() {
- function ArrayBuffer(length) {
- length = ECMAScript.ToInt32(length);
- if (length < 0) {
- throw new RangeError('ArrayBuffer size is not a small enough positive integer');
- }
- this.byteLength = length;
- this._bytes = [];
- this._bytes.length = length;
- var i;
- for (i = 0; i < this.byteLength; i += 1) {
- this._bytes[i] = 0;
- }
- configureProperties(this);
- }
- exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
- function ArrayBufferView() {}
- function makeConstructor(bytesPerElement, pack, unpack) {
- var _ctor;
- _ctor = function ctor(buffer, byteOffset, length) {
- var array, sequence, i, s;
- if (!arguments.length || typeof arguments[0] === 'number') {
- this.length = ECMAScript.ToInt32(arguments[0]);
- if (length < 0) {
- throw new RangeError('ArrayBufferView size is not a small enough positive integer');
- }
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
- } else if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === _ctor) {
- array = arguments[0];
- this.length = array.length;
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
- for (i = 0; i < this.length; i += 1) {
- this._setter(i, array._getter(i));
- }
- } else if (_typeof(arguments[0]) === 'object' && !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
- sequence = arguments[0];
- this.length = ECMAScript.ToUint32(sequence.length);
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- this.buffer = new ArrayBuffer(this.byteLength);
- this.byteOffset = 0;
- for (i = 0; i < this.length; i += 1) {
- s = sequence[i];
- this._setter(i, Number(s));
- }
- } else if (_typeof(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
- this.buffer = buffer;
- this.byteOffset = ECMAScript.ToUint32(byteOffset);
- if (this.byteOffset > this.buffer.byteLength) {
- throw new RangeError('byteOffset out of range');
- }
- if (this.byteOffset % this.BYTES_PER_ELEMENT) {
- throw new RangeError('ArrayBuffer length minus the byteOffset is not a multiple of the element size.');
- }
- if (arguments.length < 3) {
- this.byteLength = this.buffer.byteLength - this.byteOffset;
- if (this.byteLength % this.BYTES_PER_ELEMENT) {
- throw new RangeError('length of buffer minus byteOffset not a multiple of the element size');
- }
- this.length = this.byteLength / this.BYTES_PER_ELEMENT;
- } else {
- this.length = ECMAScript.ToUint32(length);
- this.byteLength = this.length * this.BYTES_PER_ELEMENT;
- }
- if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
- throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
- }
- } else {
- throw new TypeError('Unexpected argument type(s)');
- }
- this.constructor = _ctor;
- configureProperties(this);
- makeArrayAccessors(this);
- };
- _ctor.prototype = new ArrayBufferView();
- _ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
- _ctor.prototype._pack = pack;
- _ctor.prototype._unpack = unpack;
- _ctor.BYTES_PER_ELEMENT = bytesPerElement;
- _ctor.prototype._getter = function(index) {
- if (arguments.length < 1) {
- throw new SyntaxError('Not enough arguments');
- }
- index = ECMAScript.ToUint32(index);
- if (index >= this.length) {
- return void 0;
- }
- var bytes = [];
- for (var i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
- o += 1) {
- bytes.push(this.buffer._bytes[o]);
- }
- return this._unpack(bytes);
- };
- _ctor.prototype.get = _ctor.prototype._getter;
- _ctor.prototype._setter = function(index, value) {
- if (arguments.length < 2) {
- throw new SyntaxError('Not enough arguments');
- }
- index = ECMAScript.ToUint32(index);
- if (index < this.length) {
- var bytes = this._pack(value);
- var i;
- var o;
- for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
- o += 1) {
- this.buffer._bytes[o] = bytes[i];
- }
- }
- };
- _ctor.prototype.set = function(index, value) {
- if (arguments.length < 1) {
- throw new SyntaxError('Not enough arguments');
- }
- var array, sequence, offset, len, i, s, d, byteOffset, byteLength, tmp;
- if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === this.constructor) {
- array = arguments[0];
- offset = ECMAScript.ToUint32(arguments[1]);
- if (offset + array.length > this.length) {
- throw new RangeError('Offset plus length of array is out of range');
- }
- byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
- byteLength = array.length * this.BYTES_PER_ELEMENT;
- if (array.buffer === this.buffer) {
- tmp = [];
- for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
- tmp[i] = array.buffer._bytes[s];
- }
- for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
- this.buffer._bytes[d] = tmp[i];
- }
- } else {
- for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1,
- s += 1, d += 1) {
- this.buffer._bytes[d] = array.buffer._bytes[s];
- }
- }
- } else if (_typeof(arguments[0]) === 'object' && typeof arguments[0].length !== 'undefined') {
- sequence = arguments[0];
- len = ECMAScript.ToUint32(sequence.length);
- offset = ECMAScript.ToUint32(arguments[1]);
- if (offset + len > this.length) {
- throw new RangeError('Offset plus length of array is out of range');
- }
- for (i = 0; i < len; i += 1) {
- s = sequence[i];
- this._setter(offset + i, Number(s));
- }
- } else {
- throw new TypeError('Unexpected argument type(s)');
- }
- };
- _ctor.prototype.subarray = function(start, end) {
- start = ECMAScript.ToInt32(start);
- end = ECMAScript.ToInt32(end);
- if (arguments.length < 1) {
- start = 0;
- }
- if (arguments.length < 2) {
- end = this.length;
- }
- if (start < 0) {
- start = this.length + start;
- }
- if (end < 0) {
- end = this.length + end;
- }
- start = clamp2(start, 0, this.length);
- end = clamp2(end, 0, this.length);
- var len = end - start;
- if (len < 0) {
- len = 0;
- }
- return new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
- };
- return _ctor;
- }
- var Int8Array = makeConstructor(1, packI8, unpackI8);
- var Uint8Array2 = makeConstructor(1, packU8, unpackU8);
- var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8);
- var Int16Array = makeConstructor(2, packI16, unpackI16);
- var Uint16Array = makeConstructor(2, packU16, unpackU16);
- var Int32Array = makeConstructor(4, packI32, unpackI32);
- var Uint32Array3 = makeConstructor(4, packU32, unpackU32);
- var Float32Array = makeConstructor(4, packF32, unpackF32);
- var Float64Array = makeConstructor(8, packF64, unpackF64);
- exports.Int8Array = exports.Int8Array || Int8Array;
- exports.Uint8Array = exports.Uint8Array || Uint8Array2;
- exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray2;
- exports.Int16Array = exports.Int16Array || Int16Array;
- exports.Uint16Array = exports.Uint16Array || Uint16Array;
- exports.Int32Array = exports.Int32Array || Int32Array;
- exports.Uint32Array = exports.Uint32Array || Uint32Array3;
- exports.Float32Array = exports.Float32Array || Float32Array;
- exports.Float64Array = exports.Float64Array || Float64Array;
- })();
- (function() {
- function r(array, index) {
- return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
- }
- var IS_BIG_ENDIAN = function() {
- var u16array = new exports.Uint16Array([ 4660 ]), u8array = new exports.Uint8Array(u16array.buffer);
- return r(u8array, 0) === 18;
- }();
- function DataView(buffer, byteOffset, byteLength) {
- if (arguments.length === 0) {
- buffer = new exports.ArrayBuffer(0);
- } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
- throw new TypeError('TypeError');
- }
- this.buffer = buffer || new exports.ArrayBuffer(0);
- this.byteOffset = ECMAScript.ToUint32(byteOffset);
- if (this.byteOffset > this.buffer.byteLength) {
- throw new RangeError('byteOffset out of range');
- }
- if (arguments.length < 3) {
- this.byteLength = this.buffer.byteLength - this.byteOffset;
- } else {
- this.byteLength = ECMAScript.ToUint32(byteLength);
- }
- if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
- throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
- }
- configureProperties(this);
- }
- function makeGetter(arrayType) {
- return function(byteOffset, littleEndian) {
- byteOffset = ECMAScript.ToUint32(byteOffset);
- if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
- throw new RangeError('Array index out of range');
- }
- byteOffset += this.byteOffset;
- var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i;
- for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
- bytes.push(r(uint8Array, i));
- }
- if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
- bytes.reverse();
- }
- return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
- };
- }
- DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
- DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
- DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
- DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
- DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
- DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
- DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
- DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
- function makeSetter(arrayType) {
- return function(byteOffset, value, littleEndian) {
- byteOffset = ECMAScript.ToUint32(byteOffset);
- if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
- throw new RangeError('Array index out of range');
- }
- var typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = [], i, byteView;
- for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
- bytes.push(r(byteArray, i));
- }
- if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
- bytes.reverse();
- }
- byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
- byteView.set(bytes);
- };
- }
- DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
- DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
- DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
- DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
- DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
- DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
- DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
- DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
- exports.DataView = exports.DataView || DataView;
- })();
- });
- var require_weakmap_polyfill = __commonJS(function(exports) {
- (function(self2) {
- 'use strict';
- if (self2.WeakMap) {
- return;
- }
- var hasOwnProperty2 = Object.prototype.hasOwnProperty;
- var hasDefine = Object.defineProperty && function() {
- try {
- return Object.defineProperty({}, 'x', {
- value: 1
- }).x === 1;
- } catch (e) {}
- }();
- var defineProperty = function defineProperty(object, name, value) {
- if (hasDefine) {
- Object.defineProperty(object, name, {
- configurable: true,
- writable: true,
- value: value
- });
- } else {
- object[name] = value;
- }
- };
- self2.WeakMap = function() {
- function WeakMap2() {
- if (this === void 0) {
- throw new TypeError('Constructor WeakMap requires \'new\'');
- }
- defineProperty(this, '_id', genId('_WeakMap'));
- if (arguments.length > 0) {
- throw new TypeError('WeakMap iterable is not supported');
- }
- }
- defineProperty(WeakMap2.prototype, 'delete', function(key) {
- checkInstance(this, 'delete');
- if (!isObject(key)) {
- return false;
- }
- var entry = key[this._id];
- if (entry && entry[0] === key) {
- delete key[this._id];
- return true;
- }
- return false;
- });
- defineProperty(WeakMap2.prototype, 'get', function(key) {
- checkInstance(this, 'get');
- if (!isObject(key)) {
- return void 0;
- }
- var entry = key[this._id];
- if (entry && entry[0] === key) {
- return entry[1];
- }
- return void 0;
- });
- defineProperty(WeakMap2.prototype, 'has', function(key) {
- checkInstance(this, 'has');
- if (!isObject(key)) {
- return false;
- }
- var entry = key[this._id];
- if (entry && entry[0] === key) {
- return true;
- }
- return false;
- });
- defineProperty(WeakMap2.prototype, 'set', function(key, value) {
- checkInstance(this, 'set');
- if (!isObject(key)) {
- throw new TypeError('Invalid value used as weak map key');
- }
- var entry = key[this._id];
- if (entry && entry[0] === key) {
- entry[1] = value;
- return this;
- }
- defineProperty(key, this._id, [ key, value ]);
- return this;
- });
- function checkInstance(x, methodName) {
- if (!isObject(x) || !hasOwnProperty2.call(x, '_id')) {
- throw new TypeError(methodName + ' method called on incompatible receiver ' + _typeof(x));
- }
- }
- function genId(prefix) {
- return prefix + '_' + rand() + '.' + rand();
- }
- function rand() {
- return Math.random().toString().substring(2);
- }
- defineProperty(WeakMap2, '_polyfill', true);
- return WeakMap2;
- }();
- function isObject(x) {
- return Object(x) === x;
- }
- })(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports);
- });
- var definitions = [ {
- name: 'NA',
- value: 'inapplicable',
- priority: 0,
- group: 'inapplicable'
- }, {
- name: 'PASS',
- value: 'passed',
- priority: 1,
- group: 'passes'
- }, {
- name: 'CANTTELL',
- value: 'cantTell',
- priority: 2,
- group: 'incomplete'
- }, {
- name: 'FAIL',
- value: 'failed',
- priority: 3,
- group: 'violations'
- } ];
- var constants = {
- helpUrlBase: 'https://dequeuniversity.com/rules/',
- gridSize: 200,
- results: [],
- resultGroups: [],
- resultGroupMap: {},
- impact: Object.freeze([ 'minor', 'moderate', 'serious', 'critical' ]),
- preload: Object.freeze({
- assets: [ 'cssom', 'media' ],
- timeout: 1e4
- }),
- allOrigins: '<unsafe_all_origins>',
- sameOrigin: '<same_origin>'
- };
- definitions.forEach(function(definition) {
- var name = definition.name;
- var value = definition.value;
- var priority = definition.priority;
- var group = definition.group;
- constants[name] = value;
- constants[name + '_PRIO'] = priority;
- constants[name + '_GROUP'] = group;
- constants.results[priority] = value;
- constants.resultGroups[priority] = group;
- constants.resultGroupMap[value] = group;
- });
- Object.freeze(constants.results);
- Object.freeze(constants.resultGroups);
- Object.freeze(constants.resultGroupMap);
- Object.freeze(constants);
- var constants_default = constants;
- function log() {
- if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
- Function.prototype.apply.call(console.log, console, arguments);
- }
- }
- var log_default = log;
- var whitespaceRegex = /[\t\r\n\f]/g;
- var AbstractVirtualNode = function() {
- function AbstractVirtualNode() {
- _classCallCheck(this, AbstractVirtualNode);
- this.parent = void 0;
- }
- _createClass(AbstractVirtualNode, [ {
- key: 'props',
- get: function get() {
- throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties');
- }
- }, {
- key: 'attrNames',
- get: function get() {
- throw new Error('VirtualNode class must have an "attrNames" property');
- }
- }, {
- key: 'attr',
- value: function attr() {
- throw new Error('VirtualNode class must have an "attr" function');
- }
- }, {
- key: 'hasAttr',
- value: function hasAttr() {
- throw new Error('VirtualNode class must have a "hasAttr" function');
- }
- }, {
- key: 'hasClass',
- value: function hasClass(className) {
- var classAttr = this.attr('class');
- if (!classAttr) {
- return false;
- }
- var selector = ' ' + className + ' ';
- return (' ' + classAttr + ' ').replace(whitespaceRegex, ' ').indexOf(selector) >= 0;
- }
- } ]);
- return AbstractVirtualNode;
- }();
- var abstract_virtual_node_default = AbstractVirtualNode;
- var utils_exports = {};
- __export(utils_exports, {
- DqElement: function DqElement() {
- return dq_element_default;
- },
- aggregate: function aggregate() {
- return aggregate_default;
- },
- aggregateChecks: function aggregateChecks() {
- return aggregate_checks_default;
- },
- aggregateNodeResults: function aggregateNodeResults() {
- return aggregate_node_results_default;
- },
- aggregateResult: function aggregateResult() {
- return aggregate_result_default;
- },
- areStylesSet: function areStylesSet() {
- return are_styles_set_default;
- },
- assert: function assert() {
- return assert_default;
- },
- checkHelper: function checkHelper() {
- return check_helper_default;
- },
- clone: function clone() {
- return clone_default;
- },
- closest: function closest() {
- return closest_default;
- },
- collectResultsFromFrames: function collectResultsFromFrames() {
- return _collectResultsFromFrames;
- },
- contains: function contains() {
- return _contains;
- },
- convertSelector: function convertSelector() {
- return _convertSelector;
- },
- cssParser: function cssParser() {
- return css_parser_default;
- },
- deepMerge: function deepMerge() {
- return deep_merge_default;
- },
- escapeSelector: function escapeSelector() {
- return escape_selector_default;
- },
- extendMetaData: function extendMetaData() {
- return extend_meta_data_default;
- },
- filterHtmlAttrs: function filterHtmlAttrs() {
- return _filterHtmlAttrs;
- },
- finalizeRuleResult: function finalizeRuleResult() {
- return finalize_result_default;
- },
- findBy: function findBy() {
- return find_by_default;
- },
- getAllChecks: function getAllChecks() {
- return get_all_checks_default;
- },
- getAncestry: function getAncestry() {
- return _getAncestry;
- },
- getBaseLang: function getBaseLang() {
- return get_base_lang_default;
- },
- getCheckMessage: function getCheckMessage() {
- return get_check_message_default;
- },
- getCheckOption: function getCheckOption() {
- return get_check_option_default;
- },
- getEnvironmentData: function getEnvironmentData() {
- return _getEnvironmentData;
- },
- getFlattenedTree: function getFlattenedTree() {
- return get_flattened_tree_default;
- },
- getFrameContexts: function getFrameContexts() {
- return _getFrameContexts;
- },
- getFriendlyUriEnd: function getFriendlyUriEnd() {
- return get_friendly_uri_end_default;
- },
- getNodeAttributes: function getNodeAttributes() {
- return get_node_attributes_default;
- },
- getNodeFromTree: function getNodeFromTree() {
- return get_node_from_tree_default;
- },
- getPreloadConfig: function getPreloadConfig() {
- return _getPreloadConfig;
- },
- getRootNode: function getRootNode() {
- return get_root_node_default;
- },
- getRule: function getRule() {
- return get_rule_default;
- },
- getScroll: function getScroll() {
- return _getScroll;
- },
- getScrollState: function getScrollState() {
- return get_scroll_state_default;
- },
- getSelector: function getSelector() {
- return _getSelector;
- },
- getSelectorData: function getSelectorData() {
- return _getSelectorData;
- },
- getShadowSelector: function getShadowSelector() {
- return get_shadow_selector_default;
- },
- getStandards: function getStandards() {
- return _getStandards;
- },
- getStyleSheetFactory: function getStyleSheetFactory() {
- return get_stylesheet_factory_default;
- },
- getXpath: function getXpath() {
- return get_xpath_default;
- },
- injectStyle: function injectStyle() {
- return inject_style_default;
- },
- isHidden: function isHidden() {
- return is_hidden_default;
- },
- isHtmlElement: function isHtmlElement() {
- return is_html_element_default;
- },
- isNodeInContext: function isNodeInContext() {
- return _isNodeInContext;
- },
- isShadowRoot: function isShadowRoot() {
- return is_shadow_root_default;
- },
- isValidLang: function isValidLang() {
- return valid_langs_default;
- },
- isXHTML: function isXHTML() {
- return is_xhtml_default;
- },
- matchAncestry: function matchAncestry() {
- return match_ancestry_default;
- },
- matches: function matches() {
- return matches_default;
- },
- matchesExpression: function matchesExpression() {
- return _matchesExpression;
- },
- matchesSelector: function matchesSelector() {
- return element_matches_default;
- },
- memoize: function memoize() {
- return memoize_default;
- },
- mergeResults: function mergeResults() {
- return merge_results_default;
- },
- nodeSorter: function nodeSorter() {
- return node_sorter_default;
- },
- parseCrossOriginStylesheet: function parseCrossOriginStylesheet() {
- return parse_crossorigin_stylesheet_default;
- },
- parseSameOriginStylesheet: function parseSameOriginStylesheet() {
- return parse_sameorigin_stylesheet_default;
- },
- parseStylesheet: function parseStylesheet() {
- return parse_stylesheet_default;
- },
- performanceTimer: function performanceTimer() {
- return performance_timer_default;
- },
- pollyfillElementsFromPoint: function pollyfillElementsFromPoint() {
- return _pollyfillElementsFromPoint;
- },
- preload: function preload() {
- return preload_default;
- },
- preloadCssom: function preloadCssom() {
- return preload_cssom_default;
- },
- preloadMedia: function preloadMedia() {
- return preload_media_default;
- },
- processMessage: function processMessage() {
- return process_message_default;
- },
- publishMetaData: function publishMetaData() {
- return publish_metadata_default;
- },
- querySelectorAll: function querySelectorAll() {
- return query_selector_all_default;
- },
- querySelectorAllFilter: function querySelectorAllFilter() {
- return query_selector_all_filter_default;
- },
- queue: function queue() {
- return queue_default;
- },
- respondable: function respondable() {
- return _respondable;
- },
- ruleShouldRun: function ruleShouldRun() {
- return rule_should_run_default;
- },
- select: function select() {
- return _select;
- },
- sendCommandToFrame: function sendCommandToFrame() {
- return _sendCommandToFrame;
- },
- setScrollState: function setScrollState() {
- return set_scroll_state_default;
- },
- shadowSelect: function shadowSelect() {
- return _shadowSelect;
- },
- shadowSelectAll: function shadowSelectAll() {
- return _shadowSelectAll;
- },
- shouldPreload: function shouldPreload() {
- return _shouldPreload;
- },
- toArray: function toArray() {
- return to_array_default;
- },
- tokenList: function tokenList() {
- return token_list_default;
- },
- uniqueArray: function uniqueArray() {
- return unique_array_default;
- },
- uuid: function uuid() {
- return uuid_default;
- },
- validInputTypes: function validInputTypes() {
- return valid_input_type_default;
- },
- validLangs: function validLangs() {
- return _validLangs;
- }
- });
- function aggregate(map, values, initial) {
- values = values.slice();
- if (initial) {
- values.push(initial);
- }
- var sorting = values.map(function(val) {
- return map.indexOf(val);
- }).sort();
- return map[sorting.pop()];
- }
- var aggregate_default = aggregate;
- var CANTTELL_PRIO = constants_default.CANTTELL_PRIO, FAIL_PRIO = constants_default.FAIL_PRIO;
- var checkMap = [];
- checkMap[constants_default.PASS_PRIO] = true;
- checkMap[constants_default.CANTTELL_PRIO] = null;
- checkMap[constants_default.FAIL_PRIO] = false;
- var checkTypes = [ 'any', 'all', 'none' ];
- function anyAllNone(obj, functor) {
- return checkTypes.reduce(function(out, type) {
- out[type] = (obj[type] || []).map(function(val) {
- return functor(val, type);
- });
- return out;
- }, {});
- }
- function aggregateChecks(nodeResOriginal) {
- var nodeResult = Object.assign({}, nodeResOriginal);
- anyAllNone(nodeResult, function(check, type) {
- var i = typeof check.result === 'undefined' ? -1 : checkMap.indexOf(check.result);
- check.priority = i !== -1 ? i : constants_default.CANTTELL_PRIO;
- if (type === 'none') {
- if (check.priority === constants_default.PASS_PRIO) {
- check.priority = constants_default.FAIL_PRIO;
- } else if (check.priority === constants_default.FAIL_PRIO) {
- check.priority = constants_default.PASS_PRIO;
- }
- }
- });
- var priorities = {
- all: nodeResult.all.reduce(function(a, b) {
- return Math.max(a, b.priority);
- }, 0),
- none: nodeResult.none.reduce(function(a, b) {
- return Math.max(a, b.priority);
- }, 0),
- any: nodeResult.any.reduce(function(a, b) {
- return Math.min(a, b.priority);
- }, 4) % 4
- };
- nodeResult.priority = Math.max(priorities.all, priorities.none, priorities.any);
- var impacts = [];
- checkTypes.forEach(function(type) {
- nodeResult[type] = nodeResult[type].filter(function(check) {
- return check.priority === nodeResult.priority && check.priority === priorities[type];
- });
- nodeResult[type].forEach(function(check) {
- return impacts.push(check.impact);
- });
- });
- if ([ CANTTELL_PRIO, FAIL_PRIO ].includes(nodeResult.priority)) {
- nodeResult.impact = aggregate_default(constants_default.impact, impacts);
- } else {
- nodeResult.impact = null;
- }
- anyAllNone(nodeResult, function(c) {
- delete c.result;
- delete c.priority;
- });
- nodeResult.result = constants_default.results[nodeResult.priority];
- delete nodeResult.priority;
- return nodeResult;
- }
- var aggregate_checks_default = aggregateChecks;
- function finalizeRuleResult(ruleResult) {
- var rule = axe._audit.rules.find(function(rule2) {
- return rule2.id === ruleResult.id;
- });
- if (rule && rule.impact) {
- ruleResult.nodes.forEach(function(node) {
- [ 'any', 'all', 'none' ].forEach(function(checkType) {
- (node[checkType] || []).forEach(function(checkResult) {
- checkResult.impact = rule.impact;
- });
- });
- });
- }
- Object.assign(ruleResult, aggregate_node_results_default(ruleResult.nodes));
- delete ruleResult.nodes;
- return ruleResult;
- }
- var finalize_result_default = finalizeRuleResult;
- function aggregateNodeResults(nodeResults) {
- var ruleResult = {};
- nodeResults = nodeResults.map(function(nodeResult) {
- if (nodeResult.any && nodeResult.all && nodeResult.none) {
- return aggregate_checks_default(nodeResult);
- } else if (Array.isArray(nodeResult.node)) {
- return finalize_result_default(nodeResult);
- } else {
- throw new TypeError('Invalid Result type');
- }
- });
- if (nodeResults && nodeResults.length) {
- var resultList = nodeResults.map(function(node) {
- return node.result;
- });
- ruleResult.result = aggregate_default(constants_default.results, resultList, ruleResult.result);
- } else {
- ruleResult.result = 'inapplicable';
- }
- constants_default.resultGroups.forEach(function(group) {
- return ruleResult[group] = [];
- });
- nodeResults.forEach(function(nodeResult) {
- var groupName = constants_default.resultGroupMap[nodeResult.result];
- ruleResult[groupName].push(nodeResult);
- });
- var impactGroup = constants_default.FAIL_GROUP;
- if (ruleResult[impactGroup].length === 0) {
- impactGroup = constants_default.CANTTELL_GROUP;
- }
- if (ruleResult[impactGroup].length > 0) {
- var impactList = ruleResult[impactGroup].map(function(failure) {
- return failure.impact;
- });
- ruleResult.impact = aggregate_default(constants_default.impact, impactList) || null;
- } else {
- ruleResult.impact = null;
- }
- return ruleResult;
- }
- var aggregate_node_results_default = aggregateNodeResults;
- function copyToGroup(resultObject, subResult, group) {
- var resultCopy = Object.assign({}, subResult);
- resultCopy.nodes = (resultCopy[group] || []).concat();
- constants_default.resultGroups.forEach(function(group2) {
- delete resultCopy[group2];
- });
- resultObject[group].push(resultCopy);
- }
- function aggregateResult(results) {
- var resultObject = {};
- constants_default.resultGroups.forEach(function(groupName) {
- return resultObject[groupName] = [];
- });
- results.forEach(function(subResult) {
- if (subResult.error) {
- copyToGroup(resultObject, subResult, constants_default.CANTTELL_GROUP);
- } else if (subResult.result === constants_default.NA) {
- copyToGroup(resultObject, subResult, constants_default.NA_GROUP);
- } else {
- constants_default.resultGroups.forEach(function(group) {
- if (Array.isArray(subResult[group]) && subResult[group].length > 0) {
- copyToGroup(resultObject, subResult, group);
- }
- });
- }
- });
- return resultObject;
- }
- var aggregate_result_default = aggregateResult;
- function areStylesSet(el, styles, stopAt) {
- var styl = window.getComputedStyle(el, null);
- if (!styl) {
- return false;
- }
- for (var i = 0; i < styles.length; ++i) {
- var att = styles[i];
- if (styl.getPropertyValue(att.property) === att.value) {
- return true;
- }
- }
- if (!el.parentNode || el.nodeName.toUpperCase() === stopAt.toUpperCase()) {
- return false;
- }
- return areStylesSet(el.parentNode, styles, stopAt);
- }
- var are_styles_set_default = areStylesSet;
- function assert(bool, message) {
- if (!bool) {
- throw new Error(message);
- }
- }
- var assert_default = assert;
- function toArray(thing) {
- return Array.prototype.slice.call(thing);
- }
- var to_array_default = toArray;
- function escapeSelector(value) {
- var string = String(value);
- var length = string.length;
- var index = -1;
- var codeUnit;
- var result = '';
- var firstCodeUnit = string.charCodeAt(0);
- while (++index < length) {
- codeUnit = string.charCodeAt(index);
- if (codeUnit == 0) {
- result += '\ufffd';
- continue;
- }
- if (codeUnit >= 1 && codeUnit <= 31 || codeUnit == 127 || index == 0 && codeUnit >= 48 && codeUnit <= 57 || index == 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit == 45) {
- result += '\\' + codeUnit.toString(16) + ' ';
- continue;
- }
- if (index == 0 && length == 1 && codeUnit == 45) {
- result += '\\' + string.charAt(index);
- continue;
- }
- if (codeUnit >= 128 || codeUnit == 45 || codeUnit == 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
- result += string.charAt(index);
- continue;
- }
- result += '\\' + string.charAt(index);
- }
- return result;
- }
- var escape_selector_default = escapeSelector;
- function isMostlyNumbers() {
- var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- return str.length !== 0 && (str.match(/[0-9]/g) || '').length >= str.length / 2;
- }
- function splitString(str, splitIndex) {
- return [ str.substring(0, splitIndex), str.substring(splitIndex) ];
- }
- function trimRight(str) {
- return str.replace(/\s+$/, '');
- }
- function uriParser(url) {
- var original = url;
- var protocol = '', domain = '', port = '', path = '', query = '', hash = '';
- if (url.includes('#')) {
- var _splitString = splitString(url, url.indexOf('#'));
- var _splitString2 = _slicedToArray(_splitString, 2);
- url = _splitString2[0];
- hash = _splitString2[1];
- }
- if (url.includes('?')) {
- var _splitString3 = splitString(url, url.indexOf('?'));
- var _splitString4 = _slicedToArray(_splitString3, 2);
- url = _splitString4[0];
- query = _splitString4[1];
- }
- if (url.includes('://')) {
- var _url$split = url.split('://');
- var _url$split2 = _slicedToArray(_url$split, 2);
- protocol = _url$split2[0];
- url = _url$split2[1];
- var _splitString5 = splitString(url, url.indexOf('/'));
- var _splitString6 = _slicedToArray(_splitString5, 2);
- domain = _splitString6[0];
- url = _splitString6[1];
- } else if (url.substr(0, 2) === '//') {
- url = url.substr(2);
- var _splitString7 = splitString(url, url.indexOf('/'));
- var _splitString8 = _slicedToArray(_splitString7, 2);
- domain = _splitString8[0];
- url = _splitString8[1];
- }
- if (domain.substr(0, 4) === 'www.') {
- domain = domain.substr(4);
- }
- if (domain && domain.includes(':')) {
- var _splitString9 = splitString(domain, domain.indexOf(':'));
- var _splitString10 = _slicedToArray(_splitString9, 2);
- domain = _splitString10[0];
- port = _splitString10[1];
- }
- path = url;
- return {
- original: original,
- protocol: protocol,
- domain: domain,
- port: port,
- path: path,
- query: query,
- hash: hash
- };
- }
- function getFriendlyUriEnd() {
- var uri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (uri.length <= 1 || uri.substr(0, 5) === 'data:' || uri.substr(0, 11) === 'javascript:' || uri.includes('?')) {
- return;
- }
- var currentDomain = options.currentDomain, _options$maxLength = options.maxLength, maxLength = _options$maxLength === void 0 ? 25 : _options$maxLength;
- var _uriParser = uriParser(uri), path = _uriParser.path, domain = _uriParser.domain, hash = _uriParser.hash;
- var pathEnd = path.substr(path.substr(0, path.length - 2).lastIndexOf('/') + 1);
- if (hash) {
- if (pathEnd && (pathEnd + hash).length <= maxLength) {
- return trimRight(pathEnd + hash);
- } else if (pathEnd.length < 2 && hash.length > 2 && hash.length <= maxLength) {
- return trimRight(hash);
- } else {
- return;
- }
- } else if (domain && domain.length < maxLength && path.length <= 1) {
- return trimRight(domain + path);
- }
- if (path === '/' + pathEnd && domain && currentDomain && domain !== currentDomain && (domain + path).length <= maxLength) {
- return trimRight(domain + path);
- }
- var lastDotIndex = pathEnd.lastIndexOf('.');
- if ((lastDotIndex === -1 || lastDotIndex > 1) && (lastDotIndex !== -1 || pathEnd.length > 2) && pathEnd.length <= maxLength && !pathEnd.match(/index(\.[a-zA-Z]{2-4})?/) && !isMostlyNumbers(pathEnd)) {
- return trimRight(pathEnd);
- }
- }
- var get_friendly_uri_end_default = getFriendlyUriEnd;
- function getNodeAttributes(node) {
- if (node.attributes instanceof window.NamedNodeMap) {
- return node.attributes;
- }
- return node.cloneNode(false).attributes;
- }
- var get_node_attributes_default = getNodeAttributes;
- var matchesSelector = function() {
- var method;
- function getMethod(node) {
- var index, candidate, candidates = [ 'matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector' ], length = candidates.length;
- for (index = 0; index < length; index++) {
- candidate = candidates[index];
- if (node[candidate]) {
- return candidate;
- }
- }
- }
- return function(node, selector) {
- if (!method || !node[method]) {
- method = getMethod(node);
- }
- if (node[method]) {
- return node[method](selector);
- }
- return false;
- };
- }();
- var element_matches_default = matchesSelector;
- function isXHTML(doc) {
- if (!doc.createElement) {
- return false;
- }
- return doc.createElement('A').localName === 'A';
- }
- var is_xhtml_default = isXHTML;
- function getShadowSelector(generateSelector2, elm) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- if (!elm) {
- return '';
- }
- var doc = elm.getRootNode && elm.getRootNode() || document;
- if (doc.nodeType !== 11) {
- return generateSelector2(elm, options, doc);
- }
- var stack = [];
- while (doc.nodeType === 11) {
- if (!doc.host) {
- return '';
- }
- stack.unshift({
- elm: elm,
- doc: doc
- });
- elm = doc.host;
- doc = elm.getRootNode();
- }
- stack.unshift({
- elm: elm,
- doc: doc
- });
- return stack.map(function(_ref) {
- var elm2 = _ref.elm, doc2 = _ref.doc;
- return generateSelector2(elm2, options, doc2);
- });
- }
- var get_shadow_selector_default = getShadowSelector;
- var xhtml;
- 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' ];
- var MAXATTRIBUTELENGTH = 31;
- var attrCharsRegex = /([\\"])/g;
- var newlineChars = /(\r\n|\r|\n)/g;
- function escapeAttribute(str) {
- return str.replace(attrCharsRegex, '\\$1').replace(newlineChars, '\\a ');
- }
- function getAttributeNameValue(node, at) {
- var name = at.name;
- var atnv;
- if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
- var friendly = get_friendly_uri_end_default(node.getAttribute(name));
- if (friendly) {
- atnv = escape_selector_default(at.name) + '$="' + escapeAttribute(friendly) + '"';
- } else {
- atnv = escape_selector_default(at.name) + '="' + escapeAttribute(node.getAttribute(name)) + '"';
- }
- } else {
- atnv = escape_selector_default(name) + '="' + escapeAttribute(at.value) + '"';
- }
- return atnv;
- }
- function countSort(a, b) {
- return a.count < b.count ? -1 : a.count === b.count ? 0 : 1;
- }
- function filterAttributes(at) {
- return !ignoredAttributes.includes(at.name) && at.name.indexOf(':') === -1 && (!at.value || at.value.length < MAXATTRIBUTELENGTH);
- }
- function _getSelectorData(domTree) {
- var data2 = {
- classes: {},
- tags: {},
- attributes: {}
- };
- domTree = Array.isArray(domTree) ? domTree : [ domTree ];
- var currentLevel = domTree.slice();
- var stack = [];
- var _loop2 = function _loop2() {
- var current = currentLevel.pop();
- var node = current.actualNode;
- if (!!node.querySelectorAll) {
- var tag = node.nodeName;
- if (data2.tags[tag]) {
- data2.tags[tag]++;
- } else {
- data2.tags[tag] = 1;
- }
- if (node.classList) {
- Array.from(node.classList).forEach(function(cl) {
- var ind = escape_selector_default(cl);
- if (data2.classes[ind]) {
- data2.classes[ind]++;
- } else {
- data2.classes[ind] = 1;
- }
- });
- }
- if (node.hasAttributes()) {
- Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
- var atnv = getAttributeNameValue(node, at);
- if (atnv) {
- if (data2.attributes[atnv]) {
- data2.attributes[atnv]++;
- } else {
- data2.attributes[atnv] = 1;
- }
- }
- });
- }
- }
- if (current.children.length) {
- stack.push(currentLevel);
- currentLevel = current.children.slice();
- }
- while (!currentLevel.length && stack.length) {
- currentLevel = stack.pop();
- }
- };
- while (currentLevel.length) {
- _loop2();
- }
- return data2;
- }
- function uncommonClasses(node, selectorData) {
- var retVal = [];
- var classData = selectorData.classes;
- var tagData = selectorData.tags;
- if (node.classList) {
- Array.from(node.classList).forEach(function(cl) {
- var ind = escape_selector_default(cl);
- if (classData[ind] < tagData[node.nodeName]) {
- retVal.push({
- name: ind,
- count: classData[ind],
- species: 'class'
- });
- }
- });
- }
- return retVal.sort(countSort);
- }
- function getNthChildString(elm, selector) {
- var siblings = elm.parentNode && Array.from(elm.parentNode.children || '') || [];
- var hasMatchingSiblings = siblings.find(function(sibling) {
- return sibling !== elm && element_matches_default(sibling, selector);
- });
- if (hasMatchingSiblings) {
- var nthChild = 1 + siblings.indexOf(elm);
- return ':nth-child(' + nthChild + ')';
- } else {
- return '';
- }
- }
- function getElmId(elm) {
- if (!elm.getAttribute('id')) {
- return;
- }
- var doc = elm.getRootNode && elm.getRootNode() || document;
- var id = '#' + escape_selector_default(elm.getAttribute('id') || '');
- if (!id.match(/player_uid_/) && doc.querySelectorAll(id).length === 1) {
- return id;
- }
- }
- function getBaseSelector(elm) {
- if (typeof xhtml === 'undefined') {
- xhtml = is_xhtml_default(document);
- }
- return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
- }
- function uncommonAttributes(node, selectorData) {
- var retVal = [];
- var attData = selectorData.attributes;
- var tagData = selectorData.tags;
- if (node.hasAttributes()) {
- Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
- var atnv = getAttributeNameValue(node, at);
- if (atnv && attData[atnv] < tagData[node.nodeName]) {
- retVal.push({
- name: atnv,
- count: attData[atnv],
- species: 'attribute'
- });
- }
- });
- }
- return retVal.sort(countSort);
- }
- function getThreeLeastCommonFeatures(elm, selectorData) {
- var selector = '';
- var features;
- var clss = uncommonClasses(elm, selectorData);
- var atts = uncommonAttributes(elm, selectorData);
- if (clss.length && clss[0].count === 1) {
- features = [ clss[0] ];
- } else if (atts.length && atts[0].count === 1) {
- features = [ atts[0] ];
- selector = getBaseSelector(elm);
- } else {
- features = clss.concat(atts);
- features.sort(countSort);
- features = features.slice(0, 3);
- if (!features.some(function(feat) {
- return feat.species === 'class';
- })) {
- selector = getBaseSelector(elm);
- } else {
- features.sort(function(a, b) {
- return a.species !== b.species && a.species === 'class' ? -1 : a.species === b.species ? 0 : 1;
- });
- }
- }
- return selector += features.reduce(function(val, feat) {
- switch (feat.species) {
- case 'class':
- return val + '.' + feat.name;
- case 'attribute':
- return val + '[' + feat.name + ']';
- }
- return val;
- }, '');
- }
- function generateSelector(elm, options, doc) {
- if (!axe._selectorData) {
- throw new Error('Expect axe._selectorData to be set up');
- }
- var _options$toRoot = options.toRoot, toRoot = _options$toRoot === void 0 ? false : _options$toRoot;
- var selector;
- var similar;
- do {
- var features = getElmId(elm);
- if (!features) {
- features = getThreeLeastCommonFeatures(elm, axe._selectorData);
- features += getNthChildString(elm, features);
- }
- if (selector) {
- selector = features + ' > ' + selector;
- } else {
- selector = features;
- }
- if (!similar) {
- similar = Array.from(doc.querySelectorAll(selector));
- } else {
- similar = similar.filter(function(item) {
- return element_matches_default(item, selector);
- });
- }
- elm = elm.parentElement;
- } while ((similar.length > 1 || toRoot) && elm && elm.nodeType !== 11);
- if (similar.length === 1) {
- return selector;
- } else if (selector.indexOf(' > ') !== -1) {
- return ':root' + selector.substring(selector.indexOf(' > '));
- }
- return ':root';
- }
- function _getSelector(elm, options) {
- return get_shadow_selector_default(generateSelector, elm, options);
- }
- function generateAncestry(node) {
- var nodeName2 = node.nodeName.toLowerCase();
- var parent = node.parentElement;
- if (!parent) {
- return nodeName2;
- }
- var nthChild = '';
- if (nodeName2 !== 'head' && nodeName2 !== 'body' && parent.children.length > 1) {
- var index = Array.prototype.indexOf.call(parent.children, node) + 1;
- nthChild = ':nth-child('.concat(index, ')');
- }
- return generateAncestry(parent) + ' > ' + nodeName2 + nthChild;
- }
- function _getAncestry(elm, options) {
- return get_shadow_selector_default(generateAncestry, elm, options);
- }
- function getXPathArray(node, path) {
- var sibling, count;
- if (!node) {
- return [];
- }
- if (!path && node.nodeType === 9) {
- path = [ {
- str: 'html'
- } ];
- return path;
- }
- path = path || [];
- if (node.parentNode && node.parentNode !== node) {
- path = getXPathArray(node.parentNode, path);
- }
- if (node.previousSibling) {
- count = 1;
- sibling = node.previousSibling;
- do {
- if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
- count++;
- }
- sibling = sibling.previousSibling;
- } while (sibling);
- if (count === 1) {
- count = null;
- }
- } else if (node.nextSibling) {
- sibling = node.nextSibling;
- do {
- if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
- count = 1;
- sibling = null;
- } else {
- count = null;
- sibling = sibling.previousSibling;
- }
- } while (sibling);
- }
- if (node.nodeType === 1) {
- var element = {};
- element.str = node.nodeName.toLowerCase();
- var id = node.getAttribute && escape_selector_default(node.getAttribute('id'));
- if (id && node.ownerDocument.querySelectorAll('#' + id).length === 1) {
- element.id = node.getAttribute('id');
- }
- if (count > 1) {
- element.count = count;
- }
- path.push(element);
- }
- return path;
- }
- function xpathToString(xpathArray) {
- return xpathArray.reduce(function(str, elm) {
- if (elm.id) {
- return '/'.concat(elm.str, '[@id=\'').concat(elm.id, '\']');
- } else {
- return str + '/'.concat(elm.str) + (elm.count > 0 ? '['.concat(elm.count, ']') : '');
- }
- }, '');
- }
- function getXpath(node) {
- var xpathArray = getXPathArray(node);
- return xpathToString(xpathArray);
- }
- var get_xpath_default = getXpath;
- var _cache = {};
- var cache = {
- set: function set(key, value) {
- validateKey(key);
- _cache[key] = value;
- },
- get: function get(key, creator) {
- validateCreator(creator);
- if (key in _cache) {
- return _cache[key];
- }
- if (typeof creator === 'function') {
- var value = creator();
- assert_default(value !== void 0, 'Cache creator function should not return undefined');
- this.set(key, value);
- return _cache[key];
- }
- },
- clear: function clear() {
- _cache = {};
- }
- };
- function validateKey(key) {
- assert_default(typeof key === 'string', 'key must be a string, ' + _typeof(key) + ' given');
- assert_default(key !== '', 'key must not be empty');
- }
- function validateCreator(creator) {
- assert_default(typeof creator === 'function' || typeof creator === 'undefined', 'creator must be a function or undefined, ' + _typeof(creator) + ' given');
- }
- var cache_default = cache;
- function getNodeFromTree(vNode, node) {
- var el = node || vNode;
- return cache_default.get('nodeMap') ? cache_default.get('nodeMap').get(el) : null;
- }
- var get_node_from_tree_default = getNodeFromTree;
- function truncate(str, maxLength) {
- maxLength = maxLength || 300;
- if (str.length > maxLength) {
- var index = str.indexOf('>');
- str = str.substring(0, index + 1);
- }
- return str;
- }
- function getSource(element) {
- if (!(element !== null && element !== void 0 && element.outerHTML)) {
- return '';
- }
- var source = element.outerHTML;
- if (!source && typeof window.XMLSerializer === 'function') {
- source = new window.XMLSerializer().serializeToString(element);
- }
- return truncate(source || '');
- }
- function DqElement(elm) {
- var _this$spec$selector, _this$_virtualNode;
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var spec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- this.spec = spec;
- if (elm instanceof abstract_virtual_node_default) {
- this._virtualNode = elm;
- this._element = elm.actualNode;
- } else {
- this._element = elm;
- this._virtualNode = get_node_from_tree_default(elm);
- }
- this.fromFrame = ((_this$spec$selector = this.spec.selector) === null || _this$spec$selector === void 0 ? void 0 : _this$spec$selector.length) > 1;
- if (options.absolutePaths) {
- this._options = {
- toRoot: true
- };
- }
- this.nodeIndexes = [];
- if (Array.isArray(this.spec.nodeIndexes)) {
- this.nodeIndexes = this.spec.nodeIndexes;
- } else if (typeof ((_this$_virtualNode = this._virtualNode) === null || _this$_virtualNode === void 0 ? void 0 : _this$_virtualNode.nodeIndex) === 'number') {
- this.nodeIndexes = [ this._virtualNode.nodeIndex ];
- }
- this.source = null;
- if (!axe._audit.noHtml) {
- var _this$spec$source;
- this.source = (_this$spec$source = this.spec.source) !== null && _this$spec$source !== void 0 ? _this$spec$source : getSource(this._element);
- }
- }
- DqElement.prototype = {
- get selector() {
- return this.spec.selector || [ _getSelector(this.element, this._options) ];
- },
- get ancestry() {
- return this.spec.ancestry || [ _getAncestry(this.element) ];
- },
- get xpath() {
- return this.spec.xpath || [ get_xpath_default(this.element) ];
- },
- get element() {
- return this._element;
- },
- toJSON: function toJSON() {
- return {
- selector: this.selector,
- source: this.source,
- xpath: this.xpath,
- ancestry: this.ancestry,
- nodeIndexes: this.nodeIndexes
- };
- }
- };
- DqElement.fromFrame = function fromFrame(node, options, frame) {
- var spec = DqElement.mergeSpecs(node, frame);
- return new DqElement(frame.element, options, spec);
- };
- DqElement.mergeSpecs = function mergeSpec(node, frame) {
- return _extends({}, node, {
- selector: [].concat(_toConsumableArray(frame.selector), _toConsumableArray(node.selector)),
- ancestry: [].concat(_toConsumableArray(frame.ancestry), _toConsumableArray(node.ancestry)),
- xpath: [].concat(_toConsumableArray(frame.xpath), _toConsumableArray(node.xpath)),
- nodeIndexes: [].concat(_toConsumableArray(frame.nodeIndexes), _toConsumableArray(node.nodeIndexes))
- });
- };
- var dq_element_default = DqElement;
- function checkHelper(checkResult, options, resolve, reject) {
- return {
- isAsync: false,
- async: function async() {
- this.isAsync = true;
- return function(result) {
- if (result instanceof Error === false) {
- checkResult.result = result;
- resolve(checkResult);
- } else {
- reject(result);
- }
- };
- },
- data: function data(data2) {
- checkResult.data = data2;
- },
- relatedNodes: function relatedNodes(nodes) {
- if (!window.Node) {
- return;
- }
- nodes = nodes instanceof window.Node ? [ nodes ] : to_array_default(nodes);
- if (!nodes.every(function(node) {
- return node instanceof window.Node || node.actualNode;
- })) {
- return;
- }
- checkResult.relatedNodes = nodes.map(function(element) {
- return new dq_element_default(element, options);
- });
- }
- };
- }
- var check_helper_default = checkHelper;
- function clone(obj) {
- var _window, _window2;
- var index, length, out = obj;
- 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) {
- return obj;
- }
- if (obj !== null && _typeof(obj) === 'object') {
- if (Array.isArray(obj)) {
- out = [];
- for (index = 0, length = obj.length; index < length; index++) {
- out[index] = clone(obj[index]);
- }
- } else {
- out = {};
- for (index in obj) {
- out[index] = clone(obj[index]);
- }
- }
- }
- return out;
- }
- var clone_default = clone;
- var import_css_selector_parser = __toModule(require_lib());
- var parser = new import_css_selector_parser.CssSelectorParser();
- parser.registerSelectorPseudos('not');
- parser.registerSelectorPseudos('is');
- parser.registerNestingOperators('>');
- parser.registerAttrEqualityMods('^', '$', '*', '~');
- var css_parser_default = parser;
- function matchesTag(vNode, exp) {
- return vNode.props.nodeType === 1 && (exp.tag === '*' || vNode.props.nodeName === exp.tag);
- }
- function matchesClasses(vNode, exp) {
- return !exp.classes || exp.classes.every(function(cl) {
- return vNode.hasClass(cl.value);
- });
- }
- function matchesAttributes(vNode, exp) {
- return !exp.attributes || exp.attributes.every(function(att) {
- var nodeAtt = vNode.attr(att.key);
- return nodeAtt !== null && att.test(nodeAtt);
- });
- }
- function matchesId(vNode, exp) {
- return !exp.id || vNode.props.id === exp.id;
- }
- function matchesPseudos(target, exp) {
- if (!exp.pseudos || exp.pseudos.every(function(pseudo) {
- if (pseudo.name === 'not') {
- return !pseudo.expressions.some(function(expression) {
- return _matchesExpression(target, expression);
- });
- } else if (pseudo.name === 'is') {
- return pseudo.expressions.some(function(expression) {
- return _matchesExpression(target, expression);
- });
- }
- throw new Error('the pseudo selector ' + pseudo.name + ' has not yet been implemented');
- })) {
- return true;
- }
- return false;
- }
- function matchExpression(vNode, expression) {
- return matchesTag(vNode, expression) && matchesClasses(vNode, expression) && matchesAttributes(vNode, expression) && matchesId(vNode, expression) && matchesPseudos(vNode, expression);
- }
- var escapeRegExp = function() {
- var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;
- var to = '\\';
- return function(string) {
- return string.replace(from, to);
- };
- }();
- var reUnescape = /\\/g;
- function convertAttributes(atts) {
- if (!atts) {
- return;
- }
- return atts.map(function(att) {
- var attributeKey = att.name.replace(reUnescape, '');
- var attributeValue = (att.value || '').replace(reUnescape, '');
- var test, regexp;
- switch (att.operator) {
- case '^=':
- regexp = new RegExp('^' + escapeRegExp(attributeValue));
- break;
- case '$=':
- regexp = new RegExp(escapeRegExp(attributeValue) + '$');
- break;
- case '~=':
- regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)');
- break;
- case '|=':
- regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');
- break;
- case '=':
- test = function test(value) {
- return attributeValue === value;
- };
- break;
- case '*=':
- test = function test(value) {
- return value && value.includes(attributeValue);
- };
- break;
- case '!=':
- test = function test(value) {
- return attributeValue !== value;
- };
- break;
- default:
- test = function test(value) {
- return value !== null;
- };
- }
- if (attributeValue === '' && /^[*$^]=$/.test(att.operator)) {
- test = function test() {
- return false;
- };
- }
- if (!test) {
- test = function test(value) {
- return value && regexp.test(value);
- };
- }
- return {
- key: attributeKey,
- value: attributeValue,
- type: typeof att.value === 'undefined' ? 'attrExist' : 'attrValue',
- test: test
- };
- });
- }
- function convertClasses(classes) {
- if (!classes) {
- return;
- }
- return classes.map(function(className) {
- className = className.replace(reUnescape, '');
- return {
- value: className,
- regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
- };
- });
- }
- function convertPseudos(pseudos) {
- if (!pseudos) {
- return;
- }
- return pseudos.map(function(p) {
- var expressions;
- if ([ 'is', 'not' ].includes(p.name)) {
- expressions = p.value;
- expressions = expressions.selectors ? expressions.selectors : [ expressions ];
- expressions = convertExpressions(expressions);
- }
- return {
- name: p.name,
- expressions: expressions,
- value: p.value
- };
- });
- }
- function convertExpressions(expressions) {
- return expressions.map(function(exp) {
- var newExp = [];
- var rule = exp.rule;
- while (rule) {
- newExp.push({
- tag: rule.tagName ? rule.tagName.toLowerCase() : '*',
- combinator: rule.nestingOperator ? rule.nestingOperator : ' ',
- id: rule.id,
- attributes: convertAttributes(rule.attrs),
- classes: convertClasses(rule.classNames),
- pseudos: convertPseudos(rule.pseudos)
- });
- rule = rule.rule;
- }
- return newExp;
- });
- }
- function _convertSelector(selector) {
- var expressions = css_parser_default.parse(selector);
- expressions = expressions.selectors ? expressions.selectors : [ expressions ];
- return convertExpressions(expressions);
- }
- function optimizedMatchesExpression(vNode, expressions, index, matchAnyParent) {
- if (!vNode) {
- return false;
- }
- var isArray = Array.isArray(expressions);
- var expression = isArray ? expressions[index] : expressions;
- var matches4 = matchExpression(vNode, expression);
- while (!matches4 && matchAnyParent && vNode.parent) {
- vNode = vNode.parent;
- matches4 = matchExpression(vNode, expression);
- }
- if (index > 0) {
- if ([ ' ', '>' ].includes(expression.combinator) === false) {
- throw new Error('axe.utils.matchesExpression does not support the combinator: ' + expression.combinator);
- }
- matches4 = matches4 && optimizedMatchesExpression(vNode.parent, expressions, index - 1, expression.combinator === ' ');
- }
- return matches4;
- }
- function _matchesExpression(vNode, expressions, matchAnyParent) {
- return optimizedMatchesExpression(vNode, expressions, expressions.length - 1, matchAnyParent);
- }
- function matches(vNode, selector) {
- var expressions = _convertSelector(selector);
- return expressions.some(function(expression) {
- return _matchesExpression(vNode, expression);
- });
- }
- var matches_default = matches;
- function closest(vNode, selector) {
- while (vNode) {
- if (matches_default(vNode, selector)) {
- return vNode;
- }
- if (typeof vNode.parent === 'undefined') {
- throw new TypeError('Cannot resolve parent for non-DOM nodes');
- }
- vNode = vNode.parent;
- }
- return null;
- }
- var closest_default = closest;
- function noop() {}
- function funcGuard(f) {
- if (typeof f !== 'function') {
- throw new TypeError('Queue methods require functions as arguments');
- }
- }
- function queue() {
- var tasks = [];
- var started = 0;
- var remaining = 0;
- var completeQueue = noop;
- var complete = false;
- var err2;
- var defaultFail = function defaultFail(e) {
- err2 = e;
- setTimeout(function() {
- if (err2 !== void 0 && err2 !== null) {
- log_default('Uncaught error (of queue)', err2);
- }
- }, 1);
- };
- var failed = defaultFail;
- function createResolve(i) {
- return function(r) {
- tasks[i] = r;
- remaining -= 1;
- if (!remaining && completeQueue !== noop) {
- complete = true;
- completeQueue(tasks);
- }
- };
- }
- function abort(msg) {
- completeQueue = noop;
- failed(msg);
- return tasks;
- }
- function pop() {
- var length = tasks.length;
- for (;started < length; started++) {
- var task = tasks[started];
- try {
- task.call(null, createResolve(started), abort);
- } catch (e) {
- abort(e);
- }
- }
- }
- var q = {
- defer: function defer(fn) {
- if (_typeof(fn) === 'object' && fn.then && fn['catch']) {
- var defer = fn;
- fn = function fn(resolve, reject) {
- defer.then(resolve)['catch'](reject);
- };
- }
- funcGuard(fn);
- if (err2 !== void 0) {
- return;
- } else if (complete) {
- throw new Error('Queue already completed');
- }
- tasks.push(fn);
- ++remaining;
- pop();
- return q;
- },
- then: function then(fn) {
- funcGuard(fn);
- if (completeQueue !== noop) {
- throw new Error('queue `then` already set');
- }
- if (!err2) {
- completeQueue = fn;
- if (!remaining) {
- complete = true;
- completeQueue(tasks);
- }
- }
- return q;
- },
- catch: function _catch(fn) {
- funcGuard(fn);
- if (failed !== defaultFail) {
- throw new Error('queue `catch` already set');
- }
- if (!err2) {
- failed = fn;
- } else {
- fn(err2);
- err2 = null;
- }
- return q;
- },
- abort: abort
- };
- return q;
- }
- var queue_default = queue;
- var uuid;
- var _rng;
- var _crypto = window.crypto || window.msCrypto;
- if (!_rng && _crypto && _crypto.getRandomValues) {
- _rnds8 = new Uint8Array(16);
- _rng = function whatwgRNG() {
- _crypto.getRandomValues(_rnds8);
- return _rnds8;
- };
- }
- var _rnds8;
- if (!_rng) {
- _rnds = new Array(16);
- _rng = function _rng() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 3) === 0) {
- r = Math.random() * 4294967296;
- }
- _rnds[i] = r >>> ((i & 3) << 3) & 255;
- }
- return _rnds;
- };
- }
- var _rnds;
- var BufferClass = typeof window.Buffer == 'function' ? window.Buffer : Array;
- var _byteToHex = [];
- var _hexToByte = {};
- for (var i = 0; i < 256; i++) {
- _byteToHex[i] = (i + 256).toString(16).substr(1);
- _hexToByte[_byteToHex[i]] = i;
- }
- function parse(s, buf, offset) {
- var i = buf && offset || 0, ii = 0;
- buf = buf || [];
- s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
- if (ii < 16) {
- buf[i + ii++] = _hexToByte[oct];
- }
- });
- while (ii < 16) {
- buf[i + ii++] = 0;
- }
- return buf;
- }
- function unparse(buf, offset) {
- var i = offset || 0, bth = _byteToHex;
- 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++]];
- }
- var _seedBytes = _rng();
- var _nodeId = [ _seedBytes[0] | 1, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] ];
- var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 16383;
- var _lastMSecs = 0;
- var _lastNSecs = 0;
- function v1(options, buf, offset) {
- var i = buf && offset || 0;
- var b = buf || [];
- options = options || {};
- var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
- var msecs = options.msecs != null ? options.msecs : new Date().getTime();
- var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
- var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
- if (dt < 0 && options.clockseq == null) {
- clockseq = clockseq + 1 & 16383;
- }
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
- nsecs = 0;
- }
- if (nsecs >= 1e4) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
- _lastMSecs = msecs;
- _lastNSecs = nsecs;
- _clockseq = clockseq;
- msecs += 122192928e5;
- var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
- b[i++] = tl >>> 24 & 255;
- b[i++] = tl >>> 16 & 255;
- b[i++] = tl >>> 8 & 255;
- b[i++] = tl & 255;
- var tmh = msecs / 4294967296 * 1e4 & 268435455;
- b[i++] = tmh >>> 8 & 255;
- b[i++] = tmh & 255;
- b[i++] = tmh >>> 24 & 15 | 16;
- b[i++] = tmh >>> 16 & 255;
- b[i++] = clockseq >>> 8 | 128;
- b[i++] = clockseq & 255;
- var node = options.node || _nodeId;
- for (var n = 0; n < 6; n++) {
- b[i + n] = node[n];
- }
- return buf ? buf : unparse(b);
- }
- function v4(options, buf, offset) {
- var i = buf && offset || 0;
- if (typeof options == 'string') {
- buf = options == 'binary' ? new BufferClass(16) : null;
- options = null;
- }
- options = options || {};
- var rnds = options.random || (options.rng || _rng)();
- rnds[6] = rnds[6] & 15 | 64;
- rnds[8] = rnds[8] & 63 | 128;
- if (buf) {
- for (var ii = 0; ii < 16; ii++) {
- buf[i + ii] = rnds[ii];
- }
- }
- return buf || unparse(rnds);
- }
- uuid = v4;
- uuid.v1 = v1;
- uuid.v4 = v4;
- uuid.parse = parse;
- uuid.unparse = unparse;
- uuid.BufferClass = BufferClass;
- axe._uuid = v1();
- var uuid_default = v4;
- var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
- function stringifyMessage(_ref2) {
- var topic = _ref2.topic, channelId = _ref2.channelId, message = _ref2.message, messageId = _ref2.messageId, keepalive = _ref2.keepalive;
- var data2 = {
- channelId: channelId,
- topic: topic,
- messageId: messageId,
- keepalive: !!keepalive,
- source: getSource2()
- };
- if (message instanceof Error) {
- data2.error = {
- name: message.name,
- message: message.message,
- stack: message.stack
- };
- } else {
- data2.payload = message;
- }
- return JSON.stringify(data2);
- }
- function parseMessage(dataString) {
- var data2;
- try {
- data2 = JSON.parse(dataString);
- } catch (e) {
- return;
- }
- if (!isRespondableMessage(data2)) {
- return;
- }
- var _data = data2, topic = _data.topic, channelId = _data.channelId, messageId = _data.messageId, keepalive = _data.keepalive;
- var message = _typeof(data2.error) === 'object' ? buildErrorObject(data2.error) : data2.payload;
- return {
- topic: topic,
- message: message,
- messageId: messageId,
- channelId: channelId,
- keepalive: !!keepalive
- };
- }
- function isRespondableMessage(postedMessage) {
- return postedMessage !== null && _typeof(postedMessage) === 'object' && typeof postedMessage.channelId === 'string' && postedMessage.source === getSource2();
- }
- function buildErrorObject(error) {
- var msg = error.message || 'Unknown error occurred';
- var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
- var ErrConstructor = window[errorName] || Error;
- if (error.stack) {
- msg += '\n' + error.stack.replace(error.message, '');
- }
- return new ErrConstructor(msg);
- }
- function getSource2() {
- var application = 'axeAPI';
- var version = '';
- if (typeof axe !== 'undefined' && axe._audit && axe._audit.application) {
- application = axe._audit.application;
- }
- if (typeof axe !== 'undefined') {
- version = axe.version;
- }
- return application + '.' + version;
- }
- function assertIsParentWindow(win) {
- assetNotGlobalWindow(win);
- assert_default(window.parent === win, 'Source of the response must be the parent window.');
- }
- function assertIsFrameWindow(win) {
- assetNotGlobalWindow(win);
- assert_default(win.parent === window, 'Respondable target must be a frame in the current window');
- }
- function assetNotGlobalWindow(win) {
- assert_default(window !== win, 'Messages can not be sent to the same window.');
- }
- var channels = {};
- function storeReplyHandler(channelId, replyHandler) {
- var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- assert_default(!channels[channelId], 'A replyHandler already exists for this message channel.');
- channels[channelId] = {
- replyHandler: replyHandler,
- sendToParent: sendToParent
- };
- }
- function getReplyHandler(channelId) {
- return channels[channelId];
- }
- function deleteReplyHandler(channelId) {
- delete channels[channelId];
- }
- var messageIds = [];
- function createMessageId() {
- var uuid2 = ''.concat(v4(), ':').concat(v4());
- if (messageIds.includes(uuid2)) {
- return createMessageId();
- }
- messageIds.push(uuid2);
- return uuid2;
- }
- function isNewMessage(uuid2) {
- if (messageIds.includes(uuid2)) {
- return false;
- }
- messageIds.push(uuid2);
- return true;
- }
- function postMessage(win, data2, sendToParent, replyHandler) {
- if (typeof replyHandler === 'function') {
- storeReplyHandler(data2.channelId, replyHandler, sendToParent);
- }
- sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
- if (data2.message instanceof Error && !sendToParent) {
- axe.log(data2.message);
- return false;
- }
- var dataString = stringifyMessage(_extends({
- messageId: createMessageId()
- }, data2));
- var allowedOrigins = axe._audit.allowedOrigins;
- if (!allowedOrigins || !allowedOrigins.length) {
- return false;
- }
- allowedOrigins.forEach(function(origin) {
- try {
- win.postMessage(dataString, origin);
- } catch (err2) {
- if (err2 instanceof win.DOMException) {
- throw new Error('allowedOrigins value "'.concat(origin, '" is not a valid origin'));
- }
- throw err2;
- }
- });
- return true;
- }
- function processError(win, error, channelId) {
- if (!win.parent !== window) {
- return axe.log(error);
- }
- try {
- postMessage(win, {
- topic: null,
- channelId: channelId,
- message: error,
- messageId: createMessageId(),
- keepalive: true
- }, true);
- } catch (err2) {
- return axe.log(err2);
- }
- }
- function createResponder(win, channelId) {
- var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- return function respond(message, keepalive, replyHandler) {
- var data2 = {
- channelId: channelId,
- message: message,
- keepalive: keepalive
- };
- postMessage(win, data2, sendToParent, replyHandler);
- };
- }
- function originIsAllowed(origin) {
- var allowedOrigins = axe._audit.allowedOrigins;
- return allowedOrigins && allowedOrigins.includes('*') || allowedOrigins.includes(origin);
- }
- function messageHandler(_ref3, topicHandler) {
- var origin = _ref3.origin, dataString = _ref3.data, win = _ref3.source;
- try {
- var data2 = parseMessage(dataString) || {};
- var channelId = data2.channelId, message = data2.message, messageId = data2.messageId;
- if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
- return;
- }
- if (message instanceof Error && win.parent !== window) {
- axe.log(message);
- return false;
- }
- try {
- if (data2.topic) {
- var responder = createResponder(win, channelId);
- assertIsParentWindow(win);
- topicHandler(data2, responder);
- } else {
- callReplyHandler(win, data2);
- }
- } catch (error) {
- processError(win, error, channelId);
- }
- } catch (error) {
- axe.log(error);
- return false;
- }
- }
- function callReplyHandler(win, data2) {
- var channelId = data2.channelId, message = data2.message, keepalive = data2.keepalive;
- var _ref4 = getReplyHandler(channelId) || {}, replyHandler = _ref4.replyHandler, sendToParent = _ref4.sendToParent;
- if (!replyHandler) {
- return;
- }
- sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
- var responder = createResponder(win, channelId, sendToParent);
- if (!keepalive && channelId) {
- deleteReplyHandler(channelId);
- }
- try {
- replyHandler(message, keepalive, responder);
- } catch (error) {
- axe.log(error);
- responder(error, keepalive);
- }
- }
- var frameMessenger = {
- open: function open(topicHandler) {
- if (typeof window.addEventListener !== 'function') {
- return;
- }
- var handler = function handler(messageEvent) {
- messageHandler(messageEvent, topicHandler);
- };
- window.addEventListener('message', handler, false);
- return function() {
- window.removeEventListener('message', handler, false);
- };
- },
- post: function post(win, data2, replyHandler) {
- if (typeof window.addEventListener !== 'function') {
- return false;
- }
- return postMessage(win, data2, false, replyHandler);
- }
- };
- function setDefaultFrameMessenger(respondable2) {
- respondable2.updateMessenger(frameMessenger);
- }
- var closeHandler;
- var postMessage2;
- var topicHandlers = {};
- function _respondable(win, topic, message, keepalive, replyHandler) {
- var data2 = {
- topic: topic,
- message: message,
- channelId: ''.concat(v4(), ':').concat(v4()),
- keepalive: keepalive
- };
- return postMessage2(win, data2, replyHandler);
- }
- function messageListener(data2, responder) {
- var topic = data2.topic, message = data2.message, keepalive = data2.keepalive;
- var topicHandler = topicHandlers[topic];
- if (!topicHandler) {
- return;
- }
- try {
- topicHandler(message, keepalive, responder);
- } catch (error) {
- axe.log(error);
- responder(error, keepalive);
- }
- }
- _respondable.updateMessenger = function updateMessenger(_ref5) {
- var open = _ref5.open, post = _ref5.post;
- assert_default(typeof open === 'function', 'open callback must be a function');
- assert_default(typeof post === 'function', 'post callback must be a function');
- if (closeHandler) {
- closeHandler();
- }
- var close = open(messageListener);
- if (close) {
- assert_default(typeof close === 'function', 'open callback must return a cleanup function');
- closeHandler = close;
- } else {
- closeHandler = null;
- }
- postMessage2 = post;
- };
- _respondable.subscribe = function subscribe(topic, topicHandler) {
- assert_default(typeof topicHandler === 'function', 'Subscriber callback must be a function');
- assert_default(!topicHandlers[topic], 'Topic '.concat(topic, ' is already registered to.'));
- topicHandlers[topic] = topicHandler;
- };
- _respondable.isInFrame = function isInFrame() {
- var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
- return !!win.frameElement;
- };
- setDefaultFrameMessenger(_respondable);
- function _sendCommandToFrame(node, parameters, resolve, reject) {
- var _parameters$options$p, _parameters$options;
- var win = node.contentWindow;
- 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;
- if (!win) {
- log_default('Frame does not have a content window', node);
- resolve(null);
- return;
- }
- if (pingWaitTime === 0) {
- callAxeStart(node, parameters, resolve, reject);
- return;
- }
- var timeout = setTimeout(function() {
- timeout = setTimeout(function() {
- if (!parameters.debug) {
- resolve(null);
- } else {
- reject(err('No response from frame', node));
- }
- }, 0);
- }, pingWaitTime);
- _respondable(win, 'axe.ping', null, void 0, function() {
- clearTimeout(timeout);
- callAxeStart(node, parameters, resolve, reject);
- });
- }
- function callAxeStart(node, parameters, resolve, reject) {
- var _parameters$options$f, _parameters$options2;
- 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;
- var win = node.contentWindow;
- var timeout = setTimeout(function collectResultFramesTimeout() {
- reject(err('Axe in frame timed out', node));
- }, frameWaitTime);
- _respondable(win, 'axe.start', parameters, void 0, function(data2) {
- clearTimeout(timeout);
- if (data2 instanceof Error === false) {
- resolve(data2);
- } else {
- reject(data2);
- }
- });
- }
- function err(message, node) {
- var selector;
- if (axe._tree) {
- selector = _getSelector(node);
- }
- return new Error(message + ': ' + (selector || node));
- }
- function getAllChecks(object) {
- var result = [];
- return result.concat(object.any || []).concat(object.all || []).concat(object.none || []);
- }
- var get_all_checks_default = getAllChecks;
- function findBy(array, key, value) {
- if (Array.isArray(array)) {
- return array.find(function(obj) {
- return _typeof(obj) === 'object' && obj[key] === value;
- });
- }
- }
- var find_by_default = findBy;
- function pushFrame(resultSet, options, frameSpec) {
- resultSet.forEach(function(res) {
- res.node = dq_element_default.fromFrame(res.node, options, frameSpec);
- var checks = get_all_checks_default(res);
- checks.forEach(function(check) {
- check.relatedNodes = check.relatedNodes.map(function(node) {
- return dq_element_default.fromFrame(node, options, frameSpec);
- });
- });
- });
- }
- function spliceNodes(target, to) {
- var firstFromFrame = to[0].node;
- for (var _i2 = 0; _i2 < target.length; _i2++) {
- var node = target[_i2].node;
- var resultSort = nodeIndexSort(node.nodeIndexes, firstFromFrame.nodeIndexes);
- if (resultSort > 0 || resultSort === 0 && firstFromFrame.selector.length < node.selector.length) {
- target.splice.apply(target, [ _i2, 0 ].concat(_toConsumableArray(to)));
- return;
- }
- }
- target.push.apply(target, _toConsumableArray(to));
- }
- function normalizeResult(result) {
- if (!result || !result.results) {
- return null;
- }
- if (!Array.isArray(result.results)) {
- return [ result.results ];
- }
- if (!result.results.length) {
- return null;
- }
- return result.results;
- }
- function mergeResults(frameResults, options) {
- var mergedResult = [];
- frameResults.forEach(function(frameResult) {
- var results = normalizeResult(frameResult);
- if (!results || !results.length) {
- return;
- }
- var frameSpec = getFrameSpec(frameResult, options);
- results.forEach(function(ruleResult) {
- if (ruleResult.nodes && frameSpec) {
- pushFrame(ruleResult.nodes, options, frameSpec);
- }
- var res = find_by_default(mergedResult, 'id', ruleResult.id);
- if (!res) {
- mergedResult.push(ruleResult);
- } else {
- if (ruleResult.nodes.length) {
- spliceNodes(res.nodes, ruleResult.nodes);
- }
- }
- });
- });
- mergedResult.forEach(function(result) {
- if (result.nodes) {
- result.nodes.sort(function(nodeA, nodeB) {
- return nodeIndexSort(nodeA.node.nodeIndexes, nodeB.node.nodeIndexes);
- });
- }
- });
- return mergedResult;
- }
- function nodeIndexSort() {
- var nodeIndexesA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var nodeIndexesB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var length = Math.max(nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA.length, nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB.length);
- for (var _i3 = 0; _i3 < length; _i3++) {
- var indexA = nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA[_i3];
- var indexB = nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB[_i3];
- if (typeof indexA !== 'number' || isNaN(indexA)) {
- return _i3 === 0 ? 1 : -1;
- }
- if (typeof indexB !== 'number' || isNaN(indexB)) {
- return _i3 === 0 ? -1 : 1;
- }
- if (indexA !== indexB) {
- return indexA - indexB;
- }
- }
- return 0;
- }
- var merge_results_default = mergeResults;
- function getFrameSpec(frameResult, options) {
- if (frameResult.frameElement) {
- return new dq_element_default(frameResult.frameElement, options);
- } else if (frameResult.frameSpec) {
- return frameResult.frameSpec;
- }
- return null;
- }
- function _collectResultsFromFrames(parentContent, options, command, parameter, resolve, reject) {
- var q = queue_default();
- var frames = parentContent.frames;
- frames.forEach(function(_ref6) {
- var frameElement = _ref6.node, context = _objectWithoutProperties(_ref6, _excluded);
- q.defer(function(res, rej) {
- var params = {
- options: options,
- command: command,
- parameter: parameter,
- context: context
- };
- function callback(results) {
- if (!results) {
- return res(null);
- }
- return res({
- results: results,
- frameElement: frameElement
- });
- }
- _sendCommandToFrame(frameElement, params, callback, rej);
- });
- });
- q.then(function(data2) {
- resolve(merge_results_default(data2, options));
- })['catch'](reject);
- }
- function _contains(vNode, otherVNode) {
- if (!vNode.shadowId && !otherVNode.shadowId && vNode.actualNode && typeof vNode.actualNode.contains === 'function') {
- return vNode.actualNode.contains(otherVNode.actualNode);
- }
- do {
- if (vNode === otherVNode) {
- return true;
- } else if (otherVNode.nodeIndex < vNode.nodeIndex) {
- return false;
- }
- otherVNode = otherVNode.parent;
- } while (otherVNode);
- return false;
- }
- function deepMerge() {
- var target = {};
- for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
- sources[_key] = arguments[_key];
- }
- sources.forEach(function(source) {
- if (!source || _typeof(source) !== 'object' || Array.isArray(source)) {
- return;
- }
- for (var _i4 = 0, _Object$keys = Object.keys(source); _i4 < _Object$keys.length; _i4++) {
- var key = _Object$keys[_i4];
- if (!target.hasOwnProperty(key) || _typeof(source[key]) !== 'object' || Array.isArray(target[key])) {
- target[key] = source[key];
- } else {
- target[key] = deepMerge(target[key], source[key]);
- }
- }
- });
- return target;
- }
- var deep_merge_default = deepMerge;
- function extendMetaData(to, from) {
- Object.assign(to, from);
- Object.keys(from).filter(function(prop) {
- return typeof from[prop] === 'function';
- }).forEach(function(prop) {
- to[prop] = null;
- try {
- to[prop] = from[prop](to);
- } catch (e) {}
- });
- }
- var extend_meta_data_default = extendMetaData;
- var possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ];
- function isShadowRoot(node) {
- if (node.shadowRoot) {
- var nodeName2 = node.nodeName.toLowerCase();
- if (possibleShadowRoots.includes(nodeName2) || /^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(nodeName2)) {
- return true;
- }
- }
- return false;
- }
- var is_shadow_root_default = isShadowRoot;
- var dom_exports = {};
- __export(dom_exports, {
- createGrid: function createGrid() {
- return _createGrid;
- },
- findElmsInContext: function findElmsInContext() {
- return find_elms_in_context_default;
- },
- findNearbyElms: function findNearbyElms() {
- return _findNearbyElms;
- },
- findUp: function findUp() {
- return find_up_default;
- },
- findUpVirtual: function findUpVirtual() {
- return find_up_virtual_default;
- },
- focusDisabled: function focusDisabled() {
- return focus_disabled_default;
- },
- getComposedParent: function getComposedParent() {
- return get_composed_parent_default;
- },
- getElementByReference: function getElementByReference() {
- return get_element_by_reference_default;
- },
- getElementCoordinates: function getElementCoordinates() {
- return get_element_coordinates_default;
- },
- getElementStack: function getElementStack() {
- return get_element_stack_default;
- },
- getModalDialog: function getModalDialog() {
- return get_modal_dialog_default;
- },
- getOverflowHiddenAncestors: function getOverflowHiddenAncestors() {
- return get_overflow_hidden_ancestors_default;
- },
- getRootNode: function getRootNode() {
- return get_root_node_default2;
- },
- getScrollOffset: function getScrollOffset() {
- return get_scroll_offset_default;
- },
- getTabbableElements: function getTabbableElements() {
- return get_tabbable_elements_default;
- },
- getTextElementStack: function getTextElementStack() {
- return get_text_element_stack_default;
- },
- getViewportSize: function getViewportSize() {
- return get_viewport_size_default;
- },
- getVisibleChildTextRects: function getVisibleChildTextRects() {
- return get_visible_child_text_rects_default;
- },
- hasContent: function hasContent() {
- return has_content_default;
- },
- hasContentVirtual: function hasContentVirtual() {
- return has_content_virtual_default;
- },
- hasLangText: function hasLangText() {
- return _hasLangText;
- },
- idrefs: function idrefs() {
- return idrefs_default;
- },
- insertedIntoFocusOrder: function insertedIntoFocusOrder() {
- return inserted_into_focus_order_default;
- },
- isCurrentPageLink: function isCurrentPageLink() {
- return _isCurrentPageLink;
- },
- isFocusable: function isFocusable() {
- return _isFocusable;
- },
- isHTML5: function isHTML5() {
- return is_html5_default;
- },
- isHiddenForEveryone: function isHiddenForEveryone() {
- return _isHiddenForEveryone;
- },
- isHiddenWithCSS: function isHiddenWithCSS() {
- return is_hidden_with_css_default;
- },
- isInTabOrder: function isInTabOrder() {
- return _isInTabOrder;
- },
- isInTextBlock: function isInTextBlock() {
- return is_in_text_block_default;
- },
- isInert: function isInert() {
- return _isInert;
- },
- isModalOpen: function isModalOpen() {
- return is_modal_open_default;
- },
- isMultiline: function isMultiline() {
- return _isMultiline;
- },
- isNativelyFocusable: function isNativelyFocusable() {
- return is_natively_focusable_default;
- },
- isNode: function isNode() {
- return is_node_default;
- },
- isOffscreen: function isOffscreen() {
- return is_offscreen_default;
- },
- isOpaque: function isOpaque() {
- return is_opaque_default;
- },
- isSkipLink: function isSkipLink() {
- return _isSkipLink;
- },
- isVisible: function isVisible() {
- return is_visible_default;
- },
- isVisibleOnScreen: function isVisibleOnScreen() {
- return _isVisibleOnScreen;
- },
- isVisibleToScreenReaders: function isVisibleToScreenReaders() {
- return _isVisibleToScreenReaders;
- },
- isVisualContent: function isVisualContent() {
- return is_visual_content_default;
- },
- reduceToElementsBelowFloating: function reduceToElementsBelowFloating() {
- return reduce_to_elements_below_floating_default;
- },
- shadowElementsFromPoint: function shadowElementsFromPoint() {
- return shadow_elements_from_point_default;
- },
- urlPropsFromAttribute: function urlPropsFromAttribute() {
- return url_props_from_attribute_default;
- },
- visuallyContains: function visuallyContains() {
- return _visuallyContains;
- },
- visuallyOverlaps: function visuallyOverlaps() {
- return visually_overlaps_default;
- },
- visuallySort: function visuallySort() {
- return _visuallySort;
- }
- });
- function getRootNode(node) {
- var doc = node.getRootNode && node.getRootNode() || document;
- if (doc === node) {
- doc = document;
- }
- return doc;
- }
- var get_root_node_default = getRootNode;
- var get_root_node_default2 = get_root_node_default;
- function findElmsInContext(_ref7) {
- var context = _ref7.context, value = _ref7.value, attr = _ref7.attr, _ref7$elm = _ref7.elm, elm = _ref7$elm === void 0 ? '' : _ref7$elm;
- var root;
- var escapedValue = escape_selector_default(value);
- if (context.nodeType === 9 || context.nodeType === 11) {
- root = context;
- } else {
- root = get_root_node_default2(context);
- }
- return Array.from(root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']'));
- }
- var find_elms_in_context_default = findElmsInContext;
- function findUpVirtual(element, target) {
- var parent;
- parent = element.actualNode;
- if (!element.shadowId && typeof element.actualNode.closest === 'function') {
- var match = element.actualNode.closest(target);
- if (match) {
- return match;
- }
- return null;
- }
- do {
- parent = parent.assignedSlot ? parent.assignedSlot : parent.parentNode;
- if (parent && parent.nodeType === 11) {
- parent = parent.host;
- }
- } while (parent && !element_matches_default(parent, target) && parent !== document.documentElement);
- if (!parent) {
- return null;
- }
- if (!element_matches_default(parent, target)) {
- return null;
- }
- return parent;
- }
- var find_up_virtual_default = findUpVirtual;
- function findUp(element, target) {
- return find_up_virtual_default(get_node_from_tree_default(element), target);
- }
- var find_up_default = findUp;
- var import_memoizee = __toModule(require_memoizee());
- axe._memoizedFns = [];
- function memoizeImplementation(fn) {
- var memoized = (0, import_memoizee['default'])(fn);
- axe._memoizedFns.push(memoized);
- return memoized;
- }
- var memoize_default = memoizeImplementation;
- function _rectsOverlap(rect1, rect2) {
- 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);
- }
- var getOverflowHiddenAncestors = memoize_default(function getOverflowHiddenAncestorsMemoized(vNode) {
- var ancestors = [];
- if (!vNode) {
- return ancestors;
- }
- var overflow = vNode.getComputedStylePropertyValue('overflow');
- if (overflow === 'hidden') {
- ancestors.push(vNode);
- }
- return ancestors.concat(getOverflowHiddenAncestors(vNode.parent));
- });
- var get_overflow_hidden_ancestors_default = getOverflowHiddenAncestors;
- var clipRegex = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
- var clipPathRegex = /(\w+)\((\d+)/;
- function nativelyHidden(vNode) {
- return [ 'style', 'script', 'noscript', 'template' ].includes(vNode.props.nodeName);
- }
- function displayHidden(vNode) {
- if (vNode.props.nodeName === 'area') {
- return false;
- }
- return vNode.getComputedStylePropertyValue('display') === 'none';
- }
- function visibilityHidden(vNode) {
- var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref8.isAncestor;
- return !isAncestor && [ 'hidden', 'collapse' ].includes(vNode.getComputedStylePropertyValue('visibility'));
- }
- function contentVisibiltyHidden(vNode) {
- var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref9.isAncestor;
- return !!isAncestor && vNode.getComputedStylePropertyValue('content-visibility') === 'hidden';
- }
- function ariaHidden(vNode) {
- return vNode.attr('aria-hidden') === 'true';
- }
- function opacityHidden(vNode) {
- return vNode.getComputedStylePropertyValue('opacity') === '0';
- }
- function scrollHidden(vNode) {
- var scroll = _getScroll(vNode.actualNode);
- var elHeight = parseInt(vNode.getComputedStylePropertyValue('height'));
- var elWidth = parseInt(vNode.getComputedStylePropertyValue('width'));
- return !!scroll && (elHeight === 0 || elWidth === 0);
- }
- function overflowHidden(vNode) {
- var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref10.isAncestor;
- if (isAncestor) {
- return false;
- }
- var rect = vNode.boundingClientRect;
- var nodes = get_overflow_hidden_ancestors_default(vNode);
- if (!nodes.length) {
- return false;
- }
- return nodes.some(function(node) {
- var nodeRect = node.boundingClientRect;
- if (nodeRect.width < 2 || nodeRect.height < 2) {
- return true;
- }
- return !_rectsOverlap(rect, nodeRect);
- });
- }
- function clipHidden(vNode) {
- var matchesClip = vNode.getComputedStylePropertyValue('clip').match(clipRegex);
- var matchesClipPath = vNode.getComputedStylePropertyValue('clip-path').match(clipPathRegex);
- if (matchesClip && matchesClip.length === 5) {
- var position = vNode.getComputedStylePropertyValue('position');
- if ([ 'fixed', 'absolute' ].includes(position)) {
- return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
- }
- }
- if (matchesClipPath) {
- var type = matchesClipPath[1];
- var value = parseInt(matchesClipPath[2], 10);
- switch (type) {
- case 'inset':
- return value >= 50;
- case 'circle':
- return value === 0;
- default:
- }
- }
- return false;
- }
- function areaHidden(vNode, visibleFunction) {
- var mapEl = closest_default(vNode, 'map');
- if (!mapEl) {
- return true;
- }
- var mapElName = mapEl.attr('name');
- if (!mapElName) {
- return true;
- }
- var mapElRootNode = get_root_node_default(vNode.actualNode);
- if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
- return true;
- }
- var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
- if (!refs || !refs.length) {
- return true;
- }
- return refs.some(function(ref) {
- return !visibleFunction(ref);
- });
- }
- function detailsHidden(vNode) {
- var _vNode$parent;
- if (((_vNode$parent = vNode.parent) === null || _vNode$parent === void 0 ? void 0 : _vNode$parent.props.nodeName) !== 'details') {
- return false;
- }
- if (vNode.props.nodeName === 'summary') {
- var firstSummary = vNode.parent.children.find(function(node) {
- return node.props.nodeName === 'summary';
- });
- if (firstSummary === vNode) {
- return false;
- }
- }
- return !vNode.parent.hasAttr('open');
- }
- var hiddenMethods = [ displayHidden, visibilityHidden, contentVisibiltyHidden, detailsHidden ];
- function _isHiddenForEveryone(vNode) {
- var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref11.skipAncestors, _ref11$isAncestor = _ref11.isAncestor, isAncestor = _ref11$isAncestor === void 0 ? false : _ref11$isAncestor;
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- if (skipAncestors) {
- return isHiddenSelf(vNode, isAncestor);
- }
- return isHiddenAncestors(vNode, isAncestor);
- }
- var isHiddenSelf = memoize_default(function isHiddenSelfMemoized(vNode, isAncestor) {
- if (nativelyHidden(vNode)) {
- return true;
- }
- if (!vNode.actualNode) {
- return false;
- }
- if (hiddenMethods.some(function(method) {
- return method(vNode, {
- isAncestor: isAncestor
- });
- })) {
- return true;
- }
- if (!vNode.actualNode.isConnected) {
- return true;
- }
- return false;
- });
- var isHiddenAncestors = memoize_default(function isHiddenAncestorsMemoized(vNode, isAncestor) {
- if (isHiddenSelf(vNode, isAncestor)) {
- return true;
- }
- if (!vNode.parent) {
- return false;
- }
- return isHiddenAncestors(vNode.parent, true);
- });
- function getComposedParent(element) {
- if (element.assignedSlot) {
- return getComposedParent(element.assignedSlot);
- } else if (element.parentNode) {
- var parentNode = element.parentNode;
- if (parentNode.nodeType === 1) {
- return parentNode;
- } else if (parentNode.host) {
- return parentNode.host;
- }
- }
- return null;
- }
- var get_composed_parent_default = getComposedParent;
- function getScrollOffset(element) {
- if (!element.nodeType && element.document) {
- element = element.document;
- }
- if (element.nodeType === 9) {
- var docElement = element.documentElement, body = element.body;
- return {
- left: docElement && docElement.scrollLeft || body && body.scrollLeft || 0,
- top: docElement && docElement.scrollTop || body && body.scrollTop || 0
- };
- }
- return {
- left: element.scrollLeft,
- top: element.scrollTop
- };
- }
- var get_scroll_offset_default = getScrollOffset;
- function getElementCoordinates(element) {
- var scrollOffset = get_scroll_offset_default(document), xOffset = scrollOffset.left, yOffset = scrollOffset.top, coords = element.getBoundingClientRect();
- return {
- top: coords.top + yOffset,
- right: coords.right + xOffset,
- bottom: coords.bottom + yOffset,
- left: coords.left + xOffset,
- width: coords.right - coords.left,
- height: coords.bottom - coords.top
- };
- }
- var get_element_coordinates_default = getElementCoordinates;
- function getViewportSize(win) {
- var doc = win.document;
- var docElement = doc.documentElement;
- if (win.innerWidth) {
- return {
- width: win.innerWidth,
- height: win.innerHeight
- };
- }
- if (docElement) {
- return {
- width: docElement.clientWidth,
- height: docElement.clientHeight
- };
- }
- var body = doc.body;
- return {
- width: body.clientWidth,
- height: body.clientHeight
- };
- }
- var get_viewport_size_default = getViewportSize;
- function noParentScrolled(element, offset) {
- element = get_composed_parent_default(element);
- while (element && element.nodeName.toLowerCase() !== 'html') {
- if (element.scrollTop) {
- offset += element.scrollTop;
- if (offset >= 0) {
- return false;
- }
- }
- element = get_composed_parent_default(element);
- }
- return true;
- }
- function isOffscreen(element) {
- var _ref12 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref12.isAncestor;
- if (isAncestor) {
- return false;
- }
- element = element instanceof abstract_virtual_node_default ? element.actualNode : element;
- if (!element) {
- return void 0;
- }
- var leftBoundary;
- var docElement = document.documentElement;
- var styl = window.getComputedStyle(element);
- var dir = window.getComputedStyle(document.body || docElement).getPropertyValue('direction');
- var coords = get_element_coordinates_default(element);
- if (coords.bottom < 0 && (noParentScrolled(element, coords.bottom) || styl.position === 'absolute')) {
- return true;
- }
- if (coords.left === 0 && coords.right === 0) {
- return false;
- }
- if (dir === 'ltr') {
- if (coords.right <= 0) {
- return true;
- }
- } else {
- leftBoundary = Math.max(docElement.scrollWidth, get_viewport_size_default(window).width);
- if (coords.left >= leftBoundary) {
- return true;
- }
- }
- return false;
- }
- var is_offscreen_default = isOffscreen;
- var hiddenMethods2 = [ opacityHidden, scrollHidden, overflowHidden, clipHidden, is_offscreen_default ];
- function _isVisibleOnScreen(vNode) {
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- return isVisibleOnScreenVirtual(vNode);
- }
- var isVisibleOnScreenVirtual = memoize_default(function isVisibleOnScreenMemoized(vNode, isAncestor) {
- if (vNode.actualNode && vNode.props.nodeName === 'area') {
- return !areaHidden(vNode, isVisibleOnScreenVirtual);
- }
- if (_isHiddenForEveryone(vNode, {
- skipAncestors: true,
- isAncestor: isAncestor
- })) {
- return false;
- }
- if (vNode.actualNode && hiddenMethods2.some(function(method) {
- return method(vNode, {
- isAncestor: isAncestor
- });
- })) {
- return false;
- }
- if (!vNode.parent) {
- return true;
- }
- return isVisibleOnScreenVirtual(vNode.parent, true);
- });
- function _getBoundingRect(rectA, rectB) {
- var top = Math.min(rectA.top, rectB.top);
- var right = Math.max(rectA.right, rectB.right);
- var bottom = Math.max(rectA.bottom, rectB.bottom);
- var left = Math.min(rectA.left, rectB.left);
- return new window.DOMRect(left, top, right - left, bottom - top);
- }
- function _isPointInRect(_ref13, _ref14) {
- var x = _ref13.x, y = _ref13.y;
- var top = _ref14.top, right = _ref14.right, bottom = _ref14.bottom, left = _ref14.left;
- return y >= top && x <= right && y <= bottom && x >= left;
- }
- var ROOT_ORDER = 0;
- var DEFAULT_ORDER = .1;
- var FLOAT_ORDER = .2;
- var POSITION_STATIC_ORDER = .3;
- var nodeIndex = 0;
- function _createGrid() {
- var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
- var rootGrid = arguments.length > 1 ? arguments[1] : undefined;
- var parentVNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- if (cache_default.get('gridCreated') && !parentVNode) {
- return constants_default.gridSize;
- }
- cache_default.set('gridCreated', true);
- if (!parentVNode) {
- var _rootGrid;
- var vNode = get_node_from_tree_default(document.documentElement);
- if (!vNode) {
- vNode = new virtual_node_default(document.documentElement);
- }
- nodeIndex = 0;
- vNode._stackingOrder = [ createContext(ROOT_ORDER, null) ];
- (_rootGrid = rootGrid) !== null && _rootGrid !== void 0 ? _rootGrid : rootGrid = new Grid();
- addNodeToGrid(rootGrid, vNode);
- if (_getScroll(vNode.actualNode)) {
- var subGrid = new Grid(vNode);
- vNode._subGrid = subGrid;
- }
- }
- var treeWalker = document.createTreeWalker(root, window.NodeFilter.SHOW_ELEMENT, null, false);
- var node = parentVNode ? treeWalker.nextNode() : treeWalker.currentNode;
- while (node) {
- var _vNode = get_node_from_tree_default(node);
- if (_vNode && _vNode.parent) {
- parentVNode = _vNode.parent;
- } else if (node.assignedSlot) {
- parentVNode = get_node_from_tree_default(node.assignedSlot);
- } else if (node.parentElement) {
- parentVNode = get_node_from_tree_default(node.parentElement);
- } else if (node.parentNode && get_node_from_tree_default(node.parentNode)) {
- parentVNode = get_node_from_tree_default(node.parentNode);
- }
- if (!_vNode) {
- _vNode = new axe.VirtualNode(node, parentVNode);
- }
- _vNode._stackingOrder = createStackingOrder(_vNode, parentVNode, nodeIndex++);
- var scrollRegionParent = findScrollRegionParent(_vNode, parentVNode);
- var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
- if (_getScroll(_vNode.actualNode)) {
- var _subGrid = new Grid(_vNode);
- _vNode._subGrid = _subGrid;
- }
- var rect = _vNode.boundingClientRect;
- if (rect.width !== 0 && rect.height !== 0 && _isVisibleOnScreen(node)) {
- addNodeToGrid(grid, _vNode);
- }
- if (is_shadow_root_default(node)) {
- _createGrid(node.shadowRoot, grid, _vNode);
- }
- node = treeWalker.nextNode();
- }
- return constants_default.gridSize;
- }
- function isStackingContext(vNode, parentVNode) {
- var position = vNode.getComputedStylePropertyValue('position');
- var zIndex = vNode.getComputedStylePropertyValue('z-index');
- if (position === 'fixed' || position === 'sticky') {
- return true;
- }
- if (zIndex !== 'auto' && position !== 'static') {
- return true;
- }
- if (vNode.getComputedStylePropertyValue('opacity') !== '1') {
- return true;
- }
- var transform = vNode.getComputedStylePropertyValue('-webkit-transform') || vNode.getComputedStylePropertyValue('-ms-transform') || vNode.getComputedStylePropertyValue('transform') || 'none';
- if (transform !== 'none') {
- return true;
- }
- var mixBlendMode = vNode.getComputedStylePropertyValue('mix-blend-mode');
- if (mixBlendMode && mixBlendMode !== 'normal') {
- return true;
- }
- var filter = vNode.getComputedStylePropertyValue('filter');
- if (filter && filter !== 'none') {
- return true;
- }
- var perspective = vNode.getComputedStylePropertyValue('perspective');
- if (perspective && perspective !== 'none') {
- return true;
- }
- var clipPath = vNode.getComputedStylePropertyValue('clip-path');
- if (clipPath && clipPath !== 'none') {
- return true;
- }
- var mask = vNode.getComputedStylePropertyValue('-webkit-mask') || vNode.getComputedStylePropertyValue('mask') || 'none';
- if (mask !== 'none') {
- return true;
- }
- var maskImage = vNode.getComputedStylePropertyValue('-webkit-mask-image') || vNode.getComputedStylePropertyValue('mask-image') || 'none';
- if (maskImage !== 'none') {
- return true;
- }
- var maskBorder = vNode.getComputedStylePropertyValue('-webkit-mask-border') || vNode.getComputedStylePropertyValue('mask-border') || 'none';
- if (maskBorder !== 'none') {
- return true;
- }
- if (vNode.getComputedStylePropertyValue('isolation') === 'isolate') {
- return true;
- }
- var willChange = vNode.getComputedStylePropertyValue('will-change');
- if (willChange === 'transform' || willChange === 'opacity') {
- return true;
- }
- if (vNode.getComputedStylePropertyValue('-webkit-overflow-scrolling') === 'touch') {
- return true;
- }
- var contain = vNode.getComputedStylePropertyValue('contain');
- if ([ 'layout', 'paint', 'strict', 'content' ].includes(contain)) {
- return true;
- }
- if (zIndex !== 'auto' && isFlexOrGridContainer(parentVNode)) {
- return true;
- }
- return false;
- }
- function isFlexOrGridContainer(vNode) {
- if (!vNode) {
- return false;
- }
- var display = vNode.getComputedStylePropertyValue('display');
- return [ 'flex', 'inline-flex', 'grid', 'inline-grid' ].includes(display);
- }
- function createStackingOrder(vNode, parentVNode, nodeIndex3) {
- var stackingOrder = parentVNode._stackingOrder.slice();
- if (!isStackingContext(vNode, parentVNode)) {
- if (vNode.getComputedStylePropertyValue('position') !== 'static') {
- stackingOrder.push(createContext(POSITION_STATIC_ORDER, vNode));
- } else if (vNode.getComputedStylePropertyValue('float') !== 'none') {
- stackingOrder.push(createContext(FLOAT_ORDER, vNode));
- }
- return stackingOrder;
- }
- var index = stackingOrder.findIndex(function(_ref15) {
- var value = _ref15.value;
- return [ ROOT_ORDER, FLOAT_ORDER, POSITION_STATIC_ORDER ].includes(value);
- });
- if (index !== -1) {
- stackingOrder.splice(index, stackingOrder.length - index);
- }
- var zIndex = getRealZIndex(vNode, parentVNode);
- if (![ 'auto', '0' ].includes(zIndex)) {
- stackingOrder.push(createContext(parseInt(zIndex), vNode));
- return stackingOrder;
- }
- var _float = nodeIndex3.toString();
- while (_float.length < 10) {
- _float = '0' + _float;
- }
- stackingOrder.push(createContext(parseFloat(''.concat(DEFAULT_ORDER).concat(_float)), vNode));
- return stackingOrder;
- }
- function createContext(value, vNode) {
- return {
- value: value,
- vNode: vNode
- };
- }
- function getRealZIndex(vNode, parentVNode) {
- var position = vNode.getComputedStylePropertyValue('position');
- if (position === 'static' && !isFlexOrGridContainer(parentVNode)) {
- return 'auto';
- }
- return vNode.getComputedStylePropertyValue('z-index');
- }
- function findScrollRegionParent(vNode, parentVNode) {
- var scrollRegionParent = null;
- var checkedNodes = [ vNode ];
- while (parentVNode) {
- if (_getScroll(parentVNode.actualNode)) {
- scrollRegionParent = parentVNode;
- break;
- }
- if (parentVNode._scrollRegionParent) {
- scrollRegionParent = parentVNode._scrollRegionParent;
- break;
- }
- checkedNodes.push(parentVNode);
- parentVNode = get_node_from_tree_default(parentVNode.actualNode.parentElement || parentVNode.actualNode.parentNode);
- }
- checkedNodes.forEach(function(vNode2) {
- return vNode2._scrollRegionParent = scrollRegionParent;
- });
- return scrollRegionParent;
- }
- function addNodeToGrid(grid, vNode) {
- vNode.clientRects.forEach(function(rect) {
- var _vNode$_grid;
- (_vNode$_grid = vNode._grid) !== null && _vNode$_grid !== void 0 ? _vNode$_grid : vNode._grid = grid;
- var gridRect = grid.getGridPositionOfRect(rect);
- grid.loopGridPosition(gridRect, function(gridCell) {
- if (!gridCell.includes(vNode)) {
- gridCell.push(vNode);
- }
- });
- });
- }
- var Grid = function() {
- function Grid() {
- var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- _classCallCheck(this, Grid);
- this.container = container;
- this.cells = [];
- }
- _createClass(Grid, [ {
- key: 'toGridIndex',
- value: function toGridIndex(num) {
- return Math.floor(num / constants_default.gridSize);
- }
- }, {
- key: 'getCellFromPoint',
- value: function getCellFromPoint(_ref16) {
- var _this$cells, _row;
- var x = _ref16.x, y = _ref16.y;
- assert_default(this.boundaries, 'Grid does not have cells added');
- var rowIndex = this.toGridIndex(y);
- var colIndex = this.toGridIndex(x);
- assert_default(_isPointInRect({
- y: rowIndex,
- x: colIndex
- }, this.boundaries), 'Element midpoint exceeds the grid bounds');
- var row = (_this$cells = this.cells[rowIndex - this.cells._negativeIndex]) !== null && _this$cells !== void 0 ? _this$cells : [];
- return (_row = row[colIndex - row._negativeIndex]) !== null && _row !== void 0 ? _row : [];
- }
- }, {
- key: 'loopGridPosition',
- value: function loopGridPosition(gridPosition, callback) {
- var _gridPosition = gridPosition, left = _gridPosition.left, right = _gridPosition.right, top = _gridPosition.top, bottom = _gridPosition.bottom;
- if (this.boundaries) {
- gridPosition = _getBoundingRect(this.boundaries, gridPosition);
- }
- this.boundaries = gridPosition;
- loopNegativeIndexMatrix(this.cells, top, bottom, function(gridRow, row) {
- loopNegativeIndexMatrix(gridRow, left, right, function(gridCell, col) {
- callback(gridCell, {
- row: row,
- col: col
- });
- });
- });
- }
- }, {
- key: 'getGridPositionOfRect',
- value: function getGridPositionOfRect(_ref17) {
- var top = _ref17.top, right = _ref17.right, bottom = _ref17.bottom, left = _ref17.left;
- var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- top = this.toGridIndex(top - margin);
- right = this.toGridIndex(right + margin - 1);
- bottom = this.toGridIndex(bottom + margin - 1);
- left = this.toGridIndex(left - margin);
- return new window.DOMRect(left, top, right - left, bottom - top);
- }
- } ]);
- return Grid;
- }();
- function loopNegativeIndexMatrix(matrix, start, end, callback) {
- var _matrix$_negativeInde;
- (_matrix$_negativeInde = matrix._negativeIndex) !== null && _matrix$_negativeInde !== void 0 ? _matrix$_negativeInde : matrix._negativeIndex = 0;
- if (start < matrix._negativeIndex) {
- for (var _i5 = 0; _i5 < matrix._negativeIndex - start; _i5++) {
- matrix.splice(0, 0, []);
- }
- matrix._negativeIndex = start;
- }
- var startOffset = start - matrix._negativeIndex;
- var endOffset = end - matrix._negativeIndex;
- for (var index = startOffset; index <= endOffset; index++) {
- var _index, _matrix$_index;
- (_matrix$_index = matrix[_index = index]) !== null && _matrix$_index !== void 0 ? _matrix$_index : matrix[_index] = [];
- callback(matrix[index], index + matrix._negativeIndex);
- }
- }
- function _findNearbyElms(vNode) {
- var _vNode$_grid2, _vNode$_grid2$cells;
- var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- _createGrid();
- if (!((_vNode$_grid2 = vNode._grid) !== null && _vNode$_grid2 !== void 0 && (_vNode$_grid2$cells = _vNode$_grid2.cells) !== null && _vNode$_grid2$cells !== void 0 && _vNode$_grid2$cells.length)) {
- return [];
- }
- var rect = vNode.boundingClientRect;
- var grid = vNode._grid;
- var selfIsFixed = hasFixedPosition(vNode);
- var gridPosition = grid.getGridPositionOfRect(rect, margin);
- var neighbors = [];
- grid.loopGridPosition(gridPosition, function(vNeighbors) {
- var _iterator2 = _createForOfIteratorHelper(vNeighbors), _step2;
- try {
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
- var vNeighbor = _step2.value;
- if (vNeighbor && vNeighbor !== vNode && !neighbors.includes(vNeighbor) && selfIsFixed === hasFixedPosition(vNeighbor)) {
- neighbors.push(vNeighbor);
- }
- }
- } catch (err) {
- _iterator2.e(err);
- } finally {
- _iterator2.f();
- }
- });
- return neighbors;
- }
- var hasFixedPosition = memoize_default(function(vNode) {
- if (!vNode) {
- return false;
- }
- if (vNode.getComputedStylePropertyValue('position') === 'fixed') {
- return true;
- }
- return hasFixedPosition(vNode.parent);
- });
- function _getIntersectionRect(rect1, rect2) {
- var leftX = Math.max(rect1.left, rect2.left);
- var rightX = Math.min(rect1.right, rect2.right);
- var topY = Math.max(rect1.top, rect2.top);
- var bottomY = Math.min(rect1.bottom, rect2.bottom);
- if (leftX >= rightX || topY >= bottomY) {
- return null;
- }
- return new window.DOMRect(leftX, topY, rightX - leftX, bottomY - topY);
- }
- var getModalDialog = memoize_default(function getModalDialogMemoized() {
- var _dialogs$find;
- if (!axe._tree) {
- return null;
- }
- var dialogs = query_selector_all_filter_default(axe._tree[0], 'dialog[open]', function(vNode) {
- var rect = vNode.boundingClientRect;
- var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
- return stack.includes(vNode.actualNode) && _isVisibleOnScreen(vNode);
- });
- if (!dialogs.length) {
- return null;
- }
- var modalDialog = dialogs.find(function(dialog) {
- var rect = dialog.boundingClientRect;
- var stack = document.elementsFromPoint(rect.left - 10, rect.top - 10);
- return stack.includes(dialog.actualNode);
- });
- if (modalDialog) {
- return modalDialog;
- }
- return (_dialogs$find = dialogs.find(function(dialog) {
- var _getNodeFromGrid;
- var _ref18 = (_getNodeFromGrid = getNodeFromGrid(dialog)) !== null && _getNodeFromGrid !== void 0 ? _getNodeFromGrid : {}, vNode = _ref18.vNode, rect = _ref18.rect;
- if (!vNode) {
- return false;
- }
- var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
- return !stack.includes(vNode.actualNode);
- })) !== null && _dialogs$find !== void 0 ? _dialogs$find : null;
- });
- var get_modal_dialog_default = getModalDialog;
- function getNodeFromGrid(dialog) {
- _createGrid();
- var grid = axe._tree[0]._grid;
- var viewRect = new window.DOMRect(0, 0, window.innerWidth, window.innerHeight);
- if (!grid) {
- return;
- }
- for (var row = 0; row < grid.cells.length; row++) {
- var cols = grid.cells[row];
- if (!cols) {
- continue;
- }
- for (var col = 0; col < cols.length; col++) {
- var cells = cols[col];
- if (!cells) {
- continue;
- }
- for (var _i6 = 0; _i6 < cells.length; _i6++) {
- var vNode = cells[_i6];
- var rect = vNode.boundingClientRect;
- var intersection = _getIntersectionRect(rect, viewRect);
- if (vNode.props.nodeName !== 'html' && vNode !== dialog && vNode.getComputedStylePropertyValue('pointer-events') !== 'none' && intersection) {
- return {
- vNode: vNode,
- rect: intersection
- };
- }
- }
- }
- }
- }
- function _isInert(vNode) {
- var _ref19 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref19.skipAncestors, isAncestor = _ref19.isAncestor;
- if (skipAncestors) {
- return isInertSelf(vNode, isAncestor);
- }
- return isInertAncestors(vNode, isAncestor);
- }
- var isInertSelf = memoize_default(function isInertSelfMemoized(vNode, isAncestor) {
- if (vNode.hasAttr('inert')) {
- return true;
- }
- if (!isAncestor && vNode.actualNode) {
- var modalDialog = get_modal_dialog_default();
- if (modalDialog && !_contains(modalDialog, vNode)) {
- return true;
- }
- }
- return false;
- });
- var isInertAncestors = memoize_default(function isInertAncestorsMemoized(vNode, isAncestor) {
- if (isInertSelf(vNode, isAncestor)) {
- return true;
- }
- if (!vNode.parent) {
- return false;
- }
- return isInertAncestors(vNode.parent, true);
- });
- var allowedDisabledNodeNames = [ 'button', 'command', 'fieldset', 'keygen', 'optgroup', 'option', 'select', 'textarea', 'input' ];
- function isDisabledAttrAllowed(nodeName2) {
- return allowedDisabledNodeNames.includes(nodeName2);
- }
- function focusDisabled(el) {
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- if (isDisabledAttrAllowed(vNode.props.nodeName) && vNode.hasAttr('disabled') || _isInert(vNode)) {
- return true;
- }
- var parentNode = vNode.parent;
- var ancestors = [];
- var fieldsetDisabled = false;
- while (parentNode && parentNode.shadowId === vNode.shadowId && !fieldsetDisabled) {
- ancestors.push(parentNode);
- if (parentNode.props.nodeName === 'legend') {
- break;
- }
- if (parentNode._inDisabledFieldset !== void 0) {
- fieldsetDisabled = parentNode._inDisabledFieldset;
- break;
- }
- if (parentNode.props.nodeName === 'fieldset' && parentNode.hasAttr('disabled')) {
- fieldsetDisabled = true;
- }
- parentNode = parentNode.parent;
- }
- ancestors.forEach(function(ancestor) {
- return ancestor._inDisabledFieldset = fieldsetDisabled;
- });
- if (fieldsetDisabled) {
- return true;
- }
- if (vNode.props.nodeName !== 'area') {
- if (!vNode.actualNode) {
- return false;
- }
- return _isHiddenForEveryone(vNode);
- }
- return false;
- }
- var focus_disabled_default = focusDisabled;
- var angularSkipLinkRegex = /^\/\#/;
- var angularRouterLinkRegex = /^#[!/]/;
- function _isCurrentPageLink(anchor) {
- var _window$location;
- var href = anchor.getAttribute('href');
- if (!href || href === '#') {
- return false;
- }
- if (angularSkipLinkRegex.test(href)) {
- return true;
- }
- var hash = anchor.hash, protocol = anchor.protocol, hostname = anchor.hostname, port = anchor.port, pathname = anchor.pathname;
- if (angularRouterLinkRegex.test(hash)) {
- return false;
- }
- if (href.charAt(0) === '#') {
- return true;
- }
- if (typeof ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin) !== 'string' || window.location.origin.indexOf('://') === -1) {
- return null;
- }
- var currentPageUrl = window.location.origin + window.location.pathname;
- var url;
- if (!hostname) {
- url = window.location.origin;
- } else {
- url = ''.concat(protocol, '//').concat(hostname).concat(port ? ':'.concat(port) : '');
- }
- if (!pathname) {
- url += window.location.pathname;
- } else {
- url += (pathname[0] !== '/' ? '/' : '') + pathname;
- }
- return url === currentPageUrl;
- }
- function getElementByReference(node, attr) {
- var fragment = node.getAttribute(attr);
- if (!fragment) {
- return null;
- }
- if (attr === 'href' && !_isCurrentPageLink(node)) {
- return null;
- }
- if (fragment.indexOf('#') !== -1) {
- fragment = decodeURIComponent(fragment.substr(fragment.indexOf('#') + 1));
- }
- var candidate = document.getElementById(fragment);
- if (candidate) {
- return candidate;
- }
- candidate = document.getElementsByName(fragment);
- if (candidate.length) {
- return candidate[0];
- }
- return null;
- }
- var get_element_by_reference_default = getElementByReference;
- function _visuallySort(a, b) {
- _createGrid();
- var length = Math.max(a._stackingOrder.length, b._stackingOrder.length);
- for (var _i7 = 0; _i7 < length; _i7++) {
- if (typeof b._stackingOrder[_i7] === 'undefined') {
- return -1;
- } else if (typeof a._stackingOrder[_i7] === 'undefined') {
- return 1;
- }
- if (b._stackingOrder[_i7].value > a._stackingOrder[_i7].value) {
- return 1;
- }
- if (b._stackingOrder[_i7].value < a._stackingOrder[_i7].value) {
- return -1;
- }
- }
- var aNode = a.actualNode;
- var bNode = b.actualNode;
- if (aNode.getRootNode && aNode.getRootNode() !== bNode.getRootNode()) {
- var boundaries = [];
- while (aNode) {
- boundaries.push({
- root: aNode.getRootNode(),
- node: aNode
- });
- aNode = aNode.getRootNode().host;
- }
- while (bNode && !boundaries.find(function(boundary) {
- return boundary.root === bNode.getRootNode();
- })) {
- bNode = bNode.getRootNode().host;
- }
- aNode = boundaries.find(function(boundary) {
- return boundary.root === bNode.getRootNode();
- }).node;
- if (aNode === bNode) {
- return a.actualNode.getRootNode() !== aNode.getRootNode() ? -1 : 1;
- }
- }
- 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;
- var docPosition = aNode.compareDocumentPosition(bNode);
- var DOMOrder = docPosition & DOCUMENT_POSITION_FOLLOWING ? 1 : -1;
- var isDescendant = docPosition & DOCUMENT_POSITION_CONTAINS || docPosition & DOCUMENT_POSITION_CONTAINED_BY;
- var aPosition = getPositionOrder(a);
- var bPosition = getPositionOrder(b);
- if (aPosition === bPosition || isDescendant) {
- return DOMOrder;
- }
- return bPosition - aPosition;
- }
- function getPositionOrder(vNode) {
- if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
- return 2;
- }
- if (isFloated(vNode)) {
- return 1;
- }
- return 0;
- }
- function isFloated(vNode) {
- if (!vNode) {
- return false;
- }
- if (vNode._isFloated !== void 0) {
- return vNode._isFloated;
- }
- var floatStyle = vNode.getComputedStylePropertyValue('float');
- if (floatStyle !== 'none') {
- vNode._isFloated = true;
- return true;
- }
- var floated = isFloated(vNode.parent);
- vNode._isFloated = floated;
- return floated;
- }
- var math_exports = {};
- __export(math_exports, {
- getBoundingRect: function getBoundingRect() {
- return _getBoundingRect;
- },
- getIntersectionRect: function getIntersectionRect() {
- return _getIntersectionRect;
- },
- getOffset: function getOffset() {
- return _getOffset;
- },
- getRectCenter: function getRectCenter() {
- return _getRectCenter;
- },
- hasVisualOverlap: function hasVisualOverlap() {
- return _hasVisualOverlap;
- },
- isPointInRect: function isPointInRect() {
- return _isPointInRect;
- },
- rectsOverlap: function rectsOverlap() {
- return _rectsOverlap;
- },
- splitRects: function splitRects() {
- return _splitRects;
- }
- });
- function _getOffset(vNodeA, vNodeB) {
- var rectA = vNodeA.boundingClientRect;
- var rectB = vNodeB.boundingClientRect;
- var pointA = getFarthestPoint(rectA, rectB);
- var pointB = getClosestPoint(pointA, rectA, rectB);
- return pointDistance(pointA, pointB);
- }
- function getFarthestPoint(rectA, rectB) {
- var dimensionProps = [ [ 'x', 'left', 'right', 'width' ], [ 'y', 'top', 'bottom', 'height' ] ];
- var farthestPoint = {};
- dimensionProps.forEach(function(_ref20) {
- var _ref21 = _slicedToArray(_ref20, 4), axis = _ref21[0], start = _ref21[1], end = _ref21[2], diameter = _ref21[3];
- if (rectB[start] < rectA[start] && rectB[end] > rectA[end]) {
- farthestPoint[axis] = rectA[start] + rectA[diameter] / 2;
- return;
- }
- var centerB = rectB[start] + rectB[diameter] / 2;
- var startDistance = Math.abs(centerB - rectA[start]);
- var endDistance = Math.abs(centerB - rectA[end]);
- if (startDistance >= endDistance) {
- farthestPoint[axis] = rectA[start];
- } else {
- farthestPoint[axis] = rectA[end];
- }
- });
- return farthestPoint;
- }
- function getClosestPoint(_ref22, ownRect, adjacentRect) {
- var x = _ref22.x, y = _ref22.y;
- if (pointInRect({
- x: x,
- y: y
- }, adjacentRect)) {
- var closestPoint = getCornerInAdjacentRect({
- x: x,
- y: y
- }, ownRect, adjacentRect);
- if (closestPoint !== null) {
- return closestPoint;
- }
- adjacentRect = ownRect;
- }
- var _adjacentRect = adjacentRect, top = _adjacentRect.top, right = _adjacentRect.right, bottom = _adjacentRect.bottom, left = _adjacentRect.left;
- var xAligned = x >= left && x <= right;
- var yAligned = y >= top && y <= bottom;
- var closestX = Math.abs(left - x) < Math.abs(right - x) ? left : right;
- var closestY = Math.abs(top - y) < Math.abs(bottom - y) ? top : bottom;
- if (!xAligned && yAligned) {
- return {
- x: closestX,
- y: y
- };
- } else if (xAligned && !yAligned) {
- return {
- x: x,
- y: closestY
- };
- } else if (!xAligned && !yAligned) {
- return {
- x: closestX,
- y: closestY
- };
- }
- if (Math.abs(x - closestX) < Math.abs(y - closestY)) {
- return {
- x: closestX,
- y: y
- };
- } else {
- return {
- x: x,
- y: closestY
- };
- }
- }
- function pointDistance(pointA, pointB) {
- var xDistance = Math.abs(pointA.x - pointB.x);
- var yDistance = Math.abs(pointA.y - pointB.y);
- if (!xDistance || !yDistance) {
- return xDistance || yDistance;
- }
- return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
- }
- function pointInRect(_ref23, rect) {
- var x = _ref23.x, y = _ref23.y;
- return y >= rect.top && x <= rect.right && y <= rect.bottom && x >= rect.left;
- }
- function getCornerInAdjacentRect(_ref24, ownRect, adjacentRect) {
- var x = _ref24.x, y = _ref24.y;
- var closestX, closestY;
- if (x === ownRect.left && ownRect.right < adjacentRect.right) {
- closestX = ownRect.right;
- } else if (x === ownRect.right && ownRect.left > adjacentRect.left) {
- closestX = ownRect.left;
- }
- if (y === ownRect.top && ownRect.bottom < adjacentRect.bottom) {
- closestY = ownRect.bottom;
- } else if (y === ownRect.bottom && ownRect.top > adjacentRect.top) {
- closestY = ownRect.top;
- }
- if (!closestX && !closestY) {
- return null;
- } else if (!closestY) {
- return {
- x: closestX,
- y: y
- };
- } else if (!closestX) {
- return {
- x: x,
- y: closestY
- };
- }
- if (Math.abs(x - closestX) < Math.abs(y - closestY)) {
- return {
- x: closestX,
- y: y
- };
- } else {
- return {
- x: x,
- y: closestY
- };
- }
- }
- function _getRectCenter(_ref25) {
- var left = _ref25.left, top = _ref25.top, width = _ref25.width, height = _ref25.height;
- return new window.DOMPoint(left + width / 2, top + height / 2);
- }
- function _hasVisualOverlap(vNodeA, vNodeB) {
- var rectA = vNodeA.boundingClientRect;
- var rectB = vNodeB.boundingClientRect;
- if (rectA.left >= rectB.right || rectA.right <= rectB.left || rectA.top >= rectB.bottom || rectA.bottom <= rectB.top) {
- return false;
- }
- return _visuallySort(vNodeA, vNodeB) > 0;
- }
- function _splitRects(outerRect, overlapRects) {
- var uniqueRects = [ outerRect ];
- var _iterator3 = _createForOfIteratorHelper(overlapRects), _step3;
- try {
- var _loop3 = function _loop3() {
- var overlapRect = _step3.value;
- uniqueRects = uniqueRects.reduce(function(uniqueRects2, inputRect) {
- return uniqueRects2.concat(splitRect(inputRect, overlapRect));
- }, []);
- };
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
- _loop3();
- }
- } catch (err) {
- _iterator3.e(err);
- } finally {
- _iterator3.f();
- }
- return uniqueRects;
- }
- function splitRect(inputRect, clipRect) {
- var top = inputRect.top, left = inputRect.left, bottom = inputRect.bottom, right = inputRect.right;
- var yAligned = top < clipRect.bottom && bottom > clipRect.top;
- var xAligned = left < clipRect.right && right > clipRect.left;
- var rects = [];
- if (between(clipRect.top, top, bottom) && xAligned) {
- rects.push({
- top: top,
- left: left,
- bottom: clipRect.top,
- right: right
- });
- }
- if (between(clipRect.right, left, right) && yAligned) {
- rects.push({
- top: top,
- left: clipRect.right,
- bottom: bottom,
- right: right
- });
- }
- if (between(clipRect.bottom, top, bottom) && xAligned) {
- rects.push({
- top: clipRect.bottom,
- right: right,
- bottom: bottom,
- left: left
- });
- }
- if (between(clipRect.left, left, right) && yAligned) {
- rects.push({
- top: top,
- left: left,
- bottom: bottom,
- right: clipRect.left
- });
- }
- if (rects.length === 0) {
- rects.push(inputRect);
- }
- return rects.map(computeRect);
- }
- var between = function between(num, min, max) {
- return num > min && num < max;
- };
- function computeRect(baseRect) {
- return _extends({}, baseRect, {
- x: baseRect.left,
- y: baseRect.top,
- height: baseRect.bottom - baseRect.top,
- width: baseRect.right - baseRect.left
- });
- }
- function getRectStack(grid, rect) {
- var recursed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var center = _getRectCenter(rect);
- var gridCell = grid.getCellFromPoint(center) || [];
- var floorX = Math.floor(center.x);
- var floorY = Math.floor(center.y);
- var stack = gridCell.filter(function(gridCellNode) {
- return gridCellNode.clientRects.some(function(clientRect) {
- var rectX = clientRect.left;
- var rectY = clientRect.top;
- return floorX < Math.floor(rectX + clientRect.width) && floorX >= Math.floor(rectX) && floorY < Math.floor(rectY + clientRect.height) && floorY >= Math.floor(rectY);
- });
- });
- var gridContainer = grid.container;
- if (gridContainer) {
- stack = getRectStack(gridContainer._grid, gridContainer.boundingClientRect, true).concat(stack);
- }
- if (!recursed) {
- stack = stack.sort(_visuallySort).map(function(vNode) {
- return vNode.actualNode;
- }).concat(document.documentElement).filter(function(node, index, array) {
- return array.indexOf(node) === index;
- });
- }
- return stack;
- }
- function getElementStack(node) {
- _createGrid();
- var vNode = get_node_from_tree_default(node);
- var grid = vNode._grid;
- if (!grid) {
- return [];
- }
- return getRectStack(grid, vNode.boundingClientRect);
- }
- var get_element_stack_default = getElementStack;
- function getTabbableElements(virtualNode) {
- var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
- var tabbableElements = nodeAndDescendents.filter(function(vNode) {
- var isFocusable2 = vNode.isFocusable;
- var tabIndex = vNode.actualNode.getAttribute('tabindex');
- tabIndex = tabIndex && !isNaN(parseInt(tabIndex, 10)) ? parseInt(tabIndex) : null;
- return tabIndex ? isFocusable2 && tabIndex >= 0 : isFocusable2;
- });
- return tabbableElements;
- }
- var get_tabbable_elements_default = getTabbableElements;
- var text_exports = {};
- __export(text_exports, {
- accessibleText: function accessibleText() {
- return accessible_text_default;
- },
- accessibleTextVirtual: function accessibleTextVirtual() {
- return accessible_text_virtual_default;
- },
- autocomplete: function autocomplete() {
- return _autocomplete;
- },
- formControlValue: function formControlValue() {
- return form_control_value_default;
- },
- formControlValueMethods: function formControlValueMethods() {
- return _formControlValueMethods;
- },
- hasUnicode: function hasUnicode() {
- return has_unicode_default;
- },
- isHumanInterpretable: function isHumanInterpretable() {
- return is_human_interpretable_default;
- },
- isIconLigature: function isIconLigature() {
- return is_icon_ligature_default;
- },
- isValidAutocomplete: function isValidAutocomplete() {
- return is_valid_autocomplete_default;
- },
- label: function label() {
- return label_default;
- },
- labelText: function labelText() {
- return label_text_default;
- },
- labelVirtual: function labelVirtual() {
- return label_virtual_default2;
- },
- nativeElementType: function nativeElementType() {
- return native_element_type_default;
- },
- nativeTextAlternative: function nativeTextAlternative() {
- return native_text_alternative_default;
- },
- nativeTextMethods: function nativeTextMethods() {
- return native_text_methods_default;
- },
- removeUnicode: function removeUnicode() {
- return remove_unicode_default;
- },
- sanitize: function sanitize() {
- return sanitize_default;
- },
- subtreeText: function subtreeText() {
- return subtree_text_default;
- },
- titleText: function titleText() {
- return title_text_default;
- },
- unsupported: function unsupported() {
- return unsupported_default;
- },
- visible: function visible() {
- return visible_default;
- },
- visibleTextNodes: function visibleTextNodes() {
- return visible_text_nodes_default;
- },
- visibleVirtual: function visibleVirtual() {
- return visible_virtual_default;
- }
- });
- function idrefs(node, attr) {
- node = node.actualNode || node;
- try {
- var doc = get_root_node_default2(node);
- var result = [];
- var attrValue = node.getAttribute(attr);
- if (attrValue) {
- attrValue = token_list_default(attrValue);
- for (var index = 0; index < attrValue.length; index++) {
- result.push(doc.getElementById(attrValue[index]));
- }
- }
- return result;
- } catch (e) {
- throw new TypeError('Cannot resolve id references for non-DOM nodes');
- }
- }
- var idrefs_default = idrefs;
- function accessibleText(element, context) {
- var virtualNode = get_node_from_tree_default(element);
- return accessible_text_virtual_default(virtualNode, context);
- }
- var accessible_text_default = accessibleText;
- function arialabelledbyText(vNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (!(vNode instanceof abstract_virtual_node_default)) {
- if (vNode.nodeType !== 1) {
- return '';
- }
- vNode = get_node_from_tree_default(vNode);
- }
- if (vNode.props.nodeType !== 1 || context.inLabelledByContext || context.inControlContext || !vNode.attr('aria-labelledby')) {
- return '';
- }
- var refs = idrefs_default(vNode, 'aria-labelledby').filter(function(elm) {
- return elm;
- });
- return refs.reduce(function(accessibleName, elm) {
- var accessibleNameAdd = accessible_text_default(elm, _extends({
- inLabelledByContext: true,
- startNode: context.startNode || vNode
- }, context));
- if (!accessibleName) {
- return accessibleNameAdd;
- } else {
- return ''.concat(accessibleName, ' ').concat(accessibleNameAdd);
- }
- }, '');
- }
- var arialabelledby_text_default = arialabelledbyText;
- function arialabelText(vNode) {
- if (!(vNode instanceof abstract_virtual_node_default)) {
- if (vNode.nodeType !== 1) {
- return '';
- }
- vNode = get_node_from_tree_default(vNode);
- }
- return vNode.attr('aria-label') || '';
- }
- var arialabel_text_default = arialabelText;
- var ariaAttrs = {
- 'aria-activedescendant': {
- type: 'idref',
- allowEmpty: true
- },
- 'aria-atomic': {
- type: 'boolean',
- global: true
- },
- 'aria-autocomplete': {
- type: 'nmtoken',
- values: [ 'inline', 'list', 'both', 'none' ]
- },
- 'aria-braillelabel': {
- type: 'string',
- global: true
- },
- 'aria-brailleroledescription': {
- type: 'string',
- global: true
- },
- 'aria-busy': {
- type: 'boolean',
- global: true
- },
- 'aria-checked': {
- type: 'nmtoken',
- values: [ 'false', 'mixed', 'true', 'undefined' ]
- },
- 'aria-colcount': {
- type: 'int',
- minValue: -1
- },
- 'aria-colindex': {
- type: 'int',
- minValue: 1
- },
- 'aria-colspan': {
- type: 'int',
- minValue: 1
- },
- 'aria-controls': {
- type: 'idrefs',
- allowEmpty: true,
- global: true
- },
- 'aria-current': {
- type: 'nmtoken',
- allowEmpty: true,
- values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
- global: true
- },
- 'aria-describedby': {
- type: 'idrefs',
- allowEmpty: true,
- global: true
- },
- 'aria-description': {
- type: 'string',
- allowEmpty: true,
- global: true
- },
- 'aria-details': {
- type: 'idref',
- allowEmpty: true,
- global: true
- },
- 'aria-disabled': {
- type: 'boolean',
- global: true
- },
- 'aria-dropeffect': {
- type: 'nmtokens',
- values: [ 'copy', 'execute', 'link', 'move', 'none', 'popup' ],
- global: true
- },
- 'aria-errormessage': {
- type: 'idref',
- allowEmpty: true,
- global: true
- },
- 'aria-expanded': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ]
- },
- 'aria-flowto': {
- type: 'idrefs',
- allowEmpty: true,
- global: true
- },
- 'aria-grabbed': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ],
- global: true
- },
- 'aria-haspopup': {
- type: 'nmtoken',
- allowEmpty: true,
- values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
- global: true
- },
- 'aria-hidden': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ],
- global: true
- },
- 'aria-invalid': {
- type: 'nmtoken',
- values: [ 'grammar', 'false', 'spelling', 'true' ],
- global: true
- },
- 'aria-keyshortcuts': {
- type: 'string',
- allowEmpty: true,
- global: true
- },
- 'aria-label': {
- type: 'string',
- allowEmpty: true,
- global: true
- },
- 'aria-labelledby': {
- type: 'idrefs',
- allowEmpty: true,
- global: true
- },
- 'aria-level': {
- type: 'int',
- minValue: 1
- },
- 'aria-live': {
- type: 'nmtoken',
- values: [ 'assertive', 'off', 'polite' ],
- global: true
- },
- 'aria-modal': {
- type: 'boolean'
- },
- 'aria-multiline': {
- type: 'boolean'
- },
- 'aria-multiselectable': {
- type: 'boolean'
- },
- 'aria-orientation': {
- type: 'nmtoken',
- values: [ 'horizontal', 'undefined', 'vertical' ]
- },
- 'aria-owns': {
- type: 'idrefs',
- allowEmpty: true,
- global: true
- },
- 'aria-placeholder': {
- type: 'string',
- allowEmpty: true
- },
- 'aria-posinset': {
- type: 'int',
- minValue: 1
- },
- 'aria-pressed': {
- type: 'nmtoken',
- values: [ 'false', 'mixed', 'true', 'undefined' ]
- },
- 'aria-readonly': {
- type: 'boolean'
- },
- 'aria-relevant': {
- type: 'nmtokens',
- values: [ 'additions', 'all', 'removals', 'text' ],
- global: true
- },
- 'aria-required': {
- type: 'boolean'
- },
- 'aria-roledescription': {
- type: 'string',
- allowEmpty: true,
- global: true
- },
- 'aria-rowcount': {
- type: 'int',
- minValue: -1
- },
- 'aria-rowindex': {
- type: 'int',
- minValue: 1
- },
- 'aria-rowspan': {
- type: 'int',
- minValue: 0
- },
- 'aria-selected': {
- type: 'nmtoken',
- values: [ 'false', 'true', 'undefined' ]
- },
- 'aria-setsize': {
- type: 'int',
- minValue: -1
- },
- 'aria-sort': {
- type: 'nmtoken',
- values: [ 'ascending', 'descending', 'none', 'other' ]
- },
- 'aria-valuemax': {
- type: 'decimal'
- },
- 'aria-valuemin': {
- type: 'decimal'
- },
- 'aria-valuenow': {
- type: 'decimal'
- },
- 'aria-valuetext': {
- type: 'string'
- }
- };
- var aria_attrs_default = ariaAttrs;
- var ariaRoles = {
- alert: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- alertdialog: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
- superclassRole: [ 'alert', 'dialog' ],
- accessibleNameRequired: true
- },
- application: {
- type: 'landmark',
- allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
- superclassRole: [ 'structure' ],
- accessibleNameRequired: true
- },
- article: {
- type: 'structure',
- allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
- superclassRole: [ 'document' ]
- },
- banner: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- blockquote: {
- type: 'structure',
- superclassRole: [ 'section' ]
- },
- button: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded', 'aria-pressed' ],
- superclassRole: [ 'command' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- caption: {
- type: 'structure',
- requiredContext: [ 'figure', 'table', 'grid', 'treegrid' ],
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- cell: {
- type: 'structure',
- requiredContext: [ 'row' ],
- allowedAttrs: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-expanded' ],
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- checkbox: {
- type: 'widget',
- requiredAttrs: [ 'aria-checked' ],
- allowedAttrs: [ 'aria-readonly', 'aria-required' ],
- superclassRole: [ 'input' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- code: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- columnheader: {
- type: 'structure',
- requiredContext: [ 'row' ],
- allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
- superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
- accessibleNameRequired: false,
- nameFromContent: true
- },
- combobox: {
- type: 'widget',
- requiredAttrs: [ 'aria-expanded', 'aria-controls' ],
- allowedAttrs: [ 'aria-owns', 'aria-autocomplete', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-orientation' ],
- superclassRole: [ 'select' ],
- accessibleNameRequired: true
- },
- command: {
- type: 'abstract',
- superclassRole: [ 'widget' ]
- },
- complementary: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- composite: {
- type: 'abstract',
- superclassRole: [ 'widget' ]
- },
- contentinfo: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- comment: {
- type: 'structure',
- allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize' ],
- superclassRole: [ 'article' ]
- },
- definition: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- deletion: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- dialog: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
- superclassRole: [ 'window' ],
- accessibleNameRequired: true
- },
- directory: {
- type: 'structure',
- deprecated: true,
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'list' ],
- nameFromContent: true
- },
- document: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'structure' ]
- },
- emphasis: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- feed: {
- type: 'structure',
- requiredOwned: [ 'article' ],
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'list' ]
- },
- figure: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- form: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- grid: {
- type: 'composite',
- requiredOwned: [ 'rowgroup', 'row' ],
- allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
- superclassRole: [ 'composite', 'table' ],
- accessibleNameRequired: false
- },
- gridcell: {
- type: 'widget',
- requiredContext: [ 'row' ],
- allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-selected', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan' ],
- superclassRole: [ 'cell', 'widget' ],
- nameFromContent: true
- },
- group: {
- type: 'structure',
- allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- heading: {
- type: 'structure',
- requiredAttrs: [ 'aria-level' ],
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'sectionhead' ],
- accessibleNameRequired: false,
- nameFromContent: true
- },
- img: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- accessibleNameRequired: true,
- childrenPresentational: true
- },
- input: {
- type: 'abstract',
- superclassRole: [ 'widget' ]
- },
- insertion: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- landmark: {
- type: 'abstract',
- superclassRole: [ 'section' ]
- },
- link: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'command' ],
- accessibleNameRequired: true,
- nameFromContent: true
- },
- list: {
- type: 'structure',
- requiredOwned: [ 'listitem' ],
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- listbox: {
- type: 'widget',
- requiredOwned: [ 'group', 'option' ],
- allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'select' ],
- accessibleNameRequired: true
- },
- listitem: {
- type: 'structure',
- requiredContext: [ 'list' ],
- allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- log: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- main: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- marquee: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- math: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- childrenPresentational: true
- },
- menu: {
- type: 'composite',
- requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
- allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'select' ]
- },
- menubar: {
- type: 'composite',
- requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
- allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'menu' ]
- },
- menuitem: {
- type: 'widget',
- requiredContext: [ 'menu', 'menubar', 'group' ],
- allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
- superclassRole: [ 'command' ],
- accessibleNameRequired: true,
- nameFromContent: true
- },
- menuitemcheckbox: {
- type: 'widget',
- requiredContext: [ 'menu', 'menubar', 'group' ],
- requiredAttrs: [ 'aria-checked' ],
- allowedAttrs: [ 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
- superclassRole: [ 'checkbox', 'menuitem' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- menuitemradio: {
- type: 'widget',
- requiredContext: [ 'menu', 'menubar', 'group' ],
- requiredAttrs: [ 'aria-checked' ],
- allowedAttrs: [ 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
- superclassRole: [ 'menuitemcheckbox', 'radio' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- meter: {
- type: 'structure',
- requiredAttrs: [ 'aria-valuenow' ],
- allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
- superclassRole: [ 'range' ],
- accessibleNameRequired: true,
- childrenPresentational: true
- },
- mark: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- navigation: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- none: {
- type: 'structure',
- superclassRole: [ 'structure' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- note: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- option: {
- type: 'widget',
- requiredContext: [ 'group', 'listbox' ],
- allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
- superclassRole: [ 'input' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- paragraph: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- presentation: {
- type: 'structure',
- superclassRole: [ 'structure' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- progressbar: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' ],
- superclassRole: [ 'range' ],
- accessibleNameRequired: true,
- childrenPresentational: true
- },
- radio: {
- type: 'widget',
- requiredAttrs: [ 'aria-checked' ],
- allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-required' ],
- superclassRole: [ 'input' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- radiogroup: {
- type: 'composite',
- allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'select' ],
- accessibleNameRequired: false
- },
- range: {
- type: 'abstract',
- superclassRole: [ 'widget' ]
- },
- region: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ],
- accessibleNameRequired: false
- },
- roletype: {
- type: 'abstract',
- superclassRole: []
- },
- row: {
- type: 'structure',
- requiredContext: [ 'grid', 'rowgroup', 'table', 'treegrid' ],
- requiredOwned: [ 'cell', 'columnheader', 'gridcell', 'rowheader' ],
- allowedAttrs: [ 'aria-colindex', 'aria-level', 'aria-rowindex', 'aria-selected', 'aria-activedescendant', 'aria-expanded', 'aria-posinset', 'aria-setsize' ],
- superclassRole: [ 'group', 'widget' ],
- nameFromContent: true
- },
- rowgroup: {
- type: 'structure',
- requiredContext: [ 'grid', 'table', 'treegrid' ],
- requiredOwned: [ 'row' ],
- superclassRole: [ 'structure' ],
- nameFromContent: true
- },
- rowheader: {
- type: 'structure',
- requiredContext: [ 'row' ],
- allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
- superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
- accessibleNameRequired: false,
- nameFromContent: true
- },
- scrollbar: {
- type: 'widget',
- requiredAttrs: [ 'aria-valuenow' ],
- allowedAttrs: [ 'aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
- superclassRole: [ 'range' ],
- childrenPresentational: true
- },
- search: {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- searchbox: {
- type: 'widget',
- allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
- superclassRole: [ 'textbox' ],
- accessibleNameRequired: true
- },
- section: {
- type: 'abstract',
- superclassRole: [ 'structure' ],
- nameFromContent: true
- },
- sectionhead: {
- type: 'abstract',
- superclassRole: [ 'structure' ],
- nameFromContent: true
- },
- select: {
- type: 'abstract',
- superclassRole: [ 'composite', 'group' ]
- },
- separator: {
- type: 'structure',
- requiredAttrs: [ 'aria-valuenow' ],
- allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-valuetext' ],
- superclassRole: [ 'structure', 'widget' ],
- childrenPresentational: true
- },
- slider: {
- type: 'widget',
- requiredAttrs: [ 'aria-valuenow' ],
- allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-valuetext' ],
- superclassRole: [ 'input', 'range' ],
- accessibleNameRequired: true,
- childrenPresentational: true
- },
- spinbutton: {
- type: 'widget',
- allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-valuetext', 'aria-valuenow' ],
- superclassRole: [ 'composite', 'input', 'range' ],
- accessibleNameRequired: true
- },
- status: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- strong: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- structure: {
- type: 'abstract',
- superclassRole: [ 'roletype' ]
- },
- subscript: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- superscript: {
- type: 'structure',
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- switch: {
- type: 'widget',
- requiredAttrs: [ 'aria-checked' ],
- allowedAttrs: [ 'aria-readonly' ],
- superclassRole: [ 'checkbox' ],
- accessibleNameRequired: true,
- nameFromContent: true,
- childrenPresentational: true
- },
- suggestion: {
- type: 'structure',
- requiredOwned: [ 'insertion', 'deletion' ],
- superclassRole: [ 'section' ],
- prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
- },
- tab: {
- type: 'widget',
- requiredContext: [ 'tablist' ],
- allowedAttrs: [ 'aria-posinset', 'aria-selected', 'aria-setsize', 'aria-expanded' ],
- superclassRole: [ 'sectionhead', 'widget' ],
- nameFromContent: true,
- childrenPresentational: true
- },
- table: {
- type: 'structure',
- requiredOwned: [ 'rowgroup', 'row' ],
- allowedAttrs: [ 'aria-colcount', 'aria-rowcount', 'aria-expanded' ],
- superclassRole: [ 'section' ],
- accessibleNameRequired: false,
- nameFromContent: true
- },
- tablist: {
- type: 'composite',
- requiredOwned: [ 'tab' ],
- allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
- superclassRole: [ 'composite' ]
- },
- tabpanel: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- accessibleNameRequired: false
- },
- term: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- text: {
- type: 'structure',
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- textbox: {
- type: 'widget',
- allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
- superclassRole: [ 'input' ],
- accessibleNameRequired: true
- },
- time: {
- type: 'structure',
- superclassRole: [ 'section' ]
- },
- timer: {
- type: 'widget',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'status' ]
- },
- toolbar: {
- type: 'structure',
- allowedAttrs: [ 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
- superclassRole: [ 'group' ],
- accessibleNameRequired: true
- },
- tooltip: {
- type: 'structure',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ],
- nameFromContent: true
- },
- tree: {
- type: 'composite',
- requiredOwned: [ 'group', 'treeitem' ],
- allowedAttrs: [ 'aria-multiselectable', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'select' ],
- accessibleNameRequired: false
- },
- treegrid: {
- type: 'composite',
- requiredOwned: [ 'rowgroup', 'row' ],
- allowedAttrs: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-rowcount' ],
- superclassRole: [ 'grid', 'tree' ],
- accessibleNameRequired: false
- },
- treeitem: {
- type: 'widget',
- requiredContext: [ 'group', 'tree' ],
- allowedAttrs: [ 'aria-checked', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-selected', 'aria-setsize' ],
- superclassRole: [ 'listitem', 'option' ],
- accessibleNameRequired: true,
- nameFromContent: true
- },
- widget: {
- type: 'abstract',
- superclassRole: [ 'roletype' ]
- },
- window: {
- type: 'abstract',
- superclassRole: [ 'roletype' ]
- }
- };
- var aria_roles_default = ariaRoles;
- var dpubRoles = {
- 'doc-abstract': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-acknowledgments': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-afterword': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-appendix': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-backlink': {
- type: 'link',
- allowedAttrs: [ 'aria-expanded' ],
- nameFromContent: true,
- superclassRole: [ 'link' ]
- },
- 'doc-biblioentry': {
- type: 'listitem',
- allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
- superclassRole: [ 'listitem' ],
- deprecated: true
- },
- 'doc-bibliography': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-biblioref': {
- type: 'link',
- allowedAttrs: [ 'aria-expanded' ],
- nameFromContent: true,
- superclassRole: [ 'link' ]
- },
- 'doc-chapter': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-colophon': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-conclusion': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-cover': {
- type: 'img',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'img' ]
- },
- 'doc-credit': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-credits': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-dedication': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-endnote': {
- type: 'listitem',
- allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
- superclassRole: [ 'listitem' ],
- deprecated: true
- },
- 'doc-endnotes': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-epigraph': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-epilogue': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-errata': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-example': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-footnote': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-foreword': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-glossary': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-glossref': {
- type: 'link',
- allowedAttrs: [ 'aria-expanded' ],
- nameFromContent: true,
- superclassRole: [ 'link' ]
- },
- 'doc-index': {
- type: 'navigation',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'navigation' ]
- },
- 'doc-introduction': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-noteref': {
- type: 'link',
- allowedAttrs: [ 'aria-expanded' ],
- nameFromContent: true,
- superclassRole: [ 'link' ]
- },
- 'doc-notice': {
- type: 'note',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'note' ]
- },
- 'doc-pagebreak': {
- type: 'separator',
- allowedAttrs: [ 'aria-expanded', 'aria-orientation' ],
- superclassRole: [ 'separator' ],
- childrenPresentational: true
- },
- 'doc-pagelist': {
- type: 'navigation',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'navigation' ]
- },
- 'doc-part': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-preface': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-prologue': {
- type: 'landmark',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'landmark' ]
- },
- 'doc-pullquote': {
- type: 'none',
- superclassRole: [ 'none' ]
- },
- 'doc-qna': {
- type: 'section',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'section' ]
- },
- 'doc-subtitle': {
- type: 'sectionhead',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'sectionhead' ]
- },
- 'doc-tip': {
- type: 'note',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'note' ]
- },
- 'doc-toc': {
- type: 'navigation',
- allowedAttrs: [ 'aria-expanded' ],
- superclassRole: [ 'navigation' ]
- }
- };
- var dpub_roles_default = dpubRoles;
- var graphicsRoles = {
- 'graphics-document': {
- type: 'structure',
- superclassRole: [ 'document' ],
- accessibleNameRequired: true
- },
- 'graphics-object': {
- type: 'structure',
- superclassRole: [ 'group' ],
- nameFromContent: true
- },
- 'graphics-symbol': {
- type: 'structure',
- superclassRole: [ 'img' ],
- accessibleNameRequired: true,
- childrenPresentational: true
- }
- };
- var graphics_roles_default = graphicsRoles;
- var htmlElms = {
- a: {
- variant: {
- href: {
- matches: '[href]',
- contentTypes: [ 'interactive', 'phrasing', 'flow' ],
- allowedRoles: [ 'button', 'checkbox', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab', 'treeitem', 'doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref' ],
- namingMethods: [ 'subtreeText' ]
- },
- default: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- }
- }
- },
- abbr: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- address: {
- contentTypes: [ 'flow' ],
- allowedRoles: true
- },
- area: {
- variant: {
- href: {
- matches: '[href]',
- allowedRoles: false
- },
- default: {
- allowedRoles: [ 'button', 'link' ]
- }
- },
- contentTypes: [ 'phrasing', 'flow' ],
- namingMethods: [ 'altText' ]
- },
- article: {
- contentTypes: [ 'sectioning', 'flow' ],
- allowedRoles: [ 'feed', 'presentation', 'none', 'document', 'application', 'main', 'region' ],
- shadowRoot: true
- },
- aside: {
- contentTypes: [ 'sectioning', 'flow' ],
- allowedRoles: [ 'feed', 'note', 'presentation', 'none', 'region', 'search', 'doc-dedication', 'doc-example', 'doc-footnote', 'doc-pullquote', 'doc-tip' ]
- },
- audio: {
- variant: {
- controls: {
- matches: '[controls]',
- contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
- },
- default: {
- contentTypes: [ 'embedded', 'phrasing', 'flow' ]
- }
- },
- allowedRoles: [ 'application' ],
- chromiumRole: 'Audio'
- },
- b: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- base: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- bdi: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- bdo: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- blockquote: {
- contentTypes: [ 'flow' ],
- allowedRoles: true,
- shadowRoot: true
- },
- body: {
- allowedRoles: false,
- shadowRoot: true
- },
- br: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: [ 'presentation', 'none' ],
- namingMethods: [ 'titleText', 'singleSpace' ]
- },
- button: {
- contentTypes: [ 'interactive', 'phrasing', 'flow' ],
- allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ],
- namingMethods: [ 'subtreeText' ]
- },
- canvas: {
- allowedRoles: true,
- contentTypes: [ 'embedded', 'phrasing', 'flow' ],
- chromiumRole: 'Canvas'
- },
- caption: {
- allowedRoles: false
- },
- cite: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- code: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- col: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- colgroup: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- data: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- datalist: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true,
- implicitAttrs: {
- 'aria-multiselectable': 'false'
- }
- },
- dd: {
- allowedRoles: false
- },
- del: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- dfn: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- details: {
- contentTypes: [ 'interactive', 'flow' ],
- allowedRoles: false
- },
- dialog: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'alertdialog' ]
- },
- div: {
- contentTypes: [ 'flow' ],
- allowedRoles: true,
- shadowRoot: true
- },
- dl: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'group', 'list', 'presentation', 'none' ],
- chromiumRole: 'DescriptionList'
- },
- dt: {
- allowedRoles: [ 'listitem' ]
- },
- em: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- embed: {
- contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
- allowedRoles: [ 'application', 'document', 'img', 'presentation', 'none' ],
- chromiumRole: 'EmbeddedObject'
- },
- fieldset: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'radiogroup' ],
- namingMethods: [ 'fieldsetLegendText' ]
- },
- figcaption: {
- allowedRoles: [ 'group', 'none', 'presentation' ]
- },
- figure: {
- contentTypes: [ 'flow' ],
- allowedRoles: true,
- namingMethods: [ 'figureText', 'titleText' ]
- },
- footer: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
- shadowRoot: true
- },
- form: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'search', 'none', 'presentation' ]
- },
- h1: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '1'
- }
- },
- h2: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '2'
- }
- },
- h3: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '3'
- }
- },
- h4: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '4'
- }
- },
- h5: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '5'
- }
- },
- h6: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
- shadowRoot: true,
- implicitAttrs: {
- 'aria-level': '6'
- }
- },
- head: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- header: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
- shadowRoot: true
- },
- hgroup: {
- contentTypes: [ 'heading', 'flow' ],
- allowedRoles: true
- },
- hr: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'none', 'presentation', 'doc-pagebreak' ],
- namingMethods: [ 'titleText', 'singleSpace' ]
- },
- html: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- i: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- iframe: {
- contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
- allowedRoles: [ 'application', 'document', 'img', 'none', 'presentation' ],
- chromiumRole: 'Iframe'
- },
- img: {
- variant: {
- nonEmptyAlt: {
- matches: [ {
- attributes: {
- alt: '/.+/'
- }
- }, {
- hasAccessibleName: true
- } ],
- allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
- },
- usemap: {
- matches: '[usemap]',
- contentTypes: [ 'interactive', 'embedded', 'flow' ]
- },
- default: {
- allowedRoles: [ 'presentation', 'none' ],
- contentTypes: [ 'embedded', 'flow' ]
- }
- },
- namingMethods: [ 'altText' ]
- },
- input: {
- variant: {
- button: {
- matches: {
- properties: {
- type: 'button'
- }
- },
- allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ]
- },
- buttonType: {
- matches: {
- properties: {
- type: [ 'button', 'submit', 'reset' ]
- }
- },
- namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
- },
- checkboxPressed: {
- matches: {
- properties: {
- type: 'checkbox'
- },
- attributes: {
- 'aria-pressed': '/.*/'
- }
- },
- allowedRoles: [ 'button', 'menuitemcheckbox', 'option', 'switch' ],
- implicitAttrs: {
- 'aria-checked': 'false'
- }
- },
- checkbox: {
- matches: {
- properties: {
- type: 'checkbox'
- },
- attributes: {
- 'aria-pressed': null
- }
- },
- allowedRoles: [ 'menuitemcheckbox', 'option', 'switch' ],
- implicitAttrs: {
- 'aria-checked': 'false'
- }
- },
- noRoles: {
- matches: {
- properties: {
- type: [ 'color', 'date', 'datetime-local', 'file', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
- }
- },
- allowedRoles: false
- },
- hidden: {
- matches: {
- properties: {
- type: 'hidden'
- }
- },
- contentTypes: [ 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- image: {
- matches: {
- properties: {
- type: 'image'
- }
- },
- allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'radio', 'switch' ],
- namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
- },
- radio: {
- matches: {
- properties: {
- type: 'radio'
- }
- },
- allowedRoles: [ 'menuitemradio' ],
- implicitAttrs: {
- 'aria-checked': 'false'
- }
- },
- textWithList: {
- matches: {
- properties: {
- type: 'text'
- },
- attributes: {
- list: '/.*/'
- }
- },
- allowedRoles: false
- },
- default: {
- contentTypes: [ 'interactive', 'flow' ],
- allowedRoles: [ 'combobox', 'searchbox', 'spinbutton' ],
- implicitAttrs: {
- 'aria-valuenow': ''
- },
- namingMethods: [ 'labelText', 'placeholderText' ]
- }
- }
- },
- ins: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- kbd: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- label: {
- contentTypes: [ 'interactive', 'phrasing', 'flow' ],
- allowedRoles: false,
- chromiumRole: 'Label'
- },
- legend: {
- allowedRoles: false
- },
- li: {
- allowedRoles: [ 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'none', 'presentation', 'radio', 'separator', 'tab', 'treeitem', 'doc-biblioentry', 'doc-endnote' ],
- implicitAttrs: {
- 'aria-setsize': '1',
- 'aria-posinset': '1'
- }
- },
- link: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- main: {
- contentTypes: [ 'flow' ],
- allowedRoles: false,
- shadowRoot: true
- },
- map: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- math: {
- contentTypes: [ 'embedded', 'phrasing', 'flow' ],
- allowedRoles: false
- },
- mark: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- menu: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
- },
- meta: {
- variant: {
- itemprop: {
- matches: '[itemprop]',
- contentTypes: [ 'phrasing', 'flow' ]
- }
- },
- allowedRoles: false,
- noAriaAttrs: true
- },
- meter: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- chromiumRole: 'progressbar'
- },
- nav: {
- contentTypes: [ 'sectioning', 'flow' ],
- allowedRoles: [ 'doc-index', 'doc-pagelist', 'doc-toc', 'menu', 'menubar', 'none', 'presentation', 'tablist' ],
- shadowRoot: true
- },
- noscript: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- object: {
- variant: {
- usemap: {
- matches: '[usemap]',
- contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
- },
- default: {
- contentTypes: [ 'embedded', 'phrasing', 'flow' ]
- }
- },
- allowedRoles: [ 'application', 'document', 'img' ],
- chromiumRole: 'PluginObject'
- },
- ol: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
- },
- optgroup: {
- allowedRoles: false
- },
- option: {
- allowedRoles: false,
- implicitAttrs: {
- 'aria-selected': 'false'
- }
- },
- output: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true,
- namingMethods: [ 'subtreeText' ]
- },
- p: {
- contentTypes: [ 'flow' ],
- allowedRoles: true,
- shadowRoot: true
- },
- param: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- picture: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- pre: {
- contentTypes: [ 'flow' ],
- allowedRoles: true
- },
- progress: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- implicitAttrs: {
- 'aria-valuemax': '100',
- 'aria-valuemin': '0',
- 'aria-valuenow': '0'
- }
- },
- q: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- rp: {
- allowedRoles: true
- },
- rt: {
- allowedRoles: true
- },
- ruby: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- s: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- samp: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- script: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- section: {
- contentTypes: [ 'sectioning', 'flow' ],
- 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' ],
- shadowRoot: true
- },
- select: {
- variant: {
- combobox: {
- matches: {
- attributes: {
- multiple: null,
- size: [ null, '1' ]
- }
- },
- allowedRoles: [ 'menu' ]
- },
- default: {
- allowedRoles: false
- }
- },
- contentTypes: [ 'interactive', 'phrasing', 'flow' ],
- implicitAttrs: {
- 'aria-valuenow': ''
- },
- namingMethods: [ 'labelText' ]
- },
- slot: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- small: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- source: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- span: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true,
- shadowRoot: true
- },
- strong: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- style: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- svg: {
- contentTypes: [ 'embedded', 'phrasing', 'flow' ],
- allowedRoles: true,
- chromiumRole: 'SVGRoot',
- namingMethods: [ 'svgTitleText' ]
- },
- sub: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- summary: {
- allowedRoles: false,
- namingMethods: [ 'subtreeText' ]
- },
- sup: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- table: {
- contentTypes: [ 'flow' ],
- allowedRoles: true,
- namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
- },
- tbody: {
- allowedRoles: true
- },
- template: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: false,
- noAriaAttrs: true
- },
- textarea: {
- contentTypes: [ 'interactive', 'phrasing', 'flow' ],
- allowedRoles: false,
- implicitAttrs: {
- 'aria-valuenow': '',
- 'aria-multiline': 'true'
- },
- namingMethods: [ 'labelText', 'placeholderText' ]
- },
- tfoot: {
- allowedRoles: true
- },
- thead: {
- allowedRoles: true
- },
- time: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- title: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- td: {
- allowedRoles: true
- },
- th: {
- allowedRoles: true
- },
- tr: {
- allowedRoles: true
- },
- track: {
- allowedRoles: false,
- noAriaAttrs: true
- },
- u: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- ul: {
- contentTypes: [ 'flow' ],
- allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
- },
- var: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: true
- },
- video: {
- variant: {
- controls: {
- matches: '[controls]',
- contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
- },
- default: {
- contentTypes: [ 'embedded', 'phrasing', 'flow' ]
- }
- },
- allowedRoles: [ 'application' ],
- chromiumRole: 'video'
- },
- wbr: {
- contentTypes: [ 'phrasing', 'flow' ],
- allowedRoles: [ 'presentation', 'none' ]
- }
- };
- var html_elms_default = htmlElms;
- var cssColors = {
- aliceblue: [ 240, 248, 255 ],
- antiquewhite: [ 250, 235, 215 ],
- aqua: [ 0, 255, 255 ],
- aquamarine: [ 127, 255, 212 ],
- azure: [ 240, 255, 255 ],
- beige: [ 245, 245, 220 ],
- bisque: [ 255, 228, 196 ],
- black: [ 0, 0, 0 ],
- blanchedalmond: [ 255, 235, 205 ],
- blue: [ 0, 0, 255 ],
- blueviolet: [ 138, 43, 226 ],
- brown: [ 165, 42, 42 ],
- burlywood: [ 222, 184, 135 ],
- cadetblue: [ 95, 158, 160 ],
- chartreuse: [ 127, 255, 0 ],
- chocolate: [ 210, 105, 30 ],
- coral: [ 255, 127, 80 ],
- cornflowerblue: [ 100, 149, 237 ],
- cornsilk: [ 255, 248, 220 ],
- crimson: [ 220, 20, 60 ],
- cyan: [ 0, 255, 255 ],
- darkblue: [ 0, 0, 139 ],
- darkcyan: [ 0, 139, 139 ],
- darkgoldenrod: [ 184, 134, 11 ],
- darkgray: [ 169, 169, 169 ],
- darkgreen: [ 0, 100, 0 ],
- darkgrey: [ 169, 169, 169 ],
- darkkhaki: [ 189, 183, 107 ],
- darkmagenta: [ 139, 0, 139 ],
- darkolivegreen: [ 85, 107, 47 ],
- darkorange: [ 255, 140, 0 ],
- darkorchid: [ 153, 50, 204 ],
- darkred: [ 139, 0, 0 ],
- darksalmon: [ 233, 150, 122 ],
- darkseagreen: [ 143, 188, 143 ],
- darkslateblue: [ 72, 61, 139 ],
- darkslategray: [ 47, 79, 79 ],
- darkslategrey: [ 47, 79, 79 ],
- darkturquoise: [ 0, 206, 209 ],
- darkviolet: [ 148, 0, 211 ],
- deeppink: [ 255, 20, 147 ],
- deepskyblue: [ 0, 191, 255 ],
- dimgray: [ 105, 105, 105 ],
- dimgrey: [ 105, 105, 105 ],
- dodgerblue: [ 30, 144, 255 ],
- firebrick: [ 178, 34, 34 ],
- floralwhite: [ 255, 250, 240 ],
- forestgreen: [ 34, 139, 34 ],
- fuchsia: [ 255, 0, 255 ],
- gainsboro: [ 220, 220, 220 ],
- ghostwhite: [ 248, 248, 255 ],
- gold: [ 255, 215, 0 ],
- goldenrod: [ 218, 165, 32 ],
- gray: [ 128, 128, 128 ],
- green: [ 0, 128, 0 ],
- greenyellow: [ 173, 255, 47 ],
- grey: [ 128, 128, 128 ],
- honeydew: [ 240, 255, 240 ],
- hotpink: [ 255, 105, 180 ],
- indianred: [ 205, 92, 92 ],
- indigo: [ 75, 0, 130 ],
- ivory: [ 255, 255, 240 ],
- khaki: [ 240, 230, 140 ],
- lavender: [ 230, 230, 250 ],
- lavenderblush: [ 255, 240, 245 ],
- lawngreen: [ 124, 252, 0 ],
- lemonchiffon: [ 255, 250, 205 ],
- lightblue: [ 173, 216, 230 ],
- lightcoral: [ 240, 128, 128 ],
- lightcyan: [ 224, 255, 255 ],
- lightgoldenrodyellow: [ 250, 250, 210 ],
- lightgray: [ 211, 211, 211 ],
- lightgreen: [ 144, 238, 144 ],
- lightgrey: [ 211, 211, 211 ],
- lightpink: [ 255, 182, 193 ],
- lightsalmon: [ 255, 160, 122 ],
- lightseagreen: [ 32, 178, 170 ],
- lightskyblue: [ 135, 206, 250 ],
- lightslategray: [ 119, 136, 153 ],
- lightslategrey: [ 119, 136, 153 ],
- lightsteelblue: [ 176, 196, 222 ],
- lightyellow: [ 255, 255, 224 ],
- lime: [ 0, 255, 0 ],
- limegreen: [ 50, 205, 50 ],
- linen: [ 250, 240, 230 ],
- magenta: [ 255, 0, 255 ],
- maroon: [ 128, 0, 0 ],
- mediumaquamarine: [ 102, 205, 170 ],
- mediumblue: [ 0, 0, 205 ],
- mediumorchid: [ 186, 85, 211 ],
- mediumpurple: [ 147, 112, 219 ],
- mediumseagreen: [ 60, 179, 113 ],
- mediumslateblue: [ 123, 104, 238 ],
- mediumspringgreen: [ 0, 250, 154 ],
- mediumturquoise: [ 72, 209, 204 ],
- mediumvioletred: [ 199, 21, 133 ],
- midnightblue: [ 25, 25, 112 ],
- mintcream: [ 245, 255, 250 ],
- mistyrose: [ 255, 228, 225 ],
- moccasin: [ 255, 228, 181 ],
- navajowhite: [ 255, 222, 173 ],
- navy: [ 0, 0, 128 ],
- oldlace: [ 253, 245, 230 ],
- olive: [ 128, 128, 0 ],
- olivedrab: [ 107, 142, 35 ],
- orange: [ 255, 165, 0 ],
- orangered: [ 255, 69, 0 ],
- orchid: [ 218, 112, 214 ],
- palegoldenrod: [ 238, 232, 170 ],
- palegreen: [ 152, 251, 152 ],
- paleturquoise: [ 175, 238, 238 ],
- palevioletred: [ 219, 112, 147 ],
- papayawhip: [ 255, 239, 213 ],
- peachpuff: [ 255, 218, 185 ],
- peru: [ 205, 133, 63 ],
- pink: [ 255, 192, 203 ],
- plum: [ 221, 160, 221 ],
- powderblue: [ 176, 224, 230 ],
- purple: [ 128, 0, 128 ],
- rebeccapurple: [ 102, 51, 153 ],
- red: [ 255, 0, 0 ],
- rosybrown: [ 188, 143, 143 ],
- royalblue: [ 65, 105, 225 ],
- saddlebrown: [ 139, 69, 19 ],
- salmon: [ 250, 128, 114 ],
- sandybrown: [ 244, 164, 96 ],
- seagreen: [ 46, 139, 87 ],
- seashell: [ 255, 245, 238 ],
- sienna: [ 160, 82, 45 ],
- silver: [ 192, 192, 192 ],
- skyblue: [ 135, 206, 235 ],
- slateblue: [ 106, 90, 205 ],
- slategray: [ 112, 128, 144 ],
- slategrey: [ 112, 128, 144 ],
- snow: [ 255, 250, 250 ],
- springgreen: [ 0, 255, 127 ],
- steelblue: [ 70, 130, 180 ],
- tan: [ 210, 180, 140 ],
- teal: [ 0, 128, 128 ],
- thistle: [ 216, 191, 216 ],
- tomato: [ 255, 99, 71 ],
- turquoise: [ 64, 224, 208 ],
- violet: [ 238, 130, 238 ],
- wheat: [ 245, 222, 179 ],
- white: [ 255, 255, 255 ],
- whitesmoke: [ 245, 245, 245 ],
- yellow: [ 255, 255, 0 ],
- yellowgreen: [ 154, 205, 50 ]
- };
- var css_colors_default = cssColors;
- var originals = {
- ariaAttrs: aria_attrs_default,
- ariaRoles: _extends({}, aria_roles_default, dpub_roles_default, graphics_roles_default),
- htmlElms: html_elms_default,
- cssColors: css_colors_default
- };
- var standards = _extends({}, originals);
- function configureStandards(config) {
- Object.keys(standards).forEach(function(propName) {
- if (config[propName]) {
- standards[propName] = deep_merge_default(standards[propName], config[propName]);
- }
- });
- }
- function resetStandards() {
- Object.keys(standards).forEach(function(propName) {
- standards[propName] = originals[propName];
- });
- }
- var standards_default = standards;
- function isUnsupportedRole(role) {
- var roleDefinition = standards_default.ariaRoles[role];
- return roleDefinition ? !!roleDefinition.unsupported : false;
- }
- var is_unsupported_role_default = isUnsupportedRole;
- function isValidRole(role) {
- 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;
- var roleDefinition = standards_default.ariaRoles[role];
- var isRoleUnsupported = is_unsupported_role_default(role);
- if (!roleDefinition || flagUnsupported && isRoleUnsupported) {
- return false;
- }
- return allowAbstract ? true : roleDefinition.type !== 'abstract';
- }
- var is_valid_role_default = isValidRole;
- function getExplicitRole(vNode) {
- var _ref27 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, fallback = _ref27.fallback, abstracts = _ref27.abstracts, dpub = _ref27.dpub;
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- if (vNode.props.nodeType !== 1) {
- return null;
- }
- var roleAttr = (vNode.attr('role') || '').trim().toLowerCase();
- var roleList = fallback ? token_list_default(roleAttr) : [ roleAttr ];
- var firstValidRole = roleList.find(function(role) {
- if (!dpub && role.substr(0, 4) === 'doc-') {
- return false;
- }
- return is_valid_role_default(role, {
- allowAbstract: abstracts
- });
- });
- return firstValidRole || null;
- }
- var get_explicit_role_default = getExplicitRole;
- function getElementsByContentType(type) {
- return Object.keys(standards_default.htmlElms).filter(function(nodeName2) {
- var elm = standards_default.htmlElms[nodeName2];
- if (elm.contentTypes) {
- return elm.contentTypes.includes(type);
- }
- if (!elm.variant) {
- return false;
- }
- if (elm.variant['default'] && elm.variant['default'].contentTypes) {
- return elm.variant['default'].contentTypes.includes(type);
- }
- return false;
- });
- }
- var get_elements_by_content_type_default = getElementsByContentType;
- function getGlobalAriaAttrs() {
- return cache_default.get('globalAriaAttrs', function() {
- return Object.keys(standards_default.ariaAttrs).filter(function(attrName) {
- return standards_default.ariaAttrs[attrName].global;
- });
- });
- }
- var get_global_aria_attrs_default = getGlobalAriaAttrs;
- function toGrid(node) {
- var table = [];
- var rows = node.rows;
- for (var i = 0, rowLength = rows.length; i < rowLength; i++) {
- var cells = rows[i].cells;
- table[i] = table[i] || [];
- var columnIndex = 0;
- for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
- for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
- var rowspanAttr = cells[j].getAttribute('rowspan');
- var rowspanValue = parseInt(rowspanAttr) === 0 || cells[j].rowspan === 0 ? rows.length : cells[j].rowSpan;
- for (var rowSpan = 0; rowSpan < rowspanValue; rowSpan++) {
- table[i + rowSpan] = table[i + rowSpan] || [];
- while (table[i + rowSpan][columnIndex]) {
- columnIndex++;
- }
- table[i + rowSpan][columnIndex] = cells[j];
- }
- columnIndex++;
- }
- }
- }
- return table;
- }
- var to_grid_default = memoize_default(toGrid);
- function getCellPosition(cell, tableGrid) {
- var rowIndex, index;
- if (!tableGrid) {
- tableGrid = to_grid_default(find_up_default(cell, 'table'));
- }
- for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
- if (tableGrid[rowIndex]) {
- index = tableGrid[rowIndex].indexOf(cell);
- if (index !== -1) {
- return {
- x: index,
- y: rowIndex
- };
- }
- }
- }
- }
- var get_cell_position_default = memoize_default(getCellPosition);
- function getScope(cell) {
- var vNode = cell instanceof abstract_virtual_node_default ? cell : get_node_from_tree_default(cell);
- cell = vNode.actualNode;
- var scope = vNode.attr('scope');
- var role = vNode.attr('role');
- if (![ 'td', 'th' ].includes(vNode.props.nodeName)) {
- throw new TypeError('Expected TD or TH element');
- }
- if (role === 'columnheader') {
- return 'col';
- } else if (role === 'rowheader') {
- return 'row';
- } else if (scope === 'col' || scope === 'row') {
- return scope;
- } else if (vNode.props.nodeName !== 'th') {
- return false;
- } else if (!vNode.actualNode) {
- return 'auto';
- }
- var tableGrid = to_grid_default(find_up_default(cell, 'table'));
- var pos = get_cell_position_default(cell, tableGrid);
- var headerRow = tableGrid[pos.y].reduce(function(headerRow2, cell2) {
- return headerRow2 && cell2.nodeName.toUpperCase() === 'TH';
- }, true);
- if (headerRow) {
- return 'col';
- }
- var headerCol = tableGrid.map(function(col) {
- return col[pos.x];
- }).reduce(function(headerCol2, cell2) {
- return headerCol2 && cell2 && cell2.nodeName.toUpperCase() === 'TH';
- }, true);
- if (headerCol) {
- return 'row';
- }
- return 'auto';
- }
- var get_scope_default = getScope;
- function isColumnHeader(element) {
- return [ 'col', 'auto' ].indexOf(get_scope_default(element)) !== -1;
- }
- var is_column_header_default = isColumnHeader;
- function isRowHeader(cell) {
- return [ 'row', 'auto' ].includes(get_scope_default(cell));
- }
- var is_row_header_default = isRowHeader;
- function sanitize(str) {
- if (!str) {
- return '';
- }
- return str.replace(/\r\n/g, '\n').replace(/\u00A0/g, ' ').replace(/[\s]{2,}/g, ' ').trim();
- }
- var sanitize_default = sanitize;
- function isNativelyFocusable(el) {
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- if (!vNode || focus_disabled_default(vNode)) {
- return false;
- }
- switch (vNode.props.nodeName) {
- case 'a':
- case 'area':
- if (vNode.hasAttr('href')) {
- return true;
- }
- break;
- case 'input':
- return vNode.props.type !== 'hidden';
- case 'textarea':
- case 'select':
- case 'summary':
- case 'button':
- return true;
- case 'details':
- return !query_selector_all_default(vNode, 'summary').length;
- }
- return false;
- }
- var is_natively_focusable_default = isNativelyFocusable;
- function _isFocusable(el) {
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- if (vNode.props.nodeType !== 1) {
- return false;
- }
- if (focus_disabled_default(vNode)) {
- return false;
- } else if (is_natively_focusable_default(vNode)) {
- return true;
- }
- var tabindex = vNode.attr('tabindex');
- if (tabindex && !isNaN(parseInt(tabindex, 10))) {
- return true;
- }
- return false;
- }
- var sectioningElementSelector = get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
- return ''.concat(nodeName2, ':not([role])');
- }).join(', ') + ' , main:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]';
- function hasAccessibleName(vNode) {
- var ariaLabelledby = sanitize_default(arialabelledby_text_default(vNode));
- var ariaLabel = sanitize_default(arialabel_text_default(vNode));
- return !!(ariaLabelledby || ariaLabel);
- }
- var implicitHtmlRoles = {
- a: function a(vNode) {
- return vNode.hasAttr('href') ? 'link' : null;
- },
- area: function area(vNode) {
- return vNode.hasAttr('href') ? 'link' : null;
- },
- article: 'article',
- aside: 'complementary',
- body: 'document',
- button: 'button',
- datalist: 'listbox',
- dd: 'definition',
- dfn: 'term',
- details: 'group',
- dialog: 'dialog',
- dt: 'term',
- fieldset: 'group',
- figure: 'figure',
- footer: function footer(vNode) {
- var sectioningElement = closest_default(vNode, sectioningElementSelector);
- return !sectioningElement ? 'contentinfo' : null;
- },
- form: function form(vNode) {
- return hasAccessibleName(vNode) ? 'form' : null;
- },
- h1: 'heading',
- h2: 'heading',
- h3: 'heading',
- h4: 'heading',
- h5: 'heading',
- h6: 'heading',
- header: function header(vNode) {
- var sectioningElement = closest_default(vNode, sectioningElementSelector);
- return !sectioningElement ? 'banner' : null;
- },
- hr: 'separator',
- img: function img(vNode) {
- var emptyAlt = vNode.hasAttr('alt') && !vNode.attr('alt');
- var hasGlobalAria = get_global_aria_attrs_default().find(function(attr) {
- return vNode.hasAttr(attr);
- });
- return emptyAlt && !hasGlobalAria && !_isFocusable(vNode) ? 'presentation' : 'img';
- },
- input: function input(vNode) {
- var suggestionsSourceElement;
- if (vNode.hasAttr('list')) {
- var listElement = idrefs_default(vNode.actualNode, 'list').filter(function(node) {
- return !!node;
- })[0];
- suggestionsSourceElement = listElement && listElement.nodeName.toLowerCase() === 'datalist';
- }
- switch (vNode.props.type) {
- case 'checkbox':
- return 'checkbox';
- case 'number':
- return 'spinbutton';
- case 'radio':
- return 'radio';
- case 'range':
- return 'slider';
- case 'search':
- return !suggestionsSourceElement ? 'searchbox' : 'combobox';
- case 'button':
- case 'image':
- case 'reset':
- case 'submit':
- return 'button';
- case 'text':
- case 'tel':
- case 'url':
- case 'email':
- case '':
- return !suggestionsSourceElement ? 'textbox' : 'combobox';
- default:
- return 'textbox';
- }
- },
- li: 'listitem',
- main: 'main',
- math: 'math',
- menu: 'list',
- nav: 'navigation',
- ol: 'list',
- optgroup: 'group',
- option: 'option',
- output: 'status',
- progress: 'progressbar',
- section: function section(vNode) {
- return hasAccessibleName(vNode) ? 'region' : null;
- },
- select: function select(vNode) {
- return vNode.hasAttr('multiple') || parseInt(vNode.attr('size')) > 1 ? 'listbox' : 'combobox';
- },
- summary: 'button',
- table: 'table',
- tbody: 'rowgroup',
- td: function td(vNode) {
- var table = closest_default(vNode, 'table');
- var role = get_explicit_role_default(table);
- return [ 'grid', 'treegrid' ].includes(role) ? 'gridcell' : 'cell';
- },
- textarea: 'textbox',
- tfoot: 'rowgroup',
- th: function th(vNode) {
- if (is_column_header_default(vNode)) {
- return 'columnheader';
- }
- if (is_row_header_default(vNode)) {
- return 'rowheader';
- }
- },
- thead: 'rowgroup',
- tr: 'row',
- ul: 'list'
- };
- var implicit_html_roles_default = implicitHtmlRoles;
- function fromPrimative(someString, matcher) {
- var matcherType = _typeof(matcher);
- if (Array.isArray(matcher) && typeof someString !== 'undefined') {
- return matcher.includes(someString);
- }
- if (matcherType === 'function') {
- return !!matcher(someString);
- }
- if (someString !== null && someString !== void 0) {
- if (matcher instanceof RegExp) {
- return matcher.test(someString);
- }
- if (/^\/.*\/$/.test(matcher)) {
- var pattern = matcher.substring(1, matcher.length - 1);
- return new RegExp(pattern).test(someString);
- }
- }
- return matcher === someString;
- }
- var from_primative_default = fromPrimative;
- function hasAccessibleName2(vNode, matcher) {
- return from_primative_default(!!accessible_text_virtual_default(vNode), matcher);
- }
- var has_accessible_name_default = hasAccessibleName2;
- function fromFunction(getValue, matcher) {
- var matcherType = _typeof(matcher);
- if (matcherType !== 'object' || Array.isArray(matcher) || matcher instanceof RegExp) {
- throw new Error('Expect matcher to be an object');
- }
- return Object.keys(matcher).every(function(propName) {
- return from_primative_default(getValue(propName), matcher[propName]);
- });
- }
- var from_function_default = fromFunction;
- function attributes(vNode, matcher) {
- if (!(vNode instanceof abstract_virtual_node_default)) {
- vNode = get_node_from_tree_default(vNode);
- }
- return from_function_default(function(attrName) {
- return vNode.attr(attrName);
- }, matcher);
- }
- var attributes_default = attributes;
- function condition(arg, condition2) {
- return !!condition2(arg);
- }
- var condition_default = condition;
- function explicitRole(vNode, matcher) {
- return from_primative_default(get_explicit_role_default(vNode), matcher);
- }
- var explicit_role_default = explicitRole;
- function implicitRole(vNode, matcher) {
- return from_primative_default(implicit_role_default(vNode), matcher);
- }
- var implicit_role_default2 = implicitRole;
- function nodeName(vNode, matcher) {
- if (!(vNode instanceof abstract_virtual_node_default)) {
- vNode = get_node_from_tree_default(vNode);
- }
- return from_primative_default(vNode.props.nodeName, matcher);
- }
- var node_name_default = nodeName;
- function properties(vNode, matcher) {
- if (!(vNode instanceof abstract_virtual_node_default)) {
- vNode = get_node_from_tree_default(vNode);
- }
- return from_function_default(function(propName) {
- return vNode.props[propName];
- }, matcher);
- }
- var properties_default = properties;
- function semanticRole(vNode, matcher) {
- return from_primative_default(get_role_default(vNode), matcher);
- }
- var semantic_role_default = semanticRole;
- var matchers = {
- hasAccessibleName: has_accessible_name_default,
- attributes: attributes_default,
- condition: condition_default,
- explicitRole: explicit_role_default,
- implicitRole: implicit_role_default2,
- nodeName: node_name_default,
- properties: properties_default,
- semanticRole: semantic_role_default
- };
- function fromDefinition(vNode, definition) {
- if (!(vNode instanceof abstract_virtual_node_default)) {
- vNode = get_node_from_tree_default(vNode);
- }
- if (Array.isArray(definition)) {
- return definition.some(function(definitionItem) {
- return fromDefinition(vNode, definitionItem);
- });
- }
- if (typeof definition === 'string') {
- return matches_default(vNode, definition);
- }
- return Object.keys(definition).every(function(matcherName) {
- if (!matchers[matcherName]) {
- throw new Error('Unknown matcher type "'.concat(matcherName, '"'));
- }
- var matchMethod = matchers[matcherName];
- var matcher = definition[matcherName];
- return matchMethod(vNode, matcher);
- });
- }
- var from_definition_default = fromDefinition;
- function matches2(vNode, definition) {
- return from_definition_default(vNode, definition);
- }
- var matches_default2 = matches2;
- matches_default2.hasAccessibleName = has_accessible_name_default;
- matches_default2.attributes = attributes_default;
- matches_default2.condition = condition_default;
- matches_default2.explicitRole = explicit_role_default;
- matches_default2.fromDefinition = from_definition_default;
- matches_default2.fromFunction = from_function_default;
- matches_default2.fromPrimative = from_primative_default;
- matches_default2.implicitRole = implicit_role_default2;
- matches_default2.nodeName = node_name_default;
- matches_default2.properties = properties_default;
- matches_default2.semanticRole = semantic_role_default;
- var matches_default3 = matches_default2;
- function getElementSpec(vNode) {
- var _ref28 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref28$noMatchAccessi = _ref28.noMatchAccessibleName, noMatchAccessibleName = _ref28$noMatchAccessi === void 0 ? false : _ref28$noMatchAccessi;
- var standard = standards_default.htmlElms[vNode.props.nodeName];
- if (!standard) {
- return {};
- }
- if (!standard.variant) {
- return standard;
- }
- var variant = standard.variant, spec = _objectWithoutProperties(standard, _excluded2);
- for (var variantName in variant) {
- if (!variant.hasOwnProperty(variantName) || variantName === 'default') {
- continue;
- }
- var _variant$variantName = variant[variantName], matches4 = _variant$variantName.matches, props = _objectWithoutProperties(_variant$variantName, _excluded3);
- var matchProperties = Array.isArray(matches4) ? matches4 : [ matches4 ];
- for (var _i8 = 0; _i8 < matchProperties.length && noMatchAccessibleName; _i8++) {
- if (matchProperties[_i8].hasOwnProperty('hasAccessibleName')) {
- return standard;
- }
- }
- if (matches_default3(vNode, matches4)) {
- for (var propName in props) {
- if (props.hasOwnProperty(propName)) {
- spec[propName] = props[propName];
- }
- }
- }
- }
- for (var _propName in variant['default']) {
- if (variant['default'].hasOwnProperty(_propName) && typeof spec[_propName] === 'undefined') {
- spec[_propName] = variant['default'][_propName];
- }
- }
- return spec;
- }
- var get_element_spec_default = getElementSpec;
- function implicitRole2(node) {
- var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, chromium = _ref29.chromium;
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- node = vNode.actualNode;
- if (!vNode) {
- throw new ReferenceError('Cannot get implicit role of a node outside the current scope.');
- }
- var nodeName2 = vNode.props.nodeName;
- var role = implicit_html_roles_default[nodeName2];
- if (!role && chromium) {
- var _get_element_spec_def = get_element_spec_default(vNode), chromiumRole = _get_element_spec_def.chromiumRole;
- return chromiumRole || null;
- }
- if (typeof role === 'function') {
- return role(vNode);
- }
- return role || null;
- }
- var implicit_role_default = implicitRole2;
- var inheritsPresentationChain = {
- td: [ 'tr' ],
- th: [ 'tr' ],
- tr: [ 'thead', 'tbody', 'tfoot', 'table' ],
- thead: [ 'table' ],
- tbody: [ 'table' ],
- tfoot: [ 'table' ],
- li: [ 'ol', 'ul' ],
- dt: [ 'dl', 'div' ],
- dd: [ 'dl', 'div' ],
- div: [ 'dl' ]
- };
- function getInheritedRole(vNode, explicitRoleOptions) {
- var parentNodeNames = inheritsPresentationChain[vNode.props.nodeName];
- if (!parentNodeNames) {
- return null;
- }
- if (!vNode.parent) {
- if (!vNode.actualNode) {
- return null;
- }
- throw new ReferenceError('Cannot determine role presentational inheritance of a required parent outside the current scope.');
- }
- if (!parentNodeNames.includes(vNode.parent.props.nodeName)) {
- return null;
- }
- var parentRole = get_explicit_role_default(vNode.parent, explicitRoleOptions);
- if ([ 'none', 'presentation' ].includes(parentRole) && !hasConflictResolution(vNode.parent)) {
- return parentRole;
- }
- if (parentRole) {
- return null;
- }
- return getInheritedRole(vNode.parent, explicitRoleOptions);
- }
- function resolveImplicitRole(vNode, _ref30) {
- var chromium = _ref30.chromium, explicitRoleOptions = _objectWithoutProperties(_ref30, _excluded4);
- var implicitRole3 = implicit_role_default(vNode, {
- chromium: chromium
- });
- if (!implicitRole3) {
- return null;
- }
- var presentationalRole = getInheritedRole(vNode, explicitRoleOptions);
- if (presentationalRole) {
- return presentationalRole;
- }
- return implicitRole3;
- }
- function hasConflictResolution(vNode) {
- var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
- return vNode.hasAttr(attr);
- });
- return hasGlobalAria || _isFocusable(vNode);
- }
- function resolveRole(node) {
- var _ref31 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var noImplicit = _ref31.noImplicit, roleOptions = _objectWithoutProperties(_ref31, _excluded5);
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (vNode.props.nodeType !== 1) {
- return null;
- }
- var explicitRole2 = get_explicit_role_default(vNode, roleOptions);
- if (!explicitRole2) {
- return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
- }
- if (![ 'presentation', 'none' ].includes(explicitRole2)) {
- return explicitRole2;
- }
- if (hasConflictResolution(vNode)) {
- return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
- }
- return explicitRole2;
- }
- function getRole(node) {
- var _ref32 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var noPresentational = _ref32.noPresentational, options = _objectWithoutProperties(_ref32, _excluded6);
- var role = resolveRole(node, options);
- if (noPresentational && [ 'presentation', 'none' ].includes(role)) {
- return null;
- }
- return role;
- }
- var get_role_default = getRole;
- var alwaysTitleElements = [ 'iframe' ];
- function titleText(node) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (vNode.props.nodeType !== 1 || !node.hasAttr('title')) {
- return '';
- }
- if (!matches_default2(vNode, alwaysTitleElements) && [ 'none', 'presentation' ].includes(get_role_default(vNode))) {
- return '';
- }
- return vNode.attr('title');
- }
- var title_text_default = titleText;
- function namedFromContents(vNode) {
- var _ref33 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, strict = _ref33.strict;
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- if (vNode.props.nodeType !== 1) {
- return false;
- }
- var role = get_role_default(vNode);
- var roleDef = standards_default.ariaRoles[role];
- if (roleDef && roleDef.nameFromContent) {
- return true;
- }
- if (strict) {
- return false;
- }
- return !roleDef || [ 'presentation', 'none' ].includes(role);
- }
- var named_from_contents_default = namedFromContents;
- function getOwnedVirtual(virtualNode) {
- var actualNode = virtualNode.actualNode, children = virtualNode.children;
- if (!children) {
- throw new Error('getOwnedVirtual requires a virtual node');
- }
- if (virtualNode.hasAttr('aria-owns')) {
- var owns = idrefs_default(actualNode, 'aria-owns').filter(function(element) {
- return !!element;
- }).map(function(element) {
- return axe.utils.getNodeFromTree(element);
- });
- return [].concat(_toConsumableArray(children), _toConsumableArray(owns));
- }
- return _toConsumableArray(children);
- }
- var get_owned_virtual_default = getOwnedVirtual;
- function subtreeText(virtualNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
- context.startNode = context.startNode || virtualNode;
- var _context = context, strict = _context.strict, inControlContext = _context.inControlContext, inLabelledByContext = _context.inLabelledByContext;
- var _get_element_spec_def2 = get_element_spec_default(virtualNode, {
- noMatchAccessibleName: true
- }), contentTypes = _get_element_spec_def2.contentTypes;
- if (alreadyProcessed2(virtualNode, context) || virtualNode.props.nodeType !== 1 || contentTypes !== null && contentTypes !== void 0 && contentTypes.includes('embedded')) {
- return '';
- }
- if (!named_from_contents_default(virtualNode, {
- strict: strict
- }) && !context.subtreeDescendant) {
- return '';
- }
- if (!strict) {
- var subtreeDescendant = !inControlContext && !inLabelledByContext;
- context = _extends({
- subtreeDescendant: subtreeDescendant
- }, context);
- }
- return get_owned_virtual_default(virtualNode).reduce(function(contentText, child) {
- return appendAccessibleText(contentText, child, context);
- }, '');
- }
- var phrasingElements = get_elements_by_content_type_default('phrasing').concat([ '#text' ]);
- function appendAccessibleText(contentText, virtualNode, context) {
- var nodeName2 = virtualNode.props.nodeName;
- var contentTextAdd = accessible_text_virtual_default(virtualNode, context);
- if (!contentTextAdd) {
- return contentText;
- }
- if (!phrasingElements.includes(nodeName2)) {
- if (contentTextAdd[0] !== ' ') {
- contentTextAdd += ' ';
- }
- if (contentText && contentText[contentText.length - 1] !== ' ') {
- contentTextAdd = ' ' + contentTextAdd;
- }
- }
- return contentText + contentTextAdd;
- }
- var subtree_text_default = subtreeText;
- function labelText(virtualNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
- if (context.inControlContext || context.inLabelledByContext || alreadyProcessed2(virtualNode, context)) {
- return '';
- }
- if (!context.startNode) {
- context.startNode = virtualNode;
- }
- var labelContext = _extends({
- inControlContext: true
- }, context);
- var explicitLabels = getExplicitLabels(virtualNode);
- var implicitLabel = closest_default(virtualNode, 'label');
- var labels;
- if (implicitLabel) {
- labels = [].concat(_toConsumableArray(explicitLabels), [ implicitLabel.actualNode ]);
- labels.sort(node_sorter_default);
- } else {
- labels = explicitLabels;
- }
- return labels.map(function(label3) {
- return accessible_text_default(label3, labelContext);
- }).filter(function(text) {
- return text !== '';
- }).join(' ');
- }
- function getExplicitLabels(virtualNode) {
- if (!virtualNode.attr('id')) {
- return [];
- }
- if (!virtualNode.actualNode) {
- throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
- }
- return find_elms_in_context_default({
- elm: 'label',
- attr: 'for',
- value: virtualNode.attr('id'),
- context: virtualNode.actualNode
- });
- }
- var label_text_default = labelText;
- var defaultButtonValues = {
- submit: 'Submit',
- image: 'Submit',
- reset: 'Reset',
- button: ''
- };
- var nativeTextMethods = {
- valueText: function valueText(_ref34) {
- var actualNode = _ref34.actualNode;
- return actualNode.value || '';
- },
- buttonDefaultText: function buttonDefaultText(_ref35) {
- var actualNode = _ref35.actualNode;
- return defaultButtonValues[actualNode.type] || '';
- },
- tableCaptionText: descendantText.bind(null, 'caption'),
- figureText: descendantText.bind(null, 'figcaption'),
- svgTitleText: descendantText.bind(null, 'title'),
- fieldsetLegendText: descendantText.bind(null, 'legend'),
- altText: attrText.bind(null, 'alt'),
- tableSummaryText: attrText.bind(null, 'summary'),
- titleText: title_text_default,
- subtreeText: subtree_text_default,
- labelText: label_text_default,
- singleSpace: function singleSpace() {
- return ' ';
- },
- placeholderText: attrText.bind(null, 'placeholder')
- };
- function attrText(attr, vNode) {
- return vNode.attr(attr) || '';
- }
- function descendantText(nodeName2, _ref36, context) {
- var actualNode = _ref36.actualNode;
- nodeName2 = nodeName2.toLowerCase();
- var nodeNames2 = [ nodeName2, actualNode.nodeName.toLowerCase() ].join(',');
- var candidate = actualNode.querySelector(nodeNames2);
- if (!candidate || candidate.nodeName.toLowerCase() !== nodeName2) {
- return '';
- }
- return accessible_text_default(candidate, context);
- }
- var native_text_methods_default = nativeTextMethods;
- function nativeTextAlternative(virtualNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var actualNode = virtualNode.actualNode;
- if (virtualNode.props.nodeType !== 1 || [ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
- return '';
- }
- var textMethods = findTextMethods(virtualNode);
- var accName = textMethods.reduce(function(accName2, step) {
- return accName2 || step(virtualNode, context);
- }, '');
- if (context.debug) {
- axe.log(accName || '{empty-value}', actualNode, context);
- }
- return accName;
- }
- function findTextMethods(virtualNode) {
- var elmSpec = get_element_spec_default(virtualNode, {
- noMatchAccessibleName: true
- });
- var methods = elmSpec.namingMethods || [];
- return methods.map(function(methodName) {
- return native_text_methods_default[methodName];
- });
- }
- var native_text_alternative_default = nativeTextAlternative;
- var unsupported = {
- accessibleNameFromFieldValue: [ 'combobox', 'listbox', 'progressbar' ]
- };
- var unsupported_default = unsupported;
- function _isVisibleToScreenReaders(vNode) {
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- return isVisibleToScreenReadersVirtual(vNode);
- }
- var isVisibleToScreenReadersVirtual = memoize_default(function isVisibleToScreenReadersMemoized(vNode, isAncestor) {
- if (ariaHidden(vNode) || _isInert(vNode, {
- skipAncestors: true,
- isAncestor: isAncestor
- })) {
- return false;
- }
- if (vNode.actualNode && vNode.props.nodeName === 'area') {
- return !areaHidden(vNode, isVisibleToScreenReadersVirtual);
- }
- if (_isHiddenForEveryone(vNode, {
- skipAncestors: true,
- isAncestor: isAncestor
- })) {
- return false;
- }
- if (!vNode.parent) {
- return true;
- }
- return isVisibleToScreenReadersVirtual(vNode.parent, true);
- });
- function visibleVirtual(element, screenReader, noRecursing) {
- var vNode = element instanceof abstract_virtual_node_default ? element : get_node_from_tree_default(element);
- var visibleMethod = screenReader ? _isVisibleToScreenReaders : _isVisibleOnScreen;
- var visible2 = !element.actualNode || element.actualNode && visibleMethod(element);
- var result = vNode.children.map(function(child) {
- var _child$props = child.props, nodeType = _child$props.nodeType, nodeValue = _child$props.nodeValue;
- if (nodeType === 3) {
- if (nodeValue && visible2) {
- return nodeValue;
- }
- } else if (!noRecursing) {
- return visibleVirtual(child, screenReader);
- }
- }).join('');
- return sanitize_default(result);
- }
- var visible_virtual_default = visibleVirtual;
- var nonTextInputTypes = [ 'button', 'checkbox', 'color', 'file', 'hidden', 'image', 'password', 'radio', 'reset', 'submit' ];
- function isNativeTextbox(node) {
- node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- var nodeName2 = node.props.nodeName;
- return nodeName2 === 'textarea' || nodeName2 === 'input' && !nonTextInputTypes.includes((node.attr('type') || '').toLowerCase());
- }
- var is_native_textbox_default = isNativeTextbox;
- function isNativeSelect(node) {
- node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- var nodeName2 = node.props.nodeName;
- return nodeName2 === 'select';
- }
- var is_native_select_default = isNativeSelect;
- function isAriaTextbox(node) {
- var role = get_explicit_role_default(node);
- return role === 'textbox';
- }
- var is_aria_textbox_default = isAriaTextbox;
- function isAriaListbox(node) {
- var role = get_explicit_role_default(node);
- return role === 'listbox';
- }
- var is_aria_listbox_default = isAriaListbox;
- function isAriaCombobox(node) {
- var role = get_explicit_role_default(node);
- return role === 'combobox';
- }
- var is_aria_combobox_default = isAriaCombobox;
- var rangeRoles = [ 'progressbar', 'scrollbar', 'slider', 'spinbutton' ];
- function isAriaRange(node) {
- var role = get_explicit_role_default(node);
- return rangeRoles.includes(role);
- }
- var is_aria_range_default = isAriaRange;
- var controlValueRoles = [ 'textbox', 'progressbar', 'scrollbar', 'slider', 'spinbutton', 'combobox', 'listbox' ];
- var _formControlValueMethods = {
- nativeTextboxValue: nativeTextboxValue,
- nativeSelectValue: nativeSelectValue,
- ariaTextboxValue: ariaTextboxValue,
- ariaListboxValue: ariaListboxValue,
- ariaComboboxValue: ariaComboboxValue,
- ariaRangeValue: ariaRangeValue
- };
- function formControlValue(virtualNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var actualNode = virtualNode.actualNode;
- var unsupportedRoles = unsupported_default.accessibleNameFromFieldValue || [];
- var role = get_role_default(virtualNode);
- if (context.startNode === virtualNode || !controlValueRoles.includes(role) || unsupportedRoles.includes(role)) {
- return '';
- }
- var valueMethods = Object.keys(_formControlValueMethods).map(function(name) {
- return _formControlValueMethods[name];
- });
- var valueString = valueMethods.reduce(function(accName, step) {
- return accName || step(virtualNode, context);
- }, '');
- if (context.debug) {
- log_default(valueString || '{empty-value}', actualNode, context);
- }
- return valueString;
- }
- function nativeTextboxValue(node) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (is_native_textbox_default(vNode)) {
- return vNode.props.value || '';
- }
- return '';
- }
- function nativeSelectValue(node) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (!is_native_select_default(vNode)) {
- return '';
- }
- var options = query_selector_all_default(vNode, 'option');
- var selectedOptions = options.filter(function(option) {
- return option.props.selected;
- });
- if (!selectedOptions.length) {
- selectedOptions.push(options[0]);
- }
- return selectedOptions.map(function(option) {
- return visible_virtual_default(option);
- }).join(' ') || '';
- }
- function ariaTextboxValue(node) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- var actualNode = vNode.actualNode;
- if (!is_aria_textbox_default(vNode)) {
- return '';
- }
- if (!actualNode || actualNode && !_isHiddenForEveryone(actualNode)) {
- return visible_virtual_default(vNode, true);
- } else {
- return actualNode.textContent;
- }
- }
- function ariaListboxValue(node, context) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (!is_aria_listbox_default(vNode)) {
- return '';
- }
- var selected = get_owned_virtual_default(vNode).filter(function(owned) {
- return get_role_default(owned) === 'option' && owned.attr('aria-selected') === 'true';
- });
- if (selected.length === 0) {
- return '';
- }
- return accessible_text_virtual_default(selected[0], context);
- }
- function ariaComboboxValue(node, context) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (!is_aria_combobox_default(vNode)) {
- return '';
- }
- var listbox = get_owned_virtual_default(vNode).filter(function(elm) {
- return get_role_default(elm) === 'listbox';
- })[0];
- return listbox ? ariaListboxValue(listbox, context) : '';
- }
- function ariaRangeValue(node) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (!is_aria_range_default(vNode) || !vNode.hasAttr('aria-valuenow')) {
- return '';
- }
- var valueNow = +vNode.attr('aria-valuenow');
- return !isNaN(valueNow) ? String(valueNow) : '0';
- }
- var form_control_value_default = formControlValue;
- function getUnicodeNonBmpRegExp() {
- 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;
- }
- function getPunctuationRegExp() {
- return /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&\xa3\xa2\xa5\xa7\u20ac()*+,\-.\/:;<=>?@\[\]^_`{|}~\xb1]/g;
- }
- function getSupplementaryPrivateUseRegExp() {
- return /[\uDB80-\uDBBF][\uDC00-\uDFFF]/g;
- }
- var emoji_regex_default = function emoji_regex_default() {
- 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\u26D3\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](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\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])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\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-\uDDF5\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\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-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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;
- };
- function hasUnicode(str, options) {
- var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
- if (emoji) {
- return emoji_regex_default().test(str);
- }
- if (nonBmp) {
- return getUnicodeNonBmpRegExp().test(str) || getSupplementaryPrivateUseRegExp().test(str);
- }
- if (punctuations) {
- return getPunctuationRegExp().test(str);
- }
- return false;
- }
- var has_unicode_default = hasUnicode;
- function isIconLigature(textVNode) {
- var differenceThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
- var occurrenceThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
- var nodeValue = textVNode.actualNode.nodeValue.trim();
- if (!sanitize_default(nodeValue) || has_unicode_default(nodeValue, {
- emoji: true,
- nonBmp: true
- })) {
- return false;
- }
- var canvasContext = cache_default.get('canvasContext', function() {
- return document.createElement('canvas').getContext('2d', {
- willReadFrequently: true
- });
- });
- var canvas = canvasContext.canvas;
- if (!cache_default.get('fonts')) {
- cache_default.set('fonts', {});
- }
- var fonts = cache_default.get('fonts');
- var style = window.getComputedStyle(textVNode.parent.actualNode);
- var fontFamily = style.getPropertyValue('font-family');
- if (!fonts[fontFamily]) {
- fonts[fontFamily] = {
- occurrences: 0,
- numLigatures: 0
- };
- }
- var font = fonts[fontFamily];
- if (font.occurrences >= occurrenceThreshold) {
- if (font.numLigatures / font.occurrences === 1) {
- return true;
- } else if (font.numLigatures === 0) {
- return false;
- }
- }
- font.occurrences++;
- var fontSize = 30;
- var fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
- canvasContext.font = fontStyle;
- var firstChar = nodeValue.charAt(0);
- var width = canvasContext.measureText(firstChar).width;
- if (width < 30) {
- var diff = 30 / width;
- width *= diff;
- fontSize *= diff;
- fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
- }
- canvas.width = width;
- canvas.height = fontSize;
- canvasContext.font = fontStyle;
- canvasContext.textAlign = 'left';
- canvasContext.textBaseline = 'top';
- canvasContext.fillText(firstChar, 0, 0);
- var compareData = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
- if (!compareData.some(function(pixel) {
- return pixel;
- })) {
- font.numLigatures++;
- return true;
- }
- canvasContext.clearRect(0, 0, width, fontSize);
- canvasContext.fillText(nodeValue, 0, 0);
- var compareWith = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
- var differences = compareData.reduce(function(diff, pixel, i) {
- if (pixel === 0 && compareWith[i] === 0) {
- return diff;
- }
- if (pixel !== 0 && compareWith[i] !== 0) {
- return diff;
- }
- return ++diff;
- }, 0);
- var expectedWidth = nodeValue.split('').reduce(function(width2, _char2) {
- return width2 + canvasContext.measureText(_char2).width;
- }, 0);
- var actualWidth = canvasContext.measureText(nodeValue).width;
- var pixelDifference = differences / compareData.length;
- var sizeDifference = 1 - actualWidth / expectedWidth;
- if (pixelDifference >= differenceThreshold && sizeDifference >= differenceThreshold) {
- font.numLigatures++;
- return true;
- }
- return false;
- }
- var is_icon_ligature_default = isIconLigature;
- function accessibleTextVirtual(virtualNode) {
- var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- context = prepareContext(virtualNode, context);
- if (shouldIgnoreHidden(virtualNode, context)) {
- return '';
- }
- if (shouldIgnoreIconLigature(virtualNode, context)) {
- return '';
- }
- var computationSteps = [ arialabelledby_text_default, arialabel_text_default, native_text_alternative_default, form_control_value_default, subtree_text_default, textNodeValue, title_text_default ];
- var accName = computationSteps.reduce(function(accName2, step) {
- if (context.startNode === virtualNode) {
- accName2 = sanitize_default(accName2);
- }
- if (accName2 !== '') {
- return accName2;
- }
- return step(virtualNode, context);
- }, '');
- if (context.debug) {
- axe.log(accName || '{empty-value}', virtualNode.actualNode, context);
- }
- return accName;
- }
- function textNodeValue(virtualNode) {
- if (virtualNode.props.nodeType !== 3) {
- return '';
- }
- return virtualNode.props.nodeValue;
- }
- function shouldIgnoreHidden(virtualNode, context) {
- if (!virtualNode) {
- return false;
- }
- if (virtualNode.props.nodeType !== 1 || context.includeHidden) {
- return false;
- }
- return !_isVisibleToScreenReaders(virtualNode);
- }
- function shouldIgnoreIconLigature(virtualNode, context) {
- var _context$occurrenceTh;
- var ignoreIconLigature = context.ignoreIconLigature, pixelThreshold = context.pixelThreshold;
- var occurrenceThreshold = (_context$occurrenceTh = context.occurrenceThreshold) !== null && _context$occurrenceTh !== void 0 ? _context$occurrenceTh : context.occuranceThreshold;
- if (virtualNode.props.nodeType !== 3 || !ignoreIconLigature) {
- return false;
- }
- return is_icon_ligature_default(virtualNode, pixelThreshold, occurrenceThreshold);
- }
- function prepareContext(virtualNode, context) {
- if (!context.startNode) {
- context = _extends({
- startNode: virtualNode
- }, context);
- }
- if (virtualNode.props.nodeType === 1 && context.inLabelledByContext && context.includeHidden === void 0) {
- context = _extends({
- includeHidden: !_isVisibleToScreenReaders(virtualNode)
- }, context);
- }
- return context;
- }
- accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(virtualnode, context) {
- context.processed = context.processed || [];
- if (context.processed.includes(virtualnode)) {
- return true;
- }
- context.processed.push(virtualnode);
- return false;
- };
- var accessible_text_virtual_default = accessibleTextVirtual;
- function removeUnicode(str, options) {
- var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
- if (emoji) {
- str = str.replace(emoji_regex_default(), '');
- }
- if (nonBmp) {
- str = str.replace(getUnicodeNonBmpRegExp(), '');
- str = str.replace(getSupplementaryPrivateUseRegExp(), '');
- }
- if (punctuations) {
- str = str.replace(getPunctuationRegExp(), '');
- }
- return str;
- }
- var remove_unicode_default = removeUnicode;
- function isHumanInterpretable(str) {
- if (!str.length) {
- return 0;
- }
- var alphaNumericIconMap = [ 'x', 'i' ];
- if (alphaNumericIconMap.includes(str)) {
- return 0;
- }
- var noUnicodeStr = remove_unicode_default(str, {
- emoji: true,
- nonBmp: true,
- punctuations: true
- });
- if (!sanitize_default(noUnicodeStr)) {
- return 0;
- }
- return 1;
- }
- var is_human_interpretable_default = isHumanInterpretable;
- var _autocomplete = {
- stateTerms: [ 'on', 'off' ],
- 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' ],
- qualifiers: [ 'home', 'work', 'mobile', 'fax', 'pager' ],
- qualifiedTerms: [ 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp' ],
- locations: [ 'billing', 'shipping' ]
- };
- function isValidAutocomplete(autocompleteValue) {
- var _ref37 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref37$looseTyped = _ref37.looseTyped, looseTyped = _ref37$looseTyped === void 0 ? false : _ref37$looseTyped, _ref37$stateTerms = _ref37.stateTerms, stateTerms = _ref37$stateTerms === void 0 ? [] : _ref37$stateTerms, _ref37$locations = _ref37.locations, locations = _ref37$locations === void 0 ? [] : _ref37$locations, _ref37$qualifiers = _ref37.qualifiers, qualifiers = _ref37$qualifiers === void 0 ? [] : _ref37$qualifiers, _ref37$standaloneTerm = _ref37.standaloneTerms, standaloneTerms = _ref37$standaloneTerm === void 0 ? [] : _ref37$standaloneTerm, _ref37$qualifiedTerms = _ref37.qualifiedTerms, qualifiedTerms = _ref37$qualifiedTerms === void 0 ? [] : _ref37$qualifiedTerms;
- autocompleteValue = autocompleteValue.toLowerCase().trim();
- stateTerms = stateTerms.concat(_autocomplete.stateTerms);
- if (stateTerms.includes(autocompleteValue) || autocompleteValue === '') {
- return true;
- }
- qualifiers = qualifiers.concat(_autocomplete.qualifiers);
- locations = locations.concat(_autocomplete.locations);
- standaloneTerms = standaloneTerms.concat(_autocomplete.standaloneTerms);
- qualifiedTerms = qualifiedTerms.concat(_autocomplete.qualifiedTerms);
- var autocompleteTerms = autocompleteValue.split(/\s+/g);
- if (autocompleteTerms[autocompleteTerms.length - 1] === 'webauthn') {
- autocompleteTerms.pop();
- if (autocompleteTerms.length === 0) {
- return false;
- }
- }
- if (!looseTyped) {
- if (autocompleteTerms[0].length > 8 && autocompleteTerms[0].substr(0, 8) === 'section-') {
- autocompleteTerms.shift();
- }
- if (locations.includes(autocompleteTerms[0])) {
- autocompleteTerms.shift();
- }
- if (qualifiers.includes(autocompleteTerms[0])) {
- autocompleteTerms.shift();
- standaloneTerms = [];
- }
- if (autocompleteTerms.length !== 1) {
- return false;
- }
- }
- var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
- return standaloneTerms.includes(purposeTerm) || qualifiedTerms.includes(purposeTerm);
- }
- var is_valid_autocomplete_default = isValidAutocomplete;
- function labelVirtual(virtualNode) {
- var ref, candidate;
- if (virtualNode.attr('aria-labelledby')) {
- ref = idrefs_default(virtualNode.actualNode, 'aria-labelledby');
- candidate = ref.map(function(thing) {
- var vNode = get_node_from_tree_default(thing);
- return vNode ? visible_virtual_default(vNode) : '';
- }).join(' ').trim();
- if (candidate) {
- return candidate;
- }
- }
- candidate = virtualNode.attr('aria-label');
- if (candidate) {
- candidate = sanitize_default(candidate);
- if (candidate) {
- return candidate;
- }
- }
- return null;
- }
- var label_virtual_default = labelVirtual;
- function visible(element, screenReader, noRecursing) {
- element = get_node_from_tree_default(element);
- return visible_virtual_default(element, screenReader, noRecursing);
- }
- var visible_default = visible;
- function labelVirtual2(virtualNode) {
- var ref, candidate, doc;
- candidate = label_virtual_default(virtualNode);
- if (candidate) {
- return candidate;
- }
- if (virtualNode.attr('id')) {
- if (!virtualNode.actualNode) {
- throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
- }
- var id = escape_selector_default(virtualNode.attr('id'));
- doc = get_root_node_default2(virtualNode.actualNode);
- ref = doc.querySelector('label[for="' + id + '"]');
- candidate = ref && visible_default(ref, true);
- if (candidate) {
- return candidate;
- }
- }
- ref = closest_default(virtualNode, 'label');
- candidate = ref && visible_virtual_default(ref, true);
- if (candidate) {
- return candidate;
- }
- return null;
- }
- var label_virtual_default2 = labelVirtual2;
- function label(node) {
- node = get_node_from_tree_default(node);
- return label_virtual_default2(node);
- }
- var label_default = label;
- var nativeElementType = [ {
- matches: [ {
- nodeName: 'textarea'
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'text', 'password', 'search', 'tel', 'email', 'url' ]
- }
- } ],
- namingMethods: 'labelText'
- }, {
- matches: {
- nodeName: 'input',
- properties: {
- type: [ 'button', 'submit', 'reset' ]
- }
- },
- namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
- }, {
- matches: {
- nodeName: 'input',
- properties: {
- type: 'image'
- }
- },
- namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
- }, {
- matches: 'button',
- namingMethods: 'subtreeText'
- }, {
- matches: 'fieldset',
- namingMethods: 'fieldsetLegendText'
- }, {
- matches: 'OUTPUT',
- namingMethods: 'subtreeText'
- }, {
- matches: [ {
- nodeName: 'select'
- }, {
- nodeName: 'input',
- properties: {
- type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
- }
- } ],
- namingMethods: 'labelText'
- }, {
- matches: 'summary',
- namingMethods: 'subtreeText'
- }, {
- matches: 'figure',
- namingMethods: [ 'figureText', 'titleText' ]
- }, {
- matches: 'img',
- namingMethods: 'altText'
- }, {
- matches: 'table',
- namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
- }, {
- matches: [ 'hr', 'br' ],
- namingMethods: [ 'titleText', 'singleSpace' ]
- } ];
- var native_element_type_default = nativeElementType;
- function visibleTextNodes(vNode) {
- var parentVisible = _isVisibleOnScreen(vNode);
- var nodes = [];
- vNode.children.forEach(function(child) {
- if (child.actualNode.nodeType === 3) {
- if (parentVisible) {
- nodes.push(child);
- }
- } else {
- nodes = nodes.concat(visibleTextNodes(child));
- }
- });
- return nodes;
- }
- var visible_text_nodes_default = visibleTextNodes;
- var getVisibleChildTextRects = memoize_default(function getVisibleChildTextRectsMemoized(node) {
- var vNode = get_node_from_tree_default(node);
- var nodeRect = vNode.boundingClientRect;
- var clientRects = [];
- var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
- node.childNodes.forEach(function(textNode) {
- if (textNode.nodeType !== 3 || sanitize_default(textNode.nodeValue) === '') {
- return;
- }
- var contentRects = getContentRects(textNode);
- if (isOutsideNodeBounds(contentRects, nodeRect)) {
- return;
- }
- clientRects.push.apply(clientRects, _toConsumableArray(filterHiddenRects(contentRects, overflowHiddenNodes)));
- });
- return clientRects.length ? clientRects : [ nodeRect ];
- });
- var get_visible_child_text_rects_default = getVisibleChildTextRects;
- function getContentRects(node) {
- var range = document.createRange();
- range.selectNodeContents(node);
- return Array.from(range.getClientRects());
- }
- function isOutsideNodeBounds(rects, nodeRect) {
- return rects.some(function(rect) {
- var centerPoint = _getRectCenter(rect);
- return !_isPointInRect(centerPoint, nodeRect);
- });
- }
- function filterHiddenRects(contentRects, overflowHiddenNodes) {
- var visibleRects = [];
- contentRects.forEach(function(contentRect) {
- if (contentRect.width < 1 || contentRect.height < 1) {
- return;
- }
- var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
- return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
- }, contentRect);
- if (visibleRect) {
- visibleRects.push(visibleRect);
- }
- });
- return visibleRects;
- }
- function getTextElementStack(node) {
- _createGrid();
- var vNode = get_node_from_tree_default(node);
- var grid = vNode._grid;
- if (!grid) {
- return [];
- }
- var clientRects = get_visible_child_text_rects_default(node);
- return clientRects.map(function(rect) {
- return getRectStack(grid, rect);
- });
- }
- var get_text_element_stack_default = getTextElementStack;
- var visualRoles = [ 'checkbox', 'img', 'meter', 'progressbar', 'scrollbar', 'radio', 'slider', 'spinbutton', 'textbox' ];
- function isVisualContent(el) {
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- var role = axe.commons.aria.getExplicitRole(vNode);
- if (role) {
- return visualRoles.indexOf(role) !== -1;
- }
- switch (vNode.props.nodeName) {
- case 'img':
- case 'iframe':
- case 'object':
- case 'video':
- case 'audio':
- case 'canvas':
- case 'svg':
- case 'math':
- case 'button':
- case 'select':
- case 'textarea':
- case 'keygen':
- case 'progress':
- case 'meter':
- return true;
- case 'input':
- return vNode.props.type !== 'hidden';
- default:
- return false;
- }
- }
- var is_visual_content_default = isVisualContent;
- var hiddenTextElms = [ 'head', 'title', 'template', 'script', 'style', 'iframe', 'object', 'video', 'audio', 'noscript' ];
- function hasChildTextNodes(elm) {
- if (hiddenTextElms.includes(elm.props.nodeName)) {
- return false;
- }
- return elm.children.some(function(_ref38) {
- var props = _ref38.props;
- return props.nodeType === 3 && props.nodeValue.trim();
- });
- }
- function hasContentVirtual(elm, noRecursion, ignoreAria) {
- return hasChildTextNodes(elm) || is_visual_content_default(elm.actualNode) || !ignoreAria && !!label_virtual_default(elm) || !noRecursion && elm.children.some(function(child) {
- return child.actualNode.nodeType === 1 && hasContentVirtual(child);
- });
- }
- var has_content_virtual_default = hasContentVirtual;
- function hasContent(elm, noRecursion, ignoreAria) {
- elm = get_node_from_tree_default(elm);
- return has_content_virtual_default(elm, noRecursion, ignoreAria);
- }
- var has_content_default = hasContent;
- function _hasLangText(virtualNode) {
- if (typeof virtualNode.children === 'undefined' || hasChildTextNodes(virtualNode)) {
- return true;
- }
- if (virtualNode.props.nodeType === 1 && is_visual_content_default(virtualNode)) {
- return !!axe.commons.text.accessibleTextVirtual(virtualNode);
- }
- return virtualNode.children.some(function(child) {
- return !child.attr('lang') && _hasLangText(child) && !_isHiddenForEveryone(child);
- });
- }
- function insertedIntoFocusOrder(el) {
- var tabIndex = parseInt(el.getAttribute('tabindex'), 10);
- return tabIndex > -1 && _isFocusable(el) && !is_natively_focusable_default(el);
- }
- var inserted_into_focus_order_default = insertedIntoFocusOrder;
- function isHiddenWithCSS(node, descendentVisibilityValue) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- var el = node instanceof window.Node ? node : vNode === null || vNode === void 0 ? void 0 : vNode.actualNode;
- if (!vNode) {
- return _isHiddenWithCSS(el, descendentVisibilityValue);
- }
- if (vNode._isHiddenWithCSS === void 0) {
- vNode._isHiddenWithCSS = _isHiddenWithCSS(el, descendentVisibilityValue);
- }
- return vNode._isHiddenWithCSS;
- }
- function _isHiddenWithCSS(el, descendentVisibilityValue) {
- if (el.nodeType === 9) {
- return false;
- }
- if (el.nodeType === 11) {
- el = el.host;
- }
- if ([ 'STYLE', 'SCRIPT' ].includes(el.nodeName.toUpperCase())) {
- return false;
- }
- var style = window.getComputedStyle(el, null);
- if (!style) {
- throw new Error('Style does not exist for the given element.');
- }
- var displayValue = style.getPropertyValue('display');
- if (displayValue === 'none') {
- return true;
- }
- var HIDDEN_VISIBILITY_VALUES = [ 'hidden', 'collapse' ];
- var visibilityValue = style.getPropertyValue('visibility');
- if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && !descendentVisibilityValue) {
- return true;
- }
- if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && descendentVisibilityValue && HIDDEN_VISIBILITY_VALUES.includes(descendentVisibilityValue)) {
- return true;
- }
- var parent = get_composed_parent_default(el);
- if (parent && !HIDDEN_VISIBILITY_VALUES.includes(visibilityValue)) {
- return isHiddenWithCSS(parent, visibilityValue);
- }
- return false;
- }
- var is_hidden_with_css_default = isHiddenWithCSS;
- function isHTML5(doc) {
- var node = doc.doctype;
- if (node === null) {
- return false;
- }
- return node.name === 'html' && !node.publicId && !node.systemId;
- }
- var is_html5_default = isHTML5;
- function _isInTabOrder(el) {
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- if (vNode.props.nodeType !== 1) {
- return false;
- }
- var tabindex = parseInt(vNode.attr('tabindex', 10));
- if (tabindex <= -1) {
- return false;
- }
- return _isFocusable(vNode);
- }
- function getRoleType(role) {
- var _window3;
- if (role instanceof abstract_virtual_node_default || (_window3 = window) !== null && _window3 !== void 0 && _window3.Node && role instanceof window.Node) {
- role = axe.commons.aria.getRole(role);
- }
- var roleDef = standards_default.ariaRoles[role];
- return (roleDef === null || roleDef === void 0 ? void 0 : roleDef.type) || null;
- }
- var get_role_type_default = getRoleType;
- function walkDomNode(node, functor) {
- if (functor(node.actualNode) !== false) {
- node.children.forEach(function(child) {
- return walkDomNode(child, functor);
- });
- }
- }
- var blockLike = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
- function isBlock(elm) {
- var display = window.getComputedStyle(elm).getPropertyValue('display');
- return blockLike.includes(display) || display.substr(0, 6) === 'table-';
- }
- function getBlockParent(node) {
- var parentBlock = get_composed_parent_default(node);
- while (parentBlock && !isBlock(parentBlock)) {
- parentBlock = get_composed_parent_default(parentBlock);
- }
- return get_node_from_tree_default(parentBlock);
- }
- function isInTextBlock(node, options) {
- if (isBlock(node)) {
- return false;
- }
- var virtualParent = getBlockParent(node);
- var parentText = '';
- var widgetText = '';
- var inBrBlock = 0;
- walkDomNode(virtualParent, function(currNode) {
- if (inBrBlock === 2) {
- return false;
- }
- if (currNode.nodeType === 3) {
- parentText += currNode.nodeValue;
- }
- if (currNode.nodeType !== 1) {
- return;
- }
- var nodeName2 = (currNode.nodeName || '').toUpperCase();
- if (currNode === node) {
- inBrBlock = 1;
- }
- if ([ 'BR', 'HR' ].includes(nodeName2)) {
- if (inBrBlock === 0) {
- parentText = '';
- widgetText = '';
- } else {
- inBrBlock = 2;
- }
- } else if (currNode.style.display === 'none' || currNode.style.overflow === 'hidden' || ![ '', null, 'none' ].includes(currNode.style['float']) || ![ '', null, 'relative' ].includes(currNode.style.position)) {
- return false;
- } else if (get_role_type_default(currNode) === 'widget') {
- widgetText += currNode.textContent;
- return false;
- }
- });
- parentText = sanitize_default(parentText);
- if (options !== null && options !== void 0 && options.noLengthCompare) {
- return parentText.length !== 0;
- }
- widgetText = sanitize_default(widgetText);
- return parentText.length > widgetText.length;
- }
- var is_in_text_block_default = isInTextBlock;
- function isModalOpen(options) {
- options = options || {};
- var modalPercent = options.modalPercent || .75;
- if (cache_default.get('isModalOpen')) {
- return cache_default.get('isModalOpen');
- }
- var definiteModals = query_selector_all_filter_default(axe._tree[0], 'dialog, [role=dialog], [aria-modal=true]', _isVisibleOnScreen);
- if (definiteModals.length) {
- cache_default.set('isModalOpen', true);
- return true;
- }
- var viewport = get_viewport_size_default(window);
- var percentWidth = viewport.width * modalPercent;
- var percentHeight = viewport.height * modalPercent;
- var x = (viewport.width - percentWidth) / 2;
- var y = (viewport.height - percentHeight) / 2;
- var points = [ {
- x: x,
- y: y
- }, {
- x: viewport.width - x,
- y: y
- }, {
- x: viewport.width / 2,
- y: viewport.height / 2
- }, {
- x: x,
- y: viewport.height - y
- }, {
- x: viewport.width - x,
- y: viewport.height - y
- } ];
- var stacks = points.map(function(point) {
- return Array.from(document.elementsFromPoint(point.x, point.y));
- });
- var _loop4 = function _loop4(_i9) {
- var modalElement = stacks[_i9].find(function(elm) {
- var style = window.getComputedStyle(elm);
- return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed');
- });
- if (modalElement && stacks.every(function(stack) {
- return stack.includes(modalElement);
- })) {
- cache_default.set('isModalOpen', true);
- return {
- v: true
- };
- }
- };
- for (var _i9 = 0; _i9 < stacks.length; _i9++) {
- var _ret = _loop4(_i9);
- if (_typeof(_ret) === 'object') {
- return _ret.v;
- }
- }
- cache_default.set('isModalOpen', void 0);
- return void 0;
- }
- var is_modal_open_default = isModalOpen;
- function _isMultiline(domNode) {
- var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
- var range = domNode.ownerDocument.createRange();
- range.setStart(domNode, 0);
- range.setEnd(domNode, domNode.childNodes.length);
- var lastLineEnd = 0;
- var lineCount = 0;
- var _iterator4 = _createForOfIteratorHelper(range.getClientRects()), _step4;
- try {
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
- var rect = _step4.value;
- if (rect.height <= margin) {
- continue;
- }
- if (lastLineEnd > rect.top + margin) {
- lastLineEnd = Math.max(lastLineEnd, rect.bottom);
- } else if (lineCount === 0) {
- lastLineEnd = rect.bottom;
- lineCount++;
- } else {
- return true;
- }
- }
- } catch (err) {
- _iterator4.e(err);
- } finally {
- _iterator4.f();
- }
- return false;
- }
- function isNode(element) {
- return element instanceof window.Node;
- }
- var is_node_default = isNode;
- var data = {};
- var incompleteData = {
- set: function set(key, reason) {
- if (typeof key !== 'string') {
- throw new Error('Incomplete data: key must be a string');
- }
- if (reason) {
- data[key] = reason;
- }
- return data[key];
- },
- get: function get(key) {
- return data[key];
- },
- clear: function clear() {
- data = {};
- }
- };
- var incomplete_data_default = incompleteData;
- function elementHasImage(elm, style) {
- var graphicNodes = [ 'IMG', 'CANVAS', 'OBJECT', 'IFRAME', 'VIDEO', 'SVG' ];
- var nodeName2 = elm.nodeName.toUpperCase();
- if (graphicNodes.includes(nodeName2)) {
- incomplete_data_default.set('bgColor', 'imgNode');
- return true;
- }
- style = style || window.getComputedStyle(elm);
- var bgImageStyle = style.getPropertyValue('background-image');
- var hasBgImage = bgImageStyle !== 'none';
- if (hasBgImage) {
- var hasGradient = /gradient/.test(bgImageStyle);
- incomplete_data_default.set('bgColor', hasGradient ? 'bgGradient' : 'bgImage');
- }
- return hasBgImage;
- }
- var element_has_image_default = elementHasImage;
- var hexRegex = /^#[0-9a-f]{3,8}$/i;
- var colorFnRegex = /^((?:rgb|hsl)a?)\s*\(([^\)]*)\)/i;
- var Color = function() {
- function Color(red, green, blue) {
- var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
- _classCallCheck(this, Color);
- this.red = red;
- this.green = green;
- this.blue = blue;
- this.alpha = alpha;
- }
- _createClass(Color, [ {
- key: 'toHexString',
- value: function toHexString() {
- var redString = Math.round(this.red).toString(16);
- var greenString = Math.round(this.green).toString(16);
- var blueString = Math.round(this.blue).toString(16);
- return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString);
- }
- }, {
- key: 'toJSON',
- value: function toJSON() {
- var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
- return {
- red: red,
- green: green,
- blue: blue,
- alpha: alpha
- };
- }
- }, {
- key: 'parseString',
- value: function parseString(colorString) {
- if (standards_default.cssColors[colorString] || colorString === 'transparent') {
- var _ref39 = standards_default.cssColors[colorString] || [ 0, 0, 0 ], _ref40 = _slicedToArray(_ref39, 3), red = _ref40[0], green = _ref40[1], blue = _ref40[2];
- this.red = red;
- this.green = green;
- this.blue = blue;
- this.alpha = colorString === 'transparent' ? 0 : 1;
- return this;
- }
- if (colorString.match(colorFnRegex)) {
- this.parseColorFnString(colorString);
- return this;
- }
- if (colorString.match(hexRegex)) {
- this.parseHexString(colorString);
- return this;
- }
- throw new Error('Unable to parse color "'.concat(colorString, '"'));
- }
- }, {
- key: 'parseRgbString',
- value: function parseRgbString(colorString) {
- if (colorString === 'transparent') {
- this.red = 0;
- this.green = 0;
- this.blue = 0;
- this.alpha = 0;
- return;
- }
- this.parseColorFnString(colorString);
- }
- }, {
- key: 'parseHexString',
- value: function parseHexString(colorString) {
- if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) {
- return;
- }
- colorString = colorString.replace('#', '');
- if (colorString.length < 6) {
- var _colorString = colorString, _colorString2 = _slicedToArray(_colorString, 4), r = _colorString2[0], g = _colorString2[1], b = _colorString2[2], a = _colorString2[3];
- colorString = r + r + g + g + b + b;
- if (a) {
- colorString += a + a;
- }
- }
- var aRgbHex = colorString.match(/.{1,2}/g);
- this.red = parseInt(aRgbHex[0], 16);
- this.green = parseInt(aRgbHex[1], 16);
- this.blue = parseInt(aRgbHex[2], 16);
- if (aRgbHex[3]) {
- this.alpha = parseInt(aRgbHex[3], 16) / 255;
- } else {
- this.alpha = 1;
- }
- }
- }, {
- key: 'parseColorFnString',
- value: function parseColorFnString(colorString) {
- var _ref41 = colorString.match(colorFnRegex) || [], _ref42 = _slicedToArray(_ref41, 3), colorFunc = _ref42[1], colorValStr = _ref42[2];
- if (!colorFunc || !colorValStr) {
- return;
- }
- var colorVals = colorValStr.split(/\s*[,\/\s]\s*/).map(function(str) {
- return str.replace(',', '').trim();
- }).filter(function(str) {
- return str !== '';
- });
- var colorNums = colorVals.map(function(val, index) {
- return convertColorVal(colorFunc, val, index);
- });
- if (colorFunc.substr(0, 3) === 'hsl') {
- colorNums = hslToRgb(colorNums);
- }
- this.red = colorNums[0];
- this.green = colorNums[1];
- this.blue = colorNums[2];
- this.alpha = typeof colorNums[3] === 'number' ? colorNums[3] : 1;
- }
- }, {
- key: 'getRelativeLuminance',
- value: function getRelativeLuminance() {
- var rSRGB = this.red / 255;
- var gSRGB = this.green / 255;
- var bSRGB = this.blue / 255;
- var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
- var g = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
- var b = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
- return .2126 * r + .7152 * g + .0722 * b;
- }
- } ]);
- return Color;
- }();
- var color_default = Color;
- function convertColorVal(colorFunc, value, index) {
- if (/%$/.test(value)) {
- if (index === 3) {
- return parseFloat(value) / 100;
- }
- return parseFloat(value) * 255 / 100;
- }
- if (colorFunc[index] === 'h') {
- if (/turn$/.test(value)) {
- return parseFloat(value) * 360;
- }
- if (/rad$/.test(value)) {
- return parseFloat(value) * 57.3;
- }
- }
- return parseFloat(value);
- }
- function hslToRgb(_ref43) {
- var _ref44 = _slicedToArray(_ref43, 4), hue = _ref44[0], saturation = _ref44[1], lightness = _ref44[2], alpha = _ref44[3];
- saturation /= 255;
- lightness /= 255;
- var high = (1 - Math.abs(2 * lightness - 1)) * saturation;
- var low = high * (1 - Math.abs(hue / 60 % 2 - 1));
- var base = lightness - high / 2;
- var colors;
- if (hue < 60) {
- colors = [ high, low, 0 ];
- } else if (hue < 120) {
- colors = [ low, high, 0 ];
- } else if (hue < 180) {
- colors = [ 0, high, low ];
- } else if (hue < 240) {
- colors = [ 0, low, high ];
- } else if (hue < 300) {
- colors = [ low, 0, high ];
- } else {
- colors = [ high, 0, low ];
- }
- return colors.map(function(color) {
- return Math.round((color + base) * 255);
- }).concat(alpha);
- }
- function getOwnBackgroundColor(elmStyle) {
- var bgColor = new color_default();
- bgColor.parseString(elmStyle.getPropertyValue('background-color'));
- if (bgColor.alpha !== 0) {
- var opacity = elmStyle.getPropertyValue('opacity');
- bgColor.alpha = bgColor.alpha * opacity;
- }
- return bgColor;
- }
- var get_own_background_color_default = getOwnBackgroundColor;
- function isOpaque(node) {
- var style = window.getComputedStyle(node);
- return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1;
- }
- var is_opaque_default = isOpaque;
- function _isSkipLink(element) {
- if (!element.href) {
- return false;
- }
- var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink);
- if (!firstPageLink) {
- return true;
- }
- return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING;
- }
- function generateFirstPageLink() {
- var firstPageLink;
- if (!window.location.origin) {
- firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0];
- } else {
- firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) {
- return !_isCurrentPageLink(link.actualNode);
- });
- }
- return firstPageLink || null;
- }
- var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
- var clipPathRegex2 = /(\w+)\((\d+)/;
- function isClipped(style) {
- var matchesClip = style.getPropertyValue('clip').match(clipRegex2);
- var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2);
- if (matchesClip && matchesClip.length === 5) {
- var position = style.getPropertyValue('position');
- if ([ 'fixed', 'absolute' ].includes(position)) {
- return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
- }
- }
- if (matchesClipPath) {
- var type = matchesClipPath[1];
- var value = parseInt(matchesClipPath[2], 10);
- switch (type) {
- case 'inset':
- return value >= 50;
- case 'circle':
- return value === 0;
- default:
- }
- }
- return false;
- }
- function isAreaVisible(el, screenReader, recursed) {
- var mapEl = find_up_default(el, 'map');
- if (!mapEl) {
- return false;
- }
- var mapElName = mapEl.getAttribute('name');
- if (!mapElName) {
- return false;
- }
- var mapElRootNode = get_root_node_default2(el);
- if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
- return false;
- }
- var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
- if (!refs || !refs.length) {
- return false;
- }
- return refs.some(function(_ref45) {
- var actualNode = _ref45.actualNode;
- return isVisible(actualNode, screenReader, recursed);
- });
- }
- function isVisible(el, screenReader, recursed) {
- var _window$Node2;
- if (!el) {
- throw new TypeError('Cannot determine if element is visible for non-DOM nodes');
- }
- var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
- el = vNode ? vNode.actualNode : el;
- var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : '');
- var _ref46 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref46.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref46.DOCUMENT_FRAGMENT_NODE;
- var nodeType = vNode ? vNode.props.nodeType : el.nodeType;
- var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase();
- if (vNode && typeof vNode[cacheName] !== 'undefined') {
- return vNode[cacheName];
- }
- if (nodeType === DOCUMENT_NODE) {
- return true;
- }
- if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) {
- return false;
- }
- if (el && nodeType === DOCUMENT_FRAGMENT_NODE) {
- el = el.host;
- }
- if (screenReader) {
- var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden');
- if (ariaHiddenValue === 'true') {
- return false;
- }
- }
- if (!el) {
- var parent2 = vNode.parent;
- var visible3 = true;
- if (parent2) {
- visible3 = isVisible(parent2, screenReader, true);
- }
- if (vNode) {
- vNode[cacheName] = visible3;
- }
- return visible3;
- }
- var style = window.getComputedStyle(el, null);
- if (style === null) {
- return false;
- }
- if (nodeName2 === 'area') {
- return isAreaVisible(el, screenReader, recursed);
- }
- if (style.getPropertyValue('display') === 'none') {
- return false;
- }
- var elHeight = parseInt(style.getPropertyValue('height'));
- var elWidth = parseInt(style.getPropertyValue('width'));
- var scroll = _getScroll(el);
- var scrollableWithZeroHeight = scroll && elHeight === 0;
- var scrollableWithZeroWidth = scroll && elWidth === 0;
- var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden';
- if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) {
- return false;
- }
- if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) {
- return false;
- }
- var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
- var visible2 = false;
- if (parent) {
- visible2 = isVisible(parent, screenReader, true);
- }
- if (vNode) {
- vNode[cacheName] = visible2;
- }
- return visible2;
- }
- var is_visible_default = isVisible;
- function reduceToElementsBelowFloating(elements, targetNode) {
- var floatingPositions = [ 'fixed', 'sticky' ];
- var finalElements = [];
- var targetFound = false;
- for (var index = 0; index < elements.length; ++index) {
- var currentNode = elements[index];
- if (currentNode === targetNode) {
- targetFound = true;
- }
- var style = window.getComputedStyle(currentNode);
- if (!targetFound && floatingPositions.indexOf(style.position) !== -1) {
- finalElements = [];
- continue;
- }
- finalElements.push(currentNode);
- }
- return finalElements;
- }
- var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating;
- function _visuallyContains(node, parent) {
- var parentScrollAncestor = getScrollAncestor(parent);
- do {
- var nextScrollAncestor = getScrollAncestor(node);
- if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) {
- return contains2(node, parent);
- }
- node = nextScrollAncestor;
- } while (node);
- return false;
- }
- function getScrollAncestor(node) {
- var vNode = get_node_from_tree_default(node);
- var ancestor = vNode.parent;
- while (ancestor) {
- if (_getScroll(ancestor.actualNode)) {
- return ancestor.actualNode;
- }
- ancestor = ancestor.parent;
- }
- }
- function contains2(node, parent) {
- var style = window.getComputedStyle(parent);
- var overflow = style.getPropertyValue('overflow');
- if (style.getPropertyValue('display') === 'inline') {
- return true;
- }
- var clientRects = Array.from(node.getClientRects());
- var boundingRect = parent.getBoundingClientRect();
- var rect = {
- left: boundingRect.left,
- top: boundingRect.top,
- width: boundingRect.width,
- height: boundingRect.height
- };
- if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) {
- rect.width = parent.scrollWidth;
- rect.height = parent.scrollHeight;
- }
- if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') {
- clientRects[0] = rect;
- }
- return clientRects.some(function(clientRect) {
- 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));
- });
- }
- function shadowElementsFromPoint(nodeX, nodeY) {
- var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
- var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
- if (i > 999) {
- throw new Error('Infinite loop detected');
- }
- return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) {
- return get_root_node_default2(nodes) === root;
- }).reduce(function(stack, elm) {
- if (is_shadow_root_default(elm)) {
- var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1);
- stack = stack.concat(shadowStack);
- if (stack.length && _visuallyContains(stack[0], elm)) {
- stack.push(elm);
- }
- } else {
- stack.push(elm);
- }
- return stack;
- }, []);
- }
- var shadow_elements_from_point_default = shadowElementsFromPoint;
- function urlPropsFromAttribute(node, attribute) {
- if (!node.hasAttribute(attribute)) {
- return void 0;
- }
- var nodeName2 = node.nodeName.toUpperCase();
- var parser2 = node;
- if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) {
- parser2 = document.createElement('a');
- parser2.href = node.getAttribute(attribute);
- }
- var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol;
- var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname);
- var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename;
- return {
- protocol: protocol,
- hostname: parser2.hostname,
- port: getPort(parser2.port),
- pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'),
- search: getSearchPairs(parser2.search),
- hash: getHashRoute(parser2.hash),
- filename: filename
- };
- }
- function getPort(port) {
- var excludePorts = [ '443', '80' ];
- return !excludePorts.includes(port) ? port : '';
- }
- function getPathnameOrFilename(pathname) {
- var filename = pathname.split('/').pop();
- if (!filename || filename.indexOf('.') === -1) {
- return {
- pathname: pathname,
- filename: ''
- };
- }
- return {
- pathname: pathname.replace(filename, ''),
- filename: /index./.test(filename) ? '' : filename
- };
- }
- function getSearchPairs(searchStr) {
- var query = {};
- if (!searchStr || !searchStr.length) {
- return query;
- }
- var pairs = searchStr.substring(1).split('&');
- if (!pairs || !pairs.length) {
- return query;
- }
- for (var index = 0; index < pairs.length; index++) {
- var pair = pairs[index];
- var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), key = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$;
- query[decodeURIComponent(key)] = decodeURIComponent(value);
- }
- return query;
- }
- function getHashRoute(hash) {
- if (!hash) {
- return '';
- }
- var hashRegex = /#!?\/?/g;
- var hasMatch = hash.match(hashRegex);
- if (!hasMatch) {
- return '';
- }
- var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0];
- if (matchedStr === '#') {
- return '';
- }
- return hash;
- }
- var url_props_from_attribute_default = urlPropsFromAttribute;
- function visuallyOverlaps(rect, parent) {
- var parentRect = parent.getBoundingClientRect();
- var parentTop = parentRect.top;
- var parentLeft = parentRect.left;
- var parentScrollArea = {
- top: parentTop - parent.scrollTop,
- bottom: parentTop - parent.scrollTop + parent.scrollHeight,
- left: parentLeft - parent.scrollLeft,
- right: parentLeft - parent.scrollLeft + parent.scrollWidth
- };
- 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) {
- return false;
- }
- var style = window.getComputedStyle(parent);
- if (rect.left > parentRect.right || rect.top > parentRect.bottom) {
- return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
- }
- return true;
- }
- var visually_overlaps_default = visuallyOverlaps;
- var isXHTMLGlobal;
- var nodeIndex2 = 0;
- var VirtualNode = function(_abstract_virtual_nod) {
- _inherits(VirtualNode, _abstract_virtual_nod);
- var _super = _createSuper(VirtualNode);
- function VirtualNode(node, parent, shadowId) {
- var _this;
- _classCallCheck(this, VirtualNode);
- _this = _super.call(this);
- _this.shadowId = shadowId;
- _this.children = [];
- _this.actualNode = node;
- _this.parent = parent;
- if (!parent) {
- nodeIndex2 = 0;
- }
- _this.nodeIndex = nodeIndex2++;
- _this._isHidden = null;
- _this._cache = {};
- if (typeof isXHTMLGlobal === 'undefined') {
- isXHTMLGlobal = is_xhtml_default(node.ownerDocument);
- }
- _this._isXHTML = isXHTMLGlobal;
- if (node.nodeName.toLowerCase() === 'input') {
- var type = node.getAttribute('type');
- type = _this._isXHTML ? type : (type || '').toLowerCase();
- if (!valid_input_type_default().includes(type)) {
- type = 'text';
- }
- _this._type = type;
- }
- if (cache_default.get('nodeMap')) {
- cache_default.get('nodeMap').set(node, _assertThisInitialized(_this));
- }
- return _this;
- }
- _createClass(VirtualNode, [ {
- key: 'props',
- get: function get() {
- if (!this._cache.hasOwnProperty('props')) {
- var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, id = _this$actualNode.id, multiple = _this$actualNode.multiple, nodeValue = _this$actualNode.nodeValue, value = _this$actualNode.value, selected = _this$actualNode.selected;
- this._cache.props = {
- nodeType: nodeType,
- nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(),
- id: id,
- type: this._type,
- multiple: multiple,
- nodeValue: nodeValue,
- value: value,
- selected: selected
- };
- }
- return this._cache.props;
- }
- }, {
- key: 'attr',
- value: function attr(attrName) {
- if (typeof this.actualNode.getAttribute !== 'function') {
- return null;
- }
- return this.actualNode.getAttribute(attrName);
- }
- }, {
- key: 'hasAttr',
- value: function hasAttr(attrName) {
- if (typeof this.actualNode.hasAttribute !== 'function') {
- return false;
- }
- return this.actualNode.hasAttribute(attrName);
- }
- }, {
- key: 'attrNames',
- get: function get() {
- if (!this._cache.hasOwnProperty('attrNames')) {
- var attrs;
- if (this.actualNode.attributes instanceof window.NamedNodeMap) {
- attrs = this.actualNode.attributes;
- } else {
- attrs = this.actualNode.cloneNode(false).attributes;
- }
- this._cache.attrNames = Array.from(attrs).map(function(attr) {
- return attr.name;
- });
- }
- return this._cache.attrNames;
- }
- }, {
- key: 'getComputedStylePropertyValue',
- value: function getComputedStylePropertyValue(property) {
- var key = 'computedStyle_' + property;
- if (!this._cache.hasOwnProperty(key)) {
- if (!this._cache.hasOwnProperty('computedStyle')) {
- this._cache.computedStyle = window.getComputedStyle(this.actualNode);
- }
- this._cache[key] = this._cache.computedStyle.getPropertyValue(property);
- }
- return this._cache[key];
- }
- }, {
- key: 'isFocusable',
- get: function get() {
- if (!this._cache.hasOwnProperty('isFocusable')) {
- this._cache.isFocusable = _isFocusable(this.actualNode);
- }
- return this._cache.isFocusable;
- }
- }, {
- key: 'tabbableElements',
- get: function get() {
- if (!this._cache.hasOwnProperty('tabbableElements')) {
- this._cache.tabbableElements = get_tabbable_elements_default(this);
- }
- return this._cache.tabbableElements;
- }
- }, {
- key: 'clientRects',
- get: function get() {
- if (!this._cache.hasOwnProperty('clientRects')) {
- this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) {
- return rect.width > 0;
- });
- }
- return this._cache.clientRects;
- }
- }, {
- key: 'boundingClientRect',
- get: function get() {
- if (!this._cache.hasOwnProperty('boundingClientRect')) {
- this._cache.boundingClientRect = this.actualNode.getBoundingClientRect();
- }
- return this._cache.boundingClientRect;
- }
- } ]);
- return VirtualNode;
- }(abstract_virtual_node_default);
- var virtual_node_default = VirtualNode;
- function tokenList(str) {
- return (str || '').trim().replace(/\s{2,}/g, ' ').split(' ');
- }
- var token_list_default = tokenList;
- var idsKey = ' [idsMap]';
- function getNodesMatchingExpression(domTree, expressions, filter) {
- var selectorMap = domTree[0]._selectorMap;
- if (!selectorMap) {
- return;
- }
- var shadowId = domTree[0].shadowId;
- for (var _i10 = 0; _i10 < expressions.length; _i10++) {
- if (expressions[_i10].length > 1 && expressions[_i10].some(function(expression) {
- return isGlobalSelector(expression);
- })) {
- return;
- }
- }
- var nodeSet = new Set();
- expressions.forEach(function(expression) {
- var _matchingNodes$nodes;
- var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId);
- matchingNodes === null || matchingNodes === void 0 ? void 0 : (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 ? void 0 : _matchingNodes$nodes.forEach(function(node) {
- if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) {
- return;
- }
- nodeSet.add(node);
- });
- });
- var matchedNodes = [];
- nodeSet.forEach(function(node) {
- return matchedNodes.push(node);
- });
- if (filter) {
- matchedNodes = matchedNodes.filter(filter);
- }
- return matchedNodes.sort(function(a, b) {
- return a.nodeIndex - b.nodeIndex;
- });
- }
- function findMatchingNodes(expression, selectorMap, shadowId) {
- var exp = expression[expression.length - 1];
- var nodes = null;
- var isComplexSelector = expression.length > 1 || !!exp.pseudos || !!exp.classes;
- if (isGlobalSelector(exp)) {
- nodes = selectorMap['*'];
- } else {
- if (exp.id) {
- var _selectorMap$idsKey$e;
- if (!selectorMap[idsKey] || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
- return;
- }
- nodes = selectorMap[idsKey][exp.id].filter(function(node) {
- return node.shadowId === shadowId;
- });
- }
- if (exp.tag && exp.tag !== '*') {
- var _selectorMap$exp$tag;
- if (!((_selectorMap$exp$tag = selectorMap[exp.tag]) !== null && _selectorMap$exp$tag !== void 0 && _selectorMap$exp$tag.length)) {
- return;
- }
- var cachedNodes = selectorMap[exp.tag];
- nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes;
- }
- if (exp.classes) {
- var _selectorMap$Class;
- if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) {
- return;
- }
- var _cachedNodes = selectorMap['[class]'];
- nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes;
- }
- if (exp.attributes) {
- for (var _i11 = 0; _i11 < exp.attributes.length; _i11++) {
- var _selectorMap;
- var attr = exp.attributes[_i11];
- if (attr.type === 'attrValue') {
- isComplexSelector = true;
- }
- if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) {
- return;
- }
- var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')];
- nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2;
- }
- }
- }
- return {
- nodes: nodes,
- isComplexSelector: isComplexSelector
- };
- }
- function isGlobalSelector(expression) {
- return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes;
- }
- function getSharedValues(a, b) {
- return a.filter(function(node) {
- return b.includes(node);
- });
- }
- function cacheSelector(key, vNode, map) {
- map[key] = map[key] || [];
- map[key].push(vNode);
- }
- function cacheNodeSelectors(vNode, selectorMap) {
- if (vNode.props.nodeType !== 1) {
- return;
- }
- cacheSelector(vNode.props.nodeName, vNode, selectorMap);
- cacheSelector('*', vNode, selectorMap);
- vNode.attrNames.forEach(function(attrName) {
- if (attrName === 'id') {
- selectorMap[idsKey] = selectorMap[idsKey] || {};
- token_list_default(vNode.attr(attrName)).forEach(function(value) {
- cacheSelector(value, vNode, selectorMap[idsKey]);
- });
- }
- cacheSelector('['.concat(attrName, ']'), vNode, selectorMap);
- });
- }
- var hasShadowRoot;
- function getSlotChildren(node) {
- var retVal = [];
- node = node.firstChild;
- while (node) {
- retVal.push(node);
- node = node.nextSibling;
- }
- return retVal;
- }
- function createNode(node, parent, shadowId) {
- var vNode = new virtual_node_default(node, parent, shadowId);
- cacheNodeSelectors(vNode, cache_default.get('selectorMap'));
- return vNode;
- }
- function flattenTree(node, shadowId, parent) {
- var retVal, realArray, nodeName2;
- function reduceShadowDOM(res, child, parent2) {
- var replacements = flattenTree(child, shadowId, parent2);
- if (replacements) {
- res = res.concat(replacements);
- }
- return res;
- }
- if (node.documentElement) {
- node = node.documentElement;
- }
- nodeName2 = node.nodeName.toLowerCase();
- if (is_shadow_root_default(node)) {
- hasShadowRoot = true;
- retVal = createNode(node, parent, shadowId);
- shadowId = 'a' + Math.random().toString().substring(2);
- realArray = Array.from(node.shadowRoot.childNodes);
- retVal.children = realArray.reduce(function(res, child) {
- return reduceShadowDOM(res, child, retVal);
- }, []);
- return [ retVal ];
- } else {
- if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
- realArray = Array.from(node.getDistributedNodes());
- return realArray.reduce(function(res, child) {
- return reduceShadowDOM(res, child, parent);
- }, []);
- } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
- realArray = Array.from(node.assignedNodes());
- if (!realArray.length) {
- realArray = getSlotChildren(node);
- }
- var styl = window.getComputedStyle(node);
- if (false) {
- retVal = createNode(node, parent, shadowId);
- retVal.children = realArray.reduce(function(res, child) {
- return reduceShadowDOM(res, child, retVal);
- }, []);
- return [ retVal ];
- } else {
- return realArray.reduce(function(res, child) {
- return reduceShadowDOM(res, child, parent);
- }, []);
- }
- } else {
- if (node.nodeType === 1) {
- retVal = createNode(node, parent, shadowId);
- realArray = Array.from(node.childNodes);
- retVal.children = realArray.reduce(function(res, child) {
- return reduceShadowDOM(res, child, retVal);
- }, []);
- return [ retVal ];
- } else if (node.nodeType === 3) {
- return [ createNode(node, parent) ];
- }
- return void 0;
- }
- }
- }
- function getFlattenedTree() {
- var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
- var shadowId = arguments.length > 1 ? arguments[1] : undefined;
- hasShadowRoot = false;
- var selectorMap = {};
- cache_default.set('nodeMap', new WeakMap());
- cache_default.set('selectorMap', selectorMap);
- var tree = flattenTree(node, shadowId, null);
- tree[0]._selectorMap = selectorMap;
- tree[0]._hasShadowRoot = hasShadowRoot;
- return tree;
- }
- var get_flattened_tree_default = getFlattenedTree;
- function getBaseLang(lang) {
- if (!lang) {
- return '';
- }
- return lang.trim().split('-')[0].toLowerCase();
- }
- var get_base_lang_default = getBaseLang;
- function failureSummary(nodeData) {
- var failingChecks = {};
- failingChecks.none = nodeData.none.concat(nodeData.all);
- failingChecks.any = nodeData.any;
- return Object.keys(failingChecks).map(function(key) {
- if (!failingChecks[key].length) {
- return;
- }
- var sum = axe._audit.data.failureSummaries[key];
- if (sum && typeof sum.failureMessage === 'function') {
- return sum.failureMessage(failingChecks[key].map(function(check) {
- return check.message || '';
- }));
- }
- }).filter(function(i) {
- return i !== void 0;
- }).join('\n\n');
- }
- var failure_summary_default = failureSummary;
- function incompleteFallbackMessage() {
- var incompleteFallbackMessage2 = axe._audit.data.incompleteFallbackMessage;
- if (typeof incompleteFallbackMessage2 === 'function') {
- incompleteFallbackMessage2 = incompleteFallbackMessage2();
- }
- if (typeof incompleteFallbackMessage2 !== 'string') {
- return '';
- }
- return incompleteFallbackMessage2;
- }
- function normalizeRelatedNodes(node, options) {
- [ 'any', 'all', 'none' ].forEach(function(type) {
- if (!Array.isArray(node[type])) {
- return;
- }
- node[type].filter(function(checkRes) {
- return Array.isArray(checkRes.relatedNodes);
- }).forEach(function(checkRes) {
- checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) {
- var _relatedNode$source;
- var res = {
- html: (_relatedNode$source = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.source) !== null && _relatedNode$source !== void 0 ? _relatedNode$source : 'Undefined'
- };
- if (options.elementRef && !(relatedNode !== null && relatedNode !== void 0 && relatedNode.fromFrame)) {
- var _relatedNode$element;
- res.element = (_relatedNode$element = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.element) !== null && _relatedNode$element !== void 0 ? _relatedNode$element : null;
- }
- if (options.selectors !== false || relatedNode !== null && relatedNode !== void 0 && relatedNode.fromFrame) {
- var _relatedNode$selector;
- res.target = (_relatedNode$selector = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.selector) !== null && _relatedNode$selector !== void 0 ? _relatedNode$selector : [ ':root' ];
- }
- if (options.ancestry) {
- var _relatedNode$ancestry;
- res.ancestry = (_relatedNode$ancestry = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.ancestry) !== null && _relatedNode$ancestry !== void 0 ? _relatedNode$ancestry : [ ':root' ];
- }
- if (options.xpath) {
- var _relatedNode$xpath;
- res.xpath = (_relatedNode$xpath = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.xpath) !== null && _relatedNode$xpath !== void 0 ? _relatedNode$xpath : [ '/' ];
- }
- return res;
- });
- });
- });
- }
- var resultKeys = constants_default.resultGroups;
- function processAggregate(results, options) {
- var resultObject = axe.utils.aggregateResult(results);
- resultKeys.forEach(function(key) {
- if (options.resultTypes && !options.resultTypes.includes(key)) {
- (resultObject[key] || []).forEach(function(ruleResult) {
- if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
- ruleResult.nodes = [ ruleResult.nodes[0] ];
- }
- });
- }
- resultObject[key] = (resultObject[key] || []).map(function(ruleResult) {
- ruleResult = Object.assign({}, ruleResult);
- if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
- ruleResult.nodes = ruleResult.nodes.map(function(subResult) {
- if (_typeof(subResult.node) === 'object') {
- subResult.html = subResult.node.source;
- if (options.elementRef && !subResult.node.fromFrame) {
- subResult.element = subResult.node.element;
- }
- if (options.selectors !== false || subResult.node.fromFrame) {
- subResult.target = subResult.node.selector;
- }
- if (options.ancestry) {
- subResult.ancestry = subResult.node.ancestry;
- }
- if (options.xpath) {
- subResult.xpath = subResult.node.xpath;
- }
- }
- delete subResult.result;
- delete subResult.node;
- normalizeRelatedNodes(subResult, options);
- return subResult;
- });
- }
- resultKeys.forEach(function(key2) {
- return delete ruleResult[key2];
- });
- delete ruleResult.pageLevel;
- delete ruleResult.result;
- return ruleResult;
- });
- });
- return resultObject;
- }
- var process_aggregate_default = processAggregate;
- var dataRegex = /\$\{\s?data\s?\}/g;
- function substitute(str, data2) {
- if (typeof data2 === 'string') {
- return str.replace(dataRegex, data2);
- }
- for (var prop in data2) {
- if (data2.hasOwnProperty(prop)) {
- var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
- var replace = typeof data2[prop] === 'undefined' ? '' : String(data2[prop]);
- str = str.replace(regex, replace);
- }
- }
- return str;
- }
- function processMessage(message, data2) {
- if (!message) {
- return;
- }
- if (Array.isArray(data2)) {
- data2.values = data2.join(', ');
- if (typeof message.singular === 'string' && typeof message.plural === 'string') {
- var str2 = data2.length === 1 ? message.singular : message.plural;
- return substitute(str2, data2);
- }
- return substitute(message, data2);
- }
- if (typeof message === 'string') {
- return substitute(message, data2);
- }
- if (typeof data2 === 'string') {
- var _str = message[data2];
- return substitute(_str, data2);
- }
- var str = message['default'] || incompleteFallbackMessage();
- if (data2 && data2.messageKey && message[data2.messageKey]) {
- str = message[data2.messageKey];
- }
- return processMessage(str, data2);
- }
- var process_message_default = processMessage;
- function getCheckMessage(checkId, type, data2) {
- var check = axe._audit.data.checks[checkId];
- if (!check) {
- throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
- }
- if (!check.messages[type]) {
- throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type, '" message.'));
- }
- return process_message_default(check.messages[type], data2);
- }
- var get_check_message_default = getCheckMessage;
- function getCheckOption(check, ruleID, options) {
- var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id];
- var checkOption = (options.checks || {})[check.id];
- var enabled = check.enabled;
- var opts = check.options;
- if (checkOption) {
- if (checkOption.hasOwnProperty('enabled')) {
- enabled = checkOption.enabled;
- }
- if (checkOption.hasOwnProperty('options')) {
- opts = checkOption.options;
- }
- }
- if (ruleCheckOption) {
- if (ruleCheckOption.hasOwnProperty('enabled')) {
- enabled = ruleCheckOption.enabled;
- }
- if (ruleCheckOption.hasOwnProperty('options')) {
- opts = ruleCheckOption.options;
- }
- }
- return {
- enabled: enabled,
- options: opts,
- absolutePaths: options.absolutePaths
- };
- }
- var get_check_option_default = getCheckOption;
- function _getEnvironmentData() {
- var _win$location;
- var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
- if (metadata && _typeof(metadata) === 'object') {
- return metadata;
- } else if (_typeof(win) !== 'object') {
- return {};
- }
- return {
- testEngine: {
- name: 'axe-core',
- version: axe.version
- },
- testRunner: {
- name: axe._audit.brand
- },
- testEnvironment: getTestEnvironment(win),
- timestamp: new Date().toISOString(),
- url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href
- };
- }
- function getTestEnvironment(win) {
- if (!win.navigator || _typeof(win.navigator) !== 'object') {
- return {};
- }
- var navigator = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth;
- var _ref47 = getOrientation(win) || {}, angle = _ref47.angle, type = _ref47.type;
- return {
- userAgent: navigator.userAgent,
- windowWidth: innerWidth,
- windowHeight: innerHeight,
- orientationAngle: angle,
- orientationType: type
- };
- }
- function getOrientation(_ref48) {
- var screen = _ref48.screen;
- return screen.orientation || screen.msOrientation || screen.mozOrientation;
- }
- function createFrameContext(frame, _ref49) {
- var focusable = _ref49.focusable, page = _ref49.page;
- return {
- node: frame,
- include: [],
- exclude: [],
- initiator: false,
- focusable: focusable && frameFocusable(frame),
- size: getBoundingSize(frame),
- page: page
- };
- }
- function frameFocusable(frame) {
- var tabIndex = frame.getAttribute('tabindex');
- if (!tabIndex) {
- return true;
- }
- var _int = parseInt(tabIndex, 10);
- return isNaN(_int) || _int >= 0;
- }
- function getBoundingSize(domNode) {
- var width = parseInt(domNode.getAttribute('width'), 10);
- var height = parseInt(domNode.getAttribute('height'), 10);
- if (isNaN(width) || isNaN(height)) {
- var rect = domNode.getBoundingClientRect();
- width = isNaN(width) ? rect.width : width;
- height = isNaN(height) ? rect.height : height;
- }
- return {
- width: width,
- height: height
- };
- }
- function normalizeContext(contextSpec) {
- if (isContextObject(contextSpec)) {
- var msg = ' must be used inside include or exclude. It should not be on the same object.';
- assert2(!objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg);
- assert2(!objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg);
- } else if (isContextProp(contextSpec)) {
- contextSpec = {
- include: contextSpec,
- exclude: []
- };
- } else {
- return {
- include: [ document ],
- exclude: []
- };
- }
- var include = normalizeContextList(contextSpec.include);
- if (include.length === 0) {
- include.push(document);
- }
- var exclude = normalizeContextList(contextSpec.exclude);
- return {
- include: include,
- exclude: exclude
- };
- }
- function isContextSpec(contextSpec) {
- return isContextObject(contextSpec) || isContextProp(contextSpec);
- }
- function normalizeContextList() {
- var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var normalizedList = [];
- if (!isArrayLike(selectorList)) {
- selectorList = [ selectorList ];
- }
- for (var _i12 = 0; _i12 < selectorList.length; _i12++) {
- var normalizedSelector = normalizeContextSelector(selectorList[_i12]);
- if (normalizedSelector) {
- normalizedList.push(normalizedSelector);
- }
- }
- return normalizedList;
- }
- function normalizeContextSelector(selector) {
- if (selector instanceof window.Node) {
- return selector;
- }
- if (typeof selector === 'string') {
- return [ selector ];
- }
- if (isLabelledFramesSelector(selector)) {
- assertLabelledFrameSelector(selector);
- selector = selector.fromFrames;
- } else if (isLabelledShadowDomSelector(selector)) {
- selector = [ selector ];
- }
- return normalizeFrameSelectors(selector);
- }
- function normalizeFrameSelectors(frameSelectors) {
- if (!Array.isArray(frameSelectors)) {
- return;
- }
- var normalizedSelectors = [];
- var _iterator5 = _createForOfIteratorHelper(frameSelectors), _step5;
- try {
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
- var selector = _step5.value;
- if (isLabelledShadowDomSelector(selector)) {
- assertLabelledShadowDomSelector(selector);
- selector = selector.fromShadowDom;
- }
- if (typeof selector !== 'string' && !isShadowSelector(selector)) {
- return;
- }
- normalizedSelectors.push(selector);
- }
- } catch (err) {
- _iterator5.e(err);
- } finally {
- _iterator5.f();
- }
- return normalizedSelectors;
- }
- function isContextObject(contextSpec) {
- return [ 'include', 'exclude' ].some(function(prop) {
- return objectHasOwn(contextSpec, prop) && isContextProp(contextSpec[prop]);
- });
- }
- function isContextProp(contextList) {
- return typeof contextList === 'string' || contextList instanceof window.Node || isLabelledFramesSelector(contextList) || isLabelledShadowDomSelector(contextList) || isArrayLike(contextList);
- }
- function isLabelledFramesSelector(selector) {
- return objectHasOwn(selector, 'fromFrames');
- }
- function isLabelledShadowDomSelector(selector) {
- return objectHasOwn(selector, 'fromShadowDom');
- }
- function assertLabelledFrameSelector(selector) {
- assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array');
- assert2(selector.fromFrames.every(function(selector2) {
- return !objectHasOwn(selector2, 'fromFrames');
- }), 'Invalid context; fromFrames selector must be appended, rather than nested');
- assert2(!objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object');
- }
- function assertLabelledShadowDomSelector(selector) {
- assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array');
- assert2(selector.fromShadowDom.every(function(selector2) {
- return !objectHasOwn(selector2, 'fromFrames');
- }), 'shadow selector must be inside fromFrame instead');
- assert2(selector.fromShadowDom.every(function(selector2) {
- return !objectHasOwn(selector2, 'fromShadowDom');
- }), 'fromShadowDom selector must be appended, rather than nested');
- }
- function isShadowSelector(selector) {
- return Array.isArray(selector) && selector.every(function(str) {
- return typeof str === 'string';
- });
- }
- function isArrayLike(arr) {
- return arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false;
- }
- function assert2(bool, str) {
- assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md'));
- }
- function objectHasOwn(obj, prop) {
- if (!obj || _typeof(obj) !== 'object') {
- return false;
- }
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- function parseSelectorArray(context, type) {
- var result = [];
- for (var _i13 = 0, l = context[type].length; _i13 < l; _i13++) {
- var item = context[type][_i13];
- if (item instanceof window.Node) {
- if (item.documentElement instanceof window.Node) {
- result.push(context.flatTree[0]);
- } else {
- result.push(get_node_from_tree_default(item));
- }
- } else if (item && item.length) {
- if (item.length > 1) {
- pushUniqueFrameSelector(context, type, item);
- } else {
- var nodeList = _shadowSelectAll(item[0]);
- result.push.apply(result, _toConsumableArray(nodeList.map(function(node) {
- return get_node_from_tree_default(node);
- })));
- }
- }
- }
- return result.filter(function(r) {
- return r;
- });
- }
- function pushUniqueFrameSelector(context, type, selectorArray) {
- context.frames = context.frames || [];
- var frameSelector = selectorArray.shift();
- var frames = _shadowSelectAll(frameSelector);
- frames.forEach(function(frame) {
- var frameContext = context.frames.find(function(result) {
- return result.node === frame;
- });
- if (!frameContext) {
- frameContext = createFrameContext(frame, context);
- context.frames.push(frameContext);
- }
- frameContext[type].push(selectorArray);
- });
- }
- function Context(spec, flatTree) {
- var _spec, _spec2, _spec3, _spec4, _this2 = this;
- spec = clone_default(spec);
- this.frames = [];
- this.page = typeof ((_spec = spec) === null || _spec === void 0 ? void 0 : _spec.page) === 'boolean' ? spec.page : void 0;
- this.initiator = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.initiator) === 'boolean' ? spec.initiator : true;
- this.focusable = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.focusable) === 'boolean' ? spec.focusable : true;
- this.size = _typeof((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.size) === 'object' ? spec.size : {};
- spec = normalizeContext(spec);
- this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : get_flattened_tree_default(getRootNode2(spec));
- this.exclude = spec.exclude;
- this.include = spec.include;
- this.include = parseSelectorArray(this, 'include');
- this.exclude = parseSelectorArray(this, 'exclude');
- _select('frame, iframe', this).forEach(function(frame) {
- if (_isNodeInContext(frame, _this2)) {
- pushUniqueFrame(_this2, frame.actualNode);
- }
- });
- if (typeof this.page === 'undefined') {
- this.page = isPageContext(this);
- this.frames.forEach(function(frame) {
- frame.page = _this2.page;
- });
- }
- validateContext(this);
- if (!Array.isArray(this.include)) {
- this.include = Array.from(this.include);
- }
- this.include.sort(node_sorter_default);
- }
- function pushUniqueFrame(context, frame) {
- if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) {
- return;
- }
- context.frames.push(createFrameContext(frame, context));
- }
- function isPageContext(_ref50) {
- var include = _ref50.include;
- return include.length === 1 && include[0].actualNode === document.documentElement;
- }
- function validateContext(context) {
- if (context.include.length === 0 && context.frames.length === 0) {
- var env = _respondable.isInFrame() ? 'frame' : 'page';
- throw new Error('No elements found for include in ' + env + ' Context');
- }
- }
- function getRootNode2(_ref51) {
- var include = _ref51.include, exclude = _ref51.exclude;
- var selectors = Array.from(include).concat(Array.from(exclude));
- for (var _i14 = 0; _i14 < selectors.length; _i14++) {
- var item = selectors[_i14];
- if (item instanceof window.Element) {
- return item.ownerDocument.documentElement;
- }
- if (item instanceof window.Document) {
- return item.documentElement;
- }
- }
- return document.documentElement;
- }
- function _getFrameContexts(context) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (options.iframes === false) {
- return [];
- }
- var _Context = new Context(context), frames = _Context.frames;
- return frames.map(function(_ref52) {
- var node = _ref52.node, frameContext = _objectWithoutProperties(_ref52, _excluded7);
- frameContext.initiator = false;
- var frameSelector = _getAncestry(node);
- return {
- frameSelector: frameSelector,
- frameContext: frameContext
- };
- });
- }
- function getRule(ruleId) {
- var rule = axe._audit.rules.find(function(rule2) {
- return rule2.id === ruleId;
- });
- if (!rule) {
- throw new Error('Cannot find rule by id: '.concat(ruleId));
- }
- return rule;
- }
- var get_rule_default = getRule;
- function _getScroll(elm) {
- var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
- var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
- if (!(overflowX || overflowY)) {
- return;
- }
- var style = window.getComputedStyle(elm);
- var scrollableX = isScrollable(style, 'overflow-x');
- var scrollableY = isScrollable(style, 'overflow-y');
- if (overflowX && scrollableX || overflowY && scrollableY) {
- return {
- elm: elm,
- top: elm.scrollTop,
- left: elm.scrollLeft
- };
- }
- }
- function isScrollable(style, prop) {
- var overflowProp = style.getPropertyValue(prop);
- return [ 'scroll', 'auto' ].includes(overflowProp);
- }
- function getElmScrollRecursive(root) {
- return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
- var scroll = _getScroll(elm);
- if (scroll) {
- scrolls.push(scroll);
- }
- return scrolls.concat(getElmScrollRecursive(elm));
- }, []);
- }
- function getScrollState() {
- var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
- var root = win.document.documentElement;
- var windowScroll = [ win.pageXOffset !== void 0 ? {
- elm: win,
- top: win.pageYOffset,
- left: win.pageXOffset
- } : {
- elm: root,
- top: root.scrollTop,
- left: root.scrollLeft
- } ];
- return windowScroll.concat(getElmScrollRecursive(document.body));
- }
- var get_scroll_state_default = getScrollState;
- function _getStandards() {
- return clone_default(standards_default);
- }
- function getStyleSheetFactory(dynamicDoc) {
- if (!dynamicDoc) {
- throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
- }
- return function(options) {
- var data2 = 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;
- var style = dynamicDoc.createElement('style');
- if (isLink) {
- var text = dynamicDoc.createTextNode('@import "'.concat(data2.href, '"'));
- style.appendChild(text);
- } else {
- style.appendChild(dynamicDoc.createTextNode(data2));
- }
- dynamicDoc.head.appendChild(style);
- return {
- sheet: style.sheet,
- isCrossOrigin: isCrossOrigin,
- shadowId: shadowId,
- root: root,
- priority: priority
- };
- };
- }
- var get_stylesheet_factory_default = getStyleSheetFactory;
- var styleSheet;
- function injectStyle(style) {
- if (styleSheet && styleSheet.parentNode) {
- if (styleSheet.styleSheet === void 0) {
- styleSheet.appendChild(document.createTextNode(style));
- } else {
- styleSheet.styleSheet.cssText += style;
- }
- return styleSheet;
- }
- if (!style) {
- return;
- }
- var head = document.head || document.getElementsByTagName('head')[0];
- styleSheet = document.createElement('style');
- styleSheet.type = 'text/css';
- if (styleSheet.styleSheet === void 0) {
- styleSheet.appendChild(document.createTextNode(style));
- } else {
- styleSheet.styleSheet.cssText = style;
- }
- head.appendChild(styleSheet);
- return styleSheet;
- }
- var inject_style_default = injectStyle;
- function isHidden(el, recursed) {
- var node = get_node_from_tree_default(el);
- if (el.nodeType === 9) {
- return false;
- }
- if (el.nodeType === 11) {
- el = el.host;
- }
- if (node && node._isHidden !== null) {
- return node._isHidden;
- }
- var style = window.getComputedStyle(el, null);
- if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') {
- return true;
- }
- var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
- var hidden = isHidden(parent, true);
- if (node) {
- node._isHidden = hidden;
- }
- return hidden;
- }
- var is_hidden_default = isHidden;
- function isHtmlElement(node) {
- var _node$props$nodeName, _node$props;
- 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();
- if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
- return false;
- }
- return !!standards_default.htmlElms[nodeName2];
- }
- var is_html_element_default = isHtmlElement;
- function _isNodeInContext(node, _ref53) {
- var _ref53$include = _ref53.include, include = _ref53$include === void 0 ? [] : _ref53$include, _ref53$exclude = _ref53.exclude, exclude = _ref53$exclude === void 0 ? [] : _ref53$exclude;
- var filterInclude = include.filter(function(candidate) {
- return _contains(candidate, node);
- });
- if (filterInclude.length === 0) {
- return false;
- }
- var filterExcluded = exclude.filter(function(candidate) {
- return _contains(candidate, node);
- });
- if (filterExcluded.length === 0) {
- return true;
- }
- var deepestInclude = getDeepest(filterInclude);
- var deepestExclude = getDeepest(filterExcluded);
- return _contains(deepestExclude, deepestInclude);
- }
- function getDeepest(collection) {
- var deepest;
- var _iterator6 = _createForOfIteratorHelper(collection), _step6;
- try {
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
- var node = _step6.value;
- if (!deepest || !_contains(node, deepest)) {
- deepest = node;
- }
- }
- } catch (err) {
- _iterator6.e(err);
- } finally {
- _iterator6.f();
- }
- return deepest;
- }
- function matchAncestry(ancestryA, ancestryB) {
- if (ancestryA.length !== ancestryB.length) {
- return false;
- }
- return ancestryA.every(function(selectorA, index) {
- var selectorB = ancestryB[index];
- if (!Array.isArray(selectorA)) {
- return selectorA === selectorB;
- }
- if (selectorA.length !== selectorB.length) {
- return false;
- }
- return selectorA.every(function(str, index2) {
- return selectorB[index2] === str;
- });
- });
- }
- var match_ancestry_default = matchAncestry;
- function nodeSorter(nodeA, nodeB) {
- nodeA = nodeA.actualNode || nodeA;
- nodeB = nodeB.actualNode || nodeB;
- if (nodeA === nodeB) {
- return 0;
- }
- if (nodeA.compareDocumentPosition(nodeB) & 4) {
- return -1;
- } else {
- return 1;
- }
- }
- var node_sorter_default = nodeSorter;
- function parseSameOriginStylesheet(sheet, options, priority, importedUrls) {
- var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var rules = Array.from(sheet.cssRules);
- if (!rules) {
- return Promise.resolve();
- }
- var cssImportRules = rules.filter(function(r) {
- return r.type === 3;
- });
- if (!cssImportRules.length) {
- return Promise.resolve({
- isCrossOrigin: isCrossOrigin,
- priority: priority,
- root: options.rootNode,
- shadowId: options.shadowId,
- sheet: sheet
- });
- }
- var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) {
- return rule.href;
- }).map(function(rule) {
- return rule.href;
- }).filter(function(url) {
- return !importedUrls.includes(url);
- });
- var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) {
- var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]);
- var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl);
- return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest);
- });
- var nonImportCSSRules = rules.filter(function(r) {
- return r.type !== 3;
- });
- if (!nonImportCSSRules.length) {
- return Promise.all(promises);
- }
- promises.push(Promise.resolve(options.convertDataToStylesheet({
- data: nonImportCSSRules.map(function(rule) {
- return rule.cssText;
- }).join(),
- isCrossOrigin: isCrossOrigin,
- priority: priority,
- root: options.rootNode,
- shadowId: options.shadowId
- })));
- return Promise.all(promises);
- }
- var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet;
- function parseStylesheet(sheet, options, priority, importedUrls) {
- var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var isSameOrigin = isSameOriginStylesheet(sheet);
- if (isSameOrigin) {
- return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin);
- }
- return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true);
- }
- function isSameOriginStylesheet(sheet) {
- try {
- var rules = sheet.cssRules;
- if (!rules && sheet.href) {
- return false;
- }
- return true;
- } catch (e) {
- return false;
- }
- }
- var parse_stylesheet_default = parseStylesheet;
- function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) {
- importedUrls.push(url);
- return new Promise(function(resolve, reject) {
- var request = new window.XMLHttpRequest();
- request.open('GET', url);
- request.timeout = constants_default.preload.timeout;
- request.addEventListener('error', reject);
- request.addEventListener('timeout', reject);
- request.addEventListener('loadend', function(event) {
- if (event.loaded && request.responseText) {
- return resolve(request.responseText);
- }
- reject(request.responseText);
- });
- request.send();
- }).then(function(data2) {
- var result = options.convertDataToStylesheet({
- data: data2,
- isCrossOrigin: isCrossOrigin,
- priority: priority,
- root: options.rootNode,
- shadowId: options.shadowId
- });
- return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin);
- });
- }
- var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
- var performanceTimer = function() {
- function now() {
- if (window.performance && window.performance) {
- return window.performance.now();
- }
- }
- var originalTime = null;
- var lastRecordedTime = now();
- return {
- start: function start() {
- this.mark('mark_axe_start');
- },
- end: function end() {
- this.mark('mark_axe_end');
- this.measure('axe', 'mark_axe_start', 'mark_axe_end');
- this.logMeasures('axe');
- },
- auditStart: function auditStart() {
- this.mark('mark_audit_start');
- },
- auditEnd: function auditEnd() {
- this.mark('mark_audit_end');
- this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end');
- this.logMeasures();
- },
- mark: function mark(markName) {
- if (window.performance && window.performance.mark !== void 0) {
- window.performance.mark(markName);
- }
- },
- measure: function measure(measureName, startMark, endMark) {
- if (window.performance && window.performance.measure !== void 0) {
- window.performance.measure(measureName, startMark, endMark);
- }
- },
- logMeasures: function logMeasures(measureName) {
- function logMeasure(req2) {
- log_default('Measure ' + req2.name + ' took ' + req2.duration + 'ms');
- }
- if (window.performance && window.performance.getEntriesByType !== void 0) {
- var axeStart = window.performance.getEntriesByName('mark_axe_start')[0];
- var measures = window.performance.getEntriesByType('measure').filter(function(measure) {
- return measure.startTime >= axeStart.startTime;
- });
- for (var i = 0; i < measures.length; ++i) {
- var req = measures[i];
- if (req.name === measureName) {
- logMeasure(req);
- return;
- }
- logMeasure(req);
- }
- }
- },
- timeElapsed: function timeElapsed() {
- return now() - lastRecordedTime;
- },
- reset: function reset() {
- if (!originalTime) {
- originalTime = now();
- }
- lastRecordedTime = now();
- }
- };
- }();
- var performance_timer_default = performanceTimer;
- if (typeof Object.assign !== 'function') {
- (function() {
- Object.assign = function(target) {
- if (target === void 0 || target === null) {
- throw new TypeError('Cannot convert undefined or null to object');
- }
- var output = Object(target);
- for (var index = 1; index < arguments.length; index++) {
- var source = arguments[index];
- if (source !== void 0 && source !== null) {
- for (var nextKey in source) {
- if (source.hasOwnProperty(nextKey)) {
- output[nextKey] = source[nextKey];
- }
- }
- }
- }
- return output;
- };
- })();
- }
- if (!Array.prototype.find) {
- Object.defineProperty(Array.prototype, 'find', {
- value: function value(predicate) {
- if (this === null) {
- throw new TypeError('Array.prototype.find called on null or undefined');
- }
- if (typeof predicate !== 'function') {
- throw new TypeError('predicate must be a function');
- }
- var list = Object(this);
- var length = list.length >>> 0;
- var thisArg = arguments[1];
- var value;
- for (var i = 0; i < length; i++) {
- value = list[i];
- if (predicate.call(thisArg, value, i, list)) {
- return value;
- }
- }
- return void 0;
- }
- });
- }
- if (!Array.prototype.findIndex) {
- Object.defineProperty(Array.prototype, 'findIndex', {
- value: function value(predicate, thisArg) {
- if (this === null) {
- throw new TypeError('Array.prototype.find called on null or undefined');
- }
- if (typeof predicate !== 'function') {
- throw new TypeError('predicate must be a function');
- }
- var list = Object(this);
- var length = list.length >>> 0;
- var value;
- for (var i = 0; i < length; i++) {
- value = list[i];
- if (predicate.call(thisArg, value, i, list)) {
- return i;
- }
- }
- return -1;
- }
- });
- }
- function _pollyfillElementsFromPoint() {
- if (document.elementsFromPoint) {
- return document.elementsFromPoint;
- }
- if (document.msElementsFromPoint) {
- return document.msElementsFromPoint;
- }
- var usePointer = function() {
- var element = document.createElement('x');
- element.style.cssText = 'pointer-events:auto';
- return element.style.pointerEvents === 'auto';
- }();
- var cssProp = usePointer ? 'pointer-events' : 'visibility';
- var cssDisableVal = usePointer ? 'none' : 'hidden';
- var style = document.createElement('style');
- style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }';
- return function(x, y) {
- var current, i, d;
- var elements = [];
- var previousPointerEvents = [];
- document.head.appendChild(style);
- while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) {
- elements.push(current);
- previousPointerEvents.push({
- value: current.style.getPropertyValue(cssProp),
- priority: current.style.getPropertyPriority(cssProp)
- });
- current.style.setProperty(cssProp, cssDisableVal, 'important');
- }
- if (elements.indexOf(document.documentElement) < elements.length - 1) {
- elements.splice(elements.indexOf(document.documentElement), 1);
- elements.push(document.documentElement);
- }
- for (i = previousPointerEvents.length; !!(d = previousPointerEvents[--i]); ) {
- elements[i].style.setProperty(cssProp, d.value ? d.value : '', d.priority);
- }
- document.head.removeChild(style);
- return elements;
- };
- }
- if (typeof window.addEventListener === 'function') {
- document.elementsFromPoint = _pollyfillElementsFromPoint();
- }
- if (!Array.prototype.includes) {
- Object.defineProperty(Array.prototype, 'includes', {
- value: function value(searchElement) {
- var O = Object(this);
- var len = parseInt(O.length, 10) || 0;
- if (len === 0) {
- return false;
- }
- var n = parseInt(arguments[1], 10) || 0;
- var k;
- if (n >= 0) {
- k = n;
- } else {
- k = len + n;
- if (k < 0) {
- k = 0;
- }
- }
- var currentElement;
- while (k < len) {
- currentElement = O[k];
- if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
- return true;
- }
- k++;
- }
- return false;
- }
- });
- }
- if (!Array.prototype.some) {
- Object.defineProperty(Array.prototype, 'some', {
- value: function value(fun) {
- if (this == null) {
- throw new TypeError('Array.prototype.some called on null or undefined');
- }
- if (typeof fun !== 'function') {
- throw new TypeError();
- }
- var t = Object(this);
- var len = t.length >>> 0;
- var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
- for (var i = 0; i < len; i++) {
- if (i in t && fun.call(thisArg, t[i], i, t)) {
- return true;
- }
- }
- return false;
- }
- });
- }
- if (!Array.from) {
- Object.defineProperty(Array, 'from', {
- value: function() {
- var toStr = Object.prototype.toString;
- var isCallable = function isCallable(fn) {
- return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
- };
- var toInteger = function toInteger(value) {
- var number = Number(value);
- if (isNaN(number)) {
- return 0;
- }
- if (number === 0 || !isFinite(number)) {
- return number;
- }
- return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
- };
- var maxSafeInteger = Math.pow(2, 53) - 1;
- var toLength = function toLength(value) {
- var len = toInteger(value);
- return Math.min(Math.max(len, 0), maxSafeInteger);
- };
- return function from(arrayLike) {
- var C = this;
- var items = Object(arrayLike);
- if (arrayLike == null) {
- throw new TypeError('Array.from requires an array-like object - not null or undefined');
- }
- var mapFn = arguments.length > 1 ? arguments[1] : void 0;
- var T;
- if (typeof mapFn !== 'undefined') {
- if (!isCallable(mapFn)) {
- throw new TypeError('Array.from: when provided, the second argument must be a function');
- }
- if (arguments.length > 2) {
- T = arguments[2];
- }
- }
- var len = toLength(items.length);
- var A = isCallable(C) ? Object(new C(len)) : new Array(len);
- var k = 0;
- var kValue;
- while (k < len) {
- kValue = items[k];
- if (mapFn) {
- A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
- } else {
- A[k] = kValue;
- }
- k += 1;
- }
- A.length = len;
- return A;
- };
- }()
- });
- }
- if (!String.prototype.includes) {
- String.prototype.includes = function(search, start) {
- if (typeof start !== 'number') {
- start = 0;
- }
- if (start + search.length > this.length) {
- return false;
- } else {
- return this.indexOf(search, start) !== -1;
- }
- };
- }
- if (!Array.prototype.flat) {
- Object.defineProperty(Array.prototype, 'flat', {
- configurable: true,
- value: function flat() {
- var depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
- return depth ? Array.prototype.reduce.call(this, function(acc, cur) {
- if (Array.isArray(cur)) {
- acc.push.apply(acc, flat.call(cur, depth - 1));
- } else {
- acc.push(cur);
- }
- return acc;
- }, []) : Array.prototype.slice.call(this);
- },
- writable: true
- });
- }
- if (window.Node && !('isConnected' in window.Node.prototype)) {
- Object.defineProperty(window.Node.prototype, 'isConnected', {
- get: function get() {
- return !this.ownerDocument || !(this.ownerDocument.compareDocumentPosition(this) & this.DOCUMENT_POSITION_DISCONNECTED);
- }
- });
- }
- function uniqueArray(arr1, arr2) {
- return arr1.concat(arr2).filter(function(elem, pos, arr) {
- return arr.indexOf(elem) === pos;
- });
- }
- var unique_array_default = uniqueArray;
- function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) {
- var retVal = recycledLocalVariable || {};
- retVal.vNodes = vNodes;
- retVal.vNodesIndex = 0;
- retVal.anyLevel = anyLevel;
- retVal.thisLevel = thisLevel;
- retVal.parentShadowId = parentShadowId;
- return retVal;
- }
- var recycledLocalVariables = [];
- function matchExpressions(domTree, expressions, filter) {
- var stack = [];
- var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
- var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
- var result = [];
- while (currentLevel.vNodesIndex < currentLevel.vNodes.length) {
- var _currentLevel$anyLeve, _currentLevel$thisLev;
- var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++];
- var childOnly = null;
- var childAny = null;
- 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);
- var added = false;
- for (var _i15 = 0; _i15 < combinedLength; _i15++) {
- var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4;
- var exp = _i15 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i15] : currentLevel.thisLevel[_i15 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)];
- if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) {
- if (exp.length === 1) {
- if (!added && (!filter || filter(vNode))) {
- result.push(vNode);
- added = true;
- }
- } else {
- var rest = exp.slice(1);
- if ([ ' ', '>' ].includes(rest[0].combinator) === false) {
- throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator);
- }
- if (rest[0].combinator === '>') {
- (childOnly = childOnly || []).push(rest);
- } else {
- (childAny = childAny || []).push(rest);
- }
- }
- }
- if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp)) {
- (childAny = childAny || []).push(exp);
- }
- }
- if (vNode.children && vNode.children.length) {
- stack.push(currentLevel);
- currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop());
- }
- while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) {
- recycledLocalVariables.push(currentLevel);
- currentLevel = stack.pop();
- }
- }
- return result;
- }
- function querySelectorAllFilter(domTree, selector, filter) {
- domTree = Array.isArray(domTree) ? domTree : [ domTree ];
- var expressions = _convertSelector(selector);
- var nodes = getNodesMatchingExpression(domTree, expressions, filter);
- if (nodes) {
- return nodes;
- }
- return matchExpressions(domTree, expressions, filter);
- }
- var query_selector_all_filter_default = querySelectorAllFilter;
- function preloadCssom(_ref54) {
- var _ref54$treeRoot = _ref54.treeRoot, treeRoot = _ref54$treeRoot === void 0 ? axe._tree[0] : _ref54$treeRoot;
- var rootNodes = getAllRootNodesInTree(treeRoot);
- if (!rootNodes.length) {
- return Promise.resolve();
- }
- var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom');
- var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc);
- return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) {
- return flattenAssets(assets);
- });
- }
- var preload_cssom_default = preloadCssom;
- function getAllRootNodesInTree(tree) {
- var ids = [];
- var rootNodes = query_selector_all_filter_default(tree, '*', function(node) {
- if (ids.includes(node.shadowId)) {
- return false;
- }
- ids.push(node.shadowId);
- return true;
- }).map(function(node) {
- return {
- shadowId: node.shadowId,
- rootNode: get_root_node_default(node.actualNode)
- };
- });
- return unique_array_default(rootNodes, []);
- }
- function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) {
- var promises = [];
- rootNodes.forEach(function(_ref55, index) {
- var rootNode = _ref55.rootNode, shadowId = _ref55.shadowId;
- var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet);
- if (!sheets) {
- return Promise.all(promises);
- }
- var rootIndex = index + 1;
- var parseOptions = {
- rootNode: rootNode,
- shadowId: shadowId,
- convertDataToStylesheet: convertDataToStylesheet,
- rootIndex: rootIndex
- };
- var importedUrls = [];
- var p = Promise.all(sheets.map(function(sheet, sheetIndex) {
- var priority = [ rootIndex, sheetIndex ];
- return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls);
- }));
- promises.push(p);
- });
- return Promise.all(promises);
- }
- function flattenAssets(assets) {
- return assets.reduce(function(acc, val) {
- return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val);
- }, []);
- }
- function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) {
- var sheets;
- if (rootNode.nodeType === 11 && shadowId) {
- sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet);
- } else {
- sheets = getStylesheetsFromDocument(rootNode);
- }
- return filterStylesheetsWithSameHref(sheets);
- }
- function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
- return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
- var nodeName2 = node.nodeName.toUpperCase();
- var data2 = nodeName2 === 'STYLE' ? node.textContent : node;
- var isLink = nodeName2 === 'LINK';
- var stylesheet = convertDataToStylesheet({
- data: data2,
- isLink: isLink,
- root: rootNode
- });
- out.push(stylesheet.sheet);
- return out;
- }, []);
- }
- function getStylesheetsFromDocument(rootNode) {
- return Array.from(rootNode.styleSheets).filter(function(sheet) {
- if (!sheet.media) {
- return false;
- }
- return filterMediaIsPrint(sheet.media.mediaText);
- });
- }
- function filerStyleAndLinkAttributesInDocumentFragment(node) {
- var nodeName2 = node.nodeName.toUpperCase();
- var linkHref = node.getAttribute('href');
- var linkRel = node.getAttribute('rel');
- var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET');
- var isStyle = nodeName2 === 'STYLE';
- return isStyle || isLink && filterMediaIsPrint(node.media);
- }
- function filterMediaIsPrint(media) {
- if (!media) {
- return true;
- }
- return !media.toUpperCase().includes('PRINT');
- }
- function filterStylesheetsWithSameHref(sheets) {
- var hrefs = [];
- return sheets.filter(function(sheet) {
- if (!sheet.href) {
- return true;
- }
- if (hrefs.includes(sheet.href)) {
- return false;
- }
- hrefs.push(sheet.href);
- return true;
- });
- }
- function preloadMedia(_ref56) {
- var _ref56$treeRoot = _ref56.treeRoot, treeRoot = _ref56$treeRoot === void 0 ? axe._tree[0] : _ref56$treeRoot;
- var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref57) {
- var actualNode = _ref57.actualNode;
- if (actualNode.hasAttribute('src')) {
- return !!actualNode.getAttribute('src');
- }
- var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) {
- return !!source.getAttribute('src');
- });
- if (sourceWithSrc.length <= 0) {
- return false;
- }
- return true;
- });
- return Promise.all(mediaVirtualNodes.map(function(_ref58) {
- var actualNode = _ref58.actualNode;
- return isMediaElementReady(actualNode);
- }));
- }
- var preload_media_default = preloadMedia;
- function isMediaElementReady(elm) {
- return new Promise(function(resolve) {
- if (elm.readyState > 0) {
- resolve(elm);
- }
- function onMediaReady() {
- elm.removeEventListener('loadedmetadata', onMediaReady);
- resolve(elm);
- }
- elm.addEventListener('loadedmetadata', onMediaReady);
- });
- }
- function isValidPreloadObject(preload2) {
- return _typeof(preload2) === 'object' && Array.isArray(preload2.assets);
- }
- function _shouldPreload(options) {
- if (!options || options.preload === void 0 || options.preload === null) {
- return true;
- }
- if (typeof options.preload === 'boolean') {
- return options.preload;
- }
- return isValidPreloadObject(options.preload);
- }
- function _getPreloadConfig(options) {
- var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout;
- var config = {
- assets: assets,
- timeout: timeout
- };
- if (!options.preload) {
- return config;
- }
- if (typeof options.preload === 'boolean') {
- return config;
- }
- var areRequestedAssetsValid = options.preload.assets.every(function(a) {
- return assets.includes(a.toLowerCase());
- });
- if (!areRequestedAssetsValid) {
- throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.'));
- }
- config.assets = unique_array_default(options.preload.assets.map(function(a) {
- return a.toLowerCase();
- }), []);
- if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) {
- config.timeout = options.preload.timeout;
- }
- return config;
- }
- function preload(options) {
- var preloadFunctionsMap = {
- cssom: preload_cssom_default,
- media: preload_media_default
- };
- if (!_shouldPreload(options)) {
- return Promise.resolve();
- }
- return new Promise(function(resolve, reject) {
- var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout;
- var preloadTimeout = setTimeout(function() {
- return reject(new Error('Preload assets timed out.'));
- }, timeout);
- Promise.all(assets.map(function(asset) {
- return preloadFunctionsMap[asset](options).then(function(results) {
- return _defineProperty({}, asset, results);
- });
- })).then(function(results) {
- var preloadAssets = results.reduce(function(out, result) {
- return _extends({}, out, result);
- }, {});
- clearTimeout(preloadTimeout);
- resolve(preloadAssets);
- })['catch'](function(err2) {
- clearTimeout(preloadTimeout);
- reject(err2);
- });
- });
- }
- var preload_default = preload;
- function getIncompleteReason(checkData, messages) {
- function getDefaultMsg(messages2) {
- if (messages2.incomplete && messages2.incomplete['default']) {
- return messages2.incomplete['default'];
- } else {
- return incompleteFallbackMessage();
- }
- }
- if (checkData && checkData.missingData) {
- try {
- var msg = messages.incomplete[checkData.missingData[0].reason];
- if (!msg) {
- throw new Error();
- }
- return msg;
- } catch (e) {
- if (typeof checkData.missingData === 'string') {
- return messages.incomplete[checkData.missingData];
- } else {
- return getDefaultMsg(messages);
- }
- }
- } else if (checkData && checkData.messageKey) {
- return messages.incomplete[checkData.messageKey];
- } else {
- return getDefaultMsg(messages);
- }
- }
- function extender(checksData, shouldBeTrue, rule) {
- return function(check) {
- var sourceData = checksData[check.id] || {};
- var messages = sourceData.messages || {};
- var data2 = Object.assign({}, sourceData);
- delete data2.messages;
- if (!rule.reviewOnFail && check.result === void 0) {
- if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
- data2.message = getIncompleteReason(check.data, messages);
- }
- if (!data2.message) {
- data2.message = messages.incomplete;
- }
- } else {
- data2.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
- }
- if (typeof data2.message !== 'function') {
- data2.message = process_message_default(data2.message, check.data);
- }
- extend_meta_data_default(check, data2);
- };
- }
- function publishMetaData(ruleResult) {
- var checksData = axe._audit.data.checks || {};
- var rulesData = axe._audit.data.rules || {};
- var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {};
- ruleResult.tags = clone_default(rule.tags || []);
- var shouldBeTrue = extender(checksData, true, rule);
- var shouldBeFalse = extender(checksData, false, rule);
- ruleResult.nodes.forEach(function(detail) {
- detail.any.forEach(shouldBeTrue);
- detail.all.forEach(shouldBeTrue);
- detail.none.forEach(shouldBeFalse);
- });
- extend_meta_data_default(ruleResult, clone_default(rulesData[ruleResult.id] || {}));
- }
- var publish_metadata_default = publishMetaData;
- function querySelectorAll(domTree, selector) {
- return query_selector_all_filter_default(domTree, selector);
- }
- var query_selector_all_default = querySelectorAll;
- function matchTags(rule, runOnly) {
- var include, exclude, matching;
- var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
- if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
- include = runOnly.include || [];
- include = Array.isArray(include) ? include : [ include ];
- exclude = runOnly.exclude || [];
- exclude = Array.isArray(exclude) ? exclude : [ exclude ];
- exclude = exclude.concat(defaultExclude.filter(function(tag) {
- return include.indexOf(tag) === -1;
- }));
- } else {
- include = Array.isArray(runOnly) ? runOnly : [ runOnly ];
- exclude = defaultExclude.filter(function(tag) {
- return include.indexOf(tag) === -1;
- });
- }
- matching = include.some(function(tag) {
- return rule.tags.indexOf(tag) !== -1;
- });
- if (matching || include.length === 0 && rule.enabled !== false) {
- return exclude.every(function(tag) {
- return rule.tags.indexOf(tag) === -1;
- });
- } else {
- return false;
- }
- }
- function ruleShouldRun(rule, context, options) {
- var runOnly = options.runOnly || {};
- var ruleOptions = (options.rules || {})[rule.id];
- if (rule.pageLevel && !context.page) {
- return false;
- } else if (runOnly.type === 'rule') {
- return runOnly.values.indexOf(rule.id) !== -1;
- } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') {
- return ruleOptions.enabled;
- } else if (runOnly.type === 'tag' && runOnly.values) {
- return matchTags(rule, runOnly.values);
- } else {
- return matchTags(rule, []);
- }
- }
- var rule_should_run_default = ruleShouldRun;
- function _filterHtmlAttrs(element, filterAttrs) {
- if (!filterAttrs) {
- return element;
- }
- var node = element.cloneNode(false);
- var attributes2 = get_node_attributes_default(node);
- if (node.nodeType === 1) {
- var outerHTML = node.outerHTML;
- node = cache_default.get(outerHTML, function() {
- return setNodeAttributes(node, attributes2, element, filterAttrs);
- });
- } else {
- node = setNodeAttributes(node, attributes2, element, filterAttrs);
- }
- Array.from(element.childNodes).forEach(function(child) {
- node.appendChild(_filterHtmlAttrs(child, filterAttrs));
- });
- return node;
- }
- function setNodeAttributes(node, attributes2, element, filterAttrs) {
- if (!attributes2) {
- return node;
- }
- node = document.createElement(node.nodeName);
- Array.from(attributes2).forEach(function(attr) {
- if (!attributeMatches(element, attr.name, filterAttrs)) {
- node.setAttribute(attr.name, attr.value);
- }
- });
- return node;
- }
- function attributeMatches(node, attrName, filterAttrs) {
- if (typeof filterAttrs[attrName] === 'undefined') {
- return false;
- }
- if (filterAttrs[attrName] === true) {
- return true;
- }
- return element_matches_default(node, filterAttrs[attrName]);
- }
- function _select(selector, context) {
- var result = [];
- var candidate;
- if (axe._selectCache) {
- for (var j = 0, l = axe._selectCache.length; j < l; j++) {
- var item = axe._selectCache[j];
- if (item.selector === selector) {
- return item.result;
- }
- }
- }
- var outerIncludes = getOuterIncludes(context.include);
- var isInContext = getContextFilter(context);
- for (var _i16 = 0; _i16 < outerIncludes.length; _i16++) {
- candidate = outerIncludes[_i16];
- var nodes = query_selector_all_filter_default(candidate, selector, isInContext);
- result = mergeArrayUniques(result, nodes);
- }
- if (axe._selectCache) {
- axe._selectCache.push({
- selector: selector,
- result: result
- });
- }
- return result;
- }
- function getOuterIncludes(includes) {
- return includes.reduce(function(res, el) {
- if (!res.length || !_contains(res[res.length - 1], el)) {
- res.push(el);
- }
- return res;
- }, []);
- }
- function getContextFilter(context) {
- if (!context.exclude || context.exclude.length === 0) {
- return null;
- }
- return function(node) {
- return _isNodeInContext(node, context);
- };
- }
- function mergeArrayUniques(arr1, arr2) {
- if (arr1.length === 0) {
- return arr2;
- }
- if (arr1.length < arr2.length) {
- var temp = arr1;
- arr1 = arr2;
- arr2 = temp;
- }
- for (var _i17 = 0, l = arr2.length; _i17 < l; _i17++) {
- if (!arr1.includes(arr2[_i17])) {
- arr1.push(arr2[_i17]);
- }
- }
- return arr1;
- }
- function setScroll(elm, top, left) {
- if (elm === window) {
- return elm.scroll(left, top);
- } else {
- elm.scrollTop = top;
- elm.scrollLeft = left;
- }
- }
- function setScrollState(scrollState) {
- scrollState.forEach(function(_ref60) {
- var elm = _ref60.elm, top = _ref60.top, left = _ref60.left;
- return setScroll(elm, top, left);
- });
- }
- var set_scroll_state_default = setScrollState;
- function _shadowSelect(selectors) {
- var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
- return selectRecursive(selectorArr, document);
- }
- function selectRecursive(selectors, doc) {
- var selectorStr = selectors.shift();
- var elm = selectorStr ? doc.querySelector(selectorStr) : null;
- if (selectors.length === 0) {
- return elm;
- }
- if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) {
- return null;
- }
- return selectRecursive(selectors, elm.shadowRoot);
- }
- function _shadowSelectAll(selectors) {
- var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
- var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
- if (selectors.length === 0) {
- return [];
- }
- return selectAllRecursive(selectorArr, doc);
- }
- function selectAllRecursive(_ref61, doc) {
- var _ref62 = _toArray(_ref61), selectorStr = _ref62[0], restSelector = _ref62.slice(1);
- var elms = doc.querySelectorAll(selectorStr);
- if (restSelector.length === 0) {
- return Array.from(elms);
- }
- var selected = [];
- var _iterator7 = _createForOfIteratorHelper(elms), _step7;
- try {
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
- var elm = _step7.value;
- if (elm !== null && elm !== void 0 && elm.shadowRoot) {
- selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot)));
- }
- }
- } catch (err) {
- _iterator7.e(err);
- } finally {
- _iterator7.f();
- }
- return selected;
- }
- function validInputTypes() {
- return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ];
- }
- var valid_input_type_default = validInputTypes;
- 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 ] ] ];
- function isValidLang(lang) {
- var array = langs;
- while (lang.length < 3) {
- lang += '`';
- }
- for (var _i18 = 0; _i18 <= lang.length - 1; _i18++) {
- var index = lang.charCodeAt(_i18) - 96;
- array = array[index];
- if (!array) {
- return false;
- }
- }
- return true;
- }
- function _validLangs(langArray) {
- langArray = Array.isArray(langArray) ? langArray : langs;
- var codes = [];
- langArray.forEach(function(lang, index) {
- var _char3 = String.fromCharCode(index + 96).replace('`', '');
- if (Array.isArray(lang)) {
- codes = codes.concat(_validLangs(lang).map(function(newLang) {
- return _char3 + newLang;
- }));
- } else {
- codes.push(_char3);
- }
- });
- return codes;
- }
- var valid_langs_default = isValidLang;
- var SerialVirtualNode = function(_abstract_virtual_nod2) {
- _inherits(SerialVirtualNode, _abstract_virtual_nod2);
- var _super2 = _createSuper(SerialVirtualNode);
- function SerialVirtualNode(serialNode) {
- var _this3;
- _classCallCheck(this, SerialVirtualNode);
- _this3 = _super2.call(this);
- _this3._props = normaliseProps(serialNode);
- _this3._attrs = normaliseAttrs(serialNode);
- return _this3;
- }
- _createClass(SerialVirtualNode, [ {
- key: 'props',
- get: function get() {
- return this._props;
- }
- }, {
- key: 'attr',
- value: function attr(attrName) {
- var _this$_attrs$attrName;
- return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null;
- }
- }, {
- key: 'hasAttr',
- value: function hasAttr(attrName) {
- return this._attrs[attrName] !== void 0;
- }
- }, {
- key: 'attrNames',
- get: function get() {
- return Object.keys(this._attrs);
- }
- } ]);
- return SerialVirtualNode;
- }(abstract_virtual_node_default);
- var nodeNamesToTypes = {
- '#cdata-section': 2,
- '#text': 3,
- '#comment': 8,
- '#document': 9,
- '#document-fragment': 11
- };
- var nodeTypeToName = {};
- var nodeNames = Object.keys(nodeNamesToTypes);
- nodeNames.forEach(function(nodeName2) {
- nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2;
- });
- function normaliseProps(serialNode) {
- var _serialNode$nodeName, _ref63, _serialNode$nodeType;
- var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType];
- var nodeType = (_ref63 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref63 !== void 0 ? _ref63 : 1;
- assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\''));
- assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\''));
- nodeName2 = nodeName2.toLowerCase();
- var type = null;
- if (nodeName2 === 'input') {
- type = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase();
- if (!valid_input_type_default().includes(type)) {
- type = 'text';
- }
- }
- var props = _extends({}, serialNode, {
- nodeType: nodeType,
- nodeName: nodeName2
- });
- if (type) {
- props.type = type;
- }
- delete props.attributes;
- return Object.freeze(props);
- }
- function normaliseAttrs(_ref64) {
- var _ref64$attributes = _ref64.attributes, attributes2 = _ref64$attributes === void 0 ? {} : _ref64$attributes;
- var attrMap = {
- htmlFor: 'for',
- className: 'class'
- };
- return Object.keys(attributes2).reduce(function(attrs, attrName) {
- var value = attributes2[attrName];
- assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was'));
- if (value !== void 0) {
- var mappedName = attrMap[attrName] || attrName;
- attrs[mappedName] = value !== null ? String(value) : null;
- }
- return attrs;
- }, {});
- }
- var serial_virtual_node_default = SerialVirtualNode;
- var imports_exports = {};
- __export(imports_exports, {
- CssSelectorParser: function CssSelectorParser() {
- return import_css_selector_parser2.CssSelectorParser;
- },
- doT: function doT() {
- return import_dot['default'];
- },
- emojiRegexText: function emojiRegexText() {
- return emoji_regex_default;
- },
- memoize: function memoize() {
- return import_memoizee2['default'];
- }
- });
- var import_css_selector_parser2 = __toModule(require_lib());
- var import_dot = __toModule(require_doT());
- var import_memoizee2 = __toModule(require_memoizee());
- var import_es6_promise = __toModule(require_es6_promise());
- var import_typedarray = __toModule(require_typedarray());
- var import_weakmap_polyfill = __toModule(require_weakmap_polyfill());
- import_dot['default'].templateSettings.strip = false;
- if (!('Promise' in window)) {
- import_es6_promise['default'].polyfill();
- }
- if (!('Uint32Array' in window)) {
- window.Uint32Array = import_typedarray.Uint32Array;
- }
- if (window.Uint32Array) {
- if (!('some' in window.Uint32Array.prototype)) {
- Object.defineProperty(window.Uint32Array.prototype, 'some', {
- value: Array.prototype.some
- });
- }
- if (!('reduce' in window.Uint32Array.prototype)) {
- Object.defineProperty(window.Uint32Array.prototype, 'reduce', {
- value: Array.prototype.reduce
- });
- }
- }
- function cleanup(resolve, reject) {
- resolve = resolve || function res() {};
- reject = reject || axe.log;
- if (!axe._audit) {
- throw new Error('No audit configured');
- }
- var q = axe.utils.queue();
- var cleanupErrors = [];
- Object.keys(axe.plugins).forEach(function(key) {
- q.defer(function(res) {
- var rej = function rej2(err2) {
- cleanupErrors.push(err2);
- res();
- };
- try {
- axe.plugins[key].cleanup(res, rej);
- } catch (err2) {
- rej(err2);
- }
- });
- });
- var flattenedTree = axe.utils.getFlattenedTree(document.body);
- axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) {
- q.defer(function(res, rej) {
- return axe.utils.sendCommandToFrame(node.actualNode, {
- command: 'cleanup-plugin'
- }, res, rej);
- });
- });
- q.then(function(results) {
- if (cleanupErrors.length === 0) {
- resolve(results);
- } else {
- reject(cleanupErrors);
- }
- })['catch'](reject);
- }
- var cleanup_default = cleanup;
- var reporters = {};
- var defaultReporter;
- function hasReporter(reporterName) {
- return reporters.hasOwnProperty(reporterName);
- }
- function getReporter(reporter) {
- if (typeof reporter === 'string' && reporters[reporter]) {
- return reporters[reporter];
- }
- if (typeof reporter === 'function') {
- return reporter;
- }
- return defaultReporter;
- }
- function addReporter(name, cb, isDefault) {
- reporters[name] = cb;
- if (isDefault) {
- defaultReporter = cb;
- }
- }
- function configure(spec) {
- var audit;
- audit = axe._audit;
- if (!audit) {
- throw new Error('No audit configured');
- }
- if (spec.axeVersion || spec.ver) {
- var specVersion = spec.axeVersion || spec.ver;
- if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) {
- throw new Error('Invalid configured version '.concat(specVersion));
- }
- var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1];
- 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];
- 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];
- 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];
- if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) {
- throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version));
- }
- }
- if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) {
- audit.reporter = spec.reporter;
- }
- if (spec.checks) {
- if (!Array.isArray(spec.checks)) {
- throw new TypeError('Checks property must be an array');
- }
- spec.checks.forEach(function(check) {
- if (!check.id) {
- throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property'));
- }
- audit.addCheck(check);
- });
- }
- var modifiedRules = [];
- if (spec.rules) {
- if (!Array.isArray(spec.rules)) {
- throw new TypeError('Rules property must be an array');
- }
- spec.rules.forEach(function(rule) {
- if (!rule.id) {
- throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property'));
- }
- modifiedRules.push(rule.id);
- audit.addRule(rule);
- });
- }
- if (spec.disableOtherRules) {
- audit.rules.forEach(function(rule) {
- if (modifiedRules.includes(rule.id) === false) {
- rule.enabled = false;
- }
- });
- }
- if (typeof spec.branding !== 'undefined') {
- audit.setBranding(spec.branding);
- } else {
- audit._constructHelpUrls();
- }
- if (spec.tagExclude) {
- audit.tagExclude = spec.tagExclude;
- }
- if (spec.locale) {
- audit.applyLocale(spec.locale);
- }
- if (spec.standards) {
- configureStandards(spec.standards);
- }
- if (spec.noHtml) {
- audit.noHtml = true;
- }
- if (spec.allowedOrigins) {
- if (!Array.isArray(spec.allowedOrigins)) {
- throw new TypeError('Allowed origins property must be an array');
- }
- if (spec.allowedOrigins.includes('*')) {
- throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead'));
- }
- audit.setAllowedOrigins(spec.allowedOrigins);
- }
- }
- var configure_default = configure;
- function frameMessenger2(frameHandler) {
- _respondable.updateMessenger(frameHandler);
- }
- function getRules(tags) {
- tags = tags || [];
- var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) {
- return !!tags.filter(function(tag) {
- return item.tags.indexOf(tag) !== -1;
- }).length;
- });
- var ruleData = axe._audit.data.rules || {};
- return matchingRules.map(function(matchingRule) {
- var rd = ruleData[matchingRule.id] || {};
- return {
- ruleId: matchingRule.id,
- description: rd.description,
- help: rd.help,
- helpUrl: rd.helpUrl,
- tags: matchingRule.tags,
- actIds: matchingRule.actIds
- };
- });
- }
- var get_rules_default = getRules;
- var aria_exports = {};
- __export(aria_exports, {
- allowedAttr: function allowedAttr() {
- return allowed_attr_default;
- },
- arialabelText: function arialabelText() {
- return arialabel_text_default;
- },
- arialabelledbyText: function arialabelledbyText() {
- return arialabelledby_text_default;
- },
- getAccessibleRefs: function getAccessibleRefs() {
- return get_accessible_refs_default;
- },
- getElementUnallowedRoles: function getElementUnallowedRoles() {
- return get_element_unallowed_roles_default;
- },
- getExplicitRole: function getExplicitRole() {
- return get_explicit_role_default;
- },
- getImplicitRole: function getImplicitRole() {
- return implicit_role_default;
- },
- getOwnedVirtual: function getOwnedVirtual() {
- return get_owned_virtual_default;
- },
- getRole: function getRole() {
- return get_role_default;
- },
- getRoleType: function getRoleType() {
- return get_role_type_default;
- },
- getRolesByType: function getRolesByType() {
- return get_roles_by_type_default;
- },
- getRolesWithNameFromContents: function getRolesWithNameFromContents() {
- return get_roles_with_name_from_contents_default;
- },
- implicitNodes: function implicitNodes() {
- return implicit_nodes_default;
- },
- implicitRole: function implicitRole() {
- return implicit_role_default;
- },
- isAccessibleRef: function isAccessibleRef() {
- return is_accessible_ref_default;
- },
- isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() {
- return is_aria_role_allowed_on_element_default;
- },
- isComboboxPopup: function isComboboxPopup() {
- return _isComboboxPopup;
- },
- isUnsupportedRole: function isUnsupportedRole() {
- return is_unsupported_role_default;
- },
- isValidRole: function isValidRole() {
- return is_valid_role_default;
- },
- label: function label() {
- return label_default2;
- },
- labelVirtual: function labelVirtual() {
- return label_virtual_default;
- },
- lookupTable: function lookupTable() {
- return lookup_table_default;
- },
- namedFromContents: function namedFromContents() {
- return named_from_contents_default;
- },
- requiredAttr: function requiredAttr() {
- return required_attr_default;
- },
- requiredContext: function requiredContext() {
- return required_context_default;
- },
- requiredOwned: function requiredOwned() {
- return required_owned_default;
- },
- validateAttr: function validateAttr() {
- return validate_attr_default;
- },
- validateAttrValue: function validateAttrValue() {
- return validate_attr_value_default;
- }
- });
- function allowedAttr(role) {
- var roleDef = standards_default.ariaRoles[role];
- var attrs = _toConsumableArray(get_global_aria_attrs_default());
- if (!roleDef) {
- return attrs;
- }
- if (roleDef.allowedAttrs) {
- attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs));
- }
- if (roleDef.requiredAttrs) {
- attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs));
- }
- return attrs;
- }
- var allowed_attr_default = allowedAttr;
- var idRefsRegex = /^idrefs?$/;
- function cacheIdRefs(node, idRefs, refAttrs) {
- if (node.hasAttribute) {
- if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
- var id = node.getAttribute('for');
- idRefs[id] = idRefs[id] || [];
- idRefs[id].push(node);
- }
- for (var _i19 = 0; _i19 < refAttrs.length; ++_i19) {
- var attr = refAttrs[_i19];
- var attrValue = sanitize_default(node.getAttribute(attr) || '');
- if (!attrValue) {
- continue;
- }
- var tokens = token_list_default(attrValue);
- for (var k = 0; k < tokens.length; ++k) {
- idRefs[tokens[k]] = idRefs[tokens[k]] || [];
- idRefs[tokens[k]].push(node);
- }
- }
- }
- for (var _i20 = 0; _i20 < node.childNodes.length; _i20++) {
- if (node.childNodes[_i20].nodeType === 1) {
- cacheIdRefs(node.childNodes[_i20], idRefs, refAttrs);
- }
- }
- }
- function getAccessibleRefs(node) {
- node = node.actualNode || node;
- var root = get_root_node_default2(node);
- root = root.documentElement || root;
- var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
- return new WeakMap();
- });
- var idRefs = idRefsByRoot.get(root);
- if (!idRefs) {
- idRefs = {};
- idRefsByRoot.set(root, idRefs);
- var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
- var type = standards_default.ariaAttrs[attr].type;
- return idRefsRegex.test(type);
- });
- cacheIdRefs(root, idRefs, refAttrs);
- }
- return idRefs[node.id] || [];
- }
- var get_accessible_refs_default = getAccessibleRefs;
- function isAriaRoleAllowedOnElement(node, role) {
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- var implicitRole3 = implicit_role_default(vNode);
- var spec = get_element_spec_default(vNode);
- if (Array.isArray(spec.allowedRoles)) {
- return spec.allowedRoles.includes(role);
- }
- if (role === implicitRole3) {
- return false;
- }
- return !!spec.allowedRoles;
- }
- var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement;
- var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ];
- var landmarkRoles = {
- header: 'banner',
- footer: 'contentinfo'
- };
- function getRoleSegments(vNode) {
- var roles = [];
- if (!vNode) {
- return roles;
- }
- if (vNode.hasAttr('role')) {
- var nodeRoles = token_list_default(vNode.attr('role').toLowerCase());
- roles = roles.concat(nodeRoles);
- }
- return roles.filter(function(role) {
- return is_valid_role_default(role);
- });
- }
- function getElementUnallowedRoles(node) {
- var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
- if (!is_html_element_default(vNode)) {
- return [];
- }
- var nodeName2 = vNode.props.nodeName;
- var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2];
- var roleSegments = getRoleSegments(vNode);
- return roleSegments.filter(function(role) {
- return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3);
- });
- }
- function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) {
- if (allowImplicit && role === implicitRole3) {
- return true;
- }
- if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) {
- return false;
- }
- return is_aria_role_allowed_on_element_default(vNode, role);
- }
- var get_element_unallowed_roles_default = getElementUnallowedRoles;
- function getAriaRolesByType(type) {
- return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
- return standards_default.ariaRoles[roleName].type === type;
- });
- }
- var get_aria_roles_by_type_default = getAriaRolesByType;
- function getRolesByType(roleType) {
- return get_aria_roles_by_type_default(roleType);
- }
- var get_roles_by_type_default = getRolesByType;
- function getAriaRolesSupportingNameFromContent() {
- return cache_default.get('ariaRolesNameFromContent', function() {
- return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
- return standards_default.ariaRoles[roleName].nameFromContent;
- });
- });
- }
- var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent;
- function getRolesWithNameFromContents() {
- return get_aria_roles_supporting_name_from_content_default();
- }
- var get_roles_with_name_from_contents_default = getRolesWithNameFromContents;
- var isNull = function isNull(value) {
- return value === null;
- };
- var isNotNull = function isNotNull(value) {
- return value !== null;
- };
- var lookupTable = {};
- lookupTable.attributes = {
- 'aria-activedescendant': {
- type: 'idref',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-atomic': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-autocomplete': {
- type: 'nmtoken',
- values: [ 'inline', 'list', 'both', 'none' ],
- unsupported: false
- },
- 'aria-busy': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-checked': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'mixed', 'undefined' ],
- unsupported: false
- },
- 'aria-colcount': {
- type: 'int',
- unsupported: false
- },
- 'aria-colindex': {
- type: 'int',
- unsupported: false
- },
- 'aria-colspan': {
- type: 'int',
- unsupported: false
- },
- 'aria-controls': {
- type: 'idrefs',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-current': {
- type: 'nmtoken',
- allowEmpty: true,
- values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
- unsupported: false
- },
- 'aria-describedby': {
- type: 'idrefs',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-describedat': {
- unsupported: true,
- unstandardized: true
- },
- 'aria-details': {
- type: 'idref',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-disabled': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-dropeffect': {
- type: 'nmtokens',
- values: [ 'copy', 'move', 'reference', 'execute', 'popup', 'none' ],
- unsupported: false
- },
- 'aria-errormessage': {
- type: 'idref',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-expanded': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ],
- unsupported: false
- },
- 'aria-flowto': {
- type: 'idrefs',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-grabbed': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ],
- unsupported: false
- },
- 'aria-haspopup': {
- type: 'nmtoken',
- allowEmpty: true,
- values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
- unsupported: false
- },
- 'aria-hidden': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-invalid': {
- type: 'nmtoken',
- allowEmpty: true,
- values: [ 'true', 'false', 'spelling', 'grammar' ],
- unsupported: false
- },
- 'aria-keyshortcuts': {
- type: 'string',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-label': {
- type: 'string',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-labelledby': {
- type: 'idrefs',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-level': {
- type: 'int',
- unsupported: false
- },
- 'aria-live': {
- type: 'nmtoken',
- values: [ 'off', 'polite', 'assertive' ],
- unsupported: false
- },
- 'aria-modal': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-multiline': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-multiselectable': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-orientation': {
- type: 'nmtoken',
- values: [ 'horizontal', 'vertical' ],
- unsupported: false
- },
- 'aria-owns': {
- type: 'idrefs',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-placeholder': {
- type: 'string',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-posinset': {
- type: 'int',
- unsupported: false
- },
- 'aria-pressed': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'mixed', 'undefined' ],
- unsupported: false
- },
- 'aria-readonly': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-relevant': {
- type: 'nmtokens',
- values: [ 'additions', 'removals', 'text', 'all' ],
- unsupported: false
- },
- 'aria-required': {
- type: 'boolean',
- values: [ 'true', 'false' ],
- unsupported: false
- },
- 'aria-roledescription': {
- type: 'string',
- allowEmpty: true,
- unsupported: false
- },
- 'aria-rowcount': {
- type: 'int',
- unsupported: false
- },
- 'aria-rowindex': {
- type: 'int',
- unsupported: false
- },
- 'aria-rowspan': {
- type: 'int',
- unsupported: false
- },
- 'aria-selected': {
- type: 'nmtoken',
- values: [ 'true', 'false', 'undefined' ],
- unsupported: false
- },
- 'aria-setsize': {
- type: 'int',
- unsupported: false
- },
- 'aria-sort': {
- type: 'nmtoken',
- values: [ 'ascending', 'descending', 'other', 'none' ],
- unsupported: false
- },
- 'aria-valuemax': {
- type: 'decimal',
- unsupported: false
- },
- 'aria-valuemin': {
- type: 'decimal',
- unsupported: false
- },
- 'aria-valuenow': {
- type: 'decimal',
- unsupported: false
- },
- 'aria-valuetext': {
- type: 'string',
- unsupported: false
- }
- };
- 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' ];
- lookupTable.role = {
- alert: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- alertdialog: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'dialog', 'section' ]
- },
- application: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ]
- },
- article: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'article' ],
- unsupported: false
- },
- banner: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'header' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- button: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- cell: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'row' ],
- implicit: [ 'td', 'th' ],
- unsupported: false
- },
- checkbox: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'input[type="checkbox"]' ],
- unsupported: false,
- allowedElements: [ 'button' ]
- },
- columnheader: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'row' ],
- implicit: [ 'th' ],
- unsupported: false
- },
- combobox: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ],
- required: [ 'aria-expanded' ]
- },
- owned: {
- all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: 'input',
- properties: {
- type: [ 'text', 'search', 'tel', 'url', 'email' ]
- }
- } ]
- },
- command: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- complementary: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'aside' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- composite: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- contentinfo: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'footer' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- definition: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'dd', 'dfn' ],
- unsupported: false
- },
- dialog: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'dialog' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- directory: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- document: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'body' ],
- unsupported: false,
- allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ]
- },
- 'doc-abstract': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-acknowledgments': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-afterword': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-appendix': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-backlink': {
- type: 'link',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- 'doc-biblioentry': {
- type: 'listitem',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: [ 'doc-bibliography' ],
- unsupported: false,
- allowedElements: [ 'li' ]
- },
- 'doc-bibliography': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'doc-biblioentry' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-biblioref': {
- type: 'link',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- 'doc-chapter': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-colophon': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-conclusion': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-cover': {
- type: 'img',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false
- },
- 'doc-credit': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-credits': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-dedication': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-endnote': {
- type: 'listitem',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: [ 'doc-endnotes' ],
- unsupported: false,
- allowedElements: [ 'li' ]
- },
- 'doc-endnotes': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'doc-endnote' ]
- },
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-epigraph': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false
- },
- 'doc-epilogue': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-errata': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-example': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'aside', 'section' ]
- },
- 'doc-footnote': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'aside', 'footer', 'header' ]
- },
- 'doc-foreword': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-glossary': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: [ 'term', 'definition' ],
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'dl' ]
- },
- 'doc-glossref': {
- type: 'link',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- 'doc-index': {
- type: 'navigation',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'nav', 'section' ]
- },
- 'doc-introduction': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-noteref': {
- type: 'link',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- 'doc-notice': {
- type: 'note',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-pagebreak': {
- type: 'separator',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'hr' ]
- },
- 'doc-pagelist': {
- type: 'navigation',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'nav', 'section' ]
- },
- 'doc-part': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-preface': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-prologue': {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-pullquote': {
- type: 'none',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'aside', 'section' ]
- },
- 'doc-qna': {
- type: 'section',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- 'doc-subtitle': {
- type: 'sectionhead',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: {
- nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]
- }
- },
- 'doc-tip': {
- type: 'note',
- attributes: {
- allowed: [ 'aria-expanded' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'aside' ]
- },
- 'doc-toc': {
- type: 'navigation',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- namefrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'nav', 'section' ]
- },
- feed: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'article' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'article', 'aside', 'section' ]
- },
- figure: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'figure' ],
- unsupported: false
- },
- form: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'form' ],
- unsupported: false
- },
- grid: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'rowgroup', 'row' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'table' ],
- unsupported: false
- },
- gridcell: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'row' ],
- implicit: [ 'td', 'th' ],
- unsupported: false
- },
- group: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'details', 'optgroup' ],
- unsupported: false,
- allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ]
- },
- heading: {
- type: 'structure',
- attributes: {
- required: [ 'aria-level' ],
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
- unsupported: false
- },
- img: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'img' ],
- unsupported: false,
- allowedElements: [ 'embed', 'iframe', 'object', 'svg' ]
- },
- input: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- landmark: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- link: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'a[href]', 'area[href]' ],
- unsupported: false,
- allowedElements: [ 'button', {
- nodeName: 'input',
- properties: {
- type: [ 'image', 'button' ]
- }
- } ]
- },
- list: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: {
- all: [ 'listitem' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'ol', 'ul', 'dl' ],
- unsupported: false
- },
- listbox: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- all: [ 'option' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'select' ],
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- listitem: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'list' ],
- implicit: [ 'li', 'dt' ],
- unsupported: false
- },
- log: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- main: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'main' ],
- unsupported: false,
- allowedElements: [ 'article', 'section' ]
- },
- marquee: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- math: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'math' ],
- unsupported: false
- },
- menu: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'menu[type="context"]' ],
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- menubar: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- menuitem: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'menu', 'menubar' ],
- implicit: [ 'menuitem[type="command"]' ],
- unsupported: false,
- allowedElements: [ 'button', 'li', {
- nodeName: 'iput',
- properties: {
- type: [ 'image', 'button' ]
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- menuitemcheckbox: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'menu', 'menubar' ],
- implicit: [ 'menuitem[type="checkbox"]' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'button', 'li' ]
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'checkbox', 'image', 'button' ]
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- menuitemradio: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'menu', 'menubar' ],
- implicit: [ 'menuitem[type="radio"]' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'button', 'li' ]
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'image', 'button', 'radio' ]
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- navigation: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'nav' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- none: {
- type: 'structure',
- attributes: null,
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
- }, {
- nodeName: 'img',
- attributes: {
- alt: isNotNull
- }
- } ]
- },
- note: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'aside' ]
- },
- option: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'listbox' ],
- implicit: [ 'option' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'button', 'li' ]
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'checkbox', 'button' ]
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- presentation: {
- type: 'structure',
- attributes: null,
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
- }, {
- nodeName: 'img',
- attributes: {
- alt: isNotNull
- }
- } ]
- },
- progressbar: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'progress' ],
- unsupported: false
- },
- radio: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'input[type="radio"]' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'button', 'li' ]
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'image', 'button' ]
- }
- } ]
- },
- radiogroup: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ]
- },
- owned: {
- all: [ 'radio' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: {
- nodeName: [ 'ol', 'ul', 'fieldset' ]
- }
- },
- range: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- region: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ],
- unsupported: false,
- allowedElements: {
- nodeName: [ 'article', 'aside' ]
- }
- },
- roletype: {
- type: 'abstract',
- unsupported: false
- },
- row: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ]
- },
- nameFrom: [ 'author', 'contents' ],
- context: [ 'rowgroup', 'grid', 'treegrid', 'table' ],
- implicit: [ 'tr' ],
- unsupported: false
- },
- rowgroup: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
- },
- owned: {
- all: [ 'row' ]
- },
- nameFrom: [ 'author', 'contents' ],
- context: [ 'grid', 'table', 'treegrid' ],
- implicit: [ 'tbody', 'thead', 'tfoot' ],
- unsupported: false
- },
- rowheader: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'row' ],
- implicit: [ 'th' ],
- unsupported: false
- },
- scrollbar: {
- type: 'widget',
- attributes: {
- required: [ 'aria-controls', 'aria-valuenow' ],
- allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false
- },
- search: {
- type: 'landmark',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: {
- nodeName: [ 'aside', 'form', 'section' ]
- }
- },
- searchbox: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'input[type="search"]' ],
- unsupported: false,
- allowedElements: {
- nodeName: 'input',
- properties: {
- type: 'text'
- }
- }
- },
- section: {
- nameFrom: [ 'author', 'contents' ],
- type: 'abstract',
- unsupported: false
- },
- sectionhead: {
- nameFrom: [ 'author', 'contents' ],
- type: 'abstract',
- unsupported: false
- },
- select: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- },
- separator: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'hr' ],
- unsupported: false,
- allowedElements: [ 'li' ]
- },
- slider: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
- required: [ 'aria-valuenow' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'input[type="range"]' ],
- unsupported: false
- },
- spinbutton: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
- required: [ 'aria-valuenow' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'input[type="number"]' ],
- unsupported: false,
- allowedElements: {
- nodeName: 'input',
- properties: {
- type: [ 'text', 'tel' ]
- }
- }
- },
- status: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'output' ],
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- structure: {
- type: 'abstract',
- unsupported: false
- },
- switch: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-errormessage' ],
- required: [ 'aria-checked' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'button', {
- nodeName: 'input',
- properties: {
- type: [ 'checkbox', 'image', 'button' ]
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- tab: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'tablist' ],
- unsupported: false,
- allowedElements: [ {
- nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ]
- }, {
- nodeName: 'input',
- properties: {
- type: 'button'
- }
- }, {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- table: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'rowgroup', 'row' ]
- },
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'table' ],
- unsupported: false
- },
- tablist: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- all: [ 'tab' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- tabpanel: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'section' ]
- },
- term: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- implicit: [ 'dt' ],
- unsupported: false
- },
- textbox: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ],
- unsupported: false
- },
- timer: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false
- },
- toolbar: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author' ],
- context: null,
- implicit: [ 'menu[type="toolbar"]' ],
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- tooltip: {
- type: 'structure',
- attributes: {
- allowed: [ 'aria-expanded', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: null,
- unsupported: false
- },
- tree: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- all: [ 'treeitem' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false,
- allowedElements: [ 'ol', 'ul' ]
- },
- treegrid: {
- type: 'composite',
- attributes: {
- allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ]
- },
- owned: {
- one: [ 'rowgroup', 'row' ]
- },
- nameFrom: [ 'author' ],
- context: null,
- unsupported: false
- },
- treeitem: {
- type: 'widget',
- attributes: {
- allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
- },
- owned: null,
- nameFrom: [ 'author', 'contents' ],
- context: [ 'group', 'tree' ],
- unsupported: false,
- allowedElements: [ 'li', {
- nodeName: 'a',
- attributes: {
- href: isNotNull
- }
- } ]
- },
- widget: {
- type: 'abstract',
- unsupported: false
- },
- window: {
- nameFrom: [ 'author' ],
- type: 'abstract',
- unsupported: false
- }
- };
- lookupTable.implicitHtmlRole = implicit_html_roles_default;
- lookupTable.elementsAllowedNoRole = [ {
- 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' ]
- }, {
- nodeName: 'area',
- attributes: {
- href: isNotNull
- }
- }, {
- nodeName: 'input',
- properties: {
- type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
- }
- }, {
- nodeName: 'link',
- attributes: {
- href: isNotNull
- }
- }, {
- nodeName: 'menu',
- attributes: {
- type: 'context'
- }
- }, {
- nodeName: 'menuitem',
- attributes: {
- type: [ 'command', 'checkbox', 'radio' ]
- }
- }, {
- nodeName: 'select',
- condition: function condition(vNode) {
- if (!(vNode instanceof axe.AbstractVirtualNode)) {
- vNode = axe.utils.getNodeFromTree(vNode);
- }
- return Number(vNode.attr('size')) > 1;
- },
- properties: {
- multiple: true
- }
- }, {
- 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' ]
- } ];
- lookupTable.elementsAllowedAnyRole = [ {
- nodeName: 'a',
- attributes: {
- href: isNull
- }
- }, {
- nodeName: 'img',
- attributes: {
- alt: isNull
- }
- }, {
- 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' ]
- } ];
- lookupTable.evaluateRoleForElement = {
- A: function A(_ref65) {
- var node = _ref65.node, out = _ref65.out;
- if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
- return true;
- }
- if (node.href.length) {
- return out;
- }
- return true;
- },
- AREA: function AREA(_ref66) {
- var node = _ref66.node;
- return !node.href;
- },
- BUTTON: function BUTTON(_ref67) {
- var node = _ref67.node, role = _ref67.role, out = _ref67.out;
- if (node.getAttribute('type') === 'menu') {
- return role === 'menuitem';
- }
- return out;
- },
- IMG: function IMG(_ref68) {
- var node = _ref68.node, role = _ref68.role, out = _ref68.out;
- switch (node.alt) {
- case null:
- return out;
- case '':
- return role === 'presentation' || role === 'none';
- default:
- return role !== 'presentation' && role !== 'none';
- }
- },
- INPUT: function INPUT(_ref69) {
- var node = _ref69.node, role = _ref69.role, out = _ref69.out;
- switch (node.type) {
- case 'button':
- case 'image':
- return out;
- case 'checkbox':
- if (role === 'button' && node.hasAttribute('aria-pressed')) {
- return true;
- }
- return out;
- case 'radio':
- return role === 'menuitemradio';
- case 'text':
- return role === 'combobox' || role === 'searchbox' || role === 'spinbutton';
- case 'tel':
- return role === 'combobox' || role === 'spinbutton';
- case 'url':
- case 'search':
- case 'email':
- return role === 'combobox';
- default:
- return false;
- }
- },
- LI: function LI(_ref70) {
- var node = _ref70.node, out = _ref70.out;
- var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li');
- if (hasImplicitListitemRole) {
- return out;
- }
- return true;
- },
- MENU: function MENU(_ref71) {
- var node = _ref71.node;
- if (node.getAttribute('type') === 'context') {
- return false;
- }
- return true;
- },
- OPTION: function OPTION(_ref72) {
- var node = _ref72.node;
- var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option');
- return !withinOptionList;
- },
- SELECT: function SELECT(_ref73) {
- var node = _ref73.node, role = _ref73.role;
- return !node.multiple && node.size <= 1 && role === 'menu';
- },
- SVG: function SVG(_ref74) {
- var node = _ref74.node, out = _ref74.out;
- if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') {
- return true;
- }
- return out;
- }
- };
- lookupTable.rolesOfType = {
- 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' ]
- };
- var lookup_table_default = lookupTable;
- function implicitNodes(role) {
- var implicit = null;
- var roles = lookup_table_default.role[role];
- if (roles && roles.implicit) {
- implicit = clone_default(roles.implicit);
- }
- return implicit;
- }
- var implicit_nodes_default = implicitNodes;
- function isAccessibleRef(node) {
- return !!get_accessible_refs_default(node).length;
- }
- var is_accessible_ref_default = isAccessibleRef;
- function _isComboboxPopup(virtualNode) {
- var _popupRoles;
- var _ref75 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref75.popupRoles;
- var role = get_role_default(virtualNode);
- (_popupRoles = popupRoles) !== null && _popupRoles !== void 0 ? _popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values;
- if (!popupRoles.includes(role)) {
- return false;
- }
- var vParent = nearestParentWithRole(virtualNode);
- if (isCombobox(vParent)) {
- return true;
- }
- var id = virtualNode.props.id;
- if (!id) {
- return false;
- }
- if (!virtualNode.actualNode) {
- throw new Error('Unable to determine combobox popup without an actualNode');
- }
- var root = get_root_node_default(virtualNode.actualNode);
- var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)'));
- return Array.from(ownedCombobox).some(isCombobox);
- }
- var isCombobox = function isCombobox(node) {
- return node && get_role_default(node) === 'combobox';
- };
- function nearestParentWithRole(vNode) {
- while (vNode = vNode.parent) {
- if (get_role_default(vNode, {
- noPresentational: true
- }) !== null) {
- return vNode;
- }
- }
- return null;
- }
- function label2(node) {
- node = get_node_from_tree_default(node);
- return label_virtual_default(node);
- }
- var label_default2 = label2;
- function requiredAttr(role) {
- var roleDef = standards_default.ariaRoles[role];
- if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) {
- return [];
- }
- return _toConsumableArray(roleDef.requiredAttrs);
- }
- var required_attr_default = requiredAttr;
- function requiredContext(role) {
- var roleDef = standards_default.ariaRoles[role];
- if (!roleDef || !Array.isArray(roleDef.requiredContext)) {
- return null;
- }
- return _toConsumableArray(roleDef.requiredContext);
- }
- var required_context_default = requiredContext;
- function requiredOwned(role) {
- var roleDef = standards_default.ariaRoles[role];
- if (!roleDef || !Array.isArray(roleDef.requiredOwned)) {
- return null;
- }
- return _toConsumableArray(roleDef.requiredOwned);
- }
- var required_owned_default = requiredOwned;
- function validateAttrValue(vNode, attr) {
- vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
- var matches4;
- var list;
- var value = vNode.attr(attr);
- var attrInfo = standards_default.ariaAttrs[attr];
- if (!attrInfo) {
- return true;
- }
- if (attrInfo.allowEmpty && (!value || value.trim() === '')) {
- return true;
- }
- switch (attrInfo.type) {
- case 'boolean':
- return [ 'true', 'false' ].includes(value.toLowerCase());
- case 'nmtoken':
- return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase());
- case 'nmtokens':
- list = token_list_default(value);
- return list.reduce(function(result, token) {
- return result && attrInfo.values.includes(token);
- }, list.length !== 0);
- case 'idref':
- try {
- var doc = get_root_node_default2(vNode.actualNode);
- return !!(value && doc.getElementById(value));
- } catch (e) {
- throw new TypeError('Cannot resolve id references for partial DOM');
- }
- case 'idrefs':
- return idrefs_default(vNode, attr).some(function(node) {
- return !!node;
- });
- case 'string':
- return value.trim() !== '';
- case 'decimal':
- matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/);
- return !!(matches4 && (matches4[1] || matches4[2]));
- case 'int':
- var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity;
- return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue;
- }
- }
- var validate_attr_value_default = validateAttrValue;
- function validateAttr(att) {
- var attrDefinition = standards_default.ariaAttrs[att];
- return !!attrDefinition;
- }
- var validate_attr_default = validateAttr;
- function abstractroleEvaluate(node, options, virtualNode) {
- var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) {
- return get_role_type_default(role) === 'abstract';
- });
- if (abstractRoles.length > 0) {
- this.data(abstractRoles);
- return true;
- }
- return false;
- }
- var abstractrole_evaluate_default = abstractroleEvaluate;
- function ariaAllowedAttrEvaluate(node, options, virtualNode) {
- var invalid = [];
- var role = get_role_default(virtualNode);
- var attrs = virtualNode.attrNames;
- var allowed = allowed_attr_default(role);
- if (Array.isArray(options[role])) {
- allowed = unique_array_default(options[role].concat(allowed));
- }
- var tableMap = cache_default.get('aria-allowed-attr-table', function() {
- return new WeakMap();
- });
- function validateRowAttrs() {
- if (virtualNode.parent && role === 'row') {
- var table = closest_default(virtualNode, 'table, [role="treegrid"], [role="table"], [role="grid"]');
- var tableRole = tableMap.get(table);
- if (table && !tableRole) {
- tableRole = get_role_default(table);
- tableMap.set(table, tableRole);
- }
- if ([ 'table', 'grid' ].includes(tableRole) && role === 'row') {
- return true;
- }
- }
- }
- var ariaAttr = Array.isArray(options.validTreeRowAttrs) ? options.validTreeRowAttrs : [];
- var preChecks = {};
- ariaAttr.forEach(function(attr) {
- preChecks[attr] = validateRowAttrs;
- });
- if (allowed) {
- for (var _i21 = 0; _i21 < attrs.length; _i21++) {
- var _preChecks$attrName;
- var attrName = attrs[_i21];
- if (validate_attr_default(attrName) && (_preChecks$attrName = preChecks[attrName]) !== null && _preChecks$attrName !== void 0 && _preChecks$attrName.call(preChecks)) {
- invalid.push(attrName + '="' + virtualNode.attr(attrName) + '"');
- } else if (validate_attr_default(attrName) && !allowed.includes(attrName)) {
- invalid.push(attrName + '="' + virtualNode.attr(attrName) + '"');
- }
- }
- }
- if (invalid.length) {
- this.data(invalid);
- if (!is_html_element_default(virtualNode) && !role && !_isFocusable(virtualNode)) {
- return void 0;
- }
- return false;
- }
- return true;
- }
- function ariaAllowedRoleEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
- var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags;
- var nodeName2 = virtualNode.props.nodeName;
- if (ignoredTags.map(function(tag) {
- return tag.toLowerCase();
- }).includes(nodeName2)) {
- return true;
- }
- var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit);
- if (unallowedRoles.length) {
- this.data(unallowedRoles);
- if (!_isVisibleToScreenReaders(virtualNode)) {
- return void 0;
- }
- return false;
- }
- return true;
- }
- var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate;
- function ariaBusyEvaluate(node, options, virtualNode) {
- return virtualNode.attr('aria-busy') === 'true';
- }
- function ariaErrormessageEvaluate(node, options, virtualNode) {
- options = Array.isArray(options) ? options : [];
- var attr = virtualNode.attr('aria-errormessage');
- var hasAttr = virtualNode.hasAttr('aria-errormessage');
- var invaid = virtualNode.attr('aria-invalid');
- var hasInvallid = virtualNode.hasAttr('aria-invalid');
- if (!hasInvallid || invaid === 'false') {
- return true;
- }
- function validateAttrValue2(attr2) {
- if (attr2.trim() === '') {
- return standards_default.ariaAttrs['aria-errormessage'].allowEmpty;
- }
- var idref;
- try {
- idref = attr2 && idrefs_default(virtualNode, 'aria-errormessage')[0];
- } catch (e) {
- this.data({
- messageKey: 'idrefs',
- values: token_list_default(attr2)
- });
- return void 0;
- }
- if (idref) {
- if (!_isVisibleToScreenReaders(idref)) {
- this.data({
- messageKey: 'hidden',
- values: token_list_default(attr2)
- });
- return false;
- }
- return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(virtualNode.attr('aria-describedby')).indexOf(attr2) > -1;
- }
- return;
- }
- if (options.indexOf(attr) === -1 && hasAttr) {
- this.data(token_list_default(attr));
- return validateAttrValue2.call(this, attr);
- }
- return true;
- }
- var aria_errormessage_evaluate_default = ariaErrormessageEvaluate;
- function ariaHiddenBodyEvaluate(node, options, virtualNode) {
- return virtualNode.attr('aria-hidden') !== 'true';
- }
- var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate;
- function ariaLevelEvaluate(node, options, virtualNode) {
- var ariaHeadingLevel = virtualNode.attr('aria-level');
- var ariaLevel = parseInt(ariaHeadingLevel, 10);
- if (ariaLevel > 6) {
- return void 0;
- }
- return true;
- }
- var aria_level_evaluate_default = ariaLevelEvaluate;
- function ariaProhibitedAttrEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
- var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || [];
- var nodeName2 = virtualNode.props.nodeName;
- var role = get_role_default(virtualNode, {
- chromium: true
- });
- var prohibitedList = listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel);
- var prohibited = prohibitedList.filter(function(attrName) {
- if (!virtualNode.attrNames.includes(attrName)) {
- return false;
- }
- return sanitize_default(virtualNode.attr(attrName)) !== '';
- });
- if (prohibited.length === 0) {
- return false;
- }
- var messageKey = virtualNode.hasAttr('role') ? 'hasRole' : 'noRole';
- messageKey += prohibited.length > 1 ? 'Plural' : 'Singular';
- this.data({
- role: role,
- nodeName: nodeName2,
- messageKey: messageKey,
- prohibited: prohibited
- });
- var textContent = subtree_text_default(virtualNode, {
- subtreeDescendant: true
- });
- if (sanitize_default(textContent) !== '') {
- return void 0;
- }
- return true;
- }
- function listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel) {
- var roleSpec = standards_default.ariaRoles[role];
- if (roleSpec) {
- return roleSpec.prohibitedAttrs || [];
- }
- if (!!role || elementsAllowedAriaLabel.includes(nodeName2)) {
- return [];
- }
- return [ 'aria-label', 'aria-labelledby' ];
- }
- var standards_exports = {};
- __export(standards_exports, {
- getAriaRolesByType: function getAriaRolesByType() {
- return get_aria_roles_by_type_default;
- },
- getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() {
- return get_aria_roles_supporting_name_from_content_default;
- },
- getElementSpec: function getElementSpec() {
- return get_element_spec_default;
- },
- getElementsByContentType: function getElementsByContentType() {
- return get_elements_by_content_type_default;
- },
- getGlobalAriaAttrs: function getGlobalAriaAttrs() {
- return get_global_aria_attrs_default;
- },
- implicitHtmlRoles: function implicitHtmlRoles() {
- return implicit_html_roles_default;
- }
- });
- function ariaRequiredAttrEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
- var role = get_explicit_role_default(virtualNode);
- var attrs = virtualNode.attrNames;
- var requiredAttrs = required_attr_default(role);
- if (Array.isArray(options[role])) {
- requiredAttrs = unique_array_default(options[role], requiredAttrs);
- }
- if (!role || !attrs.length || !requiredAttrs.length) {
- return true;
- }
- if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) {
- return true;
- }
- var elmSpec = get_element_spec_default(virtualNode);
- var missingAttrs = requiredAttrs.filter(function(requiredAttr2) {
- return !virtualNode.attr(requiredAttr2) && !hasImplicitAttr(elmSpec, requiredAttr2);
- });
- if (missingAttrs.length) {
- this.data(missingAttrs);
- return false;
- }
- return true;
- }
- function isStaticSeparator(vNode, role) {
- return role === 'separator' && !_isFocusable(vNode);
- }
- function hasImplicitAttr(elmSpec, attr) {
- var _elmSpec$implicitAttr;
- return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0;
- }
- function isClosedCombobox(vNode, role) {
- return role === 'combobox' && vNode.attr('aria-expanded') === 'false';
- }
- function ariaRequiredChildrenEvaluate(node, options, virtualNode) {
- var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : [];
- var role = get_explicit_role_default(virtualNode, {
- dpub: true
- });
- var required = required_owned_default(role);
- if (required === null) {
- return true;
- }
- var ownedRoles = getOwnedRoles(virtualNode, required);
- var unallowed = ownedRoles.filter(function(_ref76) {
- var role2 = _ref76.role;
- return !required.includes(role2);
- });
- if (unallowed.length) {
- this.relatedNodes(unallowed.map(function(_ref77) {
- var ownedElement = _ref77.ownedElement;
- return ownedElement;
- }));
- this.data({
- messageKey: 'unallowed',
- values: unallowed.map(function(_ref78) {
- var ownedElement = _ref78.ownedElement, attr = _ref78.attr;
- return getUnallowedSelector(ownedElement, attr);
- }).filter(function(selector, index, array) {
- return array.indexOf(selector) === index;
- }).join(', ')
- });
- return false;
- }
- var missing = missingRequiredChildren(virtualNode, role, required, ownedRoles);
- if (!missing) {
- return true;
- }
- this.data(missing);
- if (reviewEmpty.includes(role) && !has_content_virtual_default(virtualNode, false, true) && !ownedRoles.length && (!virtualNode.hasAttr('aria-owns') || !idrefs_default(node, 'aria-owns').length)) {
- return void 0;
- }
- return false;
- }
- function getOwnedRoles(virtualNode, required) {
- var ownedRoles = [];
- var ownedElements = get_owned_virtual_default(virtualNode);
- var _loop5 = function _loop5(_i22) {
- var ownedElement = ownedElements[_i22];
- if (ownedElement.props.nodeType !== 1) {
- return 'continue';
- }
- var role = get_role_default(ownedElement, {
- noPresentational: true
- });
- var globalAriaAttr = getGlobalAriaAttr(ownedElement);
- var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(ownedElement);
- if (!_isVisibleToScreenReaders(ownedElement) || !role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) {
- return requiredRole === role;
- })) {
- ownedElements.push.apply(ownedElements, _toConsumableArray(ownedElement.children));
- } else if (role || hasGlobalAriaOrFocusable) {
- ownedRoles.push({
- role: role,
- attr: globalAriaAttr || 'tabindex',
- ownedElement: ownedElement
- });
- }
- };
- for (var _i22 = 0; _i22 < ownedElements.length; _i22++) {
- var _ret2 = _loop5(_i22);
- if (_ret2 === 'continue') {
- continue;
- }
- }
- return ownedRoles;
- }
- function missingRequiredChildren(virtualNode, role, required, ownedRoles) {
- var _loop6 = function _loop6(_i23) {
- var role2 = ownedRoles[_i23].role;
- if (required.includes(role2)) {
- required = required.filter(function(requiredRole) {
- return requiredRole !== role2;
- });
- return {
- v: null
- };
- }
- };
- for (var _i23 = 0; _i23 < ownedRoles.length; _i23++) {
- var _ret3 = _loop6(_i23);
- if (_typeof(_ret3) === 'object') {
- return _ret3.v;
- }
- }
- if (required.length) {
- return required;
- }
- return null;
- }
- function getGlobalAriaAttr(vNode) {
- return get_global_aria_attrs_default().find(function(attr) {
- return vNode.hasAttr(attr);
- });
- }
- function getUnallowedSelector(vNode, attr) {
- var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType;
- if (nodeType === 3) {
- return '#text';
- }
- var role = get_explicit_role_default(vNode, {
- dpub: true
- });
- if (role) {
- return '[role='.concat(role, ']');
- }
- if (attr) {
- return nodeName2 + '['.concat(attr, ']');
- }
- return nodeName2;
- }
- function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) {
- var explicitRole2 = get_explicit_role_default(virtualNode);
- if (!reqContext) {
- reqContext = required_context_default(explicitRole2);
- }
- if (!reqContext) {
- return null;
- }
- var allowsGroup = reqContext.includes('group');
- var vNode = includeElement ? virtualNode : virtualNode.parent;
- while (vNode) {
- var role = get_role_default(vNode, {
- noPresentational: true
- });
- if (!role) {
- vNode = vNode.parent;
- } else if (role === 'group' && allowsGroup) {
- if (ownGroupRoles.includes(explicitRole2)) {
- reqContext.push(explicitRole2);
- }
- reqContext = reqContext.filter(function(r) {
- return r !== 'group';
- });
- vNode = vNode.parent;
- } else if (reqContext.includes(role)) {
- return null;
- } else {
- return reqContext;
- }
- }
- return reqContext;
- }
- function getAriaOwners(element) {
- var owners = [], o = null;
- while (element) {
- if (element.getAttribute('id')) {
- var id = escape_selector_default(element.getAttribute('id'));
- var doc = get_root_node_default2(element);
- o = doc.querySelector('[aria-owns~='.concat(id, ']'));
- if (o) {
- owners.push(o);
- }
- }
- element = element.parentElement;
- }
- return owners.length ? owners : null;
- }
- function ariaRequiredParentEvaluate(node, options, virtualNode) {
- var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : [];
- var missingParents = getMissingContext(virtualNode, ownGroupRoles);
- if (!missingParents) {
- return true;
- }
- var owners = getAriaOwners(node);
- if (owners) {
- for (var _i24 = 0, l = owners.length; _i24 < l; _i24++) {
- missingParents = getMissingContext(get_node_from_tree_default(owners[_i24]), ownGroupRoles, missingParents, true);
- if (!missingParents) {
- return true;
- }
- }
- }
- this.data(missingParents);
- return false;
- }
- var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate;
- function ariaRoledescriptionEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
- var role = get_role_default(virtualNode);
- var supportedRoles = options.supportedRoles || [];
- if (supportedRoles.includes(role)) {
- return true;
- }
- if (role && role !== 'presentation' && role !== 'none') {
- return void 0;
- }
- return false;
- }
- var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate;
- function ariaUnsupportedAttrEvaluate(node, options, virtualNode) {
- var unsupportedAttrs = virtualNode.attrNames.filter(function(name) {
- var attribute = standards_default.ariaAttrs[name];
- if (!validate_attr_default(name)) {
- return false;
- }
- var unsupported2 = attribute.unsupported;
- if (_typeof(unsupported2) !== 'object') {
- return !!unsupported2;
- }
- return !matches_default3(node, unsupported2.exceptions);
- });
- if (unsupportedAttrs.length) {
- this.data(unsupportedAttrs);
- return true;
- }
- return false;
- }
- var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate;
- function ariaValidAttrEvaluate(node, options, virtualNode) {
- options = Array.isArray(options.value) ? options.value : [];
- var invalid = [];
- var aria = /^aria-/;
- virtualNode.attrNames.forEach(function(attr) {
- if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) {
- invalid.push(attr);
- }
- });
- if (invalid.length) {
- this.data(invalid);
- return false;
- }
- return true;
- }
- var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate;
- function ariaValidAttrValueEvaluate(node, options, virtualNode) {
- options = Array.isArray(options.value) ? options.value : [];
- var needsReview = '';
- var messageKey = '';
- var invalid = [];
- var aria = /^aria-/;
- var skipAttrs = [ 'aria-errormessage' ];
- var preChecks = {
- 'aria-controls': function ariaControls() {
- return virtualNode.attr('aria-expanded') !== 'false' && virtualNode.attr('aria-selected') !== 'false';
- },
- 'aria-current': function ariaCurrent(validValue) {
- if (!validValue) {
- needsReview = 'aria-current="'.concat(virtualNode.attr('aria-current'), '"');
- messageKey = 'ariaCurrent';
- }
- return;
- },
- 'aria-owns': function ariaOwns() {
- return virtualNode.attr('aria-expanded') !== 'false';
- },
- 'aria-describedby': function ariaDescribedby(validValue) {
- if (!validValue) {
- needsReview = 'aria-describedby="'.concat(virtualNode.attr('aria-describedby'), '"');
- messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
- }
- return;
- },
- 'aria-labelledby': function ariaLabelledby(validValue) {
- if (!validValue) {
- needsReview = 'aria-labelledby="'.concat(virtualNode.attr('aria-labelledby'), '"');
- messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
- }
- }
- };
- virtualNode.attrNames.forEach(function(attrName) {
- if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) {
- return;
- }
- var validValue;
- var attrValue = virtualNode.attr(attrName);
- try {
- validValue = validate_attr_value_default(virtualNode, attrName);
- } catch (e) {
- needsReview = ''.concat(attrName, '="').concat(attrValue, '"');
- messageKey = 'idrefs';
- return;
- }
- if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) {
- if (attrValue === '' && !isStringType(attrName)) {
- needsReview = attrName;
- messageKey = 'empty';
- } else {
- invalid.push(''.concat(attrName, '="').concat(attrValue, '"'));
- }
- }
- });
- if (invalid.length) {
- this.data(invalid);
- return false;
- }
- if (needsReview) {
- this.data({
- messageKey: messageKey,
- needsReview: needsReview
- });
- return void 0;
- }
- return true;
- }
- function isStringType(attrName) {
- var _standards_default$ar;
- return ((_standards_default$ar = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar === void 0 ? void 0 : _standards_default$ar.type) === 'string';
- }
- function deprecatedroleEvaluate(node, options, virtualNode) {
- var role = get_role_default(virtualNode, {
- dpub: true,
- fallback: true
- });
- var roleDefinition = standards_default.ariaRoles[role];
- if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) {
- return false;
- }
- this.data(role);
- return true;
- }
- function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) {
- var hasImplicitRole = implicit_role_default(virtualNode);
- return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation');
- }
- function fallbackroleEvaluate(node, options, virtualNode) {
- var explicitRoles = token_list_default(virtualNode.attr('role'));
- if (explicitRoles.length <= 1) {
- return false;
- }
- return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true;
- }
- var fallbackrole_evaluate_default = fallbackroleEvaluate;
- function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) {
- var globalAttrs = get_global_aria_attrs_default().filter(function(attr) {
- return virtualNode.hasAttr(attr);
- });
- this.data(globalAttrs);
- return globalAttrs.length > 0;
- }
- var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate;
- function hasWidgetRoleEvaluate(node) {
- var role = node.getAttribute('role');
- if (role === null) {
- return false;
- }
- var roleType = get_role_type_default(role);
- return roleType === 'widget' || roleType === 'composite';
- }
- var has_widget_role_evaluate_default = hasWidgetRoleEvaluate;
- function invalidroleEvaluate(node, options, virtualNode) {
- var allRoles = token_list_default(virtualNode.attr('role'));
- var allInvalid = allRoles.every(function(role) {
- return !is_valid_role_default(role, {
- allowAbstract: true
- });
- });
- if (allInvalid) {
- this.data(allRoles);
- return true;
- }
- return false;
- }
- var invalidrole_evaluate_default = invalidroleEvaluate;
- function isElementFocusableEvaluate(node, options, virtualNode) {
- return _isFocusable(virtualNode);
- }
- var is_element_focusable_evaluate_default = isElementFocusableEvaluate;
- function noImplicitExplicitLabelEvaluate(node, options, virtualNode) {
- var role = get_role_default(virtualNode, {
- noImplicit: true
- });
- this.data(role);
- var label3;
- var accText;
- try {
- label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase();
- accText = sanitize_default(accessible_text_virtual_default(virtualNode)).toLowerCase();
- } catch (e) {
- return void 0;
- }
- if (!accText && !label3) {
- return false;
- }
- if (!accText && label3) {
- return void 0;
- }
- if (!accText.includes(label3)) {
- return void 0;
- }
- return false;
- }
- var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate;
- function unsupportedroleEvaluate(node, options, virtualNode) {
- var role = get_role_default(virtualNode, {
- dpub: true,
- fallback: true
- });
- var isUnsupported = is_unsupported_role_default(role);
- if (isUnsupported) {
- this.data(role);
- }
- return isUnsupported;
- }
- var unsupportedrole_evaluate_default = unsupportedroleEvaluate;
- var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
- ARTICLE: true,
- ASIDE: true,
- NAV: true,
- SECTION: true
- };
- var VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
- application: true,
- article: true,
- banner: false,
- complementary: true,
- contentinfo: true,
- form: true,
- main: true,
- navigation: true,
- region: true,
- search: false
- };
- function validScrollableTagName(node) {
- var nodeName2 = node.nodeName.toUpperCase();
- return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false;
- }
- function validScrollableRole(node, options) {
- var role = get_explicit_role_default(node);
- if (!role) {
- return false;
- }
- return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false;
- }
- function validScrollableSemanticsEvaluate(node, options) {
- return validScrollableRole(node, options) || validScrollableTagName(node);
- }
- var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate;
- var color_exports = {};
- __export(color_exports, {
- Color: function Color() {
- return color_default;
- },
- centerPointOfRect: function centerPointOfRect() {
- return center_point_of_rect_default;
- },
- elementHasImage: function elementHasImage() {
- return element_has_image_default;
- },
- elementIsDistinct: function elementIsDistinct() {
- return element_is_distinct_default;
- },
- filteredRectStack: function filteredRectStack() {
- return filtered_rect_stack_default;
- },
- flattenColors: function flattenColors() {
- return flatten_colors_default;
- },
- flattenShadowColors: function flattenShadowColors() {
- return _flattenShadowColors;
- },
- getBackgroundColor: function getBackgroundColor() {
- return _getBackgroundColor2;
- },
- getBackgroundStack: function getBackgroundStack() {
- return _getBackgroundStack;
- },
- getContrast: function getContrast() {
- return get_contrast_default;
- },
- getForegroundColor: function getForegroundColor() {
- return _getForegroundColor;
- },
- getOwnBackgroundColor: function getOwnBackgroundColor() {
- return get_own_background_color_default;
- },
- getRectStack: function getRectStack() {
- return get_rect_stack_default;
- },
- getStackingContext: function getStackingContext() {
- return _getStackingContext;
- },
- getTextShadowColors: function getTextShadowColors() {
- return get_text_shadow_colors_default;
- },
- hasValidContrastRatio: function hasValidContrastRatio() {
- return has_valid_contrast_ratio_default;
- },
- incompleteData: function incompleteData() {
- return incomplete_data_default;
- },
- stackingContextToColor: function stackingContextToColor() {
- return _stackingContextToColor;
- }
- });
- function centerPointOfRect(rect) {
- if (rect.left > window.innerWidth) {
- return void 0;
- }
- if (rect.top > window.innerHeight) {
- return void 0;
- }
- var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1);
- var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1);
- return {
- x: x,
- y: y
- };
- }
- var center_point_of_rect_default = centerPointOfRect;
- function _getFonts(style) {
- return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) {
- return font.trim().toLowerCase();
- });
- }
- function elementIsDistinct(node, ancestorNode) {
- var nodeStyle = window.getComputedStyle(node);
- if (nodeStyle.getPropertyValue('background-image') !== 'none') {
- return true;
- }
- var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) {
- var borderClr = new color_default();
- borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color'));
- return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0;
- }, false);
- if (hasBorder) {
- return true;
- }
- var parentStyle = window.getComputedStyle(ancestorNode);
- if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) {
- return true;
- }
- var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) {
- return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp);
- }, false);
- var tDec = nodeStyle.getPropertyValue('text-decoration');
- if (tDec.split(' ').length < 3) {
- hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration');
- }
- return hasStyle;
- }
- var element_is_distinct_default = elementIsDistinct;
- function getRectStack2(elm) {
- var boundingStack = get_element_stack_default(elm);
- var filteredArr = get_text_element_stack_default(elm);
- if (!filteredArr || filteredArr.length <= 1) {
- return [ boundingStack ];
- }
- if (filteredArr.some(function(stack) {
- return stack === void 0;
- })) {
- return null;
- }
- filteredArr.splice(0, 0, boundingStack);
- return filteredArr;
- }
- var get_rect_stack_default = getRectStack2;
- function filteredRectStack(elm) {
- var rectStack = get_rect_stack_default(elm);
- if (rectStack && rectStack.length === 1) {
- return rectStack[0];
- }
- if (rectStack && rectStack.length > 1) {
- var boundingStack = rectStack.shift();
- var isSame;
- rectStack.forEach(function(rectList, index) {
- if (index === 0) {
- return;
- }
- var rectA = rectStack[index - 1], rectB = rectStack[index];
- isSame = rectA.every(function(element, elementIndex) {
- return element === rectB[elementIndex];
- }) || boundingStack.includes(elm);
- });
- if (!isSame) {
- incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
- return null;
- }
- return rectStack[0];
- }
- incomplete_data_default.set('bgColor', 'outsideViewport');
- return null;
- }
- var filtered_rect_stack_default = filteredRectStack;
- function clamp(value, min, max) {
- return Math.min(Math.max(min, value), max);
- }
- var blendFunctions = {
- normal: function normal(Cb, Cs) {
- return Cs;
- },
- multiply: function multiply(Cb, Cs) {
- return Cs * Cb;
- },
- screen: function screen(Cb, Cs) {
- return Cb + Cs - Cb * Cs;
- },
- overlay: function overlay(Cb, Cs) {
- return this['hard-light'](Cs, Cb);
- },
- darken: function darken(Cb, Cs) {
- return Math.min(Cb, Cs);
- },
- lighten: function lighten(Cb, Cs) {
- return Math.max(Cb, Cs);
- },
- 'color-dodge': function colorDodge(Cb, Cs) {
- return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs));
- },
- 'color-burn': function colorBurn(Cb, Cs) {
- return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs);
- },
- 'hard-light': function hardLight(Cb, Cs) {
- return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1);
- },
- 'soft-light': function softLight(Cb, Cs) {
- if (Cs <= .5) {
- return Cb - (1 - 2 * Cs) * Cb * (1 - Cb);
- } else {
- var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb);
- return Cb + (2 * Cs - 1) * (D - Cb);
- }
- },
- difference: function difference(Cb, Cs) {
- return Math.abs(Cb - Cs);
- },
- exclusion: function exclusion(Cb, Cs) {
- return Cb + Cs - 2 * Cb * Cs;
- }
- };
- function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendMode) {
- return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendFunctions[blendMode](Cb / 255, Cs / 255) * 255 + (1 - \u03b1s) * \u03b1b * Cb;
- }
- function flattenColors(sourceColor, backdrop) {
- var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';
- var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendMode);
- var g = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendMode);
- var b = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendMode);
- var \u03b1o = clamp(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1);
- if (\u03b1o === 0) {
- return new color_default(r, g, b, \u03b1o);
- }
- var Cr = Math.round(r / \u03b1o);
- var Cg = Math.round(g / \u03b1o);
- var Cb = Math.round(b / \u03b1o);
- return new color_default(Cr, Cg, Cb, \u03b1o);
- }
- var flatten_colors_default = flattenColors;
- function _flattenShadowColors(fgColor, bgColor) {
- var alpha = fgColor.alpha;
- var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
- var g = (1 - alpha) * bgColor.green + alpha * fgColor.green;
- var b = (1 - alpha) * bgColor.blue + alpha * fgColor.blue;
- var a = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
- return new color_default(r, g, b, a);
- }
- function _getBackgroundStack(node) {
- var stacks = get_text_element_stack_default(node).map(function(stack) {
- stack = reduce_to_elements_below_floating_default(stack, node);
- stack = sortPageBackground(stack);
- return stack;
- });
- for (var index = 0; index < stacks.length; index++) {
- var stack = stacks[index];
- if (stack[0] !== node) {
- incomplete_data_default.set('bgColor', 'bgOverlap');
- return null;
- }
- if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) {
- incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
- return null;
- }
- }
- return stacks[0] || null;
- }
- function sortPageBackground(elmStack) {
- var bodyIndex = elmStack.indexOf(document.body);
- var bgNodes = elmStack;
- var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement));
- if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) {
- if (bodyIndex > 1) {
- bgNodes.splice(bodyIndex, 1);
- bgNodes.push(document.body);
- }
- var htmlIndex = bgNodes.indexOf(document.documentElement);
- if (htmlIndex > 0) {
- bgNodes.splice(htmlIndex, 1);
- bgNodes.push(document.documentElement);
- }
- }
- return bgNodes;
- }
- function shallowArraysEqual(a, b) {
- if (a === b) {
- return true;
- }
- if (a === null || b === null) {
- return false;
- }
- if (a.length !== b.length) {
- return false;
- }
- for (var i = 0; i < a.length; ++i) {
- if (a[i] !== b[i]) {
- return false;
- }
- }
- return true;
- }
- function getTextShadowColors(node) {
- var _ref79 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref79.minRatio, maxRatio = _ref79.maxRatio;
- var style = window.getComputedStyle(node);
- var textShadow = style.getPropertyValue('text-shadow');
- if (textShadow === 'none') {
- return [];
- }
- var fontSizeStr = style.getPropertyValue('font-size');
- var fontSize = parseInt(fontSizeStr);
- assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr));
- var shadowColors = [];
- var shadows = parseTextShadows(textShadow);
- shadows.forEach(function(_ref80) {
- var colorStr = _ref80.colorStr, pixels = _ref80.pixels;
- colorStr = colorStr || style.getPropertyValue('color');
- var _pixels = _slicedToArray(pixels, 3), offsetY = _pixels[0], offsetX = _pixels[1], _pixels$ = _pixels[2], blurRadius = _pixels$ === void 0 ? 0 : _pixels$;
- if ((!minRatio || blurRadius >= fontSize * minRatio) && (!maxRatio || blurRadius < fontSize * maxRatio)) {
- var color = textShadowColor({
- colorStr: colorStr,
- offsetY: offsetY,
- offsetX: offsetX,
- blurRadius: blurRadius,
- fontSize: fontSize
- });
- shadowColors.push(color);
- }
- });
- return shadowColors;
- }
- function parseTextShadows(textShadow) {
- var current = {
- pixels: []
- };
- var str = textShadow.trim();
- var shadows = [ current ];
- if (!str) {
- return [];
- }
- while (str) {
- var colorMatch = str.match(/^rgba?\([0-9,.\s]+\)/i) || str.match(/^[a-z]+/i) || str.match(/^#[0-9a-f]+/i);
- var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/);
- if (colorMatch) {
- assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow));
- str = str.replace(colorMatch[0], '').trim();
- current.colorStr = colorMatch[0];
- } else if (pixelMatch) {
- assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow));
- str = str.replace(pixelMatch[0], '').trim();
- var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]);
- current.pixels.push(pixelUnit);
- } else if (str[0] === ',') {
- assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow));
- current = {
- pixels: []
- };
- shadows.push(current);
- str = str.substr(1).trim();
- } else {
- throw new Error('Unable to process text-shadows: '.concat(textShadow));
- }
- }
- return shadows;
- }
- function textShadowColor(_ref81) {
- var colorStr = _ref81.colorStr, offsetX = _ref81.offsetX, offsetY = _ref81.offsetY, blurRadius = _ref81.blurRadius, fontSize = _ref81.fontSize;
- if (offsetX > blurRadius || offsetY > blurRadius) {
- return new color_default(0, 0, 0, 0);
- }
- var shadowColor = new color_default();
- shadowColor.parseString(colorStr);
- shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize);
- return shadowColor;
- }
- function blurRadiusToAlpha(blurRadius, fontSize) {
- if (blurRadius === 0) {
- return 1;
- }
- var relativeBlur = blurRadius / fontSize;
- return .185 / (relativeBlur + .4);
- }
- var get_text_shadow_colors_default = getTextShadowColors;
- function _getStackingContext(elm, elmStack) {
- var _elmStack;
- var vNode = get_node_from_tree_default(elm);
- if (vNode._stackingContext) {
- return vNode._stackingContext;
- }
- var stackingContext = [];
- var contextMap = new Map();
- elmStack = (_elmStack = elmStack) !== null && _elmStack !== void 0 ? _elmStack : _getBackgroundStack(elm);
- elmStack.forEach(function(bgElm) {
- var _stackingOrder2;
- var bgVNode = get_node_from_tree_default(bgElm);
- var bgColor = getOwnBackgroundColor2(bgVNode);
- var stackingOrder = bgVNode._stackingOrder.filter(function(_ref82) {
- var vNode2 = _ref82.vNode;
- return !!vNode2;
- });
- stackingOrder.forEach(function(_ref83, index) {
- var _stackingOrder;
- var vNode2 = _ref83.vNode;
- var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode;
- var context2 = addToStackingContext(contextMap, vNode2, ancestorVNode2);
- if (index === 0 && !contextMap.get(vNode2)) {
- stackingContext.unshift(context2);
- }
- contextMap.set(vNode2, context2);
- });
- var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode;
- var context = addToStackingContext(contextMap, bgVNode, ancestorVNode);
- if (!stackingOrder.length) {
- stackingContext.unshift(context);
- }
- context.bgColor = bgColor;
- });
- vNode._stackingContext = stackingContext;
- return stackingContext;
- }
- function _stackingContextToColor(context) {
- var _context$descendants;
- if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) {
- var color2 = context.bgColor;
- color2.alpha *= context.opacity;
- return {
- color: color2,
- blendMode: context.blendMode
- };
- }
- var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext());
- var color = flatten_colors_default(sourceColor, context.bgColor, context.descendants[0].blendMode);
- color.alpha *= context.opacity;
- return {
- color: color,
- blendMode: context.blendMode
- };
- }
- function reduceToColor(backdropContext, sourceContext) {
- var backdrop;
- if (backdropContext instanceof color_default) {
- backdrop = backdropContext;
- } else {
- backdrop = _stackingContextToColor(backdropContext).color;
- }
- var sourceColor = _stackingContextToColor(sourceContext).color;
- return flatten_colors_default(sourceColor, backdrop, sourceContext.blendMode);
- }
- function createStackingContext(vNode, ancestorContext) {
- var _vNode$getComputedSty;
- return {
- vNode: vNode,
- ancestor: ancestorContext,
- opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1),
- bgColor: new color_default(0, 0, 0, 0),
- blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')),
- descendants: []
- };
- }
- function normalizeBlendMode(blendmode) {
- return !!blendmode ? blendmode : void 0;
- }
- function addToStackingContext(contextMap, vNode, ancestorVNode) {
- var _contextMap$get;
- var ancestorContext = contextMap.get(ancestorVNode);
- var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext(vNode, ancestorContext);
- if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) {
- ancestorContext.descendants.unshift(context);
- }
- return context;
- }
- function getOwnBackgroundColor2(vNode) {
- var bgColor = new color_default();
- bgColor.parseString(vNode.getComputedStylePropertyValue('background-color'));
- return bgColor;
- }
- function _getBackgroundColor2(elm) {
- var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1;
- var vNode = get_node_from_tree_default(elm);
- var bgColorCache = vNode._cache.getBackgroundColor;
- if (bgColorCache) {
- bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms));
- incomplete_data_default.set('bgColor', bgColorCache.incompleteData);
- return bgColorCache.bgColor;
- }
- var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax);
- vNode._cache.getBackgroundColor = {
- bgColor: bgColor,
- bgElms: bgElms,
- incompleteData: incomplete_data_default.get('bgColor')
- };
- return bgColor;
- }
- function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) {
- var _bgColors;
- var elmStack = _getBackgroundStack(elm);
- if (!elmStack) {
- return null;
- }
- var textRects = get_visible_child_text_rects_default(elm);
- var bgColors = get_text_shadow_colors_default(elm, {
- minRatio: shadowOutlineEmMax
- });
- if (bgColors.length) {
- bgColors = [ {
- color: bgColors.reduce(_flattenShadowColors)
- } ];
- }
- for (var _i25 = 0; _i25 < elmStack.length; _i25++) {
- var bgElm = elmStack[_i25];
- var bgElmStyle = window.getComputedStyle(bgElm);
- if (element_has_image_default(bgElm, bgElmStyle)) {
- bgElms.push(bgElm);
- return null;
- }
- var bgColor = get_own_background_color_default(bgElmStyle);
- if (bgColor.alpha === 0) {
- continue;
- }
- if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) {
- bgElms.push(bgElm);
- incomplete_data_default.set('bgColor', 'elmPartiallyObscured');
- return null;
- }
- bgElms.push(bgElm);
- if (bgColor.alpha === 1) {
- break;
- }
- }
- var stackingContext = _getStackingContext(elm, elmStack);
- bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors);
- var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body));
- (_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs));
- if (bgColors.length === 0) {
- return new color_default(255, 255, 255, 1);
- }
- var blendedColor = bgColors.reduce(function(bgColor, fgColor) {
- return flatten_colors_default(fgColor.color, bgColor.color instanceof color_default ? bgColor.color : bgColor, fgColor.blendMode);
- });
- return flatten_colors_default(blendedColor.color instanceof color_default ? blendedColor.color : blendedColor, new color_default(255, 255, 255, 1));
- }
- function fullyEncompasses(node, rects) {
- rects = Array.isArray(rects) ? rects : [ rects ];
- var nodeRect = node.getBoundingClientRect();
- var right = nodeRect.right, bottom = nodeRect.bottom;
- var style = window.getComputedStyle(node);
- var overflow = style.getPropertyValue('overflow');
- if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) {
- right = nodeRect.left + node.scrollWidth;
- bottom = nodeRect.top + node.scrollHeight;
- }
- return rects.every(function(rect) {
- return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right;
- });
- }
- function normalizeBlendMode2(blendmode) {
- return !!blendmode ? blendmode : void 0;
- }
- function getPageBackgroundColors(elm, stackContainsBody) {
- var pageColors = [];
- if (!stackContainsBody) {
- var html = document.documentElement;
- var body = document.body;
- var htmlStyle = window.getComputedStyle(html);
- var bodyStyle = window.getComputedStyle(body);
- var htmlBgColor = get_own_background_color_default(htmlStyle);
- var bodyBgColor = get_own_background_color_default(bodyStyle);
- var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect());
- if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) {
- pageColors.unshift({
- color: bodyBgColor,
- blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode'))
- });
- }
- if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) {
- pageColors.unshift({
- color: htmlBgColor,
- blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode'))
- });
- }
- }
- return pageColors;
- }
- function getContrast(bgColor, fgColor) {
- if (!fgColor || !bgColor) {
- return null;
- }
- if (fgColor.alpha < 1) {
- fgColor = flatten_colors_default(fgColor, bgColor);
- }
- var bL = bgColor.getRelativeLuminance();
- var fL = fgColor.getRelativeLuminance();
- return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05);
- }
- var get_contrast_default = getContrast;
- function _getForegroundColor(node, _, bgColor) {
- var _bgColor;
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var nodeStyle = window.getComputedStyle(node);
- var colorStack = [ function() {
- return getStrokeColor(nodeStyle, options);
- }, function() {
- return getTextColor(nodeStyle);
- }, function() {
- return get_text_shadow_colors_default(node, {
- minRatio: 0
- });
- } ];
- var fgColors = [];
- for (var _i26 = 0, _colorStack = colorStack; _i26 < _colorStack.length; _i26++) {
- var colorFn = _colorStack[_i26];
- var color = colorFn();
- if (!color) {
- continue;
- }
- fgColors = fgColors.concat(color);
- if (color.alpha === 1) {
- break;
- }
- }
- var fgColor = fgColors.reduce(function(source, backdrop) {
- return flatten_colors_default(source, backdrop);
- });
- (_bgColor = bgColor) !== null && _bgColor !== void 0 ? _bgColor : bgColor = _getBackgroundColor2(node, []);
- if (bgColor === null) {
- var reason = incomplete_data_default.get('bgColor');
- incomplete_data_default.set('fgColor', reason);
- return null;
- }
- var stackingContexts = _getStackingContext(node);
- var context = findNodeInContexts(stackingContexts, node);
- return flatten_colors_default(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default(255, 255, 255, 1));
- }
- function getTextColor(nodeStyle) {
- return new color_default().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color'));
- }
- function getStrokeColor(nodeStyle, _ref84) {
- var _ref84$textStrokeEmMi = _ref84.textStrokeEmMin, textStrokeEmMin = _ref84$textStrokeEmMi === void 0 ? 0 : _ref84$textStrokeEmMi;
- var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width'));
- if (strokeWidth === 0) {
- return null;
- }
- var fontSize = nodeStyle.getPropertyValue('font-size');
- var relativeStrokeWidth = strokeWidth / parseFloat(fontSize);
- if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) {
- return null;
- }
- var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color');
- return new color_default().parseString(strokeColor);
- }
- function calculateBlendedForegroundColor(fgColor, context, stackingContexts) {
- while (context) {
- var _context$ancestor;
- if (context.opacity === 1 && context.ancestor) {
- context = context.ancestor;
- continue;
- }
- fgColor.alpha *= context.opacity;
- var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts;
- if (context.opacity !== 1) {
- stack = stack.slice(0, stack.indexOf(context));
- }
- var bgColors = stack.map(_stackingContextToColor);
- if (!bgColors.length) {
- context = context.ancestor;
- continue;
- }
- var bgColor = bgColors.reduce(function(backdrop, source) {
- return flatten_colors_default(source.color, backdrop.color instanceof color_default ? backdrop.color : backdrop);
- }, {
- color: new color_default(0, 0, 0, 0),
- blendMode: 'normal'
- });
- fgColor = flatten_colors_default(fgColor, bgColor);
- context = context.ancestor;
- }
- return fgColor;
- }
- function findNodeInContexts(contexts, node) {
- var _iterator8 = _createForOfIteratorHelper(contexts), _step8;
- try {
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) {
- var _context$vNode;
- var context = _step8.value;
- if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
- return context;
- }
- var found = findNodeInContexts(context.descendants, node);
- if (found) {
- return found;
- }
- }
- } catch (err) {
- _iterator8.e(err);
- } finally {
- _iterator8.f();
- }
- }
- function hasValidContrastRatio(bg, fg, fontSize, isBold) {
- var contrast = get_contrast_default(bg, fg);
- var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18;
- var expectedContrastRatio = isSmallFont ? 4.5 : 3;
- return {
- isValid: contrast > expectedContrastRatio,
- contrastRatio: contrast,
- expectedContrastRatio: expectedContrastRatio
- };
- }
- var has_valid_contrast_ratio_default = hasValidContrastRatio;
- function colorContrastEvaluate(node, options, virtualNode) {
- 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;
- if (!_isVisibleOnScreen(node)) {
- this.data({
- messageKey: 'hidden'
- });
- return true;
- }
- var visibleText = visible_virtual_default(virtualNode, false, true);
- if (ignoreUnicode && textIsEmojis(visibleText)) {
- this.data({
- messageKey: 'nonBmp'
- });
- return void 0;
- }
- var nodeStyle = window.getComputedStyle(node);
- var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size'));
- var fontWeight = nodeStyle.getPropertyValue('font-weight');
- var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold';
- var ptSize = Math.ceil(fontSize * 72) / 96;
- var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt;
- var _ref85 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref85.expected, minThreshold = _ref85.minThreshold, maxThreshold = _ref85.maxThreshold;
- var pseudoElm = findPseudoElement(virtualNode, {
- ignorePseudo: ignorePseudo,
- pseudoSizeThreshold: pseudoSizeThreshold
- });
- if (pseudoElm) {
- this.data({
- fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
- fontWeight: bold ? 'bold' : 'normal',
- messageKey: 'pseudoContent',
- expectedContrastRatio: expected + ':1'
- });
- this.relatedNodes(pseudoElm.actualNode);
- return void 0;
- }
- var bgNodes = [];
- var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax);
- var fgColor = _getForegroundColor(node, false, bgColor, options);
- var shadowColors = get_text_shadow_colors_default(node, {
- minRatio: .001,
- maxRatio: shadowOutlineEmMax
- });
- var contrast = null;
- var contrastContributor = null;
- var shadowColor = null;
- if (shadowColors.length === 0) {
- contrast = get_contrast_default(bgColor, fgColor);
- } else if (fgColor && bgColor) {
- shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors);
- var fgBgContrast = get_contrast_default(bgColor, fgColor);
- var bgShContrast = get_contrast_default(bgColor, shadowColor);
- var fgShContrast = get_contrast_default(shadowColor, fgColor);
- contrast = Math.max(fgBgContrast, bgShContrast, fgShContrast);
- if (contrast !== fgBgContrast) {
- contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor';
- }
- }
- var isValid = contrast > expected;
- if (typeof minThreshold === 'number' && (typeof contrast !== 'number' || contrast < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast !== 'number' || contrast > maxThreshold)) {
- this.data({
- contrastRatio: contrast
- });
- return true;
- }
- var truncatedResult = Math.floor(contrast * 100) / 100;
- var missing;
- if (bgColor === null) {
- missing = incomplete_data_default.get('bgColor');
- } else if (!isValid) {
- missing = contrastContributor;
- }
- var equalRatio = truncatedResult === 1;
- var shortTextContent = visibleText.length === 1;
- if (equalRatio) {
- missing = incomplete_data_default.set('bgColor', 'equalRatio');
- } else if (!isValid && shortTextContent && !ignoreLength) {
- missing = 'shortTextContent';
- }
- this.data({
- fgColor: fgColor ? fgColor.toHexString() : void 0,
- bgColor: bgColor ? bgColor.toHexString() : void 0,
- contrastRatio: truncatedResult,
- fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
- fontWeight: bold ? 'bold' : 'normal',
- messageKey: missing,
- expectedContrastRatio: expected + ':1',
- shadowColor: shadowColor ? shadowColor.toHexString() : void 0
- });
- if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) {
- missing = null;
- incomplete_data_default.clear();
- this.relatedNodes(bgNodes);
- return void 0;
- }
- if (!isValid) {
- this.relatedNodes(bgNodes);
- }
- return isValid;
- }
- function findPseudoElement(vNode, _ref86) {
- var _ref86$pseudoSizeThre = _ref86.pseudoSizeThreshold, pseudoSizeThreshold = _ref86$pseudoSizeThre === void 0 ? .25 : _ref86$pseudoSizeThre, _ref86$ignorePseudo = _ref86.ignorePseudo, ignorePseudo = _ref86$ignorePseudo === void 0 ? false : _ref86$ignorePseudo;
- if (ignorePseudo) {
- return;
- }
- var rect = vNode.boundingClientRect;
- var minimumSize = rect.width * rect.height * pseudoSizeThreshold;
- do {
- var beforeSize = getPseudoElementArea(vNode.actualNode, ':before');
- var afterSize = getPseudoElementArea(vNode.actualNode, ':after');
- if (beforeSize + afterSize > minimumSize) {
- return vNode;
- }
- } while (vNode = vNode.parent);
- }
- var getPseudoElementArea = memoize_default(function getPseudoElementArea2(node, pseudo) {
- var style = window.getComputedStyle(node, pseudo);
- var matchPseudoStyle = function matchPseudoStyle(prop, value) {
- return style.getPropertyValue(prop) === value;
- };
- if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) {
- return 0;
- }
- if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) {
- return 0;
- }
- var pseudoWidth = parseUnit(style.getPropertyValue('width'));
- var pseudoHeight = parseUnit(style.getPropertyValue('height'));
- if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') {
- return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity;
- }
- return pseudoWidth.value * pseudoHeight.value;
- });
- function textIsEmojis(visibleText) {
- var options = {
- nonBmp: true
- };
- var hasUnicodeChars = has_unicode_default(visibleText, options);
- var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === '';
- return hasUnicodeChars && hasNonUnicodeChars;
- }
- function parseUnit(str) {
- var unitRegex = /^([0-9.]+)([a-z]+)$/i;
- var _ref87 = str.match(unitRegex) || [], _ref88 = _slicedToArray(_ref87, 3), _ref88$ = _ref88[1], value = _ref88$ === void 0 ? '' : _ref88$, _ref88$2 = _ref88[2], unit = _ref88$2 === void 0 ? '' : _ref88$2;
- return {
- value: parseFloat(value),
- unit: unit.toLowerCase()
- };
- }
- function getContrast2(color1, color2) {
- var c1lum = color1.getRelativeLuminance();
- var c2lum = color2.getRelativeLuminance();
- return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05);
- }
- var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
- function isBlock2(elm) {
- var display = window.getComputedStyle(elm).getPropertyValue('display');
- return blockLike2.indexOf(display) !== -1 || display.substr(0, 6) === 'table-';
- }
- function linkInTextBlockEvaluate(node, options) {
- var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor;
- if (isBlock2(node)) {
- return false;
- }
- var parentBlock = get_composed_parent_default(node);
- while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) {
- parentBlock = get_composed_parent_default(parentBlock);
- }
- if (!parentBlock) {
- return void 0;
- }
- this.relatedNodes([ parentBlock ]);
- var nodeColor = _getForegroundColor(node);
- var parentColor = _getForegroundColor(parentBlock);
- var nodeBackgroundColor = _getBackgroundColor2(node);
- var parentBackgroundColor = _getBackgroundColor2(parentBlock);
- var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0;
- if (textContrast) {
- textContrast = Math.floor(textContrast * 100) / 100;
- }
- if (textContrast && textContrast >= requiredContrastRatio) {
- return true;
- }
- var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0;
- if (backgroundContrast) {
- backgroundContrast = Math.floor(backgroundContrast * 100) / 100;
- }
- if (backgroundContrast && backgroundContrast >= requiredContrastRatio) {
- return true;
- }
- if (!backgroundContrast) {
- var _incomplete_data_defa;
- var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast';
- this.data({
- messageKey: reason
- });
- incomplete_data_default.clear();
- return void 0;
- }
- if (!textContrast) {
- return void 0;
- }
- if (allowSameColor && textContrast === 1 && backgroundContrast === 1) {
- return true;
- }
- if (textContrast === 1 && backgroundContrast > 1) {
- this.data({
- messageKey: 'bgContrast',
- contrastRatio: backgroundContrast,
- requiredContrastRatio: requiredContrastRatio,
- nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0,
- parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0
- });
- return false;
- }
- this.data({
- messageKey: 'fgContrast',
- contrastRatio: textContrast,
- requiredContrastRatio: requiredContrastRatio,
- nodeColor: nodeColor ? nodeColor.toHexString() : void 0,
- parentColor: parentColor ? parentColor.toHexString() : void 0
- });
- return false;
- }
- var link_in_text_block_evaluate_default = linkInTextBlockEvaluate;
- var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
- function isBlock3(elm) {
- var display = window.getComputedStyle(elm).getPropertyValue('display');
- return blockLike3.indexOf(display) !== -1 || display.substr(0, 6) === 'table-';
- }
- function linkInTextBlockStyleEvaluate(node) {
- if (isBlock3(node)) {
- return false;
- }
- var parentBlock = get_composed_parent_default(node);
- while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) {
- parentBlock = get_composed_parent_default(parentBlock);
- }
- if (!parentBlock) {
- return void 0;
- }
- this.relatedNodes([ parentBlock ]);
- return element_is_distinct_default(node, parentBlock);
- }
- var link_in_text_block_style_evaluate_default = linkInTextBlockStyleEvaluate;
- function autocompleteAppropriateEvaluate(node, options, virtualNode) {
- if (virtualNode.props.nodeName !== 'input') {
- return true;
- }
- var number = [ 'text', 'search', 'number', 'tel' ];
- var url = [ 'text', 'search', 'url' ];
- var allowedTypesMap = {
- bday: [ 'text', 'search', 'date' ],
- email: [ 'text', 'search', 'email' ],
- username: [ 'text', 'search', 'email' ],
- 'street-address': [ 'text' ],
- tel: [ 'text', 'search', 'tel' ],
- 'tel-country-code': [ 'text', 'search', 'tel' ],
- 'tel-national': [ 'text', 'search', 'tel' ],
- 'tel-area-code': [ 'text', 'search', 'tel' ],
- 'tel-local': [ 'text', 'search', 'tel' ],
- 'tel-local-prefix': [ 'text', 'search', 'tel' ],
- 'tel-local-suffix': [ 'text', 'search', 'tel' ],
- 'tel-extension': [ 'text', 'search', 'tel' ],
- 'cc-number': number,
- 'cc-exp': [ 'text', 'search', 'month', 'tel' ],
- 'cc-exp-month': number,
- 'cc-exp-year': number,
- 'cc-csc': number,
- 'transaction-amount': number,
- 'bday-day': number,
- 'bday-month': number,
- 'bday-year': number,
- 'new-password': [ 'text', 'search', 'password' ],
- 'current-password': [ 'text', 'search', 'password' ],
- url: url,
- photo: url,
- impp: url
- };
- if (_typeof(options) === 'object') {
- Object.keys(options).forEach(function(key) {
- if (!allowedTypesMap[key]) {
- allowedTypesMap[key] = [];
- }
- allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]);
- });
- }
- var autocompleteAttr = virtualNode.attr('autocomplete');
- var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) {
- return term.toLowerCase();
- });
- var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
- if (_autocomplete.stateTerms.includes(purposeTerm)) {
- return true;
- }
- var allowedTypes = allowedTypesMap[purposeTerm];
- var type = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text';
- type = valid_input_type_default().includes(type) ? type : 'text';
- if (typeof allowedTypes === 'undefined') {
- return type === 'text';
- }
- return allowedTypes.includes(type);
- }
- var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate;
- function autocompleteValidEvaluate(node, options, virtualNode) {
- var autocomplete2 = virtualNode.attr('autocomplete') || '';
- return is_valid_autocomplete_default(autocomplete2, options);
- }
- var autocomplete_valid_evaluate_default = autocompleteValidEvaluate;
- function attrNonSpaceContentEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var vNode = arguments.length > 2 ? arguments[2] : undefined;
- if (!options.attribute || typeof options.attribute !== 'string') {
- throw new TypeError('attr-non-space-content requires options.attribute to be a string');
- }
- if (!vNode.hasAttr(options.attribute)) {
- this.data({
- messageKey: 'noAttr'
- });
- return false;
- }
- var attribute = vNode.attr(options.attribute);
- var attributeIsEmpty = !sanitize_default(attribute);
- if (attributeIsEmpty) {
- this.data({
- messageKey: 'emptyAttr'
- });
- return false;
- }
- return true;
- }
- var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate;
- function pageHasElmAfter(results) {
- var elmUsedAnywhere = results.some(function(frameResult) {
- return frameResult.result === true;
- });
- if (elmUsedAnywhere) {
- results.forEach(function(result) {
- result.result = true;
- });
- }
- return results;
- }
- var has_descendant_after_default = pageHasElmAfter;
- function hasDescendant(node, options, virtualNode) {
- if (!options || !options.selector || typeof options.selector !== 'string') {
- throw new TypeError('has-descendant requires options.selector to be a string');
- }
- if (options.passForModal && is_modal_open_default()) {
- return true;
- }
- var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) {
- return _isVisibleToScreenReaders(vNode);
- });
- this.relatedNodes(matchingElms.map(function(vNode) {
- return vNode.actualNode;
- }));
- return matchingElms.length > 0;
- }
- var has_descendant_evaluate_default = hasDescendant;
- function hasTextContentEvaluate(node, options, virtualNode) {
- try {
- return sanitize_default(subtree_text_default(virtualNode)) !== '';
- } catch (e) {
- return void 0;
- }
- }
- function matchesDefinitionEvaluate(_, options, virtualNode) {
- return matches_default3(virtualNode, options.matcher);
- }
- var matches_definition_evaluate_default = matchesDefinitionEvaluate;
- function pageNoDuplicateAfter(results) {
- return results.filter(function(checkResult) {
- return checkResult.data !== 'ignored';
- });
- }
- var page_no_duplicate_after_default = pageNoDuplicateAfter;
- function pageNoDuplicateEvaluate(node, options, virtualNode) {
- if (!options || !options.selector || typeof options.selector !== 'string') {
- throw new TypeError('page-no-duplicate requires options.selector to be a string');
- }
- var key = 'page-no-duplicate;' + options.selector;
- if (cache_default.get(key)) {
- this.data('ignored');
- return;
- }
- cache_default.set(key, true);
- var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) {
- return _isVisibleToScreenReaders(elm);
- });
- if (typeof options.nativeScopeFilter === 'string') {
- elms = elms.filter(function(elm) {
- return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter);
- });
- }
- this.relatedNodes(elms.filter(function(elm) {
- return elm !== virtualNode;
- }).map(function(elm) {
- return elm.actualNode;
- }));
- return elms.length <= 1;
- }
- var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate;
- function accesskeysAfter(results) {
- var seen = {};
- return results.filter(function(r) {
- if (!r.data) {
- return false;
- }
- var key = r.data.toUpperCase();
- if (!seen[key]) {
- seen[key] = r;
- r.relatedNodes = [];
- return true;
- }
- seen[key].relatedNodes.push(r.relatedNodes[0]);
- return false;
- }).map(function(r) {
- r.result = !!r.relatedNodes.length;
- return r;
- });
- }
- var accesskeys_after_default = accesskeysAfter;
- function accesskeysEvaluate(node, options, vNode) {
- if (!_isHiddenForEveryone(vNode)) {
- this.data(vNode.attr('accesskey'));
- this.relatedNodes([ node ]);
- }
- return true;
- }
- var accesskeys_evaluate_default = accesskeysEvaluate;
- function focusableContentEvaluate(node, options, virtualNode) {
- var tabbableElements = virtualNode.tabbableElements;
- if (!tabbableElements) {
- return false;
- }
- var tabbableContentElements = tabbableElements.filter(function(el) {
- return el !== virtualNode;
- });
- return tabbableContentElements.length > 0;
- }
- var focusable_content_evaluate_default = focusableContentEvaluate;
- function focusableDisabledEvaluate(node, options, virtualNode) {
- var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
- var tabbableElements = virtualNode.tabbableElements;
- if (!tabbableElements || !tabbableElements.length) {
- return true;
- }
- var relatedNodes = tabbableElements.filter(function(vNode) {
- return elementsThatCanBeDisabled.includes(vNode.props.nodeName);
- });
- this.relatedNodes(relatedNodes.map(function(vNode) {
- return vNode.actualNode;
- }));
- if (relatedNodes.length === 0 || is_modal_open_default()) {
- return true;
- }
- return relatedNodes.every(function(vNode) {
- var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
- var width = parseInt(vNode.getComputedStylePropertyValue('width'));
- var height = parseInt(vNode.getComputedStylePropertyValue('height'));
- return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
- }) ? void 0 : false;
- }
- var focusable_disabled_evaluate_default = focusableDisabledEvaluate;
- function focusableElementEvaluate(node, options, virtualNode) {
- if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) {
- return true;
- }
- return _isInTabOrder(virtualNode);
- function isContenteditable(vNode) {
- var contenteditable = vNode.attr('contenteditable');
- if (contenteditable === 'true' || contenteditable === '') {
- return true;
- }
- if (contenteditable === 'false') {
- return false;
- }
- var ancestor = closest_default(virtualNode.parent, '[contenteditable]');
- if (!ancestor) {
- return false;
- }
- return isContenteditable(ancestor);
- }
- }
- var focusable_element_evaluate_default = focusableElementEvaluate;
- function focusableModalOpenEvaluate(node, options, virtualNode) {
- var tabbableElements = virtualNode.tabbableElements.map(function(_ref89) {
- var actualNode = _ref89.actualNode;
- return actualNode;
- });
- if (!tabbableElements || !tabbableElements.length) {
- return true;
- }
- if (is_modal_open_default()) {
- this.relatedNodes(tabbableElements);
- return void 0;
- }
- return true;
- }
- var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate;
- function focusableNoNameEvaluate(node, options, virtualNode) {
- var tabIndex = virtualNode.attr('tabindex');
- var inFocusOrder = _isFocusable(virtualNode) && tabIndex > -1;
- if (!inFocusOrder) {
- return false;
- }
- try {
- return !accessible_text_virtual_default(virtualNode);
- } catch (e) {
- return void 0;
- }
- }
- var focusable_no_name_evaluate_default = focusableNoNameEvaluate;
- function focusableNotTabbableEvaluate(node, options, virtualNode) {
- var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
- var tabbableElements = virtualNode.tabbableElements;
- if (!tabbableElements || !tabbableElements.length) {
- return true;
- }
- var relatedNodes = tabbableElements.filter(function(vNode) {
- return !elementsThatCanBeDisabled.includes(vNode.props.nodeName);
- });
- this.relatedNodes(relatedNodes.map(function(vNode) {
- return vNode.actualNode;
- }));
- if (relatedNodes.length === 0 || is_modal_open_default()) {
- return true;
- }
- return relatedNodes.every(function(vNode) {
- var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
- var width = parseInt(vNode.getComputedStylePropertyValue('width'));
- var height = parseInt(vNode.getComputedStylePropertyValue('height'));
- return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
- }) ? void 0 : false;
- }
- var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
- function frameFocusableContentEvaluate(node, options, virtualNode) {
- if (!virtualNode.children) {
- return void 0;
- }
- try {
- return !virtualNode.children.some(function(child) {
- return focusableDescendants(child);
- });
- } catch (e) {
- return void 0;
- }
- }
- function focusableDescendants(vNode) {
- if (_isInTabOrder(vNode)) {
- return true;
- }
- if (!vNode.children) {
- if (vNode.props.nodeType === 1) {
- throw new Error('Cannot determine children');
- }
- return false;
- }
- return vNode.children.some(function(child) {
- return focusableDescendants(child);
- });
- }
- function landmarkIsTopLevelEvaluate(node) {
- var landmarks = get_aria_roles_by_type_default('landmark');
- var parent = get_composed_parent_default(node);
- var nodeRole = get_role_default(node);
- this.data({
- role: nodeRole
- });
- while (parent) {
- var role = parent.getAttribute('role');
- if (!role && parent.nodeName.toUpperCase() !== 'FORM') {
- role = implicit_role_default(parent);
- }
- if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) {
- return false;
- }
- parent = get_composed_parent_default(parent);
- }
- return true;
- }
- var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate;
- function noFocusableContentEvaluate(node, options, virtualNode) {
- if (!virtualNode.children) {
- return void 0;
- }
- try {
- var focusableDescendants2 = getFocusableDescendants(virtualNode);
- if (!focusableDescendants2.length) {
- return true;
- }
- var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy);
- if (notHiddenElements.length > 0) {
- this.data({
- messageKey: 'notHidden'
- });
- this.relatedNodes(notHiddenElements);
- } else {
- this.relatedNodes(focusableDescendants2);
- }
- return false;
- } catch (e) {
- return void 0;
- }
- }
- function getFocusableDescendants(vNode) {
- if (!vNode.children) {
- if (vNode.props.nodeType === 1) {
- throw new Error('Cannot determine children');
- }
- return [];
- }
- var retVal = [];
- vNode.children.forEach(function(child) {
- if (get_role_type_default(child) === 'widget' && _isFocusable(child)) {
- retVal.push(child);
- } else {
- retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child)));
- }
- });
- return retVal;
- }
- function usesUnreliableHidingStrategy(vNode) {
- var tabIndex = parseInt(vNode.attr('tabindex'), 10);
- return !isNaN(tabIndex) && tabIndex < 0;
- }
- function tabindexEvaluate(node, options, virtualNode) {
- var tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
- return isNaN(tabIndex) ? true : tabIndex <= 0;
- }
- var tabindex_evaluate_default = tabindexEvaluate;
- function altSpaceValueEvaluate(node, options, virtualNode) {
- var alt = virtualNode.attr('alt');
- var isOnlySpace = /^\s+$/;
- return typeof alt === 'string' && isOnlySpace.test(alt);
- }
- var alt_space_value_evaluate_default = altSpaceValueEvaluate;
- function duplicateImgLabelEvaluate(node, options, virtualNode) {
- if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) {
- return false;
- }
- var parentVNode = closest_default(virtualNode, options.parentSelector);
- if (!parentVNode) {
- return false;
- }
- var visibleText = visible_virtual_default(parentVNode, true).toLowerCase();
- if (visibleText === '') {
- return false;
- }
- return visibleText === accessible_text_virtual_default(virtualNode).toLowerCase();
- }
- var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate;
- function explicitEvaluate(node, options, virtualNode) {
- var _this4 = this;
- if (!virtualNode.attr('id')) {
- return false;
- }
- if (!virtualNode.actualNode) {
- return void 0;
- }
- var root = get_root_node_default2(virtualNode.actualNode);
- var id = escape_selector_default(virtualNode.attr('id'));
- var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
- this.relatedNodes(labels);
- if (!labels.length) {
- return false;
- }
- try {
- return labels.some(function(label3) {
- if (!_isVisibleOnScreen(label3)) {
- return true;
- } else {
- var explicitLabel = sanitize_default(accessible_text_default(label3, {
- inControlContext: true,
- startNode: virtualNode
- }));
- _this4.data({
- explicitLabel: explicitLabel
- });
- return !!explicitLabel;
- }
- });
- } catch (e) {
- return void 0;
- }
- }
- var explicit_evaluate_default = explicitEvaluate;
- function helpSameAsLabelEvaluate(node, options, virtualNode) {
- var labelText2 = label_virtual_default2(virtualNode), check = node.getAttribute('title');
- if (!labelText2) {
- return false;
- }
- if (!check) {
- check = '';
- if (node.getAttribute('aria-describedby')) {
- var ref = idrefs_default(node, 'aria-describedby');
- check = ref.map(function(thing) {
- return thing ? accessible_text_default(thing) : '';
- }).join('');
- }
- }
- return sanitize_default(check) === sanitize_default(labelText2);
- }
- var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate;
- function hiddenExplicitLabelEvaluate(node, options, virtualNode) {
- if (virtualNode.hasAttr('id')) {
- if (!virtualNode.actualNode) {
- return void 0;
- }
- var root = get_root_node_default2(node);
- var id = escape_selector_default(node.getAttribute('id'));
- var label3 = root.querySelector('label[for="'.concat(id, '"]'));
- if (label3 && !_isVisibleToScreenReaders(label3)) {
- var name;
- try {
- name = accessible_text_virtual_default(virtualNode).trim();
- } catch (e) {
- return void 0;
- }
- var isNameEmpty = name === '';
- return isNameEmpty;
- }
- }
- return false;
- }
- var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate;
- function implicitEvaluate(node, options, virtualNode) {
- try {
- var label3 = closest_default(virtualNode, 'label');
- if (label3) {
- var implicitLabel = sanitize_default(accessible_text_virtual_default(label3, {
- inControlContext: true,
- startNode: virtualNode
- }));
- if (label3.actualNode) {
- this.relatedNodes([ label3.actualNode ]);
- }
- this.data({
- implicitLabel: implicitLabel
- });
- return !!implicitLabel;
- }
- return false;
- } catch (e) {
- return void 0;
- }
- }
- var implicit_evaluate_default = implicitEvaluate;
- function isStringContained(compare, compareWith) {
- var curatedCompareWith = curateString(compareWith);
- var curatedCompare = curateString(compare);
- if (!curatedCompareWith || !curatedCompare) {
- return false;
- }
- return curatedCompareWith.includes(curatedCompare);
- }
- function curateString(str) {
- var noUnicodeStr = remove_unicode_default(str, {
- emoji: true,
- nonBmp: true,
- punctuations: true
- });
- return sanitize_default(noUnicodeStr);
- }
- function labelContentNameMismatchEvaluate(node, options, virtualNode) {
- var _options$occurrenceTh;
- var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold;
- 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;
- var accText = accessible_text_default(node).toLowerCase();
- if (is_human_interpretable_default(accText) < 1) {
- return void 0;
- }
- var visibleText = sanitize_default(subtree_text_default(virtualNode, {
- subtreeDescendant: true,
- ignoreIconLigature: true,
- pixelThreshold: pixelThreshold,
- occurrenceThreshold: occurrenceThreshold
- })).toLowerCase();
- if (!visibleText) {
- return true;
- }
- if (is_human_interpretable_default(visibleText) < 1) {
- if (isStringContained(visibleText, accText)) {
- return true;
- }
- return void 0;
- }
- return isStringContained(visibleText, accText);
- }
- var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate;
- function multipleLabelEvaluate(node) {
- var id = escape_selector_default(node.getAttribute('id'));
- var parent = node.parentNode;
- var root = get_root_node_default2(node);
- root = root.documentElement || root;
- var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
- if (labels.length) {
- labels = labels.filter(function(label3) {
- return !_isHiddenForEveryone(label3);
- });
- }
- while (parent) {
- if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) {
- labels.push(parent);
- }
- parent = parent.parentNode;
- }
- this.relatedNodes(labels);
- if (labels.length > 1) {
- var ATVisibleLabels = labels.filter(function(label3) {
- return _isVisibleToScreenReaders(label3);
- });
- if (ATVisibleLabels.length > 1) {
- return void 0;
- }
- var labelledby = idrefs_default(node, 'aria-labelledby');
- return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false;
- }
- return false;
- }
- var multiple_label_evaluate_default = multipleLabelEvaluate;
- function titleOnlyEvaluate(node, options, virtualNode) {
- var labelText2 = label_virtual_default2(virtualNode);
- var title = title_text_default(virtualNode);
- var ariaDescribedBy = virtualNode.attr('aria-describedby');
- return !labelText2 && !!(title || ariaDescribedBy);
- }
- var title_only_evaluate_default = titleOnlyEvaluate;
- function landmarkIsUniqueAfter(results) {
- var uniqueLandmarks = [];
- return results.filter(function(currentResult) {
- var findMatch = function findMatch(someResult) {
- return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText;
- };
- var matchedResult = uniqueLandmarks.find(findMatch);
- if (matchedResult) {
- matchedResult.result = false;
- matchedResult.relatedNodes.push(currentResult.relatedNodes[0]);
- return false;
- }
- uniqueLandmarks.push(currentResult);
- currentResult.relatedNodes = [];
- return true;
- });
- }
- var landmark_is_unique_after_default = landmarkIsUniqueAfter;
- function landmarkIsUniqueEvaluate(node, options, virtualNode) {
- var role = get_role_default(node);
- var accessibleText2 = accessible_text_virtual_default(virtualNode);
- accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null;
- this.data({
- role: role,
- accessibleText: accessibleText2
- });
- this.relatedNodes([ node ]);
- return true;
- }
- var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate;
- function hasValue(value) {
- return (value || '').trim() !== '';
- }
- function hasLangEvaluate(node, options, virtualNode) {
- var xhtml2 = typeof document !== 'undefined' ? is_xhtml_default(document) : false;
- if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml2) {
- this.data({
- messageKey: 'noXHTML'
- });
- return false;
- }
- var hasLang = options.attributes.some(function(name) {
- return hasValue(virtualNode.attr(name));
- });
- if (!hasLang) {
- this.data({
- messageKey: 'noLang'
- });
- return false;
- }
- return true;
- }
- var has_lang_evaluate_default = hasLangEvaluate;
- function validLangEvaluate(node, options, virtualNode) {
- var invalid = [];
- options.attributes.forEach(function(langAttr) {
- var langVal = virtualNode.attr(langAttr);
- if (typeof langVal !== 'string') {
- return;
- }
- var baselangVal = get_base_lang_default(langVal);
- var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal);
- if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) {
- invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"');
- }
- });
- if (!invalid.length) {
- return false;
- }
- if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) {
- return false;
- }
- this.data(invalid);
- return true;
- }
- var valid_lang_evaluate_default = validLangEvaluate;
- function xmlLangMismatchEvaluate(node, options, vNode) {
- var primaryLangValue = get_base_lang_default(vNode.attr('lang'));
- var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang'));
- return primaryLangValue === primaryXmlLangValue;
- }
- var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate;
- function dlitemEvaluate(node) {
- var parent = get_composed_parent_default(node);
- var parentTagName = parent.nodeName.toUpperCase();
- var parentRole = get_explicit_role_default(parent);
- if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) {
- parent = get_composed_parent_default(parent);
- parentTagName = parent.nodeName.toUpperCase();
- parentRole = get_explicit_role_default(parent);
- }
- if (parentTagName !== 'DL') {
- return false;
- }
- if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) {
- return true;
- }
- return false;
- }
- var dlitem_evaluate_default = dlitemEvaluate;
- function invalidChildrenEvaluate(node) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
- var relatedNodes = [];
- var issues = [];
- if (!virtualNode.children) {
- return void 0;
- }
- var vChildren = mapWithNested(virtualNode.children);
- while (vChildren.length) {
- var _vChild$actualNode;
- var _vChildren$shift = vChildren.shift(), vChild = _vChildren$shift.vChild, nested = _vChildren$shift.nested;
- if (options.divGroups && !nested && isDivGroup(vChild)) {
- if (!vChild.children) {
- return void 0;
- }
- var vGrandChildren = mapWithNested(vChild.children, true);
- vChildren.push.apply(vChildren, _toConsumableArray(vGrandChildren));
- continue;
- }
- var issue = getInvalidSelector(vChild, nested, options);
- if (!issue) {
- continue;
- }
- if (!issues.includes(issue)) {
- issues.push(issue);
- }
- if ((vChild === null || vChild === void 0 ? void 0 : (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) {
- relatedNodes.push(vChild.actualNode);
- }
- }
- if (issues.length === 0) {
- return false;
- }
- this.data({
- values: issues.join(', ')
- });
- this.relatedNodes(relatedNodes);
- return true;
- }
- function getInvalidSelector(vChild, nested, _ref90) {
- var _ref90$validRoles = _ref90.validRoles, validRoles = _ref90$validRoles === void 0 ? [] : _ref90$validRoles, _ref90$validNodeNames = _ref90.validNodeNames, validNodeNames = _ref90$validNodeNames === void 0 ? [] : _ref90$validNodeNames;
- var _vChild$props = vChild.props, nodeName2 = _vChild$props.nodeName, nodeType = _vChild$props.nodeType, nodeValue = _vChild$props.nodeValue;
- var selector = nested ? 'div > ' : '';
- if (nodeType === 3 && nodeValue.trim() !== '') {
- return selector + '#text';
- }
- if (nodeType !== 1 || !_isVisibleToScreenReaders(vChild)) {
- return false;
- }
- var role = get_explicit_role_default(vChild);
- if (role) {
- return validRoles.includes(role) ? false : selector + '[role='.concat(role, ']');
- } else {
- return validNodeNames.includes(nodeName2) ? false : selector + nodeName2;
- }
- }
- function isDivGroup(vNode) {
- return vNode.props.nodeName === 'div' && get_explicit_role_default(vNode) === null;
- }
- function mapWithNested(vNodes) {
- var nested = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- return vNodes.map(function(vChild) {
- return {
- vChild: vChild,
- nested: nested
- };
- });
- }
- function listitemEvaluate(node, options, virtualNode) {
- var parent = virtualNode.parent;
- if (!parent) {
- return void 0;
- }
- var parentNodeName = parent.props.nodeName;
- var parentRole = get_explicit_role_default(parent);
- if ([ 'presentation', 'none', 'list' ].includes(parentRole)) {
- return true;
- }
- if (parentRole && is_valid_role_default(parentRole)) {
- this.data({
- messageKey: 'roleNotValid'
- });
- return false;
- }
- return [ 'ul', 'ol', 'menu' ].includes(parentNodeName);
- }
- function onlyDlitemsEvaluate(node, options, virtualNode) {
- var ALLOWED_ROLES = [ 'definition', 'term', 'list' ];
- var base = {
- badNodes: [],
- hasNonEmptyTextNode: false
- };
- var content = virtualNode.children.reduce(function(content2, child) {
- var actualNode = child.actualNode;
- if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) {
- return content2.concat(child.children);
- }
- return content2.concat(child);
- }, []);
- var result = content.reduce(function(out, childNode) {
- var actualNode = childNode.actualNode;
- var tagName = actualNode.nodeName.toUpperCase();
- if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) {
- var explicitRole2 = get_explicit_role_default(actualNode);
- if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) {
- if (!ALLOWED_ROLES.includes(explicitRole2)) {
- out.badNodes.push(actualNode);
- }
- }
- } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
- out.hasNonEmptyTextNode = true;
- }
- return out;
- }, base);
- if (result.badNodes.length) {
- this.relatedNodes(result.badNodes);
- }
- return !!result.badNodes.length || result.hasNonEmptyTextNode;
- }
- var only_dlitems_evaluate_default = onlyDlitemsEvaluate;
- function onlyListitemsEvaluate(node, options, virtualNode) {
- var hasNonEmptyTextNode = false;
- var atLeastOneListitem = false;
- var isEmpty = true;
- var badNodes = [];
- var badRoleNodes = [];
- var badRoles = [];
- virtualNode.children.forEach(function(vNode) {
- var actualNode = vNode.actualNode;
- if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
- hasNonEmptyTextNode = true;
- return;
- }
- if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) {
- return;
- }
- isEmpty = false;
- var isLi = actualNode.nodeName.toUpperCase() === 'LI';
- var role = get_role_default(vNode);
- var isListItemRole = role === 'listitem';
- if (!isLi && !isListItemRole) {
- badNodes.push(actualNode);
- }
- if (isLi && !isListItemRole) {
- badRoleNodes.push(actualNode);
- if (!badRoles.includes(role)) {
- badRoles.push(role);
- }
- }
- if (isListItemRole) {
- atLeastOneListitem = true;
- }
- });
- if (hasNonEmptyTextNode || badNodes.length) {
- this.relatedNodes(badNodes);
- return true;
- }
- if (isEmpty || atLeastOneListitem) {
- return false;
- }
- this.relatedNodes(badRoleNodes);
- this.data({
- messageKey: 'roleNotValid',
- roles: badRoles.join(', ')
- });
- return true;
- }
- var only_listitems_evaluate_default = onlyListitemsEvaluate;
- function structuredDlitemsEvaluate(node, options, virtualNode) {
- var children = virtualNode.children;
- if (!children || !children.length) {
- return false;
- }
- var hasDt = false, hasDd = false, nodeName2;
- for (var i = 0; i < children.length; i++) {
- nodeName2 = children[i].props.nodeName.toUpperCase();
- if (nodeName2 === 'DT') {
- hasDt = true;
- }
- if (hasDt && nodeName2 === 'DD') {
- return false;
- }
- if (nodeName2 === 'DD') {
- hasDd = true;
- }
- }
- return hasDt || hasDd;
- }
- var structured_dlitems_evaluate_default = structuredDlitemsEvaluate;
- function captionEvaluate(node, options, virtualNode) {
- var tracks = query_selector_all_default(virtualNode, 'track');
- var hasCaptions = tracks.some(function(vNode) {
- return (vNode.attr('kind') || '').toLowerCase() === 'captions';
- });
- return hasCaptions ? false : void 0;
- }
- var caption_evaluate_default = captionEvaluate;
- var joinStr = ' > ';
- function frameTestedAfter(results) {
- var iframes = {};
- return results.filter(function(result) {
- var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html';
- if (frameResult) {
- var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr);
- iframes[ancestry2] = result;
- return true;
- }
- var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr);
- if (iframes[ancestry]) {
- iframes[ancestry].result = true;
- }
- return false;
- });
- }
- var frame_tested_after_default = frameTestedAfter;
- function frameTestedEvaluate(node, options) {
- return options.isViolation ? false : void 0;
- }
- var frame_tested_evaluate_default = frameTestedEvaluate;
- function noAutoplayAudioEvaluate(node, options) {
- if (!node.duration) {
- console.warn('axe.utils.preloadMedia did not load metadata');
- return void 0;
- }
- var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
- var playableDuration = getPlayableDuration(node);
- if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) {
- return true;
- }
- if (!node.hasAttribute('controls')) {
- return false;
- }
- return true;
- function getPlayableDuration(elm) {
- if (!elm.currentSrc) {
- return 0;
- }
- var playbackRange = getPlaybackRange(elm.currentSrc);
- if (!playbackRange) {
- return Math.abs(elm.duration - (elm.currentTime || 0));
- }
- if (playbackRange.length === 1) {
- return Math.abs(elm.duration - playbackRange[0]);
- }
- return Math.abs(playbackRange[1] - playbackRange[0]);
- }
- function getPlaybackRange(src) {
- var match = src.match(/#t=(.*)/);
- if (!match) {
- return;
- }
- var _match = _slicedToArray(match, 2), value = _match[1];
- var ranges = value.split(',');
- return ranges.map(function(range) {
- if (/:/.test(range)) {
- return convertHourMinSecToSeconds(range);
- }
- return parseFloat(range);
- });
- }
- function convertHourMinSecToSeconds(hhMmSs) {
- var parts = hhMmSs.split(':');
- var secs = 0;
- var mins = 1;
- while (parts.length > 0) {
- secs += mins * parseInt(parts.pop(), 10);
- mins *= 60;
- }
- return parseFloat(secs);
- }
- }
- var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate;
- function cssOrientationLockEvaluate(node, options, virtualNode, context) {
- var _ref91 = context || {}, _ref91$cssom = _ref91.cssom, cssom = _ref91$cssom === void 0 ? void 0 : _ref91$cssom;
- var _ref92 = options || {}, _ref92$degreeThreshol = _ref92.degreeThreshold, degreeThreshold = _ref92$degreeThreshol === void 0 ? 0 : _ref92$degreeThreshol;
- if (!cssom || !cssom.length) {
- return void 0;
- }
- var isLocked = false;
- var relatedElements = [];
- var rulesGroupByDocumentFragment = groupCssomByDocument(cssom);
- var _loop7 = function _loop7() {
- var key = _Object$keys2[_i27];
- var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules;
- var orientationRules = rules.filter(isMediaRuleWithOrientation);
- if (!orientationRules.length) {
- return 'continue';
- }
- orientationRules.forEach(function(_ref93) {
- var cssRules = _ref93.cssRules;
- Array.from(cssRules).forEach(function(cssRule) {
- var locked = getIsOrientationLocked(cssRule);
- if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') {
- var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || [];
- relatedElements = relatedElements.concat(elms);
- }
- isLocked = isLocked || locked;
- });
- });
- };
- for (var _i27 = 0, _Object$keys2 = Object.keys(rulesGroupByDocumentFragment); _i27 < _Object$keys2.length; _i27++) {
- var _ret4 = _loop7();
- if (_ret4 === 'continue') {
- continue;
- }
- }
- if (!isLocked) {
- return true;
- }
- if (relatedElements.length) {
- this.relatedNodes(relatedElements);
- }
- return false;
- function groupCssomByDocument(cssObjectModel) {
- return cssObjectModel.reduce(function(out, _ref94) {
- var sheet = _ref94.sheet, root = _ref94.root, shadowId = _ref94.shadowId;
- var key = shadowId ? shadowId : 'topDocument';
- if (!out[key]) {
- out[key] = {
- root: root,
- rules: []
- };
- }
- if (!sheet || !sheet.cssRules) {
- return out;
- }
- var rules = Array.from(sheet.cssRules);
- out[key].rules = out[key].rules.concat(rules);
- return out;
- }, {});
- }
- function isMediaRuleWithOrientation(_ref95) {
- var type = _ref95.type, cssText = _ref95.cssText;
- if (type !== 4) {
- return false;
- }
- return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText);
- }
- function getIsOrientationLocked(_ref96) {
- var selectorText = _ref96.selectorText, style = _ref96.style;
- if (!selectorText || style.length <= 0) {
- return false;
- }
- var transformStyle = style.transform || style.webkitTransform || style.msTransform || false;
- if (!transformStyle && !style.rotate) {
- return false;
- }
- var transformDegrees = getTransformDegrees(transformStyle);
- var rotateDegrees = getRotationInDegrees('rotate', style.rotate);
- var degrees = transformDegrees + rotateDegrees;
- if (!degrees) {
- return false;
- }
- degrees = Math.abs(degrees);
- if (Math.abs(degrees - 180) % 180 <= degreeThreshold) {
- return false;
- }
- return Math.abs(degrees - 90) % 90 <= degreeThreshold;
- }
- function getTransformDegrees(transformStyle) {
- if (!transformStyle) {
- return 0;
- }
- var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/);
- if (!matches4) {
- return 0;
- }
- var _matches = _slicedToArray(matches4, 3), transformFn = _matches[1], transformFnValue = _matches[2];
- return getRotationInDegrees(transformFn, transformFnValue);
- }
- function getRotationInDegrees(transformFunction, transformFnValue) {
- switch (transformFunction) {
- case 'rotate':
- case 'rotateZ':
- return getAngleInDegrees(transformFnValue);
- case 'rotate3d':
- var _transformFnValue$spl = transformFnValue.split(',').map(function(value) {
- return value.trim();
- }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3];
- if (parseInt(z) === 0) {
- return;
- }
- return getAngleInDegrees(angleWithUnit);
- case 'matrix':
- case 'matrix3d':
- return getAngleInDegreesFromMatrixTransform(transformFnValue);
- default:
- return 0;
- }
- }
- function getAngleInDegrees(angleWithUnit) {
- var _ref97 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref98 = _slicedToArray(_ref97, 1), unit = _ref98[0];
- if (!unit) {
- return 0;
- }
- var angle = parseFloat(angleWithUnit.replace(unit, ''));
- switch (unit) {
- case 'rad':
- return convertRadToDeg(angle);
- case 'grad':
- return convertGradToDeg(angle);
- case 'turn':
- return convertTurnToDeg(angle);
- case 'deg':
- default:
- return parseInt(angle);
- }
- }
- function getAngleInDegreesFromMatrixTransform(transformFnValue) {
- var values = transformFnValue.split(',');
- if (values.length <= 6) {
- var _values = _slicedToArray(values, 2), a = _values[0], b2 = _values[1];
- var radians = Math.atan2(parseFloat(b2), parseFloat(a));
- return convertRadToDeg(radians);
- }
- var sinB = parseFloat(values[8]);
- var b = Math.asin(sinB);
- var cosB = Math.cos(b);
- var rotateZRadians = Math.acos(parseFloat(values[0]) / cosB);
- return convertRadToDeg(rotateZRadians);
- }
- function convertRadToDeg(radians) {
- return Math.round(radians * (180 / Math.PI));
- }
- function convertGradToDeg(grad) {
- grad = grad % 400;
- if (grad < 0) {
- grad += 400;
- }
- return Math.round(grad / 400 * 360);
- }
- function convertTurnToDeg(turn) {
- return Math.round(360 / (1 / turn));
- }
- }
- var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
- function metaViewportScaleEvaluate(node, options, virtualNode) {
- var _ref99 = options || {}, _ref99$scaleMinimum = _ref99.scaleMinimum, scaleMinimum = _ref99$scaleMinimum === void 0 ? 2 : _ref99$scaleMinimum, _ref99$lowerBound = _ref99.lowerBound, lowerBound = _ref99$lowerBound === void 0 ? false : _ref99$lowerBound;
- var content = virtualNode.attr('content') || '';
- if (!content) {
- return true;
- }
- var result = content.split(/[;,]/).reduce(function(out, item) {
- var contentValue = item.trim();
- if (!contentValue) {
- return out;
- }
- var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1];
- if (!key || !value) {
- return out;
- }
- var curatedKey = key.toLowerCase().trim();
- var curatedValue = value.toLowerCase().trim();
- if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
- curatedValue = 1;
- }
- if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
- return out;
- }
- out[curatedKey] = curatedValue;
- return out;
- }, {});
- if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) {
- return true;
- }
- if (!lowerBound && result['user-scalable'] === 'no') {
- this.data('user-scalable=no');
- return false;
- }
- var userScalableAsFloat = parseFloat(result['user-scalable']);
- if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) {
- this.data('user-scalable');
- return false;
- }
- if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) {
- this.data('maximum-scale');
- return false;
- }
- return true;
- }
- var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate;
- var roundingMargin = .05;
- function targetOffsetEvaluate(node, options, vNode) {
- var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
- var closeNeighbors = [];
- var closestOffset = minOffset;
- var _iterator9 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step9;
- try {
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) {
- var vNeighbor = _step9.value;
- if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) {
- continue;
- }
- var offset = roundToSingleDecimal(_getOffset(vNode, vNeighbor));
- if (offset + roundingMargin >= minOffset) {
- continue;
- }
- closestOffset = Math.min(closestOffset, offset);
- closeNeighbors.push(vNeighbor);
- }
- } catch (err) {
- _iterator9.e(err);
- } finally {
- _iterator9.f();
- }
- if (closeNeighbors.length === 0) {
- this.data({
- closestOffset: closestOffset,
- minOffset: minOffset
- });
- return true;
- }
- this.relatedNodes(closeNeighbors.map(function(_ref100) {
- var actualNode = _ref100.actualNode;
- return actualNode;
- }));
- if (!closeNeighbors.some(_isInTabOrder)) {
- this.data({
- messageKey: 'nonTabbableNeighbor',
- closestOffset: closestOffset,
- minOffset: minOffset
- });
- return void 0;
- }
- this.data({
- closestOffset: closestOffset,
- minOffset: minOffset
- });
- return _isInTabOrder(vNode) ? false : void 0;
- }
- function roundToSingleDecimal(num) {
- return Math.round(num * 10) / 10;
- }
- var roundingMargin2 = .05;
- function targetSize(node, options, vNode) {
- var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24;
- var nodeRect = vNode.boundingClientRect;
- var hasMinimumSize = rectHasMinimumSize.bind(null, minSize);
- var nearbyElms = _findNearbyElms(vNode);
- var overflowingContent = filterOverflowingContent(vNode, nearbyElms);
- var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms;
- if (fullyObscuringElms.length && !overflowingContent.length) {
- this.relatedNodes(mapActualNodes(fullyObscuringElms));
- this.data({
- messageKey: 'obscured'
- });
- return true;
- }
- var negativeOutcome = _isInTabOrder(vNode) ? false : void 0;
- if (!hasMinimumSize(nodeRect) && !overflowingContent.length) {
- this.data(_extends({
- minSize: minSize
- }, toDecimalSize(nodeRect)));
- return negativeOutcome;
- }
- var obscuredWidgets = filterFocusableWidgets(partialObscuringElms);
- var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets);
- if (overflowingContent.length) {
- if (fullyObscuringElms.length || !hasMinimumSize(largestInnerRect || nodeRect)) {
- this.data({
- minSize: minSize,
- messageKey: 'contentOverflow'
- });
- this.relatedNodes(mapActualNodes(overflowingContent));
- return void 0;
- }
- }
- if (obscuredWidgets.length !== 0 && !hasMinimumSize(largestInnerRect)) {
- var allTabbable = obscuredWidgets.every(_isInTabOrder);
- var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable');
- this.data(_extends({
- messageKey: messageKey,
- minSize: minSize
- }, toDecimalSize(largestInnerRect)));
- this.relatedNodes(mapActualNodes(obscuredWidgets));
- return allTabbable ? negativeOutcome : void 0;
- }
- this.data(_extends({
- minSize: minSize
- }, toDecimalSize(largestInnerRect || nodeRect)));
- this.relatedNodes(mapActualNodes(obscuredWidgets));
- return true;
- }
- function filterOverflowingContent(vNode, nearbyElms) {
- return nearbyElms.filter(function(nearbyElm) {
- return !isEnclosedRect(nearbyElm, vNode) && isDescendantNotInTabOrder(vNode, nearbyElm);
- });
- }
- function filterByElmsOverlap(vNode, nearbyElms) {
- var fullyObscuringElms = [];
- var partialObscuringElms = [];
- var _iterator10 = _createForOfIteratorHelper(nearbyElms), _step10;
- try {
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) {
- var vNeighbor = _step10.value;
- if (!isDescendantNotInTabOrder(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
- if (isEnclosedRect(vNode, vNeighbor)) {
- fullyObscuringElms.push(vNeighbor);
- } else {
- partialObscuringElms.push(vNeighbor);
- }
- }
- }
- } catch (err) {
- _iterator10.e(err);
- } finally {
- _iterator10.f();
- }
- return {
- fullyObscuringElms: fullyObscuringElms,
- partialObscuringElms: partialObscuringElms
- };
- }
- function getLargestUnobscuredArea(vNode, obscuredNodes) {
- var nodeRect = vNode.boundingClientRect;
- if (obscuredNodes.length === 0) {
- return null;
- }
- var obscuringRects = obscuredNodes.map(function(_ref101) {
- var rect = _ref101.boundingClientRect;
- return rect;
- });
- var unobscuredRects = _splitRects(nodeRect, obscuringRects);
- return getLargestRect(unobscuredRects);
- }
- function getLargestRect(rects, minSize) {
- return rects.reduce(function(rectA, rectB) {
- var rectAisMinimum = rectHasMinimumSize(minSize, rectA);
- var rectBisMinimum = rectHasMinimumSize(minSize, rectB);
- if (rectAisMinimum !== rectBisMinimum) {
- return rectAisMinimum ? rectA : rectB;
- }
- var areaA = rectA.width * rectA.height;
- var areaB = rectB.width * rectB.height;
- return areaA > areaB ? rectA : rectB;
- });
- }
- function filterFocusableWidgets(vNodes) {
- return vNodes.filter(function(vNode) {
- return get_role_type_default(vNode) === 'widget' && _isFocusable(vNode);
- });
- }
- function isEnclosedRect(vNodeA, vNodeB) {
- var rectA = vNodeA.boundingClientRect;
- var rectB = vNodeB.boundingClientRect;
- return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
- }
- function getCssPointerEvents(vNode) {
- return vNode.getComputedStylePropertyValue('pointer-events');
- }
- function toDecimalSize(rect) {
- return {
- width: Math.round(rect.width * 10) / 10,
- height: Math.round(rect.height * 10) / 10
- };
- }
- function isDescendantNotInTabOrder(vAncestor, vNode) {
- return vAncestor.actualNode.contains(vNode.actualNode) && !_isInTabOrder(vNode);
- }
- function rectHasMinimumSize(minSize, _ref102) {
- var width = _ref102.width, height = _ref102.height;
- return width + roundingMargin2 >= minSize && height + roundingMargin2 >= minSize;
- }
- function mapActualNodes(vNodes) {
- return vNodes.map(function(_ref103) {
- var actualNode = _ref103.actualNode;
- return actualNode;
- });
- }
- function headingOrderAfter(results) {
- var headingOrder = getHeadingOrder(results);
- results.forEach(function(result) {
- result.result = getHeadingOrderOutcome(result, headingOrder);
- });
- return results;
- }
- function getHeadingOrderOutcome(result, headingOrder) {
- var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder;
- var index = findHeadingOrderIndex(headingOrder, result.node.ancestry);
- 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;
- var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1;
- if (index === 0) {
- return true;
- }
- if (currLevel === -1) {
- return void 0;
- }
- return currLevel - prevLevel <= 1;
- }
- function getHeadingOrder(results) {
- results = _toConsumableArray(results);
- results.sort(function(_ref104, _ref105) {
- var nodeA = _ref104.node;
- var nodeB = _ref105.node;
- return nodeA.ancestry.length - nodeB.ancestry.length;
- });
- var headingOrder = results.reduce(mergeHeadingOrder, []);
- return headingOrder.filter(function(_ref106) {
- var level = _ref106.level;
- return level !== -1;
- });
- }
- function mergeHeadingOrder(mergedHeadingOrder, result) {
- var _result$data;
- var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder;
- var frameAncestry = shortenArray(result.node.ancestry, 1);
- if (!frameHeadingOrder) {
- return mergedHeadingOrder;
- }
- var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) {
- return addFrameToHeadingAncestry(heading, frameAncestry);
- });
- var index = getFrameIndex(mergedHeadingOrder, frameAncestry);
- if (index === -1) {
- mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder));
- } else {
- mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder)));
- }
- return mergedHeadingOrder;
- }
- function getFrameIndex(headingOrder, frameAncestry) {
- while (frameAncestry.length) {
- var index = findHeadingOrderIndex(headingOrder, frameAncestry);
- if (index !== -1) {
- return index;
- }
- frameAncestry = shortenArray(frameAncestry, 1);
- }
- return -1;
- }
- function findHeadingOrderIndex(headingOrder, ancestry) {
- return headingOrder.findIndex(function(heading) {
- return match_ancestry_default(heading.ancestry, ancestry);
- });
- }
- function addFrameToHeadingAncestry(heading, frameAncestry) {
- var ancestry = frameAncestry.concat(heading.ancestry);
- return _extends({}, heading, {
- ancestry: ancestry
- });
- }
- function shortenArray(arr, spliceLength) {
- return arr.slice(0, arr.length - spliceLength);
- }
- function getLevel(vNode) {
- var role = get_role_default(vNode);
- var headingRole = role && role.includes('heading');
- var ariaHeadingLevel = vNode.attr('aria-level');
- var ariaLevel = parseInt(ariaHeadingLevel, 10);
- var _ref107 = vNode.props.nodeName.match(/h(\d)/) || [], _ref108 = _slicedToArray(_ref107, 2), headingLevel = _ref108[1];
- if (!headingRole) {
- return -1;
- }
- if (headingLevel && !ariaHeadingLevel) {
- return parseInt(headingLevel, 10);
- }
- if (isNaN(ariaLevel) || ariaLevel < 1) {
- if (headingLevel) {
- return parseInt(headingLevel, 10);
- }
- return 2;
- }
- if (ariaLevel) {
- return ariaLevel;
- }
- return -1;
- }
- function headingOrderEvaluate() {
- var headingOrder = cache_default.get('headingOrder');
- if (headingOrder) {
- return true;
- }
- var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame';
- var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders);
- headingOrder = vNodes.map(function(vNode) {
- return {
- ancestry: [ _getAncestry(vNode.actualNode) ],
- level: getLevel(vNode)
- };
- });
- this.data({
- headingOrder: headingOrder
- });
- cache_default.set('headingOrder', vNodes);
- return true;
- }
- var heading_order_evaluate_default = headingOrderEvaluate;
- function isIdenticalObject(a, b) {
- if (!a || !b) {
- return false;
- }
- var aProps = Object.getOwnPropertyNames(a);
- var bProps = Object.getOwnPropertyNames(b);
- if (aProps.length !== bProps.length) {
- return false;
- }
- var result = aProps.every(function(propName) {
- var aValue = a[propName];
- var bValue = b[propName];
- if (_typeof(aValue) !== _typeof(bValue)) {
- return false;
- }
- if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') {
- return isIdenticalObject(aValue, bValue);
- }
- return aValue === bValue;
- });
- return result;
- }
- function identicalLinksSamePurposeAfter(results) {
- if (results.length < 2) {
- return results;
- }
- var incompleteResults = results.filter(function(_ref109) {
- var result = _ref109.result;
- return result !== void 0;
- });
- var uniqueResults = [];
- var nameMap = {};
- var _loop8 = function _loop8(index) {
- var _currentResult$relate;
- var currentResult = incompleteResults[index];
- var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps;
- if (nameMap[name]) {
- return 'continue';
- }
- var sameNameResults = incompleteResults.filter(function(_ref110, resultNum) {
- var data2 = _ref110.data;
- return data2.name === name && resultNum !== index;
- });
- var isSameUrl = sameNameResults.every(function(_ref111) {
- var data2 = _ref111.data;
- return isIdenticalObject(data2.urlProps, urlProps);
- });
- if (sameNameResults.length && !isSameUrl) {
- currentResult.result = void 0;
- }
- currentResult.relatedNodes = [];
- (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) {
- return node.relatedNodes[0];
- })));
- nameMap[name] = sameNameResults;
- uniqueResults.push(currentResult);
- };
- for (var index = 0; index < incompleteResults.length; index++) {
- var _ret5 = _loop8(index);
- if (_ret5 === 'continue') {
- continue;
- }
- }
- return uniqueResults;
- }
- var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter;
- var commons_exports = {};
- __export(commons_exports, {
- aria: function aria() {
- return aria_exports;
- },
- color: function color() {
- return color_exports;
- },
- dom: function dom() {
- return dom_exports;
- },
- forms: function forms() {
- return forms_exports;
- },
- matches: function matches() {
- return matches_default3;
- },
- math: function math() {
- return math_exports;
- },
- standards: function standards() {
- return standards_exports;
- },
- table: function table() {
- return table_exports;
- },
- text: function text() {
- return text_exports;
- },
- utils: function utils() {
- return utils_exports;
- }
- });
- var forms_exports = {};
- __export(forms_exports, {
- isAriaCombobox: function isAriaCombobox() {
- return is_aria_combobox_default;
- },
- isAriaListbox: function isAriaListbox() {
- return is_aria_listbox_default;
- },
- isAriaRange: function isAriaRange() {
- return is_aria_range_default;
- },
- isAriaTextbox: function isAriaTextbox() {
- return is_aria_textbox_default;
- },
- isDisabled: function isDisabled() {
- return is_disabled_default;
- },
- isNativeSelect: function isNativeSelect() {
- return is_native_select_default;
- },
- isNativeTextbox: function isNativeTextbox() {
- return is_native_textbox_default;
- }
- });
- var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ];
- function isDisabled(virtualNode) {
- var disabledState = virtualNode._isDisabled;
- if (typeof disabledState === 'boolean') {
- return disabledState;
- }
- var nodeName2 = virtualNode.props.nodeName;
- var ariaDisabled = virtualNode.attr('aria-disabled');
- if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) {
- disabledState = true;
- } else if (ariaDisabled) {
- disabledState = ariaDisabled.toLowerCase() === 'true';
- } else if (virtualNode.parent) {
- disabledState = isDisabled(virtualNode.parent);
- } else {
- disabledState = false;
- }
- virtualNode._isDisabled = disabledState;
- return disabledState;
- }
- var is_disabled_default = isDisabled;
- var table_exports = {};
- __export(table_exports, {
- getAllCells: function getAllCells() {
- return get_all_cells_default;
- },
- getCellPosition: function getCellPosition() {
- return get_cell_position_default;
- },
- getHeaders: function getHeaders() {
- return get_headers_default;
- },
- getScope: function getScope() {
- return get_scope_default;
- },
- isColumnHeader: function isColumnHeader() {
- return is_column_header_default;
- },
- isDataCell: function isDataCell() {
- return is_data_cell_default;
- },
- isDataTable: function isDataTable() {
- return is_data_table_default;
- },
- isHeader: function isHeader() {
- return is_header_default;
- },
- isRowHeader: function isRowHeader() {
- return is_row_header_default;
- },
- toArray: function toArray() {
- return to_grid_default;
- },
- toGrid: function toGrid() {
- return to_grid_default;
- },
- traverse: function traverse() {
- return traverse_default;
- }
- });
- function getAllCells(tableElm) {
- var rowIndex, cellIndex, rowLength, cellLength;
- var cells = [];
- for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) {
- for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) {
- cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
- }
- }
- return cells;
- }
- var get_all_cells_default = getAllCells;
- function traverseForHeaders(headerType, position, tableGrid) {
- var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders';
- var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default;
- var startCell = tableGrid[position.y][position.x];
- var colspan = startCell.colSpan - 1;
- var rowspanAttr = startCell.getAttribute('rowspan');
- var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan;
- var rowspan = rowspanValue - 1;
- var rowStart = position.y + rowspan;
- var colStart = position.x + colspan;
- var rowEnd = headerType === 'row' ? position.y : 0;
- var colEnd = headerType === 'row' ? 0 : position.x;
- var headers;
- var cells = [];
- for (var row = rowStart; row >= rowEnd && !headers; row--) {
- for (var col = colStart; col >= colEnd; col--) {
- var cell = tableGrid[row] ? tableGrid[row][col] : void 0;
- if (!cell) {
- continue;
- }
- var vNode = axe.utils.getNodeFromTree(cell);
- if (vNode[property]) {
- headers = vNode[property];
- break;
- }
- cells.push(cell);
- }
- }
- headers = (headers || []).concat(cells.filter(predicate));
- cells.forEach(function(tableCell) {
- var vNode = axe.utils.getNodeFromTree(tableCell);
- vNode[property] = headers;
- });
- return headers;
- }
- function getHeaders(cell, tableGrid) {
- if (cell.getAttribute('headers')) {
- var headers = idrefs_default(cell, 'headers');
- if (headers.filter(function(header) {
- return header;
- }).length) {
- return headers;
- }
- }
- if (!tableGrid) {
- tableGrid = to_grid_default(find_up_default(cell, 'table'));
- }
- var position = get_cell_position_default(cell, tableGrid);
- var rowHeaders = traverseForHeaders('row', position, tableGrid);
- var colHeaders = traverseForHeaders('col', position, tableGrid);
- return [].concat(rowHeaders, colHeaders).reverse();
- }
- var get_headers_default = getHeaders;
- function isDataCell(cell) {
- if (!cell.children.length && !cell.textContent.trim()) {
- return false;
- }
- var role = cell.getAttribute('role');
- if (is_valid_role_default(role)) {
- return [ 'cell', 'gridcell' ].includes(role);
- } else {
- return cell.nodeName.toUpperCase() === 'TD';
- }
- }
- var is_data_cell_default = isDataCell;
- function isDataTable(node) {
- var role = (node.getAttribute('role') || '').toLowerCase();
- if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) {
- return false;
- }
- if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) {
- return true;
- }
- if (role === 'grid' || role === 'treegrid' || role === 'table') {
- return true;
- }
- if (get_role_type_default(role) === 'landmark') {
- return true;
- }
- if (node.getAttribute('datatable') === '0') {
- return false;
- }
- if (node.getAttribute('summary')) {
- return true;
- }
- if (node.tHead || node.tFoot || node.caption) {
- return true;
- }
- for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) {
- if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
- return true;
- }
- }
- var cells = 0;
- var rowLength = node.rows.length;
- var row, cell;
- var hasBorder = false;
- for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
- row = node.rows[rowIndex];
- for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) {
- cell = row.cells[cellIndex];
- if (cell.nodeName.toUpperCase() === 'TH') {
- return true;
- }
- if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) {
- hasBorder = true;
- }
- if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) {
- return true;
- }
- if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) {
- return true;
- }
- if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') {
- return true;
- }
- cells++;
- }
- }
- if (node.getElementsByTagName('table').length) {
- return false;
- }
- if (rowLength < 2) {
- return false;
- }
- var sampleRow = node.rows[Math.ceil(rowLength / 2)];
- if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
- return false;
- }
- if (sampleRow.cells.length >= 5) {
- return true;
- }
- if (hasBorder) {
- return true;
- }
- var bgColor, bgImage;
- for (rowIndex = 0; rowIndex < rowLength; rowIndex++) {
- row = node.rows[rowIndex];
- if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) {
- return true;
- } else {
- bgColor = window.getComputedStyle(row).getPropertyValue('background-color');
- }
- if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) {
- return true;
- } else {
- bgImage = window.getComputedStyle(row).getPropertyValue('background-image');
- }
- }
- if (rowLength >= 20) {
- return true;
- }
- if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) {
- return false;
- }
- if (cells < 10) {
- return false;
- }
- if (node.querySelector('object, embed, iframe, applet')) {
- return false;
- }
- return true;
- }
- var is_data_table_default = isDataTable;
- function isHeader(cell) {
- if (is_column_header_default(cell) || is_row_header_default(cell)) {
- return true;
- }
- if (cell.getAttribute('id')) {
- var id = escape_selector_default(cell.getAttribute('id'));
- return !!document.querySelector('[headers~="'.concat(id, '"]'));
- }
- return false;
- }
- var is_header_default = isHeader;
- function traverseTable(dir, position, tableGrid, callback) {
- var result;
- var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0;
- if (!cell) {
- return [];
- }
- if (typeof callback === 'function') {
- result = callback(cell, position, tableGrid);
- if (result === true) {
- return [ cell ];
- }
- }
- result = traverseTable(dir, {
- x: position.x + dir.x,
- y: position.y + dir.y
- }, tableGrid, callback);
- result.unshift(cell);
- return result;
- }
- function traverse(dir, startPos, tableGrid, callback) {
- if (Array.isArray(startPos)) {
- callback = tableGrid;
- tableGrid = startPos;
- startPos = {
- x: 0,
- y: 0
- };
- }
- if (typeof dir === 'string') {
- switch (dir) {
- case 'left':
- dir = {
- x: -1,
- y: 0
- };
- break;
- case 'up':
- dir = {
- x: 0,
- y: -1
- };
- break;
- case 'right':
- dir = {
- x: 1,
- y: 0
- };
- break;
- case 'down':
- dir = {
- x: 0,
- y: 1
- };
- break;
- }
- }
- return traverseTable(dir, {
- x: startPos.x + dir.x,
- y: startPos.y + dir.y
- }, tableGrid, callback);
- }
- var traverse_default = traverse;
- function identicalLinksSamePurposeEvaluate(node, options, virtualNode) {
- var accText = text_exports.accessibleTextVirtual(virtualNode);
- var name = text_exports.sanitize(text_exports.removeUnicode(accText, {
- emoji: true,
- nonBmp: true,
- punctuations: true
- })).toLowerCase();
- if (!name) {
- return void 0;
- }
- var afterData = {
- name: name,
- urlProps: dom_exports.urlPropsFromAttribute(node, 'href')
- };
- this.data(afterData);
- this.relatedNodes([ node ]);
- return true;
- }
- var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate;
- function internalLinkPresentEvaluate(node, options, virtualNode) {
- var links = query_selector_all_default(virtualNode, 'a[href]');
- return links.some(function(vLink) {
- return /^#[^/!]/.test(vLink.attr('href'));
- });
- }
- var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
- var separatorRegex = /[;,\s]/;
- var validRedirectNumRegex = /^[0-9.]+$/;
- function metaRefreshEvaluate(node, options, virtualNode) {
- var _ref112 = options || {}, minDelay = _ref112.minDelay, maxDelay = _ref112.maxDelay;
- var content = (virtualNode.attr('content') || '').trim();
- var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0];
- if (!redirectStr.match(validRedirectNumRegex)) {
- return true;
- }
- var redirectDelay = parseFloat(redirectStr);
- this.data({
- redirectDelay: redirectDelay
- });
- if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) {
- return true;
- }
- if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) {
- return true;
- }
- return false;
- }
- function normalizeFontWeight(weight) {
- switch (weight) {
- case 'lighter':
- return 100;
- case 'normal':
- return 400;
- case 'bold':
- return 700;
- case 'bolder':
- return 900;
- }
- weight = parseInt(weight);
- return !isNaN(weight) ? weight : 400;
- }
- function getTextContainer(elm) {
- var nextNode = elm;
- var outerText = elm.textContent.trim();
- var innerText = outerText;
- while (innerText === outerText && nextNode !== void 0) {
- var _i28 = -1;
- elm = nextNode;
- if (elm.children.length === 0) {
- return elm;
- }
- do {
- _i28++;
- innerText = elm.children[_i28].textContent.trim();
- } while (innerText === '' && _i28 + 1 < elm.children.length);
- nextNode = elm.children[_i28];
- }
- return elm;
- }
- function getStyleValues(node) {
- var style = window.getComputedStyle(getTextContainer(node));
- return {
- fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')),
- fontSize: parseInt(style.getPropertyValue('font-size')),
- isItalic: style.getPropertyValue('font-style') === 'italic'
- };
- }
- function isHeaderStyle(styleA, styleB, margins) {
- return margins.reduce(function(out, margin) {
- return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic);
- }, false);
- }
- function pAsHeadingEvaluate(node, options, virtualNode) {
- var siblings = Array.from(node.parentNode.children);
- var currentIndex = siblings.indexOf(node);
- options = options || {};
- var margins = options.margins || [];
- var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) {
- return elm.nodeName.toUpperCase() === 'P';
- });
- var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) {
- return elm.nodeName.toUpperCase() === 'P';
- });
- var currStyle = getStyleValues(node);
- var nextStyle = nextSibling ? getStyleValues(nextSibling) : null;
- var prevStyle = prevSibling ? getStyleValues(prevSibling) : null;
- var optionsPassLength = options.passLength;
- var optionsFailLength = options.failLength;
- var headingLength = node.textContent.trim().length;
- var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length;
- if (headingLength > paragraphLength * optionsPassLength) {
- return true;
- }
- if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) {
- return true;
- }
- var blockquote = find_up_virtual_default(virtualNode, 'blockquote');
- if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') {
- return void 0;
- }
- if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) {
- return void 0;
- }
- if (headingLength > paragraphLength * optionsFailLength) {
- return void 0;
- }
- return false;
- }
- var p_as_heading_evaluate_default = pAsHeadingEvaluate;
- function regionAfter(results) {
- var iframeResults = results.filter(function(r) {
- return r.data.isIframe;
- });
- results.forEach(function(r) {
- if (r.result || r.node.ancestry.length === 1) {
- return;
- }
- var frameAncestry = r.node.ancestry.slice(0, -1);
- var _iterator11 = _createForOfIteratorHelper(iframeResults), _step11;
- try {
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) {
- var iframeResult = _step11.value;
- if (match_ancestry_default(frameAncestry, iframeResult.node.ancestry)) {
- r.result = iframeResult.result;
- break;
- }
- }
- } catch (err) {
- _iterator11.e(err);
- } finally {
- _iterator11.f();
- }
- });
- iframeResults.forEach(function(r) {
- if (!r.result) {
- r.result = true;
- }
- });
- return results;
- }
- var region_after_default = regionAfter;
- var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
- var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
- function regionEvaluate(node, options, virtualNode) {
- this.data({
- isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)
- });
- var regionlessNodes = cache_default.get('regionlessNodes', function() {
- return getRegionlessNodes(options);
- });
- return !regionlessNodes.includes(virtualNode);
- }
- function getRegionlessNodes(options) {
- var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) {
- while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) {
- vNode = vNode.parent;
- }
- return vNode;
- }).filter(function(vNode, index, array) {
- return array.indexOf(vNode) === index;
- });
- return regionlessNodes;
- }
- function findRegionlessElms(virtualNode, options) {
- var node = virtualNode.actualNode;
- 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)) {
- var vNode = virtualNode;
- while (vNode) {
- vNode._hasRegionDescendant = true;
- vNode = vNode.parent;
- }
- if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) {
- return [ virtualNode ];
- }
- return [];
- } else if (node !== document.body && has_content_default(node, true)) {
- return [ virtualNode ];
- } else {
- return virtualNode.children.filter(function(_ref113) {
- var actualNode = _ref113.actualNode;
- return actualNode.nodeType === 1;
- }).map(function(vNode) {
- return findRegionlessElms(vNode, options);
- }).reduce(function(a, b) {
- return a.concat(b);
- }, []);
- }
- }
- function isRegion(virtualNode, options) {
- var node = virtualNode.actualNode;
- var role = get_role_default(virtualNode);
- var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
- if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
- return true;
- }
- if (landmarkRoles2.includes(role)) {
- return true;
- }
- if (options.regionMatcher && matches_default3(virtualNode, options.regionMatcher)) {
- return true;
- }
- return false;
- }
- function skipLinkEvaluate(node) {
- var target = get_element_by_reference_default(node, 'href');
- if (target) {
- return _isVisibleToScreenReaders(target) || void 0;
- }
- return false;
- }
- var skip_link_evaluate_default = skipLinkEvaluate;
- function uniqueFrameTitleAfter(results) {
- var titles = {};
- results.forEach(function(r) {
- titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0;
- });
- results.forEach(function(r) {
- r.result = !!titles[r.data];
- });
- return results;
- }
- var unique_frame_title_after_default = uniqueFrameTitleAfter;
- function uniqueFrameTitleEvaluate(node, options, vNode) {
- var title = sanitize_default(vNode.attr('title')).toLowerCase();
- this.data(title);
- return true;
- }
- var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate;
- function duplicateIdAfter(results) {
- var uniqueIds = [];
- return results.filter(function(r) {
- if (uniqueIds.indexOf(r.data) === -1) {
- uniqueIds.push(r.data);
- return true;
- }
- return false;
- });
- }
- var duplicate_id_after_default = duplicateIdAfter;
- function duplicateIdEvaluate(node) {
- var id = node.getAttribute('id').trim();
- if (!id) {
- return true;
- }
- var root = get_root_node_default2(node);
- var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) {
- return foundNode !== node;
- });
- if (matchingNodes.length) {
- this.relatedNodes(matchingNodes);
- }
- this.data(id);
- return matchingNodes.length === 0;
- }
- var duplicate_id_evaluate_default = duplicateIdEvaluate;
- function ariaLabelEvaluate(node, options, virtualNode) {
- return !!sanitize_default(arialabel_text_default(virtualNode));
- }
- var aria_label_evaluate_default = ariaLabelEvaluate;
- function ariaLabelledbyEvaluate(node, options, virtualNode) {
- try {
- return !!sanitize_default(arialabelledby_text_default(virtualNode));
- } catch (e) {
- return void 0;
- }
- }
- var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate;
- function avoidInlineSpacingEvaluate(node, options) {
- var overriddenProperties = options.cssProperties.filter(function(property) {
- if (node.style.getPropertyPriority(property) === 'important') {
- return property;
- }
- });
- if (overriddenProperties.length > 0) {
- this.data(overriddenProperties);
- return false;
- }
- return true;
- }
- var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate;
- function docHasTitleEvaluate() {
- var title = document.title;
- return !!sanitize_default(title);
- }
- var doc_has_title_evaluate_default = docHasTitleEvaluate;
- function existsEvaluate() {
- return void 0;
- }
- var exists_evaluate_default = existsEvaluate;
- function hasAltEvaluate(node, options, virtualNode) {
- var nodeName2 = virtualNode.props.nodeName;
- if (![ 'img', 'input', 'area' ].includes(nodeName2)) {
- return false;
- }
- return virtualNode.hasAttr('alt');
- }
- var has_alt_evaluate_default = hasAltEvaluate;
- function inlineStyleProperty(node, options) {
- 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;
- if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) {
- return true;
- }
- var data2 = {};
- if (typeof minValue === 'number') {
- data2.minValue = minValue;
- }
- if (typeof maxValue === 'number') {
- data2.maxValue = maxValue;
- }
- var declaredPropValue = node.style.getPropertyValue(cssProperty);
- if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
- this.data(_extends({
- value: declaredPropValue
- }, data2));
- return true;
- }
- var value = getNumberValue(node, {
- absoluteValues: absoluteValues,
- cssProperty: cssProperty,
- normalValue: normalValue
- });
- this.data(_extends({
- value: value
- }, data2));
- if (typeof value !== 'number') {
- return void 0;
- }
- if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) {
- return true;
- }
- return false;
- }
- function getNumberValue(domNode, _ref114) {
- var cssProperty = _ref114.cssProperty, absoluteValues = _ref114.absoluteValues, normalValue = _ref114.normalValue;
- var computedStyle = window.getComputedStyle(domNode);
- var cssPropValue = computedStyle.getPropertyValue(cssProperty);
- if (cssPropValue === 'normal') {
- return normalValue;
- }
- var parsedValue = parseFloat(cssPropValue);
- if (absoluteValues) {
- return parsedValue;
- }
- var fontSize = parseFloat(computedStyle.getPropertyValue('font-size'));
- var value = Math.round(parsedValue / fontSize * 100) / 100;
- if (isNaN(value)) {
- return cssPropValue;
- }
- return value;
- }
- function isOnScreenEvaluate(node) {
- return _isVisibleOnScreen(node);
- }
- var is_on_screen_evaluate_default = isOnScreenEvaluate;
- function nonEmptyIfPresentEvaluate(node, options, virtualNode) {
- var nodeName2 = virtualNode.props.nodeName;
- var type = (virtualNode.attr('type') || '').toLowerCase();
- var label3 = virtualNode.attr('value');
- if (label3) {
- this.data({
- messageKey: 'has-label'
- });
- }
- if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type)) {
- return label3 === null;
- }
- return false;
- }
- var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate;
- function presentationalRoleEvaluate(node, options, virtualNode) {
- var explicitRole2 = get_explicit_role_default(virtualNode);
- if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) {
- this.data({
- messageKey: 'iframe',
- nodeName: virtualNode.props.nodeName
- });
- return false;
- }
- var role = get_role_default(virtualNode);
- if ([ 'presentation', 'none' ].includes(role)) {
- this.data({
- role: role
- });
- return true;
- }
- if (![ 'presentation', 'none' ].includes(explicitRole2)) {
- return false;
- }
- var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
- return virtualNode.hasAttr(attr);
- });
- var focusable = _isFocusable(virtualNode);
- var messageKey;
- if (hasGlobalAria && !focusable) {
- messageKey = 'globalAria';
- } else if (!hasGlobalAria && focusable) {
- messageKey = 'focusable';
- } else {
- messageKey = 'both';
- }
- this.data({
- messageKey: messageKey,
- role: role
- });
- return false;
- }
- function svgNonEmptyTitleEvaluate(node, options, virtualNode) {
- if (!virtualNode.children) {
- return void 0;
- }
- var titleNode = virtualNode.children.find(function(_ref115) {
- var props = _ref115.props;
- return props.nodeName === 'title';
- });
- if (!titleNode) {
- this.data({
- messageKey: 'noTitle'
- });
- return false;
- }
- try {
- var titleText2 = subtree_text_default(titleNode, {
- includeHidden: true
- }).trim();
- if (titleText2 === '') {
- this.data({
- messageKey: 'emptyTitle'
- });
- return false;
- }
- } catch (e) {
- return void 0;
- }
- return true;
- }
- var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate;
- function captionFakedEvaluate(node) {
- var table = to_grid_default(node);
- var firstRow = table[0];
- if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
- return true;
- }
- return firstRow.reduce(function(out, curr, i) {
- return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0;
- }, false);
- }
- var caption_faked_evaluate_default = captionFakedEvaluate;
- function html5ScopeEvaluate(node) {
- if (!is_html5_default(document)) {
- return true;
- }
- return node.nodeName.toUpperCase() === 'TH';
- }
- var html5_scope_evaluate_default = html5ScopeEvaluate;
- var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate;
- function sameCaptionSummaryEvaluate(node, options, virtualNode) {
- if (virtualNode.children === void 0) {
- return void 0;
- }
- var summary = virtualNode.attr('summary');
- var captionNode = virtualNode.children.find(isCaptionNode);
- var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false;
- if (!caption || !summary) {
- return false;
- }
- return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase();
- }
- function isCaptionNode(virtualNode) {
- return virtualNode.props.nodeName === 'caption';
- }
- function scopeValueEvaluate(node, options) {
- var value = node.getAttribute('scope').toLowerCase();
- return options.values.indexOf(value) !== -1;
- }
- var scope_value_evaluate_default = scopeValueEvaluate;
- function tdHasHeaderEvaluate(node) {
- var badCells = [];
- var cells = get_all_cells_default(node);
- var tableGrid = to_grid_default(node);
- cells.forEach(function(cell) {
- if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) {
- var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) {
- return header !== null && !!has_content_default(header);
- });
- if (!hasHeaders) {
- badCells.push(cell);
- }
- }
- });
- if (badCells.length) {
- this.relatedNodes(badCells);
- return false;
- }
- return true;
- }
- var td_has_header_evaluate_default = tdHasHeaderEvaluate;
- function tdHeadersAttrEvaluate(node) {
- var cells = [];
- var reviewCells = [];
- var badCells = [];
- for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) {
- var row = node.rows[rowIndex];
- for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
- cells.push(row.cells[cellIndex]);
- }
- }
- var ids = cells.reduce(function(ids2, cell) {
- if (cell.getAttribute('id')) {
- ids2.push(cell.getAttribute('id'));
- }
- return ids2;
- }, []);
- cells.forEach(function(cell) {
- var isSelf = false;
- var notOfTable = false;
- if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) {
- return;
- }
- var headersAttr = cell.getAttribute('headers').trim();
- if (!headersAttr) {
- return reviewCells.push(cell);
- }
- var headers = token_list_default(headersAttr);
- if (headers.length !== 0) {
- if (cell.getAttribute('id')) {
- isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1;
- }
- notOfTable = headers.some(function(header) {
- return !ids.includes(header);
- });
- if (isSelf || notOfTable) {
- badCells.push(cell);
- }
- }
- });
- if (badCells.length > 0) {
- this.relatedNodes(badCells);
- return false;
- }
- if (reviewCells.length) {
- this.relatedNodes(reviewCells);
- return void 0;
- }
- return true;
- }
- var td_headers_attr_evaluate_default = tdHeadersAttrEvaluate;
- function thHasDataCellsEvaluate(node) {
- var cells = get_all_cells_default(node);
- var checkResult = this;
- var reffedHeaders = [];
- cells.forEach(function(cell) {
- var headers2 = cell.getAttribute('headers');
- if (headers2) {
- reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/));
- }
- var ariaLabel = cell.getAttribute('aria-labelledby');
- if (ariaLabel) {
- reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/));
- }
- });
- var headers = cells.filter(function(cell) {
- if (sanitize_default(cell.textContent) === '') {
- return false;
- }
- return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1;
- });
- var tableGrid = to_grid_default(node);
- var out = true;
- headers.forEach(function(header) {
- if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) {
- return;
- }
- var pos = get_cell_position_default(header, tableGrid);
- var hasCell = false;
- if (is_column_header_default(header)) {
- hasCell = traverse_default('down', pos, tableGrid).find(function(cell) {
- return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
- });
- }
- if (!hasCell && is_row_header_default(header)) {
- hasCell = traverse_default('right', pos, tableGrid).find(function(cell) {
- return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
- });
- }
- if (!hasCell) {
- checkResult.relatedNodes(header);
- }
- out = out && hasCell;
- });
- return out ? true : void 0;
- }
- var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate;
- function hiddenContentEvaluate(node, options, virtualNode) {
- var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ];
- if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) {
- var styles = window.getComputedStyle(node);
- if (styles.getPropertyValue('display') === 'none') {
- return void 0;
- } else if (styles.getPropertyValue('visibility') === 'hidden') {
- var parent = get_composed_parent_default(node);
- var parentStyle = parent && window.getComputedStyle(parent);
- if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') {
- return void 0;
- }
- }
- }
- return true;
- }
- var hidden_content_evaluate_default = hiddenContentEvaluate;
- function ariaAllowedAttrMatches(node, virtualNode) {
- var aria = /^aria-/;
- var attrs = virtualNode.attrNames;
- if (attrs.length) {
- for (var _i29 = 0, l = attrs.length; _i29 < l; _i29++) {
- if (aria.test(attrs[_i29])) {
- return true;
- }
- }
- }
- return false;
- }
- var aria_allowed_attr_matches_default = ariaAllowedAttrMatches;
- function ariaAllowedRoleMatches(node, virtualNode) {
- return get_explicit_role_default(virtualNode, {
- dpub: true,
- fallback: true
- }) !== null;
- }
- var aria_allowed_role_matches_default = ariaAllowedRoleMatches;
- function ariaHasAttrMatches(node, virtualNode) {
- var aria = /^aria-/;
- return virtualNode.attrNames.some(function(attr) {
- return aria.test(attr);
- });
- }
- var aria_has_attr_matches_default = ariaHasAttrMatches;
- function shouldMatchElement(el) {
- if (!el) {
- return true;
- }
- if (el.getAttribute('aria-hidden') === 'true') {
- return false;
- }
- return shouldMatchElement(get_composed_parent_default(el));
- }
- function ariaHiddenFocusMatches(node) {
- return shouldMatchElement(get_composed_parent_default(node));
- }
- var aria_hidden_focus_matches_default = ariaHiddenFocusMatches;
- function ariaRequiredChildrenMatches(node, virtualNode) {
- var role = get_explicit_role_default(virtualNode, {
- dpub: true
- });
- return !!required_owned_default(role);
- }
- var aria_required_children_matches_default = ariaRequiredChildrenMatches;
- function ariaRequiredParentMatches(node, virtualNode) {
- var role = get_explicit_role_default(virtualNode);
- return !!required_context_default(role);
- }
- var aria_required_parent_matches_default = ariaRequiredParentMatches;
- function autocompleteMatches(node, virtualNode) {
- var autocomplete2 = virtualNode.attr('autocomplete');
- if (!autocomplete2 || sanitize_default(autocomplete2) === '') {
- return false;
- }
- var nodeName2 = virtualNode.props.nodeName;
- if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) {
- return false;
- }
- var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ];
- if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) {
- return false;
- }
- var ariaDisabled = virtualNode.attr('aria-disabled') || 'false';
- if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') {
- return false;
- }
- var role = virtualNode.attr('role');
- var tabIndex = virtualNode.attr('tabindex');
- if (tabIndex === '-1' && role) {
- var roleDef = standards_default.ariaRoles[role];
- if (roleDef === void 0 || roleDef.type !== 'widget') {
- return false;
- }
- }
- if (tabIndex === '-1' && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
- return false;
- }
- return true;
- }
- var autocomplete_matches_default = autocompleteMatches;
- function isInitiatorMatches(node, virtualNode, context) {
- return context.initiator;
- }
- var is_initiator_matches_default = isInitiatorMatches;
- function bypassMatches(node, virtualNode, context) {
- if (is_initiator_matches_default(node, virtualNode, context)) {
- return !!node.querySelector('a[href]');
- }
- return true;
- }
- var bypass_matches_default = bypassMatches;
- function colorContrastMatches(node, virtualNode) {
- var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, inputType = _virtualNode$props.type;
- if (nodeName2 === 'option') {
- return false;
- }
- if (nodeName2 === 'select' && !node.options.length) {
- return false;
- }
- var nonTextInput = [ 'hidden', 'range', 'color', 'checkbox', 'radio', 'image' ];
- if (nodeName2 === 'input' && nonTextInput.includes(inputType)) {
- return false;
- }
- if (is_disabled_default(virtualNode) || _isInert(virtualNode)) {
- return false;
- }
- var formElements = [ 'input', 'select', 'textarea' ];
- if (formElements.includes(nodeName2)) {
- var style = window.getComputedStyle(node);
- var textIndent = parseInt(style.getPropertyValue('text-indent'), 10);
- if (textIndent) {
- var rect = node.getBoundingClientRect();
- rect = {
- top: rect.top,
- bottom: rect.bottom,
- left: rect.left + textIndent,
- right: rect.right + textIndent
- };
- if (!visually_overlaps_default(rect, node)) {
- return false;
- }
- }
- return true;
- }
- var nodeParentLabel = find_up_virtual_default(virtualNode, 'label');
- if (nodeName2 === 'label' || nodeParentLabel) {
- var labelNode = nodeParentLabel || node;
- var labelVirtual3 = nodeParentLabel ? get_node_from_tree_default(nodeParentLabel) : virtualNode;
- if (labelNode.htmlFor) {
- var doc = get_root_node_default2(labelNode);
- var explicitControl = doc.getElementById(labelNode.htmlFor);
- var explicitControlVirtual = explicitControl && get_node_from_tree_default(explicitControl);
- if (explicitControlVirtual && is_disabled_default(explicitControlVirtual)) {
- return false;
- }
- }
- var query = 'input:not([type="hidden"],[type="image"],[type="button"],[type="submit"],[type="reset"]), select, textarea';
- var implicitControl = query_selector_all_default(labelVirtual3, query)[0];
- if (implicitControl && is_disabled_default(implicitControl)) {
- return false;
- }
- }
- var ariaLabelledbyControls = [];
- var ancestorNode = virtualNode;
- while (ancestorNode) {
- if (ancestorNode.props.id) {
- var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) {
- return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id);
- }).map(function(control) {
- return get_node_from_tree_default(control);
- });
- ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls));
- }
- ancestorNode = ancestorNode.parent;
- }
- if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) {
- return false;
- }
- if (!hasRealTextChildren(virtualNode)) {
- return false;
- }
- var range = document.createRange();
- var childNodes = virtualNode.children;
- for (var index = 0; index < childNodes.length; index++) {
- var child = childNodes[index];
- if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') {
- range.selectNodeContents(child.actualNode);
- }
- }
- var rects = range.getClientRects();
- for (var _index2 = 0; _index2 < rects.length; _index2++) {
- if (visually_overlaps_default(rects[_index2], node)) {
- return true;
- }
- }
- return false;
- }
- var color_contrast_matches_default = colorContrastMatches;
- var removeUnicodeOptions = {
- emoji: true,
- nonBmp: false,
- punctuations: true
- };
- function hasRealTextChildren(virtualNode) {
- var visibleText = visible_virtual_default(virtualNode, false, true);
- if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') {
- return false;
- }
- return virtualNode.children.some(function(vChild) {
- return vChild.props.nodeName === '#text' && !is_icon_ligature_default(vChild);
- });
- }
- function dataTableLargeMatches(node) {
- if (is_data_table_default(node)) {
- var tableArray = to_grid_default(node);
- return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3;
- }
- return false;
- }
- var data_table_large_matches_default = dataTableLargeMatches;
- function dataTableMatches(node) {
- return is_data_table_default(node);
- }
- var data_table_matches_default = dataTableMatches;
- function duplicateIdActiveMatches(node) {
- var id = node.getAttribute('id').trim();
- var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
- var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
- return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable);
- }
- var duplicate_id_active_matches_default = duplicateIdActiveMatches;
- function duplicateIdAriaMatches(node) {
- return is_accessible_ref_default(node);
- }
- var duplicate_id_aria_matches_default = duplicateIdAriaMatches;
- function duplicateIdMiscMatches(node) {
- var id = node.getAttribute('id').trim();
- var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
- var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
- return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) {
- return !_isFocusable(elm);
- });
- }
- var duplicate_id_misc_matches_default = duplicateIdMiscMatches;
- function frameFocusableContentMatches(node, virtualNode, context) {
- var _context$size, _context$size2;
- 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;
- }
- var frame_focusable_content_matches_default = frameFocusableContentMatches;
- function frameTitleHasTextMatches(node) {
- var title = node.getAttribute('title');
- return !!sanitize_default(title);
- }
- var frame_title_has_text_matches_default = frameTitleHasTextMatches;
- function hasImplicitChromiumRoleMatches(node, virtualNode) {
- return implicit_role_default(virtualNode, {
- chromium: true
- }) !== null;
- }
- var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches;
- function headingMatches(node, virtualNode) {
- return get_role_default(virtualNode) === 'heading';
- }
- function svgNamespaceMatches(node, virtualNode) {
- try {
- var nodeName2 = virtualNode.props.nodeName;
- if (nodeName2 === 'svg') {
- return true;
- }
- return !!closest_default(virtualNode, 'svg');
- } catch (e) {
- return false;
- }
- }
- var svg_namespace_matches_default = svgNamespaceMatches;
- function htmlNamespaceMatches(node, virtualNode) {
- return !svg_namespace_matches_default(node, virtualNode);
- }
- var html_namespace_matches_default = htmlNamespaceMatches;
- function identicalLinksSamePurposeMatches(node, virtualNode) {
- var hasAccName = !!accessible_text_virtual_default(virtualNode);
- if (!hasAccName) {
- return false;
- }
- var role = get_role_default(node);
- if (role && role !== 'link') {
- return false;
- }
- return true;
- }
- var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches;
- function insertedIntoFocusOrderMatches(node) {
- return inserted_into_focus_order_default(node);
- }
- var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches;
- function hasVisibleTextMatches(node) {
- return _isVisibleOnScreen(node);
- }
- function isVisibleOnScreenMatches(node, virtualNode) {
- return _isVisibleOnScreen(virtualNode);
- }
- function labelContentNameMismatchMatches(node, virtualNode) {
- var role = get_role_default(node);
- if (!role) {
- return false;
- }
- var widgetRoles = get_aria_roles_by_type_default('widget');
- var isWidgetType2 = widgetRoles.includes(role);
- if (!isWidgetType2) {
- return false;
- }
- var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default();
- if (!rolesWithNameFromContents.includes(role)) {
- return false;
- }
- if (!sanitize_default(arialabel_text_default(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) {
- return false;
- }
- if (!sanitize_default(visible_virtual_default(virtualNode))) {
- return false;
- }
- return true;
- }
- var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches;
- function labelMatches(node, virtualNode) {
- if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) {
- return true;
- }
- var type = virtualNode.attr('type').toLowerCase();
- return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type) === false;
- }
- var label_matches_default = labelMatches;
- function landmarkHasBodyContextMatches(node, virtualNode) {
- var nativeScopeFilter = 'article, aside, main, nav, section';
- return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter);
- }
- var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches;
- function landmarkUniqueMatches(node, virtualNode) {
- var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(',');
- function isHeaderFooterLandmark(headerFooterElement) {
- return !closest_default(headerFooterElement, excludedParentsForHeaderFooterLandmarks);
- }
- function isLandmarkVirtual(virtualNode2) {
- var actualNode = virtualNode2.actualNode;
- var landmarkRoles3 = get_aria_roles_by_type_default('landmark');
- var role = get_role_default(actualNode);
- if (!role) {
- return false;
- }
- var nodeName2 = actualNode.nodeName.toUpperCase();
- if (nodeName2 === 'HEADER' || nodeName2 === 'FOOTER') {
- return isHeaderFooterLandmark(virtualNode2);
- }
- if (nodeName2 === 'SECTION' || nodeName2 === 'FORM') {
- var accessibleText2 = accessible_text_virtual_default(virtualNode2);
- return !!accessibleText2;
- }
- return landmarkRoles3.indexOf(role) >= 0 || role === 'region';
- }
- return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(node);
- }
- var landmark_unique_matches_default = landmarkUniqueMatches;
- function dataTableMatches2(node) {
- return !is_data_table_default(node) && !_isFocusable(node);
- }
- var layout_table_matches_default = dataTableMatches2;
- function linkInTextBlockMatches(node) {
- var text = sanitize_default(node.innerText);
- var role = node.getAttribute('role');
- if (role && role !== 'link') {
- return false;
- }
- if (!text) {
- return false;
- }
- if (!_isVisibleOnScreen(node)) {
- return false;
- }
- return is_in_text_block_default(node);
- }
- var link_in_text_block_matches_default = linkInTextBlockMatches;
- function nestedInteractiveMatches(node, virtualNode) {
- var role = get_role_default(virtualNode);
- if (!role) {
- return false;
- }
- return !!standards_default.ariaRoles[role].childrenPresentational;
- }
- var nested_interactive_matches_default = nestedInteractiveMatches;
- function noAutoplayAudioMatches(node) {
- if (!node.currentSrc) {
- return false;
- }
- if (node.hasAttribute('paused') || node.hasAttribute('muted')) {
- return false;
- }
- return true;
- }
- var no_autoplay_audio_matches_default = noAutoplayAudioMatches;
- function noEmptyRoleMatches(node, virtualNode) {
- if (!virtualNode.hasAttr('role')) {
- return false;
- }
- if (!virtualNode.attr('role').trim()) {
- return false;
- }
- return true;
- }
- var no_empty_role_matches_default = noEmptyRoleMatches;
- function noExplicitNameRequired(node, virtualNode) {
- var role = get_explicit_role_default(virtualNode);
- if (!role || [ 'none', 'presentation' ].includes(role)) {
- return true;
- }
- var _ref116 = aria_roles_default[role] || {}, accessibleNameRequired = _ref116.accessibleNameRequired;
- if (accessibleNameRequired || _isFocusable(virtualNode)) {
- return true;
- }
- return false;
- }
- var no_explicit_name_required_matches_default = noExplicitNameRequired;
- function noNamingMethodMatches(node, virtualNode) {
- var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods;
- if (namingMethods && namingMethods.length !== 0) {
- return false;
- }
- if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) {
- return false;
- }
- if (_isComboboxPopup(virtualNode, {
- popupRoles: [ 'listbox' ]
- })) {
- return false;
- }
- return true;
- }
- var no_naming_method_matches_default = noNamingMethodMatches;
- function noNegativeTabindexMatches(node, virtualNode) {
- var tabindex = parseInt(virtualNode.attr('tabindex'), 10);
- return isNaN(tabindex) || tabindex >= 0;
- }
- var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
- function noRoleMatches(node, vNode) {
- return !vNode.attr('role');
- }
- var no_role_matches_default = noRoleMatches;
- function notHtmlMatches(node, virtualNode) {
- return virtualNode.props.nodeName !== 'html';
- }
- var not_html_matches_default = notHtmlMatches;
- var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) {
- return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) {
- return fn(node, vNode);
- });
- };
- function objectHasLoaded(node) {
- var _node$ownerDocument;
- if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) {
- return true;
- }
- var range = node.ownerDocument.createRange();
- range.setStart(node, 0);
- range.setEnd(node, node.childNodes.length);
- return range.getClientRects().length === 0;
- }
- function pAsHeadingMatches(node) {
- var children = Array.from(node.parentNode.childNodes);
- var nodeText = node.textContent.trim();
- var isSentence = /[.!?:;](?![.!?:;])/g;
- if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) {
- return false;
- }
- var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) {
- return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== '';
- });
- return siblingsAfter.length !== 0;
- }
- var p_as_heading_matches_default = pAsHeadingMatches;
- function presentationRoleConflictMatches(node, virtualNode) {
- return implicit_role_default(virtualNode, {
- chromiumRoles: true
- }) !== null;
- }
- var presentation_role_conflict_matches_default = presentationRoleConflictMatches;
- function scrollableRegionFocusableMatches(node, virtualNode) {
- return _getScroll(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode);
- }
- function isNoneEmptyElement(vNode) {
- return query_selector_all_default(vNode, '*').some(function(elm) {
- return has_content_virtual_default(elm, true, true);
- });
- }
- function skipLinkMatches(node) {
- return _isSkipLink(node) && is_offscreen_default(node);
- }
- var skip_link_matches_default = skipLinkMatches;
- function tableOrGridRoleMatches(_, vNode) {
- var role = get_role_default(vNode);
- return [ 'treegrid', 'grid', 'table' ].includes(role);
- }
- function widgetNotInline(node, vNode) {
- return matchesFns.every(function(fn) {
- return fn(node, vNode);
- });
- }
- var matchesFns = [ function(node, vNode) {
- return isWidgetType(vNode);
- }, function(node, vNode) {
- return isNotAreaElement(vNode);
- }, function(node, vNode) {
- return !svg_namespace_matches_default(node, vNode);
- }, function(node, vNode) {
- return _isFocusable(vNode);
- }, function(node, vNode) {
- return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode);
- }, function(node) {
- return !is_in_text_block_default(node, {
- noLengthCompare: true
- });
- } ];
- function isWidgetType(vNode) {
- return get_role_type_default(vNode) === 'widget';
- }
- function isNotAreaElement(vNode) {
- return vNode.props.nodeName !== 'area';
- }
- var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) {
- if (!(vNode !== null && vNode !== void 0 && vNode.parent)) {
- return false;
- }
- if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) {
- return true;
- }
- return hasWidgetAncestorInTabOrderMemoized(vNode.parent);
- });
- function windowIsTopMatches(node) {
- return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top;
- }
- var window_is_top_matches_default = windowIsTopMatches;
- function xmlLangMismatchMatches(node) {
- var primaryLangValue = get_base_lang_default(node.getAttribute('lang'));
- var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang'));
- return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue);
- }
- var xml_lang_mismatch_matches_default = xmlLangMismatchMatches;
- var metadataFunctionMap = {
- 'abstractrole-evaluate': abstractrole_evaluate_default,
- 'accesskeys-after': accesskeys_after_default,
- 'accesskeys-evaluate': accesskeys_evaluate_default,
- 'alt-space-value-evaluate': alt_space_value_evaluate_default,
- 'aria-allowed-attr-evaluate': ariaAllowedAttrEvaluate,
- 'aria-allowed-attr-matches': aria_allowed_attr_matches_default,
- 'aria-allowed-role-evaluate': aria_allowed_role_evaluate_default,
- 'aria-allowed-role-matches': aria_allowed_role_matches_default,
- 'aria-busy-evaluate': ariaBusyEvaluate,
- 'aria-errormessage-evaluate': aria_errormessage_evaluate_default,
- 'aria-has-attr-matches': aria_has_attr_matches_default,
- 'aria-hidden-body-evaluate': aria_hidden_body_evaluate_default,
- 'aria-hidden-focus-matches': aria_hidden_focus_matches_default,
- 'aria-label-evaluate': aria_label_evaluate_default,
- 'aria-labelledby-evaluate': aria_labelledby_evaluate_default,
- 'aria-level-evaluate': aria_level_evaluate_default,
- 'aria-prohibited-attr-evaluate': ariaProhibitedAttrEvaluate,
- 'aria-required-attr-evaluate': ariaRequiredAttrEvaluate,
- 'aria-required-children-evaluate': ariaRequiredChildrenEvaluate,
- 'aria-required-children-matches': aria_required_children_matches_default,
- 'aria-required-parent-evaluate': aria_required_parent_evaluate_default,
- 'aria-required-parent-matches': aria_required_parent_matches_default,
- 'aria-roledescription-evaluate': aria_roledescription_evaluate_default,
- 'aria-unsupported-attr-evaluate': aria_unsupported_attr_evaluate_default,
- 'aria-valid-attr-evaluate': aria_valid_attr_evaluate_default,
- 'aria-valid-attr-value-evaluate': ariaValidAttrValueEvaluate,
- 'attr-non-space-content-evaluate': attr_non_space_content_evaluate_default,
- 'autocomplete-appropriate-evaluate': autocomplete_appropriate_evaluate_default,
- 'autocomplete-matches': autocomplete_matches_default,
- 'autocomplete-valid-evaluate': autocomplete_valid_evaluate_default,
- 'avoid-inline-spacing-evaluate': avoid_inline_spacing_evaluate_default,
- 'bypass-matches': bypass_matches_default,
- 'caption-evaluate': caption_evaluate_default,
- 'caption-faked-evaluate': caption_faked_evaluate_default,
- 'color-contrast-evaluate': colorContrastEvaluate,
- 'color-contrast-matches': color_contrast_matches_default,
- 'css-orientation-lock-evaluate': css_orientation_lock_evaluate_default,
- 'data-table-large-matches': data_table_large_matches_default,
- 'data-table-matches': data_table_matches_default,
- 'deprecatedrole-evaluate': deprecatedroleEvaluate,
- 'dlitem-evaluate': dlitem_evaluate_default,
- 'doc-has-title-evaluate': doc_has_title_evaluate_default,
- 'duplicate-id-active-matches': duplicate_id_active_matches_default,
- 'duplicate-id-after': duplicate_id_after_default,
- 'duplicate-id-aria-matches': duplicate_id_aria_matches_default,
- 'duplicate-id-evaluate': duplicate_id_evaluate_default,
- 'duplicate-id-misc-matches': duplicate_id_misc_matches_default,
- 'duplicate-img-label-evaluate': duplicate_img_label_evaluate_default,
- 'exists-evaluate': exists_evaluate_default,
- 'explicit-evaluate': explicit_evaluate_default,
- 'fallbackrole-evaluate': fallbackrole_evaluate_default,
- 'focusable-content-evaluate': focusable_content_evaluate_default,
- 'focusable-disabled-evaluate': focusable_disabled_evaluate_default,
- 'focusable-element-evaluate': focusable_element_evaluate_default,
- 'focusable-modal-open-evaluate': focusable_modal_open_evaluate_default,
- 'focusable-no-name-evaluate': focusable_no_name_evaluate_default,
- 'focusable-not-tabbable-evaluate': focusable_not_tabbable_evaluate_default,
- 'frame-focusable-content-evaluate': frameFocusableContentEvaluate,
- 'frame-focusable-content-matches': frame_focusable_content_matches_default,
- 'frame-tested-after': frame_tested_after_default,
- 'frame-tested-evaluate': frame_tested_evaluate_default,
- 'frame-title-has-text-matches': frame_title_has_text_matches_default,
- 'has-alt-evaluate': has_alt_evaluate_default,
- 'has-descendant-after': has_descendant_after_default,
- 'has-descendant-evaluate': has_descendant_evaluate_default,
- 'has-global-aria-attribute-evaluate': has_global_aria_attribute_evaluate_default,
- 'has-implicit-chromium-role-matches': has_implicit_chromium_role_matches_default,
- 'has-lang-evaluate': has_lang_evaluate_default,
- 'has-text-content-evaluate': hasTextContentEvaluate,
- 'has-widget-role-evaluate': has_widget_role_evaluate_default,
- 'heading-matches': headingMatches,
- 'heading-order-after': headingOrderAfter,
- 'heading-order-evaluate': heading_order_evaluate_default,
- 'help-same-as-label-evaluate': help_same_as_label_evaluate_default,
- 'hidden-content-evaluate': hidden_content_evaluate_default,
- 'hidden-explicit-label-evaluate': hidden_explicit_label_evaluate_default,
- 'html-namespace-matches': html_namespace_matches_default,
- 'html5-scope-evaluate': html5_scope_evaluate_default,
- 'identical-links-same-purpose-after': identical_links_same_purpose_after_default,
- 'identical-links-same-purpose-evaluate': identical_links_same_purpose_evaluate_default,
- 'identical-links-same-purpose-matches': identical_links_same_purpose_matches_default,
- 'implicit-evaluate': implicit_evaluate_default,
- 'inline-style-property-evaluate': inlineStyleProperty,
- 'inserted-into-focus-order-matches': inserted_into_focus_order_matches_default,
- 'internal-link-present-evaluate': internal_link_present_evaluate_default,
- 'invalid-children-evaluate': invalidChildrenEvaluate,
- 'invalidrole-evaluate': invalidrole_evaluate_default,
- 'is-element-focusable-evaluate': is_element_focusable_evaluate_default,
- 'is-initiator-matches': is_initiator_matches_default,
- 'is-on-screen-evaluate': is_on_screen_evaluate_default,
- 'is-visible-matches': hasVisibleTextMatches,
- 'is-visible-on-screen-matches': isVisibleOnScreenMatches,
- 'label-content-name-mismatch-evaluate': label_content_name_mismatch_evaluate_default,
- 'label-content-name-mismatch-matches': label_content_name_mismatch_matches_default,
- 'label-matches': label_matches_default,
- 'landmark-has-body-context-matches': landmark_has_body_context_matches_default,
- 'landmark-is-top-level-evaluate': landmark_is_top_level_evaluate_default,
- 'landmark-is-unique-after': landmark_is_unique_after_default,
- 'landmark-is-unique-evaluate': landmark_is_unique_evaluate_default,
- 'landmark-unique-matches': landmark_unique_matches_default,
- 'layout-table-matches': layout_table_matches_default,
- 'link-in-text-block-evaluate': link_in_text_block_evaluate_default,
- 'link-in-text-block-matches': link_in_text_block_matches_default,
- 'link-in-text-block-style-evaluate': link_in_text_block_style_evaluate_default,
- 'listitem-evaluate': listitemEvaluate,
- 'matches-definition-evaluate': matches_definition_evaluate_default,
- 'meta-refresh-evaluate': metaRefreshEvaluate,
- 'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
- 'multiple-label-evaluate': multiple_label_evaluate_default,
- 'nested-interactive-matches': nested_interactive_matches_default,
- 'no-autoplay-audio-evaluate': no_autoplay_audio_evaluate_default,
- 'no-autoplay-audio-matches': no_autoplay_audio_matches_default,
- 'no-empty-role-matches': no_empty_role_matches_default,
- 'no-explicit-name-required-matches': no_explicit_name_required_matches_default,
- 'no-focusable-content-evaluate': noFocusableContentEvaluate,
- 'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
- 'no-naming-method-matches': no_naming_method_matches_default,
- 'no-negative-tabindex-matches': no_negative_tabindex_matches_default,
- 'no-role-matches': no_role_matches_default,
- 'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
- 'not-html-matches': not_html_matches_default,
- 'object-is-loaded-matches': object_is_loaded_matches_default,
- 'only-dlitems-evaluate': only_dlitems_evaluate_default,
- 'only-listitems-evaluate': only_listitems_evaluate_default,
- 'p-as-heading-evaluate': p_as_heading_evaluate_default,
- 'p-as-heading-matches': p_as_heading_matches_default,
- 'page-no-duplicate-after': page_no_duplicate_after_default,
- 'page-no-duplicate-evaluate': page_no_duplicate_evaluate_default,
- 'presentation-role-conflict-matches': presentation_role_conflict_matches_default,
- 'presentational-role-evaluate': presentationalRoleEvaluate,
- 'region-after': region_after_default,
- 'region-evaluate': regionEvaluate,
- 'same-caption-summary-evaluate': same_caption_summary_evaluate_default,
- 'scope-value-evaluate': scope_value_evaluate_default,
- 'scrollable-region-focusable-matches': scrollableRegionFocusableMatches,
- 'skip-link-evaluate': skip_link_evaluate_default,
- 'skip-link-matches': skip_link_matches_default,
- 'structured-dlitems-evaluate': structured_dlitems_evaluate_default,
- 'svg-namespace-matches': svg_namespace_matches_default,
- 'svg-non-empty-title-evaluate': svg_non_empty_title_evaluate_default,
- 'tabindex-evaluate': tabindex_evaluate_default,
- 'table-or-grid-role-matches': tableOrGridRoleMatches,
- 'target-offset-evaluate': targetOffsetEvaluate,
- 'target-size-evaluate': targetSize,
- 'td-has-header-evaluate': td_has_header_evaluate_default,
- 'td-headers-attr-evaluate': td_headers_attr_evaluate_default,
- 'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default,
- 'title-only-evaluate': title_only_evaluate_default,
- 'unique-frame-title-after': unique_frame_title_after_default,
- 'unique-frame-title-evaluate': unique_frame_title_evaluate_default,
- 'unsupportedrole-evaluate': unsupportedrole_evaluate_default,
- 'valid-lang-evaluate': valid_lang_evaluate_default,
- 'valid-scrollable-semantics-evaluate': valid_scrollable_semantics_evaluate_default,
- 'widget-not-inline-matches': widgetNotInline,
- 'window-is-top-matches': window_is_top_matches_default,
- 'xml-lang-mismatch-evaluate': xml_lang_mismatch_evaluate_default,
- 'xml-lang-mismatch-matches': xml_lang_mismatch_matches_default
- };
- var metadata_function_map_default = metadataFunctionMap;
- function CheckResult(check) {
- this.id = check.id;
- this.data = null;
- this.relatedNodes = [];
- this.result = null;
- }
- var check_result_default = CheckResult;
- function createExecutionContext(spec) {
- if (typeof spec === 'string') {
- if (metadata_function_map_default[spec]) {
- return metadata_function_map_default[spec];
- }
- if (/^\s*function[\s\w]*\(/.test(spec)) {
- return new Function('return ' + spec + ';')();
- }
- throw new ReferenceError('Function ID does not exist in the metadata-function-map: '.concat(spec));
- }
- return spec;
- }
- function normalizeOptions() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- if (Array.isArray(options) || _typeof(options) !== 'object') {
- options = {
- value: options
- };
- }
- return options;
- }
- function Check(spec) {
- if (spec) {
- this.id = spec.id;
- this.configure(spec);
- }
- }
- Check.prototype.enabled = true;
- Check.prototype.run = function run(node, options, context, resolve, reject) {
- options = options || {};
- var enabled = options.hasOwnProperty('enabled') ? options.enabled : this.enabled;
- var checkOptions = this.getOptions(options.options);
- if (enabled) {
- var checkResult = new check_result_default(this);
- var helper = check_helper_default(checkResult, options, resolve, reject);
- var result;
- try {
- result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
- } catch (e) {
- if (node && node.actualNode) {
- e.errorNode = new dq_element_default(node).toJSON();
- }
- reject(e);
- return;
- }
- if (!helper.isAsync) {
- checkResult.result = result;
- resolve(checkResult);
- }
- } else {
- resolve(null);
- }
- };
- Check.prototype.runSync = function runSync(node, options, context) {
- options = options || {};
- var _options = options, _options$enabled = _options.enabled, enabled = _options$enabled === void 0 ? this.enabled : _options$enabled;
- if (!enabled) {
- return null;
- }
- var checkOptions = this.getOptions(options.options);
- var checkResult = new check_result_default(this);
- var helper = check_helper_default(checkResult, options);
- helper.async = function async() {
- throw new Error('Cannot run async check while in a synchronous run');
- };
- var result;
- try {
- result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
- } catch (e) {
- if (node && node.actualNode) {
- e.errorNode = new dq_element_default(node).toJSON();
- }
- throw e;
- }
- checkResult.result = result;
- return checkResult;
- };
- Check.prototype.configure = function configure2(spec) {
- var _this5 = this;
- if (!spec.evaluate || metadata_function_map_default[spec.evaluate]) {
- this._internalCheck = true;
- }
- if (spec.hasOwnProperty('enabled')) {
- this.enabled = spec.enabled;
- }
- if (spec.hasOwnProperty('options')) {
- if (this._internalCheck) {
- this.options = normalizeOptions(spec.options);
- } else {
- this.options = spec.options;
- }
- }
- [ 'evaluate', 'after' ].filter(function(prop) {
- return spec.hasOwnProperty(prop);
- }).forEach(function(prop) {
- return _this5[prop] = createExecutionContext(spec[prop]);
- });
- };
- Check.prototype.getOptions = function getOptions(options) {
- if (this._internalCheck) {
- return deep_merge_default(this.options, normalizeOptions(options || {}));
- } else {
- return options || this.options;
- }
- };
- var check_default = Check;
- function RuleResult(rule) {
- this.id = rule.id;
- this.result = constants_default.NA;
- this.pageLevel = rule.pageLevel;
- this.impact = null;
- this.nodes = [];
- }
- var rule_result_default = RuleResult;
- function Rule(spec, parentAudit) {
- this._audit = parentAudit;
- this.id = spec.id;
- this.selector = spec.selector || '*';
- if (spec.impact) {
- assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
- this.impact = spec.impact;
- }
- this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
- this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
- this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
- this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
- this.any = spec.any || [];
- this.all = spec.all || [];
- this.none = spec.none || [];
- this.tags = spec.tags || [];
- this.preload = spec.preload ? true : false;
- this.actIds = spec.actIds;
- if (spec.matches) {
- this.matches = createExecutionContext(spec.matches);
- }
- }
- Rule.prototype.matches = function matches3() {
- return true;
- };
- Rule.prototype.gather = function gather(context) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var markStart = 'mark_gather_start_' + this.id;
- var markEnd = 'mark_gather_end_' + this.id;
- var markHiddenStart = 'mark_isVisibleToScreenReaders_start_' + this.id;
- var markHiddenEnd = 'mark_isVisibleToScreenReaders_end_' + this.id;
- if (options.performanceTimer) {
- performance_timer_default.mark(markStart);
- }
- var elements = _select(this.selector, context);
- if (this.excludeHidden) {
- if (options.performanceTimer) {
- performance_timer_default.mark(markHiddenStart);
- }
- elements = elements.filter(function(element) {
- return _isVisibleToScreenReaders(element);
- });
- if (options.performanceTimer) {
- performance_timer_default.mark(markHiddenEnd);
- performance_timer_default.measure('rule_' + this.id + '#gather_axe.utils.isVisibleToScreenReaders', markHiddenStart, markHiddenEnd);
- }
- }
- if (options.performanceTimer) {
- performance_timer_default.mark(markEnd);
- performance_timer_default.measure('rule_' + this.id + '#gather', markStart, markEnd);
- }
- return elements;
- };
- Rule.prototype.runChecks = function runChecks(type, node, options, context, resolve, reject) {
- var self2 = this;
- var checkQueue = queue_default();
- this[type].forEach(function(c) {
- var check = self2._audit.checks[c.id || c];
- var option = get_check_option_default(check, self2.id, options);
- checkQueue.defer(function(res, rej) {
- check.run(node, option, context, res, rej);
- });
- });
- checkQueue.then(function(results) {
- results = results.filter(function(check) {
- return check;
- });
- resolve({
- type: type,
- results: results
- });
- })['catch'](reject);
- };
- Rule.prototype.runChecksSync = function runChecksSync(type, node, options, context) {
- var self2 = this;
- var results = [];
- this[type].forEach(function(c) {
- var check = self2._audit.checks[c.id || c];
- var option = get_check_option_default(check, self2.id, options);
- results.push(check.runSync(node, option, context));
- });
- results = results.filter(function(check) {
- return check;
- });
- return {
- type: type,
- results: results
- };
- };
- Rule.prototype.run = function run2(context) {
- var _this6 = this;
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var resolve = arguments.length > 2 ? arguments[2] : undefined;
- var reject = arguments.length > 3 ? arguments[3] : undefined;
- if (options.performanceTimer) {
- this._trackPerformance();
- }
- var q = queue_default();
- var ruleResult = new rule_result_default(this);
- var nodes;
- try {
- nodes = this.gatherAndMatchNodes(context, options);
- } catch (error) {
- reject(new SupportError({
- cause: error,
- ruleId: this.id
- }));
- return;
- }
- if (options.performanceTimer) {
- this._logGatherPerformance(nodes);
- }
- nodes.forEach(function(node) {
- q.defer(function(resolveNode, rejectNode) {
- var checkQueue = queue_default();
- [ 'any', 'all', 'none' ].forEach(function(type) {
- checkQueue.defer(function(res, rej) {
- _this6.runChecks(type, node, options, context, res, rej);
- });
- });
- checkQueue.then(function(results) {
- var result = getResult(results);
- if (result) {
- result.node = new dq_element_default(node, options);
- ruleResult.nodes.push(result);
- if (_this6.reviewOnFail) {
- [ 'any', 'all' ].forEach(function(type) {
- result[type].forEach(function(checkResult) {
- if (checkResult.result === false) {
- checkResult.result = void 0;
- }
- });
- });
- result.none.forEach(function(checkResult) {
- if (checkResult.result === true) {
- checkResult.result = void 0;
- }
- });
- }
- }
- resolveNode();
- })['catch'](function(err2) {
- return rejectNode(err2);
- });
- });
- });
- q.defer(function(resolve2) {
- return setTimeout(resolve2, 0);
- });
- if (options.performanceTimer) {
- this._logRulePerformance();
- }
- q.then(function() {
- return resolve(ruleResult);
- })['catch'](function(error) {
- return reject(error);
- });
- };
- Rule.prototype.runSync = function runSync2(context) {
- var _this7 = this;
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (options.performanceTimer) {
- this._trackPerformance();
- }
- var ruleResult = new rule_result_default(this);
- var nodes;
- try {
- nodes = this.gatherAndMatchNodes(context, options);
- } catch (error) {
- throw new SupportError({
- cause: error,
- ruleId: this.id
- });
- }
- if (options.performanceTimer) {
- this._logGatherPerformance(nodes);
- }
- nodes.forEach(function(node) {
- var results = [];
- [ 'any', 'all', 'none' ].forEach(function(type) {
- results.push(_this7.runChecksSync(type, node, options, context));
- });
- var result = getResult(results);
- if (result) {
- result.node = node.actualNode ? new dq_element_default(node, options) : null;
- ruleResult.nodes.push(result);
- if (_this7.reviewOnFail) {
- [ 'any', 'all' ].forEach(function(type) {
- result[type].forEach(function(checkResult) {
- if (checkResult.result === false) {
- checkResult.result = void 0;
- }
- });
- });
- result.none.forEach(function(checkResult) {
- if (checkResult.result === true) {
- checkResult.result = void 0;
- }
- });
- }
- }
- });
- if (options.performanceTimer) {
- this._logRulePerformance();
- }
- return ruleResult;
- };
- Rule.prototype._trackPerformance = function _trackPerformance() {
- this._markStart = 'mark_rule_start_' + this.id;
- this._markEnd = 'mark_rule_end_' + this.id;
- this._markChecksStart = 'mark_runchecks_start_' + this.id;
- this._markChecksEnd = 'mark_runchecks_end_' + this.id;
- };
- Rule.prototype._logGatherPerformance = function _logGatherPerformance(nodes) {
- log_default('gather (', nodes.length, '):', performance_timer_default.timeElapsed() + 'ms');
- performance_timer_default.mark(this._markChecksStart);
- };
- Rule.prototype._logRulePerformance = function _logRulePerformance() {
- performance_timer_default.mark(this._markChecksEnd);
- performance_timer_default.mark(this._markEnd);
- performance_timer_default.measure('runchecks_' + this.id, this._markChecksStart, this._markChecksEnd);
- performance_timer_default.measure('rule_' + this.id, this._markStart, this._markEnd);
- };
- function getResult(results) {
- if (results.length) {
- var hasResults = false;
- var result = {};
- results.forEach(function(r) {
- var res = r.results.filter(function(result2) {
- return result2;
- });
- result[r.type] = res;
- if (res.length) {
- hasResults = true;
- }
- });
- if (hasResults) {
- return result;
- }
- return null;
- }
- }
- Rule.prototype.gatherAndMatchNodes = function gatherAndMatchNodes(context, options) {
- var _this8 = this;
- var markMatchesStart = 'mark_matches_start_' + this.id;
- var markMatchesEnd = 'mark_matches_end_' + this.id;
- var nodes = this.gather(context, options);
- if (options.performanceTimer) {
- performance_timer_default.mark(markMatchesStart);
- }
- nodes = nodes.filter(function(node) {
- return _this8.matches(node.actualNode, node, context);
- });
- if (options.performanceTimer) {
- performance_timer_default.mark(markMatchesEnd);
- performance_timer_default.measure('rule_' + this.id + '#matches', markMatchesStart, markMatchesEnd);
- }
- return nodes;
- };
- function findAfterChecks(rule) {
- return get_all_checks_default(rule).map(function(c) {
- var check = rule._audit.checks[c.id || c];
- return check && typeof check.after === 'function' ? check : null;
- }).filter(Boolean);
- }
- function findCheckResults(nodes, checkID) {
- var checkResults = [];
- nodes.forEach(function(nodeResult) {
- var checks = get_all_checks_default(nodeResult);
- checks.forEach(function(checkResult) {
- if (checkResult.id === checkID) {
- checkResult.node = nodeResult.node;
- checkResults.push(checkResult);
- }
- });
- });
- return checkResults;
- }
- function filterChecks(checks) {
- return checks.filter(function(check) {
- return check.filtered !== true;
- });
- }
- function sanitizeNodes(result) {
- var checkTypes2 = [ 'any', 'all', 'none' ];
- var nodes = result.nodes.filter(function(detail) {
- var length = 0;
- checkTypes2.forEach(function(type) {
- detail[type] = filterChecks(detail[type]);
- length += detail[type].length;
- });
- return length > 0;
- });
- if (result.pageLevel && nodes.length) {
- nodes = [ nodes.reduce(function(a, b) {
- if (a) {
- checkTypes2.forEach(function(type) {
- a[type].push.apply(a[type], b[type]);
- });
- return a;
- }
- }) ];
- }
- return nodes;
- }
- Rule.prototype.after = function after(result, options) {
- var _this9 = this;
- var afterChecks = findAfterChecks(this);
- var ruleID = this.id;
- afterChecks.forEach(function(check) {
- var beforeResults = findCheckResults(result.nodes, check.id);
- var option = get_check_option_default(check, ruleID, options);
- var afterResults = check.after(beforeResults, option);
- if (_this9.reviewOnFail) {
- afterResults.forEach(function(checkResult) {
- var changeAnyAllResults = (_this9.any.includes(checkResult.id) || _this9.all.includes(checkResult.id)) && checkResult.result === false;
- var changeNoneResult = _this9.none.includes(checkResult.id) && checkResult.result === true;
- if (changeAnyAllResults || changeNoneResult) {
- checkResult.result = void 0;
- }
- });
- }
- beforeResults.forEach(function(item) {
- delete item.node;
- if (afterResults.indexOf(item) === -1) {
- item.filtered = true;
- }
- });
- });
- result.nodes = sanitizeNodes(result);
- return result;
- };
- Rule.prototype.configure = function configure3(spec) {
- if (spec.hasOwnProperty('selector')) {
- this.selector = spec.selector;
- }
- if (spec.hasOwnProperty('excludeHidden')) {
- this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
- }
- if (spec.hasOwnProperty('enabled')) {
- this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
- }
- if (spec.hasOwnProperty('pageLevel')) {
- this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
- }
- if (spec.hasOwnProperty('reviewOnFail')) {
- this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
- }
- if (spec.hasOwnProperty('any')) {
- this.any = spec.any;
- }
- if (spec.hasOwnProperty('all')) {
- this.all = spec.all;
- }
- if (spec.hasOwnProperty('none')) {
- this.none = spec.none;
- }
- if (spec.hasOwnProperty('tags')) {
- this.tags = spec.tags;
- }
- if (spec.hasOwnProperty('actIds')) {
- this.actIds = spec.actIds;
- }
- if (spec.hasOwnProperty('matches')) {
- this.matches = createExecutionContext(spec.matches);
- }
- if (spec.impact) {
- assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
- this.impact = spec.impact;
- }
- };
- var rule_default = Rule;
- var import_dot2 = __toModule(require_doT());
- var dotRegex = /\{\{.+?\}\}/g;
- function getDefaultOrigin() {
- if (window.origin && window.origin !== 'null') {
- return window.origin;
- }
- if (window.location && window.location.origin && window.location.origin !== 'null') {
- return window.location.origin;
- }
- }
- function getDefaultConfiguration(audit) {
- var config;
- if (audit) {
- config = clone_default(audit);
- config.commons = audit.commons;
- } else {
- config = {};
- }
- config.reporter = config.reporter || null;
- config.noHtml = config.noHtml || false;
- if (!config.allowedOrigins) {
- var defaultOrigin = getDefaultOrigin();
- config.allowedOrigins = defaultOrigin ? [ defaultOrigin ] : [];
- }
- config.rules = config.rules || [];
- config.checks = config.checks || [];
- config.data = _extends({
- checks: {},
- rules: {}
- }, config.data);
- return config;
- }
- function unpackToObject(collection, audit, method) {
- var i, l;
- for (i = 0, l = collection.length; i < l; i++) {
- audit[method](collection[i]);
- }
- }
- var mergeCheckLocale = function mergeCheckLocale(a, b) {
- var pass = b.pass, fail = b.fail;
- if (typeof pass === 'string' && dotRegex.test(pass)) {
- pass = import_dot2['default'].compile(pass);
- }
- if (typeof fail === 'string' && dotRegex.test(fail)) {
- fail = import_dot2['default'].compile(fail);
- }
- return _extends({}, a, {
- messages: {
- pass: pass || a.messages.pass,
- fail: fail || a.messages.fail,
- incomplete: _typeof(a.messages.incomplete) === 'object' ? _extends({}, a.messages.incomplete, b.incomplete) : b.incomplete
- }
- });
- };
- var mergeRuleLocale = function mergeRuleLocale(a, b) {
- var help = b.help, description = b.description;
- if (typeof help === 'string' && dotRegex.test(help)) {
- help = import_dot2['default'].compile(help);
- }
- if (typeof description === 'string' && dotRegex.test(description)) {
- description = import_dot2['default'].compile(description);
- }
- return _extends({}, a, {
- help: help || a.help,
- description: description || a.description
- });
- };
- var mergeFailureMessage = function mergeFailureMessage(a, b) {
- var failureMessage = b.failureMessage;
- if (typeof failureMessage === 'string' && dotRegex.test(failureMessage)) {
- failureMessage = import_dot2['default'].compile(failureMessage);
- }
- return _extends({}, a, {
- failureMessage: failureMessage || a.failureMessage
- });
- };
- var mergeFallbackMessage = function mergeFallbackMessage(a, b) {
- if (typeof b === 'string' && dotRegex.test(b)) {
- b = import_dot2['default'].compile(b);
- }
- return b || a;
- };
- var Audit = function() {
- function Audit(audit) {
- _classCallCheck(this, Audit);
- this.lang = 'en';
- this.defaultConfig = audit;
- this.standards = standards_default;
- this._init();
- this._defaultLocale = null;
- }
- _createClass(Audit, [ {
- key: '_setDefaultLocale',
- value: function _setDefaultLocale() {
- if (this._defaultLocale) {
- return;
- }
- var locale = {
- checks: {},
- rules: {},
- failureSummaries: {},
- incompleteFallbackMessage: '',
- lang: this.lang
- };
- var checkIDs = Object.keys(this.data.checks);
- for (var _i30 = 0; _i30 < checkIDs.length; _i30++) {
- var id = checkIDs[_i30];
- var check = this.data.checks[id];
- var _check$messages = check.messages, pass = _check$messages.pass, fail = _check$messages.fail, incomplete = _check$messages.incomplete;
- locale.checks[id] = {
- pass: pass,
- fail: fail,
- incomplete: incomplete
- };
- }
- var ruleIDs = Object.keys(this.data.rules);
- for (var _i31 = 0; _i31 < ruleIDs.length; _i31++) {
- var _id = ruleIDs[_i31];
- var rule = this.data.rules[_id];
- var description = rule.description, help = rule.help;
- locale.rules[_id] = {
- description: description,
- help: help
- };
- }
- var failureSummaries = Object.keys(this.data.failureSummaries);
- for (var _i32 = 0; _i32 < failureSummaries.length; _i32++) {
- var type = failureSummaries[_i32];
- var failureSummary2 = this.data.failureSummaries[type];
- var failureMessage = failureSummary2.failureMessage;
- locale.failureSummaries[type] = {
- failureMessage: failureMessage
- };
- }
- locale.incompleteFallbackMessage = this.data.incompleteFallbackMessage;
- this._defaultLocale = locale;
- }
- }, {
- key: '_resetLocale',
- value: function _resetLocale() {
- var defaultLocale = this._defaultLocale;
- if (!defaultLocale) {
- return;
- }
- this.applyLocale(defaultLocale);
- }
- }, {
- key: '_applyCheckLocale',
- value: function _applyCheckLocale(checks) {
- var keys = Object.keys(checks);
- for (var _i33 = 0; _i33 < keys.length; _i33++) {
- var id = keys[_i33];
- if (!this.data.checks[id]) {
- throw new Error('Locale provided for unknown check: "'.concat(id, '"'));
- }
- this.data.checks[id] = mergeCheckLocale(this.data.checks[id], checks[id]);
- }
- }
- }, {
- key: '_applyRuleLocale',
- value: function _applyRuleLocale(rules) {
- var keys = Object.keys(rules);
- for (var _i34 = 0; _i34 < keys.length; _i34++) {
- var id = keys[_i34];
- if (!this.data.rules[id]) {
- throw new Error('Locale provided for unknown rule: "'.concat(id, '"'));
- }
- this.data.rules[id] = mergeRuleLocale(this.data.rules[id], rules[id]);
- }
- }
- }, {
- key: '_applyFailureSummaries',
- value: function _applyFailureSummaries(messages) {
- var keys = Object.keys(messages);
- for (var _i35 = 0; _i35 < keys.length; _i35++) {
- var key = keys[_i35];
- if (!this.data.failureSummaries[key]) {
- throw new Error('Locale provided for unknown failureMessage: "'.concat(key, '"'));
- }
- this.data.failureSummaries[key] = mergeFailureMessage(this.data.failureSummaries[key], messages[key]);
- }
- }
- }, {
- key: 'applyLocale',
- value: function applyLocale(locale) {
- this._setDefaultLocale();
- if (locale.checks) {
- this._applyCheckLocale(locale.checks);
- }
- if (locale.rules) {
- this._applyRuleLocale(locale.rules);
- }
- if (locale.failureSummaries) {
- this._applyFailureSummaries(locale.failureSummaries, 'failureSummaries');
- }
- if (locale.incompleteFallbackMessage) {
- this.data.incompleteFallbackMessage = mergeFallbackMessage(this.data.incompleteFallbackMessage, locale.incompleteFallbackMessage);
- }
- if (locale.lang) {
- this.lang = locale.lang;
- }
- }
- }, {
- key: 'setAllowedOrigins',
- value: function setAllowedOrigins(allowedOrigins) {
- var defaultOrigin = getDefaultOrigin();
- this.allowedOrigins = [];
- var _iterator12 = _createForOfIteratorHelper(allowedOrigins), _step12;
- try {
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) {
- var origin = _step12.value;
- if (origin === constants_default.allOrigins) {
- this.allowedOrigins = [ '*' ];
- return;
- } else if (origin !== constants_default.sameOrigin) {
- this.allowedOrigins.push(origin);
- } else if (defaultOrigin) {
- this.allowedOrigins.push(defaultOrigin);
- }
- }
- } catch (err) {
- _iterator12.e(err);
- } finally {
- _iterator12.f();
- }
- }
- }, {
- key: '_init',
- value: function _init() {
- var audit = getDefaultConfiguration(this.defaultConfig);
- this.lang = audit.lang || 'en';
- this.reporter = audit.reporter;
- this.commands = {};
- this.rules = [];
- this.checks = {};
- this.brand = 'axe';
- this.application = 'axeAPI';
- this.tagExclude = [ 'experimental' ];
- this.noHtml = audit.noHtml;
- this.allowedOrigins = audit.allowedOrigins;
- unpackToObject(audit.rules, this, 'addRule');
- unpackToObject(audit.checks, this, 'addCheck');
- this.data = {};
- this.data.checks = audit.data && audit.data.checks || {};
- this.data.rules = audit.data && audit.data.rules || {};
- this.data.failureSummaries = audit.data && audit.data.failureSummaries || {};
- this.data.incompleteFallbackMessage = audit.data && audit.data.incompleteFallbackMessage || '';
- this._constructHelpUrls();
- }
- }, {
- key: 'registerCommand',
- value: function registerCommand(command) {
- this.commands[command.id] = command.callback;
- }
- }, {
- key: 'addRule',
- value: function addRule(spec) {
- if (spec.metadata) {
- this.data.rules[spec.id] = spec.metadata;
- }
- var rule = this.getRule(spec.id);
- if (rule) {
- rule.configure(spec);
- } else {
- this.rules.push(new rule_default(spec, this));
- }
- }
- }, {
- key: 'addCheck',
- value: function addCheck(spec) {
- var metadata = spec.metadata;
- if (_typeof(metadata) === 'object') {
- this.data.checks[spec.id] = metadata;
- if (_typeof(metadata.messages) === 'object') {
- Object.keys(metadata.messages).filter(function(prop) {
- return metadata.messages.hasOwnProperty(prop) && typeof metadata.messages[prop] === 'string';
- }).forEach(function(prop) {
- if (metadata.messages[prop].indexOf('function') === 0) {
- metadata.messages[prop] = new Function('return ' + metadata.messages[prop] + ';')();
- }
- });
- }
- }
- if (this.checks[spec.id]) {
- this.checks[spec.id].configure(spec);
- } else {
- this.checks[spec.id] = new check_default(spec);
- }
- }
- }, {
- key: 'run',
- value: function run(context, options, resolve, reject) {
- this.normalizeOptions(options);
- axe._selectCache = [];
- var allRulesToRun = getRulesToRun(this.rules, context, options);
- var runNowRules = allRulesToRun.now;
- var runLaterRules = allRulesToRun.later;
- var nowRulesQueue = queue_default();
- runNowRules.forEach(function(rule) {
- nowRulesQueue.defer(getDefferedRule(rule, context, options));
- });
- var preloaderQueue = queue_default();
- if (runLaterRules.length) {
- preloaderQueue.defer(function(resolve2) {
- preload_default(options).then(function(assets) {
- return resolve2(assets);
- })['catch'](function(err2) {
- console.warn('Couldn\'t load preload assets: ', err2);
- resolve2(void 0);
- });
- });
- }
- var queueForNowRulesAndPreloader = queue_default();
- queueForNowRulesAndPreloader.defer(nowRulesQueue);
- queueForNowRulesAndPreloader.defer(preloaderQueue);
- queueForNowRulesAndPreloader.then(function(nowRulesAndPreloaderResults) {
- var assetsFromQueue = nowRulesAndPreloaderResults.pop();
- if (assetsFromQueue && assetsFromQueue.length) {
- var assets = assetsFromQueue[0];
- if (assets) {
- context = _extends({}, context, assets);
- }
- }
- var nowRulesResults = nowRulesAndPreloaderResults[0];
- if (!runLaterRules.length) {
- axe._selectCache = void 0;
- resolve(nowRulesResults.filter(function(result) {
- return !!result;
- }));
- return;
- }
- var laterRulesQueue = queue_default();
- runLaterRules.forEach(function(rule) {
- var deferredRule = getDefferedRule(rule, context, options);
- laterRulesQueue.defer(deferredRule);
- });
- laterRulesQueue.then(function(laterRuleResults) {
- axe._selectCache = void 0;
- resolve(nowRulesResults.concat(laterRuleResults).filter(function(result) {
- return !!result;
- }));
- })['catch'](reject);
- })['catch'](reject);
- }
- }, {
- key: 'after',
- value: function after(results, options) {
- var rules = this.rules;
- return results.map(function(ruleResult) {
- var rule = find_by_default(rules, 'id', ruleResult.id);
- if (!rule) {
- throw new Error('Result for unknown rule. You may be running mismatch axe-core versions');
- }
- return rule.after(ruleResult, options);
- });
- }
- }, {
- key: 'getRule',
- value: function getRule(ruleId) {
- return this.rules.find(function(rule) {
- return rule.id === ruleId;
- });
- }
- }, {
- key: 'normalizeOptions',
- value: function normalizeOptions(options) {
- var audit = this;
- var tags = [];
- var ruleIds = [];
- audit.rules.forEach(function(rule) {
- ruleIds.push(rule.id);
- rule.tags.forEach(function(tag) {
- if (!tags.includes(tag)) {
- tags.push(tag);
- }
- });
- });
- if ([ 'object', 'string' ].includes(_typeof(options.runOnly))) {
- if (typeof options.runOnly === 'string') {
- options.runOnly = [ options.runOnly ];
- }
- if (Array.isArray(options.runOnly)) {
- var hasTag = options.runOnly.find(function(value) {
- return tags.includes(value);
- });
- var hasRule = options.runOnly.find(function(value) {
- return ruleIds.includes(value);
- });
- if (hasTag && hasRule) {
- throw new Error('runOnly cannot be both rules and tags');
- }
- if (hasRule) {
- options.runOnly = {
- type: 'rule',
- values: options.runOnly
- };
- } else {
- options.runOnly = {
- type: 'tag',
- values: options.runOnly
- };
- }
- }
- var only = options.runOnly;
- if (only.value && !only.values) {
- only.values = only.value;
- delete only.value;
- }
- if (!Array.isArray(only.values) || only.values.length === 0) {
- throw new Error('runOnly.values must be a non-empty array');
- }
- if ([ 'rule', 'rules' ].includes(only.type)) {
- only.type = 'rule';
- only.values.forEach(function(ruleId) {
- if (!ruleIds.includes(ruleId)) {
- throw new Error('unknown rule `' + ruleId + '` in options.runOnly');
- }
- });
- } else if ([ 'tag', 'tags', void 0 ].includes(only.type)) {
- only.type = 'tag';
- var unmatchedTags = only.values.filter(function(tag) {
- return !tags.includes(tag) && !/wcag2[1-3]a{1,3}/.test(tag);
- });
- if (unmatchedTags.length !== 0) {
- axe.log('Could not find tags `' + unmatchedTags.join('`, `') + '`');
- }
- } else {
- throw new Error('Unknown runOnly type \''.concat(only.type, '\''));
- }
- }
- if (_typeof(options.rules) === 'object') {
- Object.keys(options.rules).forEach(function(ruleId) {
- if (!ruleIds.includes(ruleId)) {
- throw new Error('unknown rule `' + ruleId + '` in options.rules');
- }
- });
- }
- return options;
- }
- }, {
- key: 'setBranding',
- value: function setBranding(branding) {
- var previous = {
- brand: this.brand,
- application: this.application
- };
- if (typeof branding === 'string') {
- this.application = branding;
- }
- if (branding && branding.hasOwnProperty('brand') && branding.brand && typeof branding.brand === 'string') {
- this.brand = branding.brand;
- }
- if (branding && branding.hasOwnProperty('application') && branding.application && typeof branding.application === 'string') {
- this.application = branding.application;
- }
- this._constructHelpUrls(previous);
- }
- }, {
- key: '_constructHelpUrls',
- value: function _constructHelpUrls() {
- var _this10 = this;
- var previous = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- var version = (axe.version.match(/^[1-9][0-9]*\.[0-9]+/) || [ 'x.y' ])[0];
- this.rules.forEach(function(rule) {
- if (!_this10.data.rules[rule.id]) {
- _this10.data.rules[rule.id] = {};
- }
- var metaData = _this10.data.rules[rule.id];
- if (typeof metaData.helpUrl !== 'string' || previous && metaData.helpUrl === getHelpUrl(previous, rule.id, version)) {
- metaData.helpUrl = getHelpUrl(_this10, rule.id, version);
- }
- });
- }
- }, {
- key: 'resetRulesAndChecks',
- value: function resetRulesAndChecks() {
- this._init();
- this._resetLocale();
- }
- } ]);
- return Audit;
- }();
- function getRulesToRun(rules, context, options) {
- var base = {
- now: [],
- later: []
- };
- var splitRules = rules.reduce(function(out, rule) {
- if (!rule_should_run_default(rule, context, options)) {
- return out;
- }
- if (rule.preload) {
- out.later.push(rule);
- return out;
- }
- out.now.push(rule);
- return out;
- }, base);
- return splitRules;
- }
- function getDefferedRule(rule, context, options) {
- if (options.performanceTimer) {
- performance_timer_default.mark('mark_rule_start_' + rule.id);
- }
- return function(resolve, reject) {
- rule.run(context, options, function(ruleResult) {
- resolve(ruleResult);
- }, function(err2) {
- if (!options.debug) {
- var errResult = Object.assign(new rule_result_default(rule), {
- result: constants_default.CANTTELL,
- description: 'An error occured while running this rule',
- message: err2.message,
- stack: err2.stack,
- error: err2,
- errorNode: err2.errorNode
- });
- resolve(errResult);
- } else {
- reject(err2);
- }
- });
- };
- }
- function getHelpUrl(_ref117, ruleId, version) {
- var brand = _ref117.brand, application = _ref117.application, lang = _ref117.lang;
- return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
- }
- var audit_default = Audit;
- function setupGlobals(context) {
- var hasWindow = window && 'Node' in window && 'NodeList' in window;
- var hasDoc = !!document;
- if (hasWindow && hasDoc) {
- return;
- }
- if (!context || !context.ownerDocument) {
- 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.');
- }
- if (!hasDoc) {
- cache_default.set('globalDocumentSet', true);
- document = context.ownerDocument;
- }
- if (!hasWindow) {
- cache_default.set('globalWindowSet', true);
- window = document.defaultView;
- }
- }
- function resetGlobals() {
- if (cache_default.get('globalDocumentSet')) {
- cache_default.set('globalDocumentSet', false);
- document = null;
- }
- if (cache_default.get('globalWindowSet')) {
- cache_default.set('globalWindowSet', false);
- window = null;
- }
- }
- function teardown() {
- resetGlobals();
- axe._memoizedFns.forEach(function(fn) {
- return fn.clear();
- });
- cache_default.clear();
- axe._tree = void 0;
- axe._selectorData = void 0;
- axe._selectCache = void 0;
- }
- var teardown_default = teardown;
- function runRules(context, options, resolve, reject) {
- try {
- context = new Context(context);
- axe._tree = context.flatTree;
- axe._selectorData = _getSelectorData(context.flatTree);
- } catch (e) {
- teardown_default();
- return reject(e);
- }
- var q = queue_default();
- var audit = axe._audit;
- if (options.performanceTimer) {
- performance_timer_default.auditStart();
- }
- if (context.frames.length && options.iframes !== false) {
- q.defer(function(res, rej) {
- _collectResultsFromFrames(context, options, 'rules', null, res, rej);
- });
- }
- q.defer(function(res, rej) {
- audit.run(context, options, res, rej);
- });
- q.then(function(data2) {
- try {
- if (options.performanceTimer) {
- performance_timer_default.auditEnd();
- }
- var results = merge_results_default(data2.map(function(results2) {
- return {
- results: results2
- };
- }));
- if (context.initiator) {
- results = audit.after(results, options);
- results.forEach(publish_metadata_default);
- results = results.map(finalize_result_default);
- }
- try {
- resolve(results, teardown_default);
- } catch (e) {
- teardown_default();
- log_default(e);
- }
- } catch (e) {
- teardown_default();
- reject(e);
- }
- })['catch'](function(e) {
- teardown_default();
- reject(e);
- });
- }
- var run_rules_default = runRules;
- function runCommand(data2, keepalive, callback) {
- var resolve = callback;
- var reject = function reject2(err2) {
- if (err2 instanceof Error === false) {
- err2 = new Error(err2);
- }
- callback(err2);
- };
- var context = data2 && data2.context || {};
- if (context.hasOwnProperty('include') && !context.include.length) {
- context.include = [ document ];
- }
- var options = data2 && data2.options || {};
- switch (data2.command) {
- case 'rules':
- return run_rules_default(context, options, function(results, cleanup3) {
- resolve(results);
- cleanup3();
- }, reject);
- case 'cleanup-plugin':
- return cleanup_default(resolve, reject);
- default:
- if (axe._audit && axe._audit.commands && axe._audit.commands[data2.command]) {
- return axe._audit.commands[data2.command](data2, callback);
- }
- }
- }
- if (window.top !== window) {
- _respondable.subscribe('axe.start', runCommand);
- _respondable.subscribe('axe.ping', function(data2, keepalive, respond) {
- respond({
- axe: true
- });
- });
- }
- function load(audit) {
- axe._audit = new audit_default(audit);
- }
- var load_default = load;
- function Plugin(spec) {
- this._run = spec.run;
- this._collect = spec.collect;
- this._registry = {};
- spec.commands.forEach(function(command) {
- axe._audit.registerCommand(command);
- });
- }
- Plugin.prototype.run = function run3() {
- return this._run.apply(this, arguments);
- };
- Plugin.prototype.collect = function collect() {
- return this._collect.apply(this, arguments);
- };
- Plugin.prototype.cleanup = function cleanup2(done) {
- var q = axe.utils.queue();
- var that = this;
- Object.keys(this._registry).forEach(function(key) {
- q.defer(function(_done) {
- that._registry[key].cleanup(_done);
- });
- });
- q.then(done);
- };
- Plugin.prototype.add = function add(impl) {
- this._registry[impl.id] = impl;
- };
- function registerPlugin(plugin) {
- axe.plugins[plugin.id] = new Plugin(plugin);
- }
- var plugins_default = registerPlugin;
- function reset() {
- var audit = axe._audit;
- if (!audit) {
- throw new Error('No audit configured');
- }
- audit.resetRulesAndChecks();
- resetStandards();
- }
- var reset_default = reset;
- function runVirtualRule(ruleId, vNode) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- options.reporter = options.reporter || axe._audit.reporter || 'v1';
- axe._selectorData = {};
- if (!(vNode instanceof abstract_virtual_node_default)) {
- vNode = new serial_virtual_node_default(vNode);
- }
- var rule = get_rule_default(ruleId);
- if (!rule) {
- throw new Error('unknown rule `' + ruleId + '`');
- }
- rule = Object.create(rule, {
- excludeHidden: {
- value: false
- }
- });
- var context = {
- initiator: true,
- include: [ vNode ],
- exclude: [],
- frames: [],
- page: false,
- focusable: true,
- size: {},
- flatTree: []
- };
- var rawResults = rule.runSync(context, options);
- publish_metadata_default(rawResults);
- finalize_result_default(rawResults);
- var results = aggregate_result_default([ rawResults ]);
- results.violations.forEach(function(result) {
- return result.nodes.forEach(function(nodeResult) {
- nodeResult.failureSummary = failure_summary_default(nodeResult);
- });
- });
- return _extends({}, _getEnvironmentData(), results, {
- toolOptions: options
- });
- }
- function normalizeRunParams(_ref118) {
- var _ref120, _options$reporter, _axe$_audit;
- var _ref119 = _slicedToArray(_ref118, 3), context = _ref119[0], options = _ref119[1], callback = _ref119[2];
- var typeErr = new TypeError('axe.run arguments are invalid');
- if (!isContextSpec(context)) {
- if (callback !== void 0) {
- throw typeErr;
- }
- callback = options;
- options = context;
- context = document;
- }
- if (_typeof(options) !== 'object') {
- if (callback !== void 0) {
- throw typeErr;
- }
- callback = options;
- options = {};
- }
- if (typeof callback !== 'function' && callback !== void 0) {
- throw typeErr;
- }
- options = clone_default(options);
- options.reporter = (_ref120 = (_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 && _ref120 !== void 0 ? _ref120 : 'v1';
- return {
- context: context,
- options: options,
- callback: callback
- };
- }
- var noop2 = function noop2() {};
- function run4() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- setupGlobals(args[0]);
- var _normalizeRunParams = normalizeRunParams(args), context = _normalizeRunParams.context, options = _normalizeRunParams.options, _normalizeRunParams$c = _normalizeRunParams.callback, callback = _normalizeRunParams$c === void 0 ? noop2 : _normalizeRunParams$c;
- var _getPromiseHandlers = getPromiseHandlers(callback), thenable = _getPromiseHandlers.thenable, resolve = _getPromiseHandlers.resolve, reject = _getPromiseHandlers.reject;
- try {
- assert_default(axe._audit, 'No audit configured');
- 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.');
- } catch (e) {
- return handleError(e, callback);
- }
- axe._running = true;
- if (options.performanceTimer) {
- axe.utils.performanceTimer.start();
- }
- function handleRunRules(rawResults, cleanup3) {
- var respond = function respond(results) {
- axe._running = false;
- cleanup3();
- try {
- callback(null, results);
- } catch (e) {
- axe.log(e);
- }
- resolve(results);
- };
- if (options.performanceTimer) {
- axe.utils.performanceTimer.end();
- }
- try {
- createReport(rawResults, options, respond);
- } catch (err2) {
- axe._running = false;
- cleanup3();
- callback(err2);
- reject(err2);
- }
- }
- function errorRunRules(err2) {
- if (options.performanceTimer) {
- axe.utils.performanceTimer.end();
- }
- axe._running = false;
- resetGlobals();
- callback(err2);
- reject(err2);
- }
- axe._runRules(context, options, handleRunRules, errorRunRules);
- return thenable;
- }
- function getPromiseHandlers(callback) {
- var thenable, reject, resolve;
- if (typeof Promise === 'function' && callback === noop2) {
- thenable = new Promise(function(_resolve, _reject) {
- reject = _reject;
- resolve = _resolve;
- });
- } else {
- resolve = reject = noop2;
- }
- return {
- thenable: thenable,
- reject: reject,
- resolve: resolve
- };
- }
- function createReport(rawResults, options, respond) {
- var reporter = getReporter(options.reporter);
- var results = reporter(rawResults, options, respond);
- if (results !== void 0) {
- respond(results);
- }
- }
- function handleError(err2, callback) {
- resetGlobals();
- if (typeof callback === 'function' && callback !== noop2) {
- callback(err2.message);
- return;
- }
- throw err2;
- }
- function runPartial() {
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- var _normalizeRunParams2 = normalizeRunParams(args), options = _normalizeRunParams2.options, context = _normalizeRunParams2.context;
- assert_default(axe._audit, 'Axe is not configured. Audit is missing.');
- 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.');
- var contextObj = new Context(context, axe._tree);
- axe._tree = contextObj.flatTree;
- axe._selectorData = _getSelectorData(contextObj.flatTree);
- axe._running = true;
- return new Promise(function(res, rej) {
- axe._audit.run(contextObj, options, res, rej);
- }).then(function(results) {
- results = results.map(function(_ref121) {
- var nodes = _ref121.nodes, result = _objectWithoutProperties(_ref121, _excluded8);
- return _extends({
- nodes: nodes.map(serializeNode)
- }, result);
- });
- var frames = contextObj.frames.map(function(_ref122) {
- var node = _ref122.node;
- return new dq_element_default(node, options).toJSON();
- });
- var environmentData;
- if (contextObj.initiator) {
- environmentData = _getEnvironmentData();
- }
- axe._running = false;
- teardown_default();
- return {
- results: results,
- frames: frames,
- environmentData: environmentData
- };
- })['catch'](function(err2) {
- axe._running = false;
- teardown_default();
- return Promise.reject(err2);
- });
- }
- function serializeNode(_ref123) {
- var node = _ref123.node, nodeResult = _objectWithoutProperties(_ref123, _excluded9);
- nodeResult.node = node.toJSON();
- for (var _i36 = 0, _arr2 = [ 'any', 'all', 'none' ]; _i36 < _arr2.length; _i36++) {
- var type = _arr2[_i36];
- nodeResult[type] = nodeResult[type].map(function(_ref124) {
- var relatedNodes = _ref124.relatedNodes, checkResult = _objectWithoutProperties(_ref124, _excluded10);
- return _extends({}, checkResult, {
- relatedNodes: relatedNodes.map(function(node2) {
- return node2.toJSON();
- })
- });
- });
- }
- return nodeResult;
- }
- function finishRun(partialResults) {
- var _ref126, _options$reporter2, _axe$_audit2;
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- options = clone_default(options);
- var _ref125 = partialResults.find(function(r) {
- return r.environmentData;
- }) || {}, environmentData = _ref125.environmentData;
- axe._audit.normalizeOptions(options);
- options.reporter = (_ref126 = (_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 && _ref126 !== void 0 ? _ref126 : 'v1';
- setFrameSpec(partialResults);
- var results = merge_results_default(partialResults);
- results = axe._audit.after(results, options);
- results.forEach(publish_metadata_default);
- results = results.map(finalize_result_default);
- return createReport2(results, _extends({
- environmentData: environmentData
- }, options));
- }
- function setFrameSpec(partialResults) {
- var frameStack = [];
- var _iterator13 = _createForOfIteratorHelper(partialResults), _step13;
- try {
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) {
- var partialResult = _step13.value;
- var frameSpec = frameStack.shift();
- if (!partialResult) {
- continue;
- }
- partialResult.frameSpec = frameSpec !== null && frameSpec !== void 0 ? frameSpec : null;
- var frameSpecs = getMergedFrameSpecs(partialResult);
- frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
- }
- } catch (err) {
- _iterator13.e(err);
- } finally {
- _iterator13.f();
- }
- }
- function getMergedFrameSpecs(_ref127) {
- var childFrameSpecs = _ref127.frames, parentFrameSpec = _ref127.frameSpec;
- if (!parentFrameSpec) {
- return childFrameSpecs;
- }
- return childFrameSpecs.map(function(childFrameSpec) {
- return dq_element_default.mergeSpecs(childFrameSpec, parentFrameSpec);
- });
- }
- function createReport2(results, options) {
- return new Promise(function(resolve) {
- var reporter = getReporter(options.reporter);
- reporter(results, options, resolve);
- });
- }
- function setup(node) {
- if (axe._tree) {
- throw new Error('Axe is already setup. Call `axe.teardown()` before calling `axe.setup` again.');
- }
- axe._tree = get_flattened_tree_default(node);
- axe._selectorData = _getSelectorData(axe._tree);
- return axe._tree[0];
- }
- var setup_default = setup;
- var naReporter = function naReporter(results, options, callback) {
- console.warn('"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.');
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var _options2 = options, environmentData = _options2.environmentData, toolOptions = _objectWithoutProperties(_options2, _excluded11);
- callback(_extends({}, _getEnvironmentData(environmentData), {
- toolOptions: toolOptions
- }, process_aggregate_default(results, options)));
- };
- var na_default = naReporter;
- var noPassesReporter = function noPassesReporter(results, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var _options3 = options, environmentData = _options3.environmentData, toolOptions = _objectWithoutProperties(_options3, _excluded12);
- options.resultTypes = [ 'violations' ];
- var _process_aggregate_de = process_aggregate_default(results, options), violations = _process_aggregate_de.violations;
- callback(_extends({}, _getEnvironmentData(environmentData), {
- toolOptions: toolOptions,
- violations: violations
- }));
- };
- var no_passes_default = noPassesReporter;
- var rawReporter = function rawReporter(results, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- if (!results || !Array.isArray(results)) {
- return callback(results);
- }
- var transformedResults = results.map(function(result) {
- var transformedResult = _extends({}, result);
- var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ];
- for (var _i37 = 0, _types = types; _i37 < _types.length; _i37++) {
- var type = _types[_i37];
- if (transformedResult[type] && Array.isArray(transformedResult[type])) {
- transformedResult[type] = transformedResult[type].map(function(_ref128) {
- var _node;
- var node = _ref128.node, typeResult = _objectWithoutProperties(_ref128, _excluded13);
- node = typeof ((_node = node) === null || _node === void 0 ? void 0 : _node.toJSON) === 'function' ? node.toJSON() : node;
- return _extends({
- node: node
- }, typeResult);
- });
- }
- }
- return transformedResult;
- });
- callback(transformedResults);
- };
- var raw_default = rawReporter;
- var rawEnvReporter = function rawEnvReporter(results, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var _options4 = options, environmentData = _options4.environmentData, toolOptions = _objectWithoutProperties(_options4, _excluded14);
- raw_default(results, toolOptions, function(raw) {
- var env = _getEnvironmentData(environmentData);
- callback({
- raw: raw,
- env: env
- });
- });
- };
- var raw_env_default = rawEnvReporter;
- var v1Reporter = function v1Reporter(results, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var _options5 = options, environmentData = _options5.environmentData, toolOptions = _objectWithoutProperties(_options5, _excluded15);
- var out = process_aggregate_default(results, options);
- var addFailureSummaries = function addFailureSummaries(result) {
- result.nodes.forEach(function(nodeResult) {
- nodeResult.failureSummary = failure_summary_default(nodeResult);
- });
- };
- out.incomplete.forEach(addFailureSummaries);
- out.violations.forEach(addFailureSummaries);
- callback(_extends({}, _getEnvironmentData(environmentData), {
- toolOptions: toolOptions
- }, out));
- };
- var v1_default = v1Reporter;
- var v2Reporter = function v2Reporter(results, options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var _options6 = options, environmentData = _options6.environmentData, toolOptions = _objectWithoutProperties(_options6, _excluded16);
- var out = process_aggregate_default(results, options);
- callback(_extends({}, _getEnvironmentData(environmentData), {
- toolOptions: toolOptions
- }, out));
- };
- var v2_default = v2Reporter;
- var _thisWillBeDeletedDoNotUse = {
- base: {
- Audit: audit_default,
- CheckResult: check_result_default,
- Check: check_default,
- Context: Context,
- RuleResult: rule_result_default,
- Rule: rule_default,
- metadataFunctionMap: metadata_function_map_default
- },
- public: {
- reporters: reporters
- },
- helpers: {
- failureSummary: failure_summary_default,
- incompleteFallbackMessage: incompleteFallbackMessage,
- processAggregate: process_aggregate_default
- },
- utils: {
- setDefaultFrameMessenger: setDefaultFrameMessenger,
- cacheNodeSelectors: cacheNodeSelectors,
- getNodesMatchingExpression: getNodesMatchingExpression,
- convertSelector: _convertSelector
- },
- commons: {
- dom: {
- nativelyHidden: nativelyHidden,
- displayHidden: displayHidden,
- visibilityHidden: visibilityHidden,
- contentVisibiltyHidden: contentVisibiltyHidden,
- ariaHidden: ariaHidden,
- opacityHidden: opacityHidden,
- scrollHidden: scrollHidden,
- overflowHidden: overflowHidden,
- clipHidden: clipHidden,
- areaHidden: areaHidden,
- detailsHidden: detailsHidden
- }
- }
- };
- var exposed_for_testing_default = _thisWillBeDeletedDoNotUse;
- axe._thisWillBeDeletedDoNotUse = exposed_for_testing_default;
- axe.constants = constants_default;
- axe.log = log_default;
- axe.AbstractVirtualNode = abstract_virtual_node_default;
- axe.SerialVirtualNode = serial_virtual_node_default;
- axe.VirtualNode = virtual_node_default;
- axe._cache = cache_default;
- axe.imports = imports_exports;
- axe.cleanup = cleanup_default;
- axe.configure = configure_default;
- axe.frameMessenger = frameMessenger2;
- axe.getRules = get_rules_default;
- axe._load = load_default;
- axe.plugins = {};
- axe.registerPlugin = plugins_default;
- axe.hasReporter = hasReporter;
- axe.getReporter = getReporter;
- axe.addReporter = addReporter;
- axe.reset = reset_default;
- axe._runRules = run_rules_default;
- axe.runVirtualRule = runVirtualRule;
- axe.run = run4;
- axe.setup = setup_default;
- axe.teardown = teardown_default;
- axe.runPartial = runPartial;
- axe.finishRun = finishRun;
- axe.commons = commons_exports;
- axe.utils = utils_exports;
- axe.addReporter('na', na_default);
- axe.addReporter('no-passes', no_passes_default);
- axe.addReporter('rawEnv', raw_env_default);
- axe.addReporter('raw', raw_default);
- axe.addReporter('v1', v1_default);
- axe.addReporter('v2', v2_default, true);
- })();
- 'use strict';
- axe._load({
- lang: 'en',
- data: {
- rules: {
- accesskeys: {
- description: 'Ensures every accesskey attribute value is unique',
- help: 'accesskey attribute value should be unique'
- },
- 'area-alt': {
- description: 'Ensures <area> elements of image maps have alternate text',
- help: 'Active <area> elements must have alternate text'
- },
- 'aria-allowed-attr': {
- description: 'Ensures ARIA attributes are allowed for an element\'s role',
- help: 'Elements must only use allowed ARIA attributes'
- },
- 'aria-allowed-role': {
- description: 'Ensures role attribute has an appropriate value for the element',
- help: 'ARIA role should be appropriate for the element'
- },
- 'aria-command-name': {
- description: 'Ensures every ARIA button, link and menuitem has an accessible name',
- help: 'ARIA commands must have an accessible name'
- },
- 'aria-dialog-name': {
- description: 'Ensures every ARIA dialog and alertdialog node has an accessible name',
- help: 'ARIA dialog and alertdialog nodes should have an accessible name'
- },
- 'aria-hidden-body': {
- description: 'Ensures aria-hidden=\'true\' is not present on the document body.',
- help: 'aria-hidden=\'true\' must not be present on the document body'
- },
- 'aria-hidden-focus': {
- description: 'Ensures aria-hidden elements are not focusable nor contain focusable elements',
- help: 'ARIA hidden element must not be focusable or contain focusable elements'
- },
- 'aria-input-field-name': {
- description: 'Ensures every ARIA input field has an accessible name',
- help: 'ARIA input fields must have an accessible name'
- },
- 'aria-meter-name': {
- description: 'Ensures every ARIA meter node has an accessible name',
- help: 'ARIA meter nodes must have an accessible name'
- },
- 'aria-progressbar-name': {
- description: 'Ensures every ARIA progressbar node has an accessible name',
- help: 'ARIA progressbar nodes must have an accessible name'
- },
- 'aria-required-attr': {
- description: 'Ensures elements with ARIA roles have all required ARIA attributes',
- help: 'Required ARIA attributes must be provided'
- },
- 'aria-required-children': {
- description: 'Ensures elements with an ARIA role that require child roles contain them',
- help: 'Certain ARIA roles must contain particular children'
- },
- 'aria-required-parent': {
- description: 'Ensures elements with an ARIA role that require parent roles are contained by them',
- help: 'Certain ARIA roles must be contained by particular parents'
- },
- 'aria-roledescription': {
- description: 'Ensure aria-roledescription is only used on elements with an implicit or explicit role',
- help: 'aria-roledescription must be on elements with a semantic role'
- },
- 'aria-roles': {
- description: 'Ensures all elements with a role attribute use a valid value',
- help: 'ARIA roles used must conform to valid values'
- },
- 'aria-text': {
- description: 'Ensures "role=text" is used on elements with no focusable descendants',
- help: '"role=text" should have no focusable descendants'
- },
- 'aria-toggle-field-name': {
- description: 'Ensures every ARIA toggle field has an accessible name',
- help: 'ARIA toggle fields must have an accessible name'
- },
- 'aria-tooltip-name': {
- description: 'Ensures every ARIA tooltip node has an accessible name',
- help: 'ARIA tooltip nodes must have an accessible name'
- },
- 'aria-treeitem-name': {
- description: 'Ensures every ARIA treeitem node has an accessible name',
- help: 'ARIA treeitem nodes should have an accessible name'
- },
- 'aria-valid-attr-value': {
- description: 'Ensures all ARIA attributes have valid values',
- help: 'ARIA attributes must conform to valid values'
- },
- 'aria-valid-attr': {
- description: 'Ensures attributes that begin with aria- are valid ARIA attributes',
- help: 'ARIA attributes must conform to valid names'
- },
- 'audio-caption': {
- description: 'Ensures <audio> elements have captions',
- help: '<audio> elements must have a captions track'
- },
- 'autocomplete-valid': {
- description: 'Ensure the autocomplete attribute is correct and suitable for the form field',
- help: 'autocomplete attribute must be used correctly'
- },
- 'avoid-inline-spacing': {
- description: 'Ensure that text spacing set through style attributes can be adjusted with custom stylesheets',
- help: 'Inline text spacing must be adjustable with custom stylesheets'
- },
- blink: {
- description: 'Ensures <blink> elements are not used',
- help: '<blink> elements are deprecated and must not be used'
- },
- 'button-name': {
- description: 'Ensures buttons have discernible text',
- help: 'Buttons must have discernible text'
- },
- bypass: {
- description: 'Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content',
- help: 'Page must have means to bypass repeated blocks'
- },
- 'color-contrast-enhanced': {
- description: 'Ensures the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds',
- help: 'Elements must meet enhanced color contrast ratio thresholds'
- },
- 'color-contrast': {
- description: 'Ensures the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds',
- help: 'Elements must meet minimum color contrast ratio thresholds'
- },
- 'css-orientation-lock': {
- description: 'Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations',
- help: 'CSS Media queries must not lock display orientation'
- },
- 'definition-list': {
- description: 'Ensures <dl> elements are structured correctly',
- help: '<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements'
- },
- dlitem: {
- description: 'Ensures <dt> and <dd> elements are contained by a <dl>',
- help: '<dt> and <dd> elements must be contained by a <dl>'
- },
- 'document-title': {
- description: 'Ensures each HTML document contains a non-empty <title> element',
- help: 'Documents must have <title> element to aid in navigation'
- },
- 'duplicate-id-active': {
- description: 'Ensures every id attribute value of active elements is unique',
- help: 'IDs of active elements must be unique'
- },
- 'duplicate-id-aria': {
- description: 'Ensures every id attribute value used in ARIA and in labels is unique',
- help: 'IDs used in ARIA and labels must be unique'
- },
- 'duplicate-id': {
- description: 'Ensures every id attribute value is unique',
- help: 'id attribute value must be unique'
- },
- 'empty-heading': {
- description: 'Ensures headings have discernible text',
- help: 'Headings should not be empty'
- },
- 'empty-table-header': {
- description: 'Ensures table headers have discernible text',
- help: 'Table header text should not be empty'
- },
- 'focus-order-semantics': {
- description: 'Ensures elements in the focus order have a role appropriate for interactive content',
- help: 'Elements in the focus order should have an appropriate role'
- },
- 'form-field-multiple-labels': {
- description: 'Ensures form field does not have multiple label elements',
- help: 'Form field must not have multiple label elements'
- },
- 'frame-focusable-content': {
- description: 'Ensures <frame> and <iframe> elements with focusable content do not have tabindex=-1',
- help: 'Frames with focusable content must not have tabindex=-1'
- },
- 'frame-tested': {
- description: 'Ensures <iframe> and <frame> elements contain the axe-core script',
- help: 'Frames should be tested with axe-core'
- },
- 'frame-title-unique': {
- description: 'Ensures <iframe> and <frame> elements contain a unique title attribute',
- help: 'Frames must have a unique title attribute'
- },
- 'frame-title': {
- description: 'Ensures <iframe> and <frame> elements have an accessible name',
- help: 'Frames must have an accessible name'
- },
- 'heading-order': {
- description: 'Ensures the order of headings is semantically correct',
- help: 'Heading levels should only increase by one'
- },
- 'hidden-content': {
- description: 'Informs users about hidden content.',
- help: 'Hidden content on the page should be analyzed'
- },
- 'html-has-lang': {
- description: 'Ensures every HTML document has a lang attribute',
- help: '<html> element must have a lang attribute'
- },
- 'html-lang-valid': {
- description: 'Ensures the lang attribute of the <html> element has a valid value',
- help: '<html> element must have a valid value for the lang attribute'
- },
- 'html-xml-lang-mismatch': {
- description: 'Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page',
- help: 'HTML elements with lang and xml:lang must have the same base language'
- },
- 'identical-links-same-purpose': {
- description: 'Ensure that links with the same accessible name serve a similar purpose',
- help: 'Links with the same name must have a similar purpose'
- },
- 'image-alt': {
- description: 'Ensures <img> elements have alternate text or a role of none or presentation',
- help: 'Images must have alternate text'
- },
- 'image-redundant-alt': {
- description: 'Ensure image alternative is not repeated as text',
- help: 'Alternative text of images should not be repeated as text'
- },
- 'input-button-name': {
- description: 'Ensures input buttons have discernible text',
- help: 'Input buttons must have discernible text'
- },
- 'input-image-alt': {
- description: 'Ensures <input type="image"> elements have alternate text',
- help: 'Image buttons must have alternate text'
- },
- 'label-content-name-mismatch': {
- description: 'Ensures that elements labelled through their content must have their visible text as part of their accessible name',
- help: 'Elements must have their visible text as part of their accessible name'
- },
- 'label-title-only': {
- description: 'Ensures that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes',
- help: 'Form elements should have a visible label'
- },
- label: {
- description: 'Ensures every form element has a label',
- help: 'Form elements must have labels'
- },
- 'landmark-banner-is-top-level': {
- description: 'Ensures the banner landmark is at top level',
- help: 'Banner landmark should not be contained in another landmark'
- },
- 'landmark-complementary-is-top-level': {
- description: 'Ensures the complementary landmark or aside is at top level',
- help: 'Aside should not be contained in another landmark'
- },
- 'landmark-contentinfo-is-top-level': {
- description: 'Ensures the contentinfo landmark is at top level',
- help: 'Contentinfo landmark should not be contained in another landmark'
- },
- 'landmark-main-is-top-level': {
- description: 'Ensures the main landmark is at top level',
- help: 'Main landmark should not be contained in another landmark'
- },
- 'landmark-no-duplicate-banner': {
- description: 'Ensures the document has at most one banner landmark',
- help: 'Document should not have more than one banner landmark'
- },
- 'landmark-no-duplicate-contentinfo': {
- description: 'Ensures the document has at most one contentinfo landmark',
- help: 'Document should not have more than one contentinfo landmark'
- },
- 'landmark-no-duplicate-main': {
- description: 'Ensures the document has at most one main landmark',
- help: 'Document should not have more than one main landmark'
- },
- 'landmark-one-main': {
- description: 'Ensures the document has a main landmark',
- help: 'Document should have one main landmark'
- },
- 'landmark-unique': {
- help: 'Ensures landmarks are unique',
- description: 'Landmarks should have a unique role or role/label/title (i.e. accessible name) combination'
- },
- 'link-in-text-block': {
- description: 'Ensure links are distinguished from surrounding text in a way that does not rely on color',
- help: 'Links must be distinguishable without relying on color'
- },
- 'link-name': {
- description: 'Ensures links have discernible text',
- help: 'Links must have discernible text'
- },
- list: {
- description: 'Ensures that lists are structured correctly',
- help: '<ul> and <ol> must only directly contain <li>, <script> or <template> elements'
- },
- listitem: {
- description: 'Ensures <li> elements are used semantically',
- help: '<li> elements must be contained in a <ul> or <ol>'
- },
- marquee: {
- description: 'Ensures <marquee> elements are not used',
- help: '<marquee> elements are deprecated and must not be used'
- },
- 'meta-refresh-no-exceptions': {
- description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
- help: 'Delayed refresh must not be used'
- },
- 'meta-refresh': {
- description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
- help: 'Delayed refresh under 20 hours must not be used'
- },
- 'meta-viewport-large': {
- description: 'Ensures <meta name="viewport"> can scale a significant amount',
- help: 'Users should be able to zoom and scale the text up to 500%'
- },
- 'meta-viewport': {
- description: 'Ensures <meta name="viewport"> does not disable text scaling and zooming',
- help: 'Zooming and scaling must not be disabled'
- },
- 'nested-interactive': {
- description: 'Ensures interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies',
- help: 'Interactive controls must not be nested'
- },
- 'no-autoplay-audio': {
- description: 'Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio',
- help: '<video> or <audio> elements must not play automatically'
- },
- 'object-alt': {
- description: 'Ensures <object> elements have alternate text',
- help: '<object> elements must have alternate text'
- },
- 'p-as-heading': {
- description: 'Ensure bold, italic text and font-size is not used to style <p> elements as a heading',
- help: 'Styled <p> elements must not be used as headings'
- },
- 'page-has-heading-one': {
- description: 'Ensure that the page, or at least one of its frames contains a level-one heading',
- help: 'Page should contain a level-one heading'
- },
- 'presentation-role-conflict': {
- description: 'Elements marked as presentational should not have global ARIA or tabindex to ensure all screen readers ignore them',
- help: 'Ensure elements marked as presentational are consistently ignored'
- },
- region: {
- description: 'Ensures all page content is contained by landmarks',
- help: 'All page content should be contained by landmarks'
- },
- 'role-img-alt': {
- description: 'Ensures [role=\'img\'] elements have alternate text',
- help: '[role=\'img\'] elements must have an alternative text'
- },
- 'scope-attr-valid': {
- description: 'Ensures the scope attribute is used correctly on tables',
- help: 'scope attribute should be used correctly'
- },
- 'scrollable-region-focusable': {
- description: 'Ensure elements that have scrollable content are accessible by keyboard',
- help: 'Scrollable region must have keyboard access'
- },
- 'select-name': {
- description: 'Ensures select element has an accessible name',
- help: 'Select element must have an accessible name'
- },
- 'server-side-image-map': {
- description: 'Ensures that server-side image maps are not used',
- help: 'Server-side image maps must not be used'
- },
- 'skip-link': {
- description: 'Ensure all skip links have a focusable target',
- help: 'The skip-link target should exist and be focusable'
- },
- 'svg-img-alt': {
- description: 'Ensures <svg> elements with an img, graphics-document or graphics-symbol role have an accessible text',
- help: '<svg> elements with an img role must have an alternative text'
- },
- tabindex: {
- description: 'Ensures tabindex attribute values are not greater than 0',
- help: 'Elements should not have tabindex greater than zero'
- },
- 'table-duplicate-name': {
- description: 'Ensure the <caption> element does not contain the same text as the summary attribute',
- help: 'tables should not have the same summary and caption'
- },
- 'table-fake-caption': {
- description: 'Ensure that tables with a caption use the <caption> element.',
- help: 'Data or header cells must not be used to give caption to a data table.'
- },
- 'target-size': {
- description: 'Ensure touch target have sufficient size and space',
- help: 'All touch targets must be 24px large, or leave sufficient space'
- },
- 'td-has-header': {
- description: 'Ensure that each non-empty data cell in a <table> larger than 3 by 3 has one or more table headers',
- help: 'Non-empty <td> elements in larger <table> must have an associated table header'
- },
- 'td-headers-attr': {
- description: 'Ensure that each cell in a table that uses the headers attribute refers only to other cells in that table',
- help: 'Table cells that use the headers attribute must only refer to cells in the same table'
- },
- 'th-has-data-cells': {
- description: 'Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe',
- help: 'Table headers in a data table must refer to data cells'
- },
- 'valid-lang': {
- description: 'Ensures lang attributes have valid values',
- help: 'lang attribute must have a valid value'
- },
- 'video-caption': {
- description: 'Ensures <video> elements have captions',
- help: '<video> elements must have captions'
- }
- },
- checks: {
- abstractrole: {
- impact: 'serious',
- messages: {
- pass: 'Abstract roles are not used',
- fail: {
- singular: 'Abstract role cannot be directly used: ${data.values}',
- plural: 'Abstract roles cannot be directly used: ${data.values}'
- }
- }
- },
- 'aria-allowed-attr': {
- impact: 'critical',
- messages: {
- pass: 'ARIA attributes are used correctly for the defined role',
- fail: {
- singular: 'ARIA attribute is not allowed: ${data.values}',
- plural: 'ARIA attributes are not allowed: ${data.values}'
- },
- incomplete: 'Check that there is no problem if the ARIA attribute is ignored on this element: ${data.values}'
- }
- },
- 'aria-allowed-role': {
- impact: 'minor',
- messages: {
- pass: 'ARIA role is allowed for given element',
- fail: {
- singular: 'ARIA role ${data.values} is not allowed for given element',
- plural: 'ARIA roles ${data.values} are not allowed for given element'
- },
- incomplete: {
- singular: 'ARIA role ${data.values} must be removed when the element is made visible, as it is not allowed for the element',
- plural: 'ARIA roles ${data.values} must be removed when the element is made visible, as they are not allowed for the element'
- }
- }
- },
- 'aria-busy': {
- impact: 'serious',
- messages: {
- pass: 'Element has an aria-busy attribute',
- fail: 'Element uses aria-busy="true" while showing a loader'
- }
- },
- 'aria-errormessage': {
- impact: 'critical',
- messages: {
- pass: 'aria-errormessage exists and references elements visible to screen readers that use a supported aria-errormessage technique',
- fail: {
- singular: 'aria-errormessage value `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
- plural: 'aria-errormessage values `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
- hidden: 'aria-errormessage value `${data.values}` cannot reference a hidden element'
- },
- incomplete: {
- singular: 'ensure aria-errormessage value `${data.values}` references an existing element',
- plural: 'ensure aria-errormessage values `${data.values}` reference existing elements',
- idrefs: 'unable to determine if aria-errormessage element exists on the page: ${data.values}'
- }
- }
- },
- 'aria-hidden-body': {
- impact: 'critical',
- messages: {
- pass: 'No aria-hidden attribute is present on document body',
- fail: 'aria-hidden=true should not be present on the document body'
- }
- },
- 'aria-level': {
- impact: 'serious',
- messages: {
- pass: 'aria-level values are valid',
- incomplete: 'aria-level values greater than 6 are not supported in all screenreader and browser combinations'
- }
- },
- 'aria-prohibited-attr': {
- impact: 'serious',
- messages: {
- pass: 'ARIA attribute is allowed',
- fail: {
- hasRolePlural: '${data.prohibited} attributes cannot be used with role "${data.role}".',
- hasRoleSingular: '${data.prohibited} attribute cannot be used with role "${data.role}".',
- noRolePlural: '${data.prohibited} attributes cannot be used on a ${data.nodeName} with no valid role attribute.',
- noRoleSingular: '${data.prohibited} attribute cannot be used on a ${data.nodeName} with no valid role attribute.'
- },
- incomplete: {
- hasRoleSingular: '${data.prohibited} attribute is not well supported with role "${data.role}".',
- hasRolePlural: '${data.prohibited} attributes are not well supported with role "${data.role}".',
- noRoleSingular: '${data.prohibited} attribute is not well supported on a ${data.nodeName} with no valid role attribute.',
- noRolePlural: '${data.prohibited} attributes are not well supported on a ${data.nodeName} with no valid role attribute.'
- }
- }
- },
- 'aria-required-attr': {
- impact: 'critical',
- messages: {
- pass: 'All required ARIA attributes are present',
- fail: {
- singular: 'Required ARIA attribute not present: ${data.values}',
- plural: 'Required ARIA attributes not present: ${data.values}'
- }
- }
- },
- 'aria-required-children': {
- impact: 'critical',
- messages: {
- pass: 'Required ARIA children are present',
- fail: {
- singular: 'Required ARIA child role not present: ${data.values}',
- plural: 'Required ARIA children role not present: ${data.values}',
- unallowed: 'Element has children which are not allowed: ${data.values}'
- },
- incomplete: {
- singular: 'Expecting ARIA child role to be added: ${data.values}',
- plural: 'Expecting ARIA children role to be added: ${data.values}'
- }
- }
- },
- 'aria-required-parent': {
- impact: 'critical',
- messages: {
- pass: 'Required ARIA parent role present',
- fail: {
- singular: 'Required ARIA parent role not present: ${data.values}',
- plural: 'Required ARIA parents role not present: ${data.values}'
- }
- }
- },
- 'aria-roledescription': {
- impact: 'serious',
- messages: {
- pass: 'aria-roledescription used on a supported semantic role',
- incomplete: 'Check that the aria-roledescription is announced by supported screen readers',
- fail: 'Give the element a role that supports aria-roledescription'
- }
- },
- 'aria-unsupported-attr': {
- impact: 'critical',
- messages: {
- pass: 'ARIA attribute is supported',
- fail: 'ARIA attribute is not widely supported in screen readers and assistive technologies: ${data.values}'
- }
- },
- 'aria-valid-attr-value': {
- impact: 'critical',
- messages: {
- pass: 'ARIA attribute values are valid',
- fail: {
- singular: 'Invalid ARIA attribute value: ${data.values}',
- plural: 'Invalid ARIA attribute values: ${data.values}'
- },
- incomplete: {
- noId: 'ARIA attribute element ID does not exist on the page: ${data.needsReview}',
- noIdShadow: 'ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: ${data.needsReview}',
- ariaCurrent: 'ARIA attribute value is invalid and will be treated as "aria-current=true": ${data.needsReview}',
- idrefs: 'Unable to determine if ARIA attribute element ID exists on the page: ${data.needsReview}',
- empty: 'ARIA attribute value is ignored while empty: ${data.needsReview}'
- }
- }
- },
- 'aria-valid-attr': {
- impact: 'critical',
- messages: {
- pass: 'ARIA attribute name is valid',
- fail: {
- singular: 'Invalid ARIA attribute name: ${data.values}',
- plural: 'Invalid ARIA attribute names: ${data.values}'
- }
- }
- },
- deprecatedrole: {
- impact: 'minor',
- messages: {
- pass: 'ARIA role is not deprecated',
- fail: 'The role used is deprecated: ${data}'
- }
- },
- fallbackrole: {
- impact: 'serious',
- messages: {
- pass: 'Only one role value used',
- fail: 'Use only one role value, since fallback roles are not supported in older browsers',
- incomplete: 'Use only role \'presentation\' or \'none\' since they are synonymous.'
- }
- },
- 'has-global-aria-attribute': {
- impact: 'minor',
- messages: {
- pass: {
- singular: 'Element has global ARIA attribute: ${data.values}',
- plural: 'Element has global ARIA attributes: ${data.values}'
- },
- fail: 'Element does not have global ARIA attribute'
- }
- },
- 'has-widget-role': {
- impact: 'minor',
- messages: {
- pass: 'Element has a widget role.',
- fail: 'Element does not have a widget role.'
- }
- },
- invalidrole: {
- impact: 'critical',
- messages: {
- pass: 'ARIA role is valid',
- fail: {
- singular: 'Role must be one of the valid ARIA roles: ${data.values}',
- plural: 'Roles must be one of the valid ARIA roles: ${data.values}'
- }
- }
- },
- 'is-element-focusable': {
- impact: 'minor',
- messages: {
- pass: 'Element is focusable.',
- fail: 'Element is not focusable.'
- }
- },
- 'no-implicit-explicit-label': {
- impact: 'moderate',
- messages: {
- pass: 'There is no mismatch between a <label> and accessible name',
- incomplete: 'Check that the <label> does not need be part of the ARIA ${data} field\'s name'
- }
- },
- unsupportedrole: {
- impact: 'critical',
- messages: {
- pass: 'ARIA role is supported',
- fail: 'The role used is not widely supported in screen readers and assistive technologies: ${data}'
- }
- },
- 'valid-scrollable-semantics': {
- impact: 'minor',
- messages: {
- pass: 'Element has valid semantics for an element in the focus order.',
- fail: 'Element has invalid semantics for an element in the focus order.'
- }
- },
- 'color-contrast-enhanced': {
- impact: 'serious',
- messages: {
- pass: 'Element has sufficient color contrast of ${data.contrastRatio}',
- fail: {
- 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}',
- 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}',
- 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}'
- },
- incomplete: {
- default: 'Unable to determine contrast ratio',
- bgImage: 'Element\'s background color could not be determined due to a background image',
- bgGradient: 'Element\'s background color could not be determined due to a background gradient',
- imgNode: 'Element\'s background color could not be determined because element contains an image node',
- bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
- fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
- elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
- elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
- outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
- equalRatio: 'Element has a 1:1 contrast ratio with the background',
- shortTextContent: 'Element content is too short to determine if it is actual text content',
- nonBmp: 'Element content contains only non-text characters',
- pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
- }
- }
- },
- 'color-contrast': {
- impact: 'serious',
- messages: {
- pass: {
- default: 'Element has sufficient color contrast of ${data.contrastRatio}',
- hidden: 'Element is hidden'
- },
- fail: {
- 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}',
- 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}',
- 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}'
- },
- incomplete: {
- default: 'Unable to determine contrast ratio',
- bgImage: 'Element\'s background color could not be determined due to a background image',
- bgGradient: 'Element\'s background color could not be determined due to a background gradient',
- imgNode: 'Element\'s background color could not be determined because element contains an image node',
- bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
- fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
- elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
- elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
- outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
- equalRatio: 'Element has a 1:1 contrast ratio with the background',
- shortTextContent: 'Element content is too short to determine if it is actual text content',
- nonBmp: 'Element content contains only non-text characters',
- pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
- }
- }
- },
- 'link-in-text-block-style': {
- impact: 'serious',
- messages: {
- pass: 'Links can be distinguished from surrounding text by visual styling',
- fail: 'The link has no styling (such as underline) to distinguish it from the surrounding text'
- }
- },
- 'link-in-text-block': {
- impact: 'serious',
- messages: {
- pass: 'Links can be distinguished from surrounding text in some way other than by color',
- fail: {
- 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})',
- 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})'
- },
- incomplete: {
- default: 'Element\'s foreground contrast ratio could not be determined',
- bgContrast: 'Element\'s background contrast ratio could not be determined',
- bgImage: 'Element\'s contrast ratio could not be determined due to a background image',
- bgGradient: 'Element\'s contrast ratio could not be determined due to a background gradient',
- imgNode: 'Element\'s contrast ratio could not be determined because element contains an image node',
- bgOverlap: 'Element\'s contrast ratio could not be determined because of element overlap'
- }
- }
- },
- 'autocomplete-appropriate': {
- impact: 'serious',
- messages: {
- pass: 'the autocomplete value is on an appropriate element',
- fail: 'the autocomplete value is inappropriate for this type of input'
- }
- },
- 'autocomplete-valid': {
- impact: 'serious',
- messages: {
- pass: 'the autocomplete attribute is correctly formatted',
- fail: 'the autocomplete attribute is incorrectly formatted'
- }
- },
- accesskeys: {
- impact: 'serious',
- messages: {
- pass: 'Accesskey attribute value is unique',
- fail: 'Document has multiple elements with the same accesskey'
- }
- },
- 'focusable-content': {
- impact: 'serious',
- messages: {
- pass: 'Element contains focusable elements',
- fail: 'Element should have focusable content'
- }
- },
- 'focusable-disabled': {
- impact: 'serious',
- messages: {
- pass: 'No focusable elements contained within element',
- incomplete: 'Check if the focusable elements immediately move the focus indicator',
- fail: 'Focusable content should be disabled or be removed from the DOM'
- }
- },
- 'focusable-element': {
- impact: 'serious',
- messages: {
- pass: 'Element is focusable',
- fail: 'Element should be focusable'
- }
- },
- 'focusable-modal-open': {
- impact: 'serious',
- messages: {
- pass: 'No focusable elements while a modal is open',
- incomplete: 'Check that focusable elements are not tabbable in the current state'
- }
- },
- 'focusable-no-name': {
- impact: 'serious',
- messages: {
- pass: 'Element is not in tab order or has accessible text',
- fail: 'Element is in tab order and does not have accessible text',
- incomplete: 'Unable to determine if element has an accessible name'
- }
- },
- 'focusable-not-tabbable': {
- impact: 'serious',
- messages: {
- pass: 'No focusable elements contained within element',
- incomplete: 'Check if the focusable elements immediately move the focus indicator',
- fail: 'Focusable content should have tabindex=\'-1\' or be removed from the DOM'
- }
- },
- 'frame-focusable-content': {
- impact: 'serious',
- messages: {
- pass: 'Element does not have focusable descendants',
- fail: 'Element has focusable descendants',
- incomplete: 'Could not determine if element has descendants'
- }
- },
- 'landmark-is-top-level': {
- impact: 'moderate',
- messages: {
- pass: 'The ${data.role} landmark is at the top level.',
- fail: 'The ${data.role} landmark is contained in another landmark.'
- }
- },
- 'no-focusable-content': {
- impact: 'serious',
- messages: {
- pass: 'Element does not have focusable descendants',
- fail: {
- default: 'Element has focusable descendants',
- 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\')'
- },
- incomplete: 'Could not determine if element has descendants'
- }
- },
- 'page-has-heading-one': {
- impact: 'moderate',
- messages: {
- pass: 'Page has at least one level-one heading',
- fail: 'Page must have a level-one heading'
- }
- },
- 'page-has-main': {
- impact: 'moderate',
- messages: {
- pass: 'Document has at least one main landmark',
- fail: 'Document does not have a main landmark'
- }
- },
- 'page-no-duplicate-banner': {
- impact: 'moderate',
- messages: {
- pass: 'Document does not have more than one banner landmark',
- fail: 'Document has more than one banner landmark'
- }
- },
- 'page-no-duplicate-contentinfo': {
- impact: 'moderate',
- messages: {
- pass: 'Document does not have more than one contentinfo landmark',
- fail: 'Document has more than one contentinfo landmark'
- }
- },
- 'page-no-duplicate-main': {
- impact: 'moderate',
- messages: {
- pass: 'Document does not have more than one main landmark',
- fail: 'Document has more than one main landmark'
- }
- },
- tabindex: {
- impact: 'serious',
- messages: {
- pass: 'Element does not have a tabindex greater than 0',
- fail: 'Element has a tabindex greater than 0'
- }
- },
- 'alt-space-value': {
- impact: 'critical',
- messages: {
- pass: 'Element has a valid alt attribute value',
- fail: 'Element has an alt attribute containing only a space character, which is not ignored by all screen readers'
- }
- },
- 'duplicate-img-label': {
- impact: 'minor',
- messages: {
- pass: 'Element does not duplicate existing text in <img> alt text',
- fail: 'Element contains <img> element with alt text that duplicates existing text'
- }
- },
- 'explicit-label': {
- impact: 'critical',
- messages: {
- pass: 'Form element has an explicit <label>',
- fail: 'Form element does not have an explicit <label>',
- incomplete: 'Unable to determine if form element has an explicit <label>'
- }
- },
- 'help-same-as-label': {
- impact: 'minor',
- messages: {
- pass: 'Help text (title or aria-describedby) does not duplicate label text',
- fail: 'Help text (title or aria-describedby) text is the same as the label text'
- }
- },
- 'hidden-explicit-label': {
- impact: 'critical',
- messages: {
- pass: 'Form element has a visible explicit <label>',
- fail: 'Form element has explicit <label> that is hidden',
- incomplete: 'Unable to determine if form element has explicit <label> that is hidden'
- }
- },
- 'implicit-label': {
- impact: 'critical',
- messages: {
- pass: 'Form element has an implicit (wrapped) <label>',
- fail: 'Form element does not have an implicit (wrapped) <label>',
- incomplete: 'Unable to determine if form element has an implicit (wrapped} <label>'
- }
- },
- 'label-content-name-mismatch': {
- impact: 'serious',
- messages: {
- pass: 'Element contains visible text as part of it\'s accessible name',
- fail: 'Text inside the element is not included in the accessible name'
- }
- },
- 'multiple-label': {
- impact: 'moderate',
- messages: {
- pass: 'Form field does not have multiple label elements',
- incomplete: 'Multiple label elements is not widely supported in assistive technologies. Ensure the first label contains all necessary information.'
- }
- },
- 'title-only': {
- impact: 'serious',
- messages: {
- pass: 'Form element does not solely use title attribute for its label',
- fail: 'Only title used to generate label for form element'
- }
- },
- 'landmark-is-unique': {
- impact: 'moderate',
- messages: {
- pass: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination',
- fail: 'The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable'
- }
- },
- 'has-lang': {
- impact: 'serious',
- messages: {
- pass: 'The <html> element has a lang attribute',
- fail: {
- noXHTML: 'The xml:lang attribute is not valid on HTML pages, use the lang attribute.',
- noLang: 'The <html> element does not have a lang attribute'
- }
- }
- },
- 'valid-lang': {
- impact: 'serious',
- messages: {
- pass: 'Value of lang attribute is included in the list of valid languages',
- fail: 'Value of lang attribute not included in the list of valid languages'
- }
- },
- 'xml-lang-mismatch': {
- impact: 'moderate',
- messages: {
- pass: 'Lang and xml:lang attributes have the same base language',
- fail: 'Lang and xml:lang attributes do not have the same base language'
- }
- },
- dlitem: {
- impact: 'serious',
- messages: {
- pass: 'Description list item has a <dl> parent element',
- fail: 'Description list item does not have a <dl> parent element'
- }
- },
- listitem: {
- impact: 'serious',
- messages: {
- pass: 'List item has a <ul>, <ol> or role="list" parent element',
- fail: {
- default: 'List item does not have a <ul>, <ol> parent element',
- roleNotValid: 'List item does not have a <ul>, <ol> parent element without a role, or a role="list"'
- }
- }
- },
- 'only-dlitems': {
- impact: 'serious',
- messages: {
- pass: 'dl element only has direct children that are allowed inside; <dt>, <dd>, or <div> elements',
- fail: 'dl element has direct children that are not allowed: ${data.values}'
- }
- },
- 'only-listitems': {
- impact: 'serious',
- messages: {
- pass: 'List element only has direct children that are allowed inside <li> elements',
- fail: 'List element has direct children that are not allowed: ${data.values}'
- }
- },
- 'structured-dlitems': {
- impact: 'serious',
- messages: {
- pass: 'When not empty, element has both <dt> and <dd> elements',
- fail: 'When not empty, element does not have at least one <dt> element followed by at least one <dd> element'
- }
- },
- caption: {
- impact: 'critical',
- messages: {
- pass: 'The multimedia element has a captions track',
- incomplete: 'Check that captions is available for the element'
- }
- },
- 'frame-tested': {
- impact: 'critical',
- messages: {
- pass: 'The iframe was tested with axe-core',
- fail: 'The iframe could not be tested with axe-core',
- incomplete: 'The iframe still has to be tested with axe-core'
- }
- },
- 'no-autoplay-audio': {
- impact: 'moderate',
- messages: {
- pass: '<video> or <audio> does not output audio for more than allowed duration or has controls mechanism',
- fail: '<video> or <audio> outputs audio for more than allowed duration and does not have a controls mechanism',
- incomplete: 'Check that the <video> or <audio> does not output audio for more than allowed duration or provides a controls mechanism'
- }
- },
- 'css-orientation-lock': {
- impact: 'serious',
- messages: {
- pass: 'Display is operable, and orientation lock does not exist',
- fail: 'CSS Orientation lock is applied, and makes display inoperable',
- incomplete: 'CSS Orientation lock cannot be determined'
- }
- },
- 'meta-viewport-large': {
- impact: 'minor',
- messages: {
- pass: '<meta> tag does not prevent significant zooming on mobile devices',
- fail: '<meta> tag limits zooming on mobile devices'
- }
- },
- 'meta-viewport': {
- impact: 'critical',
- messages: {
- pass: '<meta> tag does not disable zooming on mobile devices',
- fail: '${data} on <meta> tag disables zooming on mobile devices'
- }
- },
- 'target-offset': {
- impact: 'serious',
- messages: {
- pass: 'Target has sufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px)',
- fail: 'Target has insufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px)',
- incomplete: {
- default: 'Element with negative tabindex has insufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px). Is this a target?',
- nonTabbableNeighbor: 'Target has insufficient offset from a neighbor with negative tabindex (${data.closestOffset}px should be at least ${data.minOffset}px). Is the neighbor a target?'
- }
- }
- },
- 'target-size': {
- impact: 'serious',
- messages: {
- pass: {
- default: 'Control has sufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
- obscured: 'Control is ignored because it is fully obscured and thus not clickable'
- },
- fail: {
- default: 'Target has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
- 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)'
- },
- incomplete: {
- 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?',
- contentOverflow: 'Element size could not be accurately determined due to overflow content',
- 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?',
- 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?'
- }
- }
- },
- 'header-present': {
- impact: 'serious',
- messages: {
- pass: 'Page has a heading',
- fail: 'Page does not have a heading'
- }
- },
- 'heading-order': {
- impact: 'moderate',
- messages: {
- pass: 'Heading order valid',
- fail: 'Heading order invalid',
- incomplete: 'Unable to determine previous heading'
- }
- },
- 'identical-links-same-purpose': {
- impact: 'minor',
- messages: {
- pass: 'There are no other links with the same name, that go to a different URL',
- incomplete: 'Check that links have the same purpose, or are intentionally ambiguous.'
- }
- },
- 'internal-link-present': {
- impact: 'serious',
- messages: {
- pass: 'Valid skip link found',
- fail: 'No valid skip link found'
- }
- },
- landmark: {
- impact: 'serious',
- messages: {
- pass: 'Page has a landmark region',
- fail: 'Page does not have a landmark region'
- }
- },
- 'meta-refresh-no-exceptions': {
- impact: 'minor',
- messages: {
- pass: '<meta> tag does not immediately refresh the page',
- fail: '<meta> tag forces timed refresh of page'
- }
- },
- 'meta-refresh': {
- impact: 'critical',
- messages: {
- pass: '<meta> tag does not immediately refresh the page',
- fail: '<meta> tag forces timed refresh of page (less than 20 hours)'
- }
- },
- 'p-as-heading': {
- impact: 'serious',
- messages: {
- pass: '<p> elements are not styled as headings',
- fail: 'Heading elements should be used instead of styled <p> elements',
- incomplete: 'Unable to determine if <p> elements are styled as headings'
- }
- },
- region: {
- impact: 'moderate',
- messages: {
- pass: 'All page content is contained by landmarks',
- fail: 'Some page content is not contained by landmarks'
- }
- },
- 'skip-link': {
- impact: 'moderate',
- messages: {
- pass: 'Skip link target exists',
- incomplete: 'Skip link target should become visible on activation',
- fail: 'No skip link target'
- }
- },
- 'unique-frame-title': {
- impact: 'serious',
- messages: {
- pass: 'Element\'s title attribute is unique',
- fail: 'Element\'s title attribute is not unique'
- }
- },
- 'duplicate-id-active': {
- impact: 'serious',
- messages: {
- pass: 'Document has no active elements that share the same id attribute',
- fail: 'Document has active elements with the same id attribute: ${data}'
- }
- },
- 'duplicate-id-aria': {
- impact: 'critical',
- messages: {
- pass: 'Document has no elements referenced with ARIA or labels that share the same id attribute',
- fail: 'Document has multiple elements referenced with ARIA with the same id attribute: ${data}'
- }
- },
- 'duplicate-id': {
- impact: 'minor',
- messages: {
- pass: 'Document has no static elements that share the same id attribute',
- fail: 'Document has multiple static elements with the same id attribute: ${data}'
- }
- },
- 'aria-label': {
- impact: 'serious',
- messages: {
- pass: 'aria-label attribute exists and is not empty',
- fail: 'aria-label attribute does not exist or is empty'
- }
- },
- 'aria-labelledby': {
- impact: 'serious',
- messages: {
- pass: 'aria-labelledby attribute exists and references elements that are visible to screen readers',
- fail: 'aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty',
- incomplete: 'ensure aria-labelledby references an existing element'
- }
- },
- 'avoid-inline-spacing': {
- impact: 'serious',
- messages: {
- pass: 'No inline styles with \'!important\' that affect text spacing has been specified',
- fail: {
- singular: 'Remove \'!important\' from inline style ${data.values}, as overriding this is not supported by most browsers',
- plural: 'Remove \'!important\' from inline styles ${data.values}, as overriding this is not supported by most browsers'
- }
- }
- },
- 'button-has-visible-text': {
- impact: 'critical',
- messages: {
- pass: 'Element has inner text that is visible to screen readers',
- fail: 'Element does not have inner text that is visible to screen readers',
- incomplete: 'Unable to determine if element has children'
- }
- },
- 'doc-has-title': {
- impact: 'serious',
- messages: {
- pass: 'Document has a non-empty <title> element',
- fail: 'Document does not have a non-empty <title> element'
- }
- },
- exists: {
- impact: 'minor',
- messages: {
- pass: 'Element does not exist',
- incomplete: 'Element exists'
- }
- },
- 'has-alt': {
- impact: 'critical',
- messages: {
- pass: 'Element has an alt attribute',
- fail: 'Element does not have an alt attribute'
- }
- },
- 'has-visible-text': {
- impact: 'minor',
- messages: {
- pass: 'Element has text that is visible to screen readers',
- fail: 'Element does not have text that is visible to screen readers',
- incomplete: 'Unable to determine if element has children'
- }
- },
- 'important-letter-spacing': {
- impact: 'serious',
- messages: {
- pass: 'Letter-spacing in the style attribute is not set to !important, or meets the minimum',
- fail: 'letter-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
- }
- },
- 'important-line-height': {
- impact: 'serious',
- messages: {
- pass: 'line-height in the style attribute is not set to !important, or meets the minimum',
- fail: 'line-height in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
- }
- },
- 'important-word-spacing': {
- impact: 'serious',
- messages: {
- pass: 'word-spacing in the style attribute is not set to !important, or meets the minimum',
- fail: 'word-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
- }
- },
- 'is-on-screen': {
- impact: 'serious',
- messages: {
- pass: 'Element is not visible',
- fail: 'Element is visible'
- }
- },
- 'non-empty-alt': {
- impact: 'critical',
- messages: {
- pass: 'Element has a non-empty alt attribute',
- fail: {
- noAttr: 'Element has no alt attribute',
- emptyAttr: 'Element has an empty alt attribute'
- }
- }
- },
- 'non-empty-if-present': {
- impact: 'critical',
- messages: {
- pass: {
- default: 'Element does not have a value attribute',
- 'has-label': 'Element has a non-empty value attribute'
- },
- fail: 'Element has a value attribute and the value attribute is empty'
- }
- },
- 'non-empty-placeholder': {
- impact: 'serious',
- messages: {
- pass: 'Element has a placeholder attribute',
- fail: {
- noAttr: 'Element has no placeholder attribute',
- emptyAttr: 'Element has an empty placeholder attribute'
- }
- }
- },
- 'non-empty-title': {
- impact: 'serious',
- messages: {
- pass: 'Element has a title attribute',
- fail: {
- noAttr: 'Element has no title attribute',
- emptyAttr: 'Element has an empty title attribute'
- }
- }
- },
- 'non-empty-value': {
- impact: 'critical',
- messages: {
- pass: 'Element has a non-empty value attribute',
- fail: {
- noAttr: 'Element has no value attribute',
- emptyAttr: 'Element has an empty value attribute'
- }
- }
- },
- 'presentational-role': {
- impact: 'minor',
- messages: {
- pass: 'Element\'s default semantics were overriden with role="${data.role}"',
- fail: {
- default: 'Element\'s default semantics were not overridden with role="none" or role="presentation"',
- globalAria: 'Element\'s role is not presentational because it has a global ARIA attribute',
- focusable: 'Element\'s role is not presentational because it is focusable',
- both: 'Element\'s role is not presentational because it has a global ARIA attribute and is focusable',
- iframe: 'Using the "title" attribute on an ${data.nodeName} element with a presentational role behaves inconsistently between screen readers'
- }
- }
- },
- 'role-none': {
- impact: 'minor',
- messages: {
- pass: 'Element\'s default semantics were overriden with role="none"',
- fail: 'Element\'s default semantics were not overridden with role="none"'
- }
- },
- 'role-presentation': {
- impact: 'minor',
- messages: {
- pass: 'Element\'s default semantics were overriden with role="presentation"',
- fail: 'Element\'s default semantics were not overridden with role="presentation"'
- }
- },
- 'svg-non-empty-title': {
- impact: 'serious',
- messages: {
- pass: 'Element has a child that is a title',
- fail: {
- noTitle: 'Element has no child that is a title',
- emptyTitle: 'Element child title is empty'
- },
- incomplete: 'Unable to determine element has a child that is a title'
- }
- },
- 'caption-faked': {
- impact: 'serious',
- messages: {
- pass: 'The first row of a table is not used as a caption',
- fail: 'The first child of the table should be a caption instead of a table cell'
- }
- },
- 'html5-scope': {
- impact: 'moderate',
- messages: {
- pass: 'Scope attribute is only used on table header elements (<th>)',
- fail: 'In HTML 5, scope attributes may only be used on table header elements (<th>)'
- }
- },
- 'same-caption-summary': {
- impact: 'minor',
- messages: {
- pass: 'Content of summary attribute and <caption> are not duplicated',
- fail: 'Content of summary attribute and <caption> element are identical',
- incomplete: 'Unable to determine if <table> element has a caption'
- }
- },
- 'scope-value': {
- impact: 'critical',
- messages: {
- pass: 'Scope attribute is used correctly',
- fail: 'The value of the scope attribute may only be \'row\' or \'col\''
- }
- },
- 'td-has-header': {
- impact: 'critical',
- messages: {
- pass: 'All non-empty data cells have table headers',
- fail: 'Some non-empty data cells do not have table headers'
- }
- },
- 'td-headers-attr': {
- impact: 'serious',
- messages: {
- pass: 'The headers attribute is exclusively used to refer to other cells in the table',
- incomplete: 'The headers attribute is empty',
- fail: 'The headers attribute is not exclusively used to refer to other cells in the table'
- }
- },
- 'th-has-data-cells': {
- impact: 'serious',
- messages: {
- pass: 'All table header cells refer to data cells',
- fail: 'Not all table header cells refer to data cells',
- incomplete: 'Table data cells are missing or empty'
- }
- },
- 'hidden-content': {
- impact: 'minor',
- messages: {
- pass: 'All content on the page has been analyzed.',
- fail: 'There were problems analyzing the content on this page.',
- 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.'
- }
- }
- },
- failureSummaries: {
- any: {
- failureMessage: function anonymous(it) {
- var out = 'Fix any of the following:';
- var arr1 = it;
- if (arr1) {
- var value, i1 = -1, l1 = arr1.length - 1;
- while (i1 < l1) {
- value = arr1[i1 += 1];
- out += '\n ' + value.split('\n').join('\n ');
- }
- }
- return out;
- }
- },
- none: {
- failureMessage: function anonymous(it) {
- var out = 'Fix all of the following:';
- var arr1 = it;
- if (arr1) {
- var value, i1 = -1, l1 = arr1.length - 1;
- while (i1 < l1) {
- value = arr1[i1 += 1];
- out += '\n ' + value.split('\n').join('\n ');
- }
- }
- return out;
- }
- }
- },
- incompleteFallbackMessage: 'axe couldn\'t tell the reason. Time to break out the element inspector!'
- },
- rules: [ {
- id: 'accesskeys',
- selector: '[accesskey]',
- excludeHidden: false,
- tags: [ 'cat.keyboard', 'best-practice' ],
- all: [],
- any: [],
- none: [ 'accesskeys' ]
- }, {
- id: 'area-alt',
- selector: 'map area[href]',
- excludeHidden: false,
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
- actIds: [ 'c487ae' ],
- all: [],
- any: [ {
- options: {
- attribute: 'alt'
- },
- id: 'non-empty-alt'
- }, 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-allowed-attr',
- matches: 'aria-allowed-attr-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- actIds: [ '5c01ea' ],
- all: [],
- any: [ {
- options: {
- validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
- },
- id: 'aria-allowed-attr'
- } ],
- none: [ 'aria-unsupported-attr', {
- options: {
- elementsAllowedAriaLabel: [ 'applet', 'input' ]
- },
- id: 'aria-prohibited-attr'
- } ]
- }, {
- id: 'aria-allowed-role',
- excludeHidden: false,
- selector: '[role]',
- matches: 'aria-allowed-role-matches',
- tags: [ 'cat.aria', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- allowImplicit: true,
- ignoredTags: []
- },
- id: 'aria-allowed-role'
- } ],
- none: []
- }, {
- id: 'aria-command-name',
- selector: '[role="link"], [role="button"], [role="menuitem"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT6.a' ],
- actIds: [ '97a4e1' ],
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-dialog-name',
- selector: '[role="dialog"], [role="alertdialog"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'best-practice' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-hidden-body',
- selector: 'body',
- excludeHidden: false,
- matches: 'is-initiator-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- all: [],
- any: [ 'aria-hidden-body' ],
- none: []
- }, {
- id: 'aria-hidden-focus',
- selector: '[aria-hidden="true"]',
- matches: 'aria-hidden-focus-matches',
- excludeHidden: false,
- tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412' ],
- actIds: [ '6cfa84' ],
- all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
- any: [],
- none: []
- }, {
- id: 'aria-input-field-name',
- selector: '[role="combobox"], [role="listbox"], [role="searchbox"], [role="slider"], [role="spinbutton"], [role="textbox"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT5.c' ],
- actIds: [ 'e086e5' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: [ 'no-implicit-explicit-label' ]
- }, {
- id: 'aria-meter-name',
- selector: '[role="meter"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-progressbar-name',
- selector: '[role="progressbar"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-required-attr',
- selector: '[role]',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- actIds: [ '4e8ab6' ],
- all: [],
- any: [ 'aria-required-attr' ],
- none: []
- }, {
- id: 'aria-required-children',
- selector: '[role]',
- matches: 'aria-required-children-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
- actIds: [ 'bc4a75', 'ff89c9' ],
- all: [],
- any: [ {
- options: {
- reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
- },
- id: 'aria-required-children'
- }, 'aria-busy' ],
- none: []
- }, {
- id: 'aria-required-parent',
- selector: '[role]',
- matches: 'aria-required-parent-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
- actIds: [ 'ff89c9' ],
- all: [],
- any: [ {
- options: {
- ownGroupRoles: [ 'listitem', 'treeitem' ]
- },
- id: 'aria-required-parent'
- } ],
- none: []
- }, {
- id: 'aria-roledescription',
- selector: '[aria-roledescription]',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'deprecated' ],
- enabled: false,
- all: [],
- any: [ {
- options: {
- supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
- },
- id: 'aria-roledescription'
- } ],
- none: []
- }, {
- id: 'aria-roles',
- selector: '[role]',
- matches: 'no-empty-role-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- actIds: [ '674b10' ],
- all: [],
- any: [],
- none: [ 'invalidrole', 'abstractrole', 'unsupportedrole', 'deprecatedrole' ]
- }, {
- id: 'aria-text',
- selector: '[role=text]',
- tags: [ 'cat.aria', 'best-practice' ],
- all: [],
- any: [ 'no-focusable-content' ],
- none: []
- }, {
- id: 'aria-toggle-field-name',
- selector: '[role="checkbox"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="radio"], [role="switch"], [role="option"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT5.c' ],
- actIds: [ 'e086e5' ],
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: [ 'no-implicit-explicit-label' ]
- }, {
- id: 'aria-tooltip-name',
- selector: '[role="tooltip"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-treeitem-name',
- selector: '[role="treeitem"]',
- matches: 'no-naming-method-matches',
- tags: [ 'cat.aria', 'best-practice' ],
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'aria-valid-attr-value',
- matches: 'aria-has-attr-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- actIds: [ '6a7281' ],
- all: [ {
- options: [],
- id: 'aria-valid-attr-value'
- }, 'aria-errormessage', 'aria-level' ],
- any: [],
- none: []
- }, {
- id: 'aria-valid-attr',
- matches: 'aria-has-attr-matches',
- tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
- actIds: [ '5f99a7' ],
- all: [],
- any: [ {
- options: [],
- id: 'aria-valid-attr'
- } ],
- none: []
- }, {
- id: 'audio-caption',
- selector: 'audio',
- enabled: false,
- excludeHidden: false,
- tags: [ 'cat.time-and-media', 'wcag2a', 'wcag121', 'section508', 'section508.22.a', 'deprecated' ],
- actIds: [ '2eb176', 'afb423' ],
- all: [],
- any: [],
- none: [ 'caption' ]
- }, {
- id: 'autocomplete-valid',
- matches: 'autocomplete-matches',
- tags: [ 'cat.forms', 'wcag21aa', 'wcag135', 'ACT' ],
- actIds: [ '73f2c2' ],
- all: [ {
- options: {
- stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ]
- },
- id: 'autocomplete-valid'
- } ],
- any: [],
- none: []
- }, {
- id: 'avoid-inline-spacing',
- selector: '[style]',
- matches: 'is-visible-on-screen-matches',
- tags: [ 'cat.structure', 'wcag21aa', 'wcag1412', 'ACT' ],
- actIds: [ '24afc2', '9e45ec', '78fd32' ],
- all: [ {
- options: {
- cssProperty: 'letter-spacing',
- minValue: .12
- },
- id: 'important-letter-spacing'
- }, {
- options: {
- cssProperty: 'word-spacing',
- minValue: .16
- },
- id: 'important-word-spacing'
- }, {
- options: {
- multiLineOnly: true,
- cssProperty: 'line-height',
- minValue: 1.5,
- normalValue: 1
- },
- id: 'important-line-height'
- } ],
- any: [],
- none: []
- }, {
- id: 'blink',
- selector: 'blink',
- excludeHidden: false,
- tags: [ 'cat.time-and-media', 'wcag2a', 'wcag222', 'section508', 'section508.22.j', 'TTv5', 'TT2.b' ],
- all: [],
- any: [],
- none: [ 'is-on-screen' ]
- }, {
- id: 'button-name',
- selector: 'button',
- matches: 'no-explicit-name-required-matches',
- tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
- actIds: [ '97a4e1', 'm6b1q3' ],
- all: [],
- any: [ 'button-has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'presentational-role' ],
- none: []
- }, {
- id: 'bypass',
- selector: 'html',
- pageLevel: true,
- matches: 'bypass-matches',
- reviewOnFail: true,
- tags: [ 'cat.keyboard', 'wcag2a', 'wcag241', 'section508', 'section508.22.o', 'TTv5', 'TT9.a' ],
- actIds: [ 'cf77f2', '047fe0', 'b40fd1', '3e12e1', 'ye5d6e' ],
- all: [],
- any: [ 'internal-link-present', {
- options: {
- selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
- },
- id: 'header-present'
- }, {
- options: {
- selector: 'main, [role=main]'
- },
- id: 'landmark'
- } ],
- none: []
- }, {
- id: 'color-contrast-enhanced',
- matches: 'color-contrast-matches',
- excludeHidden: false,
- enabled: false,
- tags: [ 'cat.color', 'wcag2aaa', 'wcag146', 'ACT' ],
- actIds: [ '09o5cg' ],
- all: [],
- any: [ {
- options: {
- ignoreUnicode: true,
- ignoreLength: false,
- ignorePseudo: false,
- boldValue: 700,
- boldTextPt: 14,
- largeTextPt: 18,
- contrastRatio: {
- normal: {
- expected: 7,
- minThreshold: 4.5
- },
- large: {
- expected: 4.5,
- minThreshold: 3
- }
- },
- pseudoSizeThreshold: .25,
- shadowOutlineEmMax: .1,
- textStrokeEmMin: .03
- },
- id: 'color-contrast-enhanced'
- } ],
- none: []
- }, {
- id: 'color-contrast',
- matches: 'color-contrast-matches',
- excludeHidden: false,
- tags: [ 'cat.color', 'wcag2aa', 'wcag143', 'ACT', 'TTv5', 'TT13.c' ],
- actIds: [ 'afw4f7', '09o5cg' ],
- all: [],
- any: [ {
- options: {
- ignoreUnicode: true,
- ignoreLength: false,
- ignorePseudo: false,
- boldValue: 700,
- boldTextPt: 14,
- largeTextPt: 18,
- contrastRatio: {
- normal: {
- expected: 4.5
- },
- large: {
- expected: 3
- }
- },
- pseudoSizeThreshold: .25,
- shadowOutlineEmMax: .2,
- textStrokeEmMin: .03
- },
- id: 'color-contrast'
- } ],
- none: []
- }, {
- id: 'css-orientation-lock',
- selector: 'html',
- tags: [ 'cat.structure', 'wcag134', 'wcag21aa', 'experimental' ],
- actIds: [ 'b33eff' ],
- all: [ {
- options: {
- degreeThreshold: 2
- },
- id: 'css-orientation-lock'
- } ],
- any: [],
- none: [],
- preload: true
- }, {
- id: 'definition-list',
- selector: 'dl',
- matches: 'no-role-matches',
- tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
- all: [],
- any: [],
- none: [ 'structured-dlitems', {
- options: {
- validRoles: [ 'definition', 'term', 'listitem' ],
- validNodeNames: [ 'dt', 'dd' ],
- divGroups: true
- },
- id: 'only-dlitems'
- } ]
- }, {
- id: 'dlitem',
- selector: 'dd, dt',
- matches: 'no-role-matches',
- tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
- all: [],
- any: [ 'dlitem' ],
- none: []
- }, {
- id: 'document-title',
- selector: 'html',
- matches: 'is-initiator-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag242', 'ACT', 'TTv5', 'TT12.a' ],
- actIds: [ '2779a5' ],
- all: [],
- any: [ 'doc-has-title' ],
- none: []
- }, {
- id: 'duplicate-id-active',
- selector: '[id]',
- matches: 'duplicate-id-active-matches',
- excludeHidden: false,
- tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
- actIds: [ '3ea0c8' ],
- all: [],
- any: [ 'duplicate-id-active' ],
- none: []
- }, {
- id: 'duplicate-id-aria',
- selector: '[id]',
- matches: 'duplicate-id-aria-matches',
- excludeHidden: false,
- tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
- actIds: [ '3ea0c8' ],
- all: [],
- any: [ 'duplicate-id-aria' ],
- none: []
- }, {
- id: 'duplicate-id',
- selector: '[id]',
- matches: 'duplicate-id-misc-matches',
- excludeHidden: false,
- tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
- actIds: [ '3ea0c8' ],
- all: [],
- any: [ 'duplicate-id' ],
- none: []
- }, {
- id: 'empty-heading',
- selector: 'h1, h2, h3, h4, h5, h6, [role="heading"]',
- matches: 'heading-matches',
- tags: [ 'cat.name-role-value', 'best-practice' ],
- actIds: [ 'ffd0e9' ],
- impact: 'minor',
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'empty-table-header',
- selector: 'th:not([role]), [role="rowheader"], [role="columnheader"]',
- tags: [ 'cat.name-role-value', 'best-practice' ],
- all: [],
- any: [ 'has-visible-text' ],
- none: []
- }, {
- id: 'focus-order-semantics',
- selector: 'div, h1, h2, h3, h4, h5, h6, [role=heading], p, span',
- matches: 'inserted-into-focus-order-matches',
- tags: [ 'cat.keyboard', 'best-practice', 'experimental' ],
- all: [],
- any: [ {
- options: [],
- id: 'has-widget-role'
- }, {
- options: {
- roles: [ 'tooltip' ]
- },
- id: 'valid-scrollable-semantics'
- } ],
- none: []
- }, {
- id: 'form-field-multiple-labels',
- selector: 'input, select, textarea',
- matches: 'label-matches',
- tags: [ 'cat.forms', 'wcag2a', 'wcag332', 'TTv5', 'TT5.c' ],
- all: [],
- any: [],
- none: [ 'multiple-label' ]
- }, {
- id: 'frame-focusable-content',
- selector: 'html',
- matches: 'frame-focusable-content-matches',
- tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a' ],
- actIds: [ 'akn7bn' ],
- all: [],
- any: [ 'frame-focusable-content' ],
- none: []
- }, {
- id: 'frame-tested',
- selector: 'html, frame, iframe',
- tags: [ 'cat.structure', 'review-item', 'best-practice' ],
- all: [ {
- options: {
- isViolation: false
- },
- id: 'frame-tested'
- } ],
- any: [],
- none: []
- }, {
- id: 'frame-title-unique',
- selector: 'frame[title], iframe[title]',
- matches: 'frame-title-has-text-matches',
- tags: [ 'cat.text-alternatives', 'wcag412', 'wcag2a', 'TTv5', 'TT12.c' ],
- actIds: [ '4b1c6c' ],
- all: [],
- any: [],
- none: [ 'unique-frame-title' ],
- reviewOnFail: true
- }, {
- id: 'frame-title',
- selector: 'frame, iframe',
- matches: 'no-negative-tabindex-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.c' ],
- actIds: [ 'cae760' ],
- all: [],
- any: [ {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'aria-label', 'aria-labelledby', 'presentational-role' ],
- none: []
- }, {
- id: 'heading-order',
- selector: 'h1, h2, h3, h4, h5, h6, [role=heading]',
- matches: 'heading-matches',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ 'heading-order' ],
- none: []
- }, {
- id: 'hidden-content',
- selector: '*',
- excludeHidden: false,
- tags: [ 'cat.structure', 'experimental', 'review-item', 'best-practice' ],
- all: [],
- any: [ 'hidden-content' ],
- none: []
- }, {
- id: 'html-has-lang',
- selector: 'html',
- matches: 'is-initiator-matches',
- tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT', 'TTv5', 'TT11.a' ],
- actIds: [ 'b5c3f8' ],
- all: [],
- any: [ {
- options: {
- attributes: [ 'lang', 'xml:lang' ]
- },
- id: 'has-lang'
- } ],
- none: []
- }, {
- id: 'html-lang-valid',
- selector: 'html[lang]:not([lang=""]), html[xml\\:lang]:not([xml\\:lang=""])',
- tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT', 'TTv5', 'TT11.a' ],
- actIds: [ 'bf051a' ],
- all: [],
- any: [],
- none: [ {
- options: {
- attributes: [ 'lang', 'xml:lang' ]
- },
- id: 'valid-lang'
- } ]
- }, {
- id: 'html-xml-lang-mismatch',
- selector: 'html[lang][xml\\:lang]',
- matches: 'xml-lang-mismatch-matches',
- tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT' ],
- actIds: [ '5b7ae0' ],
- all: [ 'xml-lang-mismatch' ],
- any: [],
- none: []
- }, {
- id: 'identical-links-same-purpose',
- selector: 'a[href], area[href], [role="link"]',
- excludeHidden: false,
- enabled: false,
- matches: 'identical-links-same-purpose-matches',
- tags: [ 'cat.semantics', 'wcag2aaa', 'wcag249' ],
- actIds: [ 'b20e66' ],
- all: [ 'identical-links-same-purpose' ],
- any: [],
- none: []
- }, {
- id: 'image-alt',
- selector: 'img',
- matches: 'no-explicit-name-required-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a', 'TT7.b' ],
- actIds: [ '23a2a8' ],
- all: [],
- any: [ 'has-alt', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'presentational-role' ],
- none: [ 'alt-space-value' ]
- }, {
- id: 'image-redundant-alt',
- selector: 'img',
- tags: [ 'cat.text-alternatives', 'best-practice' ],
- all: [],
- any: [],
- none: [ {
- options: {
- parentSelector: 'button, [role=button], a[href], p, li, td, th'
- },
- id: 'duplicate-img-label'
- } ]
- }, {
- id: 'input-button-name',
- selector: 'input[type="button"], input[type="submit"], input[type="reset"]',
- matches: 'no-explicit-name-required-matches',
- tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT5.c' ],
- actIds: [ '97a4e1' ],
- all: [],
- any: [ 'non-empty-if-present', {
- options: {
- attribute: 'value'
- },
- id: 'non-empty-value'
- }, 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'presentational-role' ],
- none: []
- }, {
- id: 'input-image-alt',
- selector: 'input[type="image"]',
- matches: 'no-explicit-name-required-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
- actIds: [ '59796f' ],
- all: [],
- any: [ {
- options: {
- attribute: 'alt'
- },
- id: 'non-empty-alt'
- }, 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'label-content-name-mismatch',
- matches: 'label-content-name-mismatch-matches',
- tags: [ 'cat.semantics', 'wcag21a', 'wcag253', 'experimental' ],
- actIds: [ '2ee8b8' ],
- all: [],
- any: [ {
- options: {
- pixelThreshold: .1,
- occurrenceThreshold: 3
- },
- id: 'label-content-name-mismatch'
- } ],
- none: []
- }, {
- id: 'label-title-only',
- selector: 'input, select, textarea',
- matches: 'label-matches',
- tags: [ 'cat.forms', 'best-practice' ],
- all: [],
- any: [],
- none: [ 'title-only' ]
- }, {
- id: 'label',
- selector: 'input, textarea',
- matches: 'label-matches',
- tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'ACT', 'TTv5', 'TT5.c' ],
- actIds: [ 'e086e5' ],
- all: [],
- any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, {
- options: {
- attribute: 'placeholder'
- },
- id: 'non-empty-placeholder'
- }, 'presentational-role' ],
- none: [ 'help-same-as-label', 'hidden-explicit-label' ]
- }, {
- id: 'landmark-banner-is-top-level',
- selector: 'header:not([role]), [role=banner]',
- matches: 'landmark-has-body-context-matches',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ 'landmark-is-top-level' ],
- none: []
- }, {
- id: 'landmark-complementary-is-top-level',
- selector: 'aside:not([role]), [role=complementary]',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ 'landmark-is-top-level' ],
- none: []
- }, {
- id: 'landmark-contentinfo-is-top-level',
- selector: 'footer:not([role]), [role=contentinfo]',
- matches: 'landmark-has-body-context-matches',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ 'landmark-is-top-level' ],
- none: []
- }, {
- id: 'landmark-main-is-top-level',
- selector: 'main:not([role]), [role=main]',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ 'landmark-is-top-level' ],
- none: []
- }, {
- id: 'landmark-no-duplicate-banner',
- selector: 'header:not([role]), [role=banner]',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- selector: 'header:not([role]), [role=banner]',
- nativeScopeFilter: 'article, aside, main, nav, section'
- },
- id: 'page-no-duplicate-banner'
- } ],
- none: []
- }, {
- id: 'landmark-no-duplicate-contentinfo',
- selector: 'footer:not([role]), [role=contentinfo]',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- selector: 'footer:not([role]), [role=contentinfo]',
- nativeScopeFilter: 'article, aside, main, nav, section'
- },
- id: 'page-no-duplicate-contentinfo'
- } ],
- none: []
- }, {
- id: 'landmark-no-duplicate-main',
- selector: 'main:not([role]), [role=main]',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- selector: 'main:not([role]), [role=\'main\']'
- },
- id: 'page-no-duplicate-main'
- } ],
- none: []
- }, {
- id: 'landmark-one-main',
- selector: 'html',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [ {
- options: {
- selector: 'main:not([role]), [role=\'main\']',
- passForModal: true
- },
- id: 'page-has-main'
- } ],
- any: [],
- none: []
- }, {
- id: 'landmark-unique',
- selector: '[role=banner], [role=complementary], [role=contentinfo], [role=main], [role=navigation], [role=region], [role=search], [role=form], form, footer, header, aside, main, nav, section',
- tags: [ 'cat.semantics', 'best-practice' ],
- matches: 'landmark-unique-matches',
- all: [],
- any: [ 'landmark-is-unique' ],
- none: []
- }, {
- id: 'link-in-text-block',
- selector: 'a[href], [role=link]',
- matches: 'link-in-text-block-matches',
- excludeHidden: false,
- tags: [ 'cat.color', 'wcag2a', 'wcag141', 'TTv5', 'TT13.a' ],
- all: [],
- any: [ {
- options: {
- requiredContrastRatio: 3,
- allowSameColor: true
- },
- id: 'link-in-text-block'
- }, 'link-in-text-block-style' ],
- none: []
- }, {
- id: 'link-name',
- selector: 'a[href]',
- tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'wcag244', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
- actIds: [ 'c487ae' ],
- all: [],
- any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: [ 'focusable-no-name' ]
- }, {
- id: 'list',
- selector: 'ul, ol',
- matches: 'no-role-matches',
- tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
- all: [],
- any: [],
- none: [ {
- options: {
- validRoles: [ 'listitem' ],
- validNodeNames: [ 'li' ]
- },
- id: 'only-listitems'
- } ]
- }, {
- id: 'listitem',
- selector: 'li',
- matches: 'no-role-matches',
- tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
- all: [],
- any: [ 'listitem' ],
- none: []
- }, {
- id: 'marquee',
- selector: 'marquee',
- excludeHidden: false,
- tags: [ 'cat.parsing', 'wcag2a', 'wcag222', 'TTv5', 'TT2.b' ],
- all: [],
- any: [],
- none: [ 'is-on-screen' ]
- }, {
- id: 'meta-refresh-no-exceptions',
- selector: 'meta[http-equiv="refresh"][content]',
- excludeHidden: false,
- enabled: false,
- tags: [ 'cat.time-and-media', 'wcag2aaa', 'wcag224', 'wcag325' ],
- actIds: [ 'bisz58' ],
- all: [],
- any: [ {
- options: {
- minDelay: 72e3,
- maxDelay: false
- },
- id: 'meta-refresh-no-exceptions'
- } ],
- none: []
- }, {
- id: 'meta-refresh',
- selector: 'meta[http-equiv="refresh"][content]',
- excludeHidden: false,
- tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', 'TT2.c' ],
- actIds: [ 'bc659a', 'bisz58' ],
- all: [],
- any: [ {
- options: {
- minDelay: 0,
- maxDelay: 72e3
- },
- id: 'meta-refresh'
- } ],
- none: []
- }, {
- id: 'meta-viewport-large',
- selector: 'meta[name="viewport"]',
- matches: 'is-initiator-matches',
- excludeHidden: false,
- tags: [ 'cat.sensory-and-visual-cues', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- scaleMinimum: 5,
- lowerBound: 2
- },
- id: 'meta-viewport-large'
- } ],
- none: []
- }, {
- id: 'meta-viewport',
- selector: 'meta[name="viewport"]',
- matches: 'is-initiator-matches',
- excludeHidden: false,
- tags: [ 'cat.sensory-and-visual-cues', 'wcag2aa', 'wcag144', 'ACT' ],
- actIds: [ 'b4f0c3' ],
- all: [],
- any: [ {
- options: {
- scaleMinimum: 2
- },
- id: 'meta-viewport'
- } ],
- none: []
- }, {
- id: 'nested-interactive',
- matches: 'nested-interactive-matches',
- tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', 'TT4.a' ],
- actIds: [ '307n5z' ],
- all: [],
- any: [ 'no-focusable-content' ],
- none: []
- }, {
- id: 'no-autoplay-audio',
- excludeHidden: false,
- selector: 'audio[autoplay], video[autoplay]',
- matches: 'no-autoplay-audio-matches',
- reviewOnFail: true,
- tags: [ 'cat.time-and-media', 'wcag2a', 'wcag142', 'ACT', 'TTv5', 'TT2.a' ],
- actIds: [ '80f0bf' ],
- preload: true,
- all: [ {
- options: {
- allowedDuration: 3
- },
- id: 'no-autoplay-audio'
- } ],
- any: [],
- none: []
- }, {
- id: 'object-alt',
- selector: 'object[data]',
- matches: 'object-is-loaded-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a' ],
- actIds: [ '8fc3b6' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'presentational-role' ],
- none: []
- }, {
- id: 'p-as-heading',
- selector: 'p',
- matches: 'p-as-heading-matches',
- tags: [ 'cat.semantics', 'wcag2a', 'wcag131', 'experimental' ],
- all: [ {
- options: {
- margins: [ {
- weight: 150,
- italic: true
- }, {
- weight: 150,
- size: 1.15
- }, {
- italic: true,
- size: 1.15
- }, {
- size: 1.4
- } ],
- passLength: 1,
- failLength: .5
- },
- id: 'p-as-heading'
- } ],
- any: [],
- none: []
- }, {
- id: 'page-has-heading-one',
- selector: 'html',
- tags: [ 'cat.semantics', 'best-practice' ],
- all: [ {
- options: {
- selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
- passForModal: true
- },
- id: 'page-has-heading-one'
- } ],
- any: [],
- none: []
- }, {
- id: 'presentation-role-conflict',
- selector: 'img[alt=\'\'], [role="none"], [role="presentation"]',
- matches: 'has-implicit-chromium-role-matches',
- tags: [ 'cat.aria', 'best-practice', 'ACT' ],
- actIds: [ '46ca7f' ],
- all: [],
- any: [],
- none: [ 'is-element-focusable', 'has-global-aria-attribute' ]
- }, {
- id: 'region',
- selector: 'body *',
- tags: [ 'cat.keyboard', 'best-practice' ],
- all: [],
- any: [ {
- options: {
- regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
- },
- id: 'region'
- } ],
- none: []
- }, {
- id: 'role-img-alt',
- selector: '[role=\'img\']:not(img, area, input, object)',
- matches: 'html-namespace-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
- actIds: [ '23a2a8' ],
- all: [],
- any: [ 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'scope-attr-valid',
- selector: 'td[scope], th[scope]',
- tags: [ 'cat.tables', 'best-practice' ],
- all: [ 'html5-scope', {
- options: {
- values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
- },
- id: 'scope-value'
- } ],
- any: [],
- none: []
- }, {
- id: 'scrollable-region-focusable',
- selector: '*:not(select,textarea)',
- matches: 'scrollable-region-focusable-matches',
- tags: [ 'cat.keyboard', 'wcag2a', 'wcag211' ],
- actIds: [ '0ssw9k' ],
- all: [],
- any: [ 'focusable-content', 'focusable-element' ],
- none: []
- }, {
- id: 'select-name',
- selector: 'select',
- tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'ACT', 'TTv5', 'TT5.c' ],
- actIds: [ 'e086e5' ],
- all: [],
- any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- }, 'presentational-role' ],
- none: [ 'help-same-as-label', 'hidden-explicit-label' ]
- }, {
- id: 'server-side-image-map',
- selector: 'img[ismap]',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f' ],
- all: [],
- any: [],
- none: [ 'exists' ]
- }, {
- id: 'skip-link',
- selector: 'a[href^="#"], a[href^="/#"]',
- matches: 'skip-link-matches',
- tags: [ 'cat.keyboard', 'best-practice' ],
- all: [],
- any: [ 'skip-link' ],
- none: []
- }, {
- id: 'svg-img-alt',
- selector: '[role="img"], [role="graphics-symbol"], svg[role="graphics-document"]',
- matches: 'svg-namespace-matches',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
- actIds: [ '7d6734' ],
- all: [],
- any: [ 'svg-non-empty-title', 'aria-label', 'aria-labelledby', {
- options: {
- attribute: 'title'
- },
- id: 'non-empty-title'
- } ],
- none: []
- }, {
- id: 'tabindex',
- selector: '[tabindex]',
- tags: [ 'cat.keyboard', 'best-practice' ],
- all: [],
- any: [ 'tabindex' ],
- none: []
- }, {
- id: 'table-duplicate-name',
- selector: 'table',
- tags: [ 'cat.tables', 'best-practice' ],
- all: [],
- any: [],
- none: [ 'same-caption-summary' ]
- }, {
- id: 'table-fake-caption',
- selector: 'table',
- matches: 'data-table-matches',
- tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
- all: [ 'caption-faked' ],
- any: [],
- none: []
- }, {
- id: 'target-size',
- selector: '*',
- enabled: false,
- matches: 'widget-not-inline-matches',
- tags: [ 'wcag22aa', 'wcag258', 'cat.sensory-and-visual-cues' ],
- all: [],
- any: [ {
- options: {
- minSize: 24
- },
- id: 'target-size'
- }, {
- options: {
- minOffset: 24
- },
- id: 'target-offset'
- } ],
- none: []
- }, {
- id: 'td-has-header',
- selector: 'table',
- matches: 'data-table-large-matches',
- tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b' ],
- all: [ 'td-has-header' ],
- any: [],
- none: []
- }, {
- id: 'td-headers-attr',
- selector: 'table',
- matches: 'table-or-grid-role-matches',
- tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
- actIds: [ 'a25f45' ],
- all: [ 'td-headers-attr' ],
- any: [],
- none: []
- }, {
- id: 'th-has-data-cells',
- selector: 'table',
- matches: 'data-table-matches',
- tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', '14.b' ],
- actIds: [ 'd0f69e' ],
- all: [ 'th-has-data-cells' ],
- any: [],
- none: []
- }, {
- id: 'valid-lang',
- selector: '[lang]:not(html), [xml\\:lang]:not(html)',
- tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'ACT', 'TTv5', 'TT11.b' ],
- actIds: [ 'de46e4' ],
- all: [],
- any: [],
- none: [ {
- options: {
- attributes: [ 'lang', 'xml:lang' ]
- },
- id: 'valid-lang'
- } ]
- }, {
- id: 'video-caption',
- selector: 'video',
- tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag122', 'section508', 'section508.22.a', 'TTv5', 'TT17.a' ],
- actIds: [ 'eac66b' ],
- all: [],
- any: [],
- none: [ 'caption' ]
- } ],
- checks: [ {
- id: 'abstractrole',
- evaluate: 'abstractrole-evaluate'
- }, {
- id: 'aria-allowed-attr',
- evaluate: 'aria-allowed-attr-evaluate',
- options: {
- validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
- }
- }, {
- id: 'aria-allowed-role',
- evaluate: 'aria-allowed-role-evaluate',
- options: {
- allowImplicit: true,
- ignoredTags: []
- }
- }, {
- id: 'aria-busy',
- evaluate: 'aria-busy-evaluate'
- }, {
- id: 'aria-errormessage',
- evaluate: 'aria-errormessage-evaluate'
- }, {
- id: 'aria-hidden-body',
- evaluate: 'aria-hidden-body-evaluate'
- }, {
- id: 'aria-level',
- evaluate: 'aria-level-evaluate'
- }, {
- id: 'aria-prohibited-attr',
- evaluate: 'aria-prohibited-attr-evaluate',
- options: {
- elementsAllowedAriaLabel: [ 'applet', 'input' ]
- }
- }, {
- id: 'aria-required-attr',
- evaluate: 'aria-required-attr-evaluate'
- }, {
- id: 'aria-required-children',
- evaluate: 'aria-required-children-evaluate',
- options: {
- reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
- }
- }, {
- id: 'aria-required-parent',
- evaluate: 'aria-required-parent-evaluate',
- options: {
- ownGroupRoles: [ 'listitem', 'treeitem' ]
- }
- }, {
- id: 'aria-roledescription',
- evaluate: 'aria-roledescription-evaluate',
- options: {
- supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
- }
- }, {
- id: 'aria-unsupported-attr',
- evaluate: 'aria-unsupported-attr-evaluate'
- }, {
- id: 'aria-valid-attr-value',
- evaluate: 'aria-valid-attr-value-evaluate',
- options: []
- }, {
- id: 'aria-valid-attr',
- evaluate: 'aria-valid-attr-evaluate',
- options: []
- }, {
- id: 'deprecatedrole',
- evaluate: 'deprecatedrole-evaluate'
- }, {
- id: 'fallbackrole',
- evaluate: 'fallbackrole-evaluate'
- }, {
- id: 'has-global-aria-attribute',
- evaluate: 'has-global-aria-attribute-evaluate'
- }, {
- id: 'has-widget-role',
- evaluate: 'has-widget-role-evaluate',
- options: []
- }, {
- id: 'invalidrole',
- evaluate: 'invalidrole-evaluate'
- }, {
- id: 'is-element-focusable',
- evaluate: 'is-element-focusable-evaluate'
- }, {
- id: 'no-implicit-explicit-label',
- evaluate: 'no-implicit-explicit-label-evaluate'
- }, {
- id: 'unsupportedrole',
- evaluate: 'unsupportedrole-evaluate'
- }, {
- id: 'valid-scrollable-semantics',
- evaluate: 'valid-scrollable-semantics-evaluate',
- options: {
- roles: [ 'tooltip' ]
- }
- }, {
- id: 'color-contrast-enhanced',
- evaluate: 'color-contrast-evaluate',
- options: {
- ignoreUnicode: true,
- ignoreLength: false,
- ignorePseudo: false,
- boldValue: 700,
- boldTextPt: 14,
- largeTextPt: 18,
- contrastRatio: {
- normal: {
- expected: 7,
- minThreshold: 4.5
- },
- large: {
- expected: 4.5,
- minThreshold: 3
- }
- },
- pseudoSizeThreshold: .25,
- shadowOutlineEmMax: .1,
- textStrokeEmMin: .03
- }
- }, {
- id: 'color-contrast',
- evaluate: 'color-contrast-evaluate',
- options: {
- ignoreUnicode: true,
- ignoreLength: false,
- ignorePseudo: false,
- boldValue: 700,
- boldTextPt: 14,
- largeTextPt: 18,
- contrastRatio: {
- normal: {
- expected: 4.5
- },
- large: {
- expected: 3
- }
- },
- pseudoSizeThreshold: .25,
- shadowOutlineEmMax: .2,
- textStrokeEmMin: .03
- }
- }, {
- id: 'link-in-text-block-style',
- evaluate: 'link-in-text-block-style-evaluate'
- }, {
- id: 'link-in-text-block',
- evaluate: 'link-in-text-block-evaluate',
- options: {
- requiredContrastRatio: 3,
- allowSameColor: true
- }
- }, {
- id: 'autocomplete-appropriate',
- evaluate: 'autocomplete-appropriate-evaluate',
- deprecated: true
- }, {
- id: 'autocomplete-valid',
- evaluate: 'autocomplete-valid-evaluate',
- options: {
- stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ]
- }
- }, {
- id: 'accesskeys',
- evaluate: 'accesskeys-evaluate',
- after: 'accesskeys-after'
- }, {
- id: 'focusable-content',
- evaluate: 'focusable-content-evaluate'
- }, {
- id: 'focusable-disabled',
- evaluate: 'focusable-disabled-evaluate'
- }, {
- id: 'focusable-element',
- evaluate: 'focusable-element-evaluate'
- }, {
- id: 'focusable-modal-open',
- evaluate: 'focusable-modal-open-evaluate'
- }, {
- id: 'focusable-no-name',
- evaluate: 'focusable-no-name-evaluate'
- }, {
- id: 'focusable-not-tabbable',
- evaluate: 'focusable-not-tabbable-evaluate'
- }, {
- id: 'frame-focusable-content',
- evaluate: 'frame-focusable-content-evaluate'
- }, {
- id: 'landmark-is-top-level',
- evaluate: 'landmark-is-top-level-evaluate'
- }, {
- id: 'no-focusable-content',
- evaluate: 'no-focusable-content-evaluate'
- }, {
- id: 'page-has-heading-one',
- evaluate: 'has-descendant-evaluate',
- after: 'has-descendant-after',
- options: {
- selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
- passForModal: true
- }
- }, {
- id: 'page-has-main',
- evaluate: 'has-descendant-evaluate',
- after: 'has-descendant-after',
- options: {
- selector: 'main:not([role]), [role=\'main\']',
- passForModal: true
- }
- }, {
- id: 'page-no-duplicate-banner',
- evaluate: 'page-no-duplicate-evaluate',
- after: 'page-no-duplicate-after',
- options: {
- selector: 'header:not([role]), [role=banner]',
- nativeScopeFilter: 'article, aside, main, nav, section'
- }
- }, {
- id: 'page-no-duplicate-contentinfo',
- evaluate: 'page-no-duplicate-evaluate',
- after: 'page-no-duplicate-after',
- options: {
- selector: 'footer:not([role]), [role=contentinfo]',
- nativeScopeFilter: 'article, aside, main, nav, section'
- }
- }, {
- id: 'page-no-duplicate-main',
- evaluate: 'page-no-duplicate-evaluate',
- after: 'page-no-duplicate-after',
- options: {
- selector: 'main:not([role]), [role=\'main\']'
- }
- }, {
- id: 'tabindex',
- evaluate: 'tabindex-evaluate'
- }, {
- id: 'alt-space-value',
- evaluate: 'alt-space-value-evaluate'
- }, {
- id: 'duplicate-img-label',
- evaluate: 'duplicate-img-label-evaluate',
- options: {
- parentSelector: 'button, [role=button], a[href], p, li, td, th'
- }
- }, {
- id: 'explicit-label',
- evaluate: 'explicit-evaluate'
- }, {
- id: 'help-same-as-label',
- evaluate: 'help-same-as-label-evaluate',
- enabled: false
- }, {
- id: 'hidden-explicit-label',
- evaluate: 'hidden-explicit-label-evaluate'
- }, {
- id: 'implicit-label',
- evaluate: 'implicit-evaluate'
- }, {
- id: 'label-content-name-mismatch',
- evaluate: 'label-content-name-mismatch-evaluate',
- options: {
- pixelThreshold: .1,
- occurrenceThreshold: 3
- }
- }, {
- id: 'multiple-label',
- evaluate: 'multiple-label-evaluate'
- }, {
- id: 'title-only',
- evaluate: 'title-only-evaluate'
- }, {
- id: 'landmark-is-unique',
- evaluate: 'landmark-is-unique-evaluate',
- after: 'landmark-is-unique-after'
- }, {
- id: 'has-lang',
- evaluate: 'has-lang-evaluate',
- options: {
- attributes: [ 'lang', 'xml:lang' ]
- }
- }, {
- id: 'valid-lang',
- evaluate: 'valid-lang-evaluate',
- options: {
- attributes: [ 'lang', 'xml:lang' ]
- }
- }, {
- id: 'xml-lang-mismatch',
- evaluate: 'xml-lang-mismatch-evaluate'
- }, {
- id: 'dlitem',
- evaluate: 'dlitem-evaluate'
- }, {
- id: 'listitem',
- evaluate: 'listitem-evaluate'
- }, {
- id: 'only-dlitems',
- evaluate: 'invalid-children-evaluate',
- options: {
- validRoles: [ 'definition', 'term', 'listitem' ],
- validNodeNames: [ 'dt', 'dd' ],
- divGroups: true
- }
- }, {
- id: 'only-listitems',
- evaluate: 'invalid-children-evaluate',
- options: {
- validRoles: [ 'listitem' ],
- validNodeNames: [ 'li' ]
- }
- }, {
- id: 'structured-dlitems',
- evaluate: 'structured-dlitems-evaluate'
- }, {
- id: 'caption',
- evaluate: 'caption-evaluate'
- }, {
- id: 'frame-tested',
- evaluate: 'frame-tested-evaluate',
- after: 'frame-tested-after',
- options: {
- isViolation: false
- }
- }, {
- id: 'no-autoplay-audio',
- evaluate: 'no-autoplay-audio-evaluate',
- options: {
- allowedDuration: 3
- }
- }, {
- id: 'css-orientation-lock',
- evaluate: 'css-orientation-lock-evaluate',
- options: {
- degreeThreshold: 2
- }
- }, {
- id: 'meta-viewport-large',
- evaluate: 'meta-viewport-scale-evaluate',
- options: {
- scaleMinimum: 5,
- lowerBound: 2
- }
- }, {
- id: 'meta-viewport',
- evaluate: 'meta-viewport-scale-evaluate',
- options: {
- scaleMinimum: 2
- }
- }, {
- id: 'target-offset',
- evaluate: 'target-offset-evaluate',
- options: {
- minOffset: 24
- }
- }, {
- id: 'target-size',
- evaluate: 'target-size-evaluate',
- options: {
- minSize: 24
- }
- }, {
- id: 'header-present',
- evaluate: 'has-descendant-evaluate',
- after: 'has-descendant-after',
- options: {
- selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
- }
- }, {
- id: 'heading-order',
- evaluate: 'heading-order-evaluate',
- after: 'heading-order-after'
- }, {
- id: 'identical-links-same-purpose',
- evaluate: 'identical-links-same-purpose-evaluate',
- after: 'identical-links-same-purpose-after'
- }, {
- id: 'internal-link-present',
- evaluate: 'internal-link-present-evaluate'
- }, {
- id: 'landmark',
- evaluate: 'has-descendant-evaluate',
- options: {
- selector: 'main, [role=main]'
- }
- }, {
- id: 'meta-refresh-no-exceptions',
- evaluate: 'meta-refresh-evaluate',
- options: {
- minDelay: 72e3,
- maxDelay: false
- }
- }, {
- id: 'meta-refresh',
- evaluate: 'meta-refresh-evaluate',
- options: {
- minDelay: 0,
- maxDelay: 72e3
- }
- }, {
- id: 'p-as-heading',
- evaluate: 'p-as-heading-evaluate',
- options: {
- margins: [ {
- weight: 150,
- italic: true
- }, {
- weight: 150,
- size: 1.15
- }, {
- italic: true,
- size: 1.15
- }, {
- size: 1.4
- } ],
- passLength: 1,
- failLength: .5
- }
- }, {
- id: 'region',
- evaluate: 'region-evaluate',
- after: 'region-after',
- options: {
- regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
- }
- }, {
- id: 'skip-link',
- evaluate: 'skip-link-evaluate'
- }, {
- id: 'unique-frame-title',
- evaluate: 'unique-frame-title-evaluate',
- after: 'unique-frame-title-after'
- }, {
- id: 'duplicate-id-active',
- evaluate: 'duplicate-id-evaluate',
- after: 'duplicate-id-after'
- }, {
- id: 'duplicate-id-aria',
- evaluate: 'duplicate-id-evaluate',
- after: 'duplicate-id-after'
- }, {
- id: 'duplicate-id',
- evaluate: 'duplicate-id-evaluate',
- after: 'duplicate-id-after'
- }, {
- id: 'aria-label',
- evaluate: 'aria-label-evaluate'
- }, {
- id: 'aria-labelledby',
- evaluate: 'aria-labelledby-evaluate'
- }, {
- id: 'avoid-inline-spacing',
- evaluate: 'avoid-inline-spacing-evaluate',
- options: {
- cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
- }
- }, {
- id: 'button-has-visible-text',
- evaluate: 'has-text-content-evaluate'
- }, {
- id: 'doc-has-title',
- evaluate: 'doc-has-title-evaluate'
- }, {
- id: 'exists',
- evaluate: 'exists-evaluate'
- }, {
- id: 'has-alt',
- evaluate: 'has-alt-evaluate'
- }, {
- id: 'has-visible-text',
- evaluate: 'has-text-content-evaluate'
- }, {
- id: 'important-letter-spacing',
- evaluate: 'inline-style-property-evaluate',
- options: {
- cssProperty: 'letter-spacing',
- minValue: .12
- }
- }, {
- id: 'important-line-height',
- evaluate: 'inline-style-property-evaluate',
- options: {
- multiLineOnly: true,
- cssProperty: 'line-height',
- minValue: 1.5,
- normalValue: 1
- }
- }, {
- id: 'important-word-spacing',
- evaluate: 'inline-style-property-evaluate',
- options: {
- cssProperty: 'word-spacing',
- minValue: .16
- }
- }, {
- id: 'is-on-screen',
- evaluate: 'is-on-screen-evaluate'
- }, {
- id: 'non-empty-alt',
- evaluate: 'attr-non-space-content-evaluate',
- options: {
- attribute: 'alt'
- }
- }, {
- id: 'non-empty-if-present',
- evaluate: 'non-empty-if-present-evaluate'
- }, {
- id: 'non-empty-placeholder',
- evaluate: 'attr-non-space-content-evaluate',
- options: {
- attribute: 'placeholder'
- }
- }, {
- id: 'non-empty-title',
- evaluate: 'attr-non-space-content-evaluate',
- options: {
- attribute: 'title'
- }
- }, {
- id: 'non-empty-value',
- evaluate: 'attr-non-space-content-evaluate',
- options: {
- attribute: 'value'
- }
- }, {
- id: 'presentational-role',
- evaluate: 'presentational-role-evaluate'
- }, {
- id: 'role-none',
- evaluate: 'matches-definition-evaluate',
- deprecated: true,
- options: {
- matcher: {
- attributes: {
- role: 'none'
- }
- }
- }
- }, {
- id: 'role-presentation',
- evaluate: 'matches-definition-evaluate',
- deprecated: true,
- options: {
- matcher: {
- attributes: {
- role: 'presentation'
- }
- }
- }
- }, {
- id: 'svg-non-empty-title',
- evaluate: 'svg-non-empty-title-evaluate'
- }, {
- id: 'caption-faked',
- evaluate: 'caption-faked-evaluate'
- }, {
- id: 'html5-scope',
- evaluate: 'html5-scope-evaluate'
- }, {
- id: 'same-caption-summary',
- evaluate: 'same-caption-summary-evaluate'
- }, {
- id: 'scope-value',
- evaluate: 'scope-value-evaluate',
- options: {
- values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
- }
- }, {
- id: 'td-has-header',
- evaluate: 'td-has-header-evaluate'
- }, {
- id: 'td-headers-attr',
- evaluate: 'td-headers-attr-evaluate'
- }, {
- id: 'th-has-data-cells',
- evaluate: 'th-has-data-cells-evaluate'
- }, {
- id: 'hidden-content',
- evaluate: 'hidden-content-evaluate'
- } ]
- });
- })(typeof window === 'object' ? window : this);
|