@d3plus/dom 3.1.1 → 3.1.3

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- @d3plus/dom v3.1.0
2
+ @d3plus/dom v3.1.2
3
3
  JavaScript functions for manipulating and analyzing DOM elements.
4
4
  Copyright (c) 2026 D3plus - https://d3plus.org
5
5
  @license MIT
@@ -24,52 +24,52 @@ function e(t,n={}){for(const e in n)({}).hasOwnProperty.call(n,e)&&t.attr(e,n[e]
24
24
  Parses numbers and strings into valid JavaScript Date objects, supporting years, quarters, months, and ISO 8601 formats.
25
25
  @param d The date value to parse (number, string, or Date).
26
26
  */var r="http://www.w3.org/1999/xhtml",i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function o(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),i.hasOwnProperty(n)?{space:i[n],local:t}:t;// eslint-disable-line no-prototype-builtins
27
- }function s(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}}function u(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var n=o(t);return(n.local?u:s)(n)}function l(){}function c(t){return null==t?l:function(){return this.querySelector(t)}}function f(){return[]}function h(t){return null==t?f:function(){return this.querySelectorAll(t)}}function d(t){return function(){return null==(n=t.apply(this,arguments))?[]:Array.isArray(n)?n:Array.from(n);
27
+ }function s(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===r&&n.documentElement.namespaceURI===r?n.createElement(t):n.createElementNS(e,t)}}function u(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var n=o(t);return(n.local?u:s)(n)}function l(){}function c(t){return null==t?l:function(){return this.querySelector(t)}}function f(){return[]}function h(t){return null==t?f:function(){return this.querySelectorAll(t)}}function N(t){return function(){return null==(n=t.apply(this,arguments))?[]:Array.isArray(n)?n:Array.from(n);
28
28
  // Given something array like (or null), returns something that is strictly an
29
29
  // array. This is used to ensure that array-like objects passed to d3.selectAll
30
30
  // or selection.selectAll are converted into proper arrays when creating a
31
31
  // selection; we don’t ever want to create a selection backed by a live
32
32
  // HTMLCollection or NodeList. However, note that selection.selectAll will use a
33
33
  // static NodeList as a group, since it safely derived from querySelectorAll.
34
- var n}}function p(t){return function(){return this.matches(t)}}function g(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function y(){return this.firstElementChild}var L=Array.prototype.filter;function w(){return Array.from(this.children)}function v(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function x(t,n,e,r,i,o){
34
+ var n}}function d(t){return function(){return this.matches(t)}}function p(t){return function(n){return n.matches(t)}}var g=Array.prototype.find;function S(){return this.firstElementChild}var m=Array.prototype.filter;function M(){return Array.from(this.children)}function y(t){return new Array(t.length)}function v(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function w(t,n,e,r,i,o){
35
35
  // Put any non-null nodes that fit into update.
36
36
  // Put any null nodes into enter.
37
37
  // Put any remaining data into enter.
38
- for(var s,u=0,a=n.length,l=o.length;u<l;++u)(s=n[u])?(s.__data__=o[u],r[u]=s):e[u]=new A(t,o[u]);
38
+ for(var s,u=0,a=n.length,l=o.length;u<l;++u)(s=n[u])?(s.__data__=o[u],r[u]=s):e[u]=new v(t,o[u]);
39
39
  // Put any non-null nodes that don’t fit into exit.
40
- for(;u<a;++u)(s=n[u])&&(i[u]=s)}function _(t,n,e,r,i,o,s){var u,a,l,c=new Map,f=n.length,h=o.length,d=new Array(f);
40
+ for(;u<a;++u)(s=n[u])&&(i[u]=s)}function x(t,n,e,r,i,o,s){var u,a,l,c=new Map,f=n.length,h=o.length,N=new Array(f);
41
41
  // Compute the key for each node.
42
42
  // If multiple nodes have the same key, the duplicates are added to exit.
43
- for(u=0;u<f;++u)(a=n[u])&&(d[u]=l=s.call(a,a.__data__,u,n)+"",c.has(l)?i[u]=a:c.set(l,a));
43
+ for(u=0;u<f;++u)(a=n[u])&&(N[u]=l=s.call(a,a.__data__,u,n)+"",c.has(l)?i[u]=a:c.set(l,a));
44
44
  // Compute the key for each datum.
45
45
  // If there a node associated with this key, join and add it to update.
46
46
  // If there is not (or the key is a duplicate), add it to enter.
47
- for(u=0;u<h;++u)l=s.call(t,o[u],u,o)+"",(a=c.get(l))?(r[u]=a,a.__data__=o[u],c.delete(l)):e[u]=new A(t,o[u]);
47
+ for(u=0;u<h;++u)l=s.call(t,o[u],u,o)+"",(a=c.get(l))?(r[u]=a,a.__data__=o[u],c.delete(l)):e[u]=new v(t,o[u]);
48
48
  // Add any remaining nodes that were not bound to data to exit.
49
- for(u=0;u<f;++u)(a=n[u])&&c.get(d[u])===a&&(i[u]=a)}function N(t){return t.__data__}
49
+ for(u=0;u<f;++u)(a=n[u])&&c.get(N[u])===a&&(i[u]=a)}function _(t){return t.__data__}
50
50
  // Given some data, this returns an array-like view of it: an object that
51
51
  // exposes a length property and allows numeric indexing. Note that unlike
52
52
  // selectAll, this isn’t worried about “live” collections because the resulting
53
53
  // array will only be used briefly while data is being bound. (It is possible to
54
54
  // cause the data to change while iterating by using a key function, but please
55
55
  // don’t; we’d rather avoid a gratuitous copy.)
56
- function b(t){return"object"==typeof t&&"length"in t?t:Array.from(t);// Map, Set, iterable, string, or anything else
57
- }function k(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function S(t){return function(){this.removeAttribute(t)}}function E(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,n){return function(){this.setAttribute(t,n)}}function M(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function C(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function W(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView;// node is a Document
58
- }function $(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function P(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function F(t,n){return t.style.getPropertyValue(n)||W(t).getComputedStyle(t,null).getPropertyValue(n)}function R(t){return function(){delete this[t]}}function T(t,n){return function(){this[t]=n}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function j(t){return t.trim().split(/^|\s+/)}function H(t){return t.classList||new q(t)}function q(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function D(t,n){for(var e=H(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function X(t,n){for(var e=H(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Y(t){return function(){D(this,t)}}function G(t){return function(){X(this,t)}}function V(t,n){return function(){(n.apply(this,arguments)?D:X)(this,t)}}function Q(){this.textContent=""}function K(t){return function(){this.textContent=t}}function J(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function U(){this.innerHTML=""}function Z(t){return function(){this.innerHTML=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function nt(){this.nextSibling&&this.parentNode.appendChild(this)}function et(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rt(){return null}function it(){var t=this.parentNode;t&&t.removeChild(this)}function ot(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ut(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function at(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var s=0,u=i.length;s<u;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function lt(t,n,e){var r=W(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function ct(t,n){return function(){return lt(this,t,n)}}function ft(t,n){return function(){return lt(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},q.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ht=[null];function dt(t,n){this._groups=t,this._parents=n}function pt(){return new dt([[document.documentElement]],ht)}function gt(t){return"string"==typeof t?new dt([[document.querySelector(t)]],[document.documentElement]):new dt([[t]],ht)}dt.prototype=pt.prototype={constructor:dt,select:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s,u=n[i],a=u.length,l=r[i]=new Array(a),f=0;f<a;++f)(o=u[f])&&(s=t.call(o,o.__data__,f,u))&&("__data__"in o&&(s.__data__=o.__data__),l[f]=s);return new dt(r,this._parents)},selectAll:function(t){t="function"==typeof t?d(t):h(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var s,u=n[o],a=u.length,l=0;l<a;++l)(s=u[l])&&(r.push(t.call(s,s.__data__,l,u)),i.push(s));return new dt(r,i)},selectChild:function(t){return this.select(null==t?y:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:g(t)))},selectChildren:function(t){return this.selectAll(null==t?w:function(t){return function(){return L.call(this.children,t)}}("function"==typeof t?t:g(t)))},filter:function(t){"function"!=typeof t&&(t=p(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s=n[i],u=s.length,a=r[i]=[],l=0;l<u;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&a.push(o);return new dt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,N);var e,r=n?_:x,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var s=o.length,u=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var f=i[c],h=o[c],d=h.length,p=b(t.call(f,f&&f.__data__,c,i)),g=p.length,m=a[c]=new Array(g),y=u[c]=new Array(g);r(f,h,m,y,l[c]=new Array(d),p,n);
56
+ function O(t){return"object"==typeof t&&"length"in t?t:Array.from(t);// Map, Set, iterable, string, or anything else
57
+ }function b(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function L(t){return function(){this.removeAttribute(t)}}function k(t){return function(){this.removeAttributeNS(t.space,t.local)}}function A(t,n){return function(){this.setAttribute(t,n)}}function E(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function C(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView;// node is a Document
58
+ }function $(t){return function(){this.style.removeProperty(t)}}function I(t,n,e){return function(){this.style.setProperty(t,n,e)}}function F(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function W(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function T(t){return function(){delete this[t]}}function z(t,n){return function(){this[t]=n}}function P(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function j(t){return t.trim().split(/^|\s+/)}function H(t){return t.classList||new q(t)}function q(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function D(t,n){for(var e=H(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function X(t,n){for(var e=H(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Y(t){return function(){D(this,t)}}function G(t){return function(){X(this,t)}}function V(t,n){return function(){(n.apply(this,arguments)?D:X)(this,t)}}function Q(){this.textContent=""}function K(t){return function(){this.textContent=t}}function J(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function U(){this.innerHTML=""}function Z(t){return function(){this.innerHTML=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function nt(){this.nextSibling&&this.parentNode.appendChild(this)}function et(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rt(){return null}function it(){var t=this.parentNode;t&&t.removeChild(this)}function ot(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ut(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function at(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var s=0,u=i.length;s<u;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function lt(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function ct(t,n){return function(){return lt(this,t,n)}}function ft(t,n){return function(){return lt(this,t,n.apply(this,arguments))}}v.prototype={constructor:v,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},q.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ht=[null];function Nt(t,n){this._groups=t,this._parents=n}function dt(){return new Nt([[document.documentElement]],ht)}function pt(t){return"string"==typeof t?new Nt([[document.querySelector(t)]],[document.documentElement]):new Nt([[t]],ht)}Nt.prototype=dt.prototype={constructor:Nt,select:function(t){"function"!=typeof t&&(t=c(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s,u=n[i],a=u.length,l=r[i]=new Array(a),f=0;f<a;++f)(o=u[f])&&(s=t.call(o,o.__data__,f,u))&&("__data__"in o&&(s.__data__=o.__data__),l[f]=s);return new Nt(r,this._parents)},selectAll:function(t){t="function"==typeof t?N(t):h(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var s,u=n[o],a=u.length,l=0;l<a;++l)(s=u[l])&&(r.push(t.call(s,s.__data__,l,u)),i.push(s));return new Nt(r,i)},selectChild:function(t){return this.select(null==t?S:function(t){return function(){return g.call(this.children,t)}}("function"==typeof t?t:p(t)))},selectChildren:function(t){return this.selectAll(null==t?M:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:p(t)))},filter:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s=n[i],u=s.length,a=r[i]=[],l=0;l<u;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&a.push(o);return new Nt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,_);var e,r=n?x:w,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var s=o.length,u=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var f=i[c],h=o[c],N=h.length,d=O(t.call(f,f&&f.__data__,c,i)),p=d.length,g=a[c]=new Array(p),S=u[c]=new Array(p);r(f,h,g,S,l[c]=new Array(N),d,n);
59
59
  // Now connect the enter nodes to their following update node, such that
60
60
  // appendChild can insert the materialized enter node before this node,
61
61
  // rather than at the end of the parent node.
62
- for(var L,w,v=0,A=0;v<g;++v)if(L=m[v]){for(v>=A&&(A=v+1);!(w=y[A])&&++A<g;);L._next=w||null}}return(u=new dt(u,i))._enter=a,u._exit=l,u},enter:function(){return new dt(this._enter||this._groups.map(v),this._parents)},exit:function(){return new dt(this._exit||this._groups.map(v),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),u=new Array(i),a=0;a<s;++a)for(var l,c=e[a],f=r[a],h=c.length,d=u[a]=new Array(h),p=0;p<h;++p)(l=c[p]||f[p])&&(d[p]=l);for(;a<i;++a)u[a]=e[a];return new dt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,s=i[o];--o>=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=k);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var s,u=e[o],a=u.length,l=i[o]=new Array(a),c=0;c<a;++c)(s=u[c])&&(l[c]=s);l.sort(n)}return new dt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null},size:function(){let t=0;for(const n of this)++t;// eslint-disable-line no-unused-vars
63
- return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],s=0,u=o.length;s<u;++s)(i=o[s])&&t.call(i,i.__data__,s,o);return this},attr:function(t,n){var e=o(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?E:S:"function"==typeof n?e.local?C:B:e.local?M:O)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?$:"function"==typeof n?P:I)(t,n,null==e?"":e)):F(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?R:"function"==typeof n?z:T)(t,n)):this.node()[t]},classed:function(t,n){var e=j(t+"");if(arguments.length<2){for(var r=H(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?V:n?Y:G)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?J:K)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?tt:Z)(t)):this.node().innerHTML},raise:function(){return this.each(nt)},lower:function(){return this.each(et)},append:function(t){var n="function"==typeof t?t:a(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:a(t),r=null==n?rt:"function"==typeof n?n:c(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(it)},clone:function(t){return this.select(t?st:ot)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),s=o.length;if(!(arguments.length<2)){for(u=n?at:ut,r=0;r<s;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var a,l=0,c=u.length;l<c;++l)for(r=0,a=u[l];r<s;++r)if((i=o[r]).type===a.type&&i.name===a.name)return a.value},dispatch:function(t,n){return this.each(("function"==typeof n?ft:ct)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,s=i.length;o<s;++o)(r=i[o])&&(yield r)}};var mt={value:()=>{}};function yt(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Lt(r)}function Lt(t){this._=t}function wt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function vt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=mt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}Lt.prototype=yt.prototype={constructor:Lt,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),s=-1,u=o.length;
62
+ for(var m,M,y=0,v=0;y<p;++y)if(m=g[y]){for(y>=v&&(v=y+1);!(M=S[v])&&++v<p;);m._next=M||null}}return(u=new Nt(u,i))._enter=a,u._exit=l,u},enter:function(){return new Nt(this._enter||this._groups.map(y),this._parents)},exit:function(){return new Nt(this._exit||this._groups.map(y),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),u=new Array(i),a=0;a<s;++a)for(var l,c=e[a],f=r[a],h=c.length,N=u[a]=new Array(h),d=0;d<h;++d)(l=c[d]||f[d])&&(N[d]=l);for(;a<i;++a)u[a]=e[a];return new Nt(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,s=i[o];--o>=0;)(r=i[o])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=b);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var s,u=e[o],a=u.length,l=i[o]=new Array(a),c=0;c<a;++c)(s=u[c])&&(l[c]=s);l.sort(n)}return new Nt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null},size:function(){let t=0;for(const n of this)++t;// eslint-disable-line no-unused-vars
63
+ return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],s=0,u=o.length;s<u;++s)(i=o[s])&&t.call(i,i.__data__,s,o);return this},attr:function(t,n){var e=o(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?k:L:"function"==typeof n?e.local?C:B:e.local?E:A)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?$:"function"==typeof n?F:I)(t,n,null==e?"":e)):W(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?T:"function"==typeof n?P:z)(t,n)):this.node()[t]},classed:function(t,n){var e=j(t+"");if(arguments.length<2){for(var r=H(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?V:n?Y:G)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?J:K)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?tt:Z)(t)):this.node().innerHTML},raise:function(){return this.each(nt)},lower:function(){return this.each(et)},append:function(t){var n="function"==typeof t?t:a(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:a(t),r=null==n?rt:"function"==typeof n?n:c(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(it)},clone:function(t){return this.select(t?st:ot)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),s=o.length;if(!(arguments.length<2)){for(u=n?at:ut,r=0;r<s;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var a,l=0,c=u.length;l<c;++l)for(r=0,a=u[l];r<s;++r)if((i=o[r]).type===a.type&&i.name===a.name)return a.value},dispatch:function(t,n){return this.each(("function"==typeof n?ft:ct)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,s=i.length;o<s;++o)(r=i[o])&&(yield r)}};var gt={value:()=>{}};function St(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new mt(r)}function mt(t){this._=t}function Mt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function yt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=gt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}mt.prototype=St.prototype={constructor:mt,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),s=-1,u=o.length;
64
64
  // If no callback was specified, return the callback of the given type and name.
65
65
  if(!(arguments.length<2)){
66
66
  // If a type was specified, set the callback for the given type and name.
67
67
  // Otherwise, if a null callback was specified, remove callbacks of the given name.
68
- if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<u;)if(e=(t=o[s]).type)i[e]=vt(i[e],t.name,n);else if(null==n)for(e in i)i[e]=vt(i[e],t.name,null);return this}for(;++s<u;)if((e=(t=o[s]).type)&&(e=wt(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Lt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var At,xt,_t=0,Nt=0,bt=0,kt=0,St=0,Et=0,Ot="object"==typeof performance&&performance.now?performance:Date,Mt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bt(){return St||(Mt(Ct),St=Ot.now()+Et)}function Ct(){St=0}function Wt(){this._call=this._time=this._next=null}function $t(t,n,e){var r=new Wt;return r.restart(t,n,e),r}function It(){St=(kt=Ot.now())+Et,_t=Nt=0;try{!function(){Bt(),// Get the current time, if not already set.
69
- ++_t;for(// Pretend we’ve set an alarm, if we haven’t already.
70
- var t,n=At;n;)(t=St-n._time)>=0&&n._call.call(void 0,t),n=n._next;--_t}()}finally{_t=0,function(){var t,n,e=At,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:At=n);xt=t,Ft(r)}(),St=0}}function Pt(){var t=Ot.now(),n=t-kt;n>1e3&&(Et-=n,kt=t)}function Ft(t){_t||(// Soonest alarm already set, or will be.
71
- Nt&&(Nt=clearTimeout(Nt)),// Strictly less than if we recomputed clockNow.
72
- t-St>24?(t<1/0&&(Nt=setTimeout(It,t-Ot.now()-Et)),bt&&(bt=clearInterval(bt))):(bt||(kt=Ot.now(),bt=setInterval(Pt,1e3)),_t=1,Mt(It)))}function Rt(t,n,e){var r=new Wt;return n=null==n?0:+n,r.restart(e=>{r.stop(),t(e+n)},n,e),r}Wt.prototype=$t.prototype={constructor:Wt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Bt():+e)+(null==n?0:+n),this._next||xt===this||(xt?xt._next=this:At=this,xt=this),this._call=t,this._time=e,Ft()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ft())}};var Tt=yt("start","end","cancel","interrupt"),zt=[];function jt(t,n,e,r,i,o){var s=t.__transition;if(s){if(e in s)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;
68
+ if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<u;)if(e=(t=o[s]).type)i[e]=yt(i[e],t.name,n);else if(null==n)for(e in i)i[e]=yt(i[e],t.name,null);return this}for(;++s<u;)if((e=(t=o[s]).type)&&(e=Mt(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new mt(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var vt,wt,xt=0,_t=0,Ot=0,bt=0,Lt=0,kt=0,At="object"==typeof performance&&performance.now?performance:Date,Et="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Bt(){return Lt||(Et(Ct),Lt=At.now()+kt)}function Ct(){Lt=0}function Rt(){this._call=this._time=this._next=null}function $t(t,n,e){var r=new Rt;return r.restart(t,n,e),r}function It(){Lt=(bt=At.now())+kt,xt=_t=0;try{!function(){Bt(),// Get the current time, if not already set.
69
+ ++xt;for(// Pretend we’ve set an alarm, if we haven’t already.
70
+ var t,n=vt;n;)(t=Lt-n._time)>=0&&n._call.call(void 0,t),n=n._next;--xt}()}finally{xt=0,function(){var t,n,e=vt,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:vt=n);wt=t,Wt(r)}(),Lt=0}}function Ft(){var t=At.now(),n=t-bt;n>1e3&&(kt-=n,bt=t)}function Wt(t){xt||(// Soonest alarm already set, or will be.
71
+ _t&&(_t=clearTimeout(_t)),// Strictly less than if we recomputed clockNow.
72
+ t-Lt>24?(t<1/0&&(_t=setTimeout(It,t-At.now()-kt)),Ot&&(Ot=clearInterval(Ot))):(Ot||(bt=At.now(),Ot=setInterval(Ft,1e3)),xt=1,Et(It)))}function Tt(t,n,e){var r=new Rt;return n=null==n?0:+n,r.restart(e=>{r.stop(),t(e+n)},n,e),r}Rt.prototype=$t.prototype={constructor:Rt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Bt():+e)+(null==n?0:+n),this._next||wt===this||(wt?wt._next=this:vt=this,wt=this),this._call=t,this._time=e,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};var zt=St("start","end","cancel","interrupt"),Pt=[];function jt(t,n,e,r,i,o){var s=t.__transition;if(s){if(e in s)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;
73
73
  // Initialize the self timer when the transition is created.
74
74
  // Note the actual delay is not known until the first callback!
75
75
  function o(t){e.state=1,e.timer.restart(s,e.delay,e.time),
@@ -80,14 +80,14 @@ if(1!==e.state)return a();for(l in i)if((h=i[l]).name===e.name){
80
80
  // While this element already has a starting transition during this frame,
81
81
  // defer starting an interrupting transition until that transition has a
82
82
  // chance to tick (and possibly end); see d3/d3-transition#54!
83
- if(3===h.state)return Rt(s);
83
+ if(3===h.state)return Tt(s);
84
84
  // Interrupt the active transition, if any.
85
85
  4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[l])}
86
86
  // Defer the first tick to end of the current frame; see d3/d3#1576.
87
87
  // Note the transition may be canceled after start and before the first tick!
88
88
  // Note this must be scheduled before the start event; see d3/d3-transition#16!
89
89
  // Assuming this is successful, subsequent callbacks go straight to tick.
90
- if(Rt(function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(o))}),
90
+ if(Tt(function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(o))}),
91
91
  // Dispatch the start event.
92
92
  // Note this must be done before the tween are initialized.
93
93
  e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(// interrupted
@@ -96,19 +96,19 @@ e.state=3,
96
96
  r=new Array(f=e.tween.length),l=0,c=-1;l<f;++l)(h=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=h);r.length=c+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=5,1),o=-1,s=r.length;++o<s;)r[o].call(t,i);
97
97
  // Dispatch the end event.
98
98
  5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;// eslint-disable-line no-unused-vars
99
- delete t.__transition}i[n]=e,e.timer=$t(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Tt,tween:zt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Ht(t,n){var e=Dt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function qt(t,n){var e=Dt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Dt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Xt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Yt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Gt(){}var Vt=.7,Qt=1/Vt,Kt="\\s*([+-]?\\d+)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zt=/^#([0-9a-f]{3,8})$/,tn=new RegExp(`^rgb\\(${Kt},${Kt},${Kt}\\)$`),nn=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),en=new RegExp(`^rgba\\(${Kt},${Kt},${Kt},${Jt}\\)$`),rn=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Jt}\\)$`),on=new RegExp(`^hsl\\(${Jt},${Ut},${Ut}\\)$`),sn=new RegExp(`^hsla\\(${Jt},${Ut},${Ut},${Jt}\\)$`),un={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function an(){return this.rgb().formatHex()}function ln(){return this.rgb().formatRgb()}function cn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Zt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?fn(n):3===e?new pn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?hn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?hn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=tn.exec(t))?new pn(n[1],n[2],n[3],1):(n=nn.exec(t))?new pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=en.exec(t))?hn(n[1],n[2],n[3],n[4]):(n=rn.exec(t))?hn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=on.exec(t))?vn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?vn(n[1],n[2]/100,n[3]/100,n[4]):un.hasOwnProperty(t)?fn(un[t]):"transparent"===t?new pn(NaN,NaN,NaN,0):null}function fn(t){return new pn(t>>16&255,t>>8&255,255&t,1)}function hn(t,n,e,r){return r<=0&&(t=n=e=NaN),new pn(t,n,e,r)}function dn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Gt||(i=cn(i)),i?new pn((i=i.rgb()).r,i.g,i.b,i.opacity):new pn):new pn(t,n,e,null==r?1:r);var i}function pn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function gn(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}`}function mn(){const t=yn(this.opacity);return`${1===t?"rgb(":"rgba("}${Ln(this.r)}, ${Ln(this.g)}, ${Ln(this.b)}${1===t?")":`, ${t})`}`}function yn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ln(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wn(t){return((t=Ln(t))<16?"0":"")+t.toString(16)}function vn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new xn(t,n,e,r)}function An(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof Gt||(t=cn(t)),!t)return new xn;if(t instanceof xn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),s=NaN,u=o-i,a=(o+i)/2;return u?(s=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=a<.5?o+i:2-o-i,s*=60):u=a>0&&a<1?0:s,new xn(s,u,a,t.opacity)}function xn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function _n(t){return(t=(t||0)%360)<0?t+360:t}function Nn(t){return Math.max(0,Math.min(1,t||0))}
100
- /* From FvD 13.37, CSS Color Module Level 3 */function bn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Xt(Gt,cn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:an,formatHex:an,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return An(this).formatHsl()},formatRgb:ln,toString:ln}),Xt(pn,dn,Yt(Gt,{brighter(t){return t=null==t?Qt:Math.pow(Qt,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new pn(Ln(this.r),Ln(this.g),Ln(this.b),yn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gn,formatHex:gn,formatHex8:function(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}${wn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:mn,toString:mn})),Xt(xn,function(t,n,e,r){return 1===arguments.length?An(t):new xn(t,n,e,null==r?1:r)},Yt(Gt,{brighter(t){return t=null==t?Qt:Math.pow(Qt,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new pn(bn(t>=240?t-240:t+120,i,r),bn(t,i,r),bn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new xn(_n(this.h),Nn(this.s),Nn(this.l),yn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=yn(this.opacity);return`${1===t?"hsl(":"hsla("}${_n(this.h)}, ${100*Nn(this.s)}%, ${100*Nn(this.l)}%${1===t?")":`, ${t})`}`}}));var kn=t=>()=>t;function Sn(t){return 1===(t=+t)?En:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):kn(isNaN(n)?e:n)}}function En(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):kn(isNaN(t)?n:t)}var On=function t(n){var e=Sn(n);function r(t,n){var r=e((t=dn(t)).r,(n=dn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),s=En(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=s(n),t+""}}return r.gamma=t,r}(1);function Mn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp(Bn.source,"g");function Wn(t,n){var e,r,i,o=Bn.lastIndex=Cn.lastIndex=0,s=-1,u=[],a=[];// number interpolators
99
+ delete t.__transition}i[n]=e,e.timer=$t(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:zt,tween:Pt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Ht(t,n){var e=Dt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function qt(t,n){var e=Dt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Dt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Xt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Yt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Gt(){}var Vt=.7,Qt=1/Vt,Kt="\\s*([+-]?\\d+)\\s*",Jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zt=/^#([0-9a-f]{3,8})$/,tn=new RegExp(`^rgb\\(${Kt},${Kt},${Kt}\\)$`),nn=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),en=new RegExp(`^rgba\\(${Kt},${Kt},${Kt},${Jt}\\)$`),rn=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${Jt}\\)$`),on=new RegExp(`^hsl\\(${Jt},${Ut},${Ut}\\)$`),sn=new RegExp(`^hsla\\(${Jt},${Ut},${Ut},${Jt}\\)$`),un={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function an(){return this.rgb().formatHex()}function ln(){return this.rgb().formatRgb()}function cn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Zt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?fn(n):3===e?new dn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?hn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?hn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=tn.exec(t))?new dn(n[1],n[2],n[3],1):(n=nn.exec(t))?new dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=en.exec(t))?hn(n[1],n[2],n[3],n[4]):(n=rn.exec(t))?hn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=on.exec(t))?yn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?yn(n[1],n[2]/100,n[3]/100,n[4]):un.hasOwnProperty(t)?fn(un[t]):"transparent"===t?new dn(NaN,NaN,NaN,0):null}function fn(t){return new dn(t>>16&255,t>>8&255,255&t,1)}function hn(t,n,e,r){return r<=0&&(t=n=e=NaN),new dn(t,n,e,r)}function Nn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Gt||(i=cn(i)),i?new dn((i=i.rgb()).r,i.g,i.b,i.opacity):new dn):new dn(t,n,e,null==r?1:r);var i}function dn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function pn(){return`#${Mn(this.r)}${Mn(this.g)}${Mn(this.b)}`}function gn(){const t=Sn(this.opacity);return`${1===t?"rgb(":"rgba("}${mn(this.r)}, ${mn(this.g)}, ${mn(this.b)}${1===t?")":`, ${t})`}`}function Sn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function mn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Mn(t){return((t=mn(t))<16?"0":"")+t.toString(16)}function yn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new wn(t,n,e,r)}function vn(t){if(t instanceof wn)return new wn(t.h,t.s,t.l,t.opacity);if(t instanceof Gt||(t=cn(t)),!t)return new wn;if(t instanceof wn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),s=NaN,u=o-i,a=(o+i)/2;return u?(s=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=a<.5?o+i:2-o-i,s*=60):u=a>0&&a<1?0:s,new wn(s,u,a,t.opacity)}function wn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function xn(t){return(t=(t||0)%360)<0?t+360:t}function _n(t){return Math.max(0,Math.min(1,t||0))}
100
+ /* From FvD 13.37, CSS Color Module Level 3 */function On(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Xt(Gt,cn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:an,formatHex:an,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vn(this).formatHsl()},formatRgb:ln,toString:ln}),Xt(dn,Nn,Yt(Gt,{brighter(t){return t=null==t?Qt:Math.pow(Qt,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new dn(mn(this.r),mn(this.g),mn(this.b),Sn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:pn,formatHex:pn,formatHex8:function(){return`#${Mn(this.r)}${Mn(this.g)}${Mn(this.b)}${Mn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gn,toString:gn})),Xt(wn,function(t,n,e,r){return 1===arguments.length?vn(t):new wn(t,n,e,null==r?1:r)},Yt(Gt,{brighter(t){return t=null==t?Qt:Math.pow(Qt,t),new wn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new wn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new dn(On(t>=240?t-240:t+120,i,r),On(t,i,r),On(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new wn(xn(this.h),_n(this.s),_n(this.l),Sn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sn(this.opacity);return`${1===t?"hsl(":"hsla("}${xn(this.h)}, ${100*_n(this.s)}%, ${100*_n(this.l)}%${1===t?")":`, ${t})`}`}}));var bn=t=>()=>t;function Ln(t){return 1===(t=+t)?kn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):bn(isNaN(n)?e:n)}}function kn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):bn(isNaN(t)?n:t)}var An=function t(n){var e=Ln(n);function r(t,n){var r=e((t=Nn(t)).r,(n=Nn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),s=kn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=s(n),t+""}}return r.gamma=t,r}(1);function En(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Bn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cn=new RegExp(Bn.source,"g");function Rn(t,n){var e,r,i,o=Bn.lastIndex=Cn.lastIndex=0,s=-1,u=[],a=[];// number interpolators
101
101
  // Coerce inputs to strings.
102
102
  // Interpolate pairs of numbers in a & b.
103
- for(t+="",n+="";(e=Bn.exec(t))&&(r=Cn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[s]?u[s]+=i:u[++s]=i),(e=e[0])===(r=r[0])?u[s]?u[s]+=r:u[++s]=r:(u[++s]=null,a.push({i:s,x:Mn(e,r)})),o=Cn.lastIndex;
103
+ for(t+="",n+="";(e=Bn.exec(t))&&(r=Cn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[s]?u[s]+=i:u[++s]=i),(e=e[0])===(r=r[0])?u[s]?u[s]+=r:u[++s]=r:(u[++s]=null,a.push({i:s,x:En(e,r)})),o=Cn.lastIndex;
104
104
  // Add remains of b.
105
105
  // Special optimization for only a single match.
106
106
  // Otherwise, interpolate each of the numbers and rejoin the string.
107
- return o<n.length&&(i=n.slice(o),u[s]?u[s]+=i:u[++s]=i),u.length<2?a[0]?function(t){return function(n){return t(n)+""}}(a[0].x):function(t){return function(){return t}}(n):(n=a.length,function(t){for(var e,r=0;r<n;++r)u[(e=a[r]).i]=e.x(t);return u.join("")})}var $n,In=180/Math.PI,Pn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Fn(t,n,e,r,i,o){var s,u,a;return(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s),(a=t*e+n*r)&&(e-=t*a,r-=n*a),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,a/=u),t*r<n*e&&(t=-t,n=-n,a=-a,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*In,skewX:Math.atan(a)*In,scaleX:s,scaleY:u}}function Rn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,s){var u=[],a=[];// number interpolators
107
+ return o<n.length&&(i=n.slice(o),u[s]?u[s]+=i:u[++s]=i),u.length<2?a[0]?function(t){return function(n){return t(n)+""}}(a[0].x):function(t){return function(){return t}}(n):(n=a.length,function(t){for(var e,r=0;r<n;++r)u[(e=a[r]).i]=e.x(t);return u.join("")})}var $n,In=180/Math.PI,Fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wn(t,n,e,r,i,o){var s,u,a;return(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s),(a=t*e+n*r)&&(e-=t*a,r-=n*a),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,a/=u),t*r<n*e&&(t=-t,n=-n,a=-a,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*In,skewX:Math.atan(a)*In,scaleX:s,scaleY:u}}function Tn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,s){var u=[],a=[];// number interpolators
108
108
  // gc
109
- return o=t(o),s=t(s),function(t,r,i,o,s,u){if(t!==i||r!==o){var a=s.push("translate(",null,n,null,e);u.push({i:a-4,x:Mn(t,i)},{i:a-2,x:Mn(r,o)})}else(i||o)&&s.push("translate("+i+n+o+e)}(o.translateX,o.translateY,s.translateX,s.translateY,u,a),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),// shortest path
110
- o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Mn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,s.rotate,u,a),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Mn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,s.skewX,u,a),function(t,n,e,r,o,s){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");s.push({i:u-4,x:Mn(t,e)},{i:u-2,x:Mn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,u,a),o=s=null,function(t){for(var n,e=-1,r=a.length;++e<r;)u[(n=a[e]).i]=n.x(t);return u.join("")}}}var Tn=Rn(
111
- /* eslint-disable no-undef */function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Pn:Fn(n.a,n.b,n.c,n.d,n.e,n.f)},"px, ","px)","deg)"),zn=Rn(function(t){return null==t?Pn:($n||($n=document.createElementNS("http://www.w3.org/2000/svg","g")),$n.setAttribute("transform",t),(t=$n.transform.baseVal.consolidate())?Fn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Pn)},", ",")",")");function jn(t,n){var e,r;return function(){var i=qt(this,t),o=i.tween;
109
+ return o=t(o),s=t(s),function(t,r,i,o,s,u){if(t!==i||r!==o){var a=s.push("translate(",null,n,null,e);u.push({i:a-4,x:En(t,i)},{i:a-2,x:En(r,o)})}else(i||o)&&s.push("translate("+i+n+o+e)}(o.translateX,o.translateY,s.translateX,s.translateY,u,a),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),// shortest path
110
+ o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:En(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,s.rotate,u,a),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:En(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,s.skewX,u,a),function(t,n,e,r,o,s){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");s.push({i:u-4,x:En(t,e)},{i:u-2,x:En(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,s.scaleX,s.scaleY,u,a),o=s=null,function(t){for(var n,e=-1,r=a.length;++e<r;)u[(n=a[e]).i]=n.x(t);return u.join("")}}}var zn=Tn(
111
+ /* eslint-disable no-undef */function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Fn:Wn(n.a,n.b,n.c,n.d,n.e,n.f)},"px, ","px)","deg)"),Pn=Tn(function(t){return null==t?Fn:($n||($n=document.createElementNS("http://www.w3.org/2000/svg","g")),$n.setAttribute("transform",t),(t=$n.transform.baseVal.consolidate())?Wn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Fn)},", ",")",")");function jn(t,n){var e,r;return function(){var i=qt(this,t),o=i.tween;
112
112
  // If this node shared tween with the previous node,
113
113
  // just assign the updated shared tween and we’re done!
114
114
  // Otherwise, copy-on-write.
@@ -116,35 +116,62 @@ if(o!==e)for(var s=0,u=(r=e=o).length;s<u;++s)if(r[s].name===n){(r=r.slice()).sp
116
116
  // If this node shared tween with the previous node,
117
117
  // just assign the updated shared tween and we’re done!
118
118
  // Otherwise, copy-on-write.
119
- if(s!==r){i=(r=s).slice();for(var u={name:n,value:e},a=0,l=i.length;a<l;++a)if(i[a].name===n){i[a]=u;break}a===l&&i.push(u)}o.tween=i}}function qn(t,n,e){var r=t._id;return t.each(function(){var t=qt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Dt(t,r).value[n]}}function Dn(t,n){var e;return("number"==typeof n?Mn:n instanceof cn?On:(e=cn(n))?(n=e,On):Wn)(t,n)}function Xn(t){return function(){this.removeAttribute(t)}}function Yn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gn(t,n,e){var r,i,o=e+"";return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=n(r=s,e)}}function Vn(t,n,e){var r,i,o=e+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=n(r=s,e)}}function Qn(t,n,e){var r,i,o;return function(){var s,u,a=e(this);if(null!=a)return(s=this.getAttribute(t))===(u=a+"")?null:s===r&&u===i?o:(i=u,o=n(r=s,a));this.removeAttribute(t)}}function Kn(t,n,e){var r,i,o;return function(){var s,u,a=e(this);if(null!=a)return(s=this.getAttributeNS(t.space,t.local))===(u=a+"")?null:s===r&&u===i?o:(i=u,o=n(r=s,a));this.removeAttributeNS(t.space,t.local)}}function Jn(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Un(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Zn(t,n){return function(){Ht(this,t).delay=+n.apply(this,arguments)}}function te(t,n){return n=+n,function(){Ht(this,t).delay=n}}function ne(t,n){return function(){qt(this,t).duration=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){qt(this,t).duration=n}}var re=pt.prototype.constructor;function ie(t){return function(){this.style.removeProperty(t)}}var oe=0;function se(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ue(t){return pt().transition(t)}function ae(){return++oe}var le=pt.prototype;se.prototype=ue.prototype={constructor:se,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=c(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var u,a,l=r[s],f=l.length,h=o[s]=new Array(f),d=0;d<f;++d)(u=l[d])&&(a=t.call(u,u.__data__,d,l))&&("__data__"in u&&(a.__data__=u.__data__),h[d]=a,jt(h[d],n,e,d,h,Dt(u,e)));return new se(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=h(t));for(var r=this._groups,i=r.length,o=[],s=[],u=0;u<i;++u)for(var a,l=r[u],c=l.length,f=0;f<c;++f)if(a=l[f]){for(var d,p=t.call(a,a.__data__,f,l),g=Dt(a,e),m=0,y=p.length;m<y;++m)(d=p[m])&&jt(d,n,e,m,p,g);o.push(p),s.push(a)}return new se(o,s,n,e)},selectChild:le.selectChild,selectChildren:le.selectChildren,filter:function(t){"function"!=typeof t&&(t=p(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s=n[i],u=s.length,a=r[i]=[],l=0;l<u;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&a.push(o);return new se(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),s=new Array(r),u=0;u<o;++u)for(var a,l=n[u],c=e[u],f=l.length,h=s[u]=new Array(f),d=0;d<f;++d)(a=l[d]||c[d])&&(h[d]=a);for(;u<r;++u)s[u]=n[u];return new se(s,this._parents,this._name,this._id)},selection:function(){return new re(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=ae(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s,u=r[o],a=u.length,l=0;l<a;++l)if(s=u[l]){var c=Dt(s,n);jt(s,t,e,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new se(r,this._parents,t,e)},call:le.call,nodes:le.nodes,node:le.node,size:le.size,empty:le.empty,each:le.each,on:function(t,n){var e=this._id;return arguments.length<2?Dt(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?Ht:qt;return function(){var s=o(this,t),u=s.on;
119
+ if(s!==r){i=(r=s).slice();for(var u={name:n,value:e},a=0,l=i.length;a<l;++a)if(i[a].name===n){i[a]=u;break}a===l&&i.push(u)}o.tween=i}}function qn(t,n,e){var r=t._id;return t.each(function(){var t=qt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Dt(t,r).value[n]}}function Dn(t,n){var e;return("number"==typeof n?En:n instanceof cn?An:(e=cn(n))?(n=e,An):Rn)(t,n)}function Xn(t){return function(){this.removeAttribute(t)}}function Yn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Gn(t,n,e){var r,i,o=e+"";return function(){var s=this.getAttribute(t);return s===o?null:s===r?i:i=n(r=s,e)}}function Vn(t,n,e){var r,i,o=e+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===o?null:s===r?i:i=n(r=s,e)}}function Qn(t,n,e){var r,i,o;return function(){var s,u,a=e(this);if(null!=a)return(s=this.getAttribute(t))===(u=a+"")?null:s===r&&u===i?o:(i=u,o=n(r=s,a));this.removeAttribute(t)}}function Kn(t,n,e){var r,i,o;return function(){var s,u,a=e(this);if(null!=a)return(s=this.getAttributeNS(t.space,t.local))===(u=a+"")?null:s===r&&u===i?o:(i=u,o=n(r=s,a));this.removeAttributeNS(t.space,t.local)}}function Jn(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Un(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Zn(t,n){return function(){Ht(this,t).delay=+n.apply(this,arguments)}}function te(t,n){return n=+n,function(){Ht(this,t).delay=n}}function ne(t,n){return function(){qt(this,t).duration=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){qt(this,t).duration=n}}var re=dt.prototype.constructor;function ie(t){return function(){this.style.removeProperty(t)}}var oe=0;function se(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ue(t){return dt().transition(t)}function ae(){return++oe}var le=dt.prototype;se.prototype=ue.prototype={constructor:se,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=c(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var u,a,l=r[s],f=l.length,h=o[s]=new Array(f),N=0;N<f;++N)(u=l[N])&&(a=t.call(u,u.__data__,N,l))&&("__data__"in u&&(a.__data__=u.__data__),h[N]=a,jt(h[N],n,e,N,h,Dt(u,e)));return new se(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=h(t));for(var r=this._groups,i=r.length,o=[],s=[],u=0;u<i;++u)for(var a,l=r[u],c=l.length,f=0;f<c;++f)if(a=l[f]){for(var N,d=t.call(a,a.__data__,f,l),p=Dt(a,e),g=0,S=d.length;g<S;++g)(N=d[g])&&jt(N,n,e,g,d,p);o.push(d),s.push(a)}return new se(o,s,n,e)},selectChild:le.selectChild,selectChildren:le.selectChildren,filter:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s=n[i],u=s.length,a=r[i]=[],l=0;l<u;++l)(o=s[l])&&t.call(o,o.__data__,l,s)&&a.push(o);return new se(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),s=new Array(r),u=0;u<o;++u)for(var a,l=n[u],c=e[u],f=l.length,h=s[u]=new Array(f),N=0;N<f;++N)(a=l[N]||c[N])&&(h[N]=a);for(;u<r;++u)s[u]=n[u];return new se(s,this._parents,this._name,this._id)},selection:function(){return new re(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=ae(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s,u=r[o],a=u.length,l=0;l<a;++l)if(s=u[l]){var c=Dt(s,n);jt(s,t,e,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new se(r,this._parents,t,e)},call:le.call,nodes:le.nodes,node:le.node,size:le.size,empty:le.empty,each:le.each,on:function(t,n){var e=this._id;return arguments.length<2?Dt(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?Ht:qt;return function(){var s=o(this,t),u=s.on;
120
120
  // If this node shared a dispatch with the previous node,
121
121
  // just assign the updated shared dispatch and we’re done!
122
122
  // Otherwise, copy-on-write.
123
- u!==r&&(i=(r=u).copy()).on(n,e),s.on=i}}(e,t,n))},attr:function(t,n){var e=o(t),r="transform"===e?zn:Dn;return this.attrTween(t,"function"==typeof n?(e.local?Kn:Qn)(e,r,qn(this,"attr."+t,n)):null==n?(e.local?Yn:Xn)(e):(e.local?Vn:Gn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=o(t);return this.tween(e,(r.local?Jn:Un)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Tn:Dn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=F(this,t),s=(this.style.removeProperty(t),F(this,t));return o===s?null:o===e&&s===r?i:i=n(e=o,r=s)}}(t,r)).on("end.style."+t,ie(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var s=F(this,t),u=e(this),a=u+"";return null==u&&(this.style.removeProperty(t),a=u=F(this,t)),s===a?null:s===r&&a===i?o:(i=a,o=n(r=s,u))}}(t,r,qn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,s="style."+n,u="end."+s;return function(){var a=qt(this,t),l=a.on,c=null==a.value[s]?o||(o=ie(n)):void 0;
123
+ u!==r&&(i=(r=u).copy()).on(n,e),s.on=i}}(e,t,n))},attr:function(t,n){var e=o(t),r="transform"===e?Pn:Dn;return this.attrTween(t,"function"==typeof n?(e.local?Kn:Qn)(e,r,qn(this,"attr."+t,n)):null==n?(e.local?Yn:Xn)(e):(e.local?Vn:Gn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=o(t);return this.tween(e,(r.local?Jn:Un)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?zn:Dn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=W(this,t),s=(this.style.removeProperty(t),W(this,t));return o===s?null:o===e&&s===r?i:i=n(e=o,r=s)}}(t,r)).on("end.style."+t,ie(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var s=W(this,t),u=e(this),a=u+"";return null==u&&(this.style.removeProperty(t),a=u=W(this,t)),s===a?null:s===r&&a===i?o:(i=a,o=n(r=s,u))}}(t,r,qn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,s="style."+n,u="end."+s;return function(){var a=qt(this,t),l=a.on,c=null==a.value[s]?o||(o=ie(n)):void 0;
124
124
  // If this node shared a dispatch with the previous node,
125
125
  // just assign the updated shared dispatch and we’re done!
126
126
  // Otherwise, copy-on-write.
127
- l===e&&i===c||(r=(e=l).copy()).on(u,i=c),a.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var s=F(this,t);return s===o?null:s===r?i:i=n(r=s,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(qn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Dt(this.node(),e).tween,o=0,s=i.length;o<s;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?jn:Hn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Zn:te)(n,t)):Dt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):Dt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){qt(this,t).ease=n}}(n,t)):Dt(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;qt(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,s){var u={value:s},a={value:function(){0===--i&&o()}};e.each(function(){var e=qt(this,r),i=e.on;
127
+ l===e&&i===c||(r=(e=l).copy()).on(u,i=c),a.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var s=W(this,t);return s===o?null:s===r?i:i=n(r=s,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(qn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Dt(this.node(),e).tween,o=0,s=i.length;o<s;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?jn:Hn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Zn:te)(n,t)):Dt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):Dt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){qt(this,t).ease=n}}(n,t)):Dt(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;qt(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,s){var u={value:s},a={value:function(){0===--i&&o()}};e.each(function(){var e=qt(this,r),i=e.on;
128
128
  // If this node shared a dispatch with the previous node,
129
129
  // just assign the updated shared dispatch and we’re done!
130
130
  // Otherwise, copy-on-write.
131
131
  i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(a)),e.on=n}),
132
132
  // The selection was empty, resolve end immediately
133
- 0===i&&o()})},[Symbol.iterator]:le[Symbol.iterator]};var ce={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function fe(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}pt.prototype.interrupt=function(t){return this.each(function(){!function(t,n){var e,r,i,o=t.__transition,s=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):s=!1;s&&delete t.__transition}}(this,t)})},pt.prototype.transition=function(t){var n,e;t instanceof se?(n=t._id,t=t._name):(n=ae(),(e=ce).time=Bt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s,u=r[o],a=u.length,l=0;l<a;++l)(s=u[l])&&jt(s,t,n,l,u,e||fe(s,n));return new se(r,this._parents,t,n)};
133
+ 0===i&&o()})},[Symbol.iterator]:le[Symbol.iterator]};var ce={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function fe(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}dt.prototype.interrupt=function(t){return this.each(function(){!function(t,n){var e,r,i,o=t.__transition,s=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):s=!1;s&&delete t.__transition}}(this,t)})},dt.prototype.transition=function(t){var n,e;t instanceof se?(n=t._id,t=t._name):(n=ae(),(e=ce).time=Bt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s,u=r[o],a=u.length,l=0;l<a;++l)(s=u[l])&&jt(s,t,n,l,u,e||fe(s,n));return new se(r,this._parents,t,n)};
134
+ // Generated by scripts/generate-bidi-data.ts from scripts/unicode/DerivedBidiClass-17.0.0.txt.
135
+ // Do not edit by hand. Regenerate with `bun run generate:bidi-data`.
136
+ // Formatting and isolate controls are projected onto `BN` because the rich
137
+ // bidi helper consumes a simplified class set and does not model UBA isolates.
138
+ const he=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Ne=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];
134
139
  // Simplified bidi metadata helper for the rich prepareWithSegments() path,
135
140
  // forked from pdf.js via Sebastian's text-layout. It classifies characters
136
141
  // into bidi types, computes embedding levels, and maps them onto prepared
137
142
  // segments for custom rendering. The line-breaking engine does not consume
138
143
  // these levels.
139
- const he=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],de=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function pe(t){return t<=255?he[t]:1424<=t&&t<=1524?"R":1536<=t&&t<=1791?de[255&t]:1792<=t&&t<=2220?"AL":"L"}function ge(t,n){const e=function(t){const n=t.length;if(0===n)return null;
144
+ function de(t){if(t<=255)return he[t];let n=0,e=Ne.length-1;for(;n<=e;){const r=n+e>>1,i=Ne[r];if(t<i[0])e=r-1;else{if(!(t>i[1]))return i[2];n=r+1}}return"L"}function pe(t,n){const e=function(t){const n=t.length;if(0===n)return null;
140
145
  // eslint-disable-next-line unicorn/no-new-array
141
- const e=new Array(n);let r=0;for(let i=0;i<n;i++){const n=pe(t.charCodeAt(i));"R"!==n&&"AL"!==n&&"AN"!==n||r++,e[i]=n}if(0===r)return null;const i=n/r<.3?0:1,o=new Int8Array(n);for(let t=0;t<n;t++)o[t]=i;const s=1&i?"R":"L",u=s;
146
+ const e=new Array(n);let r=!1;
147
+ // Keep the resolved bidi classes aligned to UTF-16 code-unit offsets,
148
+ // because the rich prepared segments index back into the normalized string
149
+ // with JavaScript string offsets.
150
+ for(let i=0;i<n;){const o=t.charCodeAt(i);let s=o,u=1;if(o>=55296&&o<=56319&&i+1<n){const n=t.charCodeAt(i+1);n>=56320&&n<=57343&&(s=n-56320+(o-55296<<10)+65536,u=2)}const a=de(s);"R"!==a&&"AL"!==a&&"AN"!==a||(r=!0);for(let t=0;t<u;t++)e[i+t]=a;i+=u}if(!r)return null;
151
+ // Use the first strong character to pick the paragraph base direction.
152
+ // Rich-path bidi metadata is only an approximation, but this keeps mixed
153
+ // LTR/RTL text aligned with the common UBA paragraph rule.
154
+ let i=0;for(let t=0;t<n;t++){const n=e[t];if("L"===n){i=0;break}if("R"===n||"AL"===n){i=1;break}}const o=new Int8Array(n);for(let t=0;t<n;t++)o[t]=i;const s=1&i?"R":"L",u=s;
142
155
  // W1-W7
143
156
  let a=u;for(let t=0;t<n;t++)"NSM"===e[t]?e[t]=a:a=e[t];a=u;for(let t=0;t<n;t++){const n=e[t];"EN"===n?e[t]="AL"===a?"AN":"EN":"R"!==n&&"L"!==n&&"AL"!==n||(a=n)}for(let t=0;t<n;t++)"AL"===e[t]&&(e[t]="R");for(let t=1;t<n-1;t++)"ES"===e[t]&&"EN"===e[t-1]&&"EN"===e[t+1]&&(e[t]="EN"),"CS"!==e[t]||"EN"!==e[t-1]&&"AN"!==e[t-1]||e[t+1]!==e[t-1]||(e[t]=e[t-1]);for(let t=0;t<n;t++){if("EN"!==e[t])continue;let r;for(r=t-1;r>=0&&"ET"===e[r];r--)e[r]="EN";for(r=t+1;r<n&&"ET"===e[r];r++)e[r]="EN"}for(let t=0;t<n;t++){const n=e[t];"WS"!==n&&"ES"!==n&&"ET"!==n&&"CS"!==n||(e[t]="ON")}a=u;for(let t=0;t<n;t++){const n=e[t];"EN"===n?e[t]="L"===a?"L":"EN":"R"!==n&&"L"!==n||(a=n)}
144
157
  // N1-N2
145
158
  for(let t=0;t<n;t++){if("ON"!==e[t])continue;let r=t+1;for(;r<n&&"ON"===e[r];)r++;const i="L"!==(t>0?e[t-1]:u)?"R":"L";if(i===("L"!==(r<n?e[r]:u)?"R":"L"))for(let n=t;n<r;n++)e[n]=i;t=r-1}for(let t=0;t<n;t++)"ON"===e[t]&&(e[t]=s);
146
159
  // I1-I2
147
- for(let t=0;t<n;t++){const n=e[t];1&o[t]?"L"!==n&&"AN"!==n&&"EN"!==n||o[t]++:"R"===n?o[t]++:"AN"!==n&&"EN"!==n||(o[t]+=2)}return o}(t);if(null===e)return null;const r=new Int8Array(n.length);for(let t=0;t<n.length;t++)r[t]=e[n[t]];return r}const me=/[ \t\n\r\f]+/g,ye=/[\t\n\r\f]| {2,}|^ | $/;let Le=null;const we=/\p{Script=Arabic}/u,ve=/\p{M}/u,Ae=/\p{Nd}/u;function xe(t){return we.test(t)}function _e(t){for(const n of t){const t=n.codePointAt(0);if(t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=196608&&t<=201551||t>=63744&&t<=64255||t>=194560&&t<=195103||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519)return!0}return!1}const Ne=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),be=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),ke=new Set(["'","’"]),Se=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Ee=new Set([":",".","،","؛"]),Oe=new Set(["၏"]),Me=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Be(t){if($e(t))return!0;let n=!1;for(const e of t)if(Se.has(e))n=!0;else if(!n||!ve.test(e))return!1;return n}function Ce(t){for(const n of t)if(!Ne.has(n)&&!Se.has(n))return!1;return t.length>0}function We(t){if($e(t))return!0;for(const n of t)if(!be.has(n)&&!ke.has(n)&&!ve.test(n))return!1;return t.length>0}function $e(t){let n=!1;for(const e of t)if("\\"!==e&&!ve.test(e)){if(!(be.has(e)||Se.has(e)||ke.has(e)))return!1;n=!0}return n}function Ie(t){const n=Array.from(t);let e=n.length;for(;e>0;){const t=n[e-1];if(ve.test(t))e--;else{if(!be.has(t)&&!ke.has(t))break;e--}}return e<=0||e===n.length?null:{head:n.slice(0,e).join(""),tail:n.slice(e).join("")}}function Pe(t,n){if(0===t.length)return!1;for(const e of t)if(e!==n)return!1;return!0}function Fe(t){return!(!xe(t)||0===t.length)&&Ee.has(t[t.length-1])}function Re(t){return 0!==t.length&&Oe.has(t[t.length-1])}function Te(t){if(t.length<2||" "!==t[0])return null;const n=t.slice(1);return/^\p{M}+$/u.test(n)?{space:" ",marks:n}:null}function ze(t){for(let n=t.length-1;n>=0;n--){const e=t[n];if(Me.has(e))return!0;if(!Se.has(e))return!1}return!1}function je(t,n){if(n.preserveOrdinarySpaces||n.preserveHardBreaks){if(" "===t)return"preserved-space";if("\t"===t)return"tab";if(n.preserveHardBreaks&&"\n"===t)return"hard-break"}return" "===t?"space":" "===t||" "===t||"⁠"===t||"\ufeff"===t?"glue":"​"===t?"zero-width-break":"­"===t?"soft-hyphen":"text"}function He(t,n,e,r){const i=[];let o=null,s="",u=e,a=!1,l=0;for(const c of t){const t=je(c,r),f="text"===t&&n;null===o||t!==o||f!==a?(null!==o&&i.push({text:s,isWordLike:a,kind:o,start:u}),o=t,s=c,u=e+l,a=f,l+=c.length):(s+=c,l+=c.length)}return null!==o&&i.push({text:s,isWordLike:a,kind:o,start:u}),i}function qe(t){return"space"===t||"preserved-space"===t||"zero-width-break"===t||"hard-break"===t}const De=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Xe(t,n){const e=t.texts[n];return!!e.startsWith("www.")||De.test(e)&&n+1<t.len&&"text"===t.kinds[n+1]&&"//"===t.texts[n+1]}function Ye(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}const Ge=new Set([":","-","/","×",",",".","+","–","—"]),Ve=/^[A-Za-z0-9_]+[,:;]*$/,Qe=/[,:;]+$/;function Ke(t){for(const n of t)if(Ae.test(n))return!0;return!1}function Je(t){if(0===t.length)return!1;for(const n of t)if(!Ae.test(n)&&!Ge.has(n))return!1;return!0}function Ue(t,n,e){const r=(null===Le&&(Le=new Intl.Segmenter(void 0,{granularity:"word"})),Le);let i=0;const o=[],s=[],u=[],a=[];for(const l of r.segment(t))for(const t of He(l.segment,l.isWordLike??!1,l.index,e)){const e="text"===t.kind;n.carryCJKAfterClosingQuote&&e&&i>0&&"text"===u[i-1]&&_e(t.text)&&_e(o[i-1])&&ze(o[i-1])||e&&i>0&&"text"===u[i-1]&&Ce(t.text)&&_e(o[i-1])||e&&i>0&&"text"===u[i-1]&&Re(o[i-1])?(o[i-1]+=t.text,s[i-1]=s[i-1]||t.isWordLike):e&&i>0&&"text"===u[i-1]&&t.isWordLike&&xe(t.text)&&Fe(o[i-1])?(o[i-1]+=t.text,s[i-1]=!0):e&&!t.isWordLike&&i>0&&"text"===u[i-1]&&1===t.text.length&&"-"!==t.text&&"—"!==t.text&&Pe(o[i-1],t.text)||e&&!t.isWordLike&&i>0&&"text"===u[i-1]&&(Be(t.text)||"-"===t.text&&s[i-1])?o[i-1]+=t.text:(o[i]=t.text,s[i]=t.isWordLike,u[i]=t.kind,a[i]=t.start,i++)}for(let t=1;t<i;t++)"text"===u[t]&&!s[t]&&$e(o[t])&&"text"===u[t-1]&&(o[t-1]+=o[t],s[t-1]=s[t-1]||s[t],o[t]="");for(let t=i-2;t>=0;t--)if("text"===u[t]&&!s[t]&&We(o[t])){let n=t+1;for(;n<i&&""===o[n];)n++;n<i&&"text"===u[n]&&(o[n]=o[t]+o[n],a[n]=a[t],o[t]="")}let l=0;for(let t=0;t<i;t++){const n=o[t];0!==n.length&&(l!==t&&(o[l]=n,s[l]=s[t],u[l]=u[t],a[l]=a[t]),l++)}o.length=l,s.length=l,u.length=l,a.length=l;const c=function(t){const n=[],e=[],r=[],i=[];let o=0;for(;o<t.len;){let s=t.texts[o],u=t.isWordLike[o],a=t.kinds[o],l=t.starts[o];if("glue"===a){let c=s;const f=l;for(o++;o<t.len&&"glue"===t.kinds[o];)c+=t.texts[o],o++;if(!(o<t.len&&"text"===t.kinds[o])){n.push(c),e.push(!1),r.push("glue"),i.push(f);continue}s=c+t.texts[o],u=t.isWordLike[o],a="text",l=f,o++}else o++;if("text"===a)for(;o<t.len&&"glue"===t.kinds[o];){let n="";for(;o<t.len&&"glue"===t.kinds[o];)n+=t.texts[o],o++;o<t.len&&"text"===t.kinds[o]?(s+=n+t.texts[o],u=u||t.isWordLike[o],o++):s+=n}n.push(s),e.push(u),r.push(a),i.push(l)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}({len:l,texts:o,isWordLike:s,kinds:u,starts:a}),f=function(t){const n=t.texts.slice(),e=t.isWordLike.slice(),r=t.kinds.slice(),i=t.starts.slice();for(let t=0;t<n.length-1;t++){if("text"!==r[t]||"text"!==r[t+1])continue;if(!_e(n[t])||!_e(n[t+1]))continue;const e=Ie(n[t]);null!==e&&(n[t]=e.head,n[t+1]=e.tail+n[t+1],i[t+1]=i[t]+e.head.length)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o],u=t.kinds[o],a=t.isWordLike[o];if("text"===u&&a&&Ve.test(s)){let u=s,a=o+1;for(;Qe.test(u)&&a<t.len&&"text"===t.kinds[a]&&t.isWordLike[a]&&Ve.test(t.texts[a]);)u+=t.texts[a],a++;n.push(u),e.push(!0),r.push("text"),i.push(t.starts[o]),o=a-1;continue}n.push(s),e.push(a),r.push(u),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o];if("text"===t.kinds[o]&&s.includes("-")){const u=s.split("-");let a=u.length>1;for(let t=0;t<u.length;t++){const n=u[t];if(!a)break;0!==n.length&&Ke(n)&&Je(n)||(a=!1)}if(a){let s=0;for(let a=0;a<u.length;a++){const l=u[a],c=a<u.length-1?`${l}-`:l;n.push(c),e.push(!0),r.push("text"),i.push(t.starts[o]+s),s+=c.length}continue}}n.push(s),e.push(t.isWordLike[o]),r.push(t.kinds[o]),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o],u=t.kinds[o];if("text"===u&&Je(s)&&Ke(s)){let u=s,a=o+1;for(;a<t.len&&"text"===t.kinds[a]&&Je(t.texts[a]);)u+=t.texts[a],a++;n.push(u),e.push(!0),r.push("text"),i.push(t.starts[o]),o=a-1;continue}n.push(s),e.push(t.isWordLike[o]),r.push(u),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o];if(n.push(s),e.push(t.isWordLike[o]),r.push(t.kinds[o]),i.push(t.starts[o]),!Ye(s))continue;const u=o+1;if(u>=t.len||qe(t.kinds[u]))continue;let a="";const l=t.starts[u];let c=u;for(;c<t.len&&!qe(t.kinds[c]);)a+=t.texts[c],c++;a.length>0&&(n.push(a),e.push(!0),r.push("text"),i.push(l),o=c-1)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=t.texts.slice(),e=t.isWordLike.slice(),r=t.kinds.slice(),i=t.starts.slice();for(let i=0;i<t.len;i++){if("text"!==r[i]||!Xe(t,i))continue;let o=i+1;for(;o<t.len&&!qe(r[o]);){n[i]+=n[o],e[i]=!0;const t=n[o].includes("?");if(r[o]="text",n[o]="",o++,t)break}}let o=0;for(let t=0;t<n.length;t++){const s=n[t];0!==s.length&&(o!==t&&(n[o]=s,e[o]=e[t],r[o]=r[t],i[o]=i[t]),o++)}return n.length=o,e.length=o,r.length=o,i.length=o,{len:o,texts:n,isWordLike:e,kinds:r,starts:i}}(c))))));for(let t=0;t<f.len-1;t++){const n=Te(f.texts[t]);null!==n&&("space"!==f.kinds[t]&&"preserved-space"!==f.kinds[t]||"text"!==f.kinds[t+1]||!xe(f.texts[t+1])||(f.texts[t]=n.space,f.isWordLike[t]=!1,f.kinds[t]="preserved-space"===f.kinds[t]?"preserved-space":"space",f.texts[t+1]=n.marks+f.texts[t+1],f.starts[t+1]=f.starts[t]+n.space.length))}return f}function Ze(t,n){if(0===t.len)return[];if(!n.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];const e=[];let r=0;for(let n=0;n<t.len;n++)"hard-break"===t.kinds[n]&&(e.push({startSegmentIndex:r,endSegmentIndex:n,consumedEndSegmentIndex:n+1}),r=n+1);return r<t.len&&e.push({startSegmentIndex:r,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),e}function tr(t,n,e="normal"){const r=function(t){const n=t??"normal";return"pre-wrap"===n?{mode:n,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:n,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}(e),i="pre-wrap"===r.mode?function(t){return/[\r\f]/.test(t)?t.replace(/\r\n/g,"\n").replace(/[\r\f]/g,"\n"):t.replace(/\r\n/g,"\n")}(t):function(t){if(!ye.test(t))return t;let n=t.replace(me," ");return 32===n.charCodeAt(0)&&(n=n.slice(1)),n.length>0&&32===n.charCodeAt(n.length-1)&&(n=n.slice(0,-1)),n}(t);if(0===i.length)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const o=Ue(i,n,r);return{normalized:i,chunks:Ze(o,r),...o}}let nr=null;const er=new Map;let rr=null;const ir=/\p{Emoji_Presentation}/u,or=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let sr=null;const ur=new Map;function ar(){if(null!==nr)return nr;if("undefined"!=typeof OffscreenCanvas)return nr=new OffscreenCanvas(1,1).getContext("2d"),nr;if("undefined"!=typeof document)return nr=document.createElement("canvas").getContext("2d"),nr;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function lr(t,n){let e=n.get(t);if(void 0===e){e={width:ar().measureText(t).width,containsCJK:_e(t)},n.set(t,e)}return e}function cr(){if(null!==rr)return rr;if("undefined"==typeof navigator)return rr={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},rr;const t=navigator.userAgent,n="Apple Computer, Inc."===navigator.vendor&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),e=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return rr={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:e,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},rr}function fr(){return null===sr&&(sr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),sr}function hr(t){return ir.test(t)||t.includes("️")}function dr(t,n){return void 0===n.emojiCount&&(n.emojiCount=function(t){let n=0;const e=fr();for(const r of e.segment(t))hr(r.segment)&&n++;return n}(t)),n.emojiCount}function pr(t,n,e){return 0===e?n.width:n.width-dr(t,n)*e}function gr(t,n,e,r){if(void 0!==n.graphemeWidths)return n.graphemeWidths;const i=[],o=fr();for(const n of o.segment(t)){const t=lr(n.segment,e);i.push(pr(n.segment,t,r))}return n.graphemeWidths=i.length>1?i:null,n.graphemeWidths}function mr(t,n,e,r){if(void 0!==n.graphemePrefixWidths)return n.graphemePrefixWidths;const i=[],o=fr();let s="";for(const n of o.segment(t)){s+=n.segment;const t=lr(s,e);i.push(pr(s,t,r))}return n.graphemePrefixWidths=i.length>1?i:null,n.graphemePrefixWidths}function yr(t,n){ar().font=t;const e=function(t){let n=er.get(t);return n||(n=new Map,er.set(t,n)),n}(t),r=function(t){const n=t.match(/(\d+(?:\.\d+)?)\s*px/);return n?parseFloat(n[1]):16}(t),i=n?function(t,n){let e=ur.get(t);if(void 0!==e)return e;const r=ar();r.font=t;const i=r.measureText("😀").width;if(e=0,i>n+.5&&"undefined"!=typeof document&&null!==document.body){const n=document.createElement("span");n.style.font=t,n.style.display="inline-block",n.style.visibility="hidden",n.style.position="absolute",n.textContent="😀",document.body.appendChild(n);const r=n.getBoundingClientRect().width;document.body.removeChild(n),i-r>.5&&(e=i-r)}return ur.set(t,e),e}(t,r):0;return{cache:e,fontSize:r,emojiCorrection:i}}function Lr(t){return"space"===t||"preserved-space"===t||"tab"===t||"zero-width-break"===t||"soft-hyphen"===t}function wr(t,n){if(n<=0)return 0;const e=t%n;return Math.abs(e)<=1e-6?n:n-e}function vr(t,n,e,r){return r&&null!==n?n[e]-(e>0?n[e-1]:0):t[e]}function Ar(t,n,e){const{widths:r,kinds:i,breakableWidths:o,breakablePrefixWidths:s}=t;if(0===r.length)return 0;const u=cr(),a=u.lineFitEpsilon;let l=0,c=0,f=!1,h=0,d=0,p=0,g=0,m=-1,y=0;function L(t=p,n=g,r=c){l++,e?.({startSegmentIndex:h,startGraphemeIndex:d,endSegmentIndex:t,endGraphemeIndex:n,width:r}),c=0,f=!1,m=-1,y=0}function w(t,n){f=!0,h=t,d=0,p=t+1,g=0,c=n}function v(t,n,e){f=!0,h=t,d=n,p=t,g=n+1,c=e}function A(t,n){f?(c+=n,p=t+1,g=0):w(t,n)}function x(t,n){Lr(i[t])&&(m=t+1,y=c-n)}function _(t){!function(t,e){const r=o[t],i=s[t]??null;for(let o=e;o<r.length;o++){const e=vr(r,i,o,u.preferPrefixWidthsForBreakableRuns);f?c+e>n+a?(L(),v(t,o,e)):(c+=e,p=t,g=o+1):v(t,o,e)}f&&p===t&&g===r.length&&(p=t+1,g=0)}(t,0)}let N=0;for(;N<r.length;){const t=r[N],e=i[N];if(!f){t>n&&null!==o[N]?_(N):w(N,t),x(N,t),N++;continue}if(c+t>n+a){if(Lr(e)){A(N,t),L(N+1,0,c-t),N++;continue}if(m>=0){L(m,0,y);continue}if(t>n&&null!==o[N]){L(),_(N),N++;continue}L()}else A(N,t),x(N,t),N++}return f&&L(),l}
160
+ for(let t=0;t<n;t++){const n=e[t];1&o[t]?"L"!==n&&"AN"!==n&&"EN"!==n||o[t]++:"R"===n?o[t]++:"AN"!==n&&"EN"!==n||(o[t]+=2)}return o}(t);if(null===e)return null;const r=new Int8Array(n.length);for(let t=0;t<n.length;t++)r[t]=e[n[t]];return r}const ge=/[ \t\n\r\f]+/g,Se=/[\t\n\r\f]| {2,}|^ | $/;let me=null;const Me=/\p{Script=Arabic}/u,ye=/\p{M}/u,ve=/\p{Nd}/u;function we(t){return Me.test(t)}function xe(t){return t>=19968&&t<=40959||t>=13312&&t<=19903||t>=131072&&t<=173791||t>=173824&&t<=177983||t>=177984&&t<=178207||t>=178208&&t<=183983||t>=183984&&t<=191471||t>=191472&&t<=192093||t>=194560&&t<=195103||t>=196608&&t<=201551||t>=201552&&t<=205743||t>=205744&&t<=210041||t>=63744&&t<=64255||t>=12288&&t<=12351||t>=12352&&t<=12447||t>=12448&&t<=12543||t>=44032&&t<=55215||t>=65280&&t<=65519}function _e(t){for(let n=0;n<t.length;n++){const e=t.charCodeAt(n);if(!(e<12288)){if(e>=55296&&e<=56319&&n+1<t.length){const r=t.charCodeAt(n+1);if(r>=56320&&r<=57343){if(xe(r-56320+(e-55296<<10)+65536))return!0;n++;continue}}if(xe(e))return!0}}return!1}const Oe=new Set([" "," ","⁠","\ufeff"]);function be(t){return _e(t)}function Le(t){return!function(t){const n=Pe(t);return null!==n&&(ke.has(n)||Be.has(n))}(t)&&!function(t){const n=Pe(t);return null!==n&&Oe.has(n)}(t)}const ke=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Ae=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ee=new Set(["'","’"]),Be=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Ce=new Set([":",".","،","؛"]),Re=new Set(["၏"]),$e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Ie(t){if(Te(t))return!0;let n=!1;for(const e of t)if(Be.has(e))n=!0;else if(!n||!ye.test(e))return!1;return n}function Fe(t){for(const n of t)if(!ke.has(n)&&!Be.has(n))return!1;return t.length>0}function We(t){if(Te(t))return!0;for(const n of t)if(!Ae.has(n)&&!Ee.has(n)&&!ye.test(n))return!1;return t.length>0}function Te(t){let n=!1;for(const e of t)if("\\"!==e&&!ye.test(e)){if(!(Ae.has(e)||Be.has(e)||Ee.has(e)))return!1;n=!0}return n}function ze(t,n){const e=n-1;if(e<=0)return Math.max(e,0);const r=t.charCodeAt(e);if(r<56320||r>57343)return e;const i=e-1;if(i<0)return e;const o=t.charCodeAt(i);return o>=55296&&o<=56319?i:e}function Pe(t){if(0===t.length)return null;const n=ze(t,t.length);return t.slice(n)}function je(t){const n=Array.from(t);let e=n.length;for(;e>0;){const t=n[e-1];if(ye.test(t))e--;else{if(!Ae.has(t)&&!Ee.has(t))break;e--}}return e<=0||e===n.length?null:{head:n.slice(0,e).join(""),tail:n.slice(e).join("")}}function He(t,n,e){return"text"!==e||n||1!==t.length||"-"===t||"—"===t?null:t}function qe(t,n,e,r){const i=n[r],o=t[r];if(null==i)return o;const s=e[r];if(o.length===s)return o;const u=i.repeat(s);return t[r]=u,u}function De(t,n){return t&&null!==n&&Ce.has(n)}function Xe(t){const n=Pe(t);return null!==n&&Re.has(n)}function Ye(t){if(t.length<2||" "!==t[0])return null;const n=t.slice(1);return/^\p{M}+$/u.test(n)?{space:" ",marks:n}:null}function Ge(t){let n=t.length;for(;n>0;){const e=ze(t,n),r=t.slice(e,n);if($e.has(r))return!0;if(!Be.has(r))return!1;n=e}return!1}function Ve(t,n){if(n.preserveOrdinarySpaces||n.preserveHardBreaks){if(" "===t)return"preserved-space";if("\t"===t)return"tab";if(n.preserveHardBreaks&&"\n"===t)return"hard-break"}return" "===t?"space":" "===t||" "===t||"⁠"===t||"\ufeff"===t?"glue":"​"===t?"zero-width-break":"­"===t?"soft-hyphen":"text"}
161
+ // All characters that classifySegmentBreakChar maps to a non-'text' kind.
162
+ const Qe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ke(t){return 1===t.length?t[0]:t.join("")}function Je(t,n){const e=[];for(let n=t.length-1;n>=0;n--)e.push(t[n]);return e.push(n),Ke(e)}function Ue(t,n,e,r){if(!Qe.test(t))return[{text:t,isWordLike:n,kind:"text",start:e}];const i=[];let o=null,s=[],u=e,a=!1,l=0;for(const c of t){const t=Ve(c,r),f="text"===t&&n;null===o||t!==o||f!==a?(null!==o&&i.push({text:Ke(s),isWordLike:a,kind:o,start:u}),o=t,s=[c],u=e+l,a=f,l+=c.length):(s.push(c),l+=c.length)}return null!==o&&i.push({text:Ke(s),isWordLike:a,kind:o,start:u}),i}function Ze(t){return"space"===t||"preserved-space"===t||"zero-width-break"===t||"hard-break"===t}const tr=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function nr(t,n){const e=t.texts[n];return!!e.startsWith("www.")||tr.test(e)&&n+1<t.len&&"text"===t.kinds[n+1]&&"//"===t.texts[n+1]}function er(t){return t.includes("?")&&(t.includes("://")||t.startsWith("www."))}const rr=new Set([":","-","/","×",",",".","+","–","—"]),ir=/^[A-Za-z0-9_]+[,:;]*$/,or=/[,:;]+$/;function sr(t){for(const n of t)if(ve.test(n))return!0;return!1}function ur(t){if(0===t.length)return!1;for(const n of t)if(!ve.test(n)&&!rr.has(n))return!1;return!0}function ar(t,n,e){const r=(null===me&&(me=new Intl.Segmenter(void 0,{granularity:"word"})),me);let i=0;const o=[],s=[],u=[],a=[],l=[],c=[],f=[],h=[],N=[],d=[],p=[],g=[];for(const x of r.segment(t))for(const _ of Ue(x.segment,x.isWordLike??!1,x.index,e)){const O="text"===_.kind,b=He(_.text,_.isWordLike,_.kind),L=_e(_.text),k=we(_.text),A=Pe(_.text),E=Ge(_.text),B=Xe(_.text),C=i-1;function S(){null!==c[C]&&(s[C]=[qe(o,c,f,C)],c[C]=null),s[C].push(_.text),u[C]=u[C]||_.isWordLike,h[C]=h[C]||L,N[C]=N[C]||k,d[C]=E,p[C]=B,g[C]=De(N[C],A)}
163
+ // First-pass keeps: no-space script-specific joins and punctuation glue
164
+ // that depend on the immediately preceding text run.
165
+ n.carryCJKAfterClosingQuote&&O&&i>0&&"text"===a[C]&&L&&h[C]&&d[C]||O&&i>0&&"text"===a[C]&&Fe(_.text)&&h[C]||O&&i>0&&"text"===a[C]&&p[C]?S():O&&i>0&&"text"===a[C]&&_.isWordLike&&k&&g[C]?(S(),u[C]=!0):null!==b&&i>0&&"text"===a[C]&&c[C]===b?f[C]=(f[C]??1)+1:O&&!_.isWordLike&&i>0&&"text"===a[C]&&(Ie(_.text)||"-"===_.text&&u[C])?S():(o[i]=_.text,s[i]=[_.text],u[i]=_.isWordLike,a[i]=_.kind,l[i]=_.start,c[i]=b,f[i]=null===b?0:1,h[i]=L,N[i]=k,d[i]=E,p[i]=B,g[i]=De(k,A),i++)}for(let R=0;R<i;R++)null===c[R]?o[R]=Ke(s[R]):o[R]=qe(o,c,f,R);
166
+ // Later passes operate on the merged text stream itself: contextual escaped
167
+ // quote glue, forward-sticky carry, compaction, then the broader URL/numeric
168
+ // and Arabic-leading-mark fixes.
169
+ for(let $=1;$<i;$++)"text"===a[$]&&!u[$]&&Te(o[$])&&"text"===a[$-1]&&(o[$-1]+=o[$],u[$-1]=u[$-1]||u[$],o[$]="");const m=Array.from({length:i},()=>null);let M=-1;for(let I=i-1;I>=0;I--){const F=o[I];if(0!==F.length){if("text"===a[I]&&!u[I]&&We(F)&&M>=0&&"text"===a[M]){const W=m[M]??[];W.push(F),m[M]=W,l[M]=l[I],o[I]="";continue}M=I}}for(let T=0;T<i;T++){const z=m[T];null!=z&&(o[T]=Je(z,o[T]))}let y=0;for(let P=0;P<i;P++){const j=o[P];0!==j.length&&(y!==P&&(o[y]=j,u[y]=u[P],a[y]=a[P],l[y]=l[P]),y++)}o.length=y,u.length=y,a.length=y,l.length=y;const v=function(t){const n=[],e=[],r=[],i=[];let o=0;for(;o<t.len;){const s=[t.texts[o]];let u=t.isWordLike[o],a=t.kinds[o],l=t.starts[o];if("glue"===a){const c=[s[0]],f=l;for(o++;o<t.len&&"glue"===t.kinds[o];)c.push(t.texts[o]),o++;const h=Ke(c);if(!(o<t.len&&"text"===t.kinds[o])){n.push(h),e.push(!1),r.push("glue"),i.push(f);continue}s[0]=h,s.push(t.texts[o]),u=t.isWordLike[o],a="text",l=f,o++}else o++;if("text"===a)for(;o<t.len&&"glue"===t.kinds[o];){const n=[];for(;o<t.len&&"glue"===t.kinds[o];)n.push(t.texts[o]),o++;const e=Ke(n);o<t.len&&"text"===t.kinds[o]?(s.push(e,t.texts[o]),u=u||t.isWordLike[o],o++):s.push(e)}n.push(Ke(s)),e.push(u),r.push(a),i.push(l)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}({len:y,texts:o,isWordLike:u,kinds:a,starts:l}),w=function(t){const n=t.texts.slice(),e=t.isWordLike.slice(),r=t.kinds.slice(),i=t.starts.slice();for(let t=0;t<n.length-1;t++){if("text"!==r[t]||"text"!==r[t+1])continue;if(!_e(n[t])||!_e(n[t+1]))continue;const e=je(n[t]);null!==e&&(n[t]=e.head,n[t+1]=e.tail+n[t+1],i[t+1]=i[t]+e.head.length)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o],u=t.kinds[o],a=t.isWordLike[o];if("text"===u&&a&&ir.test(s)){const u=[s];let a=or.test(s),l=o+1;for(;a&&l<t.len&&"text"===t.kinds[l]&&t.isWordLike[l]&&ir.test(t.texts[l]);){const n=t.texts[l];u.push(n),a=or.test(n),l++}n.push(Ke(u)),e.push(!0),r.push("text"),i.push(t.starts[o]),o=l-1;continue}n.push(s),e.push(a),r.push(u),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o];if("text"===t.kinds[o]&&s.includes("-")){const u=s.split("-");let a=u.length>1;for(let t=0;t<u.length;t++){const n=u[t];if(!a)break;0!==n.length&&sr(n)&&ur(n)||(a=!1)}if(a){let s=0;for(let a=0;a<u.length;a++){const l=u[a],c=a<u.length-1?`${l}-`:l;n.push(c),e.push(!0),r.push("text"),i.push(t.starts[o]+s),s+=c.length}continue}}n.push(s),e.push(t.isWordLike[o]),r.push(t.kinds[o]),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o],u=t.kinds[o];if("text"===u&&ur(s)&&sr(s)){const u=[s];let a=o+1;for(;a<t.len&&"text"===t.kinds[a]&&ur(t.texts[a]);)u.push(t.texts[a]),a++;n.push(Ke(u)),e.push(!0),r.push("text"),i.push(t.starts[o]),o=a-1;continue}n.push(s),e.push(t.isWordLike[o]),r.push(u),i.push(t.starts[o])}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=[],e=[],r=[],i=[];for(let o=0;o<t.len;o++){const s=t.texts[o];if(n.push(s),e.push(t.isWordLike[o]),r.push(t.kinds[o]),i.push(t.starts[o]),!er(s))continue;const u=o+1;if(u>=t.len||Ze(t.kinds[u]))continue;const a=[],l=t.starts[u];let c=u;for(;c<t.len&&!Ze(t.kinds[c]);)a.push(t.texts[c]),c++;a.length>0&&(n.push(Ke(a)),e.push(!0),r.push("text"),i.push(l),o=c-1)}return{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(function(t){const n=t.texts.slice(),e=t.isWordLike.slice(),r=t.kinds.slice(),i=t.starts.slice();for(let i=0;i<t.len;i++){if("text"!==r[i]||!nr(t,i))continue;const o=[n[i]];let s=i+1;for(;s<t.len&&!Ze(r[s]);){o.push(n[s]),e[i]=!0;const t=n[s].includes("?");if(r[s]="text",n[s]="",s++,t)break}n[i]=Ke(o)}let o=0;for(let t=0;t<n.length;t++){const s=n[t];0!==s.length&&(o!==t&&(n[o]=s,e[o]=e[t],r[o]=r[t],i[o]=i[t]),o++)}return n.length=o,e.length=o,r.length=o,i.length=o,{len:o,texts:n,isWordLike:e,kinds:r,starts:i}}(v))))));for(let H=0;H<w.len-1;H++){const q=Ye(w.texts[H]);null!==q&&("space"!==w.kinds[H]&&"preserved-space"!==w.kinds[H]||"text"!==w.kinds[H+1]||!we(w.texts[H+1])||(w.texts[H]=q.space,w.isWordLike[H]=!1,w.kinds[H]="preserved-space"===w.kinds[H]?"preserved-space":"space",w.texts[H+1]=q.marks+w.texts[H+1],w.starts[H+1]=w.starts[H]+q.space.length))}return w}function lr(t,n){if(0===t.len)return[];if(!n.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}];const e=[];let r=0;for(let n=0;n<t.len;n++)"hard-break"===t.kinds[n]&&(e.push({startSegmentIndex:r,endSegmentIndex:n,consumedEndSegmentIndex:n+1}),r=n+1);return r<t.len&&e.push({startSegmentIndex:r,endSegmentIndex:t.len,consumedEndSegmentIndex:t.len}),e}function cr(t,n,e="normal",r="normal"){const i=function(t){const n=t??"normal";return"pre-wrap"===n?{mode:n,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:n,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}(e),o="pre-wrap"===i.mode?function(t){return/[\r\f]/.test(t)?t.replace(/\r\n/g,"\n").replace(/[\r\f]/g,"\n"):t.replace(/\r\n/g,"\n")}(t):function(t){if(!Se.test(t))return t;let n=t.replace(ge," ");return 32===n.charCodeAt(0)&&(n=n.slice(1)),n.length>0&&32===n.charCodeAt(n.length-1)&&(n=n.slice(0,-1)),n}(t);if(0===o.length)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const s="keep-all"===r?function(t){if(t.len<=1)return t;const n=[],e=[],r=[],i=[];let o=null,s=!1,u=0,a=!1,l=!1;function c(){null!==o&&(n.push(Ke(o)),e.push(s),r.push("text"),i.push(u),o=null)}for(let f=0;f<t.len;f++){const h=t.texts[f],N=t.kinds[f],d=t.isWordLike[f],p=t.starts[f];if("text"===N){const t=be(h),n=Le(h);if(null!==o&&a&&l){o.push(h),s=s||d,a=a||t,l=n;continue}c(),o=[h],s=d,u=p,a=t,l=n;continue}c(),n.push(h),e.push(d),r.push(N),i.push(p)}return c(),{len:n.length,texts:n,isWordLike:e,kinds:r,starts:i}}(ar(o,n,i)):ar(o,n,i);return{normalized:o,chunks:lr(s,i),...s}}let fr=null;const hr=new Map;let Nr=null;
170
+ // Safari's prefix-fit policy is useful for ordinary word-sized runs, but letting
171
+ // it measure every growing prefix of a giant segment recreates a pathological
172
+ // superlinear prepare-time path. Past this size, switch to the cheaper
173
+ // pair-context model and keep the public behavior linear.
174
+ const dr=/\p{Emoji_Presentation}/u,pr=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let gr=null;const Sr=new Map;function mr(){if(null!==fr)return fr;if("undefined"!=typeof OffscreenCanvas)return fr=new OffscreenCanvas(1,1).getContext("2d"),fr;if("undefined"!=typeof document)return fr=document.createElement("canvas").getContext("2d"),fr;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Mr(t,n){let e=n.get(t);if(void 0===e){e={width:mr().measureText(t).width,containsCJK:_e(t)},n.set(t,e)}return e}function yr(){if(null!==Nr)return Nr;if("undefined"==typeof navigator)return Nr={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Nr;const t=navigator.userAgent,n="Apple Computer, Inc."===navigator.vendor&&t.includes("Safari/")&&!t.includes("Chrome/")&&!t.includes("Chromium/")&&!t.includes("CriOS/")&&!t.includes("FxiOS/")&&!t.includes("EdgiOS/"),e=t.includes("Chrome/")||t.includes("Chromium/")||t.includes("CriOS/")||t.includes("Edg/");return Nr={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:e,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Nr}function vr(){return null===gr&&(gr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),gr}function wr(t){return dr.test(t)||t.includes("️")}function xr(t,n){return void 0===n.emojiCount&&(n.emojiCount=function(t){let n=0;const e=vr();for(const r of e.segment(t))wr(r.segment)&&n++;return n}(t)),n.emojiCount}function _r(t,n,e){return 0===e?n.width:n.width-xr(t,n)*e}function Or(t,n){mr().font=t;const e=function(t){let n=hr.get(t);return n||(n=new Map,hr.set(t,n)),n}(t),r=function(t){const n=t.match(/(\d+(?:\.\d+)?)\s*px/);return n?parseFloat(n[1]):16}(t),i=n?function(t,n){let e=Sr.get(t);if(void 0!==e)return e;const r=mr();r.font=t;const i=r.measureText("😀").width;if(e=0,i>n+.5&&"undefined"!=typeof document&&null!==document.body){const n=document.createElement("span");n.style.font=t,n.style.display="inline-block",n.style.visibility="hidden",n.style.position="absolute",n.textContent="😀",document.body.appendChild(n);const r=n.getBoundingClientRect().width;document.body.removeChild(n),i-r>.5&&(e=i-r)}return Sr.set(t,e),e}(t,r):0;return{cache:e,fontSize:r,emojiCorrection:i}}function br(t,n){for(;n<t.widths.length;){const e=t.kinds[n];if("space"!==e&&"zero-width-break"!==e&&"soft-hyphen"!==e)break;n++}return n}function Lr(t,n){if(n<=0)return 0;const e=t%n;return Math.abs(e)<=1e-6?n:n-e}function kr(t,n,e){const{widths:r,kinds:i,breakableFitAdvances:o}=t;if(0===r.length)return 0;const s=n+yr().lineFitEpsilon;let u=0,a=0,l=!1,c=0,f=0,h=0,N=0,d=-1,p=0;function g(t=h,n=N,r=a){u++,e?.({startSegmentIndex:c,startGraphemeIndex:f,endSegmentIndex:t,endGraphemeIndex:n,width:r}),a=0,l=!1,d=-1,p=0}function S(t,n){l=!0,c=t,f=0,h=t+1,N=0,a=n}function m(t,n,e){l=!0,c=t,f=n,h=t,N=n+1,a=e}function M(t,n){l?(a+=n,h=t+1,N=0):S(t,n)}function y(t,n){const e=o[t];for(let r=n;r<e.length;r++){const n=e[r];l?a+n>s?(g(),m(t,r,n)):(a+=n,h=t,N=r+1):m(t,r,n)}l&&h===t&&N===e.length&&(h=t+1,N=0)}let v=0;for(;v<r.length&&(l||(v=br(t,v),!(v>=r.length)));){const t=r[v],e=i[v],u="space"===e||"preserved-space"===e||"tab"===e||"zero-width-break"===e||"soft-hyphen"===e;if(!l){t>n&&null!==o[v]?y(v,0):S(v,t),u&&(d=v+1,p=a-t),v++;continue}if(a+t>s){if(u){M(v,t),g(v+1,0,a-t),v++;continue}if(d>=0){if(h>d||h===d&&N>0){g();continue}g(d,0,p);continue}if(t>n&&null!==o[v]){g(),y(v,0),v++;continue}g()}else M(v,t),u&&(d=v+1,p=a-t),v++}return l&&g(),u}
148
175
  // Text measurement for browser environments using canvas measureText.
149
176
  // Problem: DOM-based text measurement (getBoundingClientRect, offsetHeight)
150
177
  // forces synchronous layout reflow. When components independently measure text,
@@ -172,24 +199,24 @@ for(let t=0;t<n;t++){const n=e[t];1&o[t]?"L"!==n&&"AN"!==n&&"EN"!==n||o[t]++:"R"
172
199
  // Use named fonts (Helvetica, Inter, etc.) for guaranteed accuracy.
173
200
  // See RESEARCH.md "Discovery: system-ui font resolution mismatch".
174
201
  // Based on Sebastian Markbage's text-layout research (github.com/chenglou/text-layout).
175
- let xr=null,_r=new WeakMap;
202
+ let Ar=null,Er=new WeakMap;
176
203
  // Rich-path only. Reuses grapheme splits while materializing multiple lines
177
204
  // from the same prepared handle, without pushing that cache into the API.
178
- function Nr(){return null===xr&&(xr=new Intl.Segmenter(void 0,{granularity:"grapheme"})),xr}
205
+ function Br(){return null===Ar&&(Ar=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ar}
179
206
  // --- Public API ---
180
- function br(t,n,e){const r=Nr(),i=cr(),{cache:o,emojiCorrection:s}=yr(n,(u=t.normalized,or.test(u)));var u;const a=pr("-",lr("-",o),s),l=8*pr(" ",lr(" ",o),s);if(0===t.len)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]};const c=[],f=[],h=[],d=[];let p=t.chunks.length<=1;const g=[],m=[],y=[],L=e?[]:null,w=Array.from({length:t.len}),v=Array.from({length:t.len});function A(t,n,e,r,i,o,s,u){"text"!==i&&"space"!==i&&"zero-width-break"!==i&&(p=!1),c.push(n),f.push(e),h.push(r),d.push(i),g?.push(o),m.push(s),y.push(u),null!==L&&L.push(t)}for(let n=0;n<t.len;n++){w[n]=c.length;const e=t.texts[n],u=t.isWordLike[n],l=t.kinds[n],f=t.starts[n];if("soft-hyphen"===l){A(e,0,a,a,l,f,null,null),v[n]=c.length;continue}if("hard-break"===l){A(e,0,0,0,l,f,null,null),v[n]=c.length;continue}if("tab"===l){A(e,0,0,0,l,f,null,null),v[n]=c.length;continue}const h=lr(e,o);if("text"===l&&h.containsCJK){let t="",u=0;for(const n of r.segment(e)){const e=n.segment;if(0===t.length){t=e,u=n.index;continue}if(be.has(t)||Ne.has(e)||Se.has(e)||i.carryCJKAfterClosingQuote&&_e(e)&&ze(t)){t+=e;continue}const r=pr(t,lr(t,o),s);A(t,r,r,r,"text",f+u,null,null),t=e,u=n.index}if(t.length>0){const n=pr(t,lr(t,o),s);A(t,n,n,n,"text",f+u,null,null)}v[n]=c.length;continue}const d=pr(e,h,s),p="space"===l||"preserved-space"===l||"zero-width-break"===l?0:d,g="space"===l||"zero-width-break"===l?0:d;if(u&&e.length>1){A(e,d,p,g,l,f,gr(e,h,o,s),i.preferPrefixWidthsForBreakableRuns?mr(e,h,o,s):null)}else A(e,d,p,g,l,f,null,null);v[n]=c.length}const x=function(t,n,e){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.startSegmentIndex<n.length?n[o.startSegmentIndex]:e[e.length-1]??0,u=o.endSegmentIndex<n.length?n[o.endSegmentIndex]:e[e.length-1]??0,a=o.consumedEndSegmentIndex<n.length?n[o.consumedEndSegmentIndex]:e[e.length-1]??0;r.push({startSegmentIndex:s,endSegmentIndex:u,consumedEndSegmentIndex:a})}return r}(t.chunks,w,v),_=null===g?null:ge(t.normalized,g);return null!==L?{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:h,kinds:d,simpleLineWalkFastPath:p,segLevels:_,breakableWidths:m,breakablePrefixWidths:y,discretionaryHyphenWidth:a,tabStopAdvance:l,chunks:x,segments:L}:{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:h,kinds:d,simpleLineWalkFastPath:p,segLevels:_,breakableWidths:m,breakablePrefixWidths:y,discretionaryHyphenWidth:a,tabStopAdvance:l,chunks:x}}
207
+ function Cr(t,n){const e=[];let r=[],i=0,o=!1,s=!1,u=!1;function a(){0!==r.length&&(e.push({text:1===r.length?r[0]:r.join(""),start:i}),r=[],o=!1,s=!1,u=!1)}function l(t,n,e){r=[t],i=n,o=e,s=Ge(t),u=Ae.has(t)}function c(t,n){r.push(t),o=o||n;const e=Ge(t);s=1===t.length&&Be.has(t)&&s||e,u=!1}for(const e of Br().segment(t)){const t=e.segment,i=_e(t);0!==r.length?u||ke.has(t)||Be.has(t)||n.carryCJKAfterClosingQuote&&i&&s?c(t,i):o||i?(a(),l(t,e.index,i)):c(t,i):l(t,e.index,i)}return a(),e}function Rr(t,n,e,r){const i=yr(),{cache:o,emojiCorrection:s}=Or(n,(u=t.normalized,pr.test(u)));var u;const a=_r("-",Mr("-",o),s),l=8*_r(" ",Mr(" ",o),s);if(0===t.len)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]};const c=[],f=[],h=[],N=[];let d=t.chunks.length<=1;const p=[],g=[],S=e?[]:null,m=Array.from({length:t.len});function M(t,n,e,r,i,o,s){"text"!==i&&"space"!==i&&"zero-width-break"!==i&&(d=!1),c.push(n),f.push(e),h.push(r),N.push(i),p?.push(o),g.push(s),null!==S&&S.push(t)}function y(t,n,e,r,u){const a=Mr(t,o),l=_r(t,a,s),c="space"===n||"preserved-space"===n||"zero-width-break"===n?0:l,f="space"===n||"zero-width-break"===n?0:l;if(u&&r&&t.length>1){let r="sum-graphemes";ur(t)?r="pair-context":i.preferPrefixWidthsForBreakableRuns&&(r="segment-prefixes");const u=function(t,n,e,r,i){if(void 0!==n.breakableFitAdvances)return n.breakableFitAdvances;const o=vr(),s=[];for(const n of o.segment(t))s.push(n.segment);if(s.length<=1)return n.breakableFitAdvances=null,n.breakableFitAdvances;if("sum-graphemes"===i){const t=[];for(const n of s){const i=Mr(n,e);t.push(_r(n,i,r))}return n.breakableFitAdvances=t,n.breakableFitAdvances}if("pair-context"===i||s.length>96){const t=[];let i=null,o=0;for(const n of s){const s=_r(n,Mr(n,e),r);if(null===i)t.push(s);else{const s=i+n,u=Mr(s,e);t.push(_r(s,u,r)-o)}i=n,o=s}return n.breakableFitAdvances=t,n.breakableFitAdvances}const u=[];let a="",l=0;for(const t of s){a+=t;const n=_r(a,Mr(a,e),r);u.push(n-l),l=n}return n.breakableFitAdvances=u,n.breakableFitAdvances}(t,a,o,s,r);return void M(t,l,c,f,n,e,u)}M(t,l,c,f,n,e,null)}for(let n=0;n<t.len;n++){m[n]=c.length;const e=t.texts[n],r=t.isWordLike[n],s=t.kinds[n],u=t.starts[n];if("soft-hyphen"===s){M(e,0,a,a,s,u,null);continue}if("hard-break"===s){M(e,0,0,0,s,u,null);continue}if("tab"===s){M(e,0,0,0,s,u,null);continue}const l=Mr(e,o);if("text"===s&&l.containsCJK){const t=Cr(e,i);for(let n=0;n<t.length;n++){const e=t[n];y(e.text,"text",u+e.start,r,!_e(e.text))}continue}y(e,s,u,r,!0)}const v=function(t,n,e){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.startSegmentIndex<n.length?n[o.startSegmentIndex]:e,u=o.endSegmentIndex<n.length?n[o.endSegmentIndex]:e,a=o.consumedEndSegmentIndex<n.length?n[o.consumedEndSegmentIndex]:e;r.push({startSegmentIndex:s,endSegmentIndex:u,consumedEndSegmentIndex:a})}return r}(t.chunks,m,c.length),w=null===p?null:pe(t.normalized,p);return null!==S?{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:h,kinds:N,simpleLineWalkFastPath:d,segLevels:w,breakableFitAdvances:g,discretionaryHyphenWidth:a,tabStopAdvance:l,chunks:v,segments:S}:{widths:c,lineEndFitAdvances:f,lineEndPaintAdvances:h,kinds:N,simpleLineWalkFastPath:d,segLevels:w,breakableFitAdvances:g,discretionaryHyphenWidth:a,tabStopAdvance:l,chunks:v}}
181
208
  // Rich variant used by callers that need enough information to render the
182
209
  // laid-out lines themselves.
183
- function kr(t,n,e){return function(t,n,e,r){return br(tr(t,cr(),r?.whiteSpace),n,e)}(t,n,!0,e)}function Sr(t,n,e){let r=e.get(t);if(void 0!==r)return r;r=[];const i=Nr();for(const e of i.segment(n[t]))r.push(e.segment);return e.set(t,r),r}function Er(t,n,e,r,i,o,s){let u="";const a=function(t,n,e,r){return r>0&&"soft-hyphen"===t[r-1]&&!(n===r&&e>0)}(n,r,i,o);for(let s=r;s<o;s++)"soft-hyphen"!==n[s]&&"hard-break"!==n[s]&&(u+=s===r&&i>0?Sr(s,t,e).slice(i).join(""):t[s]);return s>0?(a&&(u+="-"),u+=Sr(o,t,e).slice(r===o?i:0,s).join("")):a&&(u+="-"),u}function Or(t,n,e){return function(t,n,e,r,i,o,s){return{text:Er(t.segments,t.kinds,n,r,i,o,s),width:e,start:{segmentIndex:r,graphemeIndex:i},end:{segmentIndex:o,graphemeIndex:s}}}(t,n,e.width,e.startSegmentIndex,e.startGraphemeIndex,e.endSegmentIndex,e.endGraphemeIndex)}
210
+ function $r(t,n,e){return function(t,n,e,r){return Rr(cr(t,yr(),r?.whiteSpace,"normal"),n,e)}(t,n,!0,e)}function Ir(t,n,e){let r=e.get(t);if(void 0!==r)return r;r=[];const i=Br();for(const e of i.segment(n[t]))r.push(e.segment);return e.set(t,r),r}function Fr(t,n,e,r,i,o,s){let u="";const a=function(t,n,e,r){return r>0&&"soft-hyphen"===t[r-1]&&!(n===r&&e>0)}(n,r,i,o);for(let s=r;s<o;s++)"soft-hyphen"!==n[s]&&"hard-break"!==n[s]&&(u+=s===r&&i>0?Ir(s,t,e).slice(i).join(""):t[s]);return s>0?(a&&(u+="-"),u+=Ir(o,t,e).slice(r===o?i:0,s).join("")):a&&(u+="-"),u}function Wr(t,n,e){return function(t,n,e,r,i,o,s){return{text:Fr(t.segments,t.kinds,n,r,i,o,s),width:e,start:{segmentIndex:r,graphemeIndex:i},end:{segmentIndex:o,graphemeIndex:s}}}(t,n,e.width,e.startSegmentIndex,e.startGraphemeIndex,e.endSegmentIndex,e.endGraphemeIndex)}
184
211
  // Rich layout API for callers that want the actual line contents and widths.
185
212
  // Caller still supplies lineHeight at layout time. Mirrors layout()'s break
186
213
  // decisions, but keeps extra per-line bookkeeping so it should stay off the
187
214
  // resize hot path.
188
- function Mr(t,n,e){const r=[];if(0===t.widths.length)return{lineCount:0,height:0,lines:r};const i=function(t){let n=_r.get(t);return void 0!==n||(n=new Map,_r.set(t,n)),n}(t),o=function(t,n,e){if(t.simpleLineWalkFastPath)return Ar(t,n,e);const{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:s,breakableWidths:u,breakablePrefixWidths:a,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:f}=t;if(0===r.length||0===f.length)return 0;const h=cr(),d=h.lineFitEpsilon;let p=0,g=0,m=!1,y=0,L=0,w=0,v=0,A=-1,x=0,_=0,N=null;function b(){A=-1,x=0,_=0,N=null}function k(t=w,n=v,r=g){p++,e?.({startSegmentIndex:y,startGraphemeIndex:L,endSegmentIndex:t,endGraphemeIndex:n,width:r}),g=0,m=!1,b()}function S(t,n){m=!0,y=t,L=0,w=t+1,v=0,g=n}function E(t,n,e){m=!0,y=t,L=n,w=t,v=n+1,g=e}function O(t,n){m?(g+=n,w=t+1,v=0):S(t,n)}function M(t,n){if(!Lr(s[t]))return;const e="tab"===s[t]?0:i[t],r="tab"===s[t]?n:o[t];A=t+1,x=g-n+e,_=g-n+r,N=s[t]}function B(t){C(t,0)}function C(t,e){const r=u[t],i=a[t]??null;for(let o=e;o<r.length;o++){const e=vr(r,i,o,h.preferPrefixWidthsForBreakableRuns);m?g+e>n+d?(k(),E(t,o,e)):(g+=e,w=t,v=o+1):E(t,o,e)}m&&w===t&&v===r.length&&(w=t+1,v=0)}function W(t){if("soft-hyphen"!==N)return!1;const e=u[t];if(null===e)return!1;const r=h.preferPrefixWidthsForBreakableRuns?a[t]??e:e,i=r!==e,{fitCount:o,fittedWidth:s}=function(t,n,e,r,i,o){let s=0,u=n;for(;s<t.length;){const a=o?n+t[s]:u+t[s];if((s+1<t.length?a+i:a)>e+r)break;u=a,s++}return{fitCount:s,fittedWidth:u}}(r,g,n,d,l,i);return 0!==o&&(g=s,w=t,v=o,b(),o===e.length?(w=t+1,v=0,!0):(k(t,o,s+l),C(t,o),!0))}function $(t){p++,e?.({startSegmentIndex:t.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:t.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),b()}for(let t=0;t<f.length;t++){const e=f[t];if(e.startSegmentIndex===e.endSegmentIndex){$(e);continue}m=!1,g=0,y=e.startSegmentIndex,L=0,w=e.startSegmentIndex,v=0,b();let a=e.startSegmentIndex;for(;a<e.endSegmentIndex;){const t=s[a],e="tab"===t?wr(g,c):r[a];if("soft-hyphen"!==t)if(m){if(g+e>n+d){const r=g+("tab"===t?0:i[a]),s=g+("tab"===t?e:o[a]);if("soft-hyphen"===N&&h.preferEarlySoftHyphenBreak&&x<=n+d){k(A,0,_);continue}if("soft-hyphen"===N&&W(a)){a++;continue}if(Lr(t)&&r<=n+d){O(a,e),k(a+1,0,s),a++;continue}if(A>=0&&x<=n+d){k(A,0,_);continue}if(e>n&&null!==u[a]){k(),B(a),a++;continue}k();continue}O(a,e),M(a,e),a++}else e>n&&null!==u[a]?B(a):S(a,e),M(a,e),a++;else m&&(w=a+1,v=0,A=a+1,x=g+l,_=g+l,N=t),a++}if(m){const t=A===e.consumedEndSegmentIndex?_:g;k(e.consumedEndSegmentIndex,0,t)}}return p}(t,n,n=>{r.push(Or(t,i,n))});return{lineCount:o,height:o*e,lines:r}}
215
+ function Tr(t,n,e){const r=[];if(0===t.widths.length)return{lineCount:0,height:0,lines:r};const i=function(t){let n=Er.get(t);return void 0!==n||(n=new Map,Er.set(t,n)),n}(t),o=function(t,n,e){if(t.simpleLineWalkFastPath)return kr(t,n,e);const{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:s,breakableFitAdvances:u,discretionaryHyphenWidth:a,tabStopAdvance:l,chunks:c}=t;if(0===r.length||0===c.length)return 0;const f=yr(),h=f.lineFitEpsilon,N=n+h;let d=0,p=0,g=!1,S=0,m=0,M=0,y=0,v=-1,w=0,x=0,_=null;function O(){v=-1,w=0,x=0,_=null}function b(t=M,n=y,r=p){d++,e?.({startSegmentIndex:S,startGraphemeIndex:m,endSegmentIndex:t,endGraphemeIndex:n,width:r}),p=0,g=!1,O()}function L(t,n){g=!0,S=t,m=0,M=t+1,y=0,p=n}function k(t,n,e){g=!0,S=t,m=n,M=t,y=n+1,p=e}function A(t,n){g?(p+=n,M=t+1,y=0):L(t,n)}function E(t,n,e,r){if(!n)return;const s="tab"===t?0:i[e],u="tab"===t?r:o[e];v=e+1,w=p-r+s,x=p-r+u,_=t}function B(t,n){const e=u[t];for(let r=n;r<e.length;r++){const n=e[r];g?p+n>N?(b(),k(t,r,n)):(p+=n,M=t,y=r+1):k(t,r,n)}g&&M===t&&y===e.length&&(M=t+1,y=0)}function C(t){if("soft-hyphen"!==_)return!1;const e=u[t];if(null==e)return!1;const{fitCount:r,fittedWidth:i}=function(t,n,e,r,i){let o=0,s=n;for(;o<t.length;){const n=s+t[o];if((o+1<t.length?n+i:n)>e+r)break;s=n,o++}return{fitCount:o,fittedWidth:s}}(e,p,n,h,a);return 0!==r&&(p=i,M=t,y=r,O(),r===e.length?(M=t+1,y=0,!0):(b(t,r,i+a),B(t,r),!0))}function R(t){d++,e?.({startSegmentIndex:t.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:t.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),O()}for(let t=0;t<c.length;t++){const e=c[t];if(e.startSegmentIndex===e.endSegmentIndex){R(e);continue}g=!1,p=0,S=e.startSegmentIndex,m=0,M=e.startSegmentIndex,y=0,O();let h=e.startSegmentIndex;for(;h<e.endSegmentIndex;){const t=s[h],e="space"===t||"preserved-space"===t||"tab"===t||"zero-width-break"===t||"soft-hyphen"===t,c="tab"===t?Lr(p,l):r[h];if("soft-hyphen"!==t)if(g){if(p+c>N){const r=p+("tab"===t?0:i[h]),s=p+("tab"===t?c:o[h]);if("soft-hyphen"===_&&f.preferEarlySoftHyphenBreak&&w<=N){b(v,0,x);continue}if("soft-hyphen"===_&&C(h)){h++;continue}if(e&&r<=N){A(h,c),b(h+1,0,s),h++;continue}if(v>=0&&w<=N){if(M>v||M===v&&y>0){b();continue}const t=v;b(t,0,x),h=t;continue}if(c>n&&null!==u[h]){b(),B(h,0),h++;continue}b();continue}A(h,c),E(t,e,h,c),h++}else c>n&&null!==u[h]?B(h,0):L(h,c),E(t,e,h,c),h++;else g&&(M=h+1,y=0,v=h+1,w=p+a,x=p+a,_=t),h++}if(g){const t=v===e.consumedEndSegmentIndex?x:p;b(e.consumedEndSegmentIndex,0,t)}}return d}(t,n,n=>{r.push(Wr(t,i,n))});return{lineCount:o,height:o*e,lines:r}}
189
216
  /**
190
217
  * Strips HTML and "un-escapes" escape characters.
191
218
  * @param {String} input
192
- */function Br(t){if(""===t.replace(/\s+/g,""))return t;const n=(new DOMParser).parseFromString(t.replace(/<[^>]+>/g,""),"text/html");return n.documentElement?n.documentElement.textContent:t}
219
+ */function zr(t){if(""===t.replace(/\s+/g,""))return t;const n=(new DOMParser).parseFromString(t.replace(/<[^>]+>/g,""),"text/html");return n.documentElement?n.documentElement.textContent:t}
193
220
  /**
194
221
  * Builds a CSS font shorthand string from a style object.
195
222
  * @param {Object} styleObj
@@ -199,7 +226,7 @@ function Mr(t,n,e){const r=[];if(0===t.widths.length)return{lineCount:0,height:0
199
226
  * @param {String} text
200
227
  * @param {String} font CSS font shorthand
201
228
  */
202
- function Cr(t,n){if(!t)return 0;const e=Mr(kr(t,n),1/0,20);return e.lines.length?e.lines[0].width:0}function Wr(t,n={}){const e=`${(r=n)["font-style"]||"normal"} ${r["font-variant"]||"normal"} ${r["font-weight"]||400} ${"string"==typeof r["font-size"]?r["font-size"]:`${r["font-size"]||10}px`} ${r["font-family"]||"sans-serif"}`;var r;return t instanceof Array?t.map(t=>Cr(Br(t),e)):Cr(Br(t),e)}const $r="abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",Ir={};let Pr,Fr,Rr,Tr;
229
+ function Pr(t,n){if(!t)return 0;const e=Tr($r(t,n),1/0,20);return e.lines.length?e.lines[0].width:0}function jr(t,n={}){const e=`${(r=n)["font-style"]||"normal"} ${r["font-variant"]||"normal"} ${r["font-weight"]||400} ${"string"==typeof r["font-size"]?r["font-size"]:`${r["font-size"]||10}px`} ${r["font-family"]||"sans-serif"}`;var r;return t instanceof Array?t.map(t=>Pr(zr(t),e)):Pr(zr(t),e)}const Hr="abcdefghiABCDEFGHI_!@#$%^&*()_+1234567890",qr={};let Dr,Xr,Yr,Gr;
203
230
  /**
204
231
  Given either a single font-family or a list of fonts, returns the name of the first font that can be rendered, or `false` if none are installed on the user's machine.
205
232
  @param font Can be either a valid CSS font-family string (single or comma-separated names) or an Array of string names.
@@ -208,7 +235,7 @@ function Cr(t,n){if(!t)return 0;const e=Mr(kr(t,n),1/0,20);return e.lines.length
208
235
  Given an HTMLElement and a "width" or "height" string, this function returns the current calculated size for the DOM element.
209
236
  @private
210
237
  */
211
- function zr(t,n){if(t){if(void 0===t.tagName||["BODY","HTML"].indexOf(t.tagName)>=0){let e=window[`inner${n.charAt(0).toUpperCase()+n.slice(1)}`];const r=gt(t);return"width"===n?(e-=parseFloat(r.style("margin-left")),e-=parseFloat(r.style("margin-right")),e-=parseFloat(r.style("padding-left")),e-=parseFloat(r.style("padding-right"))):(e-=parseFloat(r.style("margin-top")),e-=parseFloat(r.style("margin-bottom")),e-=parseFloat(r.style("padding-top")),e-=parseFloat(r.style("padding-bottom"))),e}{let e=t.getBoundingClientRect()[n];return"number"==typeof e&&e>0?("height"===n?(e-=parseFloat(gt(t).style("padding-top")),e-=parseFloat(gt(t).style("padding-bottom")),e-=parseFloat(gt(t).style("border-top")),e-=parseFloat(gt(t).style("border-bottom"))):(e-=parseFloat(gt(t).style("padding-left")),e-=parseFloat(gt(t).style("padding-right")),e-=parseFloat(gt(t).style("border-left")),e-=parseFloat(gt(t).style("border-right"))),e):zr(t.parentNode,n)}}}
238
+ function Vr(t,n){if(t){if(void 0===t.tagName||["BODY","HTML"].indexOf(t.tagName)>=0){let e=window[`inner${n.charAt(0).toUpperCase()+n.slice(1)}`];const r=pt(t);return"width"===n?(e-=parseFloat(r.style("margin-left")),e-=parseFloat(r.style("margin-right")),e-=parseFloat(r.style("padding-left")),e-=parseFloat(r.style("padding-right"))):(e-=parseFloat(r.style("margin-top")),e-=parseFloat(r.style("margin-bottom")),e-=parseFloat(r.style("padding-top")),e-=parseFloat(r.style("padding-bottom"))),e}{let e=t.getBoundingClientRect()[n];return"number"==typeof e&&e>0?("height"===n?(e-=parseFloat(pt(t).style("padding-top")),e-=parseFloat(pt(t).style("padding-bottom")),e-=parseFloat(pt(t).style("border-top")),e-=parseFloat(pt(t).style("border-bottom"))):(e-=parseFloat(pt(t).style("padding-left")),e-=parseFloat(pt(t).style("padding-right")),e-=parseFloat(pt(t).style("border-left")),e-=parseFloat(pt(t).style("border-right"))),e):Vr(t.parentNode,n)}}}
212
239
  /**
213
240
  Finds the available width and height for a specified HTMLElement, traversing it's parents until it finds something with constrained dimensions. Falls back to the inner dimensions of the browser window if none is found.
214
241
  @private
@@ -250,7 +277,7 @@ if(!(n.includes("/")||n.includes(" ")||n.includes("-")&&n.indexOf("-"))){const e
250
277
  */
251
278
  function(t,n){
252
279
  // overrides default params
253
- const r=Object.assign({},{condition:!0,enter:{},exit:{},duration:0,parent:gt("body"),update:{}},n),i=/\.([^#]+)/g.exec(t),o=/#([^.]+)/g.exec(t),s=ue().duration(r.duration),u=/^([^.^#]+)/g.exec(t)[1],a=r.parent.selectAll(t.includes(":")?t.split(":")[1]:t).data(r.condition?[null]:[]),l=a.enter().append(u).call(e,r.enter);o&&l.attr("id",o[1]),i&&l.attr("class",i[1]),r.duration?a.exit().transition(s).call(e,r.exit).remove():a.exit().call(e,r.exit).remove();const c=l.merge(a);return r.duration?c.transition(s).call(e,r.update):c.call(e,r.update),c},t.fontExists=t=>{Pr||(Pr=Wr($r,{"font-family":"DejaVuSans","font-size":32}),Fr=Wr($r,{"font-family":"-apple-system","font-size":32}),Rr=Wr($r,{"font-family":"monospace","font-size":32}),Tr=Wr($r,{"font-family":"sans-serif","font-size":32})),t instanceof Array||(t=t.split(",")),t=t.map(t=>t.trim());for(let n=0;n<t.length;n++){const e=t[n];if(Ir[e]||["-apple-system","monospace","sans-serif","DejaVuSans"].includes(e))return e;if(!1===Ir[e])continue;const r=Wr($r,{"font-family":e,"font-size":32});if(Ir[e]=r!==Rr,Ir[e]&&(Ir[e]=r!==Tr),Fr&&Ir[e]&&(Ir[e]=r!==Fr),Pr&&Ir[e]&&(Ir[e]=r!==Pr),Ir[e])return e}return!1},t.getSize=function(t){return[zr(t,"width"),zr(t,"height")]}
280
+ const r=Object.assign({},{condition:!0,enter:{},exit:{},duration:0,parent:pt("body"),update:{}},n),i=/\.([^#]+)/g.exec(t),o=/#([^.]+)/g.exec(t),s=ue().duration(r.duration),u=/^([^.^#]+)/g.exec(t)[1],a=r.parent.selectAll(t.includes(":")?t.split(":")[1]:t).data(r.condition?[null]:[]),l=a.enter().append(u).call(e,r.enter);o&&l.attr("id",o[1]),i&&l.attr("class",i[1]),r.duration?a.exit().transition(s).call(e,r.exit).remove():a.exit().call(e,r.exit).remove();const c=l.merge(a);return r.duration?c.transition(s).call(e,r.update):c.call(e,r.update),c},t.fontExists=t=>{Dr||(Dr=jr(Hr,{"font-family":"DejaVuSans","font-size":32}),Xr=jr(Hr,{"font-family":"-apple-system","font-size":32}),Yr=jr(Hr,{"font-family":"monospace","font-size":32}),Gr=jr(Hr,{"font-family":"sans-serif","font-size":32})),t instanceof Array||(t=t.split(",")),t=t.map(t=>t.trim());for(let n=0;n<t.length;n++){const e=t[n];if(qr[e]||["-apple-system","monospace","sans-serif","DejaVuSans"].includes(e))return e;if(!1===qr[e])continue;const r=jr(Hr,{"font-family":e,"font-size":32});if(qr[e]=r!==Yr,qr[e]&&(qr[e]=r!==Gr),Xr&&qr[e]&&(qr[e]=r!==Xr),Dr&&qr[e]&&(qr[e]=r!==Dr),qr[e])return e}return!1},t.getSize=function(t){return[Vr(t,"width"),Vr(t,"height")]}
254
281
  /**
255
282
  Determines whether a given DOM element is visible within the current viewport, with an optional pixel buffer.
256
283
  @param elem The DOM element to check.
@@ -267,5 +294,5 @@ const r=Object.assign({},{condition:!0,enter:{},exit:{},duration:0,parent:gt("bo
267
294
  Applies each key/value in an object as a style.
268
295
  @param e The d3 selection to apply styles to.
269
296
  @param s An object of key/value style pairs.
270
- */,t.stylize=function(t,n={}){for(const e in n)({}).hasOwnProperty.call(n,e)&&t.style(e,n[e])},t.textWidth=Wr});
297
+ */,t.stylize=function(t,n={}){for(const e in n)({}).hasOwnProperty.call(n,e)&&t.style(e,n[e])},t.textWidth=jr});
271
298
  //# sourceMappingURL=d3plus-dom.full.js.map