html-standard 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,89 +1,56 @@
1
1
  # html-standard
2
2
 
3
- A TypeScript library that provides utilities for working with the HTML Living Standard specification.
3
+ A TypeScript library for working with the HTML Living Standard specification.
4
4
 
5
- > ⚠️ **Experimental**: This project is currently in an experimental stage and may introduce breaking changes frequently.
5
+ > ⚠️ **Experimental**: This project may introduce breaking changes frequently.
6
6
 
7
- ## Features
8
-
9
- ### Element API
10
-
11
- Create an element instance to access various HTML standard utilities:
12
-
13
- ```typescript
14
- import { element } from "html-standard";
7
+ ## Installation
15
8
 
16
- // Basic usage without attributes
17
- const button = element("button");
18
- button.accessibility.implicitRole(); // 'button'
19
-
20
- const nav = element("nav");
21
- nav.accessibility.implicitRole(); // 'navigation'
22
-
23
- // Elements with attributes
24
- const anchor = element("a", {
25
- attributes: {
26
- get: (key) => (key === "href" ? "https://example.com" : null),
27
- },
28
- });
29
- anchor.accessibility.implicitRole(); // 'link'
30
-
31
- const anchorWithoutHref = element("a");
32
- anchorWithoutHref.accessibility.implicitRole(); // 'generic'
33
-
34
- const checkbox = element("input", {
35
- attributes: {
36
- get: (key) => (key === "type" ? "checkbox" : null),
37
- },
38
- });
39
- checkbox.accessibility.implicitRole(); // 'checkbox'
9
+ ```bash
10
+ npm install html-standard
40
11
  ```
41
12
 
42
- ### Accessibility API
13
+ ## Usage
43
14
 
44
- Access accessibility utilities directly:
15
+ ### Get Implicit ARIA Roles
45
16
 
46
17
  ```typescript
47
- import { accessibility } from "html-standard";
48
-
49
- const buttonA11y = accessibility("button", {
50
- attributes: {
51
- get: () => null,
52
- },
53
- });
54
- buttonA11y.implicitRole(); // 'button'
55
- ```
18
+ import { element } from "html-standard";
56
19
 
57
- **Key Features:**
20
+ // Basic elements
21
+ element("button").implicitRole(); // 'button'
22
+ element("nav").implicitRole(); // 'navigation'
58
23
 
59
- - **Implicit ARIA Roles**: Get the default ARIA role for HTML elements according to the [HTML-ARIA specification](https://www.w3.org/TR/html-aria/)
60
- - **Attribute-Dependent Roles**: Supports roles that vary based on element attributes (e.g., `<a>`, `<input>`, `<img>`, `<select>`)
61
- - **Case-Insensitive**: Element names are handled case-insensitively
24
+ // Attribute-dependent roles
25
+ element("a", {
26
+ attributes: { get: (key) => (key === "href" ? "https://example.com" : null) },
27
+ }).implicitRole(); // 'link'
62
28
 
63
- ## Installation
29
+ element("a").implicitRole(); // 'generic' (no href)
64
30
 
65
- ```bash
66
- npm install html-standard
31
+ element("input", {
32
+ attributes: { get: (key) => (key === "type" ? "checkbox" : null) },
33
+ }).implicitRole(); // 'checkbox'
67
34
  ```
68
35
 
69
- ## Development
36
+ ### Validate Attributes
70
37
 
71
- ```bash
72
- # Run tests
73
- npm test
38
+ ```typescript
39
+ import { element } from "html-standard";
74
40
 
75
- # Run tests in watch mode
76
- npm run test:watch
41
+ const link = element("link");
77
42
 
78
- # Run tests with UI
79
- npm run test:ui
43
+ // Validate 'rel' attribute
44
+ link.attributes.get("rel")?.validateValue("stylesheet"); // { valid: true, ... }
45
+ link.attributes.get("rel")?.validateValue("invalid-value"); // { valid: false, ... }
46
+ ```
80
47
 
81
- # Type check
82
- npm run ts
48
+ ## Features
83
49
 
84
- # Build
85
- npm run build
86
- ```
50
+ - Implicit ARIA roles per [HTML-ARIA spec](https://www.w3.org/TR/html-aria/)
51
+ - Attribute validation based on HTML Standard
52
+ - Case-insensitive element names
53
+ - TypeScript support
87
54
 
88
55
  ## License
89
56
 
package/dist/index.cjs CHANGED
@@ -1,328 +1,2 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- accessibility: () => accessibility,
24
- element: () => element
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
-
28
- // src/constants/defaults.ts
29
- var DEFAULT_ATTRIBUTES_OPTIONS = {
30
- get(_) {
31
- return null;
32
- }
33
- };
34
- var DEFAULT_ELEMENT_OPTIONS = {
35
- attributes: {
36
- get(_) {
37
- return null;
38
- }
39
- }
40
- };
41
-
42
- // src/core/attribute-state.ts
43
- var AttributeState = class {
44
- constructor(options = DEFAULT_ATTRIBUTES_OPTIONS) {
45
- this.options = options;
46
- }
47
- get(key) {
48
- return this.options.get(key);
49
- }
50
- has(key) {
51
- return this.options.get(key) !== null;
52
- }
53
- };
54
-
55
- // src/core/element-state.ts
56
- var ElementState = class _ElementState {
57
- constructor(name, options) {
58
- this.options = options;
59
- this.name = name.toLowerCase();
60
- }
61
- get attributes() {
62
- return new AttributeState(this.options.attributes);
63
- }
64
- parent() {
65
- if (!this.options.ancestors) {
66
- return null;
67
- }
68
- const iterator = this.options.ancestors()[Symbol.iterator]();
69
- const first = iterator.next();
70
- if (first.done || !first.value) {
71
- return null;
72
- }
73
- return new _ElementState(first.value.name, first.value);
74
- }
75
- anceters() {
76
- var _a, _b;
77
- return ((_b = (_a = this.options).ancestors) == null ? void 0 : _b.call(_a)) || [];
78
- }
79
- };
80
-
81
- // src/constants/roles.ts
82
- var ROLES = {
83
- ARTICLE: "article",
84
- BLOCKQUOTE: "blockquote",
85
- BUTTON: "button",
86
- CAPTION: "caption",
87
- CELL: "cell",
88
- CHECKBOX: "checkbox",
89
- CODE: "code",
90
- COMBOBOX: "combobox",
91
- COMPLEMENTARY: "complementary",
92
- CONTENTINFO: "contentinfo",
93
- DELETION: "deletion",
94
- DIALOG: "dialog",
95
- DOCUMENT: "document",
96
- EMPHASIS: "emphasis",
97
- FIGURE: "figure",
98
- FORM: "form",
99
- GENERIC: "generic",
100
- GROUP: "group",
101
- HEADING: "heading",
102
- IMG: "img",
103
- INSERTION: "insertion",
104
- LINK: "link",
105
- LIST: "list",
106
- LISTBOX: "listbox",
107
- MAIN: "main",
108
- METER: "meter",
109
- NAVIGATION: "navigation",
110
- OPTION: "option",
111
- PARAGRAPH: "paragraph",
112
- PROGRESSBAR: "progressbar",
113
- RADIO: "radio",
114
- ROW: "row",
115
- ROWGROUP: "rowgroup",
116
- SEARCH: "search",
117
- SEARCHBOX: "searchbox",
118
- SEPARATOR: "separator",
119
- SLIDER: "slider",
120
- SPINBUTTON: "spinbutton",
121
- STATUS: "status",
122
- STRONG: "strong",
123
- TABLE: "table",
124
- TERM: "term",
125
- TEXTBOX: "textbox",
126
- TIME: "time"
127
- };
128
-
129
- // src/accessibility/implicit-role/implicit-role.ts
130
- var IMPLICIT_ROLE = {
131
- a: (element2) => element2.attributes.has("href") ? ROLES.LINK : ROLES.GENERIC,
132
- abbr: () => null,
133
- address: () => ROLES.GROUP,
134
- area: (element2) => element2.attributes.has("href") ? ROLES.LINK : ROLES.GENERIC,
135
- article: () => ROLES.ARTICLE,
136
- aside: () => ROLES.COMPLEMENTARY,
137
- audio: () => null,
138
- b: () => ROLES.GENERIC,
139
- base: () => null,
140
- bdi: () => ROLES.GENERIC,
141
- bdo: () => ROLES.GENERIC,
142
- blockquote: () => ROLES.BLOCKQUOTE,
143
- body: () => ROLES.GENERIC,
144
- br: () => null,
145
- button: () => ROLES.BUTTON,
146
- canvas: () => null,
147
- caption: () => ROLES.CAPTION,
148
- cite: () => null,
149
- code: () => ROLES.CODE,
150
- col: () => null,
151
- colgroup: () => null,
152
- data: () => ROLES.GENERIC,
153
- datalist: () => ROLES.LISTBOX,
154
- dd: () => null,
155
- del: () => ROLES.DELETION,
156
- details: () => ROLES.GROUP,
157
- dfn: () => ROLES.TERM,
158
- dialog: () => ROLES.DIALOG,
159
- div: () => ROLES.GENERIC,
160
- dl: () => null,
161
- dt: () => null,
162
- em: () => ROLES.EMPHASIS,
163
- embed: () => null,
164
- fieldset: () => ROLES.GROUP,
165
- figcaption: () => null,
166
- figure: () => ROLES.FIGURE,
167
- footer: (element2) => {
168
- const sectioningElements = ["article", "aside", "main", "nav", "section"];
169
- for (const ancestor of element2.anceters()) {
170
- if (sectioningElements.includes(ancestor.name.toLowerCase())) {
171
- return ROLES.GENERIC;
172
- }
173
- }
174
- return ROLES.CONTENTINFO;
175
- },
176
- form: () => ROLES.FORM,
177
- h1: () => ROLES.HEADING,
178
- h2: () => ROLES.HEADING,
179
- h3: () => ROLES.HEADING,
180
- h4: () => ROLES.HEADING,
181
- h5: () => ROLES.HEADING,
182
- h6: () => ROLES.HEADING,
183
- head: () => null,
184
- header: () => null,
185
- // TODO: banner if not descendant of article/aside/main/nav/section, otherwise generic
186
- hgroup: () => ROLES.GROUP,
187
- hr: () => ROLES.SEPARATOR,
188
- html: () => ROLES.DOCUMENT,
189
- i: () => ROLES.GENERIC,
190
- iframe: () => null,
191
- img: (element2) => {
192
- const alt = element2.attributes.get("alt");
193
- if (alt === "") return null;
194
- return ROLES.IMG;
195
- },
196
- input: (element2) => {
197
- const type = element2.attributes.get("type") || "text";
198
- switch (type) {
199
- case "button":
200
- case "image":
201
- case "reset":
202
- case "submit":
203
- return ROLES.BUTTON;
204
- case "checkbox":
205
- return ROLES.CHECKBOX;
206
- case "color":
207
- case "date":
208
- case "datetime-local":
209
- case "file":
210
- case "hidden":
211
- case "month":
212
- case "password":
213
- case "time":
214
- case "week":
215
- return null;
216
- case "email":
217
- case "tel":
218
- case "text":
219
- case "url":
220
- return ROLES.TEXTBOX;
221
- case "number":
222
- return ROLES.SPINBUTTON;
223
- case "radio":
224
- return ROLES.RADIO;
225
- case "range":
226
- return ROLES.SLIDER;
227
- case "search":
228
- return ROLES.SEARCHBOX;
229
- default:
230
- return ROLES.TEXTBOX;
231
- }
232
- },
233
- ins: () => ROLES.INSERTION,
234
- kbd: () => null,
235
- label: () => null,
236
- legend: () => null,
237
- li: () => null,
238
- // TODO: listitem if child of ol/ul/menu, otherwise generic
239
- link: () => null,
240
- main: () => ROLES.MAIN,
241
- map: () => null,
242
- mark: () => null,
243
- menu: () => ROLES.LIST,
244
- meta: () => null,
245
- meter: () => ROLES.METER,
246
- nav: () => ROLES.NAVIGATION,
247
- noscript: () => null,
248
- object: () => null,
249
- ol: () => ROLES.LIST,
250
- optgroup: () => ROLES.GROUP,
251
- option: () => ROLES.OPTION,
252
- output: () => ROLES.STATUS,
253
- p: () => ROLES.PARAGRAPH,
254
- param: () => null,
255
- picture: () => null,
256
- pre: () => ROLES.GENERIC,
257
- progress: () => ROLES.PROGRESSBAR,
258
- q: () => ROLES.GENERIC,
259
- rp: () => null,
260
- rt: () => null,
261
- ruby: () => null,
262
- s: () => ROLES.DELETION,
263
- samp: () => ROLES.GENERIC,
264
- script: () => null,
265
- search: () => ROLES.SEARCH,
266
- section: () => null,
267
- select: (element2) => element2.attributes.has("multiple") ? ROLES.LISTBOX : ROLES.COMBOBOX,
268
- slot: () => null,
269
- small: () => ROLES.GENERIC,
270
- span: () => ROLES.GENERIC,
271
- strong: () => ROLES.STRONG,
272
- style: () => null,
273
- sub: () => null,
274
- summary: () => ROLES.BUTTON,
275
- sup: () => null,
276
- svg: () => null,
277
- table: () => ROLES.TABLE,
278
- tbody: () => ROLES.ROWGROUP,
279
- td: () => ROLES.CELL,
280
- template: () => null,
281
- textarea: () => ROLES.TEXTBOX,
282
- tfoot: () => ROLES.ROWGROUP,
283
- th: () => null,
284
- thead: () => ROLES.ROWGROUP,
285
- time: () => ROLES.TIME,
286
- title: () => null,
287
- tr: () => ROLES.ROW,
288
- track: () => null,
289
- u: () => null,
290
- ul: () => ROLES.LIST,
291
- var: () => null,
292
- video: () => null,
293
- wbr: () => null
294
- };
295
-
296
- // src/accessibility/accessibility.ts
297
- var Accessibility = class {
298
- constructor(element2) {
299
- this.element = element2;
300
- }
301
- implicitRole() {
302
- var _a, _b, _c;
303
- return (_c = (_b = (_a = IMPLICIT_ROLE)[this.element.name.toLowerCase()]) == null ? void 0 : _b.call(_a, this.element)) != null ? _c : null;
304
- }
305
- };
306
- function accessibility(name, options) {
307
- return new Accessibility(new ElementState(name, options));
308
- }
309
-
310
- // src/element.ts
311
- var Element = class {
312
- constructor(name, options) {
313
- this.name = name;
314
- this.options = options;
315
- }
316
- get accessibility() {
317
- return accessibility(this.name, this.options);
318
- }
319
- };
320
- function element(name, options = DEFAULT_ELEMENT_OPTIONS) {
321
- return new Element(name, options);
322
- }
323
- // Annotate the CommonJS export names for ESM import in node:
324
- 0 && (module.exports = {
325
- accessibility,
326
- element
327
- });
1
+ "use strict";var J=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var ut=(p,t)=>{for(var r in t)J(p,r,{get:t[r],enumerable:!0})},yt=(p,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of nt(t))!lt.call(p,l)&&l!==r&&J(p,l,{get:()=>t[l],enumerable:!(o=at(t,l))||o.enumerable});return p};var ct=p=>yt(J({},"__esModule",{value:!0}),p);var bt={};ut(bt,{element:()=>st});module.exports=ct(bt);var e={ARTICLE:"article",BLOCKQUOTE:"blockquote",BUTTON:"button",CAPTION:"caption",CELL:"cell",CHECKBOX:"checkbox",CODE:"code",COMBOBOX:"combobox",COMPLEMENTARY:"complementary",CONTENTINFO:"contentinfo",DELETION:"deletion",DIALOG:"dialog",DOCUMENT:"document",EMPHASIS:"emphasis",FIGURE:"figure",FORM:"form",GENERIC:"generic",GROUP:"group",HEADING:"heading",IMG:"img",INSERTION:"insertion",LINK:"link",LIST:"list",LISTBOX:"listbox",MAIN:"main",METER:"meter",NAVIGATION:"navigation",OPTION:"option",PARAGRAPH:"paragraph",PROGRESSBAR:"progressbar",RADIO:"radio",ROW:"row",ROWGROUP:"rowgroup",SEARCH:"search",SEARCHBOX:"searchbox",SEPARATOR:"separator",SLIDER:"slider",SPINBUTTON:"spinbutton",STATUS:"status",STRONG:"strong",TABLE:"table",TERM:"term",TEXTBOX:"textbox",TIME:"time"};var tt={get(p){return null}};var F=class{constructor(t=tt){this.options=t}get(t){return this.options.get(t)}has(t){return this.options.get(t)!==null}};var W=class p{constructor(t,r){this.options=r;this.name=t.toLowerCase()}get attributes(){return new F(this.options.attributes)}parent(){if(!this.options.ancestors)return null;let r=this.options.ancestors()[Symbol.iterator]().next();return r.done||!r.value?null:new p(r.value.name,r.value)}ancestors(){var t,r;return((r=(t=this.options).ancestors)==null?void 0:r.call(t))||[]}};var it={a:p=>p.attributes.has("href")?e.LINK:e.GENERIC,abbr:()=>null,address:()=>e.GROUP,area:p=>p.attributes.has("href")?e.LINK:e.GENERIC,article:()=>e.ARTICLE,aside:()=>e.COMPLEMENTARY,audio:()=>null,b:()=>e.GENERIC,base:()=>null,bdi:()=>e.GENERIC,bdo:()=>e.GENERIC,blockquote:()=>e.BLOCKQUOTE,body:()=>e.GENERIC,br:()=>null,button:()=>e.BUTTON,canvas:()=>null,caption:()=>e.CAPTION,cite:()=>null,code:()=>e.CODE,col:()=>null,colgroup:()=>null,data:()=>e.GENERIC,datalist:()=>e.LISTBOX,dd:()=>null,del:()=>e.DELETION,details:()=>e.GROUP,dfn:()=>e.TERM,dialog:()=>e.DIALOG,div:()=>e.GENERIC,dl:()=>null,dt:()=>null,em:()=>e.EMPHASIS,embed:()=>null,fieldset:()=>e.GROUP,figcaption:()=>null,figure:()=>e.FIGURE,footer:p=>{let t=["article","aside","main","nav","section"];for(let r of p.ancestors())if(t.includes(r.name.toLowerCase()))return e.GENERIC;return e.CONTENTINFO},form:()=>e.FORM,h1:()=>e.HEADING,h2:()=>e.HEADING,h3:()=>e.HEADING,h4:()=>e.HEADING,h5:()=>e.HEADING,h6:()=>e.HEADING,head:()=>null,header:()=>null,hgroup:()=>e.GROUP,hr:()=>e.SEPARATOR,html:()=>e.DOCUMENT,i:()=>e.GENERIC,iframe:()=>null,img:p=>p.attributes.get("alt")===""?null:e.IMG,input:p=>{switch(p.attributes.get("type")||"text"){case"button":case"image":case"reset":case"submit":return e.BUTTON;case"checkbox":return e.CHECKBOX;case"color":case"date":case"datetime-local":case"file":case"hidden":case"month":case"password":case"time":case"week":return null;case"email":case"tel":case"text":case"url":return e.TEXTBOX;case"number":return e.SPINBUTTON;case"radio":return e.RADIO;case"range":return e.SLIDER;case"search":return e.SEARCHBOX;default:return e.TEXTBOX}},ins:()=>e.INSERTION,kbd:()=>null,label:()=>null,legend:()=>null,li:()=>null,link:()=>null,main:()=>e.MAIN,map:()=>null,mark:()=>null,menu:()=>e.LIST,meta:()=>null,meter:()=>e.METER,nav:()=>e.NAVIGATION,noscript:()=>null,object:()=>null,ol:()=>e.LIST,optgroup:()=>e.GROUP,option:()=>e.OPTION,output:()=>e.STATUS,p:()=>e.PARAGRAPH,param:()=>null,picture:()=>null,pre:()=>e.GENERIC,progress:()=>e.PROGRESSBAR,q:()=>e.GENERIC,rp:()=>null,rt:()=>null,ruby:()=>null,s:()=>e.DELETION,samp:()=>e.GENERIC,script:()=>null,search:()=>e.SEARCH,section:()=>null,select:p=>p.attributes.has("multiple")?e.LISTBOX:e.COMBOBOX,slot:()=>null,small:()=>e.GENERIC,span:()=>e.GENERIC,strong:()=>e.STRONG,style:()=>null,sub:()=>null,summary:()=>e.BUTTON,sup:()=>null,svg:()=>null,table:()=>e.TABLE,tbody:()=>e.ROWGROUP,td:()=>e.CELL,template:()=>null,textarea:()=>e.TEXTBOX,tfoot:()=>e.ROWGROUP,th:()=>null,thead:()=>e.ROWGROUP,time:()=>e.TIME,title:()=>null,tr:()=>e.ROW,track:()=>null,u:()=>null,ul:()=>e.LIST,var:()=>null,video:()=>null,wbr:()=>null};var mt={valid:!0};function u(){return mt}function s(p){return{valid:!1,reason:p}}var n=class{constructor(t){this.attributeKey=t}validateValue(t){return t?this.attributeKey===(t==null?void 0:t.toLowerCase())?u():s(`Boolean attribute value must be empty or match the attribute name "${this.attributeKey}", got: "${t}"`):u()}};n.type="BooleanAttribute";var ot={VALUE_MUST_BE_STRING:"Value must be a string",VALUE_CANNOT_BE_EMPTY:"Value cannot be empty"};var i=class{constructor(t){this.options=t}validateValue(t){let r=t.toLowerCase();return this.options.keywords.includes(r)?u():s(`Value "${t}" is not a valid keyword. Expected one of: ${this.options.keywords.join(", ")}`)}};i.type="EnumeratedAttribute";var B=class B{validateValue(t){return B.PATTERN.test(t)?u():s(`Invalid signed integer: "${t}"`)}};B.type="SignedInteger",B.PATTERN=/^-?\d+$/;var x=B;var X=/[\u0009\u000A\u000C\u000D\u0020]/;var b=class{constructor(t){this.options=t}parse(t){return t.split(X)}validateValue(t){let r=this.parse(t).filter(o=>o!=="");if(this.options.unique){let o=new Set(r);if(r.length!==o.size)return s("Tokens must be unique")}if(this.options.allowed){for(let o of r)if(!this.options.allowed.some(d=>o.toLowerCase()===d.toLowerCase()))return s(`Invalid token: "${o}". Allowed tokens: ${this.options.allowed.join(", ")}`)}if(typeof this.options.validateToken=="function"){for(let o of r)if(!this.options.validateToken(o))return s(`Invalid token: "${o}"`)}return u()}};b.type="SpaceSeparatedTokens";var y=class{validateValue(t){return u()}};y.type="Text";var m=class{validateValue(t){return u()}};m.type="ValidURL";var D=class D{constructor(t){this.options=t}validateValue(t){var o,l;if(!D.PATTERN.test(t))return s(`Invalid non-negative integer: "${t}"`);let r=parseInt(t,10);return((o=this.options)==null?void 0:o.min)!==void 0&&r<this.options.min?s(`Value must be at least ${this.options.min}: "${t}"`):((l=this.options)==null?void 0:l.max)!==void 0&&r>this.options.max?s(`Value must be at most ${this.options.max}: "${t}"`):u()}};D.type="NonNegativeInteger",D.PATTERN=/^\d+$/;var c=D;var A=class{constructor(){}validateValue(t){return u()}};A.type="ID";var U=class U{validateValue(t){return U.PATTERN.test(t)?u():s(`Invalid floating-point number: "${t}"`)}};U.type="FloatingPointNumber",U.PATTERN=/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/;var f=U;var N=class{validateValue(t){return u()}};N.type="CommaSeparatedTokens";var L=class{validateValue(t){return u()}};L.type="CSSColor";var j=class j{validateValue(t){if(t==="")return u();if(!j.PATTERN.test(t))return s(`Invalid BCP 47 language tag: "${t}"`);let r=t.split("-");for(let o=0;o<r.length;o++){let l=r[o];if(l.length===0)return s(`Invalid BCP 47 language tag: empty subtag in "${t}"`);if(o===0){if(l==="x")continue;if(!/^[a-zA-Z]{2,8}$/.test(l))return s(`Invalid language subtag in "${t}": "${l}"`)}}return u()}};j.type="BCP47",j.PATTERN=/^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;var w=j;var z=class z{constructor(){}validateValue(t){return z.PATTERN.test(t)?u():s(`Invalid MIME type: "${t}"`)}};z.type="MIMEType",z.PATTERN=/^[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+\/[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+(?:\s*;\s*[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\-.^_`{|}~]+|"[^"]*"))*$/;var E=z;var G=class G{constructor(){}validateValue(t){if(!G.DATE_PATTERN.test(t)&&!G.DATETIME_PATTERN.test(t))return s(`Invalid date or datetime string: "${t}"`);let r=t.match(/^(\d{4,})-(\d{2})-(\d{2})/);if(r){let l=parseInt(r[1],10),d=parseInt(r[2],10),g=parseInt(r[3],10);if(l===0)return s(`Year must be greater than 0: "${t}"`);if(d<1||d>12)return s(`Month must be between 1 and 12: "${t}"`);if(g<1||g>31)return s(`Day must be between 1 and 31: "${t}"`)}let o=t.match(/[T ](\d{2}):(\d{2})/);if(o){let l=parseInt(o[1],10),d=parseInt(o[2],10);if(l>23)return s(`Hour must be between 0 and 23: "${t}"`);if(d>59)return s(`Minute must be between 0 and 59: "${t}"`);let g=t.match(/[T ]\d{2}:\d{2}:(\d{2})/);if(g&&parseInt(g[1],10)>59)return s(`Second must be between 0 and 59: "${t}"`)}return u()}};G.type="DateString",G.DATE_PATTERN=/^\d{4,}-\d{2}-\d{2}$/,G.DATETIME_PATTERN=/^\d{4,}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:\d{2})?$/;var V=G;var C=class{constructor(){}validateValue(t){try{return new RegExp(t),u()}catch(r){return s(`Invalid regular expression: "${t}" - ${r instanceof Error?r.message:String(r)}`)}}};C.type="RegularExpression";var _=class{validateValue(t){return t.startsWith("#")?t.length===1?s(`Hash-name reference must have a name after "#": "${t}"`):u():s(`Hash-name reference must start with "#": "${t}"`)}};_.type="HashNameReference";var q=class q{constructor(){}validateValue(t){return t.length===0?s("Navigable target name must have at least one character"):t.startsWith("_")?s(`Navigable target name cannot start with "_" (reserved for keywords like _blank, _self): "${t}"`):q.INVALID_CHARS_PATTERN.test(t)?s(`Navigable target name cannot contain tab, newline, or "<" character: "${t}"`):u()}};q.type="NavigableTargetName",q.INVALID_CHARS_PATTERN=/[\t\n<]/;var S=q;var T=class{validateValue(t){if(t.trim()==="")return s("Srcset cannot be empty");let r=t.split(",");for(let o=0;o<r.length;o++){let l=r[o].trim();if(l==="")return s(`Image candidate string ${o+1} is empty`);let d=l.split(/\s+/),g=d[0];if(g.startsWith(",")||g.endsWith(","))return s(`URL cannot start or end with comma: "${g}"`);if(g==="")return s(`URL in candidate string ${o+1} is empty`);if(d.length>1){let h=d[d.length-1];if(h.endsWith("w")){let O=h.slice(0,-1),I=parseInt(O,10);if(!/^\d+$/.test(O)||I<=0)return s(`Invalid width descriptor: "${h}" (must be positive integer followed by 'w')`)}else if(h.endsWith("x")){let O=h.slice(0,-1),I=parseFloat(O);if(!/^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(O)||I<=0)return s(`Invalid pixel density descriptor: "${h}" (must be positive number followed by 'x')`)}else return s(`Invalid descriptor: "${h}" (must end with 'w' or 'x')`);if(d.length>2&&d.slice(1,-1).some(I=>I!==""))return s(`Invalid image candidate string: "${l}" (extra tokens found)`)}}return u()}};T.type="SrcsetAttribute";var R=class{validateValue(t){return u()}};R.type="MediaQueryList";var v=class{validateValue(t){return u()}};v.type="SourceSizeList";var P=class{constructor(){this.floatingPointNumberValidator=new f}validateValue(t){if(t.length===0)return s(ot.VALUE_CANNOT_BE_EMPTY);let r=t.split(",");for(let o=0;o<r.length;o++){let l=r[o];if(l.length===0)return s(`Empty value at position ${o+1}`);if(!this.floatingPointNumberValidator.validateValue(l).valid)return s(`Invalid floating-point number at position ${o+1}: "${l}"`)}return u()}};P.type="FloatingPointNumberList";var M=class{constructor(t){this.options=t}validateValue(t){let r;for(let o of this.options.items){let d=Z("",o).validateValue(t);if(d.valid)return u();r=d.reason}return s(r!=null?r:"Value does not match any of the allowed formats")}};M.type="#or";var $=class ${validateValue(t){var rt;if(t==="")return u();let r=t.toLowerCase().trim();if(r==="on"||r==="off")return u();let o=r.split(X).filter(Boolean);if(o.length===0)return s("Autocomplete value cannot be empty");let l=0,d=!1,g=!1,h=!1,O=!1,I="";if((rt=o[l])!=null&&rt.startsWith("section-")&&(d=!0,l++),(o[l]==="billing"||o[l]==="shipping")&&(g=!0,l++),l<o.length){let Q=o[l];if($.AUTOFILL_FIELD_NAMES.has(Q))h=!0,I=Q,l++;else return s(`Invalid autofill field name: "${Q}". Must be one of the standard autofill field names.`)}else return s("Autocomplete value must include an autofill field name");if(l<o.length&&o[l]==="webauthn"){if(!$.WEBAUTHN_COMPATIBLE_FIELDS.has(I))return s(`"webauthn" token is only valid with username or current-password fields, not "${I}"`);O=!0,l++}return l<o.length?s(`Invalid extra token in autocomplete value: "${o[l]}"`):u()}};$.type="AutocompleteAttribute",$.AUTOFILL_FIELD_NAMES=new Set(["name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","username","new-password","current-password","one-time-code","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","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-local-prefix","tel-local-suffix","tel-extension","email","impp"]),$.WEBAUTHN_COMPATIBLE_FIELDS=new Set(["username","current-password"]);var k=$;function Z(p,t){switch(t.type){case b.type:return new b(t.options);case i.type:return new i(t.options);case n.type:return new n(p);case x.type:return new x;case y.type:return new y;case m.type:return new m;case c.type:return new c(t.options);case A.type:return new A;case f.type:return new f;case N.type:return new N;case L.type:return new L;case w.type:return new w;case E.type:return new E;case V.type:return new V;case C.type:return new C;case _.type:return new _;case S.type:return new S;case T.type:return new T;case R.type:return new R;case v.type:return new v;case P.type:return new P;case M.type:return new M({items:t.items});case k.type:return new k}}var H=class{constructor(t,r){this.key=t;this.definition=r}validateValue(t){return Z(this.key,this.definition).validateValue(t)}};var et=new Map([["accesskey",{type:b.type,options:{unique:!0,validateToken(p){return Array.from(p).length===1}}}],["autocapitalize",{type:i.type,options:{keywords:["off","none","on","sentences","words","characters"]}}],["autocorrect",{type:i.type,options:{keywords:["on","off"]}}],["autofocus",{type:n.type}],["contenteditable",{type:i.type,options:{keywords:["true","false","plaintext-only"]}}],["dir",{type:i.type,options:{keywords:["ltr","rtl","auto"]}}],["draggable",{type:i.type,options:{keywords:["true","false"]}}],["enterkeyhint",{type:i.type,options:{keywords:["enter","done","go","next","previous","search","send"]}}],["headingoffset",{type:c.type,options:{min:0,max:8}}],["headingreset",{type:n.type}],["hidden",{type:i.type,options:{keywords:["","until-found","hidden"]}}],["inert",{type:n.type}],["inputmode",{type:i.type,options:{keywords:["none","text","tel","url","email","numeric","decimal","search"]}}],["is",{type:y.type}],["itemid",{type:m.type}],["itemprop",{type:b.type,options:{unique:!0}}],["itemref",{type:b.type,options:{unique:!0}}],["itemscope",{type:n.type}],["itemtype",{type:b.type,options:{unique:!0,validateToken(p){try{return new URL(p),!0}catch(t){return!1}}}}],["lang",{type:w.type}],["nonce",{type:y.type}],["popover",{type:"#or",items:[{type:n.type},{type:i.type,options:{keywords:["","auto","manual","hint"]}}]}],["spellcheck",{type:i.type,options:{keywords:["","true","false"]}}],["style",{type:y.type}],["tabindex",{type:x.type}],["title",{type:y.type}],["translate",{type:i.type,options:{keywords:["","yes","no"]}}],["writingsuggestions",{type:i.type,options:{keywords:["","true","false"]}}]]);var a=[],pt={html:{globalAttributes:!0,attributes:a},head:{globalAttributes:!0,attributes:a},title:{globalAttributes:!0,attributes:a},base:{globalAttributes:!0,attributes:[["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}]]},link:{globalAttributes:!0,attributes:[["href",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["rel",{type:b.type,options:{unique:!0}}],["media",{type:R.type}],["integrity",{type:y.type}],["hreflang",{type:w.type}],["type",{type:E.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["sizes",{type:b.type,options:{unique:!0,validateToken(p){if(p.toLowerCase()==="any")return!0;let t=/^([1-9]\d*|0)[xX]([1-9]\d*|0)$/,r=p.match(t);if(!r)return!1;let[,o,l]=r;return!(o.length>1&&o.startsWith("0")||l.length>1&&l.startsWith("0"))}}}],["imagesrcset",{type:T.type}],["imagesizes",{type:v.type}],["as",{type:i.type,options:{keywords:["fetch","font","image","script","style","track","json","style","audioworklet","paintworklet","script","serviceworker","sharedworker","worker"]}}],["blocking",{type:b.type,options:{unique:!0,allowed:["render"]}}],["color",{type:L.type}],["disabled",{type:n.type}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},meta:{globalAttributes:!0,attributes:[["name",{type:y.type}],["http-equiv",{type:i.type,options:{keywords:["content-language","content-type","default-style","refresh","set-cookie","x-ua-compatible","content-security-policy"]}}],["content",{type:y.type}],["charset",{type:i.type,options:{keywords:["utf-8"]}}],["media",{type:R.type}]]},style:{globalAttributes:!0,attributes:[["media",{type:R.type}],["blocking",{type:b.type,options:{unique:!0,allowed:["render"]}}]]},body:{globalAttributes:!0,attributes:a},article:{globalAttributes:!0,attributes:a},section:{globalAttributes:!0,attributes:a},nav:{globalAttributes:!0,attributes:a},aside:{globalAttributes:!0,attributes:a},hgroup:{globalAttributes:!0,attributes:a},header:{globalAttributes:!0,attributes:a},footer:{globalAttributes:!0,attributes:a},address:{globalAttributes:!0,attributes:a},p:{globalAttributes:!0,attributes:a},hr:{globalAttributes:!0,attributes:a},pre:{globalAttributes:!0,attributes:a},blockquote:{globalAttributes:!0,attributes:[["cite",{type:m.type}]]},ol:{globalAttributes:!0,attributes:[["reversed",{type:n.type}],["start",{type:x.type}],["type",{type:i.type,options:{keywords:["1","a","A","i","I"]}}]]},ul:{globalAttributes:!0,attributes:a},menu:{globalAttributes:!0,attributes:a},li:{globalAttributes:!0,attributes:[["value",{type:x.type}]]},dl:{globalAttributes:!0,attributes:a},dt:{globalAttributes:!0,attributes:a},dd:{globalAttributes:!0,attributes:a},figure:{globalAttributes:!0,attributes:a},figcaption:{globalAttributes:!0,attributes:a},main:{globalAttributes:!0,attributes:a},search:{globalAttributes:!0,attributes:a},div:{globalAttributes:!0,attributes:a},a:{globalAttributes:!0,attributes:[["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:y.type}],["ping",{type:b.type,options:{unique:!1,validateToken(p){if(p.length===0)return!1;try{let t=new URL(p);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:b.type,options:{unique:!0,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["hreflang",{type:w.type}],["type",{type:E.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},em:{globalAttributes:!0,attributes:a},strong:{globalAttributes:!0,attributes:a},small:{globalAttributes:!0,attributes:a},s:{globalAttributes:!0,attributes:a},cite:{globalAttributes:!0,attributes:a},q:{globalAttributes:!0,attributes:[["cite",{type:m.type}]]},dfn:{globalAttributes:!0,attributes:a},abbr:{globalAttributes:!0,attributes:a},ruby:{globalAttributes:!0,attributes:a},rt:{globalAttributes:!0,attributes:a},rp:{globalAttributes:!0,attributes:a},data:{globalAttributes:!0,attributes:[["value",{type:y.type}]]},time:{globalAttributes:!0,attributes:[["datetime",{type:V.type}]]},code:{globalAttributes:!0,attributes:a},var:{globalAttributes:!0,attributes:a},samp:{globalAttributes:!0,attributes:a},kbd:{globalAttributes:!0,attributes:a},i:{globalAttributes:!0,attributes:a},b:{globalAttributes:!0,attributes:a},u:{globalAttributes:!0,attributes:a},mark:{globalAttributes:!0,attributes:a},bdi:{globalAttributes:!0,attributes:a},bdo:{globalAttributes:!0,attributes:a},span:{globalAttributes:!0,attributes:a},br:{globalAttributes:!0,attributes:a},wbr:{globalAttributes:!0,attributes:a},ins:{globalAttributes:!0,attributes:[["cite",{type:m.type}],["datetime",{type:V.type}]]},del:{globalAttributes:!0,attributes:[["cite",{type:m.type}],["datetime",{type:V.type}]]},picture:{globalAttributes:!0,attributes:a},source:{globalAttributes:!0,attributes:[["type",{type:E.type}],["media",{type:R.type}],["src",{type:m.type}],["srcset",{type:T.type}],["sizes",{type:v.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},img:{globalAttributes:!0,attributes:[["alt",{type:y.type}],["src",{type:m.type}],["srcset",{type:T.type}],["sizes",{type:v.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["usemap",{type:_.type}],["ismap",{type:n.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["decoding",{type:i.type,options:{keywords:["sync","async","auto"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},iframe:{globalAttributes:!0,attributes:[["src",{type:m.type}],["srcdoc",{type:y.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["sandbox",{type:b.type,options:{unique:!0,allowed:["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"]}}],["allow",{type:y.type}],["allowfullscreen",{type:n.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["loading",{type:i.type,options:{keywords:["eager","lazy"]}}]]},embed:{globalAttributes:!0,attributes:[["src",{type:m.type}],["type",{type:E.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},object:{globalAttributes:!0,attributes:[["data",{type:m.type}],["type",{type:E.type}],["name",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["form",{type:A.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},video:{globalAttributes:!0,attributes:[["src",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["poster",{type:m.type}],["preload",{type:i.type,options:{keywords:["","none","metadata","auto"]}}],["autoplay",{type:n.type}],["playsinline",{type:n.type}],["loop",{type:n.type}],["muted",{type:n.type}],["controls",{type:n.type}],["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]},audio:{globalAttributes:!0,attributes:[["src",{type:m.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["preload",{type:i.type,options:{keywords:["","none","metadata","auto"]}}],["autoplay",{type:n.type}],["loop",{type:n.type}],["muted",{type:n.type}],["controls",{type:n.type}]]},track:{globalAttributes:!0,attributes:[["kind",{type:i.type,options:{keywords:["subtitles","captions","descriptions","chapters","metadata"]}}],["src",{type:m.type}],["srclang",{type:w.type}],["label",{type:y.type}],["default",{type:n.type}]]},map:{globalAttributes:!0,attributes:[["name",{type:y.type}]]},area:{globalAttributes:!0,attributes:[["alt",{type:y.type}],["coords",{type:P.type}],["shape",{type:i.type,options:{keywords:["circle","default","poly","rect"]}}],["href",{type:m.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["download",{type:y.type}],["ping",{type:b.type,options:{unique:!1,validateToken(p){if(p.length===0)return!1;try{let t=new URL(p);return t.protocol==="http:"||t.protocol==="https:"}catch(t){return!1}}}}],["rel",{type:b.type,options:{unique:!0,allowed:["alternate","author","bookmark","external","help","license","next","nofollow","noopener","noreferrer","opener","prev","privacy-policy","search","tag","terms-of-service"]}}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}]]},table:{globalAttributes:!0,attributes:a},caption:{globalAttributes:!0,attributes:a},colgroup:{globalAttributes:!0,attributes:[["span",{type:c.type,options:{min:1}}]]},col:{globalAttributes:!0,attributes:[["span",{type:c.type,options:{min:1}}]]},tbody:{globalAttributes:!0,attributes:a},thead:{globalAttributes:!0,attributes:a},tfoot:{globalAttributes:!0,attributes:a},tr:{globalAttributes:!0,attributes:a},td:{globalAttributes:!0,attributes:[["colspan",{type:c.type,options:{min:1}}],["rowspan",{type:c.type,options:{}}],["headers",{type:b.type,options:{unique:!0}}]]},th:{globalAttributes:!0,attributes:[["colspan",{type:c.type,options:{min:1}}],["rowspan",{type:c.type,options:{}}],["headers",{type:b.type,options:{unique:!0}}],["scope",{type:i.type,options:{keywords:["row","col","rowgroup","colgroup"]}}],["abbr",{type:y.type}]]},form:{globalAttributes:!0,attributes:[["accept-charset",{type:b.type,options:{unique:!0}}],["action",{type:m.type}],["autocomplete",{type:i.type,options:{keywords:["on","off"]}}],["enctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["method",{type:i.type,options:{keywords:["get","post","dialog"]}}],["name",{type:y.type}],["novalidate",{type:n.type}],["target",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["rel",{type:b.type,options:{unique:!0,allowed:["external","help","license","next","nofollow","noopener","noreferrer","opener","prev","search"]}}]]},label:{globalAttributes:!0,attributes:[["for",{type:A.type}]]},input:{globalAttributes:!0,attributes:[["accept",{type:N.type}],["alt",{type:y.type}],["autocomplete",{type:k.type}],["checked",{type:n.type}],["dirname",{type:y.type}],["disabled",{type:n.type}],["form",{type:A.type}],["formaction",{type:m.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:n.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["height",{type:c.type,options:{}}],["list",{type:A.type}],["max",{type:y.type}],["maxlength",{type:c.type,options:{}}],["min",{type:y.type}],["minlength",{type:c.type,options:{}}],["multiple",{type:n.type}],["name",{type:y.type}],["pattern",{type:C.type}],["placeholder",{type:y.type}],["popovertarget",{type:y.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["readonly",{type:n.type}],["required",{type:n.type}],["size",{type:c.type,options:{min:1}}],["src",{type:m.type}],["step",{type:"#or",items:[{type:f.type},{type:i.type,options:{keywords:["any"]}}]}],["type",{type:i.type,options:{keywords:["hidden","text","search","tel","url","email","password","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}}],["value",{type:y.type}],["width",{type:c.type,options:{}}]]},button:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["form",{type:A.type}],["formaction",{type:m.type}],["formenctype",{type:i.type,options:{keywords:["application/x-www-form-urlencoded","multipart/form-data","text/plain"]}}],["formmethod",{type:i.type,options:{keywords:["get","post","dialog"]}}],["formnovalidate",{type:n.type}],["formtarget",{type:"#or",items:[{type:S.type},{type:i.type,options:{keywords:["_blank","_self","_parent","_top"]}}]}],["name",{type:y.type}],["popovertarget",{type:y.type}],["popovertargetaction",{type:i.type,options:{keywords:["hide","show","toggle"]}}],["type",{type:i.type,options:{keywords:["submit","reset","button"]}}],["value",{type:y.type}]]},select:{globalAttributes:!0,attributes:[["autocomplete",{type:k.type}],["disabled",{type:n.type}],["form",{type:A.type}],["multiple",{type:n.type}],["name",{type:y.type}],["required",{type:n.type}],["size",{type:c.type,options:{min:1}}]]},datalist:{globalAttributes:!0,attributes:a},optgroup:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["label",{type:y.type}]]},option:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["label",{type:y.type}],["selected",{type:n.type}],["value",{type:y.type}]]},textarea:{globalAttributes:!0,attributes:[["autocomplete",{type:k.type}],["cols",{type:c.type,options:{min:1}}],["dirname",{type:y.type}],["disabled",{type:n.type}],["form",{type:A.type}],["maxlength",{type:c.type,options:{}}],["minlength",{type:c.type,options:{}}],["name",{type:y.type}],["placeholder",{type:y.type}],["readonly",{type:n.type}],["required",{type:n.type}],["rows",{type:c.type,options:{min:1}}],["wrap",{type:i.type,options:{keywords:["soft","hard"]}}]]},output:{globalAttributes:!0,attributes:[["for",{type:b.type,options:{unique:!0}}],["form",{type:A.type}],["name",{type:y.type}]]},progress:{globalAttributes:!0,attributes:[["value",{type:f.type}],["max",{type:f.type}]]},meter:{globalAttributes:!0,attributes:[["value",{type:f.type}],["min",{type:f.type}],["max",{type:f.type}],["low",{type:f.type}],["high",{type:f.type}],["optimum",{type:f.type}]]},fieldset:{globalAttributes:!0,attributes:[["disabled",{type:n.type}],["form",{type:A.type}],["name",{type:y.type}]]},legend:{globalAttributes:!0,attributes:a},selectedcontent:{globalAttributes:!0,attributes:a},details:{globalAttributes:!0,attributes:[["open",{type:n.type}],["name",{type:y.type}]]},summary:{globalAttributes:!0,attributes:a},dialog:{globalAttributes:!0,attributes:[["open",{type:n.type}]]},script:{globalAttributes:!0,attributes:[["src",{type:m.type}],["type",{type:M.type,items:[{type:i.type,options:{keywords:["module","importmap","speculationrules"]}},{type:E.type}]}],["nomodule",{type:n.type}],["async",{type:n.type}],["defer",{type:n.type}],["crossorigin",{type:i.type,options:{keywords:["","anonymous","use-credentials"]}}],["integrity",{type:y.type}],["referrerpolicy",{type:i.type,options:{keywords:["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]}}],["blocking",{type:b.type,options:{unique:!0}}],["fetchpriority",{type:i.type,options:{keywords:["high","low","auto"]}}]]},noscript:{globalAttributes:!0,attributes:a},template:{globalAttributes:!0,attributes:[["shadowrootmode",{type:i.type,options:{keywords:["open","closed"]}}],["shadowrootdelegatesfocus",{type:n.type}],["shadowrootclonable",{type:n.type}],["shadowrootserializable",{type:n.type}]]},slot:{globalAttributes:!0,attributes:[["name",{type:y.type}]]},canvas:{globalAttributes:!0,attributes:[["width",{type:c.type,options:{}}],["height",{type:c.type,options:{}}]]}};var K=class{constructor(t){this.state=t;this.get=t=>{var l,d,g;let r=this.getSpecDefinition();if(!r)return null;let o=null;return r.globalAttributes&&(o=(l=et.get(t))!=null?l:null,o)?new H(t,o):(o=(g=(d=r==null?void 0:r.attributes.find(([h])=>t.toLowerCase()===h))==null?void 0:d[1])!=null?g:null,o?new H(t,o):null)};this.has=t=>{let r=this.getSpecDefinition();return r!=null&&r.globalAttributes&&et.has(t)?!0:!!(r==null?void 0:r.attributes.find(([l])=>t.toLowerCase()===l))}}getSpecDefinition(){let t=pt[this.state.name];return t!=null?t:null}};var Y=class{constructor(t,r){this.implicitRole=()=>{let t=it[this.state.name];return t?t(this.state):null};this.state=new W(t,r)}get attributes(){return new K(this.state)}};function st(p,t={}){return new Y(p,t)}0&&(module.exports={element});
328
2
  //# sourceMappingURL=index.cjs.map