render-tag 0.1.23 → 0.1.25

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/lib/path/index.js CHANGED
@@ -31,7 +31,7 @@
31
31
  */
32
32
  import { parseHTML } from '../parse.js';
33
33
  import { resolveStylesFromCSS, paintOrderHasStrokeFirst } from '../css-resolver.js';
34
- import { applyFont, isTransparent } from '../layout.js';
34
+ import { applyFont, isTransparent, hasTextClip } from '../layout.js';
35
35
  import { parseTextShadows, parseLinearGradient, drawDecorationLine, decorationThickness, textFillColor, applyTextStroke, } from '../render.js';
36
36
  import { pathFromString } from './svg-path.js';
37
37
  import { flattenSegments, layoutGlyphsOnPath, baselineLocalY, } from './glyph-layout.js';
@@ -86,7 +86,7 @@ export function drawTextOnPathLayout(config) {
86
86
  try {
87
87
  drawBackgrounds(ctx, layout.glyphs, tb);
88
88
  drawShadowsAndGlyphs(ctx, layout.glyphs, layout.textWidth, tb);
89
- drawDecorations(ctx, layout.glyphs, tb);
89
+ drawDecorations(ctx, layout.glyphs, layout.textWidth, tb);
90
90
  }
91
91
  finally {
92
92
  ctx.restore();
@@ -152,16 +152,20 @@ function canonicalColor(ctx, color) {
152
152
  * group as a curve-following polygon (top edge + bottom edge).
153
153
  */
154
154
  function drawBackgrounds(ctx, glyphs, tb) {
155
+ // With background-clip:text the background is NOT painted as a polygon —
156
+ // it's clipped to the glyphs (painted as the glyph fill), same as renderBox.
157
+ const paintsBox = (g) => !isTransparent(g.style.backgroundColor) && g.style.webkitBackgroundClip !== 'text';
155
158
  let i = 0;
156
159
  while (i < glyphs.length) {
157
- const bg = glyphs[i].style.backgroundColor;
158
- if (!bg || isTransparent(bg)) {
160
+ if (!paintsBox(glyphs[i])) {
159
161
  i++;
160
162
  continue;
161
163
  }
164
+ const bg = glyphs[i].style.backgroundColor;
162
165
  const canon = canonicalColor(ctx, bg);
163
166
  let j = i + 1;
164
167
  while (j < glyphs.length &&
168
+ paintsBox(glyphs[j]) &&
165
169
  canonicalColor(ctx, glyphs[j].style.backgroundColor) === canon)
166
170
  j++;
167
171
  fillGlyphPolygon(ctx, glyphs.slice(i, j), bg, tb);
@@ -212,6 +216,56 @@ function fillGlyphPolygon(ctx, group, fill, tb) {
212
216
  ctx.restore();
213
217
  }
214
218
  // ─── Pass 2: Shadows + glyph fill/stroke ─────────────────────────────
219
+ /** True when the glyph's own fill paints nothing (both transparency channels). */
220
+ function isFillTransparent(style) {
221
+ // Mirror the main renderer's transparency check: EITHER -webkit-text-fill-color
222
+ // or color being 'transparent' suppresses the fill. textFillColor alone
223
+ // would only catch one of the two by falling back through the precedence.
224
+ return style.webkitTextFillColor === 'transparent' ||
225
+ style.color === 'transparent' ||
226
+ isTransparent(textFillColor(style));
227
+ }
228
+ /**
229
+ * The background-clip:text paint for one glyph, in the glyph's local rotated
230
+ * frame: a gradient sliced from the DECLARING element's fragment range (so
231
+ * neighbouring glyphs stitch into one continuous color curve along the path,
232
+ * and a sub-span's gradient spans the sub-span — not the whole text), else the
233
+ * declarer's solid background-color. Null when the glyph has no clip paint.
234
+ */
235
+ function clipPaintFor(ctx, g, textWidth, baseY) {
236
+ const src = g.clipStyle ?? (hasTextClip(g.style) ? g.style : undefined);
237
+ if (!src)
238
+ return null;
239
+ const range = g.clipRange ?? { start: 0, width: textWidth };
240
+ const gradient = src.backgroundImage && src.backgroundImage !== 'none'
241
+ ? parseLinearGradient(ctx, src.backgroundImage, range.start - g.pathOffset, range.width, baseY - g.ascent, g.ascent + g.descent)
242
+ : null;
243
+ return gradient ?? (!isTransparent(src.backgroundColor) ? src.backgroundColor : null);
244
+ }
245
+ /** The gradient stroke paint (--rt-text-stroke-image) for one glyph, sliced
246
+ * from the declaring element's fragment range in the glyph's local frame. */
247
+ function strokePaintFor(ctx, g, textWidth, baseY) {
248
+ const src = g.strokeImageStyle;
249
+ if (!src)
250
+ return null;
251
+ const range = g.strokeImageRange ?? { start: 0, width: textWidth };
252
+ return parseLinearGradient(ctx, src.webkitTextStrokeImage, range.start - g.pathOffset, range.width, baseY - g.ascent, g.ascent + g.descent);
253
+ }
254
+ /**
255
+ * What actually fills this glyph, mirroring the main renderer's precedence:
256
+ * the nearest clip declarer's paint when the glyph's own style declares the
257
+ * clip (a text run copies its parent element's style) or when its own fill is
258
+ * transparent (an opaque own color wins over an ancestor's clipped
259
+ * background); else the solid fill; null = nothing fills.
260
+ */
261
+ function effectiveFillPaint(ctx, g, textWidth, baseY) {
262
+ const usesClipPaint = hasTextClip(g.style) ||
263
+ (g.clipStyle != null && isFillTransparent(g.style));
264
+ if (usesClipPaint) {
265
+ return clipPaintFor(ctx, g, textWidth, baseY);
266
+ }
267
+ return isFillTransparent(g.style) ? null : textFillColor(g.style);
268
+ }
215
269
  /**
216
270
  * Iterate glyphs once. For each: draw the configured text-shadow stack (if
217
271
  * any), then fill (possibly through a sliced gradient) and stroke per
@@ -234,8 +288,13 @@ function drawShadowsAndGlyphs(ctx, glyphs, textWidth, tb) {
234
288
  // Always assign so a stale value from earlier glyphs doesn't leak.
235
289
  ctx.letterSpacing = `${g.style.letterSpacing || 0}px`;
236
290
  const baseY = baselineLocalY(tb, g.ascent, g.descent);
237
- // Shadow pass drawn underneath the glyph fill. Multi-shadow stacks
238
- // paint last-listed-first so the first declared shadow is on top.
291
+ const fill = effectiveFillPaint(ctx, g, textWidth, baseY);
292
+ const strokeGradient = strokePaintFor(ctx, g, textWidth, baseY);
293
+ const isStroked = g.style.webkitTextStrokeWidth > 0;
294
+ // Shadow pass — drawn underneath the glyph paint. Cast the shadow from
295
+ // what is actually painted: the effective fill (solid or gradient) when
296
+ // visible, and/or the stroke — matching the main renderer. Multi-shadow
297
+ // stacks paint last-listed-first so the first declared shadow is on top.
239
298
  const shadows = parseTextShadows(g.style.textShadow);
240
299
  if (shadows.length > 0) {
241
300
  for (let i = shadows.length - 1; i >= 0; i--) {
@@ -245,49 +304,38 @@ function drawShadowsAndGlyphs(ctx, glyphs, textWidth, tb) {
245
304
  ctx.shadowOffsetY = sh.offsetY;
246
305
  ctx.shadowBlur = sh.blur;
247
306
  ctx.shadowColor = sh.color;
248
- ctx.fillStyle = textFillColor(g.style);
249
- ctx.fillText(g.char, 0, baseY);
307
+ if (fill) {
308
+ ctx.fillStyle = fill;
309
+ ctx.fillText(g.char, 0, baseY);
310
+ }
311
+ if (isStroked) {
312
+ applyTextStroke(ctx, g.style, strokeGradient);
313
+ ctx.strokeText(g.char, 0, baseY);
314
+ }
250
315
  ctx.restore();
251
316
  }
252
317
  }
253
- drawGlyphFillAndStroke(ctx, g, textWidth, baseY);
318
+ drawGlyphFillAndStroke(ctx, g, baseY, fill, strokeGradient);
254
319
  ctx.restore();
255
320
  }
256
321
  }
257
- function drawGlyphFillAndStroke(ctx, g, textWidth, baseY) {
322
+ function drawGlyphFillAndStroke(ctx, g, baseY, fill, strokeGradient) {
258
323
  const { style } = g;
259
- // Mirror the main renderer's transparency check: EITHER -webkit-text-fill-color
260
- // or color being 'transparent' suppresses the fill. textFillColor alone
261
- // would only catch one of the two by falling back through the precedence.
262
- const fillTransparent = style.webkitTextFillColor === 'transparent' ||
263
- style.color === 'transparent' ||
264
- isTransparent(textFillColor(style));
265
324
  const isStroked = style.webkitTextStrokeWidth > 0;
266
- const usesGradient = style.webkitBackgroundClip === 'text' &&
267
- style.backgroundImage && style.backgroundImage !== 'none';
268
325
  // Use the canonical helper instead of an ad-hoc regex — paint-order tokens
269
326
  // are positional ("fill stroke" = fill first), not a flag bag.
270
327
  const paintStrokeFirst = paintOrderHasStrokeFirst(style.paintOrder || '');
271
328
  const drawFill = () => {
272
- if (usesGradient) {
273
- drawGradientGlyph(ctx, g, textWidth, baseY);
329
+ if (!fill)
274
330
  return;
275
- }
276
- if (fillTransparent) {
277
- if (isStroked)
278
- return;
279
- ctx.fillStyle = 'transparent';
280
- ctx.fillText(g.char, 0, baseY);
281
- return;
282
- }
283
- ctx.fillStyle = textFillColor(style);
331
+ ctx.fillStyle = fill;
284
332
  ctx.fillText(g.char, 0, baseY);
285
333
  };
286
334
  const drawStroke = () => {
287
335
  if (!isStroked)
288
336
  return;
289
337
  ctx.save();
290
- applyTextStroke(ctx, style);
338
+ applyTextStroke(ctx, style, strokeGradient);
291
339
  ctx.strokeText(g.char, 0, baseY);
292
340
  ctx.restore();
293
341
  };
@@ -300,27 +348,6 @@ function drawGlyphFillAndStroke(ctx, g, textWidth, baseY) {
300
348
  drawStroke();
301
349
  }
302
350
  }
303
- /**
304
- * Render one glyph with a gradient fill that flows along the path. The
305
- * gradient is created once per glyph spanning the FULL text width in the
306
- * glyph's local rotated frame, offset so the glyph's slice lines up with
307
- * the global gradient. Neighbouring glyphs stitch into one continuous color
308
- * curve when viewed along the path.
309
- */
310
- function drawGradientGlyph(ctx, g, textWidth, baseY) {
311
- // The gradient is laid out from (-pathOffset, *) to (textWidth-pathOffset, *)
312
- // in this glyph's local frame, so global gradient at fraction t/textWidth
313
- // matches what neighbouring glyphs render. The vertical band tracks the
314
- // glyph's full extent around the baseline anchor.
315
- const gradient = parseLinearGradient(ctx, g.style.backgroundImage, -g.pathOffset, textWidth, baseY - g.ascent, g.ascent + g.descent);
316
- if (!gradient) {
317
- ctx.fillStyle = textFillColor(g.style);
318
- ctx.fillText(g.char, 0, baseY);
319
- return;
320
- }
321
- ctx.fillStyle = gradient;
322
- ctx.fillText(g.char, 0, baseY);
323
- }
324
351
  // ─── Pass 3: Decorations ─────────────────────────────────────────────
325
352
  /** The effective decoration entry of a glyph's style for one line kind — the
326
353
  * LAST matching entry wins (own decorations are appended after ancestors'). */
@@ -343,13 +370,23 @@ function decorationFor(style, lineKind) {
343
370
  style: style.textDecorationStyle || 'solid',
344
371
  };
345
372
  }
373
+ /** The clip-paint declarer of a glyph (for transparent decorations), if any. */
374
+ function clipSourceOf(g) {
375
+ return g.clipStyle ?? (hasTextClip(g.style) ? g.style : undefined);
376
+ }
346
377
  /**
347
378
  * Underline / line-through / overline: stroke a curve that follows the path
348
379
  * at the appropriate vertical offset. Groups consecutive glyphs sharing
349
380
  * decoration-line + style + color. Color/style come from the decoration's
350
381
  * ORIGIN element (per-entry), not the glyph's currentColor.
382
+ *
383
+ * A TRANSPARENT decoration over background-clip:text glyphs shows the clipped
384
+ * background through the band (Chrome includes decorations in the clip
385
+ * region), so it paints with the declarer's gradient/color instead of
386
+ * vanishing — matching the main renderer. Transparent with no clip declarer
387
+ * paints nothing.
351
388
  */
352
- function drawDecorations(ctx, glyphs, tb) {
389
+ function drawDecorations(ctx, glyphs, textWidth, tb) {
353
390
  const lines = ['underline', 'line-through', 'overline'];
354
391
  for (const lineKind of lines) {
355
392
  let i = 0;
@@ -360,6 +397,27 @@ function drawDecorations(ctx, glyphs, tb) {
360
397
  continue;
361
398
  }
362
399
  const { color, style: decoStyle } = deco;
400
+ if (isTransparent(color)) {
401
+ const src = clipSourceOf(glyphs[i]);
402
+ if (!src) {
403
+ i++;
404
+ continue;
405
+ }
406
+ // Group by the same clip declarer so the band spans its fragment.
407
+ let j = i + 1;
408
+ while (j < glyphs.length) {
409
+ const next = decorationFor(glyphs[j].style, lineKind);
410
+ if (!next || !isTransparent(next.color) ||
411
+ next.style !== decoStyle ||
412
+ clipSourceOf(glyphs[j]) !== src) {
413
+ break;
414
+ }
415
+ j++;
416
+ }
417
+ drawClipPaintDecoration(ctx, glyphs.slice(i, j), lineKind, decoStyle, textWidth, tb);
418
+ i = j;
419
+ continue;
420
+ }
363
421
  const colorCanon = canonicalColor(ctx, color);
364
422
  let j = i + 1;
365
423
  while (j < glyphs.length) {
@@ -376,6 +434,37 @@ function drawDecorations(ctx, glyphs, tb) {
376
434
  }
377
435
  }
378
436
  }
437
+ /** Local-frame y of a decoration band for one glyph under a textBaseline. */
438
+ function decorationLocalY(g, lineKind, tb) {
439
+ const baseY = baselineLocalY(tb, g.ascent, g.descent);
440
+ if (lineKind === 'underline')
441
+ return baseY + g.descent * 0.5;
442
+ if (lineKind === 'line-through')
443
+ return baseY - g.ascent * 0.3;
444
+ return baseY - g.ascent * 0.9; // overline
445
+ }
446
+ /**
447
+ * Paint a transparent decoration band with the clip declarer's paint. Drawn
448
+ * per glyph in the glyph's local rotated frame: each glyph's gradient slice is
449
+ * anchored to its own pathOffset (same math as the glyph fill), so adjacent
450
+ * bands stitch into one continuous color curve along the path.
451
+ */
452
+ function drawClipPaintDecoration(ctx, group, lineKind, decoStyle, textWidth, tb) {
453
+ if (group.length === 0)
454
+ return;
455
+ const lineWidth = decorationThickness(group[0].style.fontSize);
456
+ for (const g of group) {
457
+ ctx.save();
458
+ ctx.translate(g.x, g.y);
459
+ ctx.rotate(g.rotation);
460
+ const baseY = baselineLocalY(tb, g.ascent, g.descent);
461
+ const paint = clipPaintFor(ctx, g, textWidth, baseY);
462
+ if (paint) {
463
+ drawDecorationLine(ctx, 0, decorationLocalY(g, lineKind, tb), g.width, lineWidth, decoStyle, paint);
464
+ }
465
+ ctx.restore();
466
+ }
467
+ }
379
468
  function strokeDecorationAlongGlyphs(ctx, group, lineKind, decoStyle, color, tb) {
380
469
  if (group.length === 0)
381
470
  return;
@@ -383,14 +472,7 @@ function strokeDecorationAlongGlyphs(ctx, group, lineKind, decoStyle, color, tb)
383
472
  // Per-glyph local y for this decoration kind. The decoration position is
384
473
  // baseline-relative, so we shift by the baseline's local-y under the
385
474
  // current textBaseline to land in the right spot on the canvas.
386
- const localY = (g) => {
387
- const baseY = baselineLocalY(tb, g.ascent, g.descent);
388
- if (lineKind === 'underline')
389
- return baseY + g.descent * 0.5;
390
- if (lineKind === 'line-through')
391
- return baseY - g.ascent * 0.3;
392
- return baseY - g.ascent * 0.9; // overline
393
- };
475
+ const localY = (g) => decorationLocalY(g, lineKind, tb);
394
476
  if (decoStyle === 'double' || decoStyle === 'wavy') {
395
477
  // For double/wavy we draw each glyph segment independently using the
396
478
  // shared helper so the visual matches the main renderer.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/path/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;QACzD,MAAM,KAAK,GAAG;YACZ,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;YAClC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI;SAChC,CAAC;QACF,IAAI,CAAC,KAAK,CAAC;YAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;;YACnC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAChC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,GAAG,CAAC,MAAM,EAAE,CAAC;IACb,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACpB,GAAG,CAAC,OAAO,EAAE,CAAC;AAChB,CAAC;AAED,wEAAwE"}
@@ -2,11 +2,11 @@
2
2
  `,e.remove();t.body.normalize();let i=t.createDocumentFragment();for(;t.body.firstChild;)i.appendChild(t.body.firstChild);return{fragment:i,css:r}}var s=1,c=3;function l(e){let t=[],n=[];e=e.replace(/\/\*[\s\S]*?\*\//g,``);let r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;if(e[r]===`@`){let t=r,i=0;for(;r<e.length;){if(e[r]===`{`&&i++,e[r]===`}`&&(i--,i<=0)){r++;break}r++}let a=e.slice(t,r);a.startsWith(`@font-face`)&&n.push(a);continue}let i=r;for(;r<e.length&&e[r]!==`{`;)r++;if(r>=e.length)break;let a=e.slice(i,r).trim();r++;let o=r;for(;r<e.length&&e[r]!==`}`;)r++;let s=e.slice(o,r).trim();if(r++,!a)continue;let c=a.split(`,`).map(e=>e.trim()).filter(Boolean),l=[];for(let e of s.split(`;`)){let t=e.indexOf(`:`);if(t===-1)continue;let n=e.slice(0,t).trim().toLowerCase(),r=e.slice(t+1).trim();n&&r&&l.push({property:n,value:r})}c.length>0&&l.length>0&&t.push({selectors:c,declarations:l})}return{rules:t,fontFaceRules:n}}function u(e){let t=e.replace(/::[\w-]+/g,``).split(/\s*>\s*|\s+/),n=0,r=0,i=0;for(let e of t){let t=e.match(/#[\w-]+/g);t&&(n+=t.length);let a=e.match(/\.[\w-]+/g);a&&(r+=a.length);let o=e.replace(/[#.][\w-]+/g,``).replace(/:[\w-]+/g,``).trim();o&&o!==`*`&&i++}return[n,r,i]}function d(e){let t=e.match(/\.[\w-]+/g)||[],n=e.replace(/\.[\w-]+/g,``).replace(/:[\w-]+/g,``).trim();return{tag:n&&n!==`*`?n:``,classes:t.map(e=>e.slice(1))}}function f(e,t){if(e.tag&&e.tag!==t.tagName)return!1;for(let n of e.classes)if(!t.classes.has(n))return!1;return!0}function p(e){let t;if(e.includes(`::`)){if(e.replace(/::marker\b/g,``).includes(`::`))return null;if(/::marker\b/.test(e))t=`marker`,e=e.replace(/(^|[\s>])::marker\b/g,`$1*`),e=e.replace(/::marker\b/g,``);else return null}if(/:(?:nth-|hover|focus|active|visited|first-child|last-child)/.test(e))return null;let n=[],r=[],i=e.trim().split(/\s+/);for(let e=0;e<i.length;e++)i[e]===`>`?r.push(`>`):(n.length>r.length+1&&r.push(` `),n.push(i[e]));for(;r.length<n.length-1;)r.push(` `);if(n.length===0)return null;let a=n.map(d),o=a[a.length-1],s=o.tag;return{parts:a,combinators:r,rightmost:o,rightmostIsRoot:s===`html`||s===`body`,spec:u(e),pseudoElement:t}}function m(e,t){if(e.rightmostIsRoot){if(t.parent!==null)return!1}else if(!f(e.rightmost,t))return!1;if(e.parts.length===1)return!0;let n=t.parent;for(let t=e.parts.length-2;t>=0;t--){if(!n)return!1;let r=e.parts[t];if(e.combinators[t]===`>`)if(n.parent===null&&(r.tag===`html`||r.tag===`body`))n=n.parent;else if(f(r,n))n=n.parent;else return!1;else{let e=!1;for(;n;){if(n.parent===null&&(r.tag===`html`||r.tag===`body`)){n=n.parent,e=!0;break}if(f(r,n)){n=n.parent,e=!0;break}n=n.parent}if(!e)return!1}}return!0}function h(){return{fontFamily:`serif`,fontSize:16,fontWeight:400,fontStyle:`normal`,fontVariantCaps:`normal`,color:`rgb(0, 0, 0)`,textAlign:`start`,textAlignLast:`auto`,textIndent:0,textTransform:`none`,textDecorationLine:`none`,textDecorationStyle:`solid`,textDecorationColor:`rgb(0, 0, 0)`,textDecorations:[],textShadow:`none`,webkitTextStrokeWidth:0,webkitTextStrokeColor:``,webkitTextStrokeImage:`none`,webkitTextFillColor:``,paintOrder:`normal`,strokeLinejoin:`round`,webkitBackgroundClip:``,backgroundImage:`none`,letterSpacing:0,wordSpacing:0,fontKerning:`auto`,lineHeight:0,verticalAlign:`baseline`,whiteSpace:`normal`,wordBreak:`normal`,overflowWrap:`normal`,unicodeBidi:`normal`,direction:`ltr`,display:`block`,width:0,minHeight:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,backgroundColor:`rgba(0, 0, 0, 0)`,borderTopWidth:0,borderTopColor:`rgb(0, 0, 0)`,borderTopStyle:`none`,borderRightWidth:0,borderRightColor:`rgb(0, 0, 0)`,borderRightStyle:`none`,borderBottomWidth:0,borderBottomColor:`rgb(0, 0, 0)`,borderBottomStyle:`none`,borderLeftWidth:0,borderLeftColor:`rgb(0, 0, 0)`,borderLeftStyle:`none`,flexDirection:`row`,gap:0,flexGrow:0,listStyleType:`disc`,lineClamp:0}}var g={span:{display:`inline`},a:{display:`inline`},strong:{display:`inline`,fontWeight:700},b:{display:`inline`,fontWeight:700},em:{display:`inline`,fontStyle:`italic`},i:{display:`inline`,fontStyle:`italic`},u:{display:`inline`,textDecorationLine:`underline`},s:{display:`inline`,textDecorationLine:`line-through`},strike:{display:`inline`,textDecorationLine:`line-through`},del:{display:`inline`,textDecorationLine:`line-through`},sub:{display:`inline`,verticalAlign:`sub`,fontSize:.83},sup:{display:`inline`,verticalAlign:`super`,fontSize:.83},code:{display:`inline`,fontFamily:`monospace`},cite:{display:`inline`,fontStyle:`italic`},bdo:{display:`inline`,unicodeBidi:`bidi-override`},bdi:{display:`inline`,unicodeBidi:`isolate`},p:{display:`block`,marginTop:-1,marginBottom:-1},div:{display:`block`},h1:{display:`block`,fontSize:2,fontWeight:700,marginTop:-.67,marginBottom:-.67},h2:{display:`block`,fontSize:1.5,fontWeight:700,marginTop:-.83,marginBottom:-.83},h3:{display:`block`,fontSize:1.17,fontWeight:700,marginTop:-1,marginBottom:-1},h4:{display:`block`,fontSize:1,fontWeight:700,marginTop:-1.33,marginBottom:-1.33},h5:{display:`block`,fontSize:.83,fontWeight:700,marginTop:-1.67,marginBottom:-1.67},h6:{display:`block`,fontSize:.67,fontWeight:700,marginTop:-2.33,marginBottom:-2.33},ul:{display:`block`,listStyleType:`disc`,marginTop:-1,marginBottom:-1},ol:{display:`block`,listStyleType:`decimal`,marginTop:-1,marginBottom:-1},li:{display:`list-item`},blockquote:{display:`block`,marginTop:-1,marginBottom:-1,marginLeft:40,marginRight:40},pre:{display:`block`,whiteSpace:`pre`,fontFamily:`monospace`,marginTop:-1,marginBottom:-1},table:{display:`table`},tr:{display:`table-row`},td:{display:`table-cell`},th:{display:`table-cell`,fontWeight:700},br:{display:`inline`},hr:{display:`block`,borderTopWidth:1,borderTopStyle:`solid`,borderTopColor:`gray`,marginTop:-.5,marginBottom:-.5}};function _(e,t,n){if(!e||e===`normal`||e===`auto`||e===`none`)return 0;let r=e.trim();if(r.endsWith(`em`)){let e=parseFloat(r);return isNaN(e)?0:e*t}if(r.endsWith(`%`)){let e=parseFloat(r);return isNaN(e)?0:e/100*n}if(r.endsWith(`px`)){let e=parseFloat(r);return isNaN(e)?0:e}let i=parseFloat(r);return isNaN(i)?0:i}function v(e){if(e===`bold`)return 700;if(e===`normal`)return 400;let t=parseInt(e,10);return isNaN(t)?400:t}function y(e){let t=e.trim().toLowerCase();if(!t||t===`normal`)return!1;let n=t.split(/\s+/).filter(e=>e===`fill`||e===`stroke`),r=n.indexOf(`stroke`),i=n.indexOf(`fill`);return r===-1?!1:i===-1?!0:r<i}function b(e){let t=[],n=0,r=``;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?(n++,r+=a):a===`)`?(n=Math.max(0,n-1),r+=a):n===0&&/\s/.test(a)?r&&=(t.push(r),``):r+=a}return r&&t.push(r),t}function x(e,t){if(e===`margin`||e===`padding`){let n=t.trim().split(/\s+/),r,i,a,o;return n.length===1?r=i=a=o=n[0]:n.length===2?(r=a=n[0],i=o=n[1]):n.length===3?(r=n[0],i=o=n[1],a=n[2]):(r=n[0],i=n[1],a=n[2],o=n[3]),[{property:`${e}-top`,value:r},{property:`${e}-right`,value:i},{property:`${e}-bottom`,value:a},{property:`${e}-left`,value:o}]}if(e===`border`||e===`border-top`||e===`border-right`||e===`border-bottom`||e===`border-left`){let n=t.trim().split(/\s+/),r=[`solid`,`dashed`,`dotted`,`double`,`none`,`hidden`],i=n.find(e=>e.endsWith(`px`)||/^\d/.test(e))||`0`,a=n.find(e=>r.includes(e))||`none`,o=n.find(e=>!e.endsWith(`px`)&&!/^\d/.test(e)&&!r.includes(e))||`currentColor`,s=[],c=e===`border`?[`top`,`right`,`bottom`,`left`]:[e.replace(`border-`,``)];for(let e of c)s.push({property:`border-${e}-width`,value:i}),s.push({property:`border-${e}-style`,value:a}),s.push({property:`border-${e}-color`,value:o});return s}if(e===`list-style`)return t===`none`?[{property:`list-style-type`,value:`none`}]:[{property:`list-style-type`,value:t}];if(e===`text-decoration`){let e=t.trim();if(e===`inherit`||e===`none`)return[{property:`text-decoration-line`,value:`none`}];let n=``,r=e.replace(/\b(rgba?\([^)]*\)|hsla?\([^)]*\))/i,e=>(n=e,``)).split(/\s+/).filter(Boolean),i=[`underline`,`overline`,`line-through`],a=[`solid`,`double`,`dotted`,`dashed`,`wavy`],o=[],s=[];for(let e of r)i.includes(e)?s.push(e):a.includes(e)?o.push({property:`text-decoration-style`,value:e}):!/^[\d.+-]/.test(e)&&e!==`auto`&&e!==`from-font`&&o.push({property:`text-decoration-color`,value:e});return n&&o.push({property:`text-decoration-color`,value:n}),s.length>0&&o.unshift({property:`text-decoration-line`,value:s.join(` `)}),o}if(e===`-webkit-text-stroke`){let e=b(t.trim()),n=e.find(e=>e.endsWith(`px`)||/^\d/.test(e))||`0`,r=e.find(e=>!e.endsWith(`px`)&&!/^\d/.test(e))||`currentColor`;return[{property:`-webkit-text-stroke-width`,value:n},{property:`-webkit-text-stroke-color`,value:r}]}if(e===`flex`){let e=t.trim().split(/\s+/),n=parseFloat(e[0]);return isNaN(n)?[]:[{property:`flex-grow`,value:String(n)}]}return e===`border-collapse`||e===`border-spacing`?[]:[{property:e,value:t}]}function S(e){let t=e.trim();return t.toLowerCase()===`currentcolor`?``:t}function C(e,t,n,r,i,a){let o=e.fontSize||r;switch(t){case`font-family`:e.fontFamily=n.trim();break;case`font-size`:{let t=n.trim();t.endsWith(`em`)?e.fontSize=parseFloat(t)*r:t.endsWith(`%`)?e.fontSize=parseFloat(t)/100*r:e.fontSize=parseFloat(t)||r;break}case`font-weight`:e.fontWeight=v(n);break;case`font-style`:e.fontStyle=n.trim();break;case`font-variant`:case`font-variant-caps`:e.fontVariantCaps=/\bsmall-caps\b/.test(n)?`small-caps`:`normal`;break;case`color`:e.color=n.trim();break;case`text-align`:e.textAlign=n.trim();break;case`text-align-last`:e.textAlignLast=n.trim();break;case`text-indent`:e.textIndent=_(n,o,i);break;case`text-transform`:e.textTransform=n.trim();break;case`text-decoration-line`:e.textDecorationLine=n.trim();break;case`text-decoration`:break;case`text-decoration-style`:e.textDecorationStyle=n.trim();break;case`text-decoration-color`:e.textDecorationColor=n.trim();break;case`text-shadow`:e.textShadow=n.trim();break;case`-webkit-text-stroke-width`:e.webkitTextStrokeWidth=_(n,o,i);break;case`-webkit-text-stroke-color`:e.webkitTextStrokeColor=S(n);break;case`--rt-text-stroke-image`:e.webkitTextStrokeImage=n.trim();break;case`-webkit-text-fill-color`:e.webkitTextFillColor=S(n);break;case`paint-order`:e.paintOrder=n.trim();break;case`stroke-linejoin`:e.strokeLinejoin=n.trim();break;case`-webkit-background-clip`:case`background-clip`:e.webkitBackgroundClip=n.trim();break;case`background-image`:e.backgroundImage=n.trim();break;case`letter-spacing`:e.letterSpacing=n.trim()===`normal`?0:_(n,o,i);break;case`word-spacing`:e.wordSpacing=n.trim()===`normal`?0:_(n,o,i);break;case`font-kerning`:e.fontKerning=n.trim();break;case`line-height`:{let t=n.trim();if(t===`normal`)e.lineHeight=0;else if(t.endsWith(`px`))e.lineHeight=parseFloat(t)||0;else if(t.endsWith(`em`))e.lineHeight=parseFloat(t)*o;else if(t.endsWith(`%`)){let n=parseFloat(t);isNaN(n)||(e.lineHeight=n/100*o)}else{let n=parseFloat(t);isNaN(n)||(e.lineHeight=n*o,e._lineHeightMultiplier=n)}break}case`-webkit-line-clamp`:case`line-clamp`:{let t=n.trim().toLowerCase();if(t===`none`||t===`auto`)e.lineClamp=0;else{let n=parseInt(t,10);e.lineClamp=Number.isFinite(n)&&n>0?n:0}break}case`vertical-align`:e.verticalAlign=n.trim();break;case`white-space`:e.whiteSpace=n.trim();break;case`word-break`:e.wordBreak=n.trim();break;case`overflow-wrap`:case`word-wrap`:e.overflowWrap=n.trim();break;case`direction`:e.direction=n.trim();break;case`unicode-bidi`:e.unicodeBidi=n.trim();break;case`display`:e.display=n.trim();break;case`width`:{let t=n.trim();t===`100%`?e.width=i:t!==`auto`&&(e.width=_(t,o,i));break}case`min-height`:e.minHeight=_(n,o,i);break;case`padding-top`:e.paddingTop=_(n,o,i);break;case`padding-right`:e.paddingRight=_(n,o,i);break;case`padding-bottom`:e.paddingBottom=_(n,o,i);break;case`padding-left`:e.paddingLeft=_(n,o,i);break;case`margin-top`:e.marginTop=_(n,o,i);break;case`margin-right`:e.marginRight=_(n,o,i);break;case`margin-bottom`:e.marginBottom=_(n,o,i);break;case`margin-left`:e.marginLeft=_(n,o,i);break;case`background-color`:e.backgroundColor=n.trim();break;case`background`:{let t=n.trim();t.includes(`gradient(`)?e.backgroundImage=t:(t.startsWith(`#`)||t.startsWith(`rgb`)||t.startsWith(`hsl`)||[`transparent`,`none`,`inherit`].includes(t)||/^[a-z]+$/.test(t))&&(e.backgroundColor=t);break}case`padding-inline-start`:a===`rtl`?e.paddingRight=_(n,o,i):e.paddingLeft=_(n,o,i);break;case`padding-inline-end`:a===`rtl`?e.paddingLeft=_(n,o,i):e.paddingRight=_(n,o,i);break;case`margin-inline-start`:a===`rtl`?e.marginRight=_(n,o,i):e.marginLeft=_(n,o,i);break;case`margin-inline-end`:a===`rtl`?e.marginLeft=_(n,o,i):e.marginRight=_(n,o,i);break;case`border-top-width`:e.borderTopWidth=_(n,o,i);break;case`border-top-color`:e.borderTopColor=n.trim();break;case`border-top-style`:e.borderTopStyle=n.trim();break;case`border-right-width`:e.borderRightWidth=_(n,o,i);break;case`border-right-color`:e.borderRightColor=n.trim();break;case`border-right-style`:e.borderRightStyle=n.trim();break;case`border-bottom-width`:e.borderBottomWidth=_(n,o,i);break;case`border-bottom-color`:e.borderBottomColor=n.trim();break;case`border-bottom-style`:e.borderBottomStyle=n.trim();break;case`border-left-width`:e.borderLeftWidth=_(n,o,i);break;case`border-left-color`:e.borderLeftColor=n.trim();break;case`border-left-style`:e.borderLeftStyle=n.trim();break;case`flex-direction`:e.flexDirection=n.trim();break;case`gap`:e.gap=_(n,o,i);break;case`flex-grow`:e.flexGrow=parseFloat(n)||0;break;case`list-style-type`:e.listStyleType=n.trim();break;case`position`:case`top`:case`left`:case`right`:case`bottom`:case`inset-inline-start`:case`inset-inline-end`:case`content`:case`counter-reset`:case`counter-increment`:case`border-radius`:case`border-top-left-radius`:case`border-top-right-radius`:case`border-bottom-left-radius`:case`border-bottom-right-radius`:case`cursor`:case`opacity`:case`overflow`:case`box-sizing`:case`outline`:case`transition`:case`transform`:case`font-stretch`:case`font-display`:case`src`:case`unicode-range`:break}}var w=[[`font-family`,`fontFamily`],[`font-size`,`fontSize`],[`font-weight`,`fontWeight`],[`font-style`,`fontStyle`],[`color`,`color`],[`text-align`,`textAlign`],[`text-align-last`,`textAlignLast`],[`text-indent`,`textIndent`],[`text-transform`,`textTransform`],[`white-space`,`whiteSpace`],[`word-break`,`wordBreak`],[`overflow-wrap`,`overflowWrap`],[`direction`,`direction`],[`letter-spacing`,`letterSpacing`],[`word-spacing`,`wordSpacing`],[`line-height`,`lineHeight`],[`text-shadow`,`textShadow`],[`font-kerning`,`fontKerning`],[`list-style-type`,`listStyleType`],[`vertical-align`,`verticalAlign`],[`paint-order`,`paintOrder`],[`stroke-linejoin`,`strokeLinejoin`],[`-webkit-text-stroke-width`,`webkitTextStrokeWidth`],[`-webkit-text-stroke-color`,`webkitTextStrokeColor`],[`-webkit-text-fill-color`,`webkitTextFillColor`]];function T(e,t,n){for(let[r,i]of w)if(!n.has(r))if(i===`lineHeight`){let n=t._lineHeightMultiplier;n===void 0?e.lineHeight=t.lineHeight:(e.lineHeight=n*e.fontSize,e._lineHeightMultiplier=n)}else e[i]=t[i]}function E(e){let t=new Map,n=new Map,r=[],i=0;for(let a of e){let e=[];for(let t of a.declarations){let n=t.value.includes(`!important`),r=n?t.value.replace(/\s*!important\s*/g,``).trim():t.value,i=x(t.property,r);for(let t of i)e.push({property:t.property,value:t.value,important:n})}for(let o of a.selectors){let a=p(o);if(!a)continue;let s={selector:a,declarations:e,orderBase:i++},c=a.rightmost;if(c.tag&&!a.rightmostIsRoot){let e=t.get(c.tag);e?e.push(s):t.set(c.tag,[s])}if(c.classes.length>0){let e=c.classes[0],t=n.get(e);t?t.push(s):n.set(e,[s])}!c.tag&&c.classes.length===0&&r.push(s),a.rightmostIsRoot&&r.push(s)}}return{byTag:t,byClass:n,universal:r}}function D(e,t){switch(t){case`disc`:return`•`;case`circle`:return`○`;case`square`:return`■`;case`none`:return``;case`decimal-leading-zero`:return`${e<10&&e>=0?`0`+e:e}.`;case`lower-roman`:return`${O(e).toLowerCase()}.`;case`upper-roman`:return`${O(e)}.`;case`lower-alpha`:case`lower-latin`:return`${k(e).toLowerCase()}.`;case`upper-alpha`:case`upper-latin`:return`${k(e)}.`;default:return`${e}.`}}function O(e){if(e<1||e>3999)return`${e}`;let t=[[1e3,`M`],[900,`CM`],[500,`D`],[400,`CD`],[100,`C`],[90,`XC`],[50,`L`],[40,`XL`],[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],n=``;for(let[r,i]of t)for(;e>=r;)n+=i,e-=r;return n}function k(e){if(e<1)return`${e}`;let t=``;for(;e>0;){let n=(e-1)%26;t=String.fromCharCode(65+n)+t,e=Math.floor((e-1)/26)}return t}function A(e,t){if(e.tagName.toLowerCase()!==`li`)return;if(t===`none`)return``;let n=e.parentElement,r=n?.tagName.toLowerCase();if(t===`disc`||t===`circle`||t===`square`)return D(0,t);if(r===`ol`||r===`ul`||!n){let r=n?Array.from(n.children).filter(e=>e.tagName.toLowerCase()===`li`):[e],i=n?.getAttribute(`start`),a=n?.hasAttribute(`reversed`)??!1,o=i?parseInt(i,10):a?r.length:1,s=a?-1:1,c=o;for(let n of r){let r=n.getAttribute(`value`);if(r){let e=parseInt(r,10);Number.isNaN(e)||(c=e)}if(n===e)return D(c,t||`decimal`);c+=s}return D(c,t||`decimal`)}}function j(e){let t=e.style;return t&&typeof t.cssText==`string`?t:null}function M(e){let t=[];for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e===-1)continue;let r=n.slice(0,e).trim().toLowerCase(),i=n.slice(e+1).trim();r&&i&&t.push({property:r,value:i})}return t}function N(e,t,n){let{rules:r,fontFaceRules:i}=l(t),a=null;i.length>0&&typeof document<`u`&&document.head&&(a=document.createElement(`style`),a.textContent=i.join(`
3
3
  `),document.head.appendChild(a));let o=E(r),u=e.ownerDocument.createElement(`div`);u.appendChild(e);function d(e,t){let n=new Set,r=e.getAttribute(`class`);if(r)for(let e of r.split(/\s+/))e&&n.add(e);return{tagName:e.tagName.toLowerCase(),classes:n,parent:t,el:e}}function f(e,t,r){let i=e.tagName.toLowerCase(),a=d(e,r),s=h(),c=new Set,l=[],u=new Set,f=o.byTag.get(i);if(f)for(let e of f)u.add(e),l.push(e);for(let e of a.classes){let t=o.byClass.get(e);if(t)for(let e of t)u.has(e)||(u.add(e),l.push(e))}for(let e of o.universal)u.has(e)||(u.add(e),l.push(e));let _=[],v=[];for(let e of l)if(m(e.selector,a)){let t=e.selector.pseudoElement===`marker`?v:_;for(let n of e.declarations)t.push({property:n.property,value:n.value,specificity:e.selector.spec,order:e.orderBase,important:n.important})}let y=g[i],b=!1;if(y?.fontSize!==void 0){let e=y.fontSize;e<10?s.fontSize=e*t.fontSize:s.fontSize=e,b=!0,c.add(`font-size`)}_.length>1&&_.sort((e,t)=>{if(e.important!==t.important)return e.important?1:-1;let n=e.specificity,r=t.specificity;return n[0]===r[0]?n[1]===r[1]?n[2]===r[2]?e.order-t.order:n[2]-r[2]:n[1]-r[1]:n[0]-r[0]});for(let e of _)e.property===`font-size`&&(C(s,e.property,e.value,t.fontSize,n,t.direction),b=!0);let S=j(e);if(S&&S.cssText){let e=M(S.cssText);for(let r of e)r.property===`font-size`&&(C(s,r.property,r.value,t.fontSize,n,t.direction),b=!0)}b||(s.fontSize=t.fontSize);let w=s.fontSize;if(y){for(let[e,t]of Object.entries(y)){if(e===`fontSize`)continue;s[e]=t;let n=e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase());c.add(n)}s.marginTop<0&&(s.marginTop=Math.abs(s.marginTop)*w),s.marginBottom<0&&(s.marginBottom=Math.abs(s.marginBottom)*w),(i===`ul`||i===`ol`)&&(t.direction===`rtl`?(s.paddingRight=40,c.add(`padding-right`)):(s.paddingLeft=40,c.add(`padding-left`)))}let E=t.direction,D={"word-wrap":`overflow-wrap`};for(let e of _)e.property!==`font-size`&&(C(s,e.property,e.value,w,n,E),c.add(D[e.property]||e.property));let O=!!S?.width;if(S&&S.cssText){let e=M(S.cssText);for(let t of e){if(t.property===`font-size`){c.add(`font-size`);continue}let e=x(t.property,t.value);for(let t of e)C(s,t.property,t.value,w,n,E),c.add(D[t.property]||t.property)}}O||(s.width=0);let k=e.getAttribute(`dir`);k&&(s.direction=k,c.add(`direction`)),c.add(`font-size`),T(s,t,c),c.has(`text-decoration-color`)?s.textDecorationColor===`currentColor`&&(s.textDecorationColor=s.color):s.textDecorationColor=s.webkitTextFillColor||s.color;for(let e of[`Top`,`Right`,`Bottom`,`Left`]){let t=`border${e}Color`,n=`border-${e.toLowerCase()}-color`;c.has(n)?s[t]===`currentColor`&&(s[t]=s.color):s[t]=s.color}let N=[];if(s.textDecorationLine&&s.textDecorationLine!==`none`)for(let e of s.textDecorationLine.split(/\s+/))e&&e!==`none`&&N.push({line:e,color:s.textDecorationColor,style:s.textDecorationStyle});s.textDecorations=t.textDecorations.length?[...t.textDecorations,...N]:N;let P=new Set(s.textDecorationLine.split(/\s+/).filter(e=>e&&e!==`none`));if(t.textDecorationLine&&t.textDecorationLine!==`none`)for(let e of t.textDecorationLine.split(/\s+/))e&&e!==`none`&&P.add(e);P.size>0&&(s.textDecorationLine=[...P].join(` `));let F=A(e,s.listStyleType),I,L=!1;if(i===`li`&&v.length>0){v.length>1&&v.sort((e,t)=>{if(e.important!==t.important)return e.important?1:-1;let n=e.specificity,r=t.specificity;return n[0]===r[0]?n[1]===r[1]?n[2]===r[2]?e.order-t.order:n[2]-r[2]:n[1]-r[1]:n[0]-r[0]});let e=[`paddingLeft`,`paddingRight`,`fontSize`,`fontFamily`,`fontWeight`,`fontStyle`,`color`,`letterSpacing`],t={...s},r=new Set;for(let i of v){if(i.property===`content`){let e=i.value.trim().toLowerCase();(e===`none`||e===`""`||e===`''`||e===`normal`)&&(L=e===`none`||e===`""`||e===`''`);continue}let a=e.map(e=>t[e]);C(t,i.property,i.value,w,n,E),e.forEach((e,n)=>{t[e]!==a[n]&&r.add(e)})}if(r.size>0){I={};for(let e of r)I[e]=t[e]}}let R=[];for(let t of e.childNodes){let e=p(t,s,a);e&&R.push(e)}return{element:e,tagName:i,style:s,children:R,textContent:null,listMarker:F,markerStyle:I,markerHidden:L||void 0}}function p(e,t,n){if(e.nodeType===c){let n=e.textContent;if(!n)return null;if(n.trim()===``&&!n.includes(`\xA0`)){let r=t.whiteSpace,i=e.previousSibling,a=e.nextSibling,o=e=>{if(!e||e.nodeType!==s)return e?.nodeType===c;let t=g[e.tagName.toLowerCase()]?.display||`block`;return t===`inline`||t===`inline-block`};if(i&&a&&!o(i)&&!o(a)&&!(r===`pre`||r===`pre-wrap`||r===`pre-line`)||r!==`pre`&&r!==`pre-wrap`&&r!==`pre-line`&&n.includes(`
4
4
  `))return null}let r={...t},i=t.whiteSpace,a=n;return i!==`pre`&&i!==`pre-wrap`&&i!==`pre-line`&&i!==`break-spaces`&&(a=n.replace(/[\n\r]/g,` `)),{element:null,tagName:`#text`,style:r,children:[],textContent:a}}if(e.nodeType!==s)return null;let r=e,i=r.tagName.toLowerCase();return i===`style`||i===`script`?null:i===`br`?{element:null,tagName:`#text`,style:{...t},children:[],textContent:`
5
- `}:f(r,t,n)}return{tree:f(u,h(),null),cleanup:()=>{a&&a.remove()}}}var P=!0,F,I=[],L=new Map;function R(e,t){let n=e.font+`\0`+(e.letterSpacing||``)+`\0`+t,r=L.get(n);if(r!==void 0)return r;let i=e.measureText(t).width;return L.set(n,i),i}function ee(e){let t=``;for(let n of e){if(!n.text||n.isSpace)continue;let e=H(n.style);if(t&&e!==t)return!0;t=e}return!1}function z(e,t){e.font=H(t),e.fontKerning=t.fontKerning===`none`?`none`:`normal`}function B(e){return Number.isFinite(e)&&e!==0?`${e}px`:`0px`}var V=new Map;function H(e){let t=`${e.fontStyle}|${e.fontVariantCaps}|${e.fontWeight}|${e.fontSize}|${e.fontFamily}`,n=V.get(t);if(n)return n;let r=[];e.fontStyle!==`normal`&&r.push(e.fontStyle),e.fontVariantCaps===`small-caps`&&r.push(`small-caps`),e.fontWeight!==400&&r.push(String(e.fontWeight)),r.push(`${e.fontSize}px`),r.push(e.fontFamily);let i=r.join(` `);return V.set(t,i),i}var te=new Map,U=null,W=null,G=null,K=new Set([`disc`,`circle`,`square`]);function ne(e,t,n=!1){let r=`${e}|${t}|${n?`ul-li`:`block`}`,i=te.get(r);if(i!==void 0)return i;if(typeof document>`u`||!document.body)throw Error(`render-tag: accuracy 'balanced' requires a browser DOM for line-height probes; use the default 'performance' mode in non-browser environments.`);let a;n?(W||(W=document.createElement(`ul`),W.style.cssText=`position:absolute;top:-9999px;left:-9999px;visibility:hidden;padding:0;margin:0;border:0;list-style:disc;`,G=document.createElement(`li`),G.style.cssText=`white-space:nowrap;padding:0;margin:0;border:0;`,G.textContent=`Mg`,W.appendChild(G),document.body.appendChild(W)),a=G):(U||(U=document.createElement(`div`),U.style.cssText=`position:absolute;top:-9999px;left:-9999px;visibility:hidden;white-space:nowrap;padding:0;margin:0;border:0;`,U.textContent=`Mg`,document.body.appendChild(U)),a=U),a.style.font=e,a.style.lineHeight=t;let o=a.getBoundingClientRect().height;return te.set(r,o),o}function re(e,t,n=!1){if(t.lineHeight>0)return P?ne(H(t),`${t.lineHeight}px`,n):t.lineHeight;if(P)return ne(H(t),`normal`,n);let{ascent:r,descent:i}=X(e,t);return r+i}function ie(e,t,n){let{ascent:r,descent:i}=X(e,t);return(r-i)/2+n/2}function ae(e,t){switch(t){case`uppercase`:return e.toUpperCase();case`lowercase`:return e.toLowerCase();case`capitalize`:return e.replace(/(^|[\s\p{P}])(\p{L})/gu,(e,t,n)=>t===`'`||t===`’`?e:t+n.toUpperCase());default:return e}}function q(e){if(e.tagName===`#text`)return!0;let t=e.style.display;return t===`inline`||t===`inline-block`}function oe(e){return e.children.length>0&&e.children.every(q)}function J(e){return!e||e===`transparent`||e===`rgba(0, 0, 0, 0)`}var Y=new Map;function X(e,t){let n=H(t),r=Y.get(n);if(r)return r;e.font=n;let i=e.measureText(`M`),a={ascent:i.fontBoundingBoxAscent??i.actualBoundingBoxAscent,descent:i.fontBoundingBoxDescent??i.actualBoundingBoxDescent};return Y.set(n,a),a}function se(e,t,n,r,i,a,o){switch(e){case`super`:return-r*.4;case`sub`:return r*.26;case`text-top`:return-(i-t);case`text-bottom`:return a-n;case`middle`:return-(r*.25)-(n-t)/2;default:{let t=parseFloat(e);return Number.isFinite(t)?e.endsWith(`%`)?-(t/100)*o:-t:0}}}function Z(e){return e!==`baseline`&&e!==`top`&&e!==`bottom`&&e!==``}function ce(e,t){let n=e.textDecorations,r=t.textDecorations;if(n===r)return!0;if(!n||!r||n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e].line!==r[e].line||n[e].color!==r[e].color||n[e].style!==r[e].style)return!1;return!0}function le(e,t){return e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontStyle===t.fontStyle&&e.color===t.color&&e.textDecorationLine===t.textDecorationLine&&ce(e,t)&&e.backgroundColor===t.backgroundColor}function ue(e){return!J(e.backgroundColor)||e.borderTopWidth>0&&e.borderTopStyle!==`none`||e.borderRightWidth>0&&e.borderRightStyle!==`none`||e.borderBottomWidth>0&&e.borderBottomStyle!==`none`||e.borderLeftWidth>0&&e.borderLeftStyle!==`none`}function de(e){return!!(e.boxOpen&&e.boxClose&&e.text)}function fe(e,t,n){let r=t.words.length-1;for(;r>=0&&(t.words[r].text===``||de(t.words[r]));)r--;if(r<0)return;let i=t.words[r].style,a=t.words[r].boxStyle;z(e,i),e.letterSpacing=`${i.letterSpacing||0}px`;let o=R(e,`…`),s=()=>{for(;t.words.length>0&&t.words[t.words.length-1].isSpace;){let e=t.words.pop();t.totalWidth-=e.width}};s();let c=e=>!e.isSpace&&e.text!==``&&!e.boxOpen&&!e.boxClose;for(;t.totalWidth+o>n&&t.words.length>0;){let e=t.words[t.words.length-1];if(!c(e)&&!de(e))break;t.totalWidth-=e.width,t.words.pop(),s()}let l={text:`…`,width:o,style:i,isSpace:!1,boxStyle:a};t.words.push(l),t.totalWidth+=o}function pe(e){let t=[];function n(e,r){if(e.tagName===`#text`&&e.textContent){t.push({text:e.textContent,style:e.style,boxStyle:r});return}let i=e.style.display===`inline-block`,a=i||q(e)&&ue(e.style),o=a?e.style:r,s=a&&(e.style.paddingLeft>0||e.style.paddingRight>0||e.style.borderLeftWidth>0||e.style.borderRightWidth>0);if(i){let n=e.element?.textContent||``;t.push({text:n,style:e.style,boxStyle:o,boxOpen:e.style,boxClose:e.style});return}let c=e.style.unicodeBidi,l=(c===`bidi-override`||c===`isolate-override`)&&e.style.direction===`rtl`,u=t.length;s&&t.push({text:``,style:e.style,boxStyle:o,boxOpen:e.style});for(let t of e.children)n(t,a?o:r);if(s&&t.push({text:``,style:e.style,boxStyle:o,boxClose:e.style}),l&&t.length>u){let e=t.splice(u);for(let t of e)t.text&&(t.text=[...t.text].reverse().join(``),t.style={...t.style,direction:`ltr`});e.reverse(),t.push(...e)}}for(let t of e.children)n(t);return t}function me(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n>=3584&&n<=3711||n>=3712&&n<=3839||n>=4096&&n<=4255||n>=6016&&n<=6143)return!0;n>65535&&t++}return!1}var he;function ge(){return he||(typeof Intl<`u`&&Intl.Segmenter?(he=new Intl.Segmenter(void 0,{granularity:`word`}),he):null)}function _e(e,t,n,r,i){if(t.includes(`​`)||t.includes(`­`)){let a=t.split(/(\u200B|\u00AD)/),o=i??{cumText:``,cumWidth:0},s=!1;for(let t of a){if(t===`­`){s=!0;continue}if(t===`​`||t===``){s=!1;continue}let i=r.length;_e(e,t,n,r,o),s&&i>0&&(r[i-1].isSoftHyphenBreak=!0),s=!1}s&&r.length>0&&(r[r.length-1].isSoftHyphenBreak=!0);return}if(n.style.whiteSpace===`pre`||n.style.whiteSpace===`pre-wrap`||n.style.whiteSpace===`break-spaces`){let i=t.split(/( +|\t)/),a=R(e,` `)*8;for(let t of i){if(t===``)continue;if(t===` `){r.push({text:` `,width:a,style:n.style,isSpace:!0,isTab:!0,boxStyle:n.boxStyle});continue}let i=/^ +$/.test(t);r.push({text:t,width:R(e,t),style:n.style,isSpace:i,boxStyle:n.boxStyle})}}else{let a=t.split(/([ \t\n\r\f\v]+)/).flatMap(e=>/^[ \t\n\r\f\v]+$/.test(e)?[e]:e.split(/(?<=\?)(?=.)/)),o=i?.cumText??``,s=i?.cumWidth??0;for(let t of a){if(t===``)continue;if(/^[ \t\n\r\f\v]+$/.test(t)){let t=s;o+=` `,s=e.measureText(o).width;let i=s-t+(n.style.wordSpacing||0);r.push({text:` `,width:i,style:n.style,isSpace:!0,boxStyle:n.boxStyle});continue}if(me(t)){let i=ge();if(i){for(let a of i.segment(t)){let t=a.segment,i=s;o+=t,s=e.measureText(o).width,r.push({text:t,width:s-i,style:n.style,isSpace:!1,boxStyle:n.boxStyle})}continue}}let i=s;o+=t,s=e.measureText(o).width;let a=s-i,c=R(e,t);F&&F({type:`measure-word`,message:`"${t}" delta=${a.toFixed(2)} direct=${c.toFixed(2)} diff=${(a-c).toFixed(2)} cumText="${o}"`,data:{text:t,deltaWidth:a,directWidth:c,cumWidth:s,prevCum:i,font:n.style.fontFamily,fontSize:n.style.fontSize}}),r.push({text:t,width:a,style:n.style,isSpace:!1,boxStyle:n.boxStyle})}i&&(i.cumText=o,i.cumWidth=s)}}function ve(e,t){let n=[];for(let r of t){if(r.text===``&&!r.boxOpen&&!r.boxClose){let e=r.style.display===`inline-block`&&(r.style.marginLeft||r.style.marginRight)||0;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle});continue}if(r.boxOpen&&r.boxClose&&r.text){z(e,r.style),e.letterSpacing=B(r.style.letterSpacing);let t=ae(r.text,r.style.textTransform),i=r.style,a=R(e,t),o=i.marginLeft+i.borderLeftWidth+i.paddingLeft+a+i.paddingRight+i.borderRightWidth+i.marginRight;n.push({text:t,width:o,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxOpen:r.boxOpen,boxClose:r.boxClose});continue}if(r.boxOpen){let e=r.boxOpen.paddingLeft+r.boxOpen.borderLeftWidth;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxOpen:r.boxOpen});continue}if(r.boxClose){let e=r.boxClose.paddingRight+r.boxClose.borderRightWidth;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxClose:r.boxClose});continue}z(e,r.style),e.letterSpacing=B(r.style.letterSpacing);let t=ae(r.text,r.style.textTransform),i=e=>{let t=n[e];if(!t||t.isSpace||!t.text||t.text===`
6
- `)return;let r=n[e-1];if(!r||r.isSpace||!r.text.trim()||r.boxOpen||r.boxClose)return;let i=[...t.text][0],a=[...r.text][r.text.length-1];Q(i)||Q(a)||me(t.text)||me(r.text)||(t.noBreakBefore=!0)};if(t.includes(`
5
+ `}:f(r,t,n)}return{tree:f(u,h(),null),cleanup:()=>{a&&a.remove()}}}var P=!0,F,I=[],L=new Map;function R(e,t){let n=e.font+`\0`+(e.letterSpacing||``)+`\0`+t,r=L.get(n);if(r!==void 0)return r;let i=e.measureText(t).width;return L.set(n,i),i}function ee(e){let t=``;for(let n of e){if(!n.text||n.isSpace)continue;let e=V(n.style);if(t&&e!==t)return!0;t=e}return!1}function z(e,t){e.font=V(t),e.fontKerning=t.fontKerning===`none`?`none`:`normal`}function B(e){return Number.isFinite(e)&&e!==0?`${e}px`:`0px`}var te=new Map;function V(e){let t=`${e.fontStyle}|${e.fontVariantCaps}|${e.fontWeight}|${e.fontSize}|${e.fontFamily}`,n=te.get(t);if(n)return n;let r=[];e.fontStyle!==`normal`&&r.push(e.fontStyle),e.fontVariantCaps===`small-caps`&&r.push(`small-caps`),e.fontWeight!==400&&r.push(String(e.fontWeight)),r.push(`${e.fontSize}px`),r.push(e.fontFamily);let i=r.join(` `);return te.set(t,i),i}var ne=new Map,H=null,U=null,W=null,G=new Set([`disc`,`circle`,`square`]);function re(e,t,n=!1){let r=`${e}|${t}|${n?`ul-li`:`block`}`,i=ne.get(r);if(i!==void 0)return i;if(typeof document>`u`||!document.body)throw Error(`render-tag: accuracy 'balanced' requires a browser DOM for line-height probes; use the default 'performance' mode in non-browser environments.`);let a;n?(U||(U=document.createElement(`ul`),U.style.cssText=`position:absolute;top:-9999px;left:-9999px;visibility:hidden;padding:0;margin:0;border:0;list-style:disc;`,W=document.createElement(`li`),W.style.cssText=`white-space:nowrap;padding:0;margin:0;border:0;`,W.textContent=`Mg`,U.appendChild(W),document.body.appendChild(U)),a=W):(H||(H=document.createElement(`div`),H.style.cssText=`position:absolute;top:-9999px;left:-9999px;visibility:hidden;white-space:nowrap;padding:0;margin:0;border:0;`,H.textContent=`Mg`,document.body.appendChild(H)),a=H),a.style.font=e,a.style.lineHeight=t;let o=a.getBoundingClientRect().height;return ne.set(r,o),o}function K(e,t,n=!1){if(t.lineHeight>0)return P?re(V(t),`${t.lineHeight}px`,n):t.lineHeight;if(P)return re(V(t),`normal`,n);let{ascent:r,descent:i}=Y(e,t);return r+i}function ie(e,t,n){let{ascent:r,descent:i}=Y(e,t);return(r-i)/2+n/2}function ae(e,t){switch(t){case`uppercase`:return e.toUpperCase();case`lowercase`:return e.toLowerCase();case`capitalize`:return e.replace(/(^|[\s\p{P}])(\p{L})/gu,(e,t,n)=>t===`'`||t===`’`?e:t+n.toUpperCase());default:return e}}function q(e){if(e.tagName===`#text`)return!0;let t=e.style.display;return t===`inline`||t===`inline-block`}function oe(e){return e.children.length>0&&e.children.every(q)}function J(e){return!e||e===`transparent`||e===`rgba(0, 0, 0, 0)`}var se=new Map;function Y(e,t){let n=V(t),r=se.get(n);if(r)return r;e.font=n;let i=e.measureText(`M`),a={ascent:i.fontBoundingBoxAscent??i.actualBoundingBoxAscent,descent:i.fontBoundingBoxDescent??i.actualBoundingBoxDescent};return se.set(n,a),a}function ce(e,t,n,r,i,a,o){switch(e){case`super`:return-r*.4;case`sub`:return r*.26;case`text-top`:return-(i-t);case`text-bottom`:return a-n;case`middle`:return-(r*.25)-(n-t)/2;default:{let t=parseFloat(e);return Number.isFinite(t)?e.endsWith(`%`)?-(t/100)*o:-t:0}}}function X(e){return e!==`baseline`&&e!==`top`&&e!==`bottom`&&e!==``}function le(e,t){let n=e.textDecorations,r=t.textDecorations;if(n===r)return!0;if(!n||!r||n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e].line!==r[e].line||n[e].color!==r[e].color||n[e].style!==r[e].style)return!1;return!0}function ue(e,t){return e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontStyle===t.fontStyle&&e.color===t.color&&e.textDecorationLine===t.textDecorationLine&&le(e,t)&&e.backgroundColor===t.backgroundColor}function de(e){return!J(e.backgroundColor)||e.borderTopWidth>0&&e.borderTopStyle!==`none`||e.borderRightWidth>0&&e.borderRightStyle!==`none`||e.borderBottomWidth>0&&e.borderBottomStyle!==`none`||e.borderLeftWidth>0&&e.borderLeftStyle!==`none`}function fe(e){return e.webkitBackgroundClip===`text`&&(!!e.backgroundImage&&e.backgroundImage!==`none`||!J(e.backgroundColor))}function pe(e){return!!(e.boxOpen&&e.boxClose&&e.text)}function me(e,t,n){let r=t.words.length-1;for(;r>=0&&(t.words[r].text===``||pe(t.words[r]));)r--;if(r<0)return;let i=t.words[r].style,a=t.words[r].boxStyle;z(e,i),e.letterSpacing=`${i.letterSpacing||0}px`;let o=R(e,`…`),s=()=>{for(;t.words.length>0&&t.words[t.words.length-1].isSpace;){let e=t.words.pop();t.totalWidth-=e.width}};s();let c=e=>!e.isSpace&&e.text!==``&&!e.boxOpen&&!e.boxClose;for(;t.totalWidth+o>n&&t.words.length>0;){let e=t.words[t.words.length-1];if(!c(e)&&!pe(e))break;t.totalWidth-=e.width,t.words.pop(),s()}let l={text:`…`,width:o,style:i,isSpace:!1,boxStyle:a};t.words.push(l),t.totalWidth+=o}function he(e){let t=[];function n(e,r,i,a){if(e.tagName===`#text`&&e.textContent){t.push({text:e.textContent,style:e.style,boxStyle:r,clipStyle:i,strokeImageStyle:a});return}let o=e.style.display===`inline-block`,s=o||q(e)&&de(e.style),c=s?e.style:r,l=q(e)&&fe(e.style)?e.style:i,u=q(e)&&e.style.webkitTextStrokeImage&&e.style.webkitTextStrokeImage!==`none`?e.style:a,d=s&&(e.style.paddingLeft>0||e.style.paddingRight>0||e.style.borderLeftWidth>0||e.style.borderRightWidth>0);if(o){let n=e.element?.textContent||``;t.push({text:n,style:e.style,boxStyle:c,clipStyle:l,strokeImageStyle:u,boxOpen:e.style,boxClose:e.style});return}let f=e.style.unicodeBidi,p=(f===`bidi-override`||f===`isolate-override`)&&e.style.direction===`rtl`,m=t.length;d&&t.push({text:``,style:e.style,boxStyle:c,boxOpen:e.style});for(let t of e.children)n(t,s?c:r,l,u);if(d&&t.push({text:``,style:e.style,boxStyle:c,boxClose:e.style}),p&&t.length>m){let e=t.splice(m);for(let t of e)t.text&&(t.text=[...t.text].reverse().join(``),t.style={...t.style,direction:`ltr`});e.reverse(),t.push(...e)}}for(let t of e.children)n(t);return t}function ge(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n>=3584&&n<=3711||n>=3712&&n<=3839||n>=4096&&n<=4255||n>=6016&&n<=6143)return!0;n>65535&&t++}return!1}var _e;function ve(){return _e||(typeof Intl<`u`&&Intl.Segmenter?(_e=new Intl.Segmenter(void 0,{granularity:`word`}),_e):null)}function ye(e,t,n,r,i){if(t.includes(`​`)||t.includes(`­`)){let a=t.split(/(\u200B|\u00AD)/),o=i??{cumText:``,cumWidth:0},s=!1;for(let t of a){if(t===`­`){s=!0;continue}if(t===`​`||t===``){s=!1;continue}let i=r.length;ye(e,t,n,r,o),s&&i>0&&(r[i-1].isSoftHyphenBreak=!0),s=!1}s&&r.length>0&&(r[r.length-1].isSoftHyphenBreak=!0);return}if(n.style.whiteSpace===`pre`||n.style.whiteSpace===`pre-wrap`||n.style.whiteSpace===`break-spaces`){let i=t.split(/( +|\t)/),a=R(e,` `)*8;for(let t of i){if(t===``)continue;if(t===` `){r.push({text:` `,width:a,style:n.style,isSpace:!0,isTab:!0,boxStyle:n.boxStyle,clipStyle:n.clipStyle,strokeImageStyle:n.strokeImageStyle});continue}let i=/^ +$/.test(t);r.push({text:t,width:R(e,t),style:n.style,isSpace:i,boxStyle:n.boxStyle,clipStyle:n.clipStyle,strokeImageStyle:n.strokeImageStyle})}}else{let a=t.split(/([ \t\n\r\f\v]+)/).flatMap(e=>/^[ \t\n\r\f\v]+$/.test(e)?[e]:e.split(/(?<=\?)(?=.)/)),o=i?.cumText??``,s=i?.cumWidth??0;for(let t of a){if(t===``)continue;if(/^[ \t\n\r\f\v]+$/.test(t)){let t=s;o+=` `,s=e.measureText(o).width;let i=s-t+(n.style.wordSpacing||0);r.push({text:` `,width:i,style:n.style,isSpace:!0,boxStyle:n.boxStyle,clipStyle:n.clipStyle,strokeImageStyle:n.strokeImageStyle});continue}if(ge(t)){let i=ve();if(i){for(let a of i.segment(t)){let t=a.segment,i=s;o+=t,s=e.measureText(o).width,r.push({text:t,width:s-i,style:n.style,isSpace:!1,boxStyle:n.boxStyle,clipStyle:n.clipStyle,strokeImageStyle:n.strokeImageStyle})}continue}}let i=s;o+=t,s=e.measureText(o).width;let a=s-i,c=R(e,t);F&&F({type:`measure-word`,message:`"${t}" delta=${a.toFixed(2)} direct=${c.toFixed(2)} diff=${(a-c).toFixed(2)} cumText="${o}"`,data:{text:t,deltaWidth:a,directWidth:c,cumWidth:s,prevCum:i,font:n.style.fontFamily,fontSize:n.style.fontSize}}),r.push({text:t,width:a,style:n.style,isSpace:!1,boxStyle:n.boxStyle,clipStyle:n.clipStyle,strokeImageStyle:n.strokeImageStyle})}i&&(i.cumText=o,i.cumWidth=s)}}function be(e,t){let n=[];for(let r of t){if(r.text===``&&!r.boxOpen&&!r.boxClose){let e=r.style.display===`inline-block`&&(r.style.marginLeft||r.style.marginRight)||0;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle});continue}if(r.boxOpen&&r.boxClose&&r.text){z(e,r.style),e.letterSpacing=B(r.style.letterSpacing);let t=ae(r.text,r.style.textTransform),i=r.style,a=R(e,t),o=i.marginLeft+i.borderLeftWidth+i.paddingLeft+a+i.paddingRight+i.borderRightWidth+i.marginRight;n.push({text:t,width:o,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxOpen:r.boxOpen,boxClose:r.boxClose,clipStyle:r.clipStyle,strokeImageStyle:r.strokeImageStyle});continue}if(r.boxOpen){let e=r.boxOpen.paddingLeft+r.boxOpen.borderLeftWidth;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxOpen:r.boxOpen});continue}if(r.boxClose){let e=r.boxClose.paddingRight+r.boxClose.borderRightWidth;e>0&&n.push({text:``,width:e,style:r.style,isSpace:!1,boxStyle:r.boxStyle,boxClose:r.boxClose});continue}z(e,r.style),e.letterSpacing=B(r.style.letterSpacing);let t=ae(r.text,r.style.textTransform),i=e=>{let t=n[e];if(!t||t.isSpace||!t.text||t.text===`
6
+ `)return;let r=n[e-1];if(!r||r.isSpace||!r.text.trim()||r.boxOpen||r.boxClose)return;let i=[...t.text][0],a=[...r.text][r.text.length-1];Z(i)||Z(a)||ge(t.text)||ge(r.text)||(t.noBreakBefore=!0)};if(t.includes(`
7
7
  `)){let a=t.split(`
8
8
  `);for(let t=0;t<a.length;t++)if(t>0&&n.push({text:`
9
- `,width:0,style:r.style,isSpace:!1,boxStyle:r.boxStyle}),a[t]){let o=n.length;_e(e,a[t],r,n),i(o)}}else{let a=n.length;_e(e,t,r,n),i(a)}}return n}function Q(e){let t=e.codePointAt(0)||0;return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519||t>=131072&&t<=173791}var ye;function be(){return ye||(typeof Intl<`u`&&Intl.Segmenter?(ye=new Intl.Segmenter(void 0,{granularity:`grapheme`}),ye):null)}var xe=/\p{Extended_Pictographic}/u;function Se(e){for(let t of e)if(t.codePointAt(0)>=126976)return!0;return e.includes(`‍`)||e.includes(`️`)?xe.test(e):!1}function Ce(e,t,n,r){let i=[...t.text].some(Q),a=xe.test(t.text)&&!!be(),o=t.width>n&&(t.style.overflowWrap===`break-word`||t.style.wordBreak===`break-all`);if(!i&&!a&&!o)return[t];if(o&&t.style.wordBreak!==`break-all`&&t.style.overflowWrap===`break-word`){let r=t.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/).filter(e=>e.length);if(r.length>1){e.font=H(t.style),e.letterSpacing=B(t.style.letterSpacing);let i=[];for(let a of r){let r=R(e,a);r<=n?i.push({...t,text:a,width:r}):i.push(...Ce(e,{...t,text:a,width:r},n,0))}return i}}e.font=H(t.style),e.letterSpacing=B(t.style.letterSpacing);let s=a?be():null,c=s?[...s.segment(t.text)].map(e=>e.segment):[...t.text],l=[],u=``,d=0;for(let r of c){if(a&&Se(r)){u&&(l.push({...t,text:u,width:d}),u=``,d=0),l.push({...t,text:r,width:R(e,r)});continue}if(Q(r)){u&&(l.push({...t,text:u,width:d}),u=``,d=0);let n=R(e,r);l.push({...t,text:r,width:n});continue}let i=u+r,s=R(e,i);if(o&&s>n&&u){l.push({...t,text:u,width:d}),u=r,d=R(e,r);continue}u=i,d=s}return u&&l.push({...t,text:u,width:d}),l}var we=/^[,.\;:!?\)\]\}'"»›]+$/;function Te(e,t,n,r,i=!1,a=0,o){let s=[],c={words:[],totalWidth:0,lineHeight:0},l=r===`nowrap`||r===`pre`,u=()=>n-(s.length===0?a:0),d=r===`pre-wrap`||r===`pre`||r===`pre-line`,f=r===`pre`||r===`pre-wrap`||r===`break-spaces`;function p(t=!1){let i=c.words.length>0;if(!(r===`break-spaces`||f&&!t))for(;c.words.length>0&&c.words[c.words.length-1].isSpace;)c.totalWidth-=c.words[c.words.length-1].width,c.words.pop();if(t&&c.words.length>0){let t=c.words[c.words.length-1];if(t.isSoftHyphenBreak){z(e,t.style);let n=R(e,`-`);c.words.push({text:`-`,width:n,style:t.style,isSpace:!1}),c.totalWidth+=n}}if(c.words.length>0||i&&d){if(F){let e=c.words.map(e=>e.text).join(``);F({type:`line-commit`,message:`Line ${s.length}: "${e}" width=${c.totalWidth.toFixed(2)} / ${n}`,data:{lineIndex:s.length,text:e,totalWidth:c.totalWidth,contentWidth:n}})}s.push(c)}c={words:[],totalWidth:0,lineHeight:0}}let m=!0;for(let r=0;r<t.length;r++){let d=t[r],h=re(e,d.style,i);if(d.boxStyle&&d.boxStyle.display===`inline-block`){let e=d.boxStyle;h=Math.max(h,h+e.paddingTop+e.paddingBottom+e.marginTop+e.marginBottom+e.borderTopWidth+e.borderBottomWidth)}if(d.text===`
10
- `){c.words.length===0?(c.lineHeight=h,c.endedByHardBreak=!0,s.push(c),c={words:[],totalWidth:0,lineHeight:0}):(c.endedByHardBreak=!0,p()),m=!0;continue}if(l){c.words.push(d),c.totalWidth+=d.width,c.lineHeight=Math.max(c.lineHeight,h);continue}if(!d.isSpace&&d.text&&!d.noBreakBefore&&!d.boxOpen&&!d.boxClose){let n=r;for(;n+1<t.length;){let e=t[n+1];if(!e.text||e.isSpace||e.boxOpen||e.boxClose||!e.noBreakBefore)break;n++}if(n>r){let a=d.style.overflowWrap===`break-word`||d.style.wordBreak===`break-all`,o=0;for(let e=r;e<=n;e++)o+=t[e].width;let s=[];for(let e=r;e<=n;e++)for(let n of[...t[e].text])s.push({ch:n,style:t[e].style});let l=s.map(e=>e.ch).join(``).split(/(?<=-)(?!\d)|(?<=[^\d]-)/).filter(e=>e.length),f=l.length>1;if(!(c.totalWidth+o<=u())&&(f||a&&o>u())){let t=[],o=0;for(let e of l){let n=[...e].length;t.push(s.slice(o,o+n)),o+=n}let d=(t,n)=>{let r=0;for(;r<t.length;){let a=t[r].style;z(e,a),e.letterSpacing=B(a.letterSpacing);let o=re(e,a,i),s=``,l=0;for(;r<t.length&&t[r].style===a;){let i=t[r].ch,d=R(e,s+i);n&&c.totalWidth+d>u()&&(c.words.length>0||s)?(s&&(c.words.push({text:s,width:l,style:a,isSpace:!1}),c.totalWidth+=l,c.lineHeight=Math.max(c.lineHeight,o)),p(!0),m=!1,s=i,l=R(e,i)):(s+=i,l=d),r++}s&&(c.words.push({text:s,width:l,style:a,isSpace:!1}),c.totalWidth+=l,c.lineHeight=Math.max(c.lineHeight,o),m=!1)}},h=t=>{let n=0,r=0;for(;r<t.length;){let i=t[r].style,a=``;for(;r<t.length&&t[r].style===i;)a+=t[r].ch,r++;z(e,i),e.letterSpacing=B(i.letterSpacing),n+=R(e,a)}return n};!f&&c.words.length>0&&(p(!0),m=!1);for(let e of t){let t=h(e);c.words.length>0&&c.totalWidth+t>u()&&(p(!0),m=!1),d(e,a&&t>u())}r=n;continue}}}let g=!d.isSpace&&d.text.length>1?Ce(e,d,u(),c.totalWidth):[d],_=0;for(let e=r+1;e<t.length;e++){let n=t[e];if(n.isSpace||n.text===`
11
- `)break;let r=!!n.text&&we.test(n.text),i=!n.text&&!!n.boxClose,a=!!n.text&&!!n.noBreakBefore;if(r||i||a){_+=n.width;continue}break}for(let i of g){let l=i===g[g.length-1]?_:0,d=!i.isSpace&&i.text.length>0&&we.test(i.text)&&c.words.length>0&&!c.words[c.words.length-1].isSpace,v=i===g[0]&&i.noBreakBefore&&c.words.length>0&&!c.words[c.words.length-1].isSpace,y=0;if(!i.text&&i.boxOpen){let n=t[r+1];n&&!n.isSpace&&n.text&&(y=(n.text.length>1?Ce(e,n,u(),0):[n])[0].width)}let b=0;if(i.isSoftHyphenBreak&&(z(e,i.style),e.letterSpacing=B(i.style.letterSpacing),b=R(e,`-`)),!i.isSpace&&!d&&!v&&c.words.length>0&&c.totalWidth+i.width+b+l+y>u()){let t=c.totalWidth+i.width+b+l+y-u(),r=!0;if(t<1&&!ee([...c.words,i])){z(e,i.style);let t=c.words.map(e=>e.text).join(``)+i.text+(i.isSoftHyphenBreak?`-`:``),n=0;for(let e of c.words)e.text||(n+=e.width);i.text||(n+=i.width),R(e,t)+n+l+y<=u()+.02&&(r=!1)}if(r&&i.text.includes(`-`)){let t=i.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/);if(t.length>1){z(e,i.style);let n=``,r=0,a=0,o=u()-c.totalWidth;for(;a<t.length;a++){let i=n+t[a],s=R(e,i);if(s>o)break;n=i,r=s}if(a>0&&a<t.length){c.words.push({...i,text:n,width:r}),c.totalWidth+=r,c.lineHeight=Math.max(c.lineHeight,h),p(!0),m=!1;let o=t.slice(a).join(``),s=R(e,o);c.words.push({...i,text:o,width:s}),c.totalWidth+=s,c.lineHeight=Math.max(c.lineHeight,h);continue}}}if(r){if(F){let e=c.words.map(e=>e.text).join(``);F({type:`line-wrap`,message:`"${i.text}" overflow=${t.toFixed(2)} wrap=true lineWidth=${c.totalWidth.toFixed(2)} pieceWidth=${i.width.toFixed(2)} contentWidth=${n} line="${e}"`,data:{text:i.text,overflow:t,lineWidth:c.totalWidth,pieceWidth:i.width,contentWidth:n,lineText:e}})}p(!0),m=!1}}if(i.isSpace&&c.words.length===0&&(!m||!f))continue;let x=i.width;if(i.isTab){let e=o?.interval||i.width,t=o?.halfSpace??0,n=e-((s.length===0?a:0)+c.totalWidth)%e;n<t&&(n+=e),x=n,i.width=x}if(c.words.length===0&&x>u()&&!i.isSpace&&i.text.includes(`-`)){let t=i.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/);if(t.length>1){z(e,i.style);let n=t.filter(e=>e).map(t=>({...i,text:t,width:R(e,t)})),r=!0;for(let e of n)r?(r=!1,c.words.push(e),c.totalWidth+=e.width,c.lineHeight=Math.max(c.lineHeight,h)):c.totalWidth+e.width>u()?(p(!0),m=!1,c.words.push(e),c.totalWidth+=e.width,c.lineHeight=Math.max(c.lineHeight,h)):(c.words.push(e),c.totalWidth+=e.width,c.lineHeight=Math.max(c.lineHeight,h));continue}}c.words.push(i),c.totalWidth+=x,c.lineHeight=Math.max(c.lineHeight,h),i.isSpace||(m=!1)}}return p(),s}function Ee(e,t,n,r,i,a=!1,o){let s=[];if(o&&(o.exhausted||o.remaining<=0))return o.exhausted=!0,{nodes:s,height:0};let c=pe(t);if(c.length===0)return{nodes:s,height:0};let l=ve(e,c),u=t.style.textIndent||0;z(e,t.style);let d=e.letterSpacing;e.letterSpacing=`0px`;let f=R(e,` `);e.letterSpacing=d;let p={interval:(f+(t.style.letterSpacing||0)+(t.style.wordSpacing||0))*8,halfSpace:f/2},m=Te(e,l,i,t.style.whiteSpace,a,u,p),h=o?o.remaining:t.style.lineClamp;if(h>0&&m.length>h){m.length=h;let t=m[h-1];fe(e,t,i-(h===1?u:0)),t.endedByHardBreak=!0,o&&(o.remaining=0,o.exhausted=!0)}else o&&(o.remaining-=m.length);let g=t.style.direction===`rtl`,_=e=>e===`start`?g?`right`:`left`:e===`end`?g?`left`:`right`:e,v=_(t.style.textAlign),y=t.style.textAlignLast||`auto`;y=y===`auto`?t.style.textAlign===`justify`?g?`right`:`left`:v:_(y);let b=r;for(let t=0;t<m.length;t++){let r=m[t];if(r.words.length===0){b+=r.lineHeight;continue}let a=r.lineHeight,o=t===m.length-1,c=t===0,l=o||r.endedByHardBreak?y:v,d=c?u:0,f=i-d,p=0;if(l===`justify`&&r.totalWidth<f){let e=r.words.filter(e=>e.isSpace).length;e>0&&(p=(f-r.totalWidth)/e)}let h=r.totalWidth>f+.5,_=n+d;h?_=g?n+f-r.totalWidth:n+d:l===`center`?_=n+d+(f-r.totalWidth)/2:l===`right`?_=(g?n+f:n+d+f)-r.totalWidth:l===`justify`&&g&&(_=n+f-r.totalWidth);let x=_,S=0,C=0;for(let t of r.words){if(t.text===``||Z(t.style.verticalAlign))continue;let{ascent:n,descent:r}=X(e,t.style);n>S&&(S=n),r>C&&(C=r)}if(S===0)for(let t of r.words){if(t.text===``)continue;let{ascent:n,descent:r}=X(e,t.style);S=n,C=r;break}let w=S+C,T=b+(a-w)/2+S,E=r.words.filter(e=>e.text!==``&&!Z(e.style.verticalAlign)),D=E.length>0?Math.max(...E.map(e=>e.style.fontSize)):0,O=b,k=b+a;for(let t of r.words){if(t.text===``)continue;let n=t.style.verticalAlign;if(!Z(n))continue;if(D===0)break;let{ascent:r,descent:i}=X(e,t.style),o=T+se(n,r,i,D,S,C,a),s=o-r,c=o+i;s<O&&(O=s),c>k&&(k=c)}let A=k-O,j=(t,n,r)=>{let{ascent:i,descent:a}=X(e,t),o=t.paddingTop+t.borderTopWidth,c=t.paddingBottom+t.borderBottomWidth,l=i+a+o+c,u;u=t.display===`inline-block`?b+t.marginTop:T-i-o,s.push({type:`box`,style:t,x:n,y:u,width:r,height:l,tagName:`span`,children:[]})};if(!g){let e=_,t=e,n,i=!1;for(let a of r.words){if(a.boxOpen&&a.boxClose&&a.text){n&&(i&&j(n,t,e-t),n=void 0,i=!1);let r=a.style,o=a.width-r.marginLeft-r.borderLeftWidth-r.paddingLeft-r.paddingRight-r.borderRightWidth-r.marginRight;j(r,e+r.marginLeft,r.borderLeftWidth+r.paddingLeft+o+r.paddingRight+r.borderRightWidth),i=!1,e+=a.width;continue}a.boxStyle!==n&&(n&&i&&j(n,t,e-t),n=a.boxStyle,t=e,i=!1),a.text&&!a.isSpace&&(i=!0),e+=a.width+(a.isSpace?p:0)}n&&i&&j(n,t,e-t)}let M=r.words.filter(e=>e.text!==``),N=M.length>0&&M.every(e=>le(e.style,M[0].style));if(g){let t=[],n=null,i=0;for(let e of r.words){if(e.text===``){n&&=(t.push(n),null),i+=e.width;continue}if(e.isSpace&&p>0){n&&=(t.push(n),null),i+=e.width+p;continue}n&&le(n.style,e.style)?(n.text+=e.text,n.width+=e.width):(n&&t.push(n),n={text:e.text,style:e.style,width:e.width,boxStyle:e.boxStyle,x:0,padBefore:i},i=0)}n&&t.push(n);let a=_+r.totalWidth;for(let n of t){a-=n.padBefore,z(e,n.style);let t=R(e,n.text);a-=t,n.x=a,n.width=t}for(let e of t)if(e.boxStyle&&ue(e.boxStyle)){let t=e.boxStyle,n=t.paddingLeft+t.borderLeftWidth,r=t.paddingRight+t.borderRightWidth;j(t,e.x-n,e.width+n+r)}for(let e of t)s.push({type:`text`,text:e.text,x:e.x+e.width,y:T,width:e.width,style:{...e.style,direction:`rtl`}})}else{let t=r.words.map(e=>e.text).join(``);if(N&&/[\u0590-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(t)&&!r.words.some(e=>e.boxOpen||e.boxClose||e.style.verticalAlign===`super`||e.style.verticalAlign===`sub`)){z(e,M[0].style);let n=R(e,t);s.push({type:`text`,text:t,x:_,y:T,width:n,style:{...M[0].style,direction:`ltr`}})}else for(let t of r.words){if(t.text===``){_+=t.width;continue}if(t.boxOpen&&t.boxClose){let n=t.style,r=_+n.marginLeft+n.borderLeftWidth+n.paddingLeft;s.push({type:`text`,text:t.text,x:r,y:T,width:R(e,t.text),style:t.style}),_+=t.width;continue}let n=T,r=t.style.verticalAlign;if(Z(r)){let i=D||t.style.fontSize,{ascent:o,descent:s}=X(e,t.style);n+=se(r,o,s,i,S,C,a)}let i=t.width+(t.isSpace?p:0);s.push({type:`text`,text:t.text,x:_,y:n,width:i,style:t.style}),_+=i}}let P=l===`justify`&&p>0?f:r.totalWidth;I.push({y:Math.round(T),text:r.words.map(e=>e.text).join(``),bounds:{x,y:O,width:P,height:A}}),b+=A}return{nodes:s,height:b-r}}function De(e,t){return e>=0&&t>=0?Math.max(e,t):e<0&&t<0?Math.min(e,t):e+t}function $(e,t,n,r,i,a){let o=t.style;!a&&o.lineClamp>0&&(a={remaining:o.lineClamp,exhausted:!1});let s=o.marginLeft,c=o.marginRight,l=o.borderLeftWidth,u=o.borderRightWidth,d=o.borderTopWidth,f=o.borderBottomWidth,p=o.paddingLeft,m=o.paddingRight,h=o.paddingTop,g=o.paddingBottom,_=n+s,v=o.width>0?o.width:i-s-c,y=_+l+p,b=Math.max(0,v-l-u-p-m),x=r,S=x+d+h,C={type:`box`,style:o,x:_,y:x,width:v,height:0,tagName:t.tagName,children:[],listMarker:t.listMarker};if(o.display===`flex`){let n=ke(e,t,y,S,b);return C.children=n.children,C.height=d+h+n.height+g+f,{box:C,height:C.height,marginBottomOut:o.marginBottom}}if(o.display===`table`){let n=Oe(e,t,y,S,b);return C.children=n.children,C.height=d+h+n.height+g+f,{box:C,height:C.height,marginBottomOut:o.marginBottom}}if(t.children.length===0)return C.height=d+h+g+f,o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:o.marginBottom};if(oe(t)){let{nodes:n,height:r}=Ee(e,t,y,S,b,t.tagName===`li`&&K.has(o.listStyleType),a);C.children=n,C.height=d+h+r+g+f}else{let n=S,r=0,i=!1,s=t.tagName===`li`||t.tagName===`ul`||t.tagName===`ol`||t.tagName===`dd`||t.tagName===`dt`;for(let c=0;c<t.children.length;c++){let l=t.children[c];if(a&&(a.exhausted||a.remaining<=0)){a.exhausted=!0,r=0;break}if(l.tagName===`#text`||q(l)){let s=[l];for(;c+1<t.children.length;){let e=t.children[c+1];if(e.tagName===`#text`||q(e))s.push(e),c++;else break}r>0&&(n+=r,r=0);let u={element:null,tagName:`div`,style:{...t.style,display:`block`,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTopWidth:0,borderBottomWidth:0},children:s,textContent:null},d=t.tagName===`li`&&K.has(o.listStyleType),{nodes:f,height:p}=Ee(e,u,y,n,b,d,a);C.children.push(...f),n+=p,r=0,i=!0;continue}let u=l.style.marginTop;if(!(!i&&h===0&&d===0&&s)){let e=De(r,u);n+=e}let{box:f,height:p,marginBottomOut:m}=$(e,l,y,n,b,a);C.children.push(f),n+=p,r=a?.exhausted?0:m,i=!0}let c=o.marginBottom,l=g===0&&f===0&&s;l&&r>0&&(c=Math.max(o.marginBottom,r));let u=n-S;return!l&&r>0&&(u+=r),C.height=d+h+u+g+f,o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:c}}return o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:o.marginBottom}}function Oe(e,t,n,r,i){let a=[],o=[];for(let e of t.children)if(e.tagName===`tr`)o.push(e);else if([`thead`,`tbody`,`tfoot`].includes(e.tagName))for(let t of e.children)t.tagName===`tr`&&o.push(t);if(o.length===0)return{children:a,height:0};let s=Math.max(...o.map(e=>e.children.filter(e=>e.tagName===`td`||e.tagName===`th`).length));if(s===0)return{children:a,height:0};let c=i/s,l=r;for(let t of o){let r=t.children.filter(e=>e.tagName===`td`||e.tagName===`th`),i=0,o=[];for(let t=0;t<r.length;t++){let a=r[t],{box:s,height:u}=$(e,a,n+t*c,l,c);o.push(s),i=Math.max(i,u)}for(let e of o)e.height=i,a.push(e);l+=i}return{children:a,height:l-r}}function ke(e,t,n,r,i){let a=t.style,o=a.gap,s=[],c=t.children.filter(e=>e.tagName!==`#text`||e.textContent?.trim());if(c.length===0)return{children:s,height:0};if(a.flexDirection===`row`||a.flexDirection===``){let t=o*(c.length-1),a=c.reduce((e,t)=>e+(t.style.flexGrow||0),0),l=(i-t)/(a||c.length),u=n,d=0;for(let t of c){if(t.tagName===`#text`)continue;let n=l*(t.style.flexGrow||(a===0?1:0)),{box:i,height:c}=$(e,t,u,r,n);s.push(i),d=Math.max(d,c),u+=n+o}return{children:s,height:d}}let l=r;for(let t of c){if(t.tagName===`#text`)continue;let{box:r,height:a}=$(e,t,n,l,i);s.push(r),l+=a+o}return{children:s,height:l-r}}function Ae(e,t,n){if(!n.listMarker||n.markerHidden)return;let r=n.style,i=n.markerStyle,a=i?{...r,...i}:r;e.font=H(a);let o=re(e,r),s=t.y+r.borderTopWidth+r.paddingTop+ie(e,r,o),c=R(e,n.listMarker),l=r.direction===`rtl`,u=K.has(r.listStyleType),d=l?i?.paddingLeft:i?.paddingRight,f,p=s,m=`ltr`,h=t.x+r.borderLeftWidth+r.paddingLeft,g=t.x+t.width;if(u){let{ascent:t}=X(e,a),r=e.measureText(n.listMarker),i=d===void 0?7+t/3:d;f=l?g+i+(r.actualBoundingBoxLeft??0):h-i-(r.actualBoundingBoxRight??c);let o=((r.actualBoundingBoxAscent??0)-(r.actualBoundingBoxDescent??0))/2;p=s-t/3+o}else{let t=d===void 0?R(e,` `):d;l?/\d/.test(n.listMarker)?(m=`rtl`,f=g+t+c):f=g+t:f=h-c-t}t.children.unshift({type:`text`,text:n.listMarker,x:f,y:p,width:c,style:{...a,textDecorationLine:`none`,textDecorations:[],fontWeight:i?.fontWeight??400,fontStyle:i?.fontStyle??`normal`,direction:m}});let _=m===`rtl`?f-c:f;I.push({y:Math.round(s),text:n.listMarker,bounds:{x:_,y:t.y+r.borderTopWidth+r.paddingTop,width:c,height:o}})}function je(e,t,n,r=!0,i){P=r,F=i,te.clear(),Y.clear(),V.clear(),L.clear(),I=[];let{box:a,height:o}=$(e,t,0,0,n);Me(e,a,t);let s=I.slice().sort((e,t)=>e.y-t.y||e.bounds.x-t.bounds.x),c=[];for(let e of s){let t=c[c.length-1],n=e.bounds.height*.5;if(t&&Math.abs(e.y-t.y)<n){let n=t.text.length>0&&e.text.length>0&&!/\s$/.test(t.text)&&!/^\s/.test(e.text);t.text+=(n?` `:``)+e.text,t.y=Math.max(t.y,e.y);let r=Math.min(t.bounds.x,e.bounds.x),i=Math.min(t.bounds.y,e.bounds.y),a=Math.max(t.bounds.x+t.bounds.width,e.bounds.x+e.bounds.width),o=Math.max(t.bounds.y+t.bounds.height,e.bounds.y+e.bounds.height);t.bounds={x:r,y:i,width:a-r,height:o-i}}else c.push({y:e.y,text:e.text,bounds:{...e.bounds}})}return{root:a,height:o,lines:c}}function Me(e,t,n){Ae(e,t,n);let r=0;for(let i of n.children)if(!(i.tagName===`#text`||q(i)))for(;r<t.children.length;){let n=t.children[r];if(n.type===`box`&&n.tagName===i.tagName){Me(e,n,i),r++;break}r++}}function Ne(e){if(!e||e===`none`)return[];let t=[],n=e.split(/,(?![^(]*\))/);for(let e of n){let n=e.trim(),r=n.match(/(rgb[a]?\([^)]+\)|#[0-9a-fA-F]+|\b[a-z]+\b)(?:\s|$)/i),i=n.match(/-?[\d.]+px/g);if(i&&i.length>=2){let e=i.map(e=>parseFloat(e));t.push({offsetX:e[0],offsetY:e[1],blur:e[2]||0,color:r?r[1]:`rgba(0,0,0,1)`})}}return t}function Pe(e,t){return e[`border${t}Width`]>0&&e[`border${t}Style`]!==`none`}function Fe(e,t,n,r,i,a,o){if(n=Math.round(n-i/2)+i/2,e.save(),e.strokeStyle=o,e.lineWidth=i,a===`double`){let a=Math.max(i,2);e.lineWidth=Math.max(.5,i*.5),e.beginPath(),e.moveTo(t,n-a/2),e.lineTo(t+r,n-a/2),e.moveTo(t,n+a/2),e.lineTo(t+r,n+a/2),e.stroke()}else if(a===`wavy`){let a=Math.max(1.5,i),o=a*4;e.beginPath(),e.moveTo(t,n);for(let i=t;i<t+r;i+=o)e.quadraticCurveTo(i+o/4,n-a,i+o/2,n),e.quadraticCurveTo(i+o*3/4,n+a,i+o,n);e.stroke()}else a===`dotted`?e.setLineDash([i,i*2]):a===`dashed`&&e.setLineDash([i*3,i*2]),e.beginPath(),e.moveTo(t,n),e.lineTo(t+r,n),e.stroke();e.setLineDash([]),e.restore()}function Ie(e,t,n,r,i,a){let o=t.indexOf(`linear-gradient(`);if(o===-1)return null;let s=0,c=-1;for(let e=o+16;e<t.length;e++)if(t[e]===`(`)s++;else if(t[e]===`)`){if(s===0){c=e;break}s--}if(c===-1)return null;let l=t.slice(o+16,c),u=[];s=0;let d=0,f=l;for(let e=0;e<f.length;e++)f[e]===`(`?s++:f[e]===`)`?s--:f[e]===`,`&&s===0&&(u.push(f.slice(d,e).trim()),d=e+1);u.push(f.slice(d).trim());let p=180,m=0,h=u[0];h.endsWith(`deg`)?(p=parseFloat(h),m=1):h===`to right`?(p=90,m=1):h===`to left`?(p=270,m=1):h===`to bottom`?(p=180,m=1):h===`to top`&&(p=0,m=1);let g=(p-90)*Math.PI/180,_=n+r/2,v=i+a/2,y=Math.abs(r*Math.cos(g))+Math.abs(a*Math.sin(g)),b=Math.cos(g)*y/2,x=Math.sin(g)*y/2,S=e.createLinearGradient(_-b,v-x,_+b,v+x),C=u.slice(m);for(let e=0;e<C.length;e++){let t=C[e].trim(),n=t,r=e/Math.max(1,C.length-1),i=t.match(/\s+([\d.]+%)\s*$/);i&&(r=parseFloat(i[1])/100,n=t.slice(0,t.length-i[0].length).trim());try{S.addColorStop(r,n)}catch{}}return S}function Le(e){return e.webkitTextFillColor&&e.webkitTextFillColor!==`transparent`?e.webkitTextFillColor:e.color}function Re(e){return Math.max(1,Math.floor(e/10))}function ze(e,t,n){e.strokeStyle=n||t.webkitTextStrokeColor||t.color,e.lineWidth=t.webkitTextStrokeWidth;let r=t.strokeLinejoin;e.lineJoin=r===`miter`||r===`bevel`?r:`round`}function Be(e,t,n,r,i=null){let{style:a}=t;e.save(),e.font=H(a),e.textBaseline=`alphabetic`,e.fontKerning=a.fontKerning===`none`?`none`:`normal`,Number.isFinite(a.letterSpacing)&&a.letterSpacing!==0&&(e.letterSpacing=`${a.letterSpacing}px`),a.wordSpacing&&(e.wordSpacing=`${a.wordSpacing}px`),a.direction===`rtl`&&(e.direction=`rtl`,e.textAlign=`right`);let o=a.webkitBackgroundClip===`text`&&a.backgroundImage&&a.backgroundImage!==`none`,s=a.webkitTextStrokeWidth>0,c=a.webkitTextFillColor===`transparent`||a.color===`transparent`,l=o||n!=null&&c,u=o&&a.backgroundImage!==i,d=null;if(u){let{ascent:n,descent:r}=X(e,a);d=Ie(e,a.backgroundImage,t.x,t.width,t.y-n,n+r)}let f=d??n??null,p=Ne(a.textShadow);if(p.length>0){let n=l||!c;for(let i of p)e.save(),e.shadowOffsetX=i.offsetX,e.shadowOffsetY=i.offsetY,e.shadowBlur=i.blur,e.shadowColor=i.color,n&&(e.fillStyle=l&&f?f:Le(a),e.fillText(t.text,t.x,t.y)),s&&(ze(e,a,r),e.strokeText(t.text,t.x,t.y)),e.restore()}let m=()=>{l?(e.save(),e.fillStyle=f||a.color,e.fillText(t.text,t.x,t.y),e.restore()):c||(e.fillStyle=Le(a),e.fillText(t.text,t.x,t.y))},h=()=>{s&&(e.save(),ze(e,a,r),e.strokeText(t.text,t.x,t.y),e.restore())};y(a.paintOrder)?(h(),m()):(m(),h());let g=t.width,_=a.fontSize,v=Re(_),b=a.direction===`rtl`?t.x-g:t.x;if(a.textDecorations.length>0){let{ascent:n}=X(e,a);for(let i of a.textDecorations){let o=i.color;if(J(i.color))if(f)o=f;else continue;let s=i.style||`solid`,c=a.webkitTextStrokeWidth>0?a.webkitTextStrokeWidth:0,l=r||a.webkitTextStrokeColor||a.color,u=t=>{let n=typeof l==`string`&&J(l);if(c>0&&!n){Fe(e,b,t,g,v+c,s,l);let n=v-c;n>0&&Fe(e,b,t,g,n,s,o)}else Fe(e,b,t,g,v,s,o)};if(i.line===`underline`){let e=_*.105-.2;u(t.y+e)}else if(i.line===`line-through`){let e=-(_*.33);u(t.y+e)}else i.line===`overline`&&u(Math.floor(t.y-n)-v/2)}}e.restore()}function Ve(e,t,n=null,r=null,i=null){let{style:a}=t;J(a.backgroundColor)||(e.fillStyle=a.backgroundColor,e.fillRect(t.x,t.y,t.width,t.height));let o=[[`Top`,t.x,t.y+a.borderTopWidth/2,t.x+t.width,t.y+a.borderTopWidth/2],[`Right`,t.x+t.width-a.borderRightWidth/2,t.y,t.x+t.width-a.borderRightWidth/2,t.y+t.height],[`Bottom`,t.x,t.y+t.height-a.borderBottomWidth/2,t.x+t.width,t.y+t.height-a.borderBottomWidth/2],[`Left`,t.x+a.borderLeftWidth/2,t.y,t.x+a.borderLeftWidth/2,t.y+t.height]];for(let[t,n,r,i,s]of o)Pe(a,t)&&(e.strokeStyle=a[`border${t}Color`],e.lineWidth=a[`border${t}Width`],e.beginPath(),e.moveTo(n,r),e.lineTo(i,s),e.stroke());a.webkitBackgroundClip===`text`&&a.backgroundImage&&a.backgroundImage!==`none`&&(n=Ie(e,a.backgroundImage,t.x,t.width,t.y,t.height),i=a.backgroundImage),a.webkitTextStrokeImage&&a.webkitTextStrokeImage!==`none`&&(r=Ie(e,a.webkitTextStrokeImage,t.x,t.width,t.y,t.height));for(let a of t.children)He(e,a,n,r,i)}function He(e,t,n,r,i=null){t.type===`text`?Be(e,t,n,r,i):Ve(e,t,n,r,i)}var Ue=null;function We(e){let{html:t,width:n,height:r,accuracy:a=`performance`,debug:s}=e;if(!n||n<=0||Number.isNaN(n))throw TypeError(`layout: width must be a positive number, got ${n}`);let c=a===`balanced`,{fragment:l,css:u}=o(t),{tree:d,cleanup:f}=N(l,u,n),p=e.ctx??(Ue??=i(!0));p.fontKerning=`normal`;let{root:m,height:h,lines:g}=je(p,d,n,c,s),_=r||h;return f(),{layoutRoot:m,height:_,lines:g}}function Ge(e){let{layout:t,width:n,pixelRatio:r=globalThis.devicePixelRatio??1}=e;if(e.ctx&&e.canvas)throw TypeError(`drawLayout: ctx and canvas are mutually exclusive — provide one or neither`);let i=t.height,a,o;if(e.ctx)o=e.ctx,a=e.ctx.canvas;else{if(!e.canvas&&typeof document>`u`)throw Error(`render-tag: drawLayout cannot create a canvas in a non-browser environment — pass ctx or canvas.`);a=e.canvas??document.createElement(`canvas`),a.width=Math.ceil(n*r),a.height=Math.ceil(i*r),`style`in a&&(a.style.width=`${n}px`,a.style.height=`${i}px`),o=a.getContext(`2d`),o.scale(r,r)}return He(o,t.layoutRoot),{canvas:a}}function Ke(e){if(e.ctx&&e.canvas)throw TypeError(`render: ctx and canvas are mutually exclusive — provide one or neither`);let t=We({html:e.html,width:e.width,height:e.height,accuracy:e.accuracy,debug:e.debug,ctx:e.ctx}),{canvas:n}=Ge({layout:t,width:e.width,ctx:e.ctx,canvas:e.canvas,pixelRatio:e.pixelRatio});return{canvas:n,height:t.height,layoutRoot:t.layoutRoot,lines:t.lines}}e.drawLayout=Ge,e.layout=We,e.render=Ke,e.setDOMParser=r});
9
+ `,width:0,style:r.style,isSpace:!1,boxStyle:r.boxStyle}),a[t]){let o=n.length;ye(e,a[t],r,n),i(o)}}else{let a=n.length;ye(e,t,r,n),i(a)}}return n}function Z(e){let t=e.codePointAt(0)||0;return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519||t>=131072&&t<=173791}var xe;function Se(){return xe||(typeof Intl<`u`&&Intl.Segmenter?(xe=new Intl.Segmenter(void 0,{granularity:`grapheme`}),xe):null)}var Ce=/\p{Extended_Pictographic}/u;function we(e){for(let t of e)if(t.codePointAt(0)>=126976)return!0;return e.includes(`‍`)||e.includes(`️`)?Ce.test(e):!1}function Te(e,t,n,r){let i=[...t.text].some(Z),a=Ce.test(t.text)&&!!Se(),o=t.width>n&&(t.style.overflowWrap===`break-word`||t.style.wordBreak===`break-all`);if(!i&&!a&&!o)return[t];if(o&&t.style.wordBreak!==`break-all`&&t.style.overflowWrap===`break-word`){let r=t.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/).filter(e=>e.length);if(r.length>1){e.font=V(t.style),e.letterSpacing=B(t.style.letterSpacing);let i=[];for(let a of r){let r=R(e,a);r<=n?i.push({...t,text:a,width:r}):i.push(...Te(e,{...t,text:a,width:r},n,0))}return i}}e.font=V(t.style),e.letterSpacing=B(t.style.letterSpacing);let s=a?Se():null,c=s?[...s.segment(t.text)].map(e=>e.segment):[...t.text],l=[],u=``,d=0;for(let r of c){if(a&&we(r)){u&&(l.push({...t,text:u,width:d}),u=``,d=0),l.push({...t,text:r,width:R(e,r)});continue}if(Z(r)){u&&(l.push({...t,text:u,width:d}),u=``,d=0);let n=R(e,r);l.push({...t,text:r,width:n});continue}let i=u+r,s=R(e,i);if(o&&s>n&&u){l.push({...t,text:u,width:d}),u=r,d=R(e,r);continue}u=i,d=s}return u&&l.push({...t,text:u,width:d}),l}var Ee=/^[,.\;:!?\)\]\}'"»›]+$/;function De(e,t,n,r,i=!1,a=0,o,s=0){let c=[],l=()=>({words:[],totalWidth:0,lineHeight:s}),u=l(),d=r===`nowrap`||r===`pre`,f=()=>n-(c.length===0?a:0),p=r===`pre-wrap`||r===`pre`||r===`pre-line`,m=r===`pre`||r===`pre-wrap`||r===`break-spaces`;function h(t=!1){let i=u.words.length>0;if(!(r===`break-spaces`||m&&!t))for(;u.words.length>0&&u.words[u.words.length-1].isSpace;)u.totalWidth-=u.words[u.words.length-1].width,u.words.pop();if(t&&u.words.length>0){let t=u.words[u.words.length-1];if(t.isSoftHyphenBreak){z(e,t.style);let n=R(e,`-`);u.words.push({text:`-`,width:n,style:t.style,isSpace:!1}),u.totalWidth+=n}}if(u.words.length>0||i&&p){if(F){let e=u.words.map(e=>e.text).join(``);F({type:`line-commit`,message:`Line ${c.length}: "${e}" width=${u.totalWidth.toFixed(2)} / ${n}`,data:{lineIndex:c.length,text:e,totalWidth:u.totalWidth,contentWidth:n}})}c.push(u)}u=l()}let g=!0;for(let r=0;r<t.length;r++){let s=t[r],p=K(e,s.style,i);if(s.boxStyle&&s.boxStyle.display===`inline-block`){let e=s.boxStyle;p=Math.max(p,p+e.paddingTop+e.paddingBottom+e.marginTop+e.marginBottom+e.borderTopWidth+e.borderBottomWidth)}if(s.text===`
10
+ `){u.words.length===0?(u.lineHeight=Math.max(u.lineHeight,p),u.endedByHardBreak=!0,c.push(u),u=l()):(u.endedByHardBreak=!0,h()),g=!0;continue}if(d){u.words.push(s),u.totalWidth+=s.width,u.lineHeight=Math.max(u.lineHeight,p);continue}if(!s.isSpace&&s.text&&!s.noBreakBefore&&!s.boxOpen&&!s.boxClose){let n=r;for(;n+1<t.length;){let e=t[n+1];if(!e.text||e.isSpace||e.boxOpen||e.boxClose||!e.noBreakBefore)break;n++}if(n>r){let a=s.style.overflowWrap===`break-word`||s.style.wordBreak===`break-all`,o=0;for(let e=r;e<=n;e++)o+=t[e].width;let c=[];for(let e=r;e<=n;e++)for(let n of[...t[e].text])c.push({ch:n,style:t[e].style});let l=c.map(e=>e.ch).join(``).split(/(?<=-)(?!\d)|(?<=[^\d]-)/).filter(e=>e.length),d=l.length>1;if(!(u.totalWidth+o<=f())&&(d||a&&o>f())){let t=[],o=0;for(let e of l){let n=[...e].length;t.push(c.slice(o,o+n)),o+=n}let s=(t,n)=>{let r=0;for(;r<t.length;){let a=t[r].style;z(e,a),e.letterSpacing=B(a.letterSpacing);let o=K(e,a,i),s=``,c=0;for(;r<t.length&&t[r].style===a;){let i=t[r].ch,l=R(e,s+i);n&&u.totalWidth+l>f()&&(u.words.length>0||s)?(s&&(u.words.push({text:s,width:c,style:a,isSpace:!1}),u.totalWidth+=c,u.lineHeight=Math.max(u.lineHeight,o)),h(!0),g=!1,s=i,c=R(e,i)):(s+=i,c=l),r++}s&&(u.words.push({text:s,width:c,style:a,isSpace:!1}),u.totalWidth+=c,u.lineHeight=Math.max(u.lineHeight,o),g=!1)}},p=t=>{let n=0,r=0;for(;r<t.length;){let i=t[r].style,a=``;for(;r<t.length&&t[r].style===i;)a+=t[r].ch,r++;z(e,i),e.letterSpacing=B(i.letterSpacing),n+=R(e,a)}return n};!d&&u.words.length>0&&(h(!0),g=!1);for(let e of t){let t=p(e);u.words.length>0&&u.totalWidth+t>f()&&(h(!0),g=!1),s(e,a&&t>f())}r=n;continue}}}let _=!s.isSpace&&s.text.length>1?Te(e,s,f(),u.totalWidth):[s],v=0;for(let e=r+1;e<t.length;e++){let n=t[e];if(n.isSpace||n.text===`
11
+ `)break;let r=!!n.text&&Ee.test(n.text),i=!n.text&&!!n.boxClose,a=!!n.text&&!!n.noBreakBefore;if(r||i||a){v+=n.width;continue}break}for(let i of _){let s=i===_[_.length-1]?v:0,l=!i.isSpace&&i.text.length>0&&Ee.test(i.text)&&u.words.length>0&&!u.words[u.words.length-1].isSpace,d=i===_[0]&&i.noBreakBefore&&u.words.length>0&&!u.words[u.words.length-1].isSpace,y=0;if(!i.text&&i.boxOpen){let n=t[r+1];n&&!n.isSpace&&n.text&&(y=(n.text.length>1?Te(e,n,f(),0):[n])[0].width)}let b=0;if(i.isSoftHyphenBreak&&(z(e,i.style),e.letterSpacing=B(i.style.letterSpacing),b=R(e,`-`)),!i.isSpace&&!l&&!d&&u.words.length>0&&u.totalWidth+i.width+b+s+y>f()){let t=u.totalWidth+i.width+b+s+y-f(),r=!0;if(t<1&&!ee([...u.words,i])){z(e,i.style);let t=u.words.map(e=>e.text).join(``)+i.text+(i.isSoftHyphenBreak?`-`:``),n=0;for(let e of u.words)e.text||(n+=e.width);i.text||(n+=i.width),R(e,t)+n+s+y<=f()+.02&&(r=!1)}if(r&&i.text.includes(`-`)){let t=i.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/);if(t.length>1){z(e,i.style);let n=``,r=0,a=0,o=f()-u.totalWidth;for(;a<t.length;a++){let i=n+t[a],s=R(e,i);if(s>o)break;n=i,r=s}if(a>0&&a<t.length){u.words.push({...i,text:n,width:r}),u.totalWidth+=r,u.lineHeight=Math.max(u.lineHeight,p),h(!0),g=!1;let o=t.slice(a).join(``),s=R(e,o);u.words.push({...i,text:o,width:s}),u.totalWidth+=s,u.lineHeight=Math.max(u.lineHeight,p);continue}}}if(r){if(F){let e=u.words.map(e=>e.text).join(``);F({type:`line-wrap`,message:`"${i.text}" overflow=${t.toFixed(2)} wrap=true lineWidth=${u.totalWidth.toFixed(2)} pieceWidth=${i.width.toFixed(2)} contentWidth=${n} line="${e}"`,data:{text:i.text,overflow:t,lineWidth:u.totalWidth,pieceWidth:i.width,contentWidth:n,lineText:e}})}h(!0),g=!1}}if(i.isSpace&&u.words.length===0&&(!g||!m))continue;let x=i.width;if(i.isTab){let e=o?.interval||i.width,t=o?.halfSpace??0,n=e-((c.length===0?a:0)+u.totalWidth)%e;n<t&&(n+=e),x=n,i.width=x}if(u.words.length===0&&x>f()&&!i.isSpace&&i.text.includes(`-`)){let t=i.text.split(/(?<=-)(?!\d)|(?<=[^\d]-)/);if(t.length>1){z(e,i.style);let n=t.filter(e=>e).map(t=>({...i,text:t,width:R(e,t)})),r=!0;for(let e of n)r?(r=!1,u.words.push(e),u.totalWidth+=e.width,u.lineHeight=Math.max(u.lineHeight,p)):u.totalWidth+e.width>f()?(h(!0),g=!1,u.words.push(e),u.totalWidth+=e.width,u.lineHeight=Math.max(u.lineHeight,p)):(u.words.push(e),u.totalWidth+=e.width,u.lineHeight=Math.max(u.lineHeight,p));continue}}u.words.push(i),u.totalWidth+=x,u.lineHeight=Math.max(u.lineHeight,p),i.isSpace||(g=!1)}}return h(),c}function Oe(e,t,n,r,i,a=!1,o){let s=[],c=new Map,l=new Map;if(o&&(o.exhausted||o.remaining<=0))return o.exhausted=!0,{nodes:s,height:0};let u=he(t);if(u.length===0)return{nodes:s,height:0};let d=be(e,u),f=t.style.textIndent||0;z(e,t.style);let p=e.letterSpacing;e.letterSpacing=`0px`;let m=R(e,` `);e.letterSpacing=p;let h={interval:(m+(t.style.letterSpacing||0)+(t.style.wordSpacing||0))*8,halfSpace:m/2},g=K(e,t.style,a),_=De(e,d,i,t.style.whiteSpace,a,f,h,g),v=o?o.remaining:t.style.lineClamp;if(v>0&&_.length>v){_.length=v;let t=_[v-1];me(e,t,i-(v===1?f:0)),t.endedByHardBreak=!0,o&&(o.remaining=0,o.exhausted=!0)}else o&&(o.remaining-=_.length);let y=t.style.direction===`rtl`,b=e=>e===`start`?y?`right`:`left`:e===`end`?y?`left`:`right`:e,x=b(t.style.textAlign),S=t.style.textAlignLast||`auto`;S=S===`auto`?t.style.textAlign===`justify`?y?`right`:`left`:x:b(S);let C=Y(e,t.style),w=r;for(let t=0;t<_.length;t++){let r=_[t];if(r.words.length===0){w+=r.lineHeight;continue}let a=r.lineHeight,o=t===_.length-1,u=t===0,d=o||r.endedByHardBreak?S:x,p=u?f:0,m=i-p,h=0;if(d===`justify`&&r.totalWidth<m){let e=r.words.filter(e=>e.isSpace).length;e>0&&(h=(m-r.totalWidth)/e)}let g=r.totalWidth>m+.5,v=n+p;g?v=y?n+m-r.totalWidth:n+p:d===`center`?v=n+p+(m-r.totalWidth)/2:d===`right`?v=(y?n+m:n+p+m)-r.totalWidth:d===`justify`&&y&&(v=n+m-r.totalWidth);let b=v,T=C.ascent,E=C.descent;for(let t of r.words){if(t.text===``||X(t.style.verticalAlign))continue;let{ascent:n,descent:r}=Y(e,t.style);n>T&&(T=n),r>E&&(E=r)}if(T===0)for(let t of r.words){if(t.text===``)continue;let{ascent:n,descent:r}=Y(e,t.style);T=n,E=r;break}let D=T+E,O=w+(a-D)/2+T,k=r.words.filter(e=>e.text!==``&&!X(e.style.verticalAlign)),A=k.length>0?Math.max(...k.map(e=>e.style.fontSize)):0,j=w,M=w+a;for(let t of r.words){if(t.text===``)continue;let n=t.style.verticalAlign;if(!X(n))continue;if(A===0)break;let{ascent:r,descent:i}=Y(e,t.style),o=O+ce(n,r,i,A,T,E,a),s=o-r,c=o+i;s<j&&(j=s),c>M&&(M=c)}let N=M-j,P=(t,n,r)=>{let{ascent:i,descent:a}=Y(e,t),o=t.paddingTop+t.borderTopWidth,c=t.paddingBottom+t.borderBottomWidth,l=i+a+o+c,u;u=t.display===`inline-block`?w+t.marginTop:O-i-o,s.push({type:`box`,style:t,x:n,y:u,width:r,height:l,tagName:`span`,children:[]})};if(!y){let e=v,t=e,n,i=!1;for(let a of r.words){if(a.boxOpen&&a.boxClose&&a.text){n&&(i&&P(n,t,e-t),n=void 0,i=!1);let r=a.style,o=a.width-r.marginLeft-r.borderLeftWidth-r.paddingLeft-r.paddingRight-r.borderRightWidth-r.marginRight;P(r,e+r.marginLeft,r.borderLeftWidth+r.paddingLeft+o+r.paddingRight+r.borderRightWidth),i=!1,e+=a.width;continue}a.boxStyle!==n&&(n&&i&&P(n,t,e-t),n=a.boxStyle,t=e,i=!1),a.text&&!a.isSpace&&(i=!0),e+=a.width+(a.isSpace?h:0)}n&&i&&P(n,t,e-t)}let F=r.words.filter(e=>e.text!==``),L=F.length>0&&F.every(e=>ue(e.style,F[0].style));if(y){let t=[],n=null,i=0;for(let e of r.words){if(e.text===``){n&&=(t.push(n),null),i+=e.width;continue}if(e.isSpace&&h>0){n&&=(t.push(n),null),i+=e.width+h;continue}n&&ue(n.style,e.style)?(n.text+=e.text,n.width+=e.width):(n&&t.push(n),n={text:e.text,style:e.style,width:e.width,boxStyle:e.boxStyle,clipStyle:e.clipStyle,strokeImageStyle:e.strokeImageStyle,x:0,padBefore:i},i=0)}n&&t.push(n);let a=v+r.totalWidth;for(let n of t){a-=n.padBefore,z(e,n.style);let t=R(e,n.text);a-=t,n.x=a,n.width=t}for(let e of t)if(e.boxStyle&&de(e.boxStyle)){let t=e.boxStyle,n=t.paddingLeft+t.borderLeftWidth,r=t.paddingRight+t.borderRightWidth;P(t,e.x-n,e.width+n+r)}for(let e of t){let t={type:`text`,text:e.text,x:e.x+e.width,y:O,width:e.width,style:{...e.style,direction:`rtl`}};s.push(t),e.clipStyle&&c.set(t,e.clipStyle),e.strokeImageStyle&&l.set(t,e.strokeImageStyle)}}else{let t=r.words.map(e=>e.text).join(``);if(L&&/[\u0590-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/.test(t)&&!r.words.some(e=>e.boxOpen||e.boxClose||e.style.verticalAlign===`super`||e.style.verticalAlign===`sub`)){z(e,F[0].style);let n=R(e,t),r={type:`text`,text:t,x:v,y:O,width:n,style:{...F[0].style,direction:`ltr`}};s.push(r),F[0].clipStyle&&c.set(r,F[0].clipStyle),F[0].strokeImageStyle&&l.set(r,F[0].strokeImageStyle)}else for(let t of r.words){if(t.text===``){v+=t.width;continue}if(t.boxOpen&&t.boxClose){let n=t.style,r=v+n.marginLeft+n.borderLeftWidth+n.paddingLeft,i={type:`text`,text:t.text,x:r,y:O,width:R(e,t.text),style:t.style};s.push(i),t.clipStyle&&c.set(i,t.clipStyle),t.strokeImageStyle&&l.set(i,t.strokeImageStyle),v+=t.width;continue}let n=O,r=t.style.verticalAlign;if(X(r)){let i=A||t.style.fontSize,{ascent:o,descent:s}=Y(e,t.style);n+=ce(r,o,s,i,T,E,a)}let i=t.width+(t.isSpace?h:0),o={type:`text`,text:t.text,x:v,y:n,width:i,style:t.style};s.push(o),t.clipStyle&&c.set(o,t.clipStyle),t.strokeImageStyle&&l.set(o,t.strokeImageStyle),v+=i}}let ee=d===`justify`&&h>0?m:r.totalWidth;I.push({y:Math.round(O),text:r.words.map(e=>e.text).join(``),bounds:{x:b,y:j,width:ee,height:N}}),w+=N}return ke(e,s,c,(e,t,n)=>{e.clip={image:t.backgroundImage&&t.backgroundImage!==`none`?t.backgroundImage:void 0,color:J(t.backgroundColor)?void 0:t.backgroundColor,...n}}),ke(e,s,l,(e,t,n)=>{e.strokeImage={image:t.webkitTextStrokeImage,...n}}),{nodes:s,height:w-r}}function ke(e,t,n,r){if(n.size===0)return;let i=e=>e.style.direction===`rtl`?{left:e.x-e.width,right:e.x}:{left:e.x,right:e.x+e.width};for(let a=0;a<t.length;){let o=t[a],s=o.type===`text`?n.get(o):void 0;if(!s){a++;continue}let c=a,l=1/0,u=-1/0;for(;c<t.length;){let e=t[c];if(e.type!==`text`||n.get(e)!==s||e.y!==o.y)break;let r=i(e);r.left<l&&(l=r.left),r.right>u&&(u=r.right),c++}let{ascent:d,descent:f}=Y(e,s),p={x:l,y:o.y-d,width:u-l,height:d+f};for(let e=a;e<c;e++)r(t[e],s,p);a=c}}function Ae(e,t){return e>=0&&t>=0?Math.max(e,t):e<0&&t<0?Math.min(e,t):e+t}function Q(e,t,n,r,i,a){let o=t.style;!a&&o.lineClamp>0&&(a={remaining:o.lineClamp,exhausted:!1});let s=o.marginLeft,c=o.marginRight,l=o.borderLeftWidth,u=o.borderRightWidth,d=o.borderTopWidth,f=o.borderBottomWidth,p=o.paddingLeft,m=o.paddingRight,h=o.paddingTop,g=o.paddingBottom,_=n+s,v=o.width>0?o.width:i-s-c,y=_+l+p,b=Math.max(0,v-l-u-p-m),x=r,S=x+d+h,C={type:`box`,style:o,x:_,y:x,width:v,height:0,tagName:t.tagName,children:[],listMarker:t.listMarker};if(o.display===`flex`){let n=Me(e,t,y,S,b);return C.children=n.children,C.height=d+h+n.height+g+f,{box:C,height:C.height,marginBottomOut:o.marginBottom}}if(o.display===`table`){let n=je(e,t,y,S,b);return C.children=n.children,C.height=d+h+n.height+g+f,{box:C,height:C.height,marginBottomOut:o.marginBottom}}if(t.children.length===0)return C.height=d+h+g+f,o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:o.marginBottom};if(oe(t)){let{nodes:n,height:r}=Oe(e,t,y,S,b,t.tagName===`li`&&G.has(o.listStyleType),a);C.children=n,C.height=d+h+r+g+f}else{let n=S,r=0,i=!1,s=t.tagName===`li`||t.tagName===`ul`||t.tagName===`ol`||t.tagName===`dd`||t.tagName===`dt`;for(let c=0;c<t.children.length;c++){let l=t.children[c];if(a&&(a.exhausted||a.remaining<=0)){a.exhausted=!0,r=0;break}if(l.tagName===`#text`||q(l)){let s=[l];for(;c+1<t.children.length;){let e=t.children[c+1];if(e.tagName===`#text`||q(e))s.push(e),c++;else break}r>0&&(n+=r,r=0);let u={element:null,tagName:`div`,style:{...t.style,display:`block`,marginTop:0,marginBottom:0,paddingTop:0,paddingBottom:0,borderTopWidth:0,borderBottomWidth:0},children:s,textContent:null},d=t.tagName===`li`&&G.has(o.listStyleType),{nodes:f,height:p}=Oe(e,u,y,n,b,d,a);C.children.push(...f),n+=p,r=0,i=!0;continue}let u=l.style.marginTop;if(!(!i&&h===0&&d===0&&s)){let e=Ae(r,u);n+=e}let{box:f,height:p,marginBottomOut:m}=Q(e,l,y,n,b,a);C.children.push(f),n+=p,r=a?.exhausted?0:m,i=!0}let c=o.marginBottom,l=g===0&&f===0&&s;l&&r>0&&(c=Math.max(o.marginBottom,r));let u=n-S;return!l&&r>0&&(u+=r),C.height=d+h+u+g+f,o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:c}}return o.minHeight>0&&(C.height=Math.max(C.height,o.minHeight)),{box:C,height:C.height,marginBottomOut:o.marginBottom}}function je(e,t,n,r,i){let a=[],o=[];for(let e of t.children)if(e.tagName===`tr`)o.push(e);else if([`thead`,`tbody`,`tfoot`].includes(e.tagName))for(let t of e.children)t.tagName===`tr`&&o.push(t);if(o.length===0)return{children:a,height:0};let s=Math.max(...o.map(e=>e.children.filter(e=>e.tagName===`td`||e.tagName===`th`).length));if(s===0)return{children:a,height:0};let c=i/s,l=r;for(let t of o){let r=t.children.filter(e=>e.tagName===`td`||e.tagName===`th`),i=0,o=[];for(let t=0;t<r.length;t++){let a=r[t],{box:s,height:u}=Q(e,a,n+t*c,l,c);o.push(s),i=Math.max(i,u)}for(let e of o)e.height=i,a.push(e);l+=i}return{children:a,height:l-r}}function Me(e,t,n,r,i){let a=t.style,o=a.gap,s=[],c=t.children.filter(e=>e.tagName!==`#text`||e.textContent?.trim());if(c.length===0)return{children:s,height:0};if(a.flexDirection===`row`||a.flexDirection===``){let t=o*(c.length-1),a=c.reduce((e,t)=>e+(t.style.flexGrow||0),0),l=(i-t)/(a||c.length),u=n,d=0;for(let t of c){if(t.tagName===`#text`)continue;let n=l*(t.style.flexGrow||(a===0?1:0)),{box:i,height:c}=Q(e,t,u,r,n);s.push(i),d=Math.max(d,c),u+=n+o}return{children:s,height:d}}let l=r;for(let t of c){if(t.tagName===`#text`)continue;let{box:r,height:a}=Q(e,t,n,l,i);s.push(r),l+=a+o}return{children:s,height:l-r}}function Ne(e,t,n){if(!n.listMarker||n.markerHidden)return;let r=n.style,i=n.markerStyle,a=i?{...r,...i}:r;e.font=V(a);let o=K(e,r),s=t.y+r.borderTopWidth+r.paddingTop+ie(e,r,o),c=R(e,n.listMarker),l=r.direction===`rtl`,u=G.has(r.listStyleType),d=l?i?.paddingLeft:i?.paddingRight,f,p=s,m=`ltr`,h=a,g=c,_=t.x+r.borderLeftWidth+r.paddingLeft,v=t.x+t.width;if(u){let{ascent:t}=Y(e,a),r=e.measureText(n.listMarker),i=t/3,o=d===void 0?7+i:d,u=(r.actualBoundingBoxAscent??0)+(r.actualBoundingBoxDescent??0),m=u>0?i/u:1,y=(r.actualBoundingBoxRight??c)*m,b=(r.actualBoundingBoxLeft??0)*m,x=((r.actualBoundingBoxAscent??0)-(r.actualBoundingBoxDescent??0))/2*m;f=l?v+o+b:_-o-y,p=s-i+x,h={...a,fontSize:a.fontSize*m},g=c*m}else{let t=d===void 0?R(e,` `):d;l?/\d/.test(n.listMarker)?(m=`rtl`,f=v+t+c):f=v+t:f=_-c-t}t.children.unshift({type:`text`,text:n.listMarker,x:f,y:p,width:g,style:{...h,textDecorationLine:`none`,textDecorations:[],fontWeight:i?.fontWeight??400,fontStyle:i?.fontStyle??`normal`,direction:m}});let y=m===`rtl`?f-g:f;I.push({y:Math.round(s),text:n.listMarker,bounds:{x:y,y:t.y+r.borderTopWidth+r.paddingTop,width:g,height:o}})}function Pe(e,t,n,r=!0,i){P=r,F=i,ne.clear(),se.clear(),te.clear(),L.clear(),I=[];let{box:a,height:o}=Q(e,t,0,0,n);Fe(e,a,t);let s=I.slice().sort((e,t)=>e.y-t.y||e.bounds.x-t.bounds.x),c=[];for(let e of s){let t=c[c.length-1],n=e.bounds.height*.5;if(t&&Math.abs(e.y-t.y)<n){let n=t.text.length>0&&e.text.length>0&&!/\s$/.test(t.text)&&!/^\s/.test(e.text);t.text+=(n?` `:``)+e.text,t.y=Math.max(t.y,e.y);let r=Math.min(t.bounds.x,e.bounds.x),i=Math.min(t.bounds.y,e.bounds.y),a=Math.max(t.bounds.x+t.bounds.width,e.bounds.x+e.bounds.width),o=Math.max(t.bounds.y+t.bounds.height,e.bounds.y+e.bounds.height);t.bounds={x:r,y:i,width:a-r,height:o-i}}else c.push({y:e.y,text:e.text,bounds:{...e.bounds}})}return{root:a,height:o,lines:c}}function Fe(e,t,n){Ne(e,t,n);let r=0;for(let i of n.children)if(!(i.tagName===`#text`||q(i)))for(;r<t.children.length;){let n=t.children[r];if(n.type===`box`&&n.tagName===i.tagName){Fe(e,n,i),r++;break}r++}}function Ie(e){if(!e||e===`none`)return[];let t=[],n=e.split(/,(?![^(]*\))/);for(let e of n){let n=e.trim(),r=n.match(/(rgb[a]?\([^)]+\)|#[0-9a-fA-F]+|\b[a-z]+\b)(?:\s|$)/i),i=n.match(/-?[\d.]+px/g);if(i&&i.length>=2){let e=i.map(e=>parseFloat(e));t.push({offsetX:e[0],offsetY:e[1],blur:e[2]||0,color:r?r[1]:`rgba(0,0,0,1)`})}}return t}function Le(e,t){return e[`border${t}Width`]>0&&e[`border${t}Style`]!==`none`}function Re(e,t,n,r,i,a,o){if(n=Math.round(n-i/2)+i/2,e.save(),e.strokeStyle=o,e.lineWidth=i,a===`double`){let a=Math.max(i,2);e.lineWidth=Math.max(.5,i*.5),e.beginPath(),e.moveTo(t,n-a/2),e.lineTo(t+r,n-a/2),e.moveTo(t,n+a/2),e.lineTo(t+r,n+a/2),e.stroke()}else if(a===`wavy`){let a=Math.max(1.5,i),o=a*4;e.beginPath(),e.moveTo(t,n);for(let i=t;i<t+r;i+=o)e.quadraticCurveTo(i+o/4,n-a,i+o/2,n),e.quadraticCurveTo(i+o*3/4,n+a,i+o,n);e.stroke()}else a===`dotted`?e.setLineDash([i,i*2]):a===`dashed`&&e.setLineDash([i*3,i*2]),e.beginPath(),e.moveTo(t,n),e.lineTo(t+r,n),e.stroke();e.setLineDash([]),e.restore()}function $(e,t,n,r,i,a){let o=t.indexOf(`linear-gradient(`);if(o===-1)return null;let s=0,c=-1;for(let e=o+16;e<t.length;e++)if(t[e]===`(`)s++;else if(t[e]===`)`){if(s===0){c=e;break}s--}if(c===-1)return null;let l=t.slice(o+16,c),u=[];s=0;let d=0,f=l;for(let e=0;e<f.length;e++)f[e]===`(`?s++:f[e]===`)`?s--:f[e]===`,`&&s===0&&(u.push(f.slice(d,e).trim()),d=e+1);u.push(f.slice(d).trim());let p=180,m=0,h=u[0];h.endsWith(`deg`)?(p=parseFloat(h),m=1):h===`to right`?(p=90,m=1):h===`to left`?(p=270,m=1):h===`to bottom`?(p=180,m=1):h===`to top`&&(p=0,m=1);let g=(p-90)*Math.PI/180,_=n+r/2,v=i+a/2,y=Math.abs(r*Math.cos(g))+Math.abs(a*Math.sin(g)),b=Math.cos(g)*y/2,x=Math.sin(g)*y/2,S=e.createLinearGradient(_-b,v-x,_+b,v+x),C=u.slice(m);for(let e=0;e<C.length;e++){let t=C[e].trim(),n=t,r=e/Math.max(1,C.length-1),i=t.match(/\s+([\d.]+%)\s*$/);i&&(r=parseFloat(i[1])/100,n=t.slice(0,t.length-i[0].length).trim());try{S.addColorStop(r,n)}catch{}}return S}function ze(e){return e.webkitTextFillColor&&e.webkitTextFillColor!==`transparent`?e.webkitTextFillColor:e.color}function Be(e){return Math.max(1,Math.floor(e/10))}function Ve(e,t,n){e.strokeStyle=n||t.webkitTextStrokeColor||t.color,e.lineWidth=t.webkitTextStrokeWidth;let r=t.strokeLinejoin;e.lineJoin=r===`miter`||r===`bevel`?r:`round`}function He(e,t,n,r){let{style:i}=t;e.save(),e.font=V(i),e.textBaseline=`alphabetic`,e.fontKerning=i.fontKerning===`none`?`none`:`normal`,Number.isFinite(i.letterSpacing)&&i.letterSpacing!==0&&(e.letterSpacing=`${i.letterSpacing}px`),i.wordSpacing&&(e.wordSpacing=`${i.wordSpacing}px`),i.direction===`rtl`&&(e.direction=`rtl`,e.textAlign=`right`);let a=fe(i),o=i.webkitTextStrokeWidth>0,s=i.webkitTextFillColor===`transparent`||i.color===`transparent`,c=t.clip?(t.clip.image?$(e,t.clip.image,t.clip.x,t.clip.width,t.clip.y,t.clip.height):null)??t.clip.color??null:null,l=a||(n!=null||c!=null)&&s,u=c??n??null,d=(t.strokeImage?$(e,t.strokeImage.image,t.strokeImage.x,t.strokeImage.width,t.strokeImage.y,t.strokeImage.height):null)??r??null,f=Ie(i.textShadow);if(f.length>0){let n=l||!s;for(let r of f)e.save(),e.shadowOffsetX=r.offsetX,e.shadowOffsetY=r.offsetY,e.shadowBlur=r.blur,e.shadowColor=r.color,n&&(e.fillStyle=l&&u?u:ze(i),e.fillText(t.text,t.x,t.y)),o&&(Ve(e,i,d),e.strokeText(t.text,t.x,t.y)),e.restore()}let p=()=>{l?(e.save(),e.fillStyle=u||i.color,e.fillText(t.text,t.x,t.y),e.restore()):s||(e.fillStyle=ze(i),e.fillText(t.text,t.x,t.y))},m=()=>{o&&(e.save(),Ve(e,i,d),e.strokeText(t.text,t.x,t.y),e.restore())};y(i.paintOrder)?(m(),p()):(p(),m());let h=t.width,g=i.fontSize,_=Be(g),v=i.direction===`rtl`?t.x-h:t.x;if(i.textDecorations.length>0){let{ascent:n}=Y(e,i);for(let r of i.textDecorations){let a=r.color;if(J(r.color))if(u)a=u;else continue;let o=r.style||`solid`,s=i.webkitTextStrokeWidth>0?i.webkitTextStrokeWidth:0,c=d||i.webkitTextStrokeColor||i.color,l=t=>{let n=typeof c==`string`&&J(c);if(s>0&&!n){Re(e,v,t,h,_+s,o,c);let n=_-s;n>0&&Re(e,v,t,h,n,o,a)}else Re(e,v,t,h,_,o,a)};if(r.line===`underline`){let e=g*.105-.2;l(t.y+e)}else if(r.line===`line-through`){let e=-(g*.33);l(t.y+e)}else r.line===`overline`&&l(Math.floor(t.y-n)-_/2)}}e.restore()}function Ue(e,t,n=null,r=null){let{style:i}=t;!J(i.backgroundColor)&&i.webkitBackgroundClip!==`text`&&(e.fillStyle=i.backgroundColor,e.fillRect(t.x,t.y,t.width,t.height));let a=[[`Top`,t.x,t.y+i.borderTopWidth/2,t.x+t.width,t.y+i.borderTopWidth/2],[`Right`,t.x+t.width-i.borderRightWidth/2,t.y,t.x+t.width-i.borderRightWidth/2,t.y+t.height],[`Bottom`,t.x,t.y+t.height-i.borderBottomWidth/2,t.x+t.width,t.y+t.height-i.borderBottomWidth/2],[`Left`,t.x+i.borderLeftWidth/2,t.y,t.x+i.borderLeftWidth/2,t.y+t.height]];for(let[t,n,r,o,s]of a)Le(i,t)&&(e.strokeStyle=i[`border${t}Color`],e.lineWidth=i[`border${t}Width`],e.beginPath(),e.moveTo(n,r),e.lineTo(o,s),e.stroke());if(fe(i)){let r=i.backgroundImage&&i.backgroundImage!==`none`?$(e,i.backgroundImage,t.x,t.width,t.y,t.height):null,a=J(i.backgroundColor)?null:i.backgroundColor;n=r??a??n}i.webkitTextStrokeImage&&i.webkitTextStrokeImage!==`none`&&(r=$(e,i.webkitTextStrokeImage,t.x,t.width,t.y,t.height));for(let i of t.children)We(e,i,n,r)}function We(e,t,n,r){t.type===`text`?He(e,t,n,r):Ue(e,t,n,r)}var Ge=null;function Ke(e){let{html:t,width:n,height:r,accuracy:a=`performance`,debug:s}=e;if(!n||n<=0||Number.isNaN(n))throw TypeError(`layout: width must be a positive number, got ${n}`);let c=a===`balanced`,{fragment:l,css:u}=o(t),{tree:d,cleanup:f}=N(l,u,n),p=e.ctx??(Ge??=i(!0));p.fontKerning=`normal`;let{root:m,height:h,lines:g}=Pe(p,d,n,c,s),_=r||h;return f(),{layoutRoot:m,height:_,lines:g}}function qe(e){let{layout:t,width:n,pixelRatio:r=globalThis.devicePixelRatio??1}=e;if(e.ctx&&e.canvas)throw TypeError(`drawLayout: ctx and canvas are mutually exclusive — provide one or neither`);let i=t.height,a,o;if(e.ctx)o=e.ctx,a=e.ctx.canvas;else{if(!e.canvas&&typeof document>`u`)throw Error(`render-tag: drawLayout cannot create a canvas in a non-browser environment — pass ctx or canvas.`);a=e.canvas??document.createElement(`canvas`),a.width=Math.ceil(n*r),a.height=Math.ceil(i*r),`style`in a&&(a.style.width=`${n}px`,a.style.height=`${i}px`),o=a.getContext(`2d`),o.scale(r,r)}return We(o,t.layoutRoot),{canvas:a}}function Je(e){if(e.ctx&&e.canvas)throw TypeError(`render: ctx and canvas are mutually exclusive — provide one or neither`);let t=Ke({html:e.html,width:e.width,height:e.height,accuracy:e.accuracy,debug:e.debug,ctx:e.ctx}),{canvas:n}=qe({layout:t,width:e.width,ctx:e.ctx,canvas:e.canvas,pixelRatio:e.pixelRatio});return{canvas:n,height:t.height,layoutRoot:t.layoutRoot,lines:t.lines}}e.drawLayout=qe,e.layout=Ke,e.render=Je,e.setDOMParser=r});
12
12
  //# sourceMappingURL=render-tag.umd.js.map