uxml-preview 0.6.0 → 0.6.1

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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { loadYoga as pt, PositionType as ue, Direction as De, Edge as te, BoxSizing as ht, FlexDirection as ne, Wrap as oe, Justify as J, Align as P, Display as mt, Overflow as gt } from "yoga-layout/load";
2
- const Pe = {
1
+ import { loadYoga as gt, PositionType as fe, Direction as Re, Edge as se, BoxSizing as yt, FlexDirection as ie, Wrap as re, Justify as G, Align as W, Display as bt, Overflow as vt } from "yoga-layout/load";
2
+ const We = {
3
3
  // VisualElement is the base class and carries no class of its own.
4
4
  VisualElement: { hasText: !1, classes: [], parts: [] },
5
5
  Label: { hasText: !0, classes: ["unity-label"], parts: [] },
@@ -37,135 +37,135 @@ const Pe = {
37
37
  { name: "unity-content-container", style: { "flex-shrink": "0" } }
38
38
  ]
39
39
  }
40
- }, de = { hasText: !1, classes: [], parts: [] }, yt = "UXML", bt = /* @__PURE__ */ new Set(["Style", "Template", "AttributeOverrides", "Bindings", "Columns"]);
41
- function ye(e) {
42
- return bt.has(e.name.local);
40
+ }, pe = { hasText: !1, classes: [], parts: [] }, wt = "UXML", xt = /* @__PURE__ */ new Set(["Style", "Template", "AttributeOverrides", "Bindings", "Columns"]);
41
+ function ve(e) {
42
+ return xt.has(e.name.local);
43
43
  }
44
- function X(e) {
44
+ function Q(e) {
45
45
  var t;
46
- if (((t = e.derived) == null ? void 0 : t.kind) === "template-container") return { spec: de, fallback: !1 };
47
- const n = Pe[e.name.local];
48
- return n !== void 0 ? { spec: n, fallback: !1 } : vt(e) ? { spec: de, fallback: !1 } : { spec: de, fallback: !0 };
46
+ if (((t = e.derived) == null ? void 0 : t.kind) === "template-container") return { spec: pe, fallback: !1 };
47
+ const n = We[e.name.local];
48
+ return n !== void 0 ? { spec: n, fallback: !1 } : kt(e) ? { spec: pe, fallback: !1 } : { spec: pe, fallback: !0 };
49
49
  }
50
- function vt(e) {
51
- return e.name.local === yt;
50
+ function kt(e) {
51
+ return e.name.local === wt;
52
52
  }
53
- function wt(e) {
54
- return X(e).spec.classes;
53
+ function St(e) {
54
+ return Q(e).spec.classes;
55
55
  }
56
- function kt() {
57
- return Object.keys(Pe);
56
+ function $t() {
57
+ return Object.keys(We);
58
58
  }
59
- function Z(e) {
59
+ function ee(e) {
60
60
  const n = (t, s) => !Number.isInteger(t) || t < 0 || t > 1114111 || t >= 55296 && t <= 57343 ? s : String.fromCodePoint(t);
61
61
  return e.replace(/&#x([0-9a-f]+);/gi, (t, s) => n(parseInt(s, 16), t)).replace(/&#(\d+);/g, (t, s) => n(Number(s), t)).replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&");
62
62
  }
63
- function Me(e) {
63
+ function Ae(e) {
64
64
  return e !== void 0 && /[A-Za-z0-9_.:-]/.test(e);
65
65
  }
66
- function Ce(e) {
66
+ function je(e) {
67
67
  return e !== void 0 && /[A-Za-z_]/.test(e);
68
68
  }
69
- function xt(e) {
69
+ function Tt(e) {
70
70
  return e === " " || e === " " || e === `
71
71
  ` || e === "\r";
72
72
  }
73
- function We(e) {
73
+ function He(e) {
74
74
  const n = [];
75
75
  let t = 0, s = 0;
76
- const o = () => s++;
77
- function i(d, m, a) {
76
+ const i = () => s++;
77
+ function o(f, m, a) {
78
78
  n.push({
79
79
  kind: "malformed",
80
- message: d,
80
+ message: f,
81
81
  at: { in: "uxml", span: { start: m, end: a } }
82
82
  });
83
83
  }
84
84
  function c() {
85
- for (; xt(e[t]); ) t++;
85
+ for (; Tt(e[t]); ) t++;
86
86
  }
87
87
  function u() {
88
88
  for (; ; ) {
89
- const d = e.indexOf("<", t);
90
- if (d < 0) {
89
+ const f = e.indexOf("<", t);
90
+ if (f < 0) {
91
91
  t = e.length;
92
92
  return;
93
93
  }
94
- const m = e[d + 1];
94
+ const m = e[f + 1];
95
95
  if (m === "!") {
96
- if (e.startsWith("<!--", d)) {
97
- const a = e.indexOf("-->", d + 4);
96
+ if (e.startsWith("<!--", f)) {
97
+ const a = e.indexOf("-->", f + 4);
98
98
  t = a < 0 ? e.length : a + 3;
99
- } else if (e.startsWith("<![CDATA[", d)) {
100
- const a = e.indexOf("]]>", d + 9);
99
+ } else if (e.startsWith("<![CDATA[", f)) {
100
+ const a = e.indexOf("]]>", f + 9);
101
101
  t = a < 0 ? e.length : a + 3;
102
102
  } else {
103
- const a = e.indexOf(">", d);
103
+ const a = e.indexOf(">", f);
104
104
  t = a < 0 ? e.length : a + 1;
105
105
  }
106
106
  continue;
107
107
  }
108
108
  if (m === "?") {
109
- const a = e.indexOf("?>", d + 2);
109
+ const a = e.indexOf("?>", f + 2);
110
110
  t = a < 0 ? e.length : a + 2;
111
111
  continue;
112
112
  }
113
- t = d;
113
+ t = f;
114
114
  return;
115
115
  }
116
116
  }
117
117
  function g() {
118
- const d = t;
119
- for (; Me(e[t]); ) t++;
120
- const m = e.slice(d, t), a = m.indexOf(":");
118
+ const f = t;
119
+ for (; Ae(e[t]); ) t++;
120
+ const m = e.slice(f, t), a = m.indexOf(":");
121
121
  return a < 0 ? { prefix: null, local: m } : { prefix: m.slice(0, a), local: m.slice(a + 1) };
122
122
  }
123
- function p() {
124
- const d = t;
125
- for (; Me(e[t]); ) t++;
126
- if (t === d) return null;
127
- const m = e.slice(d, t), a = t;
123
+ function h() {
124
+ const f = t;
125
+ for (; Ae(e[t]); ) t++;
126
+ if (t === f) return null;
127
+ const m = e.slice(f, t), a = t;
128
128
  if (c(), e[t] !== "=")
129
- return t = a, i(`attribute "${m}" has no value`, d, a), { name: m, value: "", span: { start: d, end: a } };
129
+ return t = a, o(`attribute "${m}" has no value`, f, a), { name: m, value: "", span: { start: f, end: a } };
130
130
  t++, c();
131
- const b = e[t];
132
- if (b !== '"' && b !== "'")
133
- return i(`attribute "${m}" has an unquoted value`, d, t), { name: m, value: "", span: { start: d, end: t } };
131
+ const y = e[t];
132
+ if (y !== '"' && y !== "'")
133
+ return o(`attribute "${m}" has an unquoted value`, f, t), { name: m, value: "", span: { start: f, end: t } };
134
134
  t++;
135
- const r = t, w = e.indexOf(b, t);
136
- return w < 0 ? (i(`attribute "${m}" has an unterminated value`, d, e.length), t = e.length, { name: m, value: e.slice(r), span: { start: d, end: t } }) : (t = w + 1, { name: m, value: e.slice(r, w), span: { start: d, end: t } });
135
+ const r = t, w = e.indexOf(y, t);
136
+ return w < 0 ? (o(`attribute "${m}" has an unterminated value`, f, e.length), t = e.length, { name: m, value: e.slice(r), span: { start: f, end: t } }) : (t = w + 1, { name: m, value: e.slice(r, w), span: { start: f, end: t } });
137
137
  }
138
138
  function l() {
139
- const d = t;
139
+ const f = t;
140
140
  t++;
141
141
  const m = g(), a = [];
142
- let b = !1;
142
+ let y = !1;
143
143
  for (; ; ) {
144
144
  c();
145
- const k = e[t];
146
- if (k === void 0) {
147
- i("unterminated open tag", d, e.length);
145
+ const x = e[t];
146
+ if (x === void 0) {
147
+ o("unterminated open tag", f, e.length);
148
148
  break;
149
149
  }
150
- if (k === ">") {
150
+ if (x === ">") {
151
151
  t++;
152
152
  break;
153
153
  }
154
- if (k === "/" && e[t + 1] === ">") {
155
- t += 2, b = !0;
154
+ if (x === "/" && e[t + 1] === ">") {
155
+ t += 2, y = !0;
156
156
  break;
157
157
  }
158
- const v = p();
158
+ const v = h();
159
159
  if (v === null) {
160
160
  t++;
161
161
  continue;
162
162
  }
163
163
  a.push(v);
164
164
  }
165
- const r = { start: d, end: t };
166
- if (b)
165
+ const r = { start: f, end: t };
166
+ if (y)
167
167
  return {
168
- id: o(),
168
+ id: i(),
169
169
  name: m,
170
170
  attributes: a,
171
171
  children: [],
@@ -173,39 +173,39 @@ function We(e) {
173
173
  tagDirty: !1,
174
174
  childrenDirty: !1
175
175
  };
176
- const w = t, y = [];
176
+ const w = t, b = [];
177
177
  for (; ; ) {
178
178
  if (u(), t >= e.length) {
179
- i(`unterminated element <${_e(m)}>`, d, e.length);
179
+ o(`unterminated element <${Ve(m)}>`, f, e.length);
180
180
  break;
181
181
  }
182
- const k = e[t + 1];
183
- if (k === "/") break;
184
- if (!Ce(k)) {
182
+ const x = e[t + 1];
183
+ if (x === "/") break;
184
+ if (!je(x)) {
185
185
  t++;
186
186
  continue;
187
187
  }
188
- y.push(l());
188
+ b.push(l());
189
189
  }
190
- const h = t;
191
- let f = null;
190
+ const p = t;
191
+ let d = null;
192
192
  if (e.startsWith("</", t)) {
193
- const k = e.indexOf(">", t), v = k < 0 ? e.length : k + 1;
194
- k < 0 && i("unterminated end tag", t, v), f = { start: t, end: v }, t = v;
193
+ const x = e.indexOf(">", t), v = x < 0 ? e.length : x + 1;
194
+ x < 0 && o("unterminated end tag", t, v), d = { start: t, end: v }, t = v;
195
195
  }
196
196
  return {
197
- id: o(),
197
+ id: i(),
198
198
  name: m,
199
199
  attributes: a,
200
- children: y,
201
- spans: { openTag: r, inner: { start: w, end: h }, closeTag: f },
200
+ children: b,
201
+ spans: { openTag: r, inner: { start: w, end: p }, closeTag: d },
202
202
  tagDirty: !1,
203
203
  childrenDirty: !1
204
204
  };
205
205
  }
206
- return u(), t < e.length && Ce(e[t + 1]) ? { root: l(), warnings: n } : (i("no root element", 0, 0), {
206
+ return u(), t < e.length && je(e[t + 1]) ? { root: l(), warnings: n } : (o("no root element", 0, 0), {
207
207
  root: {
208
- id: o(),
208
+ id: i(),
209
209
  name: { prefix: null, local: "" },
210
210
  attributes: [],
211
211
  children: [],
@@ -216,57 +216,57 @@ function We(e) {
216
216
  warnings: n
217
217
  });
218
218
  }
219
- function _e(e) {
219
+ function Ve(e) {
220
220
  return e.prefix === null ? e.local : `${e.prefix}:${e.local}`;
221
221
  }
222
- let Be;
223
- function St(e) {
224
- Be = e;
222
+ let qe;
223
+ function Et(e) {
224
+ qe = e;
225
225
  }
226
- const He = /* @__PURE__ */ new WeakMap();
227
- function $t(e, n) {
228
- He.set(e, n);
226
+ const Je = /* @__PURE__ */ new WeakMap();
227
+ function Ot(e, n) {
228
+ Je.set(e, n);
229
229
  }
230
- function Fn(e) {
231
- return We(e).root.children.filter((t) => t.name.local === "Template").flatMap((t) => {
232
- const s = Ve(t, "src");
233
- return s === void 0 || s.length === 0 ? [] : [Z(s)];
230
+ function Wn(e) {
231
+ return He(e).root.children.filter((t) => t.name.local === "Template").flatMap((t) => {
232
+ const s = Ye(t, "src");
233
+ return s === void 0 || s.length === 0 ? [] : [ee(s)];
234
234
  });
235
235
  }
236
- const Re = 32;
237
- function Ve(e, n) {
236
+ const Ne = 32;
237
+ function Ye(e, n) {
238
238
  var t;
239
239
  return (t = e.attributes.find((s) => s.name === n)) == null ? void 0 : t.value;
240
240
  }
241
- function F(e, n) {
242
- const t = Ve(e, n);
243
- return t === void 0 ? void 0 : Z(t);
241
+ function P(e, n) {
242
+ const t = Ye(e, n);
243
+ return t === void 0 ? void 0 : ee(t);
244
244
  }
245
- function qe(e) {
245
+ function Ke(e) {
246
246
  const n = /* @__PURE__ */ new Map();
247
247
  for (const t of e.root.children) {
248
248
  if (t.name.local !== "Template") continue;
249
- const s = F(t, "name"), o = F(t, "src");
250
- s === void 0 || s.length === 0 || o === void 0 || o.length === 0 || n.set(s, { name: s, src: o, node: t });
249
+ const s = P(t, "name"), i = P(t, "src");
250
+ s === void 0 || s.length === 0 || i === void 0 || i.length === 0 || n.set(s, { name: s, src: i, node: t });
251
251
  }
252
252
  return n;
253
253
  }
254
- function Ye(e, n) {
254
+ function Ge(e, n) {
255
255
  return JSON.stringify([e, n]);
256
256
  }
257
- function Tt(e) {
257
+ function It(e) {
258
258
  return /(?:^|\/)Packages\//i.test(e) || /PackageCache/i.test(e);
259
259
  }
260
- function V(e, n, t, s, o, i = {}) {
260
+ function J(e, n, t, s, i, o = {}) {
261
261
  e.push({
262
262
  kind: n,
263
263
  message: t,
264
264
  ...s === void 0 ? {} : { node: s.id },
265
- ...o === void 0 ? {} : { sourceDocument: o },
266
- ...i
265
+ ...i === void 0 ? {} : { sourceDocument: i },
266
+ ...o
267
267
  });
268
268
  }
269
- function le(e, n = 0, t = void 0) {
269
+ function ue(e, n = 0, t = void 0) {
270
270
  return {
271
271
  ...e,
272
272
  span: {
@@ -276,108 +276,108 @@ function le(e, n = 0, t = void 0) {
276
276
  ...t === void 0 ? {} : { sourceDocument: t }
277
277
  };
278
278
  }
279
- function Je(e) {
279
+ function Xe(e) {
280
280
  return { prefix: e.prefix, local: e.local };
281
281
  }
282
- function je() {
282
+ function Fe() {
283
283
  return { start: 0, end: 0 };
284
284
  }
285
- function fe(e, n) {
285
+ function he(e, n) {
286
286
  return { start: e.start + n, end: e.end + n };
287
287
  }
288
- function Et(e, n, t, s, o) {
288
+ function Dt(e, n, t, s, i) {
289
289
  return {
290
290
  id: e,
291
291
  name: n,
292
292
  attributes: t,
293
293
  children: s,
294
- spans: { openTag: je(), inner: je(), closeTag: null },
294
+ spans: { openTag: Fe(), inner: Fe(), closeTag: null },
295
295
  tagDirty: !1,
296
296
  childrenDirty: !1,
297
- ...o === void 0 ? {} : { derived: { kind: "template-container", instance: o } }
297
+ ...i === void 0 ? {} : { derived: { kind: "template-container", instance: i } }
298
298
  };
299
299
  }
300
- function Ot(e, n, t) {
301
- const s = e.items.map((o) => o.kind !== "import" || o.resolvedSheet === void 0 ? o.kind === "rule" ? {
302
- ...o,
300
+ function Ct(e, n, t) {
301
+ const s = e.items.map((i) => i.kind !== "import" || i.resolvedSheet === void 0 ? i.kind === "rule" ? {
302
+ ...i,
303
303
  rule: {
304
- ...o.rule,
305
- selectors: o.rule.selectors.map((i) => ({
306
- ...i,
307
- parts: i.parts.map((c) => ({ ...c, simple: [...c.simple] }))
304
+ ...i.rule,
305
+ selectors: i.rule.selectors.map((o) => ({
306
+ ...o,
307
+ parts: o.parts.map((c) => ({ ...c, simple: [...c.simple] }))
308
308
  })),
309
- declarations: o.rule.declarations.map((i) => ({ ...i }))
309
+ declarations: i.rule.declarations.map((o) => ({ ...o }))
310
310
  }
311
- } : { ...o } : { ...o, resolvedSheet: o.resolvedSheet + n });
311
+ } : { ...i } : { ...i, resolvedSheet: i.resolvedSheet + n });
312
312
  return { ...e, items: s, sourceDocumentFrom: t };
313
313
  }
314
- function It(e, n) {
314
+ function Mt(e, n) {
315
315
  const t = n.sheetOffsets.get(e.document);
316
316
  if (t !== void 0) return t;
317
- const s = n.sheets.length, o = e.document.sheets.map((c, u) => s + u), i = e.document.sheets.map(() => e.url);
317
+ const s = n.sheets.length, i = e.document.sheets.map((c, u) => s + u), o = e.document.sheets.map(() => e.url);
318
318
  return e.document.sheets.forEach((c, u) => {
319
319
  for (const g of c.items)
320
- g.kind === "import" && g.resolvedSheet !== void 0 && (i[g.resolvedSheet] = c.origin ?? e.url);
321
- }), n.sheetOffsets.set(e.document, o), e.document.sheets.forEach(
322
- (c, u) => n.sheets.push(Ot(c, s, i[u]))
323
- ), o;
320
+ g.kind === "import" && g.resolvedSheet !== void 0 && (o[g.resolvedSheet] = c.origin ?? e.url);
321
+ }), n.sheetOffsets.set(e.document, i), e.document.sheets.forEach(
322
+ (c, u) => n.sheets.push(Ct(c, s, o[u]))
323
+ ), i;
324
324
  }
325
- function Ge(e, n) {
325
+ function Ze(e, n) {
326
326
  const t = n.sourceOffsets.get(e);
327
327
  if (t !== void 0) return t;
328
328
  const s = n.sourceLength + 1;
329
329
  return n.sourceOffsets.set(e, s), n.sources.push(`
330
330
  ${e.source}`), n.sourceLength += e.source.length + 1, s;
331
331
  }
332
- function Dt(e, n, t, s, o) {
333
- for (const i of e.document.styleRoots ?? []) {
334
- const c = n[i.sheet];
332
+ function Rt(e, n, t, s, i) {
333
+ for (const o of e.document.styleRoots ?? []) {
334
+ const c = n[o.sheet];
335
335
  if (c === void 0) continue;
336
- const u = t.nodes.get(i.scope) ?? s.id;
337
- o.styleRoots.push({ sheet: c, scope: u });
336
+ const u = t.nodes.get(o.scope) ?? s.id;
337
+ i.styleRoots.push({ sheet: c, scope: u });
338
338
  }
339
339
  }
340
- function Mt(e) {
340
+ function At(e) {
341
341
  return e.map((n) => {
342
- const t = F(n, "name"), s = F(n, "slot");
342
+ const t = P(n, "name"), s = P(n, "slot");
343
343
  return `<${n.name.local}${t === void 0 ? "" : ` name="${t}"`}${s === void 0 ? "" : ` slot="${s}"`}>`;
344
344
  });
345
345
  }
346
- function Ke(e, n) {
347
- const t = F(e, "slot-name");
346
+ function Qe(e, n) {
347
+ const t = P(e, "slot-name");
348
348
  t !== void 0 && t.length > 0 && n.add(t);
349
- for (const s of e.children) Ke(s, n);
349
+ for (const s of e.children) Qe(s, n);
350
350
  }
351
- function ee(e, n, t, s, o) {
352
- const i = /* @__PURE__ */ new Set();
353
- t !== null && Ke(t.document.root, i), !(i.size === 0 && n.length === 0) && V(
354
- o.warnings,
351
+ function ne(e, n, t, s, i) {
352
+ const o = /* @__PURE__ */ new Set();
353
+ t !== null && Qe(t.document.root, o), !(o.size === 0 && n.length === 0) && J(
354
+ i.warnings,
355
355
  "template-slot-unsupported",
356
- `Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" : i.size === 0 ? "(none)" : [...i].join(", ")}; children not placed: ${n.length === 0 ? "(none)" : Mt(n).join(", ")}`,
356
+ `Template slots are unsupported; defined slot names: ${t === null ? "(unavailable)" : o.size === 0 ? "(none)" : [...o].join(", ")}; children not placed: ${n.length === 0 ? "(none)" : At(n).join(", ")}`,
357
357
  e,
358
358
  s,
359
359
  { reason: "not-rendered" }
360
360
  );
361
361
  }
362
- function $e(e, n) {
363
- if (!ye(e)) {
364
- const t = F(e, "name");
362
+ function Ee(e, n) {
363
+ if (!ve(e)) {
364
+ const t = P(e, "name");
365
365
  t !== void 0 && t.length > 0 && n.set(t, (n.get(t) ?? 0) + 1);
366
366
  }
367
- for (const t of e.children) $e(t, n);
367
+ for (const t of e.children) Ee(t, n);
368
368
  }
369
- function Xe(e, n, t) {
370
- F(e, "name") === n && t.push(e);
371
- for (const s of e.children) Xe(s, n, t);
369
+ function et(e, n, t) {
370
+ P(e, "name") === n && t.push(e);
371
+ for (const s of e.children) et(s, n, t);
372
372
  }
373
- function Ct(e, n, t, s, o) {
373
+ function jt(e, n, t, s, i) {
374
374
  if (n.length === 0) return;
375
- const i = /* @__PURE__ */ new Map();
376
- $e(e, i);
375
+ const o = /* @__PURE__ */ new Map();
376
+ Ee(e, o);
377
377
  for (const c of n) {
378
- const u = F(c, "element-name"), g = F(c, "style");
379
- if (g !== void 0 && V(
380
- o.warnings,
378
+ const u = P(c, "element-name"), g = P(c, "style");
379
+ if (g !== void 0 && J(
380
+ i.warnings,
381
381
  "override-style-ignored",
382
382
  `AttributeOverrides style for element-name "${u ?? "(missing)"}" was ignored with value "${g}"`,
383
383
  c,
@@ -387,11 +387,11 @@ function Ct(e, n, t, s, o) {
387
387
  ...u === void 0 ? {} : { subject: { kind: "name", name: u } }
388
388
  }
389
389
  ), u === void 0 || u.length === 0) continue;
390
- const p = [];
391
- if (Xe(e, u, p), p.length === 0) {
392
- const l = [...i.keys()];
393
- V(
394
- o.warnings,
390
+ const h = [];
391
+ if (et(e, u, h), h.length === 0) {
392
+ const l = [...o.keys()];
393
+ J(
394
+ i.warnings,
395
395
  "override-target-missing",
396
396
  `AttributeOverrides target "${u}" matched no element; available names: ${l.length === 0 ? "(none)" : l.join(", ")}`,
397
397
  c,
@@ -400,22 +400,22 @@ function Ct(e, n, t, s, o) {
400
400
  );
401
401
  continue;
402
402
  }
403
- for (const l of p)
404
- for (const d of c.attributes) {
405
- if (d.name === "element-name" || d.name === "style") continue;
406
- const m = l.attributes.find((a) => a.name === d.name);
407
- m === void 0 ? l.attributes.push(le(d, t, s)) : (m.value = d.value, m.sourceDocument = s);
403
+ for (const l of h)
404
+ for (const f of c.attributes) {
405
+ if (f.name === "element-name" || f.name === "style") continue;
406
+ const m = l.attributes.find((a) => a.name === f.name);
407
+ m === void 0 ? l.attributes.push(ue(f, t, s)) : (m.value = f.value, m.sourceDocument = s);
408
408
  }
409
409
  }
410
410
  }
411
- function Ze(e) {
412
- return e.name.local === "Template" || e.name.local === "Instance" ? !0 : e.children.some(Ze);
411
+ function tt(e) {
412
+ return e.name.local === "Template" || e.name.local === "Instance" ? !0 : e.children.some(tt);
413
413
  }
414
- function Rt(e, n) {
414
+ function Nt(e, n) {
415
415
  let t = 0;
416
- const s = (o) => {
417
- t = Math.max(t, Number(o.id) + 1);
418
- for (const i of o.children) s(i);
416
+ const s = (i) => {
417
+ t = Math.max(t, Number(i.id) + 1);
418
+ for (const o of i.children) s(o);
419
419
  };
420
420
  return s(e.root), {
421
421
  resolver: n,
@@ -432,20 +432,20 @@ function Rt(e, n) {
432
432
  stack: []
433
433
  };
434
434
  }
435
- function jt(e, n, t) {
435
+ function Ft(e, n, t) {
436
436
  var g;
437
- const s = Ye(e.src, n);
437
+ const s = Ge(e.src, n);
438
438
  if (t.cache.has(s)) return t.cache.get(s) ?? null;
439
- const o = ((g = t.resolver) == null ? void 0 : g.call(t, e.src, n)) ?? null;
440
- if (o === null)
441
- return t.cache.set(s, null), V(
439
+ const i = ((g = t.resolver) == null ? void 0 : g.call(t, e.src, n)) ?? null;
440
+ if (i === null)
441
+ return t.cache.set(s, null), J(
442
442
  t.warnings,
443
443
  "template-src-unresolved",
444
444
  `Template "${e.name}" src "${e.src}" could not be resolved from ${n === null ? "the entry UXML" : `"${n}"`}; attempted resolveImport("${e.src}", ${n === null ? "null" : `"${n}"`}); internal filesystem search paths: none`,
445
445
  e.node,
446
446
  n ?? void 0,
447
447
  { subject: { kind: "import", url: e.src, from: n } }
448
- ), Tt(e.src) && V(
448
+ ), It(e.src) && J(
449
449
  t.warnings,
450
450
  "package-path-not-searched",
451
451
  `Template src "${e.src}" was unresolved; the resolver returned no source and the core does not independently search Unity Packages/Library/PackageCache paths`,
@@ -453,22 +453,22 @@ function jt(e, n, t) {
453
453
  n ?? void 0,
454
454
  { reason: "not-rendered", subject: { kind: "import", url: e.src, from: n } }
455
455
  ), null;
456
- const i = Be;
457
- if (i === void 0)
456
+ const o = qe;
457
+ if (o === void 0)
458
458
  throw new Error("template parser is not registered; import parse from src/index before expansion");
459
- const c = i(
460
- o,
461
- t.resolver === void 0 ? void 0 : (p, l) => t.resolver(p, l ?? e.src)
459
+ const c = o(
460
+ i,
461
+ t.resolver === void 0 ? void 0 : (h, l) => t.resolver(h, l ?? e.src)
462
462
  ), u = {
463
463
  url: e.src,
464
464
  from: n,
465
465
  document: c,
466
- declarations: qe(c)
466
+ declarations: Ke(c)
467
467
  };
468
468
  return t.cache.set(s, u), u;
469
469
  }
470
- function Nt(e, n, t) {
471
- var s, o, i, c;
470
+ function Lt(e, n, t) {
471
+ var s, i, o, c;
472
472
  if (!t.reportedWarnings.has(e.document)) {
473
473
  t.reportedWarnings.add(e.document);
474
474
  for (const u of e.document.warnings)
@@ -477,23 +477,23 @@ function Nt(e, n, t) {
477
477
  at: {
478
478
  ...u.at,
479
479
  sheet: n[u.at.sheet] ?? u.at.sheet,
480
- url: ((o = e.document.sheets[u.at.sheet]) == null ? void 0 : o.origin) ?? null,
481
- from: ((i = t.sheets[n[u.at.sheet] ?? u.at.sheet]) == null ? void 0 : i.sourceDocumentFrom) ?? null
480
+ url: ((i = e.document.sheets[u.at.sheet]) == null ? void 0 : i.origin) ?? null,
481
+ from: ((o = t.sheets[n[u.at.sheet] ?? u.at.sheet]) == null ? void 0 : o.sourceDocumentFrom) ?? null
482
482
  },
483
483
  sourceDocument: ((c = e.document.sheets[u.at.sheet]) == null ? void 0 : c.origin) ?? e.url
484
484
  }) : t.warnings.push({ ...u, sourceDocument: e.url });
485
485
  }
486
486
  }
487
- function ce(e, n, t, s, o, i) {
488
- const c = o ? e.id : n.nextId(), u = s === null ? 0 : n.sourceOffsets.get(s.document) ?? 0, g = u === 0 || s === null ? void 0 : s.url, p = {
487
+ function de(e, n, t, s, i, o) {
488
+ const c = i ? e.id : n.nextId(), u = s === null ? 0 : n.sourceOffsets.get(s.document) ?? 0, g = u === 0 || s === null ? void 0 : s.url, h = {
489
489
  id: c,
490
- name: Je(e.name),
491
- attributes: e.attributes.map((l) => le(l, u, g)),
490
+ name: Xe(e.name),
491
+ attributes: e.attributes.map((l) => ue(l, u, g)),
492
492
  children: [],
493
493
  spans: {
494
- openTag: fe(e.spans.openTag, u),
495
- inner: fe(e.spans.inner, u),
496
- closeTag: e.spans.closeTag === null ? null : fe(e.spans.closeTag, u)
494
+ openTag: he(e.spans.openTag, u),
495
+ inner: he(e.spans.inner, u),
496
+ closeTag: e.spans.closeTag === null ? null : he(e.spans.closeTag, u)
497
497
  },
498
498
  tagDirty: e.tagDirty,
499
499
  childrenDirty: e.childrenDirty,
@@ -503,37 +503,37 @@ function ce(e, n, t, s, o, i) {
503
503
  sourceNode: e.id
504
504
  }
505
505
  };
506
- t.nodes.set(e.id, p.id);
506
+ t.nodes.set(e.id, h.id);
507
507
  for (const l of e.children)
508
508
  if (!(l.name.local === "Template" || l.name.local === "Style")) {
509
509
  if (l.name.local === "Instance") {
510
- p.children.push(Te(l, n, s, t, i + 1));
510
+ h.children.push(Oe(l, n, s, t, o + 1));
511
511
  continue;
512
512
  }
513
- l.name.local !== "AttributeOverrides" && F(l, "slot") === void 0 && p.children.push(ce(l, n, t, s, o, i));
513
+ l.name.local !== "AttributeOverrides" && P(l, "slot") === void 0 && h.children.push(de(l, n, t, s, i, o));
514
514
  }
515
- return p;
515
+ return h;
516
516
  }
517
- function At(e, n, t, s) {
518
- Ge(e.document, t);
519
- const o = { nodes: /* @__PURE__ */ new Map([[e.document.root.id, n.id]]) };
520
- for (const i of e.document.root.children)
521
- if (!(i.name.local === "Template" || i.name.local === "Style")) {
522
- if (i.name.local === "Instance") {
523
- n.children.push(Te(i, t, e, o, s + 1));
517
+ function Ut(e, n, t, s) {
518
+ Ze(e.document, t);
519
+ const i = { nodes: /* @__PURE__ */ new Map([[e.document.root.id, n.id]]) };
520
+ for (const o of e.document.root.children)
521
+ if (!(o.name.local === "Template" || o.name.local === "Style")) {
522
+ if (o.name.local === "Instance") {
523
+ n.children.push(Oe(o, t, e, i, s + 1));
524
524
  continue;
525
525
  }
526
- i.name.local !== "AttributeOverrides" && F(i, "slot") === void 0 && n.children.push(ce(i, t, o, e, !1, s));
526
+ o.name.local !== "AttributeOverrides" && P(o, "slot") === void 0 && n.children.push(de(o, t, i, e, !1, s));
527
527
  }
528
- return o;
528
+ return i;
529
529
  }
530
- function Te(e, n, t, s, o) {
531
- const i = Et(
530
+ function Oe(e, n, t, s, i) {
531
+ const o = Dt(
532
532
  n.nextId(),
533
533
  { prefix: e.name.prefix, local: "TemplateContainer" },
534
- e.attributes.filter((y) => y.name !== "template").map(
535
- (y) => le(
536
- y,
534
+ e.attributes.filter((b) => b.name !== "template").map(
535
+ (b) => ue(
536
+ b,
537
537
  t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
538
538
  t === null || t.url.length === 0 ? null : t.url
539
539
  )
@@ -541,10 +541,10 @@ function Te(e, n, t, s, o) {
541
541
  [],
542
542
  e.id
543
543
  );
544
- t !== null && (i.sourceDocument = t.url.length > 0 ? t.url : null, i.sourceDocumentFrom = t.from), s.nodes.set(e.id, i.id);
545
- const c = F(e, "template"), u = e.children.filter((y) => F(y, "slot") !== void 0), g = t === null || t.url.length === 0 ? void 0 : t.url, p = t == null ? void 0 : t.declarations.get(c ?? "");
546
- if (p === void 0)
547
- return ee(e, u, null, g, n), V(
544
+ t !== null && (o.sourceDocument = t.url.length > 0 ? t.url : null, o.sourceDocumentFrom = t.from), s.nodes.set(e.id, o.id);
545
+ const c = P(e, "template"), u = e.children.filter((b) => P(b, "slot") !== void 0), g = t === null || t.url.length === 0 ? void 0 : t.url, h = t == null ? void 0 : t.declarations.get(c ?? "");
546
+ if (h === void 0)
547
+ return ne(e, u, null, g, n), J(
548
548
  n.warnings,
549
549
  "template-not-declared",
550
550
  `Instance${c === void 0 ? "" : ` template "${c}"`} has no matching Template declaration`,
@@ -554,67 +554,67 @@ function Te(e, n, t, s, o) {
554
554
  reason: "invalid-value",
555
555
  ...c === void 0 ? {} : { subject: { kind: "name", name: c } }
556
556
  }
557
- ), i;
558
- const l = t === null || t.url.length === 0 ? null : t.url, d = {
559
- key: JSON.stringify([p.name, p.src, l]),
560
- label: `${p.name}@${p.src}`
561
- }, m = n.stack.findIndex((y) => y.key === d.key);
557
+ ), o;
558
+ const l = t === null || t.url.length === 0 ? null : t.url, f = {
559
+ key: JSON.stringify([h.name, h.src, l]),
560
+ label: `${h.name}@${h.src}`
561
+ }, m = n.stack.findIndex((b) => b.key === f.key);
562
562
  if (m >= 0) {
563
- const y = n.cache.get(Ye(p.src, l)) ?? null;
564
- ee(e, u, y, g, n);
565
- const h = [...n.stack.slice(m), d].map((f) => f.label).join(" -> ");
566
- return V(
563
+ const b = n.cache.get(Ge(h.src, l)) ?? null;
564
+ ne(e, u, b, g, n);
565
+ const p = [...n.stack.slice(m), f].map((d) => d.label).join(" -> ");
566
+ return J(
567
567
  n.warnings,
568
568
  "template-cycle",
569
- `Template cycle detected: ${h}`,
569
+ `Template cycle detected: ${p}`,
570
570
  e,
571
571
  g,
572
572
  { reason: "invalid-value" }
573
- ), i;
573
+ ), o;
574
574
  }
575
- if (o >= Re)
576
- return ee(e, u, null, g, n), V(
575
+ if (i >= Ne)
576
+ return ne(e, u, null, g, n), J(
577
577
  n.warnings,
578
578
  "template-depth-exceeded",
579
- `Template expansion exceeded the depth limit ${Re}: ${[
579
+ `Template expansion exceeded the depth limit ${Ne}: ${[
580
580
  ...n.stack,
581
- d
582
- ].map((y) => y.label).join(" -> ")}`,
581
+ f
582
+ ].map((b) => b.label).join(" -> ")}`,
583
583
  e,
584
584
  g,
585
585
  { reason: "not-rendered" }
586
- ), i;
587
- const a = jt(p, l, n);
586
+ ), o;
587
+ const a = Ft(h, l, n);
588
588
  if (a === null)
589
- return ee(e, u, null, g, n), i;
590
- Ge(a.document, n), n.stack.push(d);
591
- const b = At(a, i, n, o);
589
+ return ne(e, u, null, g, n), o;
590
+ Ze(a.document, n), n.stack.push(f);
591
+ const y = Ut(a, o, n, i);
592
592
  n.stack.pop();
593
- const r = It(a, n);
594
- Nt(a, r, n), Dt(a, r, b, i, n);
595
- const w = e.children.filter((y) => y.name.local === "AttributeOverrides");
596
- ee(e, u, a, g, n), Ct(
597
- i,
593
+ const r = Mt(a, n);
594
+ Lt(a, r, n), Rt(a, r, y, o, n);
595
+ const w = e.children.filter((b) => b.name.local === "AttributeOverrides");
596
+ ne(e, u, a, g, n), jt(
597
+ o,
598
598
  w,
599
599
  t === null ? 0 : n.sourceOffsets.get(t.document) ?? 0,
600
600
  t === null || t.url.length === 0 ? null : t.url,
601
601
  n
602
602
  );
603
- for (const y of e.children)
604
- y.name.local === "AttributeOverrides" || y.name.local === "Style" || F(y, "slot") !== void 0 || i.children.push(ce(y, n, s, t, !1, o));
605
- return i;
603
+ for (const b of e.children)
604
+ b.name.local === "AttributeOverrides" || b.name.local === "Style" || P(b, "slot") !== void 0 || o.children.push(de(b, n, s, t, !1, i));
605
+ return o;
606
606
  }
607
- function Lt(e) {
608
- if (!Ze(e.root)) return { document: e, warnings: [] };
609
- const n = Rt(e, He.get(e)), t = n.styleRoots.length, s = {
607
+ function zt(e) {
608
+ if (!tt(e.root)) return { document: e, warnings: [] };
609
+ const n = Nt(e, Je.get(e)), t = n.styleRoots.length, s = {
610
610
  url: "",
611
611
  from: null,
612
612
  document: e,
613
- declarations: qe(e)
614
- }, o = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, i = {
613
+ declarations: Ke(e)
614
+ }, i = { nodes: /* @__PURE__ */ new Map([[e.root.id, e.root.id]]) }, o = {
615
615
  id: e.root.id,
616
- name: Je(e.root.name),
617
- attributes: e.root.attributes.map((u) => le(u)),
616
+ name: Xe(e.root.name),
617
+ attributes: e.root.attributes.map((u) => ue(u)),
618
618
  children: [],
619
619
  spans: {
620
620
  openTag: { ...e.root.spans.openTag },
@@ -627,19 +627,19 @@ function Lt(e) {
627
627
  for (const u of e.root.children)
628
628
  if (!(u.name.local === "Template" || u.name.local === "Style")) {
629
629
  if (u.name.local === "Instance") {
630
- i.children.push(Te(u, n, s, o, 0));
630
+ o.children.push(Oe(u, n, s, i, 0));
631
631
  continue;
632
632
  }
633
- u.name.local !== "AttributeOverrides" && F(u, "slot") === void 0 && i.children.push(ce(u, n, o, s, !0, 0));
633
+ u.name.local !== "AttributeOverrides" && P(u, "slot") === void 0 && o.children.push(de(u, n, i, s, !0, 0));
634
634
  }
635
635
  for (let u = 0; u < t; u++) {
636
- const g = n.styleRoots[u], p = o.nodes.get(g.scope);
637
- p !== void 0 && (n.styleRoots[u] = { ...g, scope: p });
636
+ const g = n.styleRoots[u], h = i.nodes.get(g.scope);
637
+ h !== void 0 && (n.styleRoots[u] = { ...g, scope: h });
638
638
  }
639
639
  const c = /* @__PURE__ */ new Map();
640
- $e(i, c);
640
+ Ee(o, c);
641
641
  for (const [u, g] of c)
642
- g > 1 && V(
642
+ g > 1 && J(
643
643
  n.warnings,
644
644
  "duplicate-name-in-tree",
645
645
  `name "${u}" occurs ${g} times after template expansion`,
@@ -650,7 +650,7 @@ function Lt(e) {
650
650
  return {
651
651
  document: {
652
652
  ...e,
653
- root: i,
653
+ root: o,
654
654
  source: n.sources.join(""),
655
655
  sheets: n.sheets,
656
656
  styleRoots: n.styleRoots
@@ -658,7 +658,7 @@ function Lt(e) {
658
658
  warnings: n.warnings
659
659
  };
660
660
  }
661
- const ae = "6000.0.40f1", Qe = `:disabled {
661
+ const ce = "6000.0.40f1", nt = `:disabled {
662
662
  opacity: 0.5;
663
663
  }
664
664
 
@@ -666,11 +666,11 @@ const ae = "6000.0.40f1", Qe = `:disabled {
666
666
  margin: 1px 3px;
667
667
  -unity-text-align: middle-center;
668
668
  }
669
- `, Ut = 13;
670
- function zt(e) {
671
- return e ? Ut : 0;
669
+ `, Pt = 13;
670
+ function _t(e) {
671
+ return e ? Pt : 0;
672
672
  }
673
- const Ft = {
673
+ const Bt = {
674
674
  measuredTextLayout: "Measured layout effect in Unity probes, 2026-10-15/16 (tests/text-cohort/unity and tests/layout/unity); auto-size grew 32x15 to 99x49 on 6000.3.25f1",
675
675
  measuredTextPaint: "Measured paint-only effect in Unity probes, 2026-10-15/16 (tests/layout/unity)",
676
676
  yoga: "A flexbox style input of Yoga, which UI Toolkit lays out with (CLAUDE.md rule 1); many are compared in the golden set",
@@ -693,10 +693,10 @@ const Ft = {
693
693
  effectInferred: "Post-processes pixels that are already drawn",
694
694
  cursor: "Pointer appearance only; nothing is drawn or laid out",
695
695
  timeInferred: "Changes values over time; a settled frame, which is what this preview draws, is unaffected"
696
- }, Pt = {
696
+ }, Wt = {
697
697
  /** Row count of each table on the date above. A test holds the data to these. */
698
698
  counts: { "6000.0": 95, "6000.3": 99, "6000.6": 102 }
699
- }, Wt = [
699
+ }, Ht = [
700
700
  ["align-content", "6000.0", !1, "layout", "layout", "yoga"],
701
701
  ["align-items", "6000.0", !1, "layout", "layout", "yoga"],
702
702
  ["align-self", "6000.0", !1, "layout", "layout", "yoga"],
@@ -801,21 +801,21 @@ const Ft = {
801
801
  ["white-space", "6000.0", !0, "layout", "layout", "measuredTextLayout"],
802
802
  ["width", "6000.0", !1, "layout", "layout", "yoga"],
803
803
  ["word-spacing", "6000.0", !0, "layout", "layout", "measuredTextLayout"]
804
- ], et = Wt.map(
805
- ([e, n, t, s, o, i]) => ({
804
+ ], st = Ht.map(
805
+ ([e, n, t, s, i, o]) => ({
806
806
  name: e,
807
807
  since: n,
808
808
  inherited: t,
809
809
  handling: s,
810
- unity: o,
811
- basis: Ft[i],
812
- inferred: i.endsWith("Inferred")
810
+ unity: i,
811
+ basis: Bt[o],
812
+ inferred: o.endsWith("Inferred")
813
813
  })
814
- ), _t = new Map(et.map((e) => [e.name, e]));
815
- function Bt(e) {
816
- return _t.get(e);
814
+ ), Vt = new Map(st.map((e) => [e.name, e]));
815
+ function qt(e) {
816
+ return Vt.get(e);
817
817
  }
818
- const Ht = {
818
+ const Jt = {
819
819
  "font-family": ["-unity-font-definition"],
820
820
  "font-weight": ["-unity-font-style"],
821
821
  "font-style": ["-unity-font-style"],
@@ -827,7 +827,7 @@ const Ht = {
827
827
  inset: ["top", "right", "bottom", "left"],
828
828
  "overflow-x": ["overflow"],
829
829
  "overflow-y": ["overflow"]
830
- }, Vt = {
830
+ }, Yt = {
831
831
  "-unity-font": "font not loaded by this preview; the browser default is used",
832
832
  "-unity-font-definition": "font not loaded by this preview; the browser default is used",
833
833
  transition: "not animated by this preview",
@@ -837,17 +837,17 @@ const Ht = {
837
837
  "transition-timing-function": "not animated by this preview",
838
838
  "animation-play-state": "not animated by this preview",
839
839
  "-unity-animation-clip": "not animated by this preview"
840
- }, qt = `6.${Object.keys(Pt.counts).sort().at(-1).slice(5)}`;
841
- function Yt(e) {
840
+ }, Kt = `6.${Object.keys(Wt.counts).sort().at(-1).slice(5)}`;
841
+ function Gt(e) {
842
842
  return `Unity 6.${e.slice(5)}+`;
843
843
  }
844
- function tt(e, n) {
844
+ function it(e, n) {
845
845
  if (e.startsWith("--")) return null;
846
- const t = Bt(e);
846
+ const t = qt(e);
847
847
  if (t === void 0) {
848
- const c = Ht[e];
848
+ const c = Jt[e];
849
849
  return {
850
- message: `${e}: not in the USS property reference up to Unity ${qt}; ignored` + (c === void 0 ? "" : `; USS uses ${c.join(", ")}`),
850
+ message: `${e}: not in the USS property reference up to Unity ${Kt}; ignored` + (c === void 0 ? "" : `; USS uses ${c.join(", ")}`),
851
851
  reason: "not-uss",
852
852
  subject: { kind: "property", property: e, value: n, ...c === void 0 ? {} : { replacements: c } }
853
853
  };
@@ -869,43 +869,43 @@ function tt(e, n) {
869
869
  return { reason: "invalid-value", message: "opacity: Unity reads 50% as 50 (fully opaque), this preview draws it half-transparent", subject: s };
870
870
  if (n.trim() === "inherit")
871
871
  return { reason: "invalid-value", message: `${e}: USS has initial but not inherit; Unity resolved color: inherit to transparent`, subject: s };
872
- const o = t.unity === "layout", i = t.since === "6000.0" ? "" : ` (${Yt(t.since)})`;
873
- return t.handling === "paint" && o ? {
874
- message: `${e}${i}: drawn, but left out of text measurement by this preview`,
872
+ const i = t.unity === "layout", o = t.since === "6000.0" ? "" : ` (${Gt(t.since)})`;
873
+ return t.handling === "paint" && i ? {
874
+ message: `${e}${o}: drawn, but left out of text measurement by this preview`,
875
875
  reason: "not-rendered",
876
- subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: o, applied: "paint" }
876
+ subject: { kind: "property", property: e, value: n, since: t.since, affectsLayout: i, applied: "paint" }
877
877
  } : t.handling !== "none" ? null : {
878
- message: `${e}${i}: ${Vt[e] ?? "not drawn by this preview"}` + (e === "filter" && /[\w-]+\(/.test(n) ? "; Unity 6000.0 stops styling from this element on" : ""),
878
+ message: `${e}${o}: ${Yt[e] ?? "not drawn by this preview"}` + (e === "filter" && /[\w-]+\(/.test(n) ? "; Unity 6000.0 stops styling from this element on" : ""),
879
879
  reason: "not-rendered",
880
880
  subject: {
881
881
  kind: "property",
882
882
  property: e,
883
883
  value: n,
884
884
  since: t.since,
885
- affectsLayout: o,
885
+ affectsLayout: i,
886
886
  // Same probes/dumps, measured 2026-10-15: filter functions poison 6000.0 only.
887
887
  ...e === "filter" && /[\w-]+\(/.test(n) ? { unityEffect: { kind: "unstyled-from-here", versions: ["6000.0"] } } : {}
888
888
  }
889
889
  };
890
890
  }
891
- const be = ["hover", "active", "inactive", "focus", "disabled", "enabled", "checked"], Jt = new Set(et.filter((e) => e.inherited).map((e) => e.name));
892
- function Gt(e) {
893
- return e.startsWith("--") || Jt.has(e);
891
+ const we = ["hover", "active", "inactive", "focus", "disabled", "enabled", "checked"], Xt = new Set(st.filter((e) => e.inherited).map((e) => e.name));
892
+ function Zt(e) {
893
+ return e.startsWith("--") || Xt.has(e);
894
894
  }
895
- function Ne(e) {
895
+ function Le(e) {
896
896
  const n = [];
897
897
  let t = 0, s = -1;
898
- for (let o = 0; o < e.length; o++) {
899
- const i = e[o];
900
- i === "(" ? t++ : i === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(i) ? s >= 0 && (n.push(e.slice(s, o)), s = -1) : s < 0 && (s = o);
898
+ for (let i = 0; i < e.length; i++) {
899
+ const o = e[i];
900
+ o === "(" ? t++ : o === ")" && (t = Math.max(0, t - 1)), t === 0 && /\s/.test(o) ? s >= 0 && (n.push(e.slice(s, i)), s = -1) : s < 0 && (s = i);
901
901
  }
902
902
  return s >= 0 && n.push(e.slice(s)), n;
903
903
  }
904
- function Kt(e) {
905
- const [n, t, s, o] = e;
906
- return n === void 0 ? null : t === void 0 ? [n, n, n, n] : s === void 0 ? [n, t, n, t] : o === void 0 ? [n, t, s, t] : [n, t, s, o];
904
+ function Qt(e) {
905
+ const [n, t, s, i] = e;
906
+ return n === void 0 ? null : t === void 0 ? [n, n, n, n] : s === void 0 ? [n, t, n, t] : i === void 0 ? [n, t, s, t] : [n, t, s, i];
907
907
  }
908
- const Xt = {
908
+ const en = {
909
909
  margin: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
910
910
  padding: ["padding-top", "padding-right", "padding-bottom", "padding-left"],
911
911
  "border-width": [
@@ -928,21 +928,21 @@ const Xt = {
928
928
  "border-bottom-left-radius"
929
929
  ]
930
930
  };
931
- function Ae(e) {
931
+ function Ue(e) {
932
932
  return /^-?(\d+\.?\d*|\.\d+)$/.test(e);
933
933
  }
934
- function Zt(e) {
934
+ function tn(e) {
935
935
  const [n, t, s] = e;
936
- return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : t === void 0 ? Ae(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : s === void 0 ? Ae(t) ? [["flex-grow", n], ["flex-shrink", t], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", t]] : [["flex-grow", n], ["flex-shrink", t], ["flex-basis", s]];
936
+ return n === void 0 ? [] : n === "none" ? [["flex-grow", "0"], ["flex-shrink", "0"], ["flex-basis", "auto"]] : n === "auto" ? [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", "auto"]] : t === void 0 ? Ue(n) ? [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", "0"]] : [["flex-grow", "1"], ["flex-shrink", "1"], ["flex-basis", n]] : s === void 0 ? Ue(t) ? [["flex-grow", n], ["flex-shrink", t], ["flex-basis", "0"]] : [["flex-grow", n], ["flex-shrink", "1"], ["flex-basis", t]] : [["flex-grow", n], ["flex-shrink", t], ["flex-basis", s]];
937
937
  }
938
- function pe(e, n) {
939
- if (e === "flex") return Zt(Ne(n));
940
- const t = Xt[e];
938
+ function me(e, n) {
939
+ if (e === "flex") return tn(Le(n));
940
+ const t = en[e];
941
941
  if (t === void 0) return [[e, n]];
942
- const s = Kt(Ne(n));
943
- return s === null ? [[e, n]] : t.map((o, i) => [o, s[i]]);
942
+ const s = Qt(Le(n));
943
+ return s === null ? [[e, n]] : t.map((i, o) => [i, s[o]]);
944
944
  }
945
- const ve = {
945
+ const xe = {
946
946
  "align-content": "flex-start",
947
947
  "align-items": "stretch",
948
948
  "align-self": "auto",
@@ -979,8 +979,8 @@ const ve = {
979
979
  "padding-right": "0",
980
980
  "padding-top": "0",
981
981
  "font-size": "12px"
982
- }, Qt = ["em", "rem", "vh", "vw", "vmin", "vmax", "pt", "cm", "in"];
983
- function B(e) {
982
+ }, nn = ["em", "rem", "vh", "vw", "vmin", "vmax", "pt", "cm", "in"];
983
+ function V(e) {
984
984
  const n = e.trim();
985
985
  if (n === "") return { length: null, problem: "empty value", reason: "invalid-value" };
986
986
  if (n === "auto") return { length: { kind: "auto" } };
@@ -991,78 +991,78 @@ function B(e) {
991
991
  const t = /^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(n);
992
992
  if (t === null)
993
993
  return { length: null, problem: `cannot read "${n}" as a length`, reason: "invalid-value" };
994
- const s = Number(t[1]), o = t[2].toLowerCase();
995
- return o === "" || o === "px" ? { length: { kind: "px", value: s } } : o === "%" ? { length: { kind: "percent", value: s } } : Qt.includes(o) ? { length: null, problem: `unit "${o}" not recognised`, code: "unsupported-unit", reason: "not-uss" } : { length: null, problem: `unknown unit "${o}"`, reason: "invalid-value" };
994
+ const s = Number(t[1]), i = t[2].toLowerCase();
995
+ return i === "" || i === "px" ? { length: { kind: "px", value: s } } : i === "%" ? { length: { kind: "percent", value: s } } : nn.includes(i) ? { length: null, problem: `unit "${i}" not recognised`, code: "unsupported-unit", reason: "not-uss" } : { length: null, problem: `unknown unit "${i}"`, reason: "invalid-value" };
996
996
  }
997
- function he(e) {
997
+ function ge(e) {
998
998
  const n = e.trim();
999
999
  return /^-?(\d+\.?\d*|\.\d+)$/.test(n) ? Number(n) : null;
1000
1000
  }
1001
- let Ee = null;
1002
- async function Pn() {
1003
- Ee ?? (Ee = await pt());
1004
- }
1005
- function Wn() {
1006
- return Ee !== null;
1007
- }
1008
- let ie = 0;
1009
- function _n() {
1010
- return ie;
1011
- }
1012
- const me = {
1013
- auto: P.Auto,
1014
- "flex-start": P.FlexStart,
1015
- center: P.Center,
1016
- "flex-end": P.FlexEnd,
1017
- stretch: P.Stretch,
1018
- baseline: P.Baseline,
1019
- "space-between": P.SpaceBetween,
1020
- "space-around": P.SpaceAround,
1021
- "space-evenly": P.SpaceEvenly
1022
- }, en = {
1023
- "flex-start": J.FlexStart,
1024
- center: J.Center,
1025
- "flex-end": J.FlexEnd,
1026
- "space-between": J.SpaceBetween,
1027
- "space-around": J.SpaceAround,
1028
- "space-evenly": J.SpaceEvenly
1029
- }, tn = {
1030
- column: ne.Column,
1031
- "column-reverse": ne.ColumnReverse,
1032
- row: ne.Row,
1033
- "row-reverse": ne.RowReverse
1034
- }, nn = {
1035
- nowrap: oe.NoWrap,
1036
- wrap: oe.Wrap,
1037
- "wrap-reverse": oe.WrapReverse
1038
- }, sn = [
1039
- ["left", te.Left],
1040
- ["top", te.Top],
1041
- ["right", te.Right],
1042
- ["bottom", te.Bottom]
1001
+ let Ie = null;
1002
+ async function Hn() {
1003
+ Ie ?? (Ie = await gt());
1004
+ }
1005
+ function Vn() {
1006
+ return Ie !== null;
1007
+ }
1008
+ let ae = 0;
1009
+ function qn() {
1010
+ return ae;
1011
+ }
1012
+ const ye = {
1013
+ auto: W.Auto,
1014
+ "flex-start": W.FlexStart,
1015
+ center: W.Center,
1016
+ "flex-end": W.FlexEnd,
1017
+ stretch: W.Stretch,
1018
+ baseline: W.Baseline,
1019
+ "space-between": W.SpaceBetween,
1020
+ "space-around": W.SpaceAround,
1021
+ "space-evenly": W.SpaceEvenly
1022
+ }, sn = {
1023
+ "flex-start": G.FlexStart,
1024
+ center: G.Center,
1025
+ "flex-end": G.FlexEnd,
1026
+ "space-between": G.SpaceBetween,
1027
+ "space-around": G.SpaceAround,
1028
+ "space-evenly": G.SpaceEvenly
1029
+ }, on = {
1030
+ column: ie.Column,
1031
+ "column-reverse": ie.ColumnReverse,
1032
+ row: ie.Row,
1033
+ "row-reverse": ie.RowReverse
1034
+ }, rn = {
1035
+ nowrap: re.NoWrap,
1036
+ wrap: re.Wrap,
1037
+ "wrap-reverse": re.WrapReverse
1038
+ }, an = [
1039
+ ["left", se.Left],
1040
+ ["top", se.Top],
1041
+ ["right", se.Right],
1042
+ ["bottom", se.Bottom]
1043
1043
  ];
1044
- function on(e, n, t, s) {
1045
- const o = Ee;
1046
- if (o === null)
1044
+ function ln(e, n, t, s) {
1045
+ const i = Ie;
1046
+ if (i === null)
1047
1047
  throw new Error("loadLayoutEngine() must be awaited before rendering");
1048
- const i = [], c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), g = [], p = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
1049
- let d = 0, m = !1, a = !1;
1050
- const b = (x, $) => {
1048
+ const o = [], c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), g = [], h = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
1049
+ let f = 0, m = !1, a = !1;
1050
+ const y = (k, $) => {
1051
1051
  var T;
1052
- return ((T = x.get($)) == null ? void 0 : T.value) ?? ve[$] ?? "";
1052
+ return ((T = k.get($)) == null ? void 0 : T.value) ?? xe[$] ?? "";
1053
1053
  };
1054
- function r(x, $, T, I) {
1054
+ function r(k, $, T, I) {
1055
1055
  var O;
1056
- (I == null ? void 0 : I.origin.kind) !== "inherited" && i.push({
1056
+ (I == null ? void 0 : I.origin.kind) !== "inherited" && o.push({
1057
1057
  kind: "unsupported-property",
1058
- message: x,
1058
+ message: k,
1059
1059
  node: $.id,
1060
1060
  ...T,
1061
1061
  ...I === void 0 ? {} : ((O = s.locate) == null ? void 0 : O.call(s, I.origin)) ?? {}
1062
1062
  });
1063
1063
  }
1064
- function w(x, $, T, I, O, D) {
1065
- const C = x.get($), R = D && (C == null ? void 0 : C.origin.kind) === "inline";
1064
+ function w(k, $, T, I, O, D) {
1065
+ const M = k.get($), R = D && (M == null ? void 0 : M.origin.kind) === "inline";
1066
1066
  r(
1067
1067
  `${$}: ${I}${R ? "; Unity drops every inline style in that UXML file" : ""}`,
1068
1068
  T,
@@ -1071,308 +1071,317 @@ function on(e, n, t, s) {
1071
1071
  subject: {
1072
1072
  kind: "property",
1073
1073
  property: $,
1074
- value: b(x, $),
1074
+ value: y(k, $),
1075
1075
  ...R ? { unityEffect: { kind: "file-inline-dropped", versions: ["6000.0", "6000.3"] } } : {}
1076
1076
  }
1077
1077
  },
1078
- C
1078
+ M
1079
1079
  );
1080
1080
  }
1081
- function y(x, $, T) {
1082
- const I = b(x, $);
1081
+ function b(k, $, T) {
1082
+ const I = y(k, $);
1083
1083
  if (I === "") return null;
1084
- const { length: O, problem: D, reason: C, code: R } = B(I);
1085
- return D !== void 0 && w(x, $, T, D, C, R === "unsupported-unit"), O;
1084
+ const { length: O, problem: D, reason: M, code: R } = V(I);
1085
+ return D !== void 0 && w(k, $, T, D, M, R === "unsupported-unit"), O;
1086
1086
  }
1087
- function h(x) {
1088
- if (x !== null)
1089
- switch (x.kind) {
1087
+ function p(k) {
1088
+ if (k !== null)
1089
+ switch (k.kind) {
1090
1090
  case "px":
1091
- return x.value;
1091
+ return k.value;
1092
1092
  case "percent":
1093
- return `${x.value}%`;
1093
+ return `${k.value}%`;
1094
1094
  case "auto":
1095
1095
  return "auto";
1096
1096
  case "none":
1097
1097
  return;
1098
1098
  }
1099
1099
  }
1100
- function f(x) {
1101
- if (x !== null) {
1102
- if (x.kind === "px") return x.value;
1103
- if (x.kind === "percent") return `${x.value}%`;
1100
+ function d(k) {
1101
+ if (k !== null) {
1102
+ if (k.kind === "px") return k.value;
1103
+ if (k.kind === "percent") return `${k.value}%`;
1104
1104
  }
1105
1105
  }
1106
- function k(x, $, T) {
1107
- x.setBoxSizing(ht.BorderBox), x.setFlexDirection(tn[b($, "flex-direction")] ?? ne.Column), x.setFlexWrap(nn[b($, "flex-wrap")] ?? oe.NoWrap), x.setJustifyContent(en[b($, "justify-content")] ?? J.FlexStart), x.setAlignItems(me[b($, "align-items")] ?? P.Stretch), x.setAlignSelf(me[b($, "align-self")] ?? P.Auto), x.setAlignContent(me[b($, "align-content")] ?? P.FlexStart), x.setFlexGrow(he(b($, "flex-grow")) ?? 0), x.setFlexShrink(he(b($, "flex-shrink")) ?? 1), x.setFlexBasis(h(y($, "flex-basis", T)));
1108
- const I = b($, "position");
1106
+ function x(k, $, T) {
1107
+ k.setBoxSizing(yt.BorderBox), k.setFlexDirection(on[y($, "flex-direction")] ?? ie.Column), k.setFlexWrap(rn[y($, "flex-wrap")] ?? re.NoWrap), k.setJustifyContent(sn[y($, "justify-content")] ?? G.FlexStart), k.setAlignItems(ye[y($, "align-items")] ?? W.Stretch), k.setAlignSelf(ye[y($, "align-self")] ?? W.Auto), k.setAlignContent(ye[y($, "align-content")] ?? W.FlexStart), k.setFlexGrow(ge(y($, "flex-grow")) ?? 0), k.setFlexShrink(ge(y($, "flex-shrink")) ?? 1), k.setFlexBasis(p(b($, "flex-basis", T)));
1108
+ const I = y($, "position");
1109
1109
  (I === "fixed" || I === "sticky") && r(`position: ${I} treated as relative`, T, {
1110
1110
  reason: "not-uss",
1111
1111
  subject: { kind: "property", property: "position", value: I }
1112
- }, $.get("position")), x.setPositionType(
1113
- I === "absolute" ? ue.Absolute : ue.Relative
1112
+ }, $.get("position")), k.setPositionType(
1113
+ I === "absolute" ? fe.Absolute : fe.Relative
1114
1114
  );
1115
- const O = b($, "display");
1116
- O === "none" ? x.setDisplay(mt.None) : O !== "flex" && O !== "initial" && r(`display: ${O} laid out as flex`, T, {
1115
+ const O = y($, "display");
1116
+ O === "none" ? k.setDisplay(bt.None) : O !== "flex" && O !== "initial" && r(`display: ${O} laid out as flex`, T, {
1117
1117
  reason: "invalid-value",
1118
1118
  subject: { kind: "property", property: "display", value: O }
1119
1119
  }, $.get("display"));
1120
- const D = b($, "overflow");
1121
- D === "hidden" ? x.setOverflow(gt.Hidden) : (D === "auto" || D === "scroll") && r(`overflow: ${D} ignored; nothing scrolls`, T, {
1120
+ const D = y($, "overflow");
1121
+ D === "hidden" ? k.setOverflow(vt.Hidden) : (D === "auto" || D === "scroll") && r(`overflow: ${D} ignored; nothing scrolls`, T, {
1122
1122
  reason: "not-uss",
1123
1123
  subject: { kind: "property", property: "overflow", value: D }
1124
- }, $.get("overflow")), x.setWidth(h(y($, "width", T))), x.setHeight(h(y($, "height", T)));
1125
- const C = b($, "aspect-ratio").trim();
1126
- if (C !== "auto" && C !== "initial") {
1127
- const R = he(C);
1128
- R !== null && Number.isFinite(R) ? x.setAspectRatio(R) : w($, "aspect-ratio", T, `cannot read "${C}" as a number`, "invalid-value", !0);
1124
+ }, $.get("overflow")), k.setWidth(p(b($, "width", T))), k.setHeight(p(b($, "height", T)));
1125
+ const M = y($, "aspect-ratio").trim();
1126
+ if (M !== "auto" && M !== "initial") {
1127
+ const R = ge(M);
1128
+ R !== null && Number.isFinite(R) ? k.setAspectRatio(R) : w($, "aspect-ratio", T, `cannot read "${M}" as a number`, "invalid-value", !0);
1129
1129
  }
1130
- x.setMinWidth(f(y($, "min-width", T))), x.setMinHeight(f(y($, "min-height", T))), x.setMaxWidth(f(y($, "max-width", T))), x.setMaxHeight(f(y($, "max-height", T)));
1131
- for (const [R, L] of sn) {
1132
- x.setMargin(L, f(y($, `margin-${R}`, T))), x.setPadding(L, f(y($, `padding-${R}`, T)));
1133
- const U = f(y($, `border-${R}-width`, T));
1134
- x.setBorder(L, typeof U == "number" ? U : void 0), x.setPosition(L, f(y($, R, T)));
1130
+ k.setMinWidth(d(b($, "min-width", T))), k.setMinHeight(d(b($, "min-height", T))), k.setMaxWidth(d(b($, "max-width", T))), k.setMaxHeight(d(b($, "max-height", T)));
1131
+ for (const [R, F] of an) {
1132
+ k.setMargin(F, d(b($, `margin-${R}`, T))), k.setPadding(F, d(b($, `padding-${R}`, T)));
1133
+ const L = d(b($, `border-${R}-width`, T));
1134
+ k.setBorder(F, typeof L == "number" ? L : void 0), k.setPosition(F, d(b($, R, T)));
1135
1135
  }
1136
1136
  }
1137
- function v(x) {
1137
+ function v(k) {
1138
1138
  var T;
1139
- const $ = (T = x.attributes.find((I) => I.name === "text")) == null ? void 0 : T.value;
1140
- return $ === void 0 ? void 0 : Z($);
1139
+ const $ = (T = k.attributes.find((I) => I.name === "text")) == null ? void 0 : T.value;
1140
+ return $ === void 0 ? void 0 : ee($);
1141
1141
  }
1142
1142
  const S = ["text", "label"];
1143
- function E(x) {
1143
+ function E(k) {
1144
1144
  return S.filter(
1145
- ($) => x.attributes.some((T) => T.name === $ && T.value.length > 0)
1145
+ ($) => k.attributes.some((T) => T.name === $ && T.value.length > 0)
1146
1146
  );
1147
1147
  }
1148
- let M = !1;
1149
- function A(x, $) {
1150
- var U;
1151
- if (ye(x)) {
1152
- x.name.local === "Bindings" && !M && (M = !0, i.push({
1148
+ let C = !1;
1149
+ function A(k, $) {
1150
+ var z, Me;
1151
+ if (ve(k)) {
1152
+ k.name.local === "Bindings" && !C && (C = !0, o.push({
1153
1153
  kind: "unsupported-control",
1154
1154
  message: "Data bindings are not evaluated in this preview; bound values show as written",
1155
- node: x.id,
1155
+ node: k.id,
1156
1156
  reason: "not-rendered",
1157
1157
  subject: { kind: "control", type: "Bindings" }
1158
1158
  }));
1159
1159
  return;
1160
1160
  }
1161
- const T = n.get(x.id) ?? /* @__PURE__ */ new Map(), I = o.Node.create();
1162
- d++, ie++, p.set(x, I), g.push(x), k(I, T, x), $ !== null && $.insertChild(I, $.getChildCount());
1163
- const { spec: O, fallback: D } = X(x), C = v(x), R = O.hasText && C !== void 0 && C.length > 0;
1161
+ const T = n.get(k.id) ?? /* @__PURE__ */ new Map(), I = i.Node.create();
1162
+ f++, ae++, h.set(k, I), g.push(k), x(I, T, k), $ !== null && $.insertChild(I, $.getChildCount());
1163
+ const { spec: O, fallback: D } = Q(k), M = v(k), R = O.hasText && M !== void 0 && M.length > 0;
1164
1164
  if (D) {
1165
- const N = E(x);
1166
- i.push({
1165
+ const j = E(k);
1166
+ o.push({
1167
1167
  kind: "unsupported-control",
1168
- message: `<${x.name.local}> has no renderer in this version and is drawn as a plain VisualElement` + (N.length === 0 ? "" : `; its ${N.join(" and ")} attribute${N.length > 1 ? "s are" : " is"} not drawn`),
1169
- node: x.id,
1168
+ message: `<${k.name.local}> has no renderer in this version and is drawn as a plain VisualElement` + (j.length === 0 ? "" : `; its ${j.join(" and ")} attribute${j.length > 1 ? "s are" : " is"} not drawn`),
1169
+ node: k.id,
1170
1170
  reason: "not-rendered",
1171
- subject: { kind: "control", type: x.name.local }
1171
+ subject: { kind: "control", type: k.name.local }
1172
1172
  });
1173
1173
  }
1174
- if (R && !T.has("-unity-font-definition") && !T.has("-unity-font")) {
1175
- const N = /[\u1100-\u11ff\u3130-\u318f\uac00-\ud7af\u3400-\u4dbf\u4e00-\u9fff\u3040-\u30ff]/u.exec(C);
1176
- if (N !== null) {
1177
- const j = N[0].codePointAt(0), W = j >= 12352 && j <= 12543 ? "kana" : j >= 13312 && j <= 19903 || j >= 19968 && j <= 40959 ? "han" : "hangul", _ = { hangul: "Hangul", han: "Han (CJK ideographs)", kana: "Kana" }[W];
1178
- i.push({
1174
+ const F = ((z = k.attributes.find((j) => j.name === "enable-rich-text")) == null ? void 0 : z.value) ?? "", L = /<\/?(?:a|align|allcaps|alpha|b|br|color|cspace|font|font-weight|gradient|i|indent|line-height|line-indent|lowercase|margin|mark|mspace|nobr|noparse|pos|s|size|smallcaps|space|sprite|style|sub|sup|u|uppercase|voffset|width|link)(?:[=\s][^<>]*)?>/i;
1175
+ if (R && F.trim().toLowerCase() !== "false" && L.test(M) && o.push({
1176
+ kind: "unsupported-property",
1177
+ reason: "not-rendered",
1178
+ node: k.id,
1179
+ message: 'Unity interprets rich text tags here (enable-rich-text is on by default), while this preview draws them as plain characters, so size and position can differ. Use enable-rich-text="false" only if you want literal tags.',
1180
+ subject: { kind: "property", property: "enable-rich-text", value: F, affectsLayout: !0 }
1181
+ }), R && !T.has("-unity-font-definition") && !T.has("-unity-font")) {
1182
+ const j = /[\u1100-\u11ff\u3130-\u318f\uac00-\ud7af\u3400-\u4dbf\u4e00-\u9fff\u3040-\u30ff]/u.exec(M);
1183
+ if (j !== null) {
1184
+ const _ = j[0].codePointAt(0), B = _ >= 12352 && _ <= 12543 ? "kana" : _ >= 13312 && _ <= 19903 || _ >= 19968 && _ <= 40959 ? "han" : "hangul", H = { hangul: "Hangul", han: "Han (CJK ideographs)", kana: "Kana" }[B];
1185
+ o.push({
1179
1186
  kind: "unsupported-property",
1180
1187
  reason: "font-fallback",
1181
- node: x.id,
1182
- message: `The editor default font (Inter-Regular SDF) has no glyphs for ${_}; Unity draws it with a fallback font whose height can differ (measured 1–4px taller).`,
1183
- subject: { kind: "property", property: "-unity-font-definition", value: "", affectsLayout: !0, missingGlyphs: W }
1188
+ node: k.id,
1189
+ message: `The editor default font (Inter-Regular SDF) has no glyphs for ${H}; Unity draws it with a fallback font whose height can differ (measured 1–4px taller).` + (B === "hangul" ? "" : " Unity's box width was measured 6–87px narrower than this preview's (10–32px font sizes); this preview's width depends on the device's fallback font."),
1190
+ subject: { kind: "property", property: "-unity-font-definition", value: "", affectsLayout: !0, missingGlyphs: B }
1184
1191
  });
1185
1192
  }
1186
1193
  }
1187
1194
  if (R) {
1188
- x.children.some((_) => !ye(_)) && r(
1189
- `<${x.name.local}> has both a text attribute and children; children are not drawn`,
1190
- x,
1191
- { reason: "not-rendered", subject: { kind: "control", type: x.name.local } }
1195
+ k.children.some((H) => !ve(H)) && r(
1196
+ `<${k.name.local}> has both a text attribute and children; children are not drawn`,
1197
+ k,
1198
+ { reason: "not-rendered", subject: { kind: "control", type: k.name.local } }
1192
1199
  );
1193
- const N = y(T, "font-size", x), j = {
1194
- fontSize: N !== null && N.kind === "px" ? N.value : 12,
1195
- fontStyle: b(T, "-unity-font-style") || "normal",
1196
- whiteSpace: b(T, "white-space") || "normal",
1197
- textGenerator: b(T, "-unity-text-generator") === "standard" ? "standard" : "advanced"
1198
- }, W = (U = s.fonts) == null ? void 0 : U.get(T);
1199
- W !== void 0 && (j.fontFamily = W.family, W.faceInfo !== void 0 && (j.faceInfo = W.faceInfo));
1200
- for (const [_, se] of [
1200
+ const j = b(T, "font-size", k), _ = {
1201
+ fontSize: j !== null && j.kind === "px" ? j.value : 12,
1202
+ fontStyle: y(T, "-unity-font-style") || "normal",
1203
+ whiteSpace: y(T, "white-space") || "normal",
1204
+ textGenerator: y(T, "-unity-text-generator") === "standard" ? "standard" : "advanced"
1205
+ }, B = (Me = s.fonts) == null ? void 0 : Me.get(T);
1206
+ B !== void 0 && (_.fontFamily = B.family, B.faceInfo !== void 0 && (_.faceInfo = B.faceInfo));
1207
+ for (const [H, oe] of [
1201
1208
  ["letter-spacing", "letterSpacing"],
1202
1209
  ["word-spacing", "wordSpacing"],
1203
1210
  ["-unity-paragraph-spacing", "paragraphSpacing"]
1204
1211
  ]) {
1205
- const H = y(T, _, x);
1206
- (H == null ? void 0 : H.kind) === "px" && (j[se] = H.value);
1212
+ const q = b(T, H, k);
1213
+ (q == null ? void 0 : q.kind) === "px" && (_[oe] = q.value);
1207
1214
  }
1208
1215
  I.setMeasureFunc(
1209
- (_) => s.measureText(
1210
- C,
1211
- j,
1212
- Number.isFinite(_) ? _ : 0
1216
+ (H) => s.measureText(
1217
+ M,
1218
+ _,
1219
+ Number.isFinite(H) ? H : 0
1213
1220
  )
1214
1221
  );
1215
1222
  return;
1216
1223
  }
1217
- let L = I;
1224
+ let U = I;
1218
1225
  if (O.parts.length > 0) {
1219
- a || (a = !0, i.push({
1226
+ a || (a = !0, o.push({
1220
1227
  kind: "version-dependent",
1221
- message: `<${x.name.local}> drawn with built-in child elements measured on Unity ${ae}`,
1222
- node: x.id,
1228
+ message: `<${k.name.local}> drawn with built-in child elements measured on Unity ${ce}`,
1229
+ node: k.id,
1223
1230
  reason: "version-dependent",
1224
- subject: { kind: "control", type: x.name.local }
1231
+ subject: { kind: "control", type: k.name.local }
1225
1232
  }));
1226
- const N = [], j = [], W = t.get(x.id);
1227
- for (const _ of O.parts) {
1228
- const se = (W == null ? void 0 : W.get(_.name)) ?? /* @__PURE__ */ new Map(), H = o.Node.create();
1229
- d++, ie++, k(H, se, x), L.insertChild(H, L.getChildCount()), L = H, j.push(H), N.push({
1230
- name: _.name,
1231
- owner: x.id,
1233
+ const j = [], _ = [], B = t.get(k.id);
1234
+ for (const H of O.parts) {
1235
+ const oe = (B == null ? void 0 : B.get(H.name)) ?? /* @__PURE__ */ new Map(), q = i.Node.create();
1236
+ f++, ae++, x(q, oe, k), U.insertChild(q, U.getChildCount()), U = q, _.push(q), j.push({
1237
+ name: H.name,
1238
+ owner: k.id,
1232
1239
  box: { left: 0, top: 0, width: 0, height: 0 },
1233
- style: se
1240
+ style: oe
1234
1241
  });
1235
1242
  }
1236
- u.set(x.id, N), l.set(x.id, j);
1243
+ u.set(k.id, j), l.set(k.id, _);
1237
1244
  }
1238
- for (const N of x.children) A(N, L);
1245
+ for (const j of k.children) A(j, U);
1239
1246
  }
1240
1247
  A(e, null);
1241
- const z = p.get(e);
1242
- z.setWidth(s.size.width), z.setHeight(s.size.height), z.setPositionType(ue.Relative), z.calculateLayout(s.size.width, s.size.height, De.LTR);
1243
- const q = /* @__PURE__ */ new Map();
1244
- for (let x = 0; x < 3; x++) {
1248
+ const N = h.get(e);
1249
+ N.setWidth(s.size.width), N.setHeight(s.size.height), N.setPositionType(fe.Relative), N.calculateLayout(s.size.width, s.size.height, Re.LTR);
1250
+ const Y = /* @__PURE__ */ new Map();
1251
+ for (let k = 0; k < 3; k++) {
1245
1252
  let $ = !1;
1246
1253
  for (const [T, I] of u) {
1247
1254
  const O = l.get(T);
1248
1255
  if (O === void 0) continue;
1249
- const D = I.findIndex((j) => j.name === "unity-content-viewport"), C = I.findIndex((j) => j.name === "unity-content-container");
1250
- if (D === -1 || C === -1) continue;
1251
- const R = O[D].getComputedLayout(), U = O[C].getComputedLayout().height > R.height + 0.01, N = zt(U);
1252
- (q.get(T) ?? 0) !== N && (q.set(T, N), O[D].setMargin(te.Right, N), $ = !0);
1256
+ const D = I.findIndex((z) => z.name === "unity-content-viewport"), M = I.findIndex((z) => z.name === "unity-content-container");
1257
+ if (D === -1 || M === -1) continue;
1258
+ const R = O[D].getComputedLayout(), L = O[M].getComputedLayout().height > R.height + 0.01, U = _t(L);
1259
+ (Y.get(T) ?? 0) !== U && (Y.set(T, U), O[D].setMargin(se.Right, U), $ = !0);
1253
1260
  }
1254
1261
  if (!$) break;
1255
- z.calculateLayout(s.size.width, s.size.height, De.LTR);
1262
+ N.calculateLayout(s.size.width, s.size.height, Re.LTR);
1256
1263
  }
1257
- function Q(x, $, T) {
1258
- const I = p.get(x);
1264
+ function te(k, $, T) {
1265
+ const I = h.get(k);
1259
1266
  if (I === void 0) return;
1260
1267
  const O = I.getComputedLayout();
1261
- let D = $ + O.left, C = T + O.top;
1262
- c.set(x.id, { left: D, top: C, width: O.width, height: O.height });
1263
- const R = u.get(x.id), L = l.get(x.id);
1264
- R !== void 0 && L !== void 0 && R.forEach((U, N) => {
1265
- const j = L[N].getComputedLayout();
1266
- D += j.left, C += j.top, U.box = { left: D, top: C, width: j.width, height: j.height };
1268
+ let D = $ + O.left, M = T + O.top;
1269
+ c.set(k.id, { left: D, top: M, width: O.width, height: O.height });
1270
+ const R = u.get(k.id), F = l.get(k.id);
1271
+ R !== void 0 && F !== void 0 && R.forEach((L, U) => {
1272
+ const z = F[U].getComputedLayout();
1273
+ D += z.left, M += z.top, L.box = { left: D, top: M, width: z.width, height: z.height };
1267
1274
  });
1268
- for (const U of x.children) Q(U, D, C);
1275
+ for (const L of k.children) te(L, D, M);
1269
1276
  }
1270
- return Q(e, 0, 0), {
1277
+ return te(e, 0, 0), {
1271
1278
  boxes: c,
1272
1279
  parts: u,
1273
1280
  painted: g,
1274
- warnings: i,
1281
+ warnings: o,
1275
1282
  dispose() {
1276
- m || (m = !0, z.freeRecursive(), ie -= d, p.clear(), l.clear());
1283
+ m || (m = !0, N.freeRecursive(), ae -= f, h.clear(), l.clear());
1277
1284
  }
1278
1285
  };
1279
1286
  }
1280
- const rn = {
1287
+ const cn = {
1281
1288
  pointSize: 90,
1282
1289
  ascentLine: 87.1875,
1283
1290
  descentLine: -21.73295,
1284
1291
  lineHeight: 108.9205
1285
1292
  };
1286
- function an(e, n, t, s = 0, o = 0) {
1287
- return Math.ceil(e * n * (t.ascentLine - t.descentLine) / t.pointSize + s * o * n / 100);
1293
+ function un(e, n, t, s = 0, i = 0) {
1294
+ return Math.ceil(e * n * (t.ascentLine - t.descentLine) / t.pointSize + s * i * n / 100);
1288
1295
  }
1289
- function nt(e) {
1296
+ function ot(e) {
1290
1297
  return e === void 0 ? "sans-serif" : `${JSON.stringify(e)}, sans-serif`;
1291
1298
  }
1292
- function ln(e) {
1299
+ const dn = /((?![\uFFA0-\uFFDC])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\u3000-\u303F\u30FC\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u{20000}-\u{3FFFF}])/u;
1300
+ function fn(e) {
1293
1301
  var t;
1294
1302
  let n = null;
1295
1303
  if (e !== void 0) {
1296
1304
  const s = e.createElement("canvas");
1297
1305
  n = ((t = s.getContext) == null ? void 0 : t.call(s, "2d")) ?? null;
1298
1306
  }
1299
- return (s, o, i) => {
1300
- const c = o.fontStyle.includes("bold") ? "bold" : "normal", u = o.fontStyle.includes("italic") ? "italic" : "normal", g = (r) => {
1301
- n !== null && (n.font = `${u} ${c} ${r}px ${nt(o.fontFamily)}`);
1307
+ return (s, i, o) => {
1308
+ const c = i.fontStyle.includes("bold") ? "bold" : "normal", u = i.fontStyle.includes("italic") ? "italic" : "normal", g = (r) => {
1309
+ n !== null && (n.font = `${u} ${c} ${r}px ${ot(i.fontFamily)}`);
1302
1310
  };
1303
- let p = o.faceInfo;
1304
- if (p === void 0 && o.fontFamily !== void 0 && n !== null) {
1311
+ let h = i.faceInfo;
1312
+ if (h === void 0 && i.fontFamily !== void 0 && n !== null) {
1305
1313
  g(90);
1306
1314
  const r = n.measureText("Mg");
1307
- Number.isFinite(r.fontBoundingBoxAscent) && Number.isFinite(r.fontBoundingBoxDescent) && (p = { pointSize: 90, ascentLine: r.fontBoundingBoxAscent, descentLine: -r.fontBoundingBoxDescent });
1315
+ Number.isFinite(r.fontBoundingBoxAscent) && Number.isFinite(r.fontBoundingBoxDescent) && (h = { pointSize: 90, ascentLine: r.fontBoundingBoxAscent, descentLine: -r.fontBoundingBoxDescent });
1308
1316
  }
1309
- g(o.fontSize);
1317
+ g(i.fontSize);
1310
1318
  const l = (r) => {
1311
- const w = [...r].length, y = [...r].filter((k) => k === " ").length, h = Math.max(0, w - 1 - (o.textGenerator === "standard" ? 0 : y));
1312
- return (n === null ? w * o.fontSize * 0.5 : n.measureText(r).width) + (h * (o.letterSpacing ?? 0) + y * (o.wordSpacing ?? 0)) * o.fontSize / 100;
1313
- }, d = s.split(`
1314
- `).map((r) => o.whiteSpace === "pre" || o.whiteSpace === "pre-wrap" ? r : r.replace(/ +/g, " ").trim()), m = o.whiteSpace !== "nowrap" && o.whiteSpace !== "pre" && i > 0;
1315
- let a = 0, b = 0;
1316
- for (const r of d) {
1319
+ const w = [...r].length, b = [...r].filter((x) => x === " ").length, p = Math.max(0, w - 1 - (i.textGenerator === "standard" ? 0 : b));
1320
+ return (n === null ? w * i.fontSize * 0.5 : n.measureText(r).width) + (p * (i.letterSpacing ?? 0) + b * (i.wordSpacing ?? 0)) * i.fontSize / 100;
1321
+ }, f = s.split(`
1322
+ `).map((r) => i.whiteSpace === "pre" || i.whiteSpace === "pre-wrap" ? r : r.replace(/ +/g, " ").trim()), m = i.whiteSpace !== "nowrap" && i.whiteSpace !== "pre" && o > 0;
1323
+ let a = 0, y = 0;
1324
+ for (const r of f) {
1317
1325
  let w = "";
1318
1326
  if (a++, !m) {
1319
- b = Math.max(b, l(r));
1327
+ y = Math.max(y, l(r));
1320
1328
  continue;
1321
1329
  }
1322
- for (const y of r.split(/\s+/).filter((h) => h.length > 0)) {
1323
- const h = w === "" ? y : `${w} ${y}`;
1324
- w !== "" && l(h) > i ? (b = Math.max(b, l(w)), a++, w = y) : w = h;
1330
+ const b = r.split(/\s+/).filter((p) => p.length > 0).flatMap((p) => p.split(dn).filter((d) => d.length > 0).map((d, x) => ({ value: d, separator: x === 0 ? " " : "" })));
1331
+ for (const { value: p, separator: d } of b) {
1332
+ const x = w === "" ? p : `${w}${d}${p}`;
1333
+ w !== "" && l(x) > o ? (y = Math.max(y, l(w)), a++, w = p) : w = x;
1325
1334
  }
1326
- b = Math.max(b, l(w));
1335
+ y = Math.max(y, l(w));
1327
1336
  }
1328
- return { width: b, height: an(
1337
+ return { width: y, height: un(
1329
1338
  a,
1330
- o.fontSize,
1331
- p ?? rn,
1332
- d.length - 1,
1333
- o.paragraphSpacing ?? 0
1339
+ i.fontSize,
1340
+ h ?? cn,
1341
+ f.length - 1,
1342
+ i.paragraphSpacing ?? 0
1334
1343
  ) };
1335
1344
  };
1336
1345
  }
1337
- const cn = ["top", "right", "bottom", "left"], un = {
1346
+ const pn = ["top", "right", "bottom", "left"], hn = {
1338
1347
  normal: { weight: "normal", style: "normal" },
1339
1348
  bold: { weight: "bold", style: "normal" },
1340
1349
  italic: { weight: "normal", style: "italic" },
1341
1350
  "bold-and-italic": { weight: "bold", style: "italic" }
1342
- }, dn = {
1351
+ }, mn = {
1343
1352
  upper: "flex-start",
1344
1353
  middle: "center",
1345
1354
  lower: "flex-end"
1346
- }, fn = {
1355
+ }, gn = {
1347
1356
  left: "flex-start",
1348
1357
  center: "center",
1349
1358
  right: "flex-end"
1350
- }, ge = {
1359
+ }, be = {
1351
1360
  "stretch-to-fill": "100% 100%",
1352
1361
  "scale-and-crop": "cover",
1353
1362
  "scale-to-fit": "contain"
1354
- }, Le = "stretch-to-fill";
1355
- function st(e) {
1356
- const n = /^(url|resource)\(\s*(["']?)(.*?)\2\s*\)$/.exec(Z(e).trim());
1363
+ }, ze = "stretch-to-fill";
1364
+ function rt(e) {
1365
+ const n = /^(url|resource)\(\s*(["']?)(.*?)\2\s*\)$/.exec(ee(e).trim());
1357
1366
  return n === null ? null : { form: n[1], path: n[3] };
1358
1367
  }
1359
- function Ue(e, n, t = {}) {
1360
- var h;
1361
- const s = {}, o = [], i = (f) => {
1362
- var k;
1363
- return (k = e.get(f)) == null ? void 0 : k.value;
1364
- }, c = (f, k, v = {}) => {
1365
- var M, A, z;
1366
- const S = ((M = v.subject) == null ? void 0 : M.kind) === "property" ? v.subject.property : ((A = v.subject) == null ? void 0 : A.kind) === "asset" ? "background-image" : void 0, E = S === void 0 ? void 0 : e.get(S);
1367
- (E == null ? void 0 : E.origin.kind) !== "inherited" && o.push({
1368
- kind: f,
1369
- message: k,
1368
+ function Pe(e, n, t = {}) {
1369
+ var p;
1370
+ const s = {}, i = [], o = (d) => {
1371
+ var x;
1372
+ return (x = e.get(d)) == null ? void 0 : x.value;
1373
+ }, c = (d, x, v = {}) => {
1374
+ var C, A, N;
1375
+ const S = ((C = v.subject) == null ? void 0 : C.kind) === "property" ? v.subject.property : ((A = v.subject) == null ? void 0 : A.kind) === "asset" ? "background-image" : void 0, E = S === void 0 ? void 0 : e.get(S);
1376
+ (E == null ? void 0 : E.origin.kind) !== "inherited" && i.push({
1377
+ kind: d,
1378
+ message: x,
1370
1379
  node: n,
1371
1380
  ...v,
1372
- ...E === void 0 ? {} : ((z = t.locate) == null ? void 0 : z.call(t, E.origin)) ?? {}
1381
+ ...E === void 0 ? {} : ((N = t.locate) == null ? void 0 : N.call(t, E.origin)) ?? {}
1373
1382
  });
1374
- }, u = (f, k = i(f)) => ({
1375
- subject: { kind: "property", property: f, ...k === void 0 ? {} : { value: k } }
1383
+ }, u = (d, x = o(d)) => ({
1384
+ subject: { kind: "property", property: d, ...x === void 0 ? {} : { value: x } }
1376
1385
  });
1377
1386
  s["box-sizing"] = "border-box";
1378
1387
  const g = [
@@ -1386,174 +1395,174 @@ function Ue(e, n, t = {}) {
1386
1395
  "font-size",
1387
1396
  "transform-origin"
1388
1397
  ];
1389
- for (const f of g) {
1390
- const k = i(f);
1391
- k !== void 0 && (s[f] = k);
1392
- }
1393
- const p = B(i("font-size") ?? "12px").length, l = (p == null ? void 0 : p.kind) === "px" ? p.value : 12;
1394
- for (const f of ["letter-spacing", "word-spacing"]) {
1395
- const k = B(i(f) ?? "").length;
1396
- (k == null ? void 0 : k.kind) === "px" && (s[f] = `${k.value * l / 100}px`);
1397
- }
1398
- i("display") === "none" && (s.display = "none"), i("overflow") === "hidden" && (s.overflow = "hidden");
1399
- for (const f of cn) {
1400
- const k = i(`border-${f}-width`);
1401
- if (k !== void 0 && k !== "0") {
1402
- const { length: E, problem: M } = B(k);
1403
- E === null || E.kind !== "px" ? M === void 0 && c(
1398
+ for (const d of g) {
1399
+ const x = o(d);
1400
+ x !== void 0 && (s[d] = x);
1401
+ }
1402
+ const h = V(o("font-size") ?? "12px").length, l = (h == null ? void 0 : h.kind) === "px" ? h.value : 12;
1403
+ for (const d of ["letter-spacing", "word-spacing"]) {
1404
+ const x = V(o(d) ?? "").length;
1405
+ (x == null ? void 0 : x.kind) === "px" && (s[d] = `${x.value * l / 100}px`);
1406
+ }
1407
+ o("display") === "none" && (s.display = "none"), o("overflow") === "hidden" && (s.overflow = "hidden");
1408
+ for (const d of pn) {
1409
+ const x = o(`border-${d}-width`);
1410
+ if (x !== void 0 && x !== "0") {
1411
+ const { length: E, problem: C } = V(x);
1412
+ E === null || E.kind !== "px" ? C === void 0 && c(
1404
1413
  "unsupported-property",
1405
- `border-${f}-width: "${k}" is not a pixel length; ignored`,
1406
- { reason: "invalid-value", ...u(`border-${f}-width`) }
1407
- ) : (s[`border-${f}-width`] = `${E.value}px`, s[`border-${f}-style`] = "solid");
1414
+ `border-${d}-width: "${x}" is not a pixel length; ignored`,
1415
+ { reason: "invalid-value", ...u(`border-${d}-width`) }
1416
+ ) : (s[`border-${d}-width`] = `${E.value}px`, s[`border-${d}-style`] = "solid");
1408
1417
  }
1409
- const v = i(`border-${f}-color`);
1410
- v !== void 0 && (s[`border-${f}-color`] = v);
1411
- const S = i(`padding-${f}`);
1412
- S !== void 0 && S !== "0" && (s[`padding-${f}`] = S);
1418
+ const v = o(`border-${d}-color`);
1419
+ v !== void 0 && (s[`border-${d}-color`] = v);
1420
+ const S = o(`padding-${d}`);
1421
+ S !== void 0 && S !== "0" && (s[`padding-${d}`] = S);
1413
1422
  }
1414
- for (const f of [
1423
+ for (const d of [
1415
1424
  "top-left",
1416
1425
  "top-right",
1417
1426
  "bottom-right",
1418
1427
  "bottom-left"
1419
1428
  ]) {
1420
- const k = i(`border-${f}-radius`);
1421
- k !== void 0 && (s[`border-${f}-radius`] = k);
1429
+ const x = o(`border-${d}-radius`);
1430
+ x !== void 0 && (s[`border-${d}-radius`] = x);
1422
1431
  }
1423
- const d = i("-unity-font-style");
1424
- if (d !== void 0) {
1425
- const f = un[d];
1426
- f === void 0 ? c("unsupported-property", `-unity-font-style: "${d}" ignored`, {
1432
+ const f = o("-unity-font-style");
1433
+ if (f !== void 0) {
1434
+ const d = hn[f];
1435
+ d === void 0 ? c("unsupported-property", `-unity-font-style: "${f}" ignored`, {
1427
1436
  reason: "invalid-value",
1428
1437
  ...u("-unity-font-style")
1429
- }) : (s["font-weight"] = f.weight, s["font-style"] = f.style);
1438
+ }) : (s["font-weight"] = d.weight, s["font-style"] = d.style);
1430
1439
  }
1431
- const m = i("-unity-text-align");
1440
+ const m = o("-unity-text-align");
1432
1441
  if (m !== void 0) {
1433
- const [f, k] = m.split("-"), v = dn[f ?? ""], S = fn[k ?? ""];
1442
+ const [d, x] = m.split("-"), v = mn[d ?? ""], S = gn[x ?? ""];
1434
1443
  v === void 0 || S === void 0 ? c("unsupported-property", `-unity-text-align: "${m}" ignored`, {
1435
1444
  reason: "invalid-value",
1436
1445
  ...u("-unity-text-align")
1437
1446
  }) : (s["align-items"] = v, s["justify-content"] = S);
1438
1447
  }
1439
- const a = [], b = i("translate");
1440
- b !== void 0 && a.push(`translate(${b.replace(/\s+/, ", ")})`);
1441
- const r = i("rotate");
1448
+ const a = [], y = o("translate");
1449
+ y !== void 0 && a.push(`translate(${y.replace(/\s+/, ", ")})`);
1450
+ const r = o("rotate");
1442
1451
  r !== void 0 && a.push(`rotate(${r})`);
1443
- const w = i("scale");
1452
+ const w = o("scale");
1444
1453
  w !== void 0 && a.push(`scale(${w.replace(/\s+/, ", ")})`), a.length > 0 && (s.transform = a.join(" "));
1445
- const y = i("background-image");
1446
- if (y !== void 0 && y !== "none") {
1447
- const f = st(y);
1448
- if (f === null)
1449
- c("unsupported-property", `background-image: "${y}" is not an asset reference; Unity shows its warning icon instead`, {
1454
+ const b = o("background-image");
1455
+ if (b !== void 0 && b !== "none") {
1456
+ const d = rt(b);
1457
+ if (d === null)
1458
+ c("unsupported-property", `background-image: "${b}" is not an asset reference; Unity shows its warning icon instead`, {
1450
1459
  reason: "not-uss",
1451
1460
  ...u("background-image")
1452
1461
  });
1453
1462
  else {
1454
- const { form: k, path: v } = f, S = ((h = t.resolveAsset) == null ? void 0 : h.call(t, v, k)) ?? null;
1463
+ const { form: x, path: v } = d, S = ((p = t.resolveAsset) == null ? void 0 : p.call(t, v, x)) ?? null;
1455
1464
  if (S === null)
1456
1465
  s["background-image"] = "repeating-linear-gradient(45deg, rgba(255,0,255,0.35) 0 6px, rgba(0,0,0,0) 6px 12px)", c("asset-unresolved", `background-image: "${v}" was not resolved`, {
1457
- subject: { kind: "asset", path: v, form: k }
1466
+ subject: { kind: "asset", path: v, form: x }
1458
1467
  });
1459
1468
  else {
1460
- s["background-image"] = `url("${S}")`, s["background-repeat"] = i("background-repeat") ?? "no-repeat", s["background-position"] = i("background-position") ?? "center";
1461
- const E = i("background-size"), M = i("-unity-background-scale-mode") ?? Le, A = ge[M];
1469
+ s["background-image"] = `url("${S}")`, s["background-repeat"] = o("background-repeat") ?? "no-repeat", s["background-position"] = o("background-position") ?? "center";
1470
+ const E = o("background-size"), C = o("-unity-background-scale-mode") ?? ze, A = be[C];
1462
1471
  A === void 0 && c(
1463
1472
  "unsupported-property",
1464
- `-unity-background-scale-mode: "${M}" ignored; expected one of ${Object.keys(ge).join(", ")}`,
1465
- { reason: "invalid-value", ...u("-unity-background-scale-mode", M) }
1466
- ), s["background-size"] = E ?? A ?? ge[Le];
1473
+ `-unity-background-scale-mode: "${C}" ignored; expected one of ${Object.keys(be).join(", ")}`,
1474
+ { reason: "invalid-value", ...u("-unity-background-scale-mode", C) }
1475
+ ), s["background-size"] = E ?? A ?? be[ze];
1467
1476
  }
1468
1477
  }
1469
1478
  }
1470
- return { declarations: s, warnings: o };
1479
+ return { declarations: s, warnings: i };
1471
1480
  }
1472
- const pn = "data-uxml-node", hn = "data-uxml-part", mn = "data-uxml-part-owner";
1473
- function gn(e, n, t, s, o, i) {
1481
+ const yn = "data-uxml-node", bn = "data-uxml-part", vn = "data-uxml-part-owner";
1482
+ function wn(e, n, t, s, i, o) {
1474
1483
  const c = [], u = /* @__PURE__ */ new Map();
1475
1484
  function g(a) {
1476
- const b = s.get(a.id), r = (w) => {
1477
- var f;
1478
- const y = ((f = b == null ? void 0 : b.get(w)) == null ? void 0 : f.value) ?? ve[w] ?? "0", { length: h } = B(y);
1479
- return h !== null && h.kind === "px" ? h.value : 0;
1485
+ const y = s.get(a.id), r = (w) => {
1486
+ var d;
1487
+ const b = ((d = y == null ? void 0 : y.get(w)) == null ? void 0 : d.value) ?? xe[w] ?? "0", { length: p } = V(b);
1488
+ return p !== null && p.kind === "px" ? p.value : 0;
1480
1489
  };
1481
1490
  return { left: r("border-left-width"), top: r("border-top-width") };
1482
1491
  }
1483
- function p(a) {
1484
- const b = (r) => {
1485
- var h;
1486
- const w = ((h = a.style.get(r)) == null ? void 0 : h.value) ?? ve[r] ?? "0", { length: y } = B(w);
1487
- return y !== null && y.kind === "px" ? y.value : 0;
1492
+ function h(a) {
1493
+ const y = (r) => {
1494
+ var p;
1495
+ const w = ((p = a.style.get(r)) == null ? void 0 : p.value) ?? xe[r] ?? "0", { length: b } = V(w);
1496
+ return b !== null && b.kind === "px" ? b.value : 0;
1488
1497
  };
1489
- return { left: b("border-left-width"), top: b("border-top-width") };
1498
+ return { left: y("border-left-width"), top: y("border-top-width") };
1490
1499
  }
1491
- function l(a, b, r) {
1492
- var k, v;
1493
- const w = B(((k = r.get("letter-spacing")) == null ? void 0 : k.value) ?? "").length;
1500
+ function l(a, y, r) {
1501
+ var x, v;
1502
+ const w = V(((x = r.get("letter-spacing")) == null ? void 0 : x.value) ?? "").length;
1494
1503
  if ((w == null ? void 0 : w.kind) !== "px" || w.value === 0) {
1495
- a.textContent = b;
1504
+ a.textContent = y;
1496
1505
  return;
1497
1506
  }
1498
- const y = ((v = r.get("-unity-text-generator")) == null ? void 0 : v.value) === "standard", h = [...b], f = h.pop();
1499
- for (const S of h.join("").match(/ +|[^ ]+/g) ?? []) {
1500
- const E = i.document.createElement("span");
1501
- E.textContent = S, !y && S[0] === " " && (E.style.letterSpacing = "0px"), a.appendChild(E);
1507
+ const b = ((v = r.get("-unity-text-generator")) == null ? void 0 : v.value) === "standard", p = [...y], d = p.pop();
1508
+ for (const S of p.join("").match(/ +|[^ ]+/g) ?? []) {
1509
+ const E = o.document.createElement("span");
1510
+ E.textContent = S, !b && S[0] === " " && (E.style.letterSpacing = "0px"), a.appendChild(E);
1502
1511
  }
1503
- if (f !== void 0) {
1504
- const S = i.document.createElement("span");
1505
- S.textContent = f, S.style.letterSpacing = "0px", a.appendChild(S);
1512
+ if (d !== void 0) {
1513
+ const S = o.document.createElement("span");
1514
+ S.textContent = d, S.style.letterSpacing = "0px", a.appendChild(S);
1506
1515
  }
1507
1516
  }
1508
- function d(a, b, r) {
1509
- var A, z, q, Q, x;
1517
+ function f(a, y, r) {
1518
+ var A, N, Y, te, k;
1510
1519
  const w = n.get(a.id);
1511
1520
  if (w === void 0) return null;
1512
- const y = i.document.createElement("div");
1513
- y.setAttribute(pn, String(a.id));
1514
- const h = s.get(a.id) ?? /* @__PURE__ */ new Map(), f = Ue(h, a.id, i);
1515
- c.push(...f.warnings);
1516
- const k = b === null ? 0 : w.left - b.left - r.left, v = b === null ? 0 : w.top - b.top - r.top, S = {
1521
+ const b = o.document.createElement("div");
1522
+ b.setAttribute(yn, String(a.id));
1523
+ const p = s.get(a.id) ?? /* @__PURE__ */ new Map(), d = Pe(p, a.id, o);
1524
+ c.push(...d.warnings);
1525
+ const x = y === null ? 0 : w.left - y.left - r.left, v = y === null ? 0 : w.top - y.top - r.top, S = {
1517
1526
  position: "absolute",
1518
- left: `${k}px`,
1527
+ left: `${x}px`,
1519
1528
  top: `${v}px`,
1520
1529
  width: `${w.width}px`,
1521
1530
  height: `${w.height}px`,
1522
1531
  margin: "0",
1523
- ...f.declarations
1532
+ ...d.declarations
1524
1533
  };
1525
1534
  for (const [$, T] of Object.entries(S))
1526
- y.style.setProperty($, T);
1527
- const { spec: E } = X(a), M = (A = a.attributes.find(($) => $.name === "text")) == null ? void 0 : A.value;
1528
- if (E.hasText && M !== void 0 && M.length > 0) {
1529
- y.style.setProperty("display", f.declarations.display ?? "flex"), f.declarations["align-items"] === void 0 && y.style.setProperty("align-items", "flex-start"), f.declarations["justify-content"] === void 0 && y.style.setProperty("justify-content", "flex-start");
1530
- const $ = (z = i.fonts) == null ? void 0 : z.get(h);
1531
- $ !== void 0 && (y.style.fontFamily = nt($.family));
1532
- const T = B(((q = h.get("-unity-paragraph-spacing")) == null ? void 0 : q.value) ?? "").length, I = Z(M), O = B(((Q = h.get("letter-spacing")) == null ? void 0 : Q.value) ?? "").length;
1535
+ b.style.setProperty($, T);
1536
+ const { spec: E } = Q(a), C = (A = a.attributes.find(($) => $.name === "text")) == null ? void 0 : A.value;
1537
+ if (E.hasText && C !== void 0 && C.length > 0) {
1538
+ b.style.setProperty("display", d.declarations.display ?? "flex"), d.declarations["align-items"] === void 0 && b.style.setProperty("align-items", "flex-start"), d.declarations["justify-content"] === void 0 && b.style.setProperty("justify-content", "flex-start");
1539
+ const $ = (N = o.fonts) == null ? void 0 : N.get(p);
1540
+ $ !== void 0 && (b.style.fontFamily = ot($.family));
1541
+ const T = V(((Y = p.get("-unity-paragraph-spacing")) == null ? void 0 : Y.value) ?? "").length, I = ee(C), O = V(((te = p.get("letter-spacing")) == null ? void 0 : te.value) ?? "").length;
1533
1542
  if ((T == null ? void 0 : T.kind) === "px" && I.includes(`
1534
1543
  `)) {
1535
- const D = B(((x = h.get("font-size")) == null ? void 0 : x.value) ?? "12px").length, C = I.split(`
1536
- `), R = i.document.createElement("div");
1537
- R.style.width = "100%", C.forEach((L, U) => {
1538
- const N = i.document.createElement("div");
1539
- if (l(N, L, h), N.style.minHeight = "1em", U < C.length - 1 && (N.style.marginBottom = `${T.value * ((D == null ? void 0 : D.kind) === "px" ? D.value : 12) / 100}px`), R.appendChild(N), U < C.length - 1) {
1540
- const j = i.document.createElement("span");
1541
- j.textContent = `
1542
- `, j.style.display = "none", R.appendChild(j);
1544
+ const D = V(((k = p.get("font-size")) == null ? void 0 : k.value) ?? "12px").length, M = I.split(`
1545
+ `), R = o.document.createElement("div");
1546
+ R.style.width = "100%", M.forEach((F, L) => {
1547
+ const U = o.document.createElement("div");
1548
+ if (l(U, F, p), U.style.minHeight = "1em", L < M.length - 1 && (U.style.marginBottom = `${T.value * ((D == null ? void 0 : D.kind) === "px" ? D.value : 12) / 100}px`), R.appendChild(U), L < M.length - 1) {
1549
+ const z = o.document.createElement("span");
1550
+ z.textContent = `
1551
+ `, z.style.display = "none", R.appendChild(z);
1543
1552
  }
1544
- }), y.appendChild(R);
1553
+ }), b.appendChild(R);
1545
1554
  } else if ((O == null ? void 0 : O.kind) === "px" && O.value !== 0) {
1546
- const D = i.document.createElement("span");
1547
- D.style.minWidth = "0", l(D, I, h), y.appendChild(D);
1555
+ const D = o.document.createElement("span");
1556
+ D.style.minWidth = "0", l(D, I, p), b.appendChild(D);
1548
1557
  } else
1549
- y.textContent = I;
1558
+ b.textContent = I;
1550
1559
  } else {
1551
- let $ = y, T = w, I = g(a);
1560
+ let $ = b, T = w, I = g(a);
1552
1561
  for (const O of t.get(a.id) ?? []) {
1553
- const D = i.document.createElement("div");
1554
- D.setAttribute(hn, O.name), D.setAttribute(mn, String(a.id));
1555
- const C = Ue(O.style, a.id, i);
1556
- c.push(...C.warnings);
1562
+ const D = o.document.createElement("div");
1563
+ D.setAttribute(bn, O.name), D.setAttribute(vn, String(a.id));
1564
+ const M = Pe(O.style, a.id, o);
1565
+ c.push(...M.warnings);
1557
1566
  const R = {
1558
1567
  position: "absolute",
1559
1568
  left: `${O.box.left - T.left - I.left}px`,
@@ -1561,262 +1570,262 @@ function gn(e, n, t, s, o, i) {
1561
1570
  width: `${O.box.width}px`,
1562
1571
  height: `${O.box.height}px`,
1563
1572
  margin: "0",
1564
- ...C.declarations
1573
+ ...M.declarations
1565
1574
  };
1566
- for (const [L, U] of Object.entries(R))
1567
- D.style.setProperty(L, U);
1568
- $.appendChild(D), $ = D, T = O.box, I = p(O);
1575
+ for (const [F, L] of Object.entries(R))
1576
+ D.style.setProperty(F, L);
1577
+ $.appendChild(D), $ = D, T = O.box, I = h(O);
1569
1578
  }
1570
1579
  for (const O of a.children) {
1571
- const D = d(O, T, I);
1580
+ const D = f(O, T, I);
1572
1581
  D !== null && $.appendChild(D);
1573
1582
  }
1574
1583
  }
1575
- return u.set(a.id, y), y;
1584
+ return u.set(a.id, b), b;
1576
1585
  }
1577
- o.replaceChildren();
1578
- const m = d(e, null, { left: 0, top: 0 });
1579
- return m !== null && (m.style.setProperty("position", "relative"), o.appendChild(m)), { warnings: c, elements: u };
1586
+ i.replaceChildren();
1587
+ const m = f(e, null, { left: 0, top: 0 });
1588
+ return m !== null && (m.style.setProperty("position", "relative"), i.appendChild(m)), { warnings: c, elements: u };
1580
1589
  }
1581
- const ze = /[A-Za-z0-9_-]/;
1582
- function K(e) {
1590
+ const _e = /[A-Za-z0-9_-]/;
1591
+ function Z(e) {
1583
1592
  return e === " " || e === " " || e === `
1584
1593
  ` || e === "\r" || e === "\f";
1585
1594
  }
1586
- function we(e, n, t) {
1587
- let s = n, o = 0;
1595
+ function ke(e, n, t) {
1596
+ let s = n, i = 0;
1588
1597
  for (; s < e.length; ) {
1589
- const i = e[s];
1590
- if (i === '"' || i === "'") {
1591
- const c = e.indexOf(i, s + 1);
1598
+ const o = e[s];
1599
+ if (o === '"' || o === "'") {
1600
+ const c = e.indexOf(o, s + 1);
1592
1601
  s = c < 0 ? e.length : c + 1;
1593
1602
  continue;
1594
1603
  }
1595
- if (i === "/" && e[s + 1] === "*") {
1604
+ if (o === "/" && e[s + 1] === "*") {
1596
1605
  const c = e.indexOf("*/", s + 2);
1597
1606
  s = c < 0 ? e.length : c + 2;
1598
1607
  continue;
1599
1608
  }
1600
- if (i === "(" || i === "[")
1601
- o++;
1602
- else if (i === ")" || i === "]")
1603
- o > 0 && o--;
1604
- else if (o === 0 && t.includes(i))
1609
+ if (o === "(" || o === "[")
1610
+ i++;
1611
+ else if (o === ")" || o === "]")
1612
+ i > 0 && i--;
1613
+ else if (i === 0 && t.includes(o))
1605
1614
  return s;
1606
1615
  s++;
1607
1616
  }
1608
1617
  return e.length;
1609
1618
  }
1610
- function ot(e, n, t) {
1611
- let s = n, o = t;
1612
- for (; s < o && K(e[s]); ) s++;
1613
- for (; o > s && K(e[o - 1]); ) o--;
1614
- return { start: s, end: o };
1619
+ function at(e, n, t) {
1620
+ let s = n, i = t;
1621
+ for (; s < i && Z(e[s]); ) s++;
1622
+ for (; i > s && Z(e[i - 1]); ) i--;
1623
+ return { start: s, end: i };
1615
1624
  }
1616
- function it(e, n, t, s) {
1617
- const o = [];
1618
- let i = n;
1619
- for (; i < t; ) {
1620
- for (; i < t && (K(e[i]) || e.startsWith("/*", i)); )
1621
- if (e.startsWith("/*", i)) {
1622
- const l = e.indexOf("*/", i + 2);
1623
- i = l < 0 ? t : l + 2;
1625
+ function lt(e, n, t, s) {
1626
+ const i = [];
1627
+ let o = n;
1628
+ for (; o < t; ) {
1629
+ for (; o < t && (Z(e[o]) || e.startsWith("/*", o)); )
1630
+ if (e.startsWith("/*", o)) {
1631
+ const l = e.indexOf("*/", o + 2);
1632
+ o = l < 0 ? t : l + 2;
1624
1633
  } else
1625
- i++;
1626
- if (i >= t) break;
1627
- if (e[i] === ";") {
1628
- i++;
1634
+ o++;
1635
+ if (o >= t) break;
1636
+ if (e[o] === ";") {
1637
+ o++;
1629
1638
  continue;
1630
1639
  }
1631
- const c = i, u = we(e, c, ":;}");
1640
+ const c = o, u = ke(e, c, ":;}");
1632
1641
  if (u >= t || e[u] !== ":") {
1633
1642
  const l = Math.min(u, t);
1634
- s == null || s("declaration without a value", c, l), i = l + 1;
1643
+ s == null || s("declaration without a value", c, l), o = l + 1;
1635
1644
  continue;
1636
1645
  }
1637
- const g = Math.min(we(e, u + 1, ";}"), t), p = ot(e, u + 1, g);
1638
- o.push({
1646
+ const g = Math.min(ke(e, u + 1, ";}"), t), h = at(e, u + 1, g);
1647
+ i.push({
1639
1648
  property: e.slice(c, u).trim(),
1640
- value: e.slice(p.start, p.end),
1641
- span: { start: c, end: p.end },
1649
+ value: e.slice(h.start, h.end),
1650
+ span: { start: c, end: h.end },
1642
1651
  dirty: !1
1643
- }), i = g + 1;
1652
+ }), o = g + 1;
1644
1653
  }
1645
- return o;
1654
+ return i;
1646
1655
  }
1647
- function yn(e) {
1656
+ function xn(e) {
1648
1657
  const n = e.span.end - 1 - e.value.length;
1649
1658
  return n < e.span.start ? null : n;
1650
1659
  }
1651
- function Oe(e, n = null, t = 0) {
1652
- const s = [], o = [];
1653
- let i = 0;
1654
- function c(h, f, k) {
1660
+ function De(e, n = null, t = 0) {
1661
+ const s = [], i = [];
1662
+ let o = 0;
1663
+ function c(p, d, x) {
1655
1664
  s.push({
1656
1665
  kind: "malformed",
1657
- message: h,
1658
- at: { in: "uss", sheet: t, span: { start: f, end: k } }
1666
+ message: p,
1667
+ at: { in: "uss", sheet: t, span: { start: d, end: x } }
1659
1668
  });
1660
1669
  }
1661
1670
  function u() {
1662
1671
  for (; ; ) {
1663
- for (; K(e[i]); ) i++;
1664
- if (e.startsWith("/*", i)) {
1665
- const h = e.indexOf("*/", i + 2);
1666
- i = h < 0 ? e.length : h + 2;
1672
+ for (; Z(e[o]); ) o++;
1673
+ if (e.startsWith("/*", o)) {
1674
+ const p = e.indexOf("*/", o + 2);
1675
+ o = p < 0 ? e.length : p + 2;
1667
1676
  continue;
1668
1677
  }
1669
1678
  return;
1670
1679
  }
1671
1680
  }
1672
- const g = (h, f) => we(e, h, f), p = (h, f) => ot(e, h, f);
1673
- function l(h) {
1674
- let f = h + 1, k = 1;
1675
- for (; f < e.length; ) {
1676
- const v = e[f];
1681
+ const g = (p, d) => ke(e, p, d), h = (p, d) => at(e, p, d);
1682
+ function l(p) {
1683
+ let d = p + 1, x = 1;
1684
+ for (; d < e.length; ) {
1685
+ const v = e[d];
1677
1686
  if (v === '"' || v === "'") {
1678
- const S = e.indexOf(v, f + 1);
1679
- f = S < 0 ? e.length : S + 1;
1687
+ const S = e.indexOf(v, d + 1);
1688
+ d = S < 0 ? e.length : S + 1;
1680
1689
  continue;
1681
1690
  }
1682
- if (v === "/" && e[f + 1] === "*") {
1683
- const S = e.indexOf("*/", f + 2);
1684
- f = S < 0 ? e.length : S + 2;
1691
+ if (v === "/" && e[d + 1] === "*") {
1692
+ const S = e.indexOf("*/", d + 2);
1693
+ d = S < 0 ? e.length : S + 2;
1685
1694
  continue;
1686
1695
  }
1687
- if (v === "{") k++;
1688
- else if (v === "}" && --k === 0) return f + 1;
1689
- f++;
1696
+ if (v === "{") x++;
1697
+ else if (v === "}" && --x === 0) return d + 1;
1698
+ d++;
1690
1699
  }
1691
1700
  return e.length;
1692
1701
  }
1693
- function d(h) {
1694
- let f = h;
1695
- for (; f < e.length && ze.test(e[f]); ) f++;
1696
- return f;
1702
+ function f(p) {
1703
+ let d = p;
1704
+ for (; d < e.length && _e.test(e[d]); ) d++;
1705
+ return d;
1697
1706
  }
1698
- function m(h) {
1699
- const f = e[h], k = f === "(" ? ")" : "]";
1700
- let v = h + 1, S = 1;
1707
+ function m(p) {
1708
+ const d = e[p], x = d === "(" ? ")" : "]";
1709
+ let v = p + 1, S = 1;
1701
1710
  for (; v < e.length; ) {
1702
1711
  const E = e[v];
1703
1712
  if (E === '"' || E === "'") {
1704
- const M = e.indexOf(E, v + 1);
1705
- v = M < 0 ? e.length : M + 1;
1713
+ const C = e.indexOf(E, v + 1);
1714
+ v = C < 0 ? e.length : C + 1;
1706
1715
  continue;
1707
1716
  }
1708
- if (E === f) S++;
1709
- else if (E === k && --S === 0) return v + 1;
1717
+ if (E === d) S++;
1718
+ else if (E === x && --S === 0) return v + 1;
1710
1719
  v++;
1711
1720
  }
1712
1721
  return e.length;
1713
1722
  }
1714
- function a(h, f) {
1715
- const k = [];
1716
- let v = h;
1717
- for (; v < f; ) {
1723
+ function a(p, d) {
1724
+ const x = [];
1725
+ let v = p;
1726
+ for (; v < d; ) {
1718
1727
  const S = e[v];
1719
- if (K(S) || S === ">" || S === "+" || S === "~" || S === ",") break;
1728
+ if (Z(S) || S === ">" || S === "+" || S === "~" || S === ",") break;
1720
1729
  if (S === "*")
1721
- k.push({ kind: "universal" }), v++;
1730
+ x.push({ kind: "universal" }), v++;
1722
1731
  else if (S === "." || S === "#") {
1723
- const E = d(v + 1);
1724
- k.push(
1732
+ const E = f(v + 1);
1733
+ x.push(
1725
1734
  S === "." ? { kind: "class", name: e.slice(v + 1, E) } : { kind: "name", name: e.slice(v + 1, E) }
1726
1735
  ), v = E;
1727
1736
  } else if (S === "[") {
1728
- const E = Math.min(m(v), f);
1729
- k.push({ kind: "unknown", text: e.slice(v, E) }), v = E;
1737
+ const E = Math.min(m(v), d);
1738
+ x.push({ kind: "unknown", text: e.slice(v, E) }), v = E;
1730
1739
  } else if (S === ":")
1731
1740
  if (e[v + 1] === ":") {
1732
- const E = d(v + 2);
1733
- k.push({ kind: "unknown", text: e.slice(v, E) }), v = E;
1741
+ const E = f(v + 2);
1742
+ x.push({ kind: "unknown", text: e.slice(v, E) }), v = E;
1734
1743
  } else {
1735
- const E = d(v + 1);
1744
+ const E = f(v + 1);
1736
1745
  if (e[E] === "(") {
1737
- const M = Math.min(m(E), f);
1738
- k.push({ kind: "unknown", text: e.slice(v, M) }), v = M;
1746
+ const C = Math.min(m(E), d);
1747
+ x.push({ kind: "unknown", text: e.slice(v, C) }), v = C;
1739
1748
  } else
1740
- k.push({ kind: "pseudo", name: e.slice(v + 1, E) }), v = E;
1749
+ x.push({ kind: "pseudo", name: e.slice(v + 1, E) }), v = E;
1741
1750
  }
1742
- else if (ze.test(S)) {
1743
- const E = d(v);
1744
- k.push({ kind: "type", name: e.slice(v, E) }), v = E;
1751
+ else if (_e.test(S)) {
1752
+ const E = f(v);
1753
+ x.push({ kind: "type", name: e.slice(v, E) }), v = E;
1745
1754
  } else
1746
- k.push({ kind: "unknown", text: S }), v++;
1755
+ x.push({ kind: "unknown", text: S }), v++;
1747
1756
  }
1748
- return { simple: k, next: v };
1757
+ return { simple: x, next: v };
1749
1758
  }
1750
- function b(h, f) {
1751
- const k = p(h, f), v = [];
1752
- let S = "descendant", E = null, M = k.start;
1753
- for (; M < k.end; ) {
1754
- const A = e[M];
1755
- if (K(A)) {
1756
- M++;
1759
+ function y(p, d) {
1760
+ const x = h(p, d), v = [];
1761
+ let S = "descendant", E = null, C = x.start;
1762
+ for (; C < x.end; ) {
1763
+ const A = e[C];
1764
+ if (Z(A)) {
1765
+ C++;
1757
1766
  continue;
1758
1767
  }
1759
1768
  if (A === ">") {
1760
- S = "child", M++;
1769
+ S = "child", C++;
1761
1770
  continue;
1762
1771
  }
1763
1772
  if (A === "+" || A === "~") {
1764
- E = A, M++;
1773
+ E = A, C++;
1765
1774
  continue;
1766
1775
  }
1767
- const { simple: z, next: q } = a(M, k.end);
1768
- if (q === M) {
1769
- M++;
1776
+ const { simple: N, next: Y } = a(C, x.end);
1777
+ if (Y === C) {
1778
+ C++;
1770
1779
  continue;
1771
1780
  }
1772
- E !== null && (z.unshift({ kind: "unknown", text: E }), E = null), v.push({ combinator: S, simple: z }), S = "descendant", M = q;
1781
+ E !== null && (N.unshift({ kind: "unknown", text: E }), E = null), v.push({ combinator: S, simple: N }), S = "descendant", C = Y;
1773
1782
  }
1774
- return { parts: v, span: k };
1783
+ return { parts: v, span: x };
1775
1784
  }
1776
- function r(h, f) {
1777
- const k = [];
1778
- let v = h;
1785
+ function r(p, d) {
1786
+ const x = [];
1787
+ let v = p;
1779
1788
  for (; ; ) {
1780
- const S = Math.min(g(v, ","), f);
1781
- if (k.push(b(v, S)), S >= f) break;
1789
+ const S = Math.min(g(v, ","), d);
1790
+ if (x.push(y(v, S)), S >= d) break;
1782
1791
  v = S + 1;
1783
1792
  }
1784
- return k;
1793
+ return x;
1785
1794
  }
1786
1795
  function w() {
1787
- const h = i, f = d(i + 1), k = e.slice(i + 1, f), v = g(f, "{;");
1796
+ const p = o, d = f(o + 1), x = e.slice(o + 1, d), v = g(d, "{;");
1788
1797
  if (v < e.length && e[v] === "{") {
1789
1798
  const E = l(v);
1790
- return i = E, { kind: "unknown", span: { start: h, end: E } };
1799
+ return o = E, { kind: "unknown", span: { start: p, end: E } };
1791
1800
  }
1792
1801
  const S = v < e.length ? v + 1 : e.length;
1793
- if (i = S, k === "import") {
1794
- const E = e.slice(f, S), M = /["']([^"']*)["']/.exec(E);
1795
- return M === null ? (c("@import without a quoted path", h, S), { kind: "unknown", span: { start: h, end: S } }) : { kind: "import", url: M[1], span: { start: h, end: S } };
1796
- }
1797
- return { kind: "unknown", span: { start: h, end: S } };
1798
- }
1799
- function y() {
1800
- const h = i, f = g(h, "{");
1801
- if (f >= e.length)
1802
- return c("rule without a block", h, e.length), i = e.length, { kind: "unknown", span: { start: h, end: e.length } };
1803
- const k = p(h, f), v = l(f);
1804
- (v > e.length || e[v - 1] !== "}") && c("unterminated rule block", h, v);
1802
+ if (o = S, x === "import") {
1803
+ const E = e.slice(d, S), C = /["']([^"']*)["']/.exec(E);
1804
+ return C === null ? (c("@import without a quoted path", p, S), { kind: "unknown", span: { start: p, end: S } }) : { kind: "import", url: C[1], span: { start: p, end: S } };
1805
+ }
1806
+ return { kind: "unknown", span: { start: p, end: S } };
1807
+ }
1808
+ function b() {
1809
+ const p = o, d = g(p, "{");
1810
+ if (d >= e.length)
1811
+ return c("rule without a block", p, e.length), o = e.length, { kind: "unknown", span: { start: p, end: e.length } };
1812
+ const x = h(p, d), v = l(d);
1813
+ (v > e.length || e[v - 1] !== "}") && c("unterminated rule block", p, v);
1805
1814
  const S = {
1806
- selectors: r(k.start, k.end),
1807
- declarations: it(e, f + 1, v - 1, c),
1808
- span: { start: k.start, end: v },
1809
- selectorSpan: k,
1815
+ selectors: r(x.start, x.end),
1816
+ declarations: lt(e, d + 1, v - 1, c),
1817
+ span: { start: x.start, end: v },
1818
+ selectorSpan: x,
1810
1819
  selectorDirty: !1,
1811
1820
  declarationsDirty: !1
1812
1821
  };
1813
- return i = v, { kind: "rule", rule: S };
1822
+ return o = v, { kind: "rule", rule: S };
1814
1823
  }
1815
- for (; u(), !(i >= e.length); )
1816
- o.push(e[i] === "@" ? w() : y());
1817
- return { sheet: { source: e, origin: n, items: o }, warnings: s };
1824
+ for (; u(), !(o >= e.length); )
1825
+ i.push(e[o] === "@" ? w() : b());
1826
+ return { sheet: { source: e, origin: n, items: i }, warnings: s };
1818
1827
  }
1819
- function bn(e, n, t) {
1828
+ function kn(e, n, t) {
1820
1829
  switch (e.kind) {
1821
1830
  case "universal":
1822
1831
  return !0;
@@ -1832,61 +1841,61 @@ function bn(e, n, t) {
1832
1841
  return !1;
1833
1842
  }
1834
1843
  }
1835
- function vn(e, n, t) {
1836
- return e.simple.every((s) => bn(s, n, t));
1844
+ function Sn(e, n, t) {
1845
+ return e.simple.every((s) => kn(s, n, t));
1837
1846
  }
1838
- function ke(e, n, t, s) {
1839
- if (!vn(e[n], t, s)) return !1;
1847
+ function Se(e, n, t, s) {
1848
+ if (!Sn(e[n], t, s)) return !1;
1840
1849
  if (n === 0) return !0;
1841
- const o = s.parentOf(t);
1850
+ const i = s.parentOf(t);
1842
1851
  if (e[n].combinator === "child")
1843
- return o !== null && ke(e, n - 1, o, s);
1844
- for (let i = o; i !== null; i = s.parentOf(i))
1845
- if (ke(e, n - 1, i, s)) return !0;
1852
+ return i !== null && Se(e, n - 1, i, s);
1853
+ for (let o = i; o !== null; o = s.parentOf(o))
1854
+ if (Se(e, n - 1, o, s)) return !0;
1846
1855
  return !1;
1847
1856
  }
1848
- function xe(e, n, t) {
1849
- return e.parts.length === 0 ? !1 : ke(e.parts, e.parts.length - 1, n, t);
1857
+ function $e(e, n, t) {
1858
+ return e.parts.length === 0 ? !1 : Se(e.parts, e.parts.length - 1, n, t);
1850
1859
  }
1851
- function rt(e) {
1860
+ function ct(e) {
1852
1861
  const n = [];
1853
1862
  for (const t of e.parts)
1854
1863
  for (const s of t.simple)
1855
1864
  s.kind === "pseudo" && s.name !== "root" && !n.includes(s.name) && n.push(s.name);
1856
1865
  return n;
1857
1866
  }
1858
- function wn(e) {
1867
+ function $n(e) {
1859
1868
  const n = [];
1860
1869
  for (const t of e)
1861
1870
  for (const s of t.parts)
1862
- for (const o of s.simple) {
1863
- if (o.kind !== "name" && o.kind !== "class" || !o.name.startsWith("unity-")) continue;
1864
- const i = o.kind === "name" ? `#${o.name}` : `.${o.name}`;
1865
- n.includes(i) || n.push(i);
1871
+ for (const i of s.simple) {
1872
+ if (i.kind !== "name" && i.kind !== "class" || !i.name.startsWith("unity-")) continue;
1873
+ const o = i.kind === "name" ? `#${i.name}` : `.${i.name}`;
1874
+ n.includes(o) || n.push(o);
1866
1875
  }
1867
1876
  return n;
1868
1877
  }
1869
- function at(e) {
1878
+ function ut(e) {
1870
1879
  for (const n of e)
1871
1880
  for (const t of n.parts)
1872
1881
  for (const s of t.simple)
1873
1882
  if (s.kind === "unknown") return s.text;
1874
1883
  return null;
1875
1884
  }
1876
- function kn(e) {
1885
+ function Tn(e) {
1877
1886
  const n = /* @__PURE__ */ new Map([[e, null]]), t = [e];
1878
1887
  for (; t.length > 0; ) {
1879
1888
  const s = t.pop();
1880
- for (const o of s.children)
1881
- n.set(o, s), t.push(o);
1889
+ for (const i of s.children)
1890
+ n.set(i, s), t.push(i);
1882
1891
  }
1883
1892
  return n;
1884
1893
  }
1885
- function xn(e) {
1894
+ function En(e) {
1886
1895
  let n = 0, t = 0, s = 0;
1887
- for (const o of e.parts)
1888
- for (const i of o.simple)
1889
- switch (i.kind) {
1896
+ for (const i of e.parts)
1897
+ for (const o of i.simple)
1898
+ switch (o.kind) {
1890
1899
  case "name":
1891
1900
  n++;
1892
1901
  break;
@@ -1900,19 +1909,19 @@ function xn(e) {
1900
1909
  }
1901
1910
  return [n, t, s];
1902
1911
  }
1903
- function lt(e, n) {
1912
+ function dt(e, n) {
1904
1913
  return e[0] - n[0] || e[1] - n[1] || e[2] - n[2];
1905
1914
  }
1906
- const Sn = [Number.MAX_SAFE_INTEGER, 0, 0], $n = Oe(Qe, null, -1).sheet.items.flatMap(
1915
+ const On = [Number.MAX_SAFE_INTEGER, 0, 0], In = De(nt, null, -1).sheet.items.flatMap(
1907
1916
  (e, n) => e.kind === "rule" ? [{ rule: e.rule, sheet: -1, item: n, builtin: !0 }] : []
1908
1917
  );
1909
- function Tn(e) {
1910
- return Qe.slice(e.selectorSpan.start, e.selectorSpan.end).trim();
1918
+ function Dn(e) {
1919
+ return nt.slice(e.selectorSpan.start, e.selectorSpan.end).trim();
1911
1920
  }
1912
- function En(e, n, t, s) {
1913
- const o = (t == null ? void 0 : t.activeStates) ?? /* @__PURE__ */ new Set(), i = Object.entries((t == null ? void 0 : t.states) ?? {}), c = [];
1914
- for (const [l, d] of i) {
1915
- const m = Oe(`${l} {}`, null, -1).sheet.items.find((w) => w.kind === "rule"), a = m === void 0 ? l : at(m.rule.selectors);
1921
+ function Cn(e, n, t, s) {
1922
+ const i = (t == null ? void 0 : t.activeStates) ?? /* @__PURE__ */ new Set(), o = Object.entries((t == null ? void 0 : t.states) ?? {}), c = [];
1923
+ for (const [l, f] of o) {
1924
+ const m = De(`${l} {}`, null, -1).sheet.items.find((w) => w.kind === "rule"), a = m === void 0 ? l : ut(m.rule.selectors);
1916
1925
  if (m === void 0 || a !== null) {
1917
1926
  s.push({
1918
1927
  kind: "unsupported-selector",
@@ -1922,9 +1931,9 @@ function En(e, n, t, s) {
1922
1931
  });
1923
1932
  continue;
1924
1933
  }
1925
- const b = m.rule.selectors, r = (w) => b.some((y) => xe(y, { kind: "element", node: w }, n)) || w.children.some(r);
1934
+ const y = m.rule.selectors, r = (w) => y.some((b) => $e(b, { kind: "element", node: w }, n)) || w.children.some(r);
1926
1935
  if (!r(e.root)) {
1927
- const w = b.some((y) => rt(y).some((h) => be.includes(h)));
1936
+ const w = y.some((b) => ct(b).some((p) => we.includes(p)));
1928
1937
  s.push({
1929
1938
  kind: "unsupported-selector",
1930
1939
  reason: "invalid-value",
@@ -1932,49 +1941,49 @@ function En(e, n, t, s) {
1932
1941
  subject: { kind: "states-key", key: l, problem: w ? "state-in-key" : "matches-nothing" }
1933
1942
  });
1934
1943
  }
1935
- for (const w of new Set(d))
1936
- be.includes(w) || s.push({
1944
+ for (const w of new Set(f))
1945
+ we.includes(w) || s.push({
1937
1946
  kind: "unsupported-selector",
1938
1947
  reason: "invalid-value",
1939
1948
  message: `states key "${l}" lists unknown state "${w}"; Unity sets no such state`,
1940
1949
  subject: { kind: "states-key", key: l, problem: "unknown-state", state: w }
1941
1950
  });
1942
- c.push({ selectors: b, states: d });
1951
+ c.push({ selectors: y, states: f });
1943
1952
  }
1944
- const u = /* @__PURE__ */ new Map(), g = (l) => l.attributes.some((d) => d.name === "enabled" && d.value === "false"), p = (l, d) => {
1945
- const m = d || g(l), a = new Set(o);
1953
+ const u = /* @__PURE__ */ new Map(), g = (l) => l.attributes.some((f) => f.name === "enabled" && f.value === "false"), h = (l, f) => {
1954
+ const m = f || g(l), a = new Set(i);
1946
1955
  m ? a.add("disabled") : a.add("enabled");
1947
- for (const b of c)
1948
- if (b.selectors.some((r) => xe(r, { kind: "element", node: l }, n)))
1949
- for (const r of b.states) a.add(r);
1956
+ for (const y of c)
1957
+ if (y.selectors.some((r) => $e(r, { kind: "element", node: l }, n)))
1958
+ for (const r of y.states) a.add(r);
1950
1959
  u.set(l, a);
1951
- for (const b of l.children) p(b, m);
1960
+ for (const y of l.children) h(y, m);
1952
1961
  };
1953
- return p(e.root, !1), u;
1962
+ return h(e.root, !1), u;
1954
1963
  }
1955
- function On(e) {
1964
+ function Mn(e) {
1956
1965
  const n = [], t = /* @__PURE__ */ new Map();
1957
1966
  e.sheets.forEach((c, u) => {
1958
1967
  c.origin !== null && !t.has(c.origin) && t.set(c.origin, u);
1959
- }), n.push(...$n);
1960
- const s = /* @__PURE__ */ new Map(), o = (c, u) => {
1968
+ }), n.push(...In);
1969
+ const s = /* @__PURE__ */ new Map(), i = (c, u) => {
1961
1970
  const g = s.get(u) ?? /* @__PURE__ */ new Set();
1962
1971
  if (g.has(c)) return;
1963
1972
  g.add(c), s.set(u, g);
1964
- const p = e.sheets[c];
1965
- p !== void 0 && p.items.forEach((l, d) => {
1973
+ const h = e.sheets[c];
1974
+ h !== void 0 && h.items.forEach((l, f) => {
1966
1975
  if (l.kind === "rule")
1967
- n.push({ rule: l.rule, sheet: c, item: d, scope: u });
1976
+ n.push({ rule: l.rule, sheet: c, item: f, scope: u });
1968
1977
  else if (l.kind === "import") {
1969
1978
  const m = l.resolvedSheet ?? t.get(l.url);
1970
- m !== void 0 && o(m, u);
1979
+ m !== void 0 && i(m, u);
1971
1980
  }
1972
1981
  });
1973
- }, i = e.styleRoots ?? (e.sheets.length === 0 ? [] : [{ sheet: 0, scope: e.root.id }]);
1974
- for (const c of i) o(c.sheet, c.scope);
1982
+ }, o = e.styleRoots ?? (e.sheets.length === 0 ? [] : [{ sheet: 0, scope: e.root.id }]);
1983
+ for (const c of o) i(c.sheet, c.scope);
1975
1984
  return n;
1976
1985
  }
1977
- function In(e, n, t) {
1986
+ function Rn(e, n, t) {
1978
1987
  let s = e;
1979
1988
  for (; s !== null; ) {
1980
1989
  if (s.kind === "element" && s.node.id === n) return !0;
@@ -1982,33 +1991,33 @@ function In(e, n, t) {
1982
1991
  }
1983
1992
  return !1;
1984
1993
  }
1985
- function Dn(e) {
1994
+ function An(e) {
1986
1995
  return e.selectors.some(
1987
1996
  (n) => n.parts.some((t) => t.simple.some((s) => s.kind === "pseudo" && s.name === "root"))
1988
1997
  );
1989
1998
  }
1990
- function re(e, n) {
1999
+ function le(e, n) {
1991
2000
  var s;
1992
2001
  const t = n.rule.selectorSpan;
1993
2002
  return ((s = e.sheets[n.sheet]) == null ? void 0 : s.source.slice(t.start, t.end)) ?? "";
1994
2003
  }
1995
- function Y(e, n) {
1996
- const t = e.sheets[n], s = e.sheets.find((o) => o.items.some((i) => i.kind === "import" && i.resolvedSheet === n));
2004
+ function K(e, n) {
2005
+ const t = e.sheets[n], s = e.sheets.find((i) => i.items.some((o) => o.kind === "import" && o.resolvedSheet === n));
1997
2006
  return { url: (t == null ? void 0 : t.origin) ?? null, from: (t == null ? void 0 : t.sourceDocumentFrom) ?? (s == null ? void 0 : s.origin) ?? null };
1998
2007
  }
1999
- function G(e, n) {
2008
+ function X(e, n) {
2000
2009
  var s;
2001
2010
  const t = (s = e.sheets[n]) == null ? void 0 : s.origin;
2002
2011
  return typeof t == "string" ? { sourceDocument: t } : {};
2003
2012
  }
2004
- function ct(e, n) {
2005
- const t = kn(e.root), s = [], o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), c = (r) => {
2006
- var y;
2007
- const w = (y = r.attributes.find((h) => h.name === "class")) == null ? void 0 : y.value;
2008
- return w === void 0 ? [] : w.split(/\s+/).filter((h) => h.length > 0);
2013
+ function ft(e, n) {
2014
+ const t = Tn(e.root), s = [], i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), c = (r) => {
2015
+ var b;
2016
+ const w = (b = r.attributes.find((p) => p.name === "class")) == null ? void 0 : b.value;
2017
+ return w === void 0 ? [] : w.split(/\s+/).filter((p) => p.length > 0);
2009
2018
  }, u = (r, w) => {
2010
- var y;
2011
- return (y = r.attributes.find((h) => h.name === w)) == null ? void 0 : y.value;
2019
+ var b;
2020
+ return (b = r.attributes.find((p) => p.name === w)) == null ? void 0 : b.value;
2012
2021
  }, g = {
2013
2022
  /**
2014
2023
  * The rule the measurement forced.
@@ -2022,12 +2031,12 @@ function ct(e, n) {
2022
2031
  */
2023
2032
  parentOf: (r) => {
2024
2033
  if (r.kind === "element") {
2025
- const h = t.get(r.node) ?? null;
2026
- return h === null ? null : { kind: "element", node: h };
2034
+ const p = t.get(r.node) ?? null;
2035
+ return p === null ? null : { kind: "element", node: p };
2027
2036
  }
2028
2037
  if (r.depth === 0) return { kind: "element", node: r.owner };
2029
- const y = X(r.owner).spec.parts[r.depth - 1];
2030
- return { kind: "part", owner: r.owner, name: y.name, depth: r.depth - 1 };
2038
+ const b = Q(r.owner).spec.parts[r.depth - 1];
2039
+ return { kind: "part", owner: r.owner, name: b.name, depth: r.depth - 1 };
2031
2040
  },
2032
2041
  isRoot: (r) => r.kind === "element" && r.node === e.root,
2033
2042
  // Unity's parts are VisualElements, so a `VisualElement` rule reaches them.
@@ -2038,210 +2047,210 @@ function ct(e, n) {
2038
2047
  // element genuinely carries them, which is why `.unity-button` in author USS
2039
2048
  // hits a plain `<ui:Button />`. Parts carry classes too in Unity, but which
2040
2049
  // ones is unmeasured, so none are claimed here.
2041
- classesOf: (r) => r.kind === "element" ? [...c(r.node), ...wt(r.node)] : []
2042
- }, p = { ...g, statesOf: () => i }, l = En(e, p, n, s), d = {
2050
+ classesOf: (r) => r.kind === "element" ? [...c(r.node), ...St(r.node)] : []
2051
+ }, h = { ...g, statesOf: () => o }, l = Cn(e, h, n, s), f = {
2043
2052
  ...g,
2044
2053
  // A part inherits its owner's states: `SetEnabled(false)` disables the whole
2045
2054
  // subtree, and a part is inside it.
2046
- statesOf: (r) => l.get(r.kind === "element" ? r.node : r.owner) ?? i
2055
+ statesOf: (r) => l.get(r.kind === "element" ? r.node : r.owner) ?? o
2047
2056
  }, m = [];
2048
2057
  let a = !1;
2049
- for (const r of On(e)) {
2058
+ for (const r of Mn(e)) {
2050
2059
  if (r.builtin === !0) {
2051
2060
  m.push(r);
2052
2061
  continue;
2053
2062
  }
2054
- const w = at(r.rule.selectors);
2063
+ const w = ut(r.rule.selectors);
2055
2064
  if (w !== null) {
2056
2065
  s.push({
2057
2066
  kind: "unsupported-selector",
2058
2067
  message: `"${w}": the whole rule is ignored`,
2059
- at: { in: "uss", sheet: r.sheet, ...Y(e, r.sheet), span: r.rule.selectorSpan },
2068
+ at: { in: "uss", sheet: r.sheet, ...K(e, r.sheet), span: r.rule.selectorSpan },
2060
2069
  reason: "not-uss",
2061
- subject: { kind: "selector", selector: re(e, r), fragment: w },
2062
- ...G(e, r.sheet)
2070
+ subject: { kind: "selector", selector: le(e, r), fragment: w },
2071
+ ...X(e, r.sheet)
2063
2072
  });
2064
2073
  continue;
2065
2074
  }
2066
- !a && Dn(r.rule) && (a = !0, s.push({
2075
+ !a && An(r.rule) && (a = !0, s.push({
2067
2076
  kind: "version-dependent",
2068
2077
  // Not a version difference: USS :root means something else than CSS
2069
2078
  // :root, and this preview does what Unity does. Kept as a warning so
2070
2079
  // an author porting CSS is told; the kind stays for compatibility.
2071
2080
  message: ":root matched the element this stylesheet is attached to — the document root, or the TemplateContainer of a template",
2072
- at: { in: "uss", sheet: r.sheet, ...Y(e, r.sheet), span: r.rule.selectorSpan },
2081
+ at: { in: "uss", sheet: r.sheet, ...K(e, r.sheet), span: r.rule.selectorSpan },
2073
2082
  reason: "matches-unity",
2074
- subject: { kind: "selector", selector: re(e, r), fragment: ":root" },
2075
- ...G(e, r.sheet)
2083
+ subject: { kind: "selector", selector: le(e, r), fragment: ":root" },
2084
+ ...X(e, r.sheet)
2076
2085
  })), m.push(r);
2077
2086
  }
2078
- const b = /* @__PURE__ */ new Set();
2087
+ const y = /* @__PURE__ */ new Set();
2079
2088
  for (const r of m) {
2080
2089
  if (r.builtin === !0) continue;
2081
2090
  const w = `${r.sheet}:${r.item}`;
2082
- if (b.has(w)) continue;
2083
- b.add(w);
2084
- const y = /* @__PURE__ */ new Set();
2085
- for (const h of r.rule.selectors)
2086
- for (const f of h.parts)
2087
- for (const k of f.simple)
2088
- k.kind !== "pseudo" || k.name === "root" || be.includes(k.name) || y.add(k.name);
2089
- for (const h of y)
2091
+ if (y.has(w)) continue;
2092
+ y.add(w);
2093
+ const b = /* @__PURE__ */ new Set();
2094
+ for (const p of r.rule.selectors)
2095
+ for (const d of p.parts)
2096
+ for (const x of d.simple)
2097
+ x.kind !== "pseudo" || x.name === "root" || we.includes(x.name) || b.add(x.name);
2098
+ for (const p of b)
2090
2099
  s.push({
2091
2100
  kind: "unsupported-selector",
2092
- message: `":${h}": never matches; Unity sets no such state`,
2093
- at: { in: "uss", sheet: r.sheet, ...Y(e, r.sheet), span: r.rule.selectorSpan },
2094
- ...G(e, r.sheet),
2101
+ message: `":${p}": never matches; Unity sets no such state`,
2102
+ at: { in: "uss", sheet: r.sheet, ...K(e, r.sheet), span: r.rule.selectorSpan },
2103
+ ...X(e, r.sheet),
2095
2104
  reason: "not-uss",
2096
- subject: { kind: "selector", selector: re(e, r), fragment: `:${h}` }
2105
+ subject: { kind: "selector", selector: le(e, r), fragment: `:${p}` }
2097
2106
  });
2098
- for (const h of r.rule.declarations) {
2099
- const f = tt(h.property, h.value);
2100
- if (f === null) continue;
2101
- const k = {
2107
+ for (const p of r.rule.declarations) {
2108
+ const d = it(p.property, p.value);
2109
+ if (d === null) continue;
2110
+ const x = {
2102
2111
  kind: "unsupported-property",
2103
- ...f,
2104
- at: { in: "uss", sheet: r.sheet, ...Y(e, r.sheet), span: h.span },
2105
- ...G(e, r.sheet)
2112
+ ...d,
2113
+ at: { in: "uss", sheet: r.sheet, ...K(e, r.sheet), span: p.span },
2114
+ ...X(e, r.sheet)
2106
2115
  };
2107
- s.push(k), o.set(k, `${r.sheet}:${r.item}`);
2116
+ s.push(x), i.set(x, `${r.sheet}:${r.item}`);
2108
2117
  }
2109
2118
  }
2110
2119
  return e.sheets.forEach((r, w) => {
2111
- var y;
2112
- for (const h of r.items) {
2113
- if (h.kind !== "unknown") continue;
2114
- const f = (y = /^@([A-Za-z][\w-]*)/.exec(r.source.slice(h.span.start, h.span.end))) == null ? void 0 : y[1];
2115
- f === void 0 || f === "import" || s.push({
2120
+ var b;
2121
+ for (const p of r.items) {
2122
+ if (p.kind !== "unknown") continue;
2123
+ const d = (b = /^@([A-Za-z][\w-]*)/.exec(r.source.slice(p.span.start, p.span.end))) == null ? void 0 : b[1];
2124
+ d === void 0 || d === "import" || s.push({
2116
2125
  kind: "unsupported-selector",
2117
- message: `@${f}: block ignored`,
2118
- at: { in: "uss", sheet: w, ...Y(e, w), span: h.span },
2119
- ...G(e, w),
2126
+ message: `@${d}: block ignored`,
2127
+ at: { in: "uss", sheet: w, ...K(e, w), span: p.span },
2128
+ ...X(e, w),
2120
2129
  reason: "not-uss",
2121
- subject: { kind: "at-rule", name: f }
2130
+ subject: { kind: "at-rule", name: d }
2122
2131
  });
2123
2132
  }
2124
- }), { ctx: d, usable: m, warnings: s, declarationWarnings: o };
2133
+ }), { ctx: f, usable: m, warnings: s, declarationWarnings: i };
2125
2134
  }
2126
- function Ie(e, n) {
2127
- const t = n.attributes.find((o) => o.name === "style");
2135
+ function Ce(e, n) {
2136
+ const t = n.attributes.find((i) => i.name === "style");
2128
2137
  if (t === void 0) return [];
2129
- const s = yn(t);
2130
- return s === null ? [] : it(e.source, s, s + t.value.length);
2138
+ const s = xn(t);
2139
+ return s === null ? [] : lt(e.source, s, s + t.value.length);
2131
2140
  }
2132
- function Mn(e, n) {
2141
+ function jn(e, n) {
2133
2142
  let t = null;
2134
- const s = (o, i) => {
2143
+ const s = (i, o) => {
2135
2144
  var c;
2136
- typeof o.sourceDocument != "string" && i.set(((c = o.derived) == null ? void 0 : c.instance) ?? o.id, o);
2137
- for (const u of o.children) s(u, i);
2138
- return i;
2145
+ typeof i.sourceDocument != "string" && o.set(((c = i.derived) == null ? void 0 : c.instance) ?? i.id, i);
2146
+ for (const u of i.children) s(u, o);
2147
+ return o;
2139
2148
  };
2140
- return (o) => {
2141
- var i;
2142
- if (o.kind === "rule") {
2143
- const c = (i = e.sheets[o.sheet]) == null ? void 0 : i.items[o.item], u = (c == null ? void 0 : c.kind) === "rule" ? c.rule.declarations[o.declIndex] : void 0;
2144
- return u === void 0 ? {} : { nodes: [...n.get(`${o.sheet}:${o.item}`) ?? []], at: { in: "uss", sheet: o.sheet, ...Y(e, o.sheet), span: u.span }, ...G(e, o.sheet) };
2145
- }
2146
- if (o.kind === "inline") {
2147
- if (typeof o.sourceDocument == "string") return { sourceDocument: o.sourceDocument };
2149
+ return (i) => {
2150
+ var o;
2151
+ if (i.kind === "rule") {
2152
+ const c = (o = e.sheets[i.sheet]) == null ? void 0 : o.items[i.item], u = (c == null ? void 0 : c.kind) === "rule" ? c.rule.declarations[i.declIndex] : void 0;
2153
+ return u === void 0 ? {} : { nodes: [...n.get(`${i.sheet}:${i.item}`) ?? []], at: { in: "uss", sheet: i.sheet, ...K(e, i.sheet), span: u.span }, ...X(e, i.sheet) };
2154
+ }
2155
+ if (i.kind === "inline") {
2156
+ if (typeof i.sourceDocument == "string") return { sourceDocument: i.sourceDocument };
2148
2157
  t ?? (t = s(e.root, /* @__PURE__ */ new Map()));
2149
- const c = t.get(o.node), u = c === void 0 ? void 0 : Ie(e, c)[o.declIndex];
2158
+ const c = t.get(i.node), u = c === void 0 ? void 0 : Ce(e, c)[i.declIndex];
2150
2159
  return u === void 0 ? {} : { at: { in: "uxml", span: u.span } };
2151
2160
  }
2152
2161
  return {};
2153
2162
  };
2154
2163
  }
2155
- function ut(e, n, t, s, o) {
2156
- const i = [];
2164
+ function pt(e, n, t, s, i) {
2165
+ const o = [];
2157
2166
  let c = 0;
2158
- const u = (g, p, l, d, m) => {
2159
- i.push({ property: g, value: p, origin: l, rank: d, specificity: m, order: c++, winner: !1 });
2167
+ const u = (g, h, l, f, m) => {
2168
+ o.push({ property: g, value: h, origin: l, rank: f, specificity: m, order: c++, winner: !1 });
2160
2169
  };
2161
2170
  if (n.kind === "part") {
2162
- const g = X(n.owner).spec.parts[n.depth];
2163
- for (const [p, l] of Object.entries((g == null ? void 0 : g.style) ?? {}))
2164
- for (const [d, m] of pe(p, l))
2171
+ const g = Q(n.owner).spec.parts[n.depth];
2172
+ for (const [h, l] of Object.entries((g == null ? void 0 : g.style) ?? {}))
2173
+ for (const [f, m] of me(h, l))
2165
2174
  u(
2166
- d,
2175
+ f,
2167
2176
  m,
2168
2177
  {
2169
2178
  kind: "builtin-theme",
2170
2179
  selector: `#${n.name}`,
2171
- property: d,
2172
- unityVersion: ae
2180
+ property: f,
2181
+ unityVersion: ce
2173
2182
  },
2174
2183
  0,
2175
2184
  [0, 0, 0]
2176
2185
  );
2177
2186
  }
2178
2187
  for (const g of t.usable) {
2179
- if (g.scope !== void 0 && !In(n, g.scope, t.ctx)) continue;
2180
- const p = g.scope === void 0 ? t.ctx : {
2188
+ if (g.scope !== void 0 && !Rn(n, g.scope, t.ctx)) continue;
2189
+ const h = g.scope === void 0 ? t.ctx : {
2181
2190
  ...t.ctx,
2182
2191
  // Unity USS :root names the element this particular stylesheet is
2183
2192
  // attached to. Template sheets are attached to each generated
2184
2193
  // TemplateContainer, not to the entry document root.
2185
2194
  isRoot: (m) => m.kind === "element" && m.node.id === g.scope
2186
2195
  };
2187
- let l = null, d = [];
2196
+ let l = null, f = [];
2188
2197
  for (const m of g.rule.selectors) {
2189
- if (!xe(m, n, p)) continue;
2190
- const a = xn(m);
2191
- (l === null || lt(a, l) > 0) && (l = a, d = rt(m));
2198
+ if (!$e(m, n, h)) continue;
2199
+ const a = En(m);
2200
+ (l === null || dt(a, l) > 0) && (l = a, f = ct(m));
2192
2201
  }
2193
2202
  if (l !== null) {
2194
- if (s == null || s.add(g), o !== void 0 && n.kind === "element" && g.builtin !== !0) {
2195
- const m = `${g.sheet}:${g.item}`, a = o.get(m) ?? [];
2196
- a.includes(n.node.id) || a.push(n.node.id), o.set(m, a);
2203
+ if (s == null || s.add(g), i !== void 0 && n.kind === "element" && g.builtin !== !0) {
2204
+ const m = `${g.sheet}:${g.item}`, a = i.get(m) ?? [];
2205
+ a.includes(n.node.id) || a.push(n.node.id), i.set(m, a);
2197
2206
  }
2198
2207
  g.rule.declarations.forEach((m, a) => {
2199
- var b, r, w;
2200
- for (const [y, h] of pe(m.property, m.value)) {
2201
- const f = g.builtin === !0 ? {
2208
+ var y, r, w;
2209
+ for (const [b, p] of me(m.property, m.value)) {
2210
+ const d = g.builtin === !0 ? {
2202
2211
  kind: "builtin-theme",
2203
- selector: Tn(g.rule),
2204
- property: y,
2205
- unityVersion: ae
2212
+ selector: Dn(g.rule),
2213
+ property: b,
2214
+ unityVersion: ce
2206
2215
  } : {
2207
2216
  kind: "rule",
2208
2217
  sheet: g.sheet,
2209
2218
  item: g.item,
2210
2219
  declIndex: a,
2211
- ...((b = e.sheets[g.sheet]) == null ? void 0 : b.origin) === null || ((r = e.sheets[g.sheet]) == null ? void 0 : r.origin) === void 0 ? {} : { sourceDocument: e.sheets[g.sheet].origin },
2220
+ ...((y = e.sheets[g.sheet]) == null ? void 0 : y.origin) === null || ((r = e.sheets[g.sheet]) == null ? void 0 : r.origin) === void 0 ? {} : { sourceDocument: e.sheets[g.sheet].origin },
2212
2221
  ...((w = e.sheets[g.sheet]) == null ? void 0 : w.sourceDocumentFrom) === void 0 ? {} : { sourceDocumentFrom: e.sheets[g.sheet].sourceDocumentFrom },
2213
2222
  // Omitted rather than set to [] when unconditional, so the
2214
2223
  // common case stays the shape it has always been.
2215
- ...d.length > 0 ? { states: d } : {}
2224
+ ...f.length > 0 ? { states: f } : {}
2216
2225
  };
2217
- u(y, h, f, g.builtin === !0 ? 0 : 1, l);
2226
+ u(b, p, d, g.builtin === !0 ? 0 : 1, l);
2218
2227
  }
2219
2228
  });
2220
2229
  }
2221
2230
  }
2222
2231
  if (n.kind === "element") {
2223
2232
  const g = n.node;
2224
- Ie(e, g).forEach((p, l) => {
2225
- var d;
2226
- for (const [m, a] of pe(p.property, p.value))
2233
+ Ce(e, g).forEach((h, l) => {
2234
+ var f;
2235
+ for (const [m, a] of me(h.property, h.value))
2227
2236
  u(
2228
2237
  m,
2229
2238
  a,
2230
2239
  {
2231
2240
  kind: "inline",
2232
- node: ((d = g.derived) == null ? void 0 : d.instance) ?? g.sourceNode ?? g.id,
2241
+ node: ((f = g.derived) == null ? void 0 : f.instance) ?? g.sourceNode ?? g.id,
2233
2242
  declIndex: l,
2234
2243
  ...typeof g.sourceDocument == "string" ? { sourceDocument: g.sourceDocument } : {},
2235
2244
  ...g.sourceDocumentFrom === void 0 ? {} : { sourceDocumentFrom: g.sourceDocumentFrom }
2236
2245
  },
2237
2246
  1,
2238
- Sn
2247
+ On
2239
2248
  );
2240
2249
  });
2241
2250
  }
2242
- return i;
2251
+ return o;
2243
2252
  }
2244
- function dt(e) {
2253
+ function ht(e) {
2245
2254
  const n = /* @__PURE__ */ new Map();
2246
2255
  for (const t of e) {
2247
2256
  const s = n.get(t.property);
@@ -2253,42 +2262,42 @@ function dt(e) {
2253
2262
  t.rank > s.rank && n.set(t.property, t);
2254
2263
  continue;
2255
2264
  }
2256
- const o = lt(t.specificity, s.specificity);
2257
- (o > 0 || o === 0 && t.order > s.order) && n.set(t.property, t);
2265
+ const i = dt(t.specificity, s.specificity);
2266
+ (i > 0 || i === 0 && t.order > s.order) && n.set(t.property, t);
2258
2267
  }
2259
2268
  for (const t of n.values()) t.winner = !0;
2260
2269
  return n;
2261
2270
  }
2262
- const Cn = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
2263
- function Se(e, n, t = /* @__PURE__ */ new Set()) {
2264
- var o;
2271
+ const Nn = /var\(\s*(--[^,)\s]+)\s*(?:,([^)]*))?\)/;
2272
+ function Te(e, n, t = /* @__PURE__ */ new Set()) {
2273
+ var i;
2265
2274
  let s = e;
2266
- for (let i = 0; i < 32; i++) {
2267
- const c = Cn.exec(s);
2275
+ for (let o = 0; o < 32; o++) {
2276
+ const c = Nn.exec(s);
2268
2277
  if (c === null) return s;
2269
- const u = c[1], g = (o = c[2]) == null ? void 0 : o.trim();
2278
+ const u = c[1], g = (i = c[2]) == null ? void 0 : i.trim();
2270
2279
  if (t.has(u)) return null;
2271
- const p = /* @__PURE__ */ new Set([...t, u]), l = n.get(u), d = l !== void 0 ? Se(l, n, p) : g !== void 0 && g.length > 0 ? Se(g, n, p) : null;
2272
- if (d === null) return null;
2273
- s = s.slice(0, c.index) + d + s.slice(c.index + c[0].length);
2280
+ const h = /* @__PURE__ */ new Set([...t, u]), l = n.get(u), f = l !== void 0 ? Te(l, n, h) : g !== void 0 && g.length > 0 ? Te(g, n, h) : null;
2281
+ if (f === null) return null;
2282
+ s = s.slice(0, c.index) + f + s.slice(c.index + c[0].length);
2274
2283
  }
2275
2284
  return null;
2276
2285
  }
2277
- function Rn(e, n) {
2278
- const t = ct(e, n), s = [...t.warnings], o = /* @__PURE__ */ new Map();
2279
- let i = !1;
2280
- const c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map(), p = (a, b, r) => {
2281
- const w = ut(e, a, t, u, g);
2282
- !i && w.some((v) => v.origin.kind === "builtin-theme") && (i = !0);
2283
- const y = dt(w), h = /* @__PURE__ */ new Map();
2284
- for (const [v, S] of b)
2285
- v.startsWith("--") && h.set(v, S.value);
2286
+ function Fn(e, n) {
2287
+ const t = ft(e, n), s = [...t.warnings], i = /* @__PURE__ */ new Map();
2288
+ let o = !1;
2289
+ const c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map(), h = (a, y, r) => {
2290
+ const w = pt(e, a, t, u, g);
2291
+ !o && w.some((v) => v.origin.kind === "builtin-theme") && (o = !0);
2292
+ const b = ht(w), p = /* @__PURE__ */ new Map();
2286
2293
  for (const [v, S] of y)
2287
- v.startsWith("--") && h.set(v, S.value);
2288
- const f = /* @__PURE__ */ new Map();
2289
- for (const [v, S] of b) f.set(v, S);
2290
- for (const [v, S] of y) {
2291
- const E = Se(S.value, h);
2294
+ v.startsWith("--") && p.set(v, S.value);
2295
+ for (const [v, S] of b)
2296
+ v.startsWith("--") && p.set(v, S.value);
2297
+ const d = /* @__PURE__ */ new Map();
2298
+ for (const [v, S] of y) d.set(v, S);
2299
+ for (const [v, S] of b) {
2300
+ const E = Te(S.value, p);
2292
2301
  if (E === null) {
2293
2302
  s.push({
2294
2303
  kind: "unsupported-property",
@@ -2299,78 +2308,78 @@ function Rn(e, n) {
2299
2308
  });
2300
2309
  continue;
2301
2310
  }
2302
- f.set(v, { value: E, origin: S.origin });
2311
+ d.set(v, { value: E, origin: S.origin });
2303
2312
  }
2304
- const k = /* @__PURE__ */ new Map();
2305
- for (const [v, S] of f)
2306
- Gt(v) && k.set(v, {
2313
+ const x = /* @__PURE__ */ new Map();
2314
+ for (const [v, S] of d)
2315
+ Zt(v) && x.set(v, {
2307
2316
  value: S.value,
2308
2317
  origin: { kind: "inherited", from: r, origin: S.origin }
2309
2318
  });
2310
- return { computed: f, forChildren: k };
2311
- }, l = /* @__PURE__ */ new Set(), d = (a) => {
2319
+ return { computed: d, forChildren: x };
2320
+ }, l = /* @__PURE__ */ new Set(), f = (a) => {
2312
2321
  var w;
2313
- const b = ((w = a.derived) == null ? void 0 : w.instance) ?? a.sourceNode ?? a.id, r = typeof a.sourceDocument == "string" ? a.sourceDocument : null;
2314
- Ie(e, a).forEach((y, h) => {
2315
- const f = tt(y.property, y.value);
2316
- if (f === null) return;
2317
- const k = `${a.sourceDocument ?? ""}#${b}#${h}`;
2318
- l.has(k) || (l.add(k), s.push({
2322
+ const y = ((w = a.derived) == null ? void 0 : w.instance) ?? a.sourceNode ?? a.id, r = typeof a.sourceDocument == "string" ? a.sourceDocument : null;
2323
+ Ce(e, a).forEach((b, p) => {
2324
+ const d = it(b.property, b.value);
2325
+ if (d === null) return;
2326
+ const x = `${a.sourceDocument ?? ""}#${y}#${p}`;
2327
+ l.has(x) || (l.add(x), s.push({
2319
2328
  kind: "unsupported-property",
2320
- ...f,
2329
+ ...d,
2321
2330
  node: a.id,
2322
2331
  // A span is only meaningful in the entry document's own text; a
2323
2332
  // template's declaration names its file instead.
2324
- ...r !== null ? { sourceDocument: r } : { at: { in: "uxml", span: y.span } }
2333
+ ...r !== null ? { sourceDocument: r } : { at: { in: "uxml", span: b.span } }
2325
2334
  }));
2326
2335
  });
2327
- }, m = (a, b) => {
2328
- d(a);
2329
- const r = p({ kind: "element", node: a }, b, a.id);
2330
- o.set(a.id, r.computed);
2336
+ }, m = (a, y) => {
2337
+ f(a);
2338
+ const r = h({ kind: "element", node: a }, y, a.id);
2339
+ i.set(a.id, r.computed);
2331
2340
  let w = r.forChildren;
2332
- const y = X(a).spec.parts;
2333
- if (y.length > 0) {
2334
- const h = /* @__PURE__ */ new Map();
2335
- y.forEach((f, k) => {
2336
- const v = p(
2337
- { kind: "part", owner: a, name: f.name, depth: k },
2341
+ const b = Q(a).spec.parts;
2342
+ if (b.length > 0) {
2343
+ const p = /* @__PURE__ */ new Map();
2344
+ b.forEach((d, x) => {
2345
+ const v = h(
2346
+ { kind: "part", owner: a, name: d.name, depth: x },
2338
2347
  w,
2339
2348
  a.id
2340
2349
  );
2341
- h.set(f.name, v.computed), w = v.forChildren;
2342
- }), c.set(a.id, h);
2350
+ p.set(d.name, v.computed), w = v.forChildren;
2351
+ }), c.set(a.id, p);
2343
2352
  }
2344
- for (const h of a.children) m(h, w);
2353
+ for (const p of a.children) m(p, w);
2345
2354
  };
2346
- m(e.root, /* @__PURE__ */ new Map()), i && s.push({
2355
+ m(e.root, /* @__PURE__ */ new Map()), o && s.push({
2347
2356
  kind: "version-dependent",
2348
- message: `Built-in control defaults applied, as measured on Unity ${ae}`,
2357
+ message: `Built-in control defaults applied, as measured on Unity ${ce}`,
2349
2358
  reason: "version-dependent"
2350
2359
  });
2351
2360
  for (const a of t.usable) {
2352
2361
  if (a.builtin === !0 || u.has(a)) continue;
2353
- const b = wn(a.rule.selectors);
2354
- b.length !== 0 && s.push({
2362
+ const y = $n(a.rule.selectors);
2363
+ y.length !== 0 && s.push({
2355
2364
  kind: "unsupported-selector",
2356
- message: `${b.join(", ")} matched nothing; only ${kt().join(", ")} are drawn with the parts these names refer to`,
2357
- at: { in: "uss", sheet: a.sheet, ...Y(e, a.sheet), span: a.rule.selectorSpan },
2365
+ message: `${y.join(", ")} matched nothing; only ${$t().join(", ")} are drawn with the parts these names refer to`,
2366
+ at: { in: "uss", sheet: a.sheet, ...K(e, a.sheet), span: a.rule.selectorSpan },
2358
2367
  reason: "not-rendered",
2359
- subject: { kind: "selector", selector: re(e, a), fragment: b.join(", ") },
2360
- ...G(e, a.sheet)
2368
+ subject: { kind: "selector", selector: le(e, a), fragment: y.join(", ") },
2369
+ ...X(e, a.sheet)
2361
2370
  });
2362
2371
  }
2363
- for (const [a, b] of t.declarationWarnings)
2364
- a.nodes = g.get(b) ?? [];
2365
- return { styles: o, partStyles: c, warnings: s, matchedNodes: g };
2372
+ for (const [a, y] of t.declarationWarnings)
2373
+ a.nodes = g.get(y) ?? [];
2374
+ return { styles: i, partStyles: c, warnings: s, matchedNodes: g };
2366
2375
  }
2367
- function Bn(e, n, t, s) {
2368
- const o = ct(e, s), i = ut(e, { kind: "element", node: n }, o).filter(
2376
+ function Jn(e, n, t, s) {
2377
+ const i = ft(e, s), o = pt(e, { kind: "element", node: n }, i).filter(
2369
2378
  (c) => c.property === t
2370
2379
  );
2371
- return dt(i), i;
2380
+ return ht(o), o;
2372
2381
  }
2373
- const Hn = [
2382
+ const Yn = [
2374
2383
  {
2375
2384
  id: "text-metrics",
2376
2385
  kind: "unreproducible",
@@ -2390,46 +2399,46 @@ const Hn = [
2390
2399
  detail: "The yoga-layout version this package depends on resolves a main-axis percentage against an indefinite parent differently from the Yoga vendored inside Unity 6000.0.40f1. Not configurable: no available setting reproduces Unity's answer without breaking cases that currently match. Fully deterministic and pinned to a case in docs/accuracy.md — this always reproduces the same way, it just cannot be fixed from inside this repository."
2391
2400
  }
2392
2401
  ];
2393
- function jn(e, n) {
2394
- const t = (p) => e.slice(p.start, p.end);
2395
- function s(p) {
2396
- return p.spans.closeTag !== null ? p.spans.closeTag.end : Math.max(p.spans.openTag.end, p.spans.inner.end);
2397
- }
2398
- function o(p) {
2399
- return p.includes('"') ? p.includes("'") ? `"${p.replace(/"/g, "&quot;")}"` : `'${p}'` : `"${p}"`;
2400
- }
2401
- function i(p) {
2402
- const l = p.attributes.map((m) => ` ${m.name}=${o(m.value)}`).join(""), d = _e(p.name);
2403
- return p.spans.closeTag === null ? `<${d}${l} />` : `<${d}${l}>`;
2404
- }
2405
- function c(p) {
2406
- var a, b;
2407
- const l = t(p.spans.inner), d = ((a = /^[ \t]*\r?\n[ \t]*/.exec(l)) == null ? void 0 : a[0]) ?? "", m = ((b = /\r?\n[ \t]*$/.exec(l)) == null ? void 0 : b[0]) ?? "";
2408
- return { between: d, before: d, after: m };
2409
- }
2410
- function u(p) {
2411
- const { inner: l } = p.spans;
2412
- if (p.children.length === 0) return t(l);
2413
- if (p.childrenDirty) {
2414
- const { between: a, before: b, after: r } = c(p);
2415
- return b + p.children.map(g).join(a) + r;
2416
- }
2417
- let d = "", m = l.start;
2418
- for (const a of p.children)
2419
- d += e.slice(m, a.spans.openTag.start), d += g(a), m = s(a);
2420
- return d + e.slice(m, l.end);
2421
- }
2422
- function g(p) {
2423
- const l = p.tagDirty ? i(p) : t(p.spans.openTag), d = p.spans.closeTag === null ? "" : t(p.spans.closeTag);
2424
- return l + u(p) + d;
2402
+ function Ln(e, n) {
2403
+ const t = (h) => e.slice(h.start, h.end);
2404
+ function s(h) {
2405
+ return h.spans.closeTag !== null ? h.spans.closeTag.end : Math.max(h.spans.openTag.end, h.spans.inner.end);
2406
+ }
2407
+ function i(h) {
2408
+ return h.includes('"') ? h.includes("'") ? `"${h.replace(/"/g, "&quot;")}"` : `'${h}'` : `"${h}"`;
2409
+ }
2410
+ function o(h) {
2411
+ const l = h.attributes.map((m) => ` ${m.name}=${i(m.value)}`).join(""), f = Ve(h.name);
2412
+ return h.spans.closeTag === null ? `<${f}${l} />` : `<${f}${l}>`;
2413
+ }
2414
+ function c(h) {
2415
+ var a, y;
2416
+ const l = t(h.spans.inner), f = ((a = /^[ \t]*\r?\n[ \t]*/.exec(l)) == null ? void 0 : a[0]) ?? "", m = ((y = /\r?\n[ \t]*$/.exec(l)) == null ? void 0 : y[0]) ?? "";
2417
+ return { between: f, before: f, after: m };
2418
+ }
2419
+ function u(h) {
2420
+ const { inner: l } = h.spans;
2421
+ if (h.children.length === 0) return t(l);
2422
+ if (h.childrenDirty) {
2423
+ const { between: a, before: y, after: r } = c(h);
2424
+ return y + h.children.map(g).join(a) + r;
2425
+ }
2426
+ let f = "", m = l.start;
2427
+ for (const a of h.children)
2428
+ f += e.slice(m, a.spans.openTag.start), f += g(a), m = s(a);
2429
+ return f + e.slice(m, l.end);
2430
+ }
2431
+ function g(h) {
2432
+ const l = h.tagDirty ? o(h) : t(h.spans.openTag), f = h.spans.closeTag === null ? "" : t(h.spans.closeTag);
2433
+ return l + u(h) + f;
2425
2434
  }
2426
2435
  return e.slice(0, n.spans.openTag.start) + g(n) + e.slice(s(n));
2427
2436
  }
2428
- function Nn(e) {
2437
+ function Un(e) {
2429
2438
  const n = e.source, t = (l) => n.slice(l.start, l.end);
2430
2439
  function s(l) {
2431
- return l.parts.map((d, m) => {
2432
- const a = m === 0 ? "" : d.combinator === "child" ? " > " : " ", b = d.simple.map((r) => {
2440
+ return l.parts.map((f, m) => {
2441
+ const a = m === 0 ? "" : f.combinator === "child" ? " > " : " ", y = f.simple.map((r) => {
2433
2442
  switch (r.kind) {
2434
2443
  case "universal":
2435
2444
  return "*";
@@ -2445,154 +2454,154 @@ function Nn(e) {
2445
2454
  return r.text;
2446
2455
  }
2447
2456
  }).join("");
2448
- return a + b;
2457
+ return a + y;
2449
2458
  }).join("");
2450
2459
  }
2451
- function o(l) {
2452
- var w, y;
2453
- const d = l.declarations[0];
2454
- if (d === void 0) return { between: "", before: "", after: "" };
2460
+ function i(l) {
2461
+ var w, b;
2462
+ const f = l.declarations[0];
2463
+ if (f === void 0) return { between: "", before: "", after: "" };
2455
2464
  const m = n.lastIndexOf(`
2456
- `, d.span.start), a = m < 0 ? "" : n.slice(m, d.span.start), b = n.slice(l.selectorSpan.end, l.span.end), r = ((y = (w = /\r?\n[ \t]*\}$/.exec(b)) == null ? void 0 : w[0]) == null ? void 0 : y.replace(/\}$/, "")) ?? "";
2465
+ `, f.span.start), a = m < 0 ? "" : n.slice(m, f.span.start), y = n.slice(l.selectorSpan.end, l.span.end), r = ((b = (w = /\r?\n[ \t]*\}$/.exec(y)) == null ? void 0 : w[0]) == null ? void 0 : b.replace(/\}$/, "")) ?? "";
2457
2466
  return { between: `;${a}`, before: a, after: `;${r}` };
2458
2467
  }
2459
- function i(l) {
2460
- const d = l.selectorDirty ? l.selectors.map(s).join(", ") : t(l.selectorSpan);
2468
+ function o(l) {
2469
+ const f = l.selectorDirty ? l.selectors.map(s).join(", ") : t(l.selectorSpan);
2461
2470
  if (l.declarations.length === 0)
2462
- return d + n.slice(l.selectorSpan.end, l.span.end);
2471
+ return f + n.slice(l.selectorSpan.end, l.span.end);
2463
2472
  const m = n.slice(l.selectorSpan.end, l.declarations[0].span.start);
2464
2473
  if (l.declarationsDirty) {
2465
- const { between: r, before: w, after: y } = o(l), h = m.slice(0, m.indexOf("{") + 1), f = l.declarations.map(c).join(r);
2466
- return `${d}${h}${w}${f}${y}}`;
2474
+ const { between: r, before: w, after: b } = i(l), p = m.slice(0, m.indexOf("{") + 1), d = l.declarations.map(c).join(r);
2475
+ return `${f}${p}${w}${d}${b}}`;
2467
2476
  }
2468
- let a = d, b = l.selectorSpan.end;
2477
+ let a = f, y = l.selectorSpan.end;
2469
2478
  for (const r of l.declarations)
2470
- a += n.slice(b, r.span.start), a += c(r), b = r.span.end;
2471
- return a + n.slice(b, l.span.end);
2479
+ a += n.slice(y, r.span.start), a += c(r), y = r.span.end;
2480
+ return a + n.slice(y, l.span.end);
2472
2481
  }
2473
2482
  function c(l) {
2474
2483
  return l.dirty ? `${l.property}: ${l.value}` : t(l.span);
2475
2484
  }
2476
2485
  function u(l) {
2477
- return l.kind === "rule" ? i(l.rule) : t(l.span);
2486
+ return l.kind === "rule" ? o(l.rule) : t(l.span);
2478
2487
  }
2479
- let g = "", p = 0;
2488
+ let g = "", h = 0;
2480
2489
  for (const l of e.items) {
2481
- const d = l.kind === "rule" ? l.rule.span : l.span;
2482
- g += n.slice(p, d.start), g += u(l), p = d.end;
2490
+ const f = l.kind === "rule" ? l.rule.span : l.span;
2491
+ g += n.slice(h, f.start), g += u(l), h = f.end;
2483
2492
  }
2484
- return g + n.slice(p);
2493
+ return g + n.slice(h);
2485
2494
  }
2486
- function An(e, n, t, s) {
2487
- const o = /* @__PURE__ */ new Map();
2488
- if (s === void 0) return { fonts: o, warnings: [...n] };
2489
- const i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = (p, l, d) => {
2495
+ function zn(e, n, t, s) {
2496
+ const i = /* @__PURE__ */ new Map();
2497
+ if (s === void 0) return { fonts: i, warnings: [...n] };
2498
+ const o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = (h, l, f) => {
2490
2499
  for (; l.kind === "inherited"; ) l = l.origin;
2491
2500
  const m = t(l);
2492
2501
  return JSON.stringify([
2493
- p,
2502
+ h,
2494
2503
  m.sourceDocument,
2495
2504
  m.at,
2496
- m.at === void 0 ? l.kind === "inline" ? l.node : d : null
2505
+ m.at === void 0 ? l.kind === "inline" ? l.node : f : null
2497
2506
  ]);
2498
2507
  };
2499
- for (const [p, l] of e)
2500
- for (const d of ["-unity-font", "-unity-font-definition"]) {
2501
- const m = l.get(d);
2508
+ for (const [h, l] of e)
2509
+ for (const f of ["-unity-font", "-unity-font-definition"]) {
2510
+ const m = l.get(f);
2502
2511
  if (m === void 0) continue;
2503
- const a = st(m.value);
2512
+ const a = rt(m.value);
2504
2513
  if (a === null) continue;
2505
- const b = JSON.stringify([a.path, a.form]);
2506
- if (!i.has(b)) {
2507
- const h = s(a.path, a.form);
2508
- i.set(b, typeof h == "string" ? { family: h } : h);
2514
+ const y = JSON.stringify([a.path, a.form]);
2515
+ if (!o.has(y)) {
2516
+ const p = s(a.path, a.form);
2517
+ o.set(y, typeof p == "string" ? { family: p } : p);
2509
2518
  }
2510
- const r = i.get(b);
2519
+ const r = o.get(y);
2511
2520
  let w = m.origin;
2512
2521
  for (; w.kind === "inherited"; ) w = w.origin;
2513
- const y = u(d, w, p);
2514
- c.has(y) || c.set(y, r === null ? {
2522
+ const b = u(f, w, h);
2523
+ c.has(b) || c.set(b, r === null ? {
2515
2524
  kind: "asset-unresolved",
2516
- message: `${d}: "${a.path}" was not resolved`,
2517
- node: w.kind === "inline" ? w.node : p,
2525
+ message: `${f}: "${a.path}" was not resolved`,
2526
+ node: w.kind === "inline" ? w.node : h,
2518
2527
  subject: { kind: "asset", ...a, role: "font" },
2519
2528
  ...t(w)
2520
- } : null), d === "-unity-font-definition" && o.delete(l), r !== null && o.set(l, r);
2529
+ } : null), f === "-unity-font-definition" && i.delete(l), r !== null && i.set(l, r);
2521
2530
  }
2522
- const g = n.filter((p) => {
2523
- var d;
2524
- if (p.reason !== "not-rendered" || ((d = p.subject) == null ? void 0 : d.kind) !== "property") return !0;
2531
+ const g = n.filter((h) => {
2532
+ var f;
2533
+ if (h.reason !== "not-rendered" || ((f = h.subject) == null ? void 0 : f.kind) !== "property") return !0;
2525
2534
  const l = JSON.stringify([
2526
- p.subject.property,
2527
- p.sourceDocument,
2528
- p.at,
2529
- p.at === void 0 ? p.node : null
2535
+ h.subject.property,
2536
+ h.sourceDocument,
2537
+ h.at,
2538
+ h.at === void 0 ? h.node : null
2530
2539
  ]);
2531
2540
  return !c.has(l);
2532
2541
  });
2533
- return { fonts: o, warnings: [...g, ...[...c.values()].filter((p) => p !== null)] };
2542
+ return { fonts: i, warnings: [...g, ...[...c.values()].filter((h) => h !== null)] };
2534
2543
  }
2535
- function Vn(e) {
2544
+ function Kn(e) {
2536
2545
  const n = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), s = (c) => {
2537
2546
  n.set(c.id, c);
2538
2547
  for (const u of c.children)
2539
2548
  t.set(u.id, c.id), s(u);
2540
2549
  };
2541
2550
  e.document !== void 0 && s(e.document.root);
2542
- const o = /* @__PURE__ */ new Map(), i = (c) => {
2543
- var p, l, d, m;
2544
- const u = o.get(c);
2551
+ const i = /* @__PURE__ */ new Map(), o = (c) => {
2552
+ var h, l, f, m;
2553
+ const u = i.get(c);
2545
2554
  if (u !== void 0) return u;
2546
2555
  let g;
2547
2556
  for (let a = c; a !== void 0; a = t.get(a)) {
2548
- const b = (l = (p = e.styles) == null ? void 0 : p.get(a)) == null ? void 0 : l.get("display");
2549
- if ((b == null ? void 0 : b.value) === "none") {
2550
- g = { kind: "hidden", by: a, origin: b.origin };
2557
+ const y = (l = (h = e.styles) == null ? void 0 : h.get(a)) == null ? void 0 : l.get("display");
2558
+ if ((y == null ? void 0 : y.value) === "none") {
2559
+ g = { kind: "hidden", by: a, origin: y.origin };
2551
2560
  break;
2552
2561
  }
2553
2562
  }
2554
2563
  if (g === void 0) {
2555
2564
  const a = e.boxes.get(c);
2556
2565
  if (a.width === 0 || a.height === 0) {
2557
- const b = (d = e.styles) == null ? void 0 : d.get(c), r = ["width", "height"].some((y) => {
2558
- var h;
2559
- return /^-?0+(\.0+)?(px|%)?$/.test(((h = b == null ? void 0 : b.get(y)) == null ? void 0 : h.value) ?? "");
2560
- }), w = ((m = n.get(c)) == null ? void 0 : m.children.filter((y) => e.boxes.has(y.id))) ?? [];
2561
- g = !r && w.length > 0 && w.every((y) => {
2562
- const h = i(y.id).kind;
2563
- return h === "hidden" || h === "emptied";
2566
+ const y = (f = e.styles) == null ? void 0 : f.get(c), r = ["width", "height"].some((b) => {
2567
+ var p;
2568
+ return /^-?0+(\.0+)?(px|%)?$/.test(((p = y == null ? void 0 : y.get(b)) == null ? void 0 : p.value) ?? "");
2569
+ }), w = ((m = n.get(c)) == null ? void 0 : m.children.filter((b) => e.boxes.has(b.id))) ?? [];
2570
+ g = !r && w.length > 0 && w.every((b) => {
2571
+ const p = o(b.id).kind;
2572
+ return p === "hidden" || p === "emptied";
2564
2573
  }) ? { kind: "emptied" } : { kind: "collapsed", explicitZero: r };
2565
2574
  } else g = { kind: "shown" };
2566
2575
  }
2567
- return o.set(c, g), g;
2576
+ return i.set(c, g), g;
2568
2577
  };
2569
- for (const c of e.boxes.keys()) i(c);
2570
- return o;
2578
+ for (const c of e.boxes.keys()) o(c);
2579
+ return i;
2571
2580
  }
2572
- St(
2573
- (e, n) => n === void 0 ? Fe(e) : Fe(e, void 0, { resolveImport: n })
2581
+ Et(
2582
+ (e, n) => n === void 0 ? Be(e) : Be(e, void 0, { resolveImport: n })
2574
2583
  );
2575
- function ft(e, n = []) {
2584
+ function mt(e, n = []) {
2576
2585
  var t;
2577
2586
  for (const s of e.children) {
2578
2587
  if (s.name.local === "Style") {
2579
- const o = (t = s.attributes.find((i) => i.name === "src")) == null ? void 0 : t.value;
2580
- o !== void 0 && o.length > 0 && n.push({ url: Z(o), scope: e.id });
2588
+ const i = (t = s.attributes.find((o) => o.name === "src")) == null ? void 0 : t.value;
2589
+ i !== void 0 && i.length > 0 && n.push({ url: ee(i), scope: e.id });
2581
2590
  }
2582
- ft(s, n);
2591
+ mt(s, n);
2583
2592
  }
2584
2593
  return n;
2585
2594
  }
2586
- function Ln(e) {
2595
+ function Pn(e) {
2587
2596
  return e.startsWith("project://") || e.startsWith("/");
2588
2597
  }
2589
- function Fe(e, n, t) {
2590
- var p, l, d;
2591
- const s = We(e), o = [...s.warnings], i = [], c = [], u = [];
2592
- for (const { url: m, scope: a } of ft(s.root)) {
2593
- const b = ((p = t == null ? void 0 : t.resolveImport) == null ? void 0 : p.call(t, m, null)) ?? null;
2594
- if (b === null) {
2595
- o.push({
2598
+ function Be(e, n, t) {
2599
+ var h, l, f;
2600
+ const s = He(e), i = [...s.warnings], o = [], c = [], u = [];
2601
+ for (const { url: m, scope: a } of mt(s.root)) {
2602
+ const y = ((h = t == null ? void 0 : t.resolveImport) == null ? void 0 : h.call(t, m, null)) ?? null;
2603
+ if (y === null) {
2604
+ i.push({
2596
2605
  kind: "import-unresolved",
2597
2606
  message: (t == null ? void 0 : t.resolveImport) === void 0 ? `<Style src="${m}"> was not loaded: pass resolveImport to read it, or pass the stylesheet text directly. Until then this document renders unstyled.` : `<Style src="${m}"> could not be resolved`,
2598
2607
  node: s.root.id,
@@ -2600,131 +2609,131 @@ function Fe(e, n, t) {
2600
2609
  });
2601
2610
  continue;
2602
2611
  }
2603
- u.push({ text: b, origin: m, scope: a });
2612
+ u.push({ text: y, origin: m, scope: a });
2604
2613
  }
2605
2614
  if (n !== void 0 || u.length > 0) {
2606
2615
  const m = /* @__PURE__ */ new Map(), a = [];
2607
- let b = 0;
2616
+ let y = 0;
2608
2617
  for (const r of u) {
2609
- const w = b++;
2618
+ const w = y++;
2610
2619
  a.push({ text: r.text, origin: r.origin, sheet: w }), c.push({ sheet: w, scope: r.scope });
2611
2620
  }
2612
2621
  if (n !== void 0) {
2613
- const r = b++;
2622
+ const r = y++;
2614
2623
  a.push({ text: n, origin: null, sheet: r }), c.push({ sheet: r, scope: s.root.id });
2615
2624
  }
2616
2625
  for (; a.length > 0; ) {
2617
- const r = a.shift(), w = r.sheet, y = Oe(r.text, r.origin, w);
2618
- i.push(y.sheet), o.push(...y.warnings);
2619
- for (const h of y.sheet.items) {
2620
- if (h.kind !== "import") continue;
2621
- const f = Ln(h.url) ? h.url : JSON.stringify([h.url, r.origin]);
2622
- if (m.has(f)) {
2623
- const S = m.get(f);
2624
- S != null && (h.resolvedSheet = S);
2626
+ const r = a.shift(), w = r.sheet, b = De(r.text, r.origin, w);
2627
+ o.push(b.sheet), i.push(...b.warnings);
2628
+ for (const p of b.sheet.items) {
2629
+ if (p.kind !== "import") continue;
2630
+ const d = Pn(p.url) ? p.url : JSON.stringify([p.url, r.origin]);
2631
+ if (m.has(d)) {
2632
+ const S = m.get(d);
2633
+ S != null && (p.resolvedSheet = S);
2625
2634
  continue;
2626
2635
  }
2627
- m.set(f, null);
2628
- const k = ((l = t == null ? void 0 : t.resolveImport) == null ? void 0 : l.call(t, h.url, r.origin)) ?? null;
2629
- if (k === null) {
2630
- o.push({
2636
+ m.set(d, null);
2637
+ const x = ((l = t == null ? void 0 : t.resolveImport) == null ? void 0 : l.call(t, p.url, r.origin)) ?? null;
2638
+ if (x === null) {
2639
+ i.push({
2631
2640
  kind: "import-unresolved",
2632
- message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${h.url}" was not loaded: pass resolveImport to read it` : `@import "${h.url}" could not be resolved`,
2633
- at: { in: "uss", sheet: w, span: h.span },
2634
- subject: { kind: "import", url: h.url, from: r.origin }
2641
+ message: (t == null ? void 0 : t.resolveImport) === void 0 ? `@import "${p.url}" was not loaded: pass resolveImport to read it` : `@import "${p.url}" could not be resolved`,
2642
+ at: { in: "uss", sheet: w, span: p.span },
2643
+ subject: { kind: "import", url: p.url, from: r.origin }
2635
2644
  });
2636
2645
  continue;
2637
2646
  }
2638
- const v = b++;
2639
- m.set(f, v), h.resolvedSheet = v, a.push({ text: k, origin: h.url, sheet: v });
2647
+ const v = y++;
2648
+ m.set(d, v), p.resolvedSheet = v, a.push({ text: x, origin: p.url, sheet: v });
2640
2649
  }
2641
2650
  }
2642
2651
  }
2643
- const g = { source: e, root: s.root, sheets: i, styleRoots: c, warnings: o };
2644
- for (const m of o)
2645
- ((d = m.at) == null ? void 0 : d.in) === "uss" && Object.assign(m.at, Y(g, m.at.sheet));
2646
- return $t(g, t == null ? void 0 : t.resolveImport), g;
2652
+ const g = { source: e, root: s.root, sheets: o, styleRoots: c, warnings: i };
2653
+ for (const m of i)
2654
+ ((f = m.at) == null ? void 0 : f.in) === "uss" && Object.assign(m.at, K(g, m.at.sheet));
2655
+ return Ot(g, t == null ? void 0 : t.resolveImport), g;
2647
2656
  }
2648
- function qn(e) {
2657
+ function Gn(e) {
2649
2658
  const n = e.sheets[0];
2650
2659
  return {
2651
- uxml: jn(e.source, e.root),
2660
+ uxml: Ln(e.source, e.root),
2652
2661
  // Only the sheet passed to `parse` round-trips. `@import`ed sheets (Phase 3)
2653
2662
  // are separate files and are not this function's to write.
2654
- uss: n === void 0 ? "" : Nn(n)
2663
+ uss: n === void 0 ? "" : Un(n)
2655
2664
  };
2656
2665
  }
2657
- function Un(e) {
2666
+ function _n(e) {
2658
2667
  const n = /* @__PURE__ */ new Map(), t = [];
2659
2668
  for (const s of e) {
2660
- const o = { ...s }, i = o.at === void 0 ? void 0 : JSON.stringify([o.kind, o.message, o.sourceDocument ?? null, o.at]);
2661
- (i === void 0 ? void 0 : n.get(i)) === void 0 && (i !== void 0 && n.set(i, o), t.push(o));
2669
+ const i = { ...s }, o = i.at === void 0 ? void 0 : JSON.stringify([i.kind, i.message, i.sourceDocument ?? null, i.at]);
2670
+ (o === void 0 ? void 0 : n.get(o)) === void 0 && (o !== void 0 && n.set(o, i), t.push(i));
2662
2671
  }
2663
2672
  return t;
2664
2673
  }
2665
- function Yn(e, n, t) {
2666
- const s = n.ownerDocument, o = (t == null ? void 0 : t.size) ?? {
2674
+ function Xn(e, n, t) {
2675
+ const s = n.ownerDocument, i = (t == null ? void 0 : t.size) ?? {
2667
2676
  width: n.clientWidth,
2668
2677
  height: n.clientHeight
2669
- }, i = Lt(e), c = i.document, u = Rn(c, {
2678
+ }, o = zt(e), c = o.document, u = Fn(c, {
2670
2679
  ...(t == null ? void 0 : t.activeStates) === void 0 ? {} : { activeStates: t.activeStates },
2671
2680
  ...(t == null ? void 0 : t.states) === void 0 ? {} : { states: t.states }
2672
- }), g = (t == null ? void 0 : t.measureText) ?? ln(s), p = Mn(c, u.matchedNodes), l = An(u.styles, u.warnings, p, t == null ? void 0 : t.resolveFont), d = on(c.root, u.styles, u.partStyles, {
2673
- size: o,
2681
+ }), g = (t == null ? void 0 : t.measureText) ?? fn(s), h = jn(c, u.matchedNodes), l = zn(u.styles, u.warnings, h, t == null ? void 0 : t.resolveFont), f = ln(c.root, u.styles, u.partStyles, {
2682
+ size: i,
2674
2683
  measureText: g,
2675
2684
  fonts: l.fonts,
2676
- locate: p
2685
+ locate: h
2677
2686
  });
2678
2687
  let m;
2679
2688
  try {
2680
- m = gn(c.root, d.boxes, d.parts, u.styles, n, {
2689
+ m = wn(c.root, f.boxes, f.parts, u.styles, n, {
2681
2690
  document: s,
2682
2691
  fonts: l.fonts,
2683
2692
  resolveAsset: t == null ? void 0 : t.resolveAsset,
2684
- locate: p
2693
+ locate: h
2685
2694
  });
2686
- } catch (b) {
2687
- throw d.dispose(), b;
2695
+ } catch (y) {
2696
+ throw f.dispose(), y;
2688
2697
  }
2689
2698
  let a = !1;
2690
2699
  return {
2691
- warnings: Un([
2692
- ...i.warnings,
2700
+ warnings: _n([
2701
+ ...o.warnings,
2693
2702
  ...l.warnings,
2694
- ...d.warnings,
2703
+ ...f.warnings,
2695
2704
  ...m.warnings
2696
2705
  ]),
2697
2706
  elements: m.elements,
2698
- boxes: d.boxes,
2707
+ boxes: f.boxes,
2699
2708
  document: c,
2700
2709
  styles: u.styles,
2701
2710
  partStyles: u.partStyles,
2702
2711
  dispose() {
2703
- a || (a = !0, d.dispose(), n.replaceChildren());
2712
+ a || (a = !0, f.dispose(), n.replaceChildren());
2704
2713
  }
2705
2714
  };
2706
2715
  }
2707
2716
  export {
2708
- rn as EDITOR_DEFAULT_FACE_INFO,
2709
- Hn as KNOWN_DIVERGENCES,
2710
- pn as NODE_ATTRIBUTE,
2711
- hn as PART_ATTRIBUTE,
2712
- mn as PART_OWNER_ATTRIBUTE,
2713
- Re as TEMPLATE_DEPTH_LIMIT,
2714
- be as USS_STATES,
2715
- Vn as classifyVisibility,
2716
- Fn as collectDependencies,
2717
- ln as createDefaultMeasureText,
2718
- Lt as expandTemplates,
2719
- Bn as explainProperty,
2720
- Gt as isInherited,
2721
- Wn as isLayoutEngineReady,
2722
- _n as liveNodeCount,
2723
- Pn as loadLayoutEngine,
2724
- Fe as parse,
2725
- Yn as render,
2726
- Rn as resolveStyles,
2727
- qn as serialize,
2728
- kt as supportedControlNames,
2729
- an as textHeight
2717
+ cn as EDITOR_DEFAULT_FACE_INFO,
2718
+ Yn as KNOWN_DIVERGENCES,
2719
+ yn as NODE_ATTRIBUTE,
2720
+ bn as PART_ATTRIBUTE,
2721
+ vn as PART_OWNER_ATTRIBUTE,
2722
+ Ne as TEMPLATE_DEPTH_LIMIT,
2723
+ we as USS_STATES,
2724
+ Kn as classifyVisibility,
2725
+ Wn as collectDependencies,
2726
+ fn as createDefaultMeasureText,
2727
+ zt as expandTemplates,
2728
+ Jn as explainProperty,
2729
+ Zt as isInherited,
2730
+ Vn as isLayoutEngineReady,
2731
+ qn as liveNodeCount,
2732
+ Hn as loadLayoutEngine,
2733
+ Be as parse,
2734
+ Xn as render,
2735
+ Fn as resolveStyles,
2736
+ Gn as serialize,
2737
+ $t as supportedControlNames,
2738
+ un as textHeight
2730
2739
  };