courthive-components 1.0.3 → 1.0.4
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.
|
@@ -9634,7 +9634,7 @@ var ou = [
|
|
|
9634
9634
|
return lu.call(e, Lu) === !1 ? !1 : Au(t, e);
|
|
9635
9635
|
};
|
|
9636
9636
|
//#endregion
|
|
9637
|
-
//#region node_modules/.pnpm/focus-trap@8.0
|
|
9637
|
+
//#region node_modules/.pnpm/focus-trap@8.1.0/node_modules/focus-trap/dist/focus-trap.esm.js
|
|
9638
9638
|
function zu(e, t) {
|
|
9639
9639
|
(t == null || t > e.length) && (t = e.length);
|
|
9640
9640
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
@@ -10164,13 +10164,13 @@ var td = {
|
|
|
10164
10164
|
(p = l._setSubtreeIsolation) == null || p.call(l, !1), u = !0;
|
|
10165
10165
|
}
|
|
10166
10166
|
try {
|
|
10167
|
-
c || d(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = f(n), t?.();
|
|
10167
|
+
c || d(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = f(n), t?.({ trap: o });
|
|
10168
10168
|
var m = /* @__PURE__ */ function() {
|
|
10169
10169
|
var e = Hu(/* @__PURE__ */ Yu().m(function e() {
|
|
10170
10170
|
return Yu().w(function(e) {
|
|
10171
10171
|
for (;;) switch (e.n) {
|
|
10172
10172
|
case 0: return c && d(), e.n = 1, S();
|
|
10173
|
-
case 1: o._setSubtreeIsolation(!0), E(), i?.();
|
|
10173
|
+
case 1: o._setSubtreeIsolation(!0), E(), i?.({ trap: o });
|
|
10174
10174
|
case 2: return e.a(2);
|
|
10175
10175
|
}
|
|
10176
10176
|
}, e);
|
|
@@ -10199,10 +10199,10 @@ var td = {
|
|
|
10199
10199
|
}, e);
|
|
10200
10200
|
clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || o._setSubtreeIsolation(!1), a.alreadySilent.clear(), w(), a.active = !1, a.paused = !1, E(), td.deactivateTrap(r, o);
|
|
10201
10201
|
var n = s(t, "onDeactivate"), c = s(t, "onPostDeactivate"), l = s(t, "checkCanReturnFocus"), u = s(t, "returnFocus", "returnFocusOnDeactivate");
|
|
10202
|
-
n?.();
|
|
10202
|
+
n?.({ trap: o });
|
|
10203
10203
|
var d = function() {
|
|
10204
10204
|
sd(function() {
|
|
10205
|
-
u && p(m(a.nodeFocusedBeforeActivation)), c?.();
|
|
10205
|
+
u && p(m(a.nodeFocusedBeforeActivation)), c?.({ trap: o });
|
|
10206
10206
|
});
|
|
10207
10207
|
};
|
|
10208
10208
|
return u && l ? (l(m(a.nodeFocusedBeforeActivation)).then(d, d), this) : (d(), this);
|
|
@@ -10226,15 +10226,15 @@ var td = {
|
|
|
10226
10226
|
if (a.paused === e) return this;
|
|
10227
10227
|
if (a.paused = e, e) {
|
|
10228
10228
|
var n = s(t, "onPause"), r = s(t, "onPostPause");
|
|
10229
|
-
n?.(), w(), o._setSubtreeIsolation(!1), E(), r?.();
|
|
10229
|
+
n?.({ trap: o }), w(), o._setSubtreeIsolation(!1), E(), r?.({ trap: o });
|
|
10230
10230
|
} else {
|
|
10231
10231
|
var i = s(t, "onUnpause"), c = s(t, "onPostUnpause");
|
|
10232
|
-
i?.(), (/* @__PURE__ */ (function() {
|
|
10232
|
+
i?.({ trap: o }), (/* @__PURE__ */ (function() {
|
|
10233
10233
|
var e = Hu(/* @__PURE__ */ Yu().m(function e() {
|
|
10234
10234
|
return Yu().w(function(e) {
|
|
10235
10235
|
for (;;) switch (e.n) {
|
|
10236
10236
|
case 0: return d(), e.n = 1, S();
|
|
10237
|
-
case 1: o._setSubtreeIsolation(!0), E(), c?.();
|
|
10237
|
+
case 1: o._setSubtreeIsolation(!0), E(), c?.({ trap: o });
|
|
10238
10238
|
case 2: return e.a(2);
|
|
10239
10239
|
}
|
|
10240
10240
|
}, e);
|
|
@@ -12707,7 +12707,7 @@ function dh(e) {
|
|
|
12707
12707
|
}
|
|
12708
12708
|
var fh = {
|
|
12709
12709
|
name: "courthive-components",
|
|
12710
|
-
version: "1.0.
|
|
12710
|
+
version: "1.0.4",
|
|
12711
12711
|
engines: { node: ">=20.19.0 < 25" },
|
|
12712
12712
|
description: "Components for competitions projects",
|
|
12713
12713
|
files: ["dist"],
|
|
@@ -12808,7 +12808,7 @@ var fh = {
|
|
|
12808
12808
|
"focus-trap": "^8.0.0",
|
|
12809
12809
|
"timepicker-ui": "^4.1.2",
|
|
12810
12810
|
"tippy.js": "6.3.7",
|
|
12811
|
-
"tods-competition-factory": "^3.1.
|
|
12811
|
+
"tods-competition-factory": "^3.1.3",
|
|
12812
12812
|
"vanillajs-datepicker": "1.3.4"
|
|
12813
12813
|
}
|
|
12814
12814
|
};
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
<strong>Undo/Redo/Clear</strong> buttons control scoring history.
|
|
175
175
|
`},p=()=>Ul.map(e=>({label:Hl[e],active:e===a,onClick:()=>_(e)})),m=()=>({info:f[a],menu:{menuItems:p()}}),h=()=>{setTimeout(()=>{let e=document.getElementById(`clearScoreV2`);e&&(e.style.backgroundColor=`var(--chc-clear-btn-bg)`,e.style.color=`var(--chc-clear-btn-text)`,o&&(e.disabled=!1)),s&&l(s)},0)},g,_=e=>{e!==a&&(u(),s=null,c=!1,a=e,ts({scoringApproach:e}),g&&(g.update({content:d(e),config:m()}),h()))};g=F.open({title:i.title||`Score Entry`,content:d(a),config:m(),buttons:[{onClick:()=>{u()},label:i.cancel||`Cancel`,intent:`none`,footer:{className:`button`,style:`background-color: var(--chc-bg-primary); color: var(--chc-text-primary); border: 1px solid var(--chc-border-primary);`},close:!0},{id:`clearScoreV2`,label:i.clear||`Clear`,intent:`none`,disabled:!0,close:!1,onClick:()=>{if(c=!0,a===`freeScore`){let e=document.getElementById(`scoreInputV2`);e&&(e.value=``,e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())}else a===`dynamicSets`&&window.resetDynamicSets?window.resetDynamicSets():a===`dialPad`&&window.resetDialPad?window.resetDialPad():a===`inlineScoring`&&window.resetInlineScoring&&window.resetInlineScoring()}},{id:`submitScoreV2`,label:i.submit||`Submit Score`,intent:`is-primary`,disabled:a!==`inlineScoring`,onClick:()=>{s&&(a===`inlineScoring`||s.isValid||c&&o)&&(u(),n(s))},close:!0}],onClose:r?()=>r():void 0}),h()}var Gl=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],Kl=Gl.join(`,`),ql=typeof Element>`u`,Jl=ql?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Yl=!ql&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Xl=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Xl(e.parentNode))},Zl=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Ql=function(e,t,n){if(Xl(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Kl));return t&&Jl.call(e,Kl)&&r.unshift(e),r=r.filter(n),r},$l=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Xl(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=$l(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Jl.call(a,Kl)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Xl(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=$l(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},eu=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},tu=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Zl(e))&&!eu(e)?0:e.tabIndex},nu=function(e,t){var n=tu(e);return n<0&&t&&!eu(e)?0:n},ru=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},iu=function(e){return e.tagName===`INPUT`},au=function(e){return iu(e)&&e.type===`hidden`},ou=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},su=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},cu=function(e){if(!e.name)return!0;var t=e.form||Yl(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=su(r,e.form);return!i||i===e},lu=function(e){return iu(e)&&e.type===`radio`},uu=function(e){return lu(e)&&!cu(e)},du=function(e){var t=e&&Yl(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Yl(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},fu=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},pu=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Jl.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Jl.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Yl(e);if(o&&!o.shadowRoot&&r(o)===!0)return fu(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(du(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return fu(e);return!1},mu=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Jl.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},hu=function(e,t){return!(t.disabled||au(t)||pu(t,e)||ou(t)||mu(t))},gu=function(e,t){return!(uu(t)||tu(t)<0||!hu(e,t))},_u=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},vu=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=nu(a,i),s=i?vu(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ru).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},yu=function(e,t){return t||={},vu(t.getShadowRoot?$l([e],t.includeContainer,{filter:gu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:_u}):Ql(e,t.includeContainer,gu.bind(null,t)))},bu=function(e,t){return t||={},t.getShadowRoot?$l([e],t.includeContainer,{filter:hu.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ql(e,t.includeContainer,hu.bind(null,t))},xu=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Jl.call(e,Kl)===!1?!1:gu(t,e)},Su=Gl.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Cu=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Jl.call(e,Su)===!1?!1:hu(t,e)};function wu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tu(e){if(Array.isArray(e))return wu(e)}function Eu(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Du(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Eu(a,r,i,o,s,`next`,e)}function s(e){Eu(a,r,i,o,s,`throw`,e)}o(void 0)})}}function Ou(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=zu(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
176
176
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function ku(e,t,n){return(t=Ru(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Au(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ju(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
177
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mu(Object(n),!0).forEach(function(t){ku(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pu(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Fu(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Fu(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Fu(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,Fu(d,`constructor`,l),Fu(l,`constructor`,c),c.displayName=`GeneratorFunction`,Fu(l,i,`GeneratorFunction`),Fu(d),Fu(d,i,`Generator`),Fu(d,r,function(){return this}),Fu(d,`toString`,function(){return`[object Generator]`}),(Pu=function(){return{w:a,m:f}})()}function Fu(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Fu=function(e,t,n,r){function a(t,n){Fu(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},Fu(e,t,n,r)}function Iu(e){return Tu(e)||Au(e)||zu(e)||ju()}function Lu(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ru(e){var t=Lu(e,`string`);return typeof t==`symbol`?t:t+``}function zu(e,t){if(e){if(typeof e==`string`)return wu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wu(e,t):void 0}}var Bu={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==Bu.getActiveTrap(e)&&Bu.pauseTrap(e);var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),Bu.unpauseTrap(e)},pauseTrap:function(e){Bu.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=Bu.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},Vu=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},Hu=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},Uu=function(e){return e?.key===`Tab`||e?.keyCode===9},Wu=function(e){return Uu(e)&&!e.shiftKey},Gu=function(e){return Uu(e)&&e.shiftKey},Ku=function(e){return setTimeout(e,0)},qu=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return typeof e==`function`?e.apply(void 0,n):e},Ju=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Yu=[],Xu=function(e,t){var n=t?.document||document,r=t?.trapStack||Yu,i=Nu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Wu,isKeyBackward:Gu},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r===void 0?!1:r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,Iu(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!Cu(e,i.tabbableOptions))if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l(`fallbackFocus`)}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=yu(e,i.tabbableOptions),n=bu(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return xu(e)}),s=n.slice().reverse().find(function(e){return xu(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return tu(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return xu(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return xu(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)},f=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&t.shadowRoot.activeElement!==null?f(t.shadowRoot):t},p=function(e){if(e!==!1&&e!==f(document)){if(!e||!e.focus){p(u());return}e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,Vu(e)&&e.select()}},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||(t===!1?!1:e)},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r===void 0?!1:r;t||=Ju(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),f=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(f.container===t||Cu(t,i.tabbableOptions)&&!xu(t,i.tabbableOptions)&&!f.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=tu(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else Uu(n)||(s=f.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(f.container===t||Cu(t,i.tabbableOptions)&&!xu(t,i.tabbableOptions)&&!f.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=tu(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Uu(n)||(s=f.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){if(!(c(Ju(e),e)>=0)){if(qu(i.clickOutsideDeactivates,e)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}qu(i.allowOutsideClick,e)||e.preventDefault()}},_=function(e){var t=Ju(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,o=!0;if(a.mostRecentlyFocusedNode)if(tu(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return tu(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(Uu(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},b=function(e){Hu(e)&&qu(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},x=function(e){c(Ju(e),e)>=0||qu(i.clickOutsideDeactivates,e)||qu(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},S=function(){if(!a.active)return Promise.resolve();Bu.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Ku(function(){p(u()),e()})}):(e=Promise.resolve(),p(u())),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,x,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,b),e},C=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=Ou(e),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;t.add(s);for(var c=typeof ShadowRoot<`u`&&s.getRootNode()instanceof ShadowRoot,l=s;l;){t.add(l);var u=l.parentElement,d=[];u?d=u.children:!u&&c&&(d=l.getRootNode().children,u=l.getRootNode().host,c=typeof ShadowRoot<`u`&&u.getRootNode()instanceof ShadowRoot);var f=Ou(d),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;n.add(m)}}catch(e){f.e(e)}finally{f.f()}l=u}}}catch(e){r.e(e)}finally{r.f()}t.forEach(function(e){n.delete(e)}),a.adjacentElements=n},w=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,x,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,b),o},T=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})})&&p(u())}):void 0,E=function(){T&&(T.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){T.observe(e,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,`onActivate`),i=s(e,`onPostActivate`),c=s(e,`checkCanFocusTrap`),l=Bu.getActiveTrap(r),u=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),u=!0}try{c||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=f(n),t?.();var m=function(){var e=Du(Pu().m(function e(){return Pu().w(function(e){for(;;)switch(e.n){case 0:return c&&d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),i?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===Bu.getActiveTrap(r)&&u){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=Nu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||o._setSubtreeIsolation(!1),a.alreadySilent.clear(),w(),a.active=!1,a.paused=!1,E(),Bu.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();var d=function(){Ku(function(){u&&p(m(a.nodeFocusedBeforeActivation)),c?.()})};return u&&l?(l(m(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return!a.active||(a.manuallyPaused=!1,r[r.length-1]!==this)?this:this._setPausedState(!1,e)},updateContainerElements:function(e){return a.containers=[].concat(e).filter(Boolean).map(function(e){return typeof e==`string`?n.querySelector(e):e}),i.isolateSubtrees&&C(a.containers),a.active&&(d(),a.paused||o._setSubtreeIsolation(!0)),E(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,`onPause`),r=s(t,`onPostPause`);n?.(),w(),o._setSubtreeIsolation(!1),E(),r?.()}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.(),(function(){var e=Du(Pu().m(function e(){return Pu().w(function(e){for(;;)switch(e.n){case 0:return d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),c?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}})()()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){if(e)switch(i.isolateSubtrees){case`aria-hidden`:(t.ariaHidden===`true`||t.getAttribute(`aria-hidden`)?.toLowerCase()===`true`)&&a.alreadySilent.add(t),t.setAttribute(`aria-hidden`,`true`);break;default:(t.inert||t.hasAttribute(`inert`))&&a.alreadySilent.add(t),t.setAttribute(`inert`,!0);break}else if(!a.alreadySilent.has(t))switch(i.isolateSubtrees){case`aria-hidden`:t.removeAttribute(`aria-hidden`);break;default:t.removeAttribute(`inert`);break}})}}}),o.updateContainerElements(e),o},Zu=`left`,Qu=`right`,$u=`courthive-drawer`,ed=e=>typeof e==`function`,td=e=>{for(;e.firstChild;)e.firstChild.remove()};function nd(e,t){let n=t.parentNode;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}var rd=null,id=!1,ad=(e=$u)=>{if(rd)return rd;let t={selectorTrigger:`[data-drawer-trigger]`,selectorTarget:`[data-drawer-target]`,selectorClose:`[data-drawer-close]`,leftAlignment:`drawer--left`,visibleClass:`is-visible`,activeClass:`is-active`,speedClose:350,speedOpen:50},n={},r=!1,i,a,o,s=!1,c=e=>a=e,l=()=>{ed(a)&&(a?.(),a=void 0);let n=document.getElementById(e);n&&(n.classList.remove(t.visibleClass),document.documentElement.style.overflow=``,setTimeout(function(){i?(n.classList.add(t.visibleClass),document.documentElement.style.overflow=`hidden`,ed(i?.callback)&&i.callback()):(n.classList.remove(t.activeClass),r=!1),i=!1,o?.deactivate()},t.speedClose))},u=n=>{if(!e)return;let r=document.getElementById(e);r&&(r.classList.contains(t.leftAlignment)||r.classList.add(t.leftAlignment),g(r,!1,n))},d=n=>{let r=document.getElementById(e);r&&(r.classList.remove(t.leftAlignment),g(r,!1,n))},f=t=>{let n=document.getElementById(e)?.querySelector(`.drawer__title`);n&&(n.innerHTML=t)},p=t=>{let r=document.getElementById(e)?.querySelector(`.drawer__footer`);r&&(td(r),ed(t)?n.footer=t(r,l):r.innerHTML=t||``)},m=t=>{let r=document.getElementById(e)?.querySelector(`.drawer__content`);r&&(td(r),ed(t)?n.content=t(r,l):r.innerHTML=t)},h=t=>{let n=document.getElementById(e)?.querySelector(`.drawer__wrapper`);n&&(n.style.width=t)},g=(e,n,i)=>{r=!0,s=!0,e.classList.add(t.activeClass),document.documentElement.style.overflow=`hidden`,n&&(o=Xu(e),o.activate()),ed(i)&&i&&i(),setTimeout(function(){e.classList.add(t.visibleClass),setTimeout(()=>{s=!1},100)},t.speedOpen)};return id||=(document.addEventListener(`click`,function(t){if(!e||!r||s)return;let n=t.target,i=document.querySelector(`.drawer__wrapper`);if(!i)return;let a=n.classList.contains(`drawer__close`)||n.closest(`.drawer__close`)||`drawerClose`in n.dataset||n.closest(`[data-drawer-close]`);(!nd(i,n)||a)&&l()},!1),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&r&&l()},!1),!0),rd={settings:t,open:(t={})=>{let{title:n,content:a,side:o,width:s,footer:l,callback:_,onClose:v}=t;if(a&&m(a),v&&c(v),n&&f(n),s&&h(s),p(l),r)i={callback:_};else if(o){if(o===Qu)return d(_);if(o===Zu)return u(_)}else{let t=document.getElementById(e);t&&g(t,l,_)}},close:l,setTitle:f,setContent:m,setFooter:p,attributes:n},rd};function od(e=$u){if(document.getElementById(e))return;let t=`
|
|
177
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mu(Object(n),!0).forEach(function(t){ku(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pu(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Fu(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Fu(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Fu(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,Fu(d,`constructor`,l),Fu(l,`constructor`,c),c.displayName=`GeneratorFunction`,Fu(l,i,`GeneratorFunction`),Fu(d),Fu(d,i,`Generator`),Fu(d,r,function(){return this}),Fu(d,`toString`,function(){return`[object Generator]`}),(Pu=function(){return{w:a,m:f}})()}function Fu(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Fu=function(e,t,n,r){function a(t,n){Fu(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},Fu(e,t,n,r)}function Iu(e){return Tu(e)||Au(e)||zu(e)||ju()}function Lu(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ru(e){var t=Lu(e,`string`);return typeof t==`symbol`?t:t+``}function zu(e,t){if(e){if(typeof e==`string`)return wu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wu(e,t):void 0}}var Bu={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==Bu.getActiveTrap(e)&&Bu.pauseTrap(e);var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),Bu.unpauseTrap(e)},pauseTrap:function(e){Bu.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=Bu.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},Vu=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},Hu=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},Uu=function(e){return e?.key===`Tab`||e?.keyCode===9},Wu=function(e){return Uu(e)&&!e.shiftKey},Gu=function(e){return Uu(e)&&e.shiftKey},Ku=function(e){return setTimeout(e,0)},qu=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return typeof e==`function`?e.apply(void 0,n):e},Ju=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Yu=[],Xu=function(e,t){var n=t?.document||document,r=t?.trapStack||Yu,i=Nu({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Wu,isKeyBackward:Gu},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r===void 0?!1:r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,Iu(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!Cu(e,i.tabbableOptions))if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l(`fallbackFocus`)}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=yu(e,i.tabbableOptions),n=bu(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return xu(e)}),s=n.slice().reverse().find(function(e){return xu(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return tu(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return xu(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return xu(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)},f=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&t.shadowRoot.activeElement!==null?f(t.shadowRoot):t},p=function(e){if(e!==!1&&e!==f(document)){if(!e||!e.focus){p(u());return}e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,Vu(e)&&e.select()}},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||(t===!1?!1:e)},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r===void 0?!1:r;t||=Ju(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),f=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(f.container===t||Cu(t,i.tabbableOptions)&&!xu(t,i.tabbableOptions)&&!f.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=tu(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else Uu(n)||(s=f.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(f.container===t||Cu(t,i.tabbableOptions)&&!xu(t,i.tabbableOptions)&&!f.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=tu(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Uu(n)||(s=f.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){if(!(c(Ju(e),e)>=0)){if(qu(i.clickOutsideDeactivates,e)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}qu(i.allowOutsideClick,e)||e.preventDefault()}},_=function(e){var t=Ju(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,o=!0;if(a.mostRecentlyFocusedNode)if(tu(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return tu(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(Uu(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},b=function(e){Hu(e)&&qu(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},x=function(e){c(Ju(e),e)>=0||qu(i.clickOutsideDeactivates,e)||qu(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},S=function(){if(!a.active)return Promise.resolve();Bu.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Ku(function(){p(u()),e()})}):(e=Promise.resolve(),p(u())),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,x,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,b),e},C=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=Ou(e),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;t.add(s);for(var c=typeof ShadowRoot<`u`&&s.getRootNode()instanceof ShadowRoot,l=s;l;){t.add(l);var u=l.parentElement,d=[];u?d=u.children:!u&&c&&(d=l.getRootNode().children,u=l.getRootNode().host,c=typeof ShadowRoot<`u`&&u.getRootNode()instanceof ShadowRoot);var f=Ou(d),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;n.add(m)}}catch(e){f.e(e)}finally{f.f()}l=u}}}catch(e){r.e(e)}finally{r.f()}t.forEach(function(e){n.delete(e)}),a.adjacentElements=n},w=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,x,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,b),o},T=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})})&&p(u())}):void 0,E=function(){T&&(T.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){T.observe(e,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,`onActivate`),i=s(e,`onPostActivate`),c=s(e,`checkCanFocusTrap`),l=Bu.getActiveTrap(r),u=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),u=!0}try{c||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=f(n),t?.({trap:o});var m=function(){var e=Du(Pu().m(function e(){return Pu().w(function(e){for(;;)switch(e.n){case 0:return c&&d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),i?.({trap:o});case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===Bu.getActiveTrap(r)&&u){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=Nu({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||o._setSubtreeIsolation(!1),a.alreadySilent.clear(),w(),a.active=!1,a.paused=!1,E(),Bu.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.({trap:o});var d=function(){Ku(function(){u&&p(m(a.nodeFocusedBeforeActivation)),c?.({trap:o})})};return u&&l?(l(m(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return!a.active||(a.manuallyPaused=!1,r[r.length-1]!==this)?this:this._setPausedState(!1,e)},updateContainerElements:function(e){return a.containers=[].concat(e).filter(Boolean).map(function(e){return typeof e==`string`?n.querySelector(e):e}),i.isolateSubtrees&&C(a.containers),a.active&&(d(),a.paused||o._setSubtreeIsolation(!0)),E(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,`onPause`),r=s(t,`onPostPause`);n?.({trap:o}),w(),o._setSubtreeIsolation(!1),E(),r?.({trap:o})}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.({trap:o}),(function(){var e=Du(Pu().m(function e(){return Pu().w(function(e){for(;;)switch(e.n){case 0:return d(),e.n=1,S();case 1:o._setSubtreeIsolation(!0),E(),c?.({trap:o});case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}})()()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){if(e)switch(i.isolateSubtrees){case`aria-hidden`:(t.ariaHidden===`true`||t.getAttribute(`aria-hidden`)?.toLowerCase()===`true`)&&a.alreadySilent.add(t),t.setAttribute(`aria-hidden`,`true`);break;default:(t.inert||t.hasAttribute(`inert`))&&a.alreadySilent.add(t),t.setAttribute(`inert`,!0);break}else if(!a.alreadySilent.has(t))switch(i.isolateSubtrees){case`aria-hidden`:t.removeAttribute(`aria-hidden`);break;default:t.removeAttribute(`inert`);break}})}}}),o.updateContainerElements(e),o},Zu=`left`,Qu=`right`,$u=`courthive-drawer`,ed=e=>typeof e==`function`,td=e=>{for(;e.firstChild;)e.firstChild.remove()};function nd(e,t){let n=t.parentNode;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}var rd=null,id=!1,ad=(e=$u)=>{if(rd)return rd;let t={selectorTrigger:`[data-drawer-trigger]`,selectorTarget:`[data-drawer-target]`,selectorClose:`[data-drawer-close]`,leftAlignment:`drawer--left`,visibleClass:`is-visible`,activeClass:`is-active`,speedClose:350,speedOpen:50},n={},r=!1,i,a,o,s=!1,c=e=>a=e,l=()=>{ed(a)&&(a?.(),a=void 0);let n=document.getElementById(e);n&&(n.classList.remove(t.visibleClass),document.documentElement.style.overflow=``,setTimeout(function(){i?(n.classList.add(t.visibleClass),document.documentElement.style.overflow=`hidden`,ed(i?.callback)&&i.callback()):(n.classList.remove(t.activeClass),r=!1),i=!1,o?.deactivate()},t.speedClose))},u=n=>{if(!e)return;let r=document.getElementById(e);r&&(r.classList.contains(t.leftAlignment)||r.classList.add(t.leftAlignment),g(r,!1,n))},d=n=>{let r=document.getElementById(e);r&&(r.classList.remove(t.leftAlignment),g(r,!1,n))},f=t=>{let n=document.getElementById(e)?.querySelector(`.drawer__title`);n&&(n.innerHTML=t)},p=t=>{let r=document.getElementById(e)?.querySelector(`.drawer__footer`);r&&(td(r),ed(t)?n.footer=t(r,l):r.innerHTML=t||``)},m=t=>{let r=document.getElementById(e)?.querySelector(`.drawer__content`);r&&(td(r),ed(t)?n.content=t(r,l):r.innerHTML=t)},h=t=>{let n=document.getElementById(e)?.querySelector(`.drawer__wrapper`);n&&(n.style.width=t)},g=(e,n,i)=>{r=!0,s=!0,e.classList.add(t.activeClass),document.documentElement.style.overflow=`hidden`,n&&(o=Xu(e),o.activate()),ed(i)&&i&&i(),setTimeout(function(){e.classList.add(t.visibleClass),setTimeout(()=>{s=!1},100)},t.speedOpen)};return id||=(document.addEventListener(`click`,function(t){if(!e||!r||s)return;let n=t.target,i=document.querySelector(`.drawer__wrapper`);if(!i)return;let a=n.classList.contains(`drawer__close`)||n.closest(`.drawer__close`)||`drawerClose`in n.dataset||n.closest(`[data-drawer-close]`);(!nd(i,n)||a)&&l()},!1),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&r&&l()},!1),!0),rd={settings:t,open:(t={})=>{let{title:n,content:a,side:o,width:s,footer:l,callback:_,onClose:v}=t;if(a&&m(a),v&&c(v),n&&f(n),s&&h(s),p(l),r)i={callback:_};else if(o){if(o===Qu)return d(_);if(o===Zu)return u(_)}else{let t=document.getElementById(e);t&&g(t,l,_)}},close:l,setTitle:f,setContent:m,setFooter:p,attributes:n},rd};function od(e=$u){if(document.getElementById(e))return;let t=`
|
|
178
178
|
<div id="${e}" class="drawer" aria-hidden="true">
|
|
179
179
|
<div class="drawer__overlay" tabindex="-1" data-drawer-close></div>
|
|
180
180
|
<div class="drawer__wrapper" role="dialog" aria-modal="true">
|
|
@@ -211,7 +211,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
211
211
|
`,`Instead, pass the .innerHTML of the element, or use a function that`,`returns a cloned version of the element instead.`,`
|
|
212
212
|
|
|
213
213
|
`,`1) content: element.innerHTML
|
|
214
|
-
`,`2) content: () => element.cloneNode(true)`].join(` `))}var s=i.reduce(function(e,t){var n=t&&pm(t,r);return n&&e.push(n),e},[]);return Cp(e)?s[0]:s}mm.defaultProps=Zp,mm.setDefaultProps=$p,mm.currentInput=Pp,Object.assign({},Dd,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),mm.setDefaultProps({render:lm});var hm=`#000000.#434343.#666666.#999999.#b7b7b7.#cccccc.#d9d9d9.#ffffff.#980000.#ff0000.#ff9900.#ffff00.#00ff00.#00ffff.#4a86e8.#0000ff.#9900ff.#ff00ff.#e6b8af.#f4cccc.#fce5cd.#fff2cc.#d9ead3.#d0e0e3.#c9daf8.#cfe2f3.#d9d2e9.#ead1dc`.split(`.`),gm=`notes-toolbar-recent-colors`,_m=8;function vm(){try{return JSON.parse(localStorage.getItem(gm)||`[]`)}catch{return[]}}function ym(e){let t=vm().filter(t=>t!==e);t.unshift(e),t.length>_m&&(t=t.slice(0,_m)),localStorage.setItem(gm,JSON.stringify(t))}function bm(e={}){let t=document.createElement(`div`);return t.className=`notes-toolbar`,t.appendChild(Tm(e)),t.appendChild(Em(e)),t.appendChild(Dm(e)),t.appendChild(jm(e)),t.appendChild(Pm(e)),t.appendChild(Fm(e)),t.appendChild(Lm(e)),t}function xm(e,t){for(let[n,r]of Object.entries(t)){let t=e.querySelector(`[data-action="${n}"]`);t&&t.classList.toggle(`is-active`,r)}}function Sm(e,t){let n=e.querySelector(`[data-action="heading"]`);n&&(n.value=t===!1?`0`:String(t))}function Cm(){let e=document.createElement(`div`);return e.className=`notes-toolbar-group`,e}function wm(e,t,n,r){let i=document.createElement(`button`);return i.className=`notes-toolbar-btn`,i.dataset.action=e,i.title=n,i.type=`button`,i.innerHTML=t,r&&i.addEventListener(`click`,r),i}function Tm(e){let t=Cm(),n=document.createElement(`select`);n.dataset.action=`heading`,n.title=`Text style`;for(let e of[{value:`0`,label:`Paragraph`},{value:`1`,label:`Heading 1`},{value:`2`,label:`Heading 2`},{value:`3`,label:`Heading 3`},{value:`4`,label:`Heading 4`},{value:`5`,label:`Heading 5`},{value:`6`,label:`Heading 6`}]){let t=document.createElement(`option`);t.value=e.value,t.textContent=e.label,n.appendChild(t)}return n.addEventListener(`change`,()=>{let t=parseInt(n.value,10);e.onHeading?.(t===0?!1:t)}),t.appendChild(n),t}function Em(e){let t=Cm();return t.appendChild(wm(`bold`,`<b>B</b>`,`Bold`,e.onBold)),t.appendChild(wm(`italic`,`<i>I</i>`,`Italic`,e.onItalic)),t.appendChild(wm(`underline`,`<u>U</u>`,`Underline`,e.onUnderline)),t.appendChild(wm(`strike`,`<s>S</s>`,`Strikethrough`,e.onStrike)),t}function Dm(e){let t=Cm();return t.appendChild(Om(`color`,`A`,`Text color`,`#000000`,t=>{ym(t),e.onColor?.(t)})),t.appendChild(Om(`background`,`A`,`Background color`,`#ffff00`,t=>{ym(t),e.onBackground?.(t)})),t}function Om(e,t,n,r,i){let a=document.createElement(`button`);a.className=`notes-toolbar-btn notes-toolbar-color-btn`,a.dataset.action=e,a.title=n,a.type=`button`;let o=document.createElement(`span`);o.className=`notes-toolbar-color-letter`,o.textContent=t,a.appendChild(o);let s=document.createElement(`span`);s.className=`notes-toolbar-color-bar`,s.style.backgroundColor=r,a.appendChild(s);let c;return a.addEventListener(`click`,()=>{if(c){c.destroy(),c=void 0;return}c=mm(a,{content:km(r,e=>{s.style.backgroundColor=e,i(e),c?.destroy(),c=void 0}),theme:`light-border`,trigger:`manual`,interactive:!0,placement:`bottom-start`,onHidden:()=>{c?.destroy(),c=void 0}}),c.show()}),a}function km(e,t){let n=document.createElement(`div`);n.className=`notes-color-panel`;let r=document.createElement(`div`);r.className=`notes-color-swatches`;for(let n of hm)r.appendChild(Am(n,n===e,t));n.appendChild(r);let i=vm();if(i.length){let r=document.createElement(`div`);r.className=`notes-color-section-label`,r.textContent=`Recent`,n.appendChild(r);let a=document.createElement(`div`);a.className=`notes-color-swatches`;for(let n of i)a.appendChild(Am(n,n===e,t));n.appendChild(a)}let a=document.createElement(`div`);a.className=`notes-color-custom-row`;let o=document.createElement(`input`);o.type=`color`,o.value=e,o.className=`notes-color-custom-input`;let s=document.createElement(`label`);return s.className=`notes-color-custom-label`,s.textContent=`Custom...`,s.addEventListener(`click`,()=>o.click()),o.addEventListener(`input`,()=>t(o.value)),a.appendChild(o),a.appendChild(s),n.appendChild(a),n}function Am(e,t,n){let r=document.createElement(`button`);return r.type=`button`,r.className=`notes-color-swatch`,t&&r.classList.add(`is-selected`),r.style.backgroundColor=e,(e===`#ffffff`||e===`#fff`)&&(r.style.border=`1px solid var(--chc-border-secondary)`),r.title=e,r.addEventListener(`click`,()=>n(e)),r}function jm(e){let t=Cm();return t.appendChild(wm(`orderedList`,Mm(16,16,`<path d="M3 2h12v2H3zm0 5h12v2H3zm0 5h12v2H3z" fill="currentColor"/><text x="0" y="4" font-size="3.5" fill="currentColor">1</text><text x="0" y="9" font-size="3.5" fill="currentColor">2</text><text x="0" y="14" font-size="3.5" fill="currentColor">3</text>`),`Ordered list`,e.onOrderedList)),t.appendChild(wm(`bulletList`,Mm(16,16,`<circle cx="1.5" cy="3" r="1.5" fill="currentColor"/><circle cx="1.5" cy="8" r="1.5" fill="currentColor"/><circle cx="1.5" cy="13" r="1.5" fill="currentColor"/><path d="M5 2h10v2H5zm0 5h10v2H5zm0 5h10v2H5z" fill="currentColor"/>`),`Bullet list`,e.onBulletList)),t}function Mm(e,t,n){return`<svg width="${e}" height="${t}" viewBox="0 0 ${e} ${t}" xmlns="http://www.w3.org/2000/svg">${n}</svg>`}var Nm={alignLeft:Mm(16,16,`<path d="M1 2h14v2H1zm0 4h9v2H1zm0 4h14v2H1zm0 4h9v2H1z" fill="currentColor"/>`),alignCenter:Mm(16,16,`<path d="M1 2h14v2H1zm3.5 4h7v2h-7zM1 10h14v2H1zm3.5 4h7v2h-7z" fill="currentColor"/>`),alignRight:Mm(16,16,`<path d="M1 2h14v2H1zm6 4h8v2H7zM1 10h14v2H1zm6 4h8v2H7z" fill="currentColor"/>`),alignJustify:Mm(16,16,`<path d="M1 2h14v2H1zm0 4h14v2H1zm0 4h14v2H1zm0 4h14v2H1z" fill="currentColor"/>`)};function Pm(e){let t=Cm();return t.appendChild(wm(`alignLeft`,Nm.alignLeft,`Align left`,()=>e.onAlign?.(`left`))),t.appendChild(wm(`alignCenter`,Nm.alignCenter,`Align center`,()=>e.onAlign?.(`center`))),t.appendChild(wm(`alignRight`,Nm.alignRight,`Align right`,()=>e.onAlign?.(`right`))),t.appendChild(wm(`alignJustify`,Nm.alignJustify,`Justify`,()=>e.onAlign?.(`justify`))),t}function Fm(e){let t=Cm();t.appendChild(wm(`blockquote`,`“`,`Blockquote`,e.onBlockquote)),t.appendChild(wm(`codeBlock`,`</>`,`Code block`,e.onCodeBlock));let n=wm(`link`,`⇗`,`Insert link`);Im(n,`Enter URL`,`https://`,t=>e.onLink?.(t)),t.appendChild(n);let r=wm(`video`,`▷`,`Insert video`);return Im(r,`YouTube URL`,`https://youtube.com/...`,t=>e.onVideo?.(t)),t.appendChild(r),t}function Im(e,t,n,r){let i;e.addEventListener(`click`,()=>{if(i){i.destroy(),i=void 0;return}let a=document.createElement(`div`);a.className=`notes-url-panel`;let o=document.createElement(`div`);o.className=`notes-url-label`,o.textContent=t,a.appendChild(o);let s=document.createElement(`input`);s.type=`url`,s.className=`notes-url-input`,s.placeholder=n,a.appendChild(s);let c=document.createElement(`div`);c.className=`notes-url-actions`;let l=document.createElement(`button`);l.type=`button`,l.className=`button notes-url-cancel`,l.textContent=`Cancel`,l.addEventListener(`click`,()=>{i?.destroy(),i=void 0});let u=document.createElement(`button`);u.type=`button`,u.className=`button is-info notes-url-confirm`,u.textContent=`Insert`,u.addEventListener(`click`,()=>{let e=s.value.trim();e&&r(e),i?.destroy(),i=void 0}),c.appendChild(l),c.appendChild(u),a.appendChild(c),s.addEventListener(`keydown`,e=>{e.key===`Enter`?(e.preventDefault(),u.click()):e.key===`Escape`&&l.click()}),i=mm(e,{content:a,theme:`light-border`,trigger:`manual`,interactive:!0,placement:`bottom-start`,onShown:()=>setTimeout(()=>s.focus(),0),onHidden:()=>{i?.destroy(),i=void 0}}),i.show()})}function Lm(e){let t=Cm();return t.appendChild(wm(`clearFormatting`,`⊘`,`Clear formatting`,e.onClearFormatting)),t}function Rm(e,t,n){if(!e)return{};let r=document.createElement(`aside`);r.classList.add(`menu`);let i={},a=e=>n&&e.close!==!1?t=>{t.stopPropagation(),n(),e.onClick()}:t=>{t.stopPropagation(),e.onClick()},o=0,s=()=>(o+=1,o),c=e=>e?.heading||e?.text||e?.label||`Item ${s()}`,l=e=>{let t=document.createElement(`li`);if(t.className=`font-medium`,e.style&&(t.style.cssText=e.style),e.onClick){let n=e.fontSize||`1em`;if(e.divider){let e=document.createElement(`hr`);e.classList.add(`dropdown-divider`),t.appendChild(e)}else{let r=document.createElement(`a`),i=e.disabled?`0.4`:`1`;r.style.cssText=`text-decoration: none; opacity: ${i}; font-size: ${n}`,e.class&&r.classList.add(e.class),e.color&&(r.style.color=e.color),e.heading&&(r.style.fontWeight=`bold`),e.disabled||(r.onclick=a(e)),r.innerHTML=c(e),t.appendChild(r)}}else t.innerHTML=c(e),e.disabled||(t.onclick=e.onClick);return t},u;for(let e of t||[])if(!e.hide){if(e.items){if(e.text){let t=document.createElement(`p`);t.className=`menu-label font-medium`,t.innerHTML=e.text,r.appendChild(t)}let t=document.createElement(`ul`);t.className=`menu-list`;for(let n of e.items)n.hide||t.appendChild(l(n));r.appendChild(t)}else if(e.type===`input`){let{field:t,inputElement:n}=ln(e);e.focus&&(u=n),i[e.field]=n,r.appendChild(t)}else if(e.type===`divider`){let e=document.createElement(`hr`);e.classList.add(`dropdown-divider`),r.appendChild(e)}}return e.appendChild(r),{focusElement:u}}function zm(e){return typeof e==`function`}var Bm;function Vm(e){Bm&&=(Bm?.destroy(!0),void 0),e?.remove&&e.remove()}function Hm(e){let{title:t,options:n,menuItems:r=[],coords:i,callback:a,config:o}=e,{target:s,items:c}=e;if(!n?.length&&!c?.length&&!r)return;Vm();let l=document.createElement(`div`),u;return s||=i?.evt?.target,s&&(Bm=mm(s,{content:()=>(c=c?.filter(e=>!e.hide&&!e.disabled).map(e=>({...e,onClick:()=>{Vm(l),zm(e.onClick)&&e.onClick()}}))||n?.filter(e=>!e.hide&&!e.disabled).map(e=>({text:typeof e==`object`?e.option:e,style:e.style,onClick:()=>{e.subMenu?Bm.setContent(`IMPLEMENT SUB MENU`):zm(e.onClick)?(Vm(l),e.onClick()):zm(a)&&a&&(Vm(l),a(typeof e==`object`?{...e,coords:i}:e))}})),u=Rm(l,[{text:t,items:c},...r]).focusElement,l),theme:`light-border`,trigger:`click`,onShown:()=>{u&&setTimeout(()=>u?.focus(),0)},...o}),Bm.show(),Bm.setProps({interactive:!0})),Bm}var X=`court-line`;function Z(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function Um(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);return n.setAttribute(`viewBox`,e),n.setAttribute(`class`,t),n.setAttribute(`fill`,`none`),n.style.width=`100%`,n.style.height=`auto`,n.style.display=`block`,n}function Wm(e){let t=Um(`0 0 360 780`,e);for(let e of[`M 0 0 L 360 0 L 360 780 L 0 780 Z`,`M 45 0 L 45 780`,`M 315 0 L 315 780`,`M 0 390 L 360 390`,`M 45 210 L 315 210`,`M 45 570 L 315 570`,`M 180 210 L 180 570`,`M 180 0 L 180 20`,`M 180 760 L 180 780`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Gm(e){let t=Um(`0 0 500 470`,e),n=[Z(`rect`,{x:`0`,y:`0`,width:`500`,height:`470`,class:X}),Z(`circle`,{cx:`250`,cy:`470`,r:`60`,class:X}),Z(`line`,{x1:`0`,y1:`470`,x2:`500`,y2:`470`,class:X}),Z(`rect`,{x:`170`,y:`0`,width:`160`,height:`190`,class:X}),Z(`circle`,{cx:`250`,cy:`190`,r:`60`,class:X}),Z(`line`,{x1:`220`,y1:`40`,x2:`280`,y2:`40`,class:X}),Z(`circle`,{cx:`250`,cy:`52`,r:`12`,class:X}),Z(`path`,{d:`M 30 0 L 30 90 A 220 220 0 0 0 470 90 L 470 0`,class:X})];for(let e of n)t.appendChild(e);return t}function Km(e){let t=Um(`0 0 500 440`,e),n=[Z(`path`,{d:`M 20 170 A 350 400 0 0 1 480 170`,class:X}),Z(`line`,{x1:`250`,y1:`400`,x2:`20`,y2:`170`,class:X}),Z(`line`,{x1:`250`,y1:`400`,x2:`480`,y2:`170`,class:X}),Z(`path`,{d:`M 250 400 L 314 336 L 250 273 L 186 336 Z`,class:X}),Z(`path`,{d:`M 340 355 A 100 100 0 0 1 160 355`,class:X}),Z(`line`,{x1:`340`,y1:`355`,x2:`265`,y2:`405`,class:X}),Z(`line`,{x1:`160`,y1:`355`,x2:`235`,y2:`405`,class:X}),Z(`path`,{d:`M 235 405 A 18 18 0 0 1 265 405`,class:X}),Z(`circle`,{cx:`250`,cy:`340`,r:`9`,class:X}),Z(`line`,{x1:`247`,y1:`339`,x2:`253`,y2:`339`,class:X}),Z(`path`,{d:`M 244 398 L 244 404 L 250 408 L 256 404 L 256 398 Z`,class:X}),Z(`rect`,{x:`310`,y:`332`,width:`8`,height:`8`,transform:`rotate(45 314 336)`,class:X}),Z(`rect`,{x:`246`,y:`269`,width:`8`,height:`8`,transform:`rotate(45 250 273)`,class:X}),Z(`rect`,{x:`182`,y:`332`,width:`8`,height:`8`,transform:`rotate(45 186 336)`,class:X}),Z(`rect`,{x:`230`,y:`393`,width:`8`,height:`18`,class:X}),Z(`rect`,{x:`262`,y:`393`,width:`8`,height:`18`,class:X})];for(let e of n)t.appendChild(e);return t}function qm(e){let t=Um(`0 0 850 2000`,e),n=[Z(`rect`,{x:`0`,y:`0`,width:`850`,height:`2000`,rx:`280`,ry:`280`,class:X}),Z(`line`,{x1:`0`,y1:`1000`,x2:`850`,y2:`1000`,class:X}),Z(`circle`,{cx:`425`,cy:`1000`,r:`60`,class:X}),Z(`line`,{x1:`0`,y1:`650`,x2:`850`,y2:`650`,class:X}),Z(`line`,{x1:`0`,y1:`1350`,x2:`850`,y2:`1350`,class:X}),Z(`line`,{x1:`140`,y1:`300`,x2:`710`,y2:`300`,class:X}),Z(`line`,{x1:`140`,y1:`1700`,x2:`710`,y2:`1700`,class:X}),Z(`path`,{d:`M 395 300 A 40 40 0 0 1 455 300`,class:X}),Z(`path`,{d:`M 395 1700 A 40 40 0 0 0 455 1700`,class:X}),Z(`circle`,{cx:`270`,cy:`650`,r:`50`,class:X}),Z(`circle`,{cx:`580`,cy:`650`,r:`50`,class:X}),Z(`circle`,{cx:`270`,cy:`1350`,r:`50`,class:X}),Z(`circle`,{cx:`580`,cy:`1350`,r:`50`,class:X})];for(let e of n)t.appendChild(e);return t}function Jm(e){let t=Um(`0 0 200 440`,e);for(let e of[`M 0 0 L 200 0 L 200 440 L 0 440 Z`,`M 0 220 L 200 220`,`M 0 150 L 200 150`,`M 0 290 L 200 290`,`M 100 0 L 100 150`,`M 100 290 L 100 440`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Ym(e){let t=Um(`0 0 200 440`,e);for(let e of[`M 0 0 L 200 0 L 200 440 L 0 440 Z`,`M 18 0 L 18 440`,`M 182 0 L 182 440`,`M 0 220 L 200 220`,`M 0 146 L 200 146`,`M 0 294 L 200 294`,`M 0 30 L 200 30`,`M 0 410 L 200 410`,`M 100 146 L 100 220`,`M 100 220 L 100 294`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Xm(e){let t=Um(`0 0 100 200`,e);for(let e of[`M 0 0 L 100 0 L 100 200 L 0 200 Z`,`M 0 100 L 100 100`,`M 0 69.5 L 100 69.5`,`M 0 130.5 L 100 130.5`,`M 50 69.5 L 50 67.5`,`M 50 130.5 L 50 132.5`])t.appendChild(Z(`path`,{d:e,class:X}));return t}var Zm={name:`courthive-components`,version:`1.0.3`,engines:{node:`>=20.19.0 < 25`},description:`Components for competitions projects`,files:[`dist`],main:`./dist/courthive-components.umd.js`,module:`./dist/courthive-components.es.js`,types:`./dist/index.d.ts`,exports:{".":{types:`./dist/index.d.ts`,import:`./dist/courthive-components.es.js`,require:`./dist/courthive-components.umd.js`},"./dist/*":`./dist/*`},repository:{type:`git`,url:`git+https://github.com/CourtHive/courthive-components.git`},keywords:[`tournament`,`match`,`score`,`vanillajs`,`bracket`],author:`Charles Allen`,license:`MIT`,bugs:{url:`https://github.com/CourtHive/courthive-components/issues`},homepage:`https://courthive.github.io/courthive-component`,scripts:{commits:`git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-merges --pretty=format:'%s: %h' | sed '/courthive-components/d'`,release:`npm run release:patch`,test:`vitest run`,"test:watch":`vitest`,"test:ui":`vitest --ui`,dev:`vite`,build:`vite build`,prepublishOnly:`npm run build`,preview:`vite preview`,storybook:`storybook dev -p 6006`,"build-storybook":`storybook build`,"deploy-storybook":`gh-pages -d storybook-static`,"pre-commit":`lint-staged`,predeploy:`npm run build-storybook`,prebuild:`rm -rf dist/*`,lint:`eslint src --fix --cache`,"lint:report":`eslint src & eslint --cache src -f json > eslint-report.json`,format:`prettier --write src`,"release:major":`npm run commits && npm version $(semver $npm_package_version -i major) && git push && git push --tags`,"release:minor":`npm run commits && npm version $(semver $npm_package_version -i minor) && git push && git push --tags`,"release:patch":`npm run commits && npm version $(semver $npm_package_version -i patch) && git push && git push --tags`,"release:beta":`npm run commits && npm version $(semver $npm_package_version -i prerelease --preid beta) && git push && git push --tags`,"patch:beta":`npm run commits && npm version $(semver $npm_package_version -i prerelease --preid beta) && npm publish --tag beta`},"lint-staged":{"*.{js,ts}":`eslint --cache --fix`,"*":`prettier --ignore-unknown --write`},devDependencies:{"@chromatic-com/storybook":`^5.0.0`,"@commitlint/cli":`20.5.0`,"@commitlint/config-conventional":`20.5.0`,"@eslint/js":`^10.0.1`,"@fortawesome/fontawesome-free":`^7.2.0`,"@storybook/addon-docs":`^10.2.17`,"@storybook/html-vite":`^10.2.17`,"@storybook/test-runner":`^0.24.0`,"@types/d3":`^7.4.3`,"@types/vanillajs-datepicker":`^1.3.5`,"@typescript-eslint/eslint-plugin":`8.59.0`,"@typescript-eslint/parser":`8.59.0`,"@vitest/browser-playwright":`^4.0.16`,"@vitest/coverage-v8":`^4.0.16`,eslint:`10.2.1`,"eslint-plugin-sonarjs":`4.0.3`,"eslint-plugin-storybook":`^10.2.17`,"gh-pages":`6.3.0`,globals:`^17.3.0`,"happy-dom":`^20.8.3`,husky:`9.1.7`,"lint-staged":`16.4.0`,playwright:`^1.57.0`,prettier:`^3.8.1`,semver:`7.7.4`,storybook:`^10.2.17`,"tabulator-tables":`6.4.0`,typescript:`^6.0.2`,vite:`8.0.9`,"vite-plugin-dts":`^4.5.4`,vitest:`^4.0.16`},dependencies:{awesomplete:`1.1.7`,"class-variance-authority":`0.7.1`,classnames:`2.5.1`,d3:`^7.9.0`,dayjs:`1.11.20`,"focus-trap":`^8.0.0`,"timepicker-ui":`^4.1.2`,"tippy.js":`6.3.7`,"tods-competition-factory":`^3.1.2`,"vanillajs-datepicker":`1.3.4`}};function Qm(){return Zm.version}var $m={SET3_S6_TB7:`SET3-S:6/TB7`,SET3_S6_TB7_F_TB10:`SET3-S:6/TB7-F:TB10`,SET3_S6_TB10:`SET3-S:6/TB10`,SET3_S6_F_TB10:`SET3-S:6-F:TB10`,SET3_S6_TB7_NOAD:`SET3-S:6/TB7NOAD`,SET3_S8_TB7:`SET3-S:8/TB7`,SET3_S8_TB7_AT7:`SET3-S:8/TB7@7`,SET3_S4_TB7:`SET3-S:4/TB7`,SET3_S4_TB7_F_TB10:`SET3-S:4/TB7-F:TB10`,SET3_S4_TB5_AT3_F_TB10:`SET3-S:4/TB5@3-F:TB10`,SET5_S6_TB7:`SET5-S:6/TB7`,SET5_S6_TB7_F_TB10:`SET5-S:6/TB7-F:TB10`,SET1_S6_TB7:`SET1-S:6/TB7`,SET1_S6_TB10:`SET1-S:6/TB10`,SET1_S6_TB7_AT5:`SET1-S:6/TB7@5`,SET1_S8_TB7:`SET1-S:8/TB7`,SET1_S4_TB7:`SET1-S:4/TB7`,SET1_S5_TB9_AT4:`SET1-S:5/TB9@4`,SET1_S_TB7:`SET1-S:T7`,SET1_S_TB10:`SET1-S:TB10`,SET1_S_TB21:`SET1-S:T21`,SET1_S8:`SET1-S:8`,SET1_S10:`SET1-S:10`,FAST4:`SET5-S:4/NOAD`,SET3X_T10A_TB1:`SET3XA-S:T10-F:TB1`,SET3X_T10A_TB1_NOAD:`SET3XA-S:T10-F:TB1NOAD`,SET4X_T10A_TB1:`SET4XA-S:T10-F:TB1`};function eh(e,t,n){if(!e)return{elements:{}};let r={};for(let i of t||[]){if(!i?.label||i.hide)continue;let t=document.createElement(`button`);i.id&&(r[i.id]=t,t.id=i.id),t.style.marginRight=`.5em`,t.className=`button font-medium`,i.intent&&t.classList.add(i.intent),t.innerHTML=i.label,i.disabled&&(t.disabled=!0),t.onclick=e=>{e.stopPropagation(),!e.target.disabled&&B(i.onClick)&&i.onClick(),n&&B(n)&&n()},e.appendChild(t)}return{elements:r}}var th=(e,t)=>n=>n?.trim().length>=e&&(!t||n?.trim().length<=t);function nh(e){return t.tools.isConvertableInteger(e)&&parseInt(e.toString())>=0}var rh=(e,t)=>n=>nh(n)&&Number(n)>=e&&Number(n)<=t,ih=e=>/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)(?=.*?[#?!@$%^&*-]).{8,12}$/.test(e);function ah(e){return t.tools.dateTime.dateValidation.test(e)}var oh=(e,t)=>n=>{let r=(n||``).trim().split(` `).length;return r>=e&&(!t||r<=t)},sh=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,ch=e=>sh.exec(e),lh=u({dateValidator:()=>ah,emailValidator:()=>ch,nameValidator:()=>th,numericRange:()=>rh,numericValidator:()=>nh,passwordValidator:()=>ih,wordValidator:()=>oh}),uh=class{constructor({tournamentRecord:e,drawId:n,structureId:r,eventId:i}){this.tournamentRecord=e,this.drawId=n,this.structureId=r,this.eventId=i||e.events?.[0]?.eventId,t.tournamentEngine.setState(e)}setRenderCallback(e){this.renderCallback=e}getDrawEntryParticipantIds(){let{event:e,drawDefinition:n}=t.tournamentEngine.getEvent({drawId:this.drawId})||{};if(!e)return[];let{flightProfile:r}=t.tournamentEngine.getFlightProfile({eventId:this.eventId})||{};return(r?.flights?.find(e=>e.drawId===this.drawId)?.drawEntries||n?.entries||[]).map(e=>e.participantId).filter(Boolean)}getAllParticipants(){t.tournamentEngine.setState(this.tournamentRecord);let e=this.getDrawEntryParticipantIds();if(!e.length)return[];let{participants:n=[]}=t.tournamentEngine.getParticipants({participantFilters:{participantIds:e}})||{};return n.map(e=>({participantId:e.participantId,participantName:e.participantName,participantType:e.participantType,person:e.person,individualParticipants:e.individualParticipants}))}getAvailableParticipants(){t.tournamentEngine.setState(this.tournamentRecord);let e=this.getAllParticipants(),{assignedParticipantIds:n=[]}=t.tournamentEngine.getAssignedParticipantIds({drawId:this.drawId})||{};return e.filter(e=>!n.includes(e.participantId))}removeAssignment({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=this.getMatchUps().find(t=>t.sides?.some(t=>t.drawPosition===e))?.sides?.find(t=>t.drawPosition===e)?.bye===!0,r=t.tournamentEngine.removeDrawPositionAssignment({drawId:this.drawId,structureId:this.structureId,drawPosition:e});if(r.error)return{success:!1,error:r.error};let{tournamentRecord:i}=t.tournamentEngine.getState()||{};return this.tournamentRecord=i,n&&this.renderCallback&&this.renderCallback(),{success:!0}}assignParticipant({drawPosition:e,participantId:n}){t.tournamentEngine.setState(this.tournamentRecord);let r=t.tournamentEngine.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:e,participantId:n});if(r.error)return{success:!1,error:r.error};let{tournamentRecord:i}=t.tournamentEngine.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}getAndClearFocusDrawPosition(){let e=this.focusDrawPosition;return this.focusDrawPosition=void 0,e}assignBye({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=t.tournamentEngine.assignDrawPositionBye({drawId:this.drawId,structureId:this.structureId,drawPosition:e});if(n.error)return{success:!1,error:n.error};let{tournamentRecord:r}=t.tournamentEngine.getState()||{};return this.tournamentRecord=r,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}assignQualifier({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=t.tournamentEngine.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:e,qualifier:!0});if(n.error)return{success:!1,error:n.error};let{tournamentRecord:r}=t.tournamentEngine.getState()||{};return this.tournamentRecord=r,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}getMatchUps(){t.tournamentEngine.setState(this.tournamentRecord);let{eventData:e}=t.tournamentEngine.getEventData({eventId:this.eventId})||{},n=(e?.drawsData?.find(e=>e.drawId===this.drawId))?.structures?.find(e=>e.structureId===this.structureId)?.roundMatchUps;return n?Object.values(n).flat():[]}getState(){return this.tournamentRecord}getContext(){return{drawId:this.drawId,structureId:this.structureId}}};function dh(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fh(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ph(e){let t,n,r;e.length===2?(t=e===dh||e===fh?e:mh,n=e,r=e):(t=dh,n=(t,n)=>dh(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function mh(){return 0}function hh(e){return e===null?NaN:+e}var gh=ph(dh),_h=gh.right;gh.left,ph(hh).center;var vh=Math.sqrt(50),yh=Math.sqrt(10),bh=Math.sqrt(2);function xh(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=vh?10:a>=yh?5:a>=bh?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?xh(e,t,n*2):[s,c,l]}function Sh(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?xh(t,e,n):xh(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function Ch(e,t,n){return t=+t,e=+e,n=+n,xh(e,t,n)[2]}function wh(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Ch(t,e,n):Ch(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Th(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}var Eh={value:()=>{}};function Dh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Oh(n)}function Oh(e){this._=e}function kh(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Oh.prototype=Dh.prototype={constructor:Oh,on:function(e,t){var n=this._,r=kh(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ah(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=jh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=jh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Oh(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ah(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function jh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Eh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mh={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Nh(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Mh.hasOwnProperty(t)?{space:Mh[t],local:e}:e}function Ph(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Fh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ih(e){var t=Nh(e);return(t.local?Fh:Ph)(t)}function Lh(){}function Rh(e){return e==null?Lh:function(){return this.querySelector(e)}}function zh(e){typeof e!=`function`&&(e=Rh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new D_(r,this._parents)}function Bh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Vh(){return[]}function Hh(e){return e==null?Vh:function(){return this.querySelectorAll(e)}}function Uh(e){return function(){return Bh(e.apply(this,arguments))}}function Wh(e){e=typeof e==`function`?Uh(e):Hh(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new D_(r,i)}function Gh(e){return function(){return this.matches(e)}}function Kh(e){return function(t){return t.matches(e)}}var qh=Array.prototype.find;function Jh(e){return function(){return qh.call(this.children,e)}}function Yh(){return this.firstElementChild}function Xh(e){return this.select(e==null?Yh:Jh(typeof e==`function`?e:Kh(e)))}var Zh=Array.prototype.filter;function Qh(){return Array.from(this.children)}function $h(e){return function(){return Zh.call(this.children,e)}}function eg(e){return this.selectAll(e==null?Qh:$h(typeof e==`function`?e:Kh(e)))}function tg(e){typeof e!=`function`&&(e=Gh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new D_(r,this._parents)}function ng(e){return Array(e.length)}function rg(){return new D_(this._enter||this._groups.map(ng),this._parents)}function ig(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ig.prototype={constructor:ig,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ag(e){return function(){return e}}function og(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ig(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function sg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ig(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function cg(e){return e.__data__}function lg(e,t){if(!arguments.length)return Array.from(this,cg);var n=t?sg:og,r=this._parents,i=this._groups;typeof e!=`function`&&(e=ag(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=ug(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new D_(o,r),o._enter=s,o._exit=c,o}function ug(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function dg(){return new D_(this._exit||this._groups.map(ng),this._parents)}function fg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function pg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new D_(s,this._parents)}function mg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function hg(e){e||=gg;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new D_(i,this._parents).order()}function gg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _g(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vg(){return Array.from(this)}function yg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function bg(){let e=0;for(let t of this)++e;return e}function xg(){return!this.node()}function Sg(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Cg(e){return function(){this.removeAttribute(e)}}function wg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tg(e,t){return function(){this.setAttribute(e,t)}}function Eg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Dg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Og(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function kg(e,t){var n=Nh(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wg:Cg:typeof t==`function`?n.local?Og:Dg:n.local?Eg:Tg)(n,t))}function Ag(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jg(e){return function(){this.style.removeProperty(e)}}function Mg(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ng(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Pg(e,t,n){return arguments.length>1?this.each((t==null?jg:typeof t==`function`?Ng:Mg)(e,t,n??``)):Fg(this.node(),e)}function Fg(e,t){return e.style.getPropertyValue(t)||Ag(e).getComputedStyle(e,null).getPropertyValue(t)}function Ig(e){return function(){delete this[e]}}function Lg(e,t){return function(){this[e]=t}}function Rg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zg(e,t){return arguments.length>1?this.each((t==null?Ig:typeof t==`function`?Rg:Lg)(e,t)):this.node()[e]}function Bg(e){return e.trim().split(/^|\s+/)}function Vg(e){return e.classList||new Hg(e)}function Hg(e){this._node=e,this._names=Bg(e.getAttribute(`class`)||``)}Hg.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Ug(e,t){for(var n=Vg(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Wg(e,t){for(var n=Vg(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Gg(e){return function(){Ug(this,e)}}function Kg(e){return function(){Wg(this,e)}}function qg(e,t){return function(){(t.apply(this,arguments)?Ug:Wg)(this,e)}}function Jg(e,t){var n=Bg(e+``);if(arguments.length<2){for(var r=Vg(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?qg:t?Gg:Kg)(n,t))}function Yg(){this.textContent=``}function Xg(e){return function(){this.textContent=e}}function Zg(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Qg(e){return arguments.length?this.each(e==null?Yg:(typeof e==`function`?Zg:Xg)(e)):this.node().textContent}function $g(){this.innerHTML=``}function e_(e){return function(){this.innerHTML=e}}function t_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function n_(e){return arguments.length?this.each(e==null?$g:(typeof e==`function`?t_:e_)(e)):this.node().innerHTML}function r_(){this.nextSibling&&this.parentNode.appendChild(this)}function i_(){return this.each(r_)}function a_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function o_(){return this.each(a_)}function s_(e){var t=typeof e==`function`?e:Ih(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function c_(){return null}function l_(e,t){var n=typeof e==`function`?e:Ih(e),r=t==null?c_:typeof t==`function`?t:Rh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function u_(){var e=this.parentNode;e&&e.removeChild(this)}function d_(){return this.each(u_)}function f_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function p_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m_(e){return this.select(e?p_:f_)}function h_(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function g_(e){return function(t){e.call(this,t,this.__data__)}}function __(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function v_(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function y_(e,t,n){return function(){var r=this.__on,i,a=g_(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function b_(e,t,n){var r=__(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?y_:v_,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function x_(e,t,n){var r=Ag(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function S_(e,t){return function(){return x_(this,e,t)}}function C_(e,t){return function(){return x_(this,e,t.apply(this,arguments))}}function w_(e,t){return this.each((typeof t==`function`?C_:S_)(e,t))}function*T_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var E_=[null];function D_(e,t){this._groups=e,this._parents=t}function O_(){return new D_([[document.documentElement]],E_)}function k_(){return this}D_.prototype=O_.prototype={constructor:D_,select:zh,selectAll:Wh,selectChild:Xh,selectChildren:eg,filter:tg,data:lg,enter:rg,exit:dg,join:fg,merge:pg,selection:k_,order:mg,sort:hg,call:_g,nodes:vg,node:yg,size:bg,empty:xg,each:Sg,attr:kg,style:Pg,property:zg,classed:Jg,text:Qg,html:n_,raise:i_,lower:o_,append:s_,insert:l_,remove:d_,clone:m_,datum:h_,on:b_,dispatch:w_,[Symbol.iterator]:T_};function A_(e){return typeof e==`string`?new D_([[document.querySelector(e)]],[document.documentElement]):new D_([[e]],E_)}function j_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function M_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function N_(){}var P_=.7,F_=1/P_,I_=`\\s*([+-]?\\d+)\\s*`,L_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,R_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,z_=/^#([0-9a-f]{3,8})$/,B_=RegExp(`^rgb\\(${I_},${I_},${I_}\\)$`),V_=RegExp(`^rgb\\(${R_},${R_},${R_}\\)$`),H_=RegExp(`^rgba\\(${I_},${I_},${I_},${L_}\\)$`),U_=RegExp(`^rgba\\(${R_},${R_},${R_},${L_}\\)$`),W_=RegExp(`^hsl\\(${L_},${R_},${R_}\\)$`),G_=RegExp(`^hsla\\(${L_},${R_},${R_},${L_}\\)$`),K_={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};j_(N_,Z_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:q_,formatHex:q_,formatHex8:J_,formatHsl:Y_,formatRgb:X_,toString:X_});function q_(){return this.rgb().formatHex()}function J_(){return this.rgb().formatHex8()}function Y_(){return uv(this).formatHsl()}function X_(){return this.rgb().formatRgb()}function Z_(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=z_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Q_(t):n===3?new nv(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=B_.exec(e))?new nv(t[1],t[2],t[3],1):(t=V_.exec(e))?new nv(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H_.exec(e))?$_(t[1],t[2],t[3],t[4]):(t=U_.exec(e))?$_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=W_.exec(e))?lv(t[1],t[2]/100,t[3]/100,1):(t=G_.exec(e))?lv(t[1],t[2]/100,t[3]/100,t[4]):K_.hasOwnProperty(e)?Q_(K_[e]):e===`transparent`?new nv(NaN,NaN,NaN,0):null}function Q_(e){return new nv(e>>16&255,e>>8&255,e&255,1)}function $_(e,t,n,r){return r<=0&&(e=t=n=NaN),new nv(e,t,n,r)}function ev(e){return e instanceof N_||(e=Z_(e)),e?(e=e.rgb(),new nv(e.r,e.g,e.b,e.opacity)):new nv}function tv(e,t,n,r){return arguments.length===1?ev(e):new nv(e,t,n,r??1)}function nv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}j_(nv,tv,M_(N_,{brighter(e){return e=e==null?F_:F_**+e,new nv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?P_:P_**+e,new nv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nv(sv(this.r),sv(this.g),sv(this.b),ov(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:rv,formatHex:rv,formatHex8:iv,formatRgb:av,toString:av}));function rv(){return`#${cv(this.r)}${cv(this.g)}${cv(this.b)}`}function iv(){return`#${cv(this.r)}${cv(this.g)}${cv(this.b)}${cv((isNaN(this.opacity)?1:this.opacity)*255)}`}function av(){let e=ov(this.opacity);return`${e===1?`rgb(`:`rgba(`}${sv(this.r)}, ${sv(this.g)}, ${sv(this.b)}${e===1?`)`:`, ${e})`}`}function ov(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cv(e){return e=sv(e),(e<16?`0`:``)+e.toString(16)}function lv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fv(e,t,n,r)}function uv(e){if(e instanceof fv)return new fv(e.h,e.s,e.l,e.opacity);if(e instanceof N_||(e=Z_(e)),!e)return new fv;if(e instanceof fv)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new fv(o,s,c,e.opacity)}function dv(e,t,n,r){return arguments.length===1?uv(e):new fv(e,t,n,r??1)}function fv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}j_(fv,dv,M_(N_,{brighter(e){return e=e==null?F_:F_**+e,new fv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?P_:P_**+e,new fv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new nv(hv(e>=240?e-240:e+120,i,r),hv(e,i,r),hv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fv(pv(this.h),mv(this.s),mv(this.l),ov(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(){let e=ov(this.opacity);return`${e===1?`hsl(`:`hsla(`}${pv(this.h)}, ${mv(this.s)*100}%, ${mv(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function pv(e){return e=(e||0)%360,e<0?e+360:e}function mv(e){return Math.max(0,Math.min(1,e||0))}function hv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var gv=e=>()=>e;function _v(e,t){return function(n){return e+n*t}}function vv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function yv(e){return(e=+e)==1?bv:function(t,n){return n-t?vv(t,n,e):gv(isNaN(t)?n:t)}}function bv(e,t){var n=t-e;return n?_v(e,n):gv(isNaN(e)?t:e)}var xv=(function e(t){var n=yv(t);function r(e,t){var r=n((e=tv(e)).r,(t=tv(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=bv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Sv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Cv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wv(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Nv(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Tv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ev(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dv(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Nv(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Ov=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kv=new RegExp(Ov.source,`g`);function Av(e){return function(){return e}}function jv(e){return function(t){return e(t)+``}}function Mv(e,t){var n=Ov.lastIndex=kv.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Ov.exec(e))&&(i=kv.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ev(r,i)})),n=kv.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?jv(c[0].x):Av(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Nv(e,t){var n=typeof t,r;return t==null||n===`boolean`?gv(t):(n===`number`?Ev:n===`string`?(r=Z_(t))?(t=r,xv):Mv:t instanceof Z_?xv:t instanceof Date?Tv:Cv(t)?Sv:Array.isArray(t)?wv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Dv:Ev)(e,t)}function Pv(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Fv=180/Math.PI,Iv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lv(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Fv,skewX:Math.atan(c)*Fv,scaleX:o,scaleY:s}}var Rv;function zv(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Iv:Lv(t.a,t.b,t.c,t.d,t.e,t.f)}function Bv(e){return e==null||(Rv||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Rv.setAttribute(`transform`,e),!(e=Rv.transform.baseVal.consolidate()))?Iv:(e=e.matrix,Lv(e.a,e.b,e.c,e.d,e.e,e.f))}function Vv(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Ev(e,i)},{i:c-2,x:Ev(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Ev(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Ev(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Ev(e,n)},{i:s-2,x:Ev(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Hv=Vv(zv,`px, `,`px)`,`deg)`),Uv=Vv(Bv,`, `,`)`,`)`),Wv=0,Gv=0,Kv=0,qv=1e3,Jv,Yv,Xv=0,Zv=0,Qv=0,$v=typeof performance==`object`&&performance.now?performance:Date,ey=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ty(){return Zv||=(ey(ny),$v.now()+Qv)}function ny(){Zv=0}function ry(){this._call=this._time=this._next=null}ry.prototype=iy.prototype={constructor:ry,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?ty():+n)+(t==null?0:+t),!this._next&&Yv!==this&&(Yv?Yv._next=this:Jv=this,Yv=this),this._call=e,this._time=n,ly()},stop:function(){this._call&&(this._call=null,this._time=1/0,ly())}};function iy(e,t,n){var r=new ry;return r.restart(e,t,n),r}function ay(){ty(),++Wv;for(var e=Jv,t;e;)(t=Zv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wv}function oy(){Zv=(Xv=$v.now())+Qv,Wv=Gv=0;try{ay()}finally{Wv=0,cy(),Zv=0}}function sy(){var e=$v.now(),t=e-Xv;t>qv&&(Qv-=t,Xv=e)}function cy(){for(var e,t=Jv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jv=n);Yv=e,ly(r)}function ly(e){Wv||(Gv&&=clearTimeout(Gv),e-Zv>24?(e<1/0&&(Gv=setTimeout(oy,e-$v.now()-Qv)),Kv&&=clearInterval(Kv)):(Kv||=(Xv=$v.now(),setInterval(sy,qv)),Wv=1,ey(oy)))}function uy(e,t,n){var r=new ry;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var dy=Dh(`start`,`end`,`cancel`,`interrupt`),fy=[];function py(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;_y(e,n,{name:t,index:r,group:i,on:dy,tween:fy,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function my(e,t){var n=gy(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function hy(e,t){var n=gy(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function gy(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function _y(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=iy(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return uy(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(uy(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function vy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function yy(e){return this.each(function(){vy(this,e)})}function by(e,t){var n,r;return function(){var i=hy(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function xy(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=hy(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Sy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=gy(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?by:xy)(n,e,t))}function Cy(e,t,n){var r=e._id;return e.each(function(){var e=hy(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return gy(e,r).value[t]}}function wy(e,t){var n;return(typeof t==`number`?Ev:t instanceof Z_?xv:(n=Z_(t))?(t=n,xv):Mv)(e,t)}function Ty(e){return function(){this.removeAttribute(e)}}function Ey(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Oy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ky(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ay(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function jy(e,t){var n=Nh(e),r=n===`transform`?Uv:wy;return this.attrTween(e,typeof t==`function`?(n.local?Ay:ky)(n,r,Cy(this,`attr.`+e,t)):t==null?(n.local?Ey:Ty)(n):(n.local?Oy:Dy)(n,r,t))}function My(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ny(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Py(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ny(e,i)),n}return i._value=t,i}function Fy(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&My(e,i)),n}return i._value=t,i}function Iy(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Nh(e);return this.tween(n,(r.local?Py:Fy)(r,t))}function Ly(e,t){return function(){my(this,e).delay=+t.apply(this,arguments)}}function Ry(e,t){return t=+t,function(){my(this,e).delay=t}}function zy(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ly:Ry)(t,e)):gy(this.node(),t).delay}function By(e,t){return function(){hy(this,e).duration=+t.apply(this,arguments)}}function Vy(e,t){return t=+t,function(){hy(this,e).duration=t}}function Hy(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?By:Vy)(t,e)):gy(this.node(),t).duration}function Uy(e,t){if(typeof t!=`function`)throw Error();return function(){hy(this,e).ease=t}}function Wy(e){var t=this._id;return arguments.length?this.each(Uy(t,e)):gy(this.node(),t).ease}function Gy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();hy(this,e).ease=n}}function Ky(e){if(typeof e!=`function`)throw Error();return this.each(Gy(this._id,e))}function qy(e){typeof e!=`function`&&(e=Gh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Sb(r,this._parents,this._name,this._id)}function Jy(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Sb(o,this._parents,this._name,this._id)}function Yy(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Xy(e,t,n){var r,i,a=Yy(t)?my:hy;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Zy(e,t){var n=this._id;return arguments.length<2?gy(this.node(),n).on.on(e):this.each(Xy(n,e,t))}function Qy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $y(){return this.on(`end.remove`,Qy(this._id))}function eb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Rh(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,py(l[f],t,n,f,l,gy(u,n)));return new Sb(a,this._parents,t,n)}function tb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Hh(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=gy(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&py(p,t,n,h,f,m);a.push(f),o.push(u)}return new Sb(a,o,t,n)}var nb=O_.prototype.constructor;function rb(){return new nb(this._groups,this._parents)}function ib(e,t){var n,r,i;return function(){var a=Fg(this,e),o=(this.style.removeProperty(e),Fg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ab(e){return function(){this.style.removeProperty(e)}}function ob(e,t,n){var r,i=n+``,a;return function(){var o=Fg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function sb(e,t,n){var r,i,a;return function(){var o=Fg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Fg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function cb(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=hy(this,e),l=c.on,u=c.value[a]==null?s||=ab(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function lb(e,t,n){var r=(e+=``)==`transform`?Hv:wy;return t==null?this.styleTween(e,ib(e,r)).on(`end.style.`+e,ab(e)):typeof t==`function`?this.styleTween(e,sb(e,r,Cy(this,`style.`+e,t))).each(cb(this._id,e)):this.styleTween(e,ob(e,r,t),n).on(`end.style.`+e,null)}function ub(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function db(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ub(e,a,n)),r}return a._value=t,a}function fb(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,db(e,t,n??``))}function pb(e){return function(){this.textContent=e}}function mb(e){return function(){var t=e(this);this.textContent=t??``}}function hb(e){return this.tween(`text`,typeof e==`function`?mb(Cy(this,`text`,e)):pb(e==null?``:e+``))}function gb(e){return function(t){this.textContent=e.call(this,t)}}function _b(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&gb(r)),t}return r._value=e,r}function vb(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,_b(e))}function yb(){for(var e=this._name,t=this._id,n=wb(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=gy(c,t);py(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Sb(r,this._parents,e,n)}function bb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=hy(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var xb=0;function Sb(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Cb(e){return O_().transition(e)}function wb(){return++xb}var Tb=O_.prototype;Sb.prototype=Cb.prototype={constructor:Sb,select:eb,selectAll:tb,selectChild:Tb.selectChild,selectChildren:Tb.selectChildren,filter:qy,merge:Jy,selection:rb,transition:yb,call:Tb.call,nodes:Tb.nodes,node:Tb.node,size:Tb.size,empty:Tb.empty,each:Tb.each,on:Zy,attr:jy,attrTween:Iy,style:lb,styleTween:fb,text:hb,textTween:vb,remove:$y,tween:Sy,delay:zy,duration:Hy,ease:Wy,easeVarying:Ky,end:bb,[Symbol.iterator]:Tb[Symbol.iterator]};function Eb(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Db={time:null,delay:0,duration:250,ease:Eb};function Ob(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function kb(e){var t,n;e instanceof Sb?(t=e._id,e=e._name):(t=wb(),(n=Db).time=ty(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&py(c,e,t,l,o,n||Ob(c,t));return new Sb(r,this._parents,e,t)}O_.prototype.interrupt=yy,O_.prototype.transition=kb;var{abs:Ab,max:jb,min:Mb}=Math;[`w`,`e`].map(Nb),[`n`,`s`].map(Nb),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Nb);function Nb(e){return{type:e}}var Pb=Math.PI,Fb=2*Pb,Ib=1e-6,Lb=Fb-Ib;function Rb(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zb(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Rb;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Bb=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Rb:zb(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Ib)if(!(Math.abs(u*s-c*l)>Ib)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Pb-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ib&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ib||Math.abs(this._y1-l)>Ib)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Fb+Fb),d>Lb?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ib&&this._append`A${n},${n},0,${+(d>=Pb)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Vb(){return new Bb}Vb.prototype=Bb.prototype;function Hb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Ub(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Wb(e){return e=Ub(Math.abs(e)),e?e[1]:NaN}function Gb(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Kb(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var qb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jb(e){if(!(t=qb.exec(e)))throw Error(`invalid format: `+e);var t;return new Yb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jb.prototype=Yb.prototype;function Yb(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Yb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Xb(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Zb;function Qb(e,t){var n=Ub(e,t);if(!n)return Zb=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Zb=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Ub(e,Math.max(0,t+a-1))[0]}function $b(e,t){var n=Ub(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var ex={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Hb,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$b(e*100,t),r:$b,s:Qb,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function tx(e){return e}var nx=Array.prototype.map,rx=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function ix(e){var t=e.grouping===void 0||e.thousands===void 0?tx:Gb(nx.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?tx:Kb(nx.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=Jb(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):ex[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=ex[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Xb(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Zb!==void 0?rx[8+Zb/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(Wb(t)/3)))*3,r=10**-n,i=l((e=Jb(e),e.type=`f`,e),{suffix:rx[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var ax,ox,sx;cx({thousands:`,`,grouping:[3],currency:[`$`,``]});function cx(e){return ax=ix(e),ox=ax.format,sx=ax.formatPrefix,ax}function lx(e){return Math.max(0,-Wb(Math.abs(e)))}function ux(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wb(t)/3)))*3-Wb(Math.abs(e)))}function dx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wb(t)-Wb(e))+1}function fx(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function px(){return this.eachAfter(fx)}function mx(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function hx(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function gx(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function _x(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function vx(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yx(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bx(e){for(var t=this,n=xx(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function xx(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Sx(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Cx(){return Array.from(this)}function wx(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Tx(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ex(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function Dx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ax)):t===void 0&&(t=kx);for(var n=new Nx(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Nx(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Mx)}function Ox(){return Dx(this).eachBefore(jx)}function kx(e){return e.children}function Ax(e){return Array.isArray(e)?e[1]:null}function jx(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mx(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Nx(e){this.data=e,this.depth=this.height=0,this.parent=null}Nx.prototype=Dx.prototype={constructor:Nx,count:px,each:mx,eachAfter:gx,eachBefore:hx,find:_x,sum:vx,sort:yx,path:bx,ancestors:Sx,descendants:Cx,leaves:wx,links:Tx,copy:Ox,[Symbol.iterator]:Ex};function Px(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Fx(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function Ix(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(Px),i}function a(e,t){return function(r){r.children&&Fx(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=s}}return i.round=function(e){return arguments.length?(r=!!e,i):r},i.size=function(n){return arguments.length?(e=+n[0],t=+n[1],i):[e,t]},i.padding=function(e){return arguments.length?(n=+e,i):n},i}function Lx(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Rx(e){return function(){return e}}function zx(e){return+e}var Bx=[0,1];function Vx(e){return e}function Hx(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Rx(isNaN(t)?NaN:.5)}function Ux(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Wx(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Hx(i,r),a=n(o,a)):(r=Hx(r,i),a=n(a,o)),function(e){return a(r(e))}}function Gx(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Hx(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=_h(e,t,1,r)-1;return a[n](i[n](t))}}function Kx(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qx(){var e=Bx,t=Bx,n=Nv,r,i,a,o=Vx,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Vx&&(o=Ux(e[0],e[n-1])),s=n>2?Gx:Wx,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Ev))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,zx),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Pv,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Vx,u()):o!==Vx},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Jx(){return qx()(Vx,Vx)}function Yx(e,t,n,r){var i=wh(e,t,n),a;switch(r=Jb(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ux(i,o))&&(r.precision=a),sx(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=dx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=lx(i))&&(r.precision=a-(r.type===`%`)*2);break}return ox(r)}function Xx(e){var t=e.domain;return e.ticks=function(e){var n=t();return Sh(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Yx(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=Ch(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Zx(){var e=Jx();return e.copy=function(){return Kx(e,Zx())},Lx.apply(e,arguments),Xx(e)}function Qx(e){return function(){return e}}var $x=Math.abs,eS=Math.atan2,tS=Math.cos,nS=Math.max,rS=Math.min,iS=Math.sin,aS=Math.sqrt,oS=Math.PI,sS=oS/2,cS=2*oS;function lS(e){return e>1?0:e<-1?oS:Math.acos(e)}function uS(e){return e>=1?sS:e<=-1?-sS:Math.asin(e)}function dS(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Bb(t)}function fS(e){return e.innerRadius}function pS(e){return e.outerRadius}function mS(e){return e.startAngle}function hS(e){return e.endAngle}function gS(e){return e&&e.padAngle}function _S(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function vS(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/aS(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*aS(nS(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function yS(){var e=fS,t=pS,n=Qx(0),r=null,i=mS,a=hS,o=gS,s=null,c=dS(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-sS,m=a.apply(this,arguments)-sS,h=$x(m-p),g=m>p;if(s||=l=c(),f<d&&(u=f,f=d,d=u),!(f>1e-12))s.moveTo(0,0);else if(h>cS-1e-12)s.moveTo(f*tS(p),f*iS(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*tS(m),d*iS(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):aS(d*d+f*f)),T=rS($x(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var A=uS(w/d*iS(C)),j=uS(w/f*iS(C));(x-=A*2)>1e-12?(A*=g?1:-1,y+=A,b-=A):(x=0,y=b=(p+m)/2),(S-=j*2)>1e-12?(j*=g?1:-1,_+=j,v-=j):(S=0,_=v=(p+m)/2)}var M=f*tS(_),N=f*iS(_),P=d*tS(b),F=d*iS(b);if(T>1e-12){var I=f*tS(v),L=f*iS(v),R=d*tS(y),z=d*iS(y),B;if(h<oS)if(B=_S(M,N,R,z,I,L,P,F)){var ee=M-B[0],te=N-B[1],ne=I-B[0],V=L-B[1],re=1/iS(lS((ee*ne+te*V)/(aS(ee*ee+te*te)*aS(ne*ne+V*V)))/2),ie=aS(B[0]*B[0]+B[1]*B[1]);E=rS(T,(d-ie)/(re-1)),D=rS(T,(f-ie)/(re+1))}else E=D=0}S>1e-12?D>1e-12?(O=vS(R,z,M,N,f,D,g),k=vS(I,L,P,F,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D<T?s.arc(O.cx,O.cy,D,eS(O.y01,O.x01),eS(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,D,eS(O.y01,O.x01),eS(O.y11,O.x11),!g),s.arc(0,0,f,eS(O.cy+O.y11,O.cx+O.x11),eS(k.cy+k.y11,k.cx+k.x11),!g),s.arc(k.cx,k.cy,D,eS(k.y11,k.x11),eS(k.y01,k.x01),!g))):(s.moveTo(M,N),s.arc(0,0,f,_,v,!g)):s.moveTo(M,N),!(d>1e-12)||!(x>1e-12)?s.lineTo(P,F):E>1e-12?(O=vS(P,F,I,L,d,-E,g),k=vS(M,N,R,z,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E<T?s.arc(O.cx,O.cy,E,eS(O.y01,O.x01),eS(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,E,eS(O.y01,O.x01),eS(O.y11,O.x11),!g),s.arc(0,0,d,eS(O.cy+O.y11,O.cx+O.x11),eS(k.cy+k.y11,k.cx+k.x11),g),s.arc(k.cx,k.cy,E,eS(k.y11,k.x11),eS(k.y01,k.x01),!g))):s.arc(0,0,d,b,y,g)}if(s.closePath(),l)return s=null,l+``||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-oS/2;return[tS(r)*n,iS(r)*n]},l.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:Qx(+t),l):e},l.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:Qx(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:Qx(+e),l):n},l.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Qx(+e),l):r},l.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Qx(+e),l):i},l.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Qx(+e),l):a},l.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:Qx(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}function bS(e,t,n){this.k=e,this.x=t,this.y=n}bS.prototype={constructor:bS,scale:function(e){return e===1?this:new bS(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new bS(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var xS=new bS(1,0,0);SS.prototype=bS.prototype;function SS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xS;return e.__zoom}function CS(e,t=15){let n=e.split(` `),r=[],i=[],a=0;return n.forEach(e=>{a+e.length>t?(i.length&&r.push(i.join(` `)),i=[e],a=e.length):(i.push(e),a+=e.length+ +(i.length>0))}),i.length&&r.push(i.join(` `)),r}var{WILDCARD:wS,QUALIFIER:TS,LUCKY_LOSER:ES}=t.entryStatusConstants,DS=`text-anchor`,OS=`dominant-baseline`,kS=`fill-opacity`,AS=Object.assign({},...t.fixtures.countries.filter(e=>e.ioc).map(e=>({[e.ioc]:e.iso2})),...t.fixtures.countries.filter(e=>e.iso).map(e=>({[e.iso]:e.iso2})));function jS(e){let t=Math.floor(e.length/2),n=e.slice(0,t),r=e.slice(t).reverse();return[...n,...r]}function MS(e){if(e)switch(e){case wS:return`WC`;case TS:return`Q`;case ES:return`LL`;default:return e}}function NS(e,t){let n=[];for(let r of e)for(let e of r.sides){let i=r.matchUpStatus===`BYE`&&!e.participantName;n.push({name:e.participantName||(i?`BYE`:``),participantName:e.participantName||(i?`BYE`:void 0),drawPosition:e.drawPosition,seedNumber:e.seedNumber,entryStatus:MS(e.entryStatus),nationalityCode:e.nationalityCode,matchUp:r,depth:t,value:1})}return n}function PS(e,t){let n=e.winningSide!==void 0&&e.winningSide!==null?e.sides.find(t=>t.sideNumber===e.winningSide):void 0;!n&&e.matchUpStatus===`BYE`&&(n=e.sides.find(e=>e.participantName));let r=n?.participantName,i=r?t.get(r):void 0;return{winnerName:r,winnerSide:n,winnerLookup:i}}function FS(e,t,n,r){return e.map((e,i)=>{let a=i*2,o=[t[a],t[a+1]].filter(Boolean),{winnerName:s,winnerSide:c,winnerLookup:l}=PS(e,r);return{name:s||``,participantName:s,drawPosition:l?.drawPosition??c?.drawPosition,seedNumber:c?.seedNumber??l?.seedNumber,entryStatus:MS(c?.entryStatus)??l?.entryStatus,nationalityCode:c?.nationalityCode??l?.nationalityCode,scoreString:e.scoreString,matchUpStatus:e.matchUpStatus,matchUp:e,depth:n,children:o.length>0?o:void 0}})}function IS(e){let{roundMatchUps:t}=e,n=Object.keys(t).map(Number).sort((e,t)=>e-t);if(n.length===0)throw Error(`No round data found in draw`);let r=t[n[0]],i=jS(NS(r,n.length)),a=new Map;for(let e of i)e.participantName&&e.participantName!==`BYE`&&a.set(e.participantName,e);let o=FS(jS(r),i,n.length-1,a);for(let e=1;e<n.length;e++)o=FS(jS(t[n[e]]),o,n.length-1-e,a);return o.length===1?o[0]:{name:`Tournament`,depth:0,children:o}}function LS(e,t){if(!e)return;let{seedNumber:n,entryStatus:r,drawPosition:i,participantName:a}=e,o;if(a?.trim().toUpperCase()===`BYE`)o=`#B0BEC5`;else if(n){let e=Number(n),t=Zx().domain([1,32]).range([`0`,`1`]);o=Zx().domain(Th(0,1,1/7)).range([`#81D4FA`,`#42A5F5`,`#1E88E5`,`#1565C0`,`#5C6BC0`,`#673AB7`,`#9C27B0`])(Number(t(e)))}else if(r?.toUpperCase()===`WC`)o=`red`;else if(r&&(r===`Q`||r===`LL`))o=Zx().domain(Th(0,1,1/3)).range([`#FFF176`,`#FBC02D`,`#FF9800`])(t(i));else{let e=[`#C8E6C9`,`#81C784`,`#66BB6A`,`#4CAF50`,`#43A047`,`#388E3C`,`#2E7D32`,`#1B5E20`,`#A5D6A7`,`#90CAF9`,`#64B5F6`,`#42A5F5`,`#2196F3`,`#1E88E5`,`#1976D2`,`#1565C0`];o=Zx().domain(Th(0,1,1/e.length)).range(e)(t(i))}e.color=o,e.children&&e.children.forEach(n=>{n.participantName===e.participantName&&(n.color=o),LS(n,t)})}function RS(e,t){let n=[];return e.seedNumber?n.push(`Seed ${e.seedNumber}`):e.entryStatus&&n.push(e.entryStatus),t===7&&e.drawPosition&&n.push(`Draw ${e.drawPosition}`),n.length>0?n.join(` • `):void 0}function zS(e,t){let n=e.find(e=>e.data.participantName&&e.data.participantName!==t);return n?.data.participantName?n.data:void 0}function BS(e,t){let n=[e.participantName],r;if(t.children&&t.children.length>0)e.scoreString&&n.push(e.scoreString),r=zS(t.children,e.participantName),r&&n.push(r.participantName);else{let r=RS(e,t.depth);r&&n.push(r)}return{messageLines:n,opponentData:r}}function VS(e,t){return-(e*t/2)+t/2}function HS(e,t,n){let r=A_(e).append(`svg`).attr(`width`,t).attr(`height`,n).style(`display`,`block`),i=r.append(`g`).attr(`transform`,`translate(${t/2}, ${n/2})`);return{svg:r,g:i,flagsGroup:i.append(`g`).attr(`class`,`flags-group`),winningFlagsGroup:i.append(`g`).attr(`class`,`winning-flags-group`),losingFlagsGroup:i.append(`g`).attr(`class`,`losing-flags-group`)}}function US(e,t,n,r,i){let a=e.append(`text`).attr(`x`,t/2).attr(`y`,n/2).attr(DS,`middle`).attr(OS,`middle`).attr(`font-size`,`${r}px`).attr(`font-weight`,`bold`).style(`fill`,`var(--chc-text-primary, #333)`).attr(`pointer-events`,`none`),o=r+i*.5;return{centerText:a,centerText2:e.append(`text`).attr(`x`,t/2).attr(`y`,n/2+o).attr(DS,`middle`).attr(OS,`middle`).attr(`font-size`,`${i}px`).style(`fill`,`var(--chc-text-secondary, #666)`).attr(`pointer-events`,`none`)}}function WS(e,t,n,r,i,a,o){n&&(i?(t.flagsGroup.selectAll(`text`).remove(),t.winningFlagsGroup.selectAll(`text`).remove(),t.losingFlagsGroup.selectAll(`text`).remove()):e.selectAll(`text`).remove(),e.append(`text`).attr(`font-size`,`${o}px`).attr(DS,`middle`).attr(OS,`middle`).attr(`transform`,`translate(0, ${r*a})`).text(JS(n)))}function GS(e,n,r,i={}){let a=i.width||800,o=i.height||800,s=Math.min(a,o)/800*(i.textScaleFactor??1),c=28*s,l=24*s,u=30*s,d=r||i.title||`Tournament`,f=Object.assign({},...t.fixtures.countries.filter(e=>e.label).map(e=>({[e.ioc]:e.label}))),p=IS(n),m=Dx(p,e=>e.children).sum(e=>e.value||0),h=Math.min(a,o)/2,g=h/2,_=e=>e*h/200;Ix().size([2*Math.PI,h-g])(m),LS(p,Zx().domain([0,n.drawSize||128]).range([0,1]));let v=m.descendants(),y=yS().startAngle(e=>e.x0).endAngle(e=>e.x1).innerRadius(e=>e.y0+g).outerRadius(e=>e.y1+g),{svg:b,g:x,flagsGroup:S,winningFlagsGroup:C,losingFlagsGroup:w}=HS(e,a,o),T=new Set,E=e=>{e.nationalityCode&&T.add(e.nationalityCode),e.children&&e.children.forEach(E)};E(p);let D=Array.from(T),{centerText:O,centerText2:k}=US(b,a,o,c,l);function A(){let e=CS(d,15);O.text(``),O.selectAll(`tspan`).remove(),k.text(``),k.selectAll(`tspan`).remove(),O.selectAll(`tspan`).data(e).join(`tspan`).attr(`x`,a/2).attr(`dy`,(e,t)=>t===0?0:u).text(e=>e);let t=-(e.length*u/2)+u/2;O.attr(`y`,o/2+t),O.style(`display`,`block`),k.style(`display`,`none`)}function j(){if(S.selectAll(`text`).remove(),C.selectAll(`text`).remove(),w.selectAll(`text`).remove(),D.length===0)return;let e=Zx().domain([0,D.length]).range([0,Math.PI*2]),t=_(20),n=g-t+10;S.selectAll(`text`).data(D).join(`text`).attr(`font-size`,`${t}px`).attr(DS,`middle`).attr(OS,`middle`).attr(`transform`,(t,r)=>{let i=e(r);return`translate(${Math.cos(i)*n}, ${Math.sin(i)*n})`}).text(e=>JS(e)).style(`cursor`,`pointer`).on(`mouseover`,function(e,t){let n=f[t]||t;O.selectAll(`tspan`).remove(),O.attr(`y`,o/2),O.text(n).style(`display`,`block`),k.selectAll(`tspan`).remove(),k.text(``).style(`display`,`none`),N||x.selectAll(`path`).attr(kS,e=>e.data.nationalityCode===t?.9:.3)}).on(`mouseout`,function(){N||x.selectAll(`path`).attr(kS,.8),A()})}j(),A();let M=i.eventHandlers?.clickCenter;M&&x.insert(`circle`,`:first-child`).attr(`r`,g).attr(`fill`,`transparent`).style(`cursor`,`pointer`).on(`click`,M);let N=!1,P;function F(e,t){let n=t.data;if(n.participantName){let{messageLines:e,opponentData:r}=BS(n,t);r&&(n.opponent=r),O.selectAll(`tspan`).remove(),O.text(``),O.selectAll(`tspan`).data(e).join(`tspan`).attr(`x`,a/2).attr(`dy`,(e,t)=>t===0?0:u).text(e=>e);let i=VS(e.length,u);O.attr(`y`,o/2+i),O.style(`display`,`block`),k.style(`display`,`none`)}N?n.participantName?.toLowerCase()!==P?.toLowerCase()&&A_(e.currentTarget).attr(kS,.9):x.selectAll(`path`).attr(kS,e=>e.data.participantName===t.data.participantName?.9:.3);let r=_(30),i=g-r-10,s={flagsGroup:S,winningFlagsGroup:C,losingFlagsGroup:w};WS(C,s,n.nationalityCode,-1,!0,i,r),n.opponent&&WS(w,s,n.opponent.nationalityCode,1,!1,i,r)}function I(e,t){if(N){let n=t.data.participantName?.toLowerCase()===P?.toLowerCase();A_(e.currentTarget).attr(kS,n?1:.2)}else x.selectAll(`path`).attr(kS,.8);j(),A()}let L=i.eventHandlers?.clickSegment;function R(e,t){if(!L)return;let n=t.data;L({participantName:n.participantName,drawPosition:n.drawPosition,seedNumber:n.seedNumber,entryStatus:n.entryStatus,nationalityCode:n.nationalityCode,scoreString:n.scoreString,matchUpStatus:n.matchUpStatus,roundName:n.roundName,depth:n.depth,matchUp:n.matchUp})}let z=x.selectAll(`path`).data(v).join(`path`).attr(`d`,e=>y(e)).attr(`fill`,e=>e.data.color||`#ccc`).attr(kS,.8).attr(`stroke`,`#fff`).attr(`stroke-width`,1).on(`mouseover`,F).on(`mouseout`,I);L&&z.style(`cursor`,`pointer`).on(`click`,R),z.append(`title`).text(e=>{let t=e.data;return t.participantName?`${t.participantName}\nDraw: ${t.drawPosition||`N/A`}`:`${t.name}\nDepth: ${e.depth}`});function B(e){let t=0;return N=!!e,P=e,x.selectAll(`path`).attr(kS,n=>e?n.data.participantName?.toLowerCase()===e.toLowerCase()?(t+=1,1):.2:.8),t}function ee(e){b.style(`display`,e?`none`:`block`)}return{highlightPlayer:B,hide:ee}}function KS(e={}){return{render:(t,n,r)=>GS(t,n,r,e)}}function qS(e){return e?.length===2?e&&String.fromCodePoint!==void 0?e.toUpperCase().replaceAll(/./g,e=>String.fromCodePoint((e.codePointAt(0)??0)+127397)):e:``}function JS(e){return qS(AS[e]||e)}var{LUCKY_LOSER:YS,WILDCARD:XS,QUALIFIER:ZS}=t.entryStatusConstants;function QS(e){let t={};for(let[n,r]of Object.entries(e.roundMatchUps))t[Number(n)]=r.map(e=>({...e,winningSide:e.winningSide,drawPositions:e.drawPositions||[],scoreString:e.winningSide===1?e.score?.scoreStringSide1:e.winningSide===2?e.score?.scoreStringSide2:void 0,sides:(e.sides||[]).map(e=>({sideNumber:e.sideNumber,drawPosition:e.drawPosition,participantName:e.participant?.participantName,nationalityCode:e.participant?.person?.nationalityCode,seedNumber:e.seedNumber,entryStatus:e.participant?.entryStatus}))}));return{drawSize:(t[1]?.length||0)*2,roundMatchUps:t,seedAssignments:e.seedAssignments}}var $S={LL:YS,WC:XS,Q:ZS},eC=[`R128`,`R64`,`R32`,`R16`,`QF`,`SF`,`F`];function tC(e){let t=nC(e);if(t.length===0)return{drawSize:0,roundMatchUps:{}};let n=t[0].data,r=n.length,i=rC(n),a=iC(t,e),o={};o[1]=oC(n,a,t);for(let e=1;e<t.length;e++)o[e+1]=sC(e,t,a,i);return{drawSize:r,roundMatchUps:o}}function nC(e){let t=[],n=!1;for(let r of eC){let i=e[r];i&&i.length>0&&(n=!0),n&&i&&i.length>0&&t.push({key:r,data:i})}return t}function rC(e){let t=new Map;return e.forEach((e,n)=>{let r=cC(e.player);r&&r!==`BYE`&&t.set(r,{drawPosition:e.Draw??n+1,country:e.country,seed:e.seed,entry:e.entry})}),t}function iC(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=r+1<e.length?e[r+1].data:t.W||[],a=new Set;for(let e of i){let t=cC(e.player);t&&a.add(t)}n.set(e[r].key,a)}return n}function aC(e,t,n){if(e===`BYE`||t===`BYE`)return e===`BYE`?2:1;if(n.has(e))return 1;if(n.has(t))return 2}function oC(e,t,n){let r=[],i=t.get(n[0].key)||new Set;for(let t=0;t<e.length;t+=2){let a=e[t],o=e[t+1],s=cC(a?.player),c=cC(o?.player),l=s===`BYE`||c===`BYE`,u=aC(s,c,i),d;if(!l&&n.length>1){let e=n[1].data,t=u===1?s:c;d=e.find(e=>cC(e.player)===t)?.score}let f=l?`BYE`:u?`COMPLETED`:`TO_BE_PLAYED`;r.push({roundNumber:1,matchUpStatus:f,winningSide:u,drawPositions:[a?.Draw??t+1,o?.Draw??t+2],scoreString:d,sides:[uC(1,a,t+1),uC(2,o,t+2)]})}return r}function sC(e,t,n,r){let i=e+1,a=t[e].data,o=n.get(t[e].key)||new Set,s=[];for(let e=0;e<a.length;e+=2){let t=a[e],n=a[e+1],c=cC(t?.player),l=cC(n?.player),u=o.has(c)?1:o.has(l)?2:void 0,d=(u===1?t:u===2?n:void 0)?.score,f=u?`COMPLETED`:`TO_BE_PLAYED`;s.push({roundNumber:i,matchUpStatus:f,winningSide:u,drawPositions:[r.get(c)?.drawPosition??0,r.get(l)?.drawPosition??0],scoreString:d,sides:[dC(1,t,r),dC(2,n,r)]})}return s}function cC(e){if(!e)return``;let t=e.trim();return t.toUpperCase()===`BYE`?`BYE`:t}function lC(e){if(e)return $S[e.toUpperCase()]||e}function uC(e,t,n){if(!t)return{sideNumber:e,drawPosition:n};let r=cC(t.player);return{sideNumber:e,drawPosition:t.Draw??n,participantName:r||void 0,nationalityCode:t.country||void 0,seedNumber:t.seed?Number(t.seed):void 0,entryStatus:lC(t.entry)}}function dC(e,t,n){if(!t)return{sideNumber:e,drawPosition:0};let r=cC(t.player),i=n.get(r);return{sideNumber:e,drawPosition:i?.drawPosition??0,participantName:r||void 0,nationalityCode:t.country||i?.country||void 0,seedNumber:t.seed?Number(t.seed):i?.seed?Number(i.seed):void 0,entryStatus:lC(t.entry||i?.entry)}}var fC=`right`,pC=`font-medium`;function mC({target:e,button:t,stateChange:n}){let r=0,i=()=>(r+=1,`Item${r}`),a=document.createElement(`div`);t.class&&a.classList.add(t.class),a.classList.add(`dropdown`),t.id&&(a.id=t.id),t.align===fC&&a.classList.add(`is-right`);let o=e=>e.classList.contains(`is-active`),s=()=>{o(a)&&a.classList.remove(`is-active`)},c=e=>o(e)?(e.classList.remove(`is-active`),!1):(e.classList.add(`is-active`),!0);a.onmouseleave=s,a.onclick=()=>c(a);let l=document.createElement(`div`);l.classList.add(`dropdown-trigger`);let u=document.createElement(`button`);u.className=`button font-medium`,t.intent&&u.classList.add(t.intent),u.setAttribute(`aria-haspopup`,`true`);let d=document.createElement(`span`);B(t.onClick)&&(d.onclick=t.onClick),d.style.cssText=`margin-right: 1em`,d.innerHTML=t.label,u.appendChild(d);let f=document.createElement(`span`);B(t.onClick)&&(f.onclick=t.onClick),f.innerHTML=`
|
|
214
|
+
`,`2) content: () => element.cloneNode(true)`].join(` `))}var s=i.reduce(function(e,t){var n=t&&pm(t,r);return n&&e.push(n),e},[]);return Cp(e)?s[0]:s}mm.defaultProps=Zp,mm.setDefaultProps=$p,mm.currentInput=Pp,Object.assign({},Dd,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),mm.setDefaultProps({render:lm});var hm=`#000000.#434343.#666666.#999999.#b7b7b7.#cccccc.#d9d9d9.#ffffff.#980000.#ff0000.#ff9900.#ffff00.#00ff00.#00ffff.#4a86e8.#0000ff.#9900ff.#ff00ff.#e6b8af.#f4cccc.#fce5cd.#fff2cc.#d9ead3.#d0e0e3.#c9daf8.#cfe2f3.#d9d2e9.#ead1dc`.split(`.`),gm=`notes-toolbar-recent-colors`,_m=8;function vm(){try{return JSON.parse(localStorage.getItem(gm)||`[]`)}catch{return[]}}function ym(e){let t=vm().filter(t=>t!==e);t.unshift(e),t.length>_m&&(t=t.slice(0,_m)),localStorage.setItem(gm,JSON.stringify(t))}function bm(e={}){let t=document.createElement(`div`);return t.className=`notes-toolbar`,t.appendChild(Tm(e)),t.appendChild(Em(e)),t.appendChild(Dm(e)),t.appendChild(jm(e)),t.appendChild(Pm(e)),t.appendChild(Fm(e)),t.appendChild(Lm(e)),t}function xm(e,t){for(let[n,r]of Object.entries(t)){let t=e.querySelector(`[data-action="${n}"]`);t&&t.classList.toggle(`is-active`,r)}}function Sm(e,t){let n=e.querySelector(`[data-action="heading"]`);n&&(n.value=t===!1?`0`:String(t))}function Cm(){let e=document.createElement(`div`);return e.className=`notes-toolbar-group`,e}function wm(e,t,n,r){let i=document.createElement(`button`);return i.className=`notes-toolbar-btn`,i.dataset.action=e,i.title=n,i.type=`button`,i.innerHTML=t,r&&i.addEventListener(`click`,r),i}function Tm(e){let t=Cm(),n=document.createElement(`select`);n.dataset.action=`heading`,n.title=`Text style`;for(let e of[{value:`0`,label:`Paragraph`},{value:`1`,label:`Heading 1`},{value:`2`,label:`Heading 2`},{value:`3`,label:`Heading 3`},{value:`4`,label:`Heading 4`},{value:`5`,label:`Heading 5`},{value:`6`,label:`Heading 6`}]){let t=document.createElement(`option`);t.value=e.value,t.textContent=e.label,n.appendChild(t)}return n.addEventListener(`change`,()=>{let t=parseInt(n.value,10);e.onHeading?.(t===0?!1:t)}),t.appendChild(n),t}function Em(e){let t=Cm();return t.appendChild(wm(`bold`,`<b>B</b>`,`Bold`,e.onBold)),t.appendChild(wm(`italic`,`<i>I</i>`,`Italic`,e.onItalic)),t.appendChild(wm(`underline`,`<u>U</u>`,`Underline`,e.onUnderline)),t.appendChild(wm(`strike`,`<s>S</s>`,`Strikethrough`,e.onStrike)),t}function Dm(e){let t=Cm();return t.appendChild(Om(`color`,`A`,`Text color`,`#000000`,t=>{ym(t),e.onColor?.(t)})),t.appendChild(Om(`background`,`A`,`Background color`,`#ffff00`,t=>{ym(t),e.onBackground?.(t)})),t}function Om(e,t,n,r,i){let a=document.createElement(`button`);a.className=`notes-toolbar-btn notes-toolbar-color-btn`,a.dataset.action=e,a.title=n,a.type=`button`;let o=document.createElement(`span`);o.className=`notes-toolbar-color-letter`,o.textContent=t,a.appendChild(o);let s=document.createElement(`span`);s.className=`notes-toolbar-color-bar`,s.style.backgroundColor=r,a.appendChild(s);let c;return a.addEventListener(`click`,()=>{if(c){c.destroy(),c=void 0;return}c=mm(a,{content:km(r,e=>{s.style.backgroundColor=e,i(e),c?.destroy(),c=void 0}),theme:`light-border`,trigger:`manual`,interactive:!0,placement:`bottom-start`,onHidden:()=>{c?.destroy(),c=void 0}}),c.show()}),a}function km(e,t){let n=document.createElement(`div`);n.className=`notes-color-panel`;let r=document.createElement(`div`);r.className=`notes-color-swatches`;for(let n of hm)r.appendChild(Am(n,n===e,t));n.appendChild(r);let i=vm();if(i.length){let r=document.createElement(`div`);r.className=`notes-color-section-label`,r.textContent=`Recent`,n.appendChild(r);let a=document.createElement(`div`);a.className=`notes-color-swatches`;for(let n of i)a.appendChild(Am(n,n===e,t));n.appendChild(a)}let a=document.createElement(`div`);a.className=`notes-color-custom-row`;let o=document.createElement(`input`);o.type=`color`,o.value=e,o.className=`notes-color-custom-input`;let s=document.createElement(`label`);return s.className=`notes-color-custom-label`,s.textContent=`Custom...`,s.addEventListener(`click`,()=>o.click()),o.addEventListener(`input`,()=>t(o.value)),a.appendChild(o),a.appendChild(s),n.appendChild(a),n}function Am(e,t,n){let r=document.createElement(`button`);return r.type=`button`,r.className=`notes-color-swatch`,t&&r.classList.add(`is-selected`),r.style.backgroundColor=e,(e===`#ffffff`||e===`#fff`)&&(r.style.border=`1px solid var(--chc-border-secondary)`),r.title=e,r.addEventListener(`click`,()=>n(e)),r}function jm(e){let t=Cm();return t.appendChild(wm(`orderedList`,Mm(16,16,`<path d="M3 2h12v2H3zm0 5h12v2H3zm0 5h12v2H3z" fill="currentColor"/><text x="0" y="4" font-size="3.5" fill="currentColor">1</text><text x="0" y="9" font-size="3.5" fill="currentColor">2</text><text x="0" y="14" font-size="3.5" fill="currentColor">3</text>`),`Ordered list`,e.onOrderedList)),t.appendChild(wm(`bulletList`,Mm(16,16,`<circle cx="1.5" cy="3" r="1.5" fill="currentColor"/><circle cx="1.5" cy="8" r="1.5" fill="currentColor"/><circle cx="1.5" cy="13" r="1.5" fill="currentColor"/><path d="M5 2h10v2H5zm0 5h10v2H5zm0 5h10v2H5z" fill="currentColor"/>`),`Bullet list`,e.onBulletList)),t}function Mm(e,t,n){return`<svg width="${e}" height="${t}" viewBox="0 0 ${e} ${t}" xmlns="http://www.w3.org/2000/svg">${n}</svg>`}var Nm={alignLeft:Mm(16,16,`<path d="M1 2h14v2H1zm0 4h9v2H1zm0 4h14v2H1zm0 4h9v2H1z" fill="currentColor"/>`),alignCenter:Mm(16,16,`<path d="M1 2h14v2H1zm3.5 4h7v2h-7zM1 10h14v2H1zm3.5 4h7v2h-7z" fill="currentColor"/>`),alignRight:Mm(16,16,`<path d="M1 2h14v2H1zm6 4h8v2H7zM1 10h14v2H1zm6 4h8v2H7z" fill="currentColor"/>`),alignJustify:Mm(16,16,`<path d="M1 2h14v2H1zm0 4h14v2H1zm0 4h14v2H1zm0 4h14v2H1z" fill="currentColor"/>`)};function Pm(e){let t=Cm();return t.appendChild(wm(`alignLeft`,Nm.alignLeft,`Align left`,()=>e.onAlign?.(`left`))),t.appendChild(wm(`alignCenter`,Nm.alignCenter,`Align center`,()=>e.onAlign?.(`center`))),t.appendChild(wm(`alignRight`,Nm.alignRight,`Align right`,()=>e.onAlign?.(`right`))),t.appendChild(wm(`alignJustify`,Nm.alignJustify,`Justify`,()=>e.onAlign?.(`justify`))),t}function Fm(e){let t=Cm();t.appendChild(wm(`blockquote`,`“`,`Blockquote`,e.onBlockquote)),t.appendChild(wm(`codeBlock`,`</>`,`Code block`,e.onCodeBlock));let n=wm(`link`,`⇗`,`Insert link`);Im(n,`Enter URL`,`https://`,t=>e.onLink?.(t)),t.appendChild(n);let r=wm(`video`,`▷`,`Insert video`);return Im(r,`YouTube URL`,`https://youtube.com/...`,t=>e.onVideo?.(t)),t.appendChild(r),t}function Im(e,t,n,r){let i;e.addEventListener(`click`,()=>{if(i){i.destroy(),i=void 0;return}let a=document.createElement(`div`);a.className=`notes-url-panel`;let o=document.createElement(`div`);o.className=`notes-url-label`,o.textContent=t,a.appendChild(o);let s=document.createElement(`input`);s.type=`url`,s.className=`notes-url-input`,s.placeholder=n,a.appendChild(s);let c=document.createElement(`div`);c.className=`notes-url-actions`;let l=document.createElement(`button`);l.type=`button`,l.className=`button notes-url-cancel`,l.textContent=`Cancel`,l.addEventListener(`click`,()=>{i?.destroy(),i=void 0});let u=document.createElement(`button`);u.type=`button`,u.className=`button is-info notes-url-confirm`,u.textContent=`Insert`,u.addEventListener(`click`,()=>{let e=s.value.trim();e&&r(e),i?.destroy(),i=void 0}),c.appendChild(l),c.appendChild(u),a.appendChild(c),s.addEventListener(`keydown`,e=>{e.key===`Enter`?(e.preventDefault(),u.click()):e.key===`Escape`&&l.click()}),i=mm(e,{content:a,theme:`light-border`,trigger:`manual`,interactive:!0,placement:`bottom-start`,onShown:()=>setTimeout(()=>s.focus(),0),onHidden:()=>{i?.destroy(),i=void 0}}),i.show()})}function Lm(e){let t=Cm();return t.appendChild(wm(`clearFormatting`,`⊘`,`Clear formatting`,e.onClearFormatting)),t}function Rm(e,t,n){if(!e)return{};let r=document.createElement(`aside`);r.classList.add(`menu`);let i={},a=e=>n&&e.close!==!1?t=>{t.stopPropagation(),n(),e.onClick()}:t=>{t.stopPropagation(),e.onClick()},o=0,s=()=>(o+=1,o),c=e=>e?.heading||e?.text||e?.label||`Item ${s()}`,l=e=>{let t=document.createElement(`li`);if(t.className=`font-medium`,e.style&&(t.style.cssText=e.style),e.onClick){let n=e.fontSize||`1em`;if(e.divider){let e=document.createElement(`hr`);e.classList.add(`dropdown-divider`),t.appendChild(e)}else{let r=document.createElement(`a`),i=e.disabled?`0.4`:`1`;r.style.cssText=`text-decoration: none; opacity: ${i}; font-size: ${n}`,e.class&&r.classList.add(e.class),e.color&&(r.style.color=e.color),e.heading&&(r.style.fontWeight=`bold`),e.disabled||(r.onclick=a(e)),r.innerHTML=c(e),t.appendChild(r)}}else t.innerHTML=c(e),e.disabled||(t.onclick=e.onClick);return t},u;for(let e of t||[])if(!e.hide){if(e.items){if(e.text){let t=document.createElement(`p`);t.className=`menu-label font-medium`,t.innerHTML=e.text,r.appendChild(t)}let t=document.createElement(`ul`);t.className=`menu-list`;for(let n of e.items)n.hide||t.appendChild(l(n));r.appendChild(t)}else if(e.type===`input`){let{field:t,inputElement:n}=ln(e);e.focus&&(u=n),i[e.field]=n,r.appendChild(t)}else if(e.type===`divider`){let e=document.createElement(`hr`);e.classList.add(`dropdown-divider`),r.appendChild(e)}}return e.appendChild(r),{focusElement:u}}function zm(e){return typeof e==`function`}var Bm;function Vm(e){Bm&&=(Bm?.destroy(!0),void 0),e?.remove&&e.remove()}function Hm(e){let{title:t,options:n,menuItems:r=[],coords:i,callback:a,config:o}=e,{target:s,items:c}=e;if(!n?.length&&!c?.length&&!r)return;Vm();let l=document.createElement(`div`),u;return s||=i?.evt?.target,s&&(Bm=mm(s,{content:()=>(c=c?.filter(e=>!e.hide&&!e.disabled).map(e=>({...e,onClick:()=>{Vm(l),zm(e.onClick)&&e.onClick()}}))||n?.filter(e=>!e.hide&&!e.disabled).map(e=>({text:typeof e==`object`?e.option:e,style:e.style,onClick:()=>{e.subMenu?Bm.setContent(`IMPLEMENT SUB MENU`):zm(e.onClick)?(Vm(l),e.onClick()):zm(a)&&a&&(Vm(l),a(typeof e==`object`?{...e,coords:i}:e))}})),u=Rm(l,[{text:t,items:c},...r]).focusElement,l),theme:`light-border`,trigger:`click`,onShown:()=>{u&&setTimeout(()=>u?.focus(),0)},...o}),Bm.show(),Bm.setProps({interactive:!0})),Bm}var X=`court-line`;function Z(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,r);return n}function Um(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);return n.setAttribute(`viewBox`,e),n.setAttribute(`class`,t),n.setAttribute(`fill`,`none`),n.style.width=`100%`,n.style.height=`auto`,n.style.display=`block`,n}function Wm(e){let t=Um(`0 0 360 780`,e);for(let e of[`M 0 0 L 360 0 L 360 780 L 0 780 Z`,`M 45 0 L 45 780`,`M 315 0 L 315 780`,`M 0 390 L 360 390`,`M 45 210 L 315 210`,`M 45 570 L 315 570`,`M 180 210 L 180 570`,`M 180 0 L 180 20`,`M 180 760 L 180 780`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Gm(e){let t=Um(`0 0 500 470`,e),n=[Z(`rect`,{x:`0`,y:`0`,width:`500`,height:`470`,class:X}),Z(`circle`,{cx:`250`,cy:`470`,r:`60`,class:X}),Z(`line`,{x1:`0`,y1:`470`,x2:`500`,y2:`470`,class:X}),Z(`rect`,{x:`170`,y:`0`,width:`160`,height:`190`,class:X}),Z(`circle`,{cx:`250`,cy:`190`,r:`60`,class:X}),Z(`line`,{x1:`220`,y1:`40`,x2:`280`,y2:`40`,class:X}),Z(`circle`,{cx:`250`,cy:`52`,r:`12`,class:X}),Z(`path`,{d:`M 30 0 L 30 90 A 220 220 0 0 0 470 90 L 470 0`,class:X})];for(let e of n)t.appendChild(e);return t}function Km(e){let t=Um(`0 0 500 440`,e),n=[Z(`path`,{d:`M 20 170 A 350 400 0 0 1 480 170`,class:X}),Z(`line`,{x1:`250`,y1:`400`,x2:`20`,y2:`170`,class:X}),Z(`line`,{x1:`250`,y1:`400`,x2:`480`,y2:`170`,class:X}),Z(`path`,{d:`M 250 400 L 314 336 L 250 273 L 186 336 Z`,class:X}),Z(`path`,{d:`M 340 355 A 100 100 0 0 1 160 355`,class:X}),Z(`line`,{x1:`340`,y1:`355`,x2:`265`,y2:`405`,class:X}),Z(`line`,{x1:`160`,y1:`355`,x2:`235`,y2:`405`,class:X}),Z(`path`,{d:`M 235 405 A 18 18 0 0 1 265 405`,class:X}),Z(`circle`,{cx:`250`,cy:`340`,r:`9`,class:X}),Z(`line`,{x1:`247`,y1:`339`,x2:`253`,y2:`339`,class:X}),Z(`path`,{d:`M 244 398 L 244 404 L 250 408 L 256 404 L 256 398 Z`,class:X}),Z(`rect`,{x:`310`,y:`332`,width:`8`,height:`8`,transform:`rotate(45 314 336)`,class:X}),Z(`rect`,{x:`246`,y:`269`,width:`8`,height:`8`,transform:`rotate(45 250 273)`,class:X}),Z(`rect`,{x:`182`,y:`332`,width:`8`,height:`8`,transform:`rotate(45 186 336)`,class:X}),Z(`rect`,{x:`230`,y:`393`,width:`8`,height:`18`,class:X}),Z(`rect`,{x:`262`,y:`393`,width:`8`,height:`18`,class:X})];for(let e of n)t.appendChild(e);return t}function qm(e){let t=Um(`0 0 850 2000`,e),n=[Z(`rect`,{x:`0`,y:`0`,width:`850`,height:`2000`,rx:`280`,ry:`280`,class:X}),Z(`line`,{x1:`0`,y1:`1000`,x2:`850`,y2:`1000`,class:X}),Z(`circle`,{cx:`425`,cy:`1000`,r:`60`,class:X}),Z(`line`,{x1:`0`,y1:`650`,x2:`850`,y2:`650`,class:X}),Z(`line`,{x1:`0`,y1:`1350`,x2:`850`,y2:`1350`,class:X}),Z(`line`,{x1:`140`,y1:`300`,x2:`710`,y2:`300`,class:X}),Z(`line`,{x1:`140`,y1:`1700`,x2:`710`,y2:`1700`,class:X}),Z(`path`,{d:`M 395 300 A 40 40 0 0 1 455 300`,class:X}),Z(`path`,{d:`M 395 1700 A 40 40 0 0 0 455 1700`,class:X}),Z(`circle`,{cx:`270`,cy:`650`,r:`50`,class:X}),Z(`circle`,{cx:`580`,cy:`650`,r:`50`,class:X}),Z(`circle`,{cx:`270`,cy:`1350`,r:`50`,class:X}),Z(`circle`,{cx:`580`,cy:`1350`,r:`50`,class:X})];for(let e of n)t.appendChild(e);return t}function Jm(e){let t=Um(`0 0 200 440`,e);for(let e of[`M 0 0 L 200 0 L 200 440 L 0 440 Z`,`M 0 220 L 200 220`,`M 0 150 L 200 150`,`M 0 290 L 200 290`,`M 100 0 L 100 150`,`M 100 290 L 100 440`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Ym(e){let t=Um(`0 0 200 440`,e);for(let e of[`M 0 0 L 200 0 L 200 440 L 0 440 Z`,`M 18 0 L 18 440`,`M 182 0 L 182 440`,`M 0 220 L 200 220`,`M 0 146 L 200 146`,`M 0 294 L 200 294`,`M 0 30 L 200 30`,`M 0 410 L 200 410`,`M 100 146 L 100 220`,`M 100 220 L 100 294`])t.appendChild(Z(`path`,{d:e,class:X}));return t}function Xm(e){let t=Um(`0 0 100 200`,e);for(let e of[`M 0 0 L 100 0 L 100 200 L 0 200 Z`,`M 0 100 L 100 100`,`M 0 69.5 L 100 69.5`,`M 0 130.5 L 100 130.5`,`M 50 69.5 L 50 67.5`,`M 50 130.5 L 50 132.5`])t.appendChild(Z(`path`,{d:e,class:X}));return t}var Zm={name:`courthive-components`,version:`1.0.4`,engines:{node:`>=20.19.0 < 25`},description:`Components for competitions projects`,files:[`dist`],main:`./dist/courthive-components.umd.js`,module:`./dist/courthive-components.es.js`,types:`./dist/index.d.ts`,exports:{".":{types:`./dist/index.d.ts`,import:`./dist/courthive-components.es.js`,require:`./dist/courthive-components.umd.js`},"./dist/*":`./dist/*`},repository:{type:`git`,url:`git+https://github.com/CourtHive/courthive-components.git`},keywords:[`tournament`,`match`,`score`,`vanillajs`,`bracket`],author:`Charles Allen`,license:`MIT`,bugs:{url:`https://github.com/CourtHive/courthive-components/issues`},homepage:`https://courthive.github.io/courthive-component`,scripts:{commits:`git log $(git describe --tags --abbrev=0)..HEAD --oneline --no-merges --pretty=format:'%s: %h' | sed '/courthive-components/d'`,release:`npm run release:patch`,test:`vitest run`,"test:watch":`vitest`,"test:ui":`vitest --ui`,dev:`vite`,build:`vite build`,prepublishOnly:`npm run build`,preview:`vite preview`,storybook:`storybook dev -p 6006`,"build-storybook":`storybook build`,"deploy-storybook":`gh-pages -d storybook-static`,"pre-commit":`lint-staged`,predeploy:`npm run build-storybook`,prebuild:`rm -rf dist/*`,lint:`eslint src --fix --cache`,"lint:report":`eslint src & eslint --cache src -f json > eslint-report.json`,format:`prettier --write src`,"release:major":`npm run commits && npm version $(semver $npm_package_version -i major) && git push && git push --tags`,"release:minor":`npm run commits && npm version $(semver $npm_package_version -i minor) && git push && git push --tags`,"release:patch":`npm run commits && npm version $(semver $npm_package_version -i patch) && git push && git push --tags`,"release:beta":`npm run commits && npm version $(semver $npm_package_version -i prerelease --preid beta) && git push && git push --tags`,"patch:beta":`npm run commits && npm version $(semver $npm_package_version -i prerelease --preid beta) && npm publish --tag beta`},"lint-staged":{"*.{js,ts}":`eslint --cache --fix`,"*":`prettier --ignore-unknown --write`},devDependencies:{"@chromatic-com/storybook":`^5.0.0`,"@commitlint/cli":`20.5.0`,"@commitlint/config-conventional":`20.5.0`,"@eslint/js":`^10.0.1`,"@fortawesome/fontawesome-free":`^7.2.0`,"@storybook/addon-docs":`^10.2.17`,"@storybook/html-vite":`^10.2.17`,"@storybook/test-runner":`^0.24.0`,"@types/d3":`^7.4.3`,"@types/vanillajs-datepicker":`^1.3.5`,"@typescript-eslint/eslint-plugin":`8.59.0`,"@typescript-eslint/parser":`8.59.0`,"@vitest/browser-playwright":`^4.0.16`,"@vitest/coverage-v8":`^4.0.16`,eslint:`10.2.1`,"eslint-plugin-sonarjs":`4.0.3`,"eslint-plugin-storybook":`^10.2.17`,"gh-pages":`6.3.0`,globals:`^17.3.0`,"happy-dom":`^20.8.3`,husky:`9.1.7`,"lint-staged":`16.4.0`,playwright:`^1.57.0`,prettier:`^3.8.1`,semver:`7.7.4`,storybook:`^10.2.17`,"tabulator-tables":`6.4.0`,typescript:`^6.0.2`,vite:`8.0.9`,"vite-plugin-dts":`^4.5.4`,vitest:`^4.0.16`},dependencies:{awesomplete:`1.1.7`,"class-variance-authority":`0.7.1`,classnames:`2.5.1`,d3:`^7.9.0`,dayjs:`1.11.20`,"focus-trap":`^8.0.0`,"timepicker-ui":`^4.1.2`,"tippy.js":`6.3.7`,"tods-competition-factory":`^3.1.3`,"vanillajs-datepicker":`1.3.4`}};function Qm(){return Zm.version}var $m={SET3_S6_TB7:`SET3-S:6/TB7`,SET3_S6_TB7_F_TB10:`SET3-S:6/TB7-F:TB10`,SET3_S6_TB10:`SET3-S:6/TB10`,SET3_S6_F_TB10:`SET3-S:6-F:TB10`,SET3_S6_TB7_NOAD:`SET3-S:6/TB7NOAD`,SET3_S8_TB7:`SET3-S:8/TB7`,SET3_S8_TB7_AT7:`SET3-S:8/TB7@7`,SET3_S4_TB7:`SET3-S:4/TB7`,SET3_S4_TB7_F_TB10:`SET3-S:4/TB7-F:TB10`,SET3_S4_TB5_AT3_F_TB10:`SET3-S:4/TB5@3-F:TB10`,SET5_S6_TB7:`SET5-S:6/TB7`,SET5_S6_TB7_F_TB10:`SET5-S:6/TB7-F:TB10`,SET1_S6_TB7:`SET1-S:6/TB7`,SET1_S6_TB10:`SET1-S:6/TB10`,SET1_S6_TB7_AT5:`SET1-S:6/TB7@5`,SET1_S8_TB7:`SET1-S:8/TB7`,SET1_S4_TB7:`SET1-S:4/TB7`,SET1_S5_TB9_AT4:`SET1-S:5/TB9@4`,SET1_S_TB7:`SET1-S:T7`,SET1_S_TB10:`SET1-S:TB10`,SET1_S_TB21:`SET1-S:T21`,SET1_S8:`SET1-S:8`,SET1_S10:`SET1-S:10`,FAST4:`SET5-S:4/NOAD`,SET3X_T10A_TB1:`SET3XA-S:T10-F:TB1`,SET3X_T10A_TB1_NOAD:`SET3XA-S:T10-F:TB1NOAD`,SET4X_T10A_TB1:`SET4XA-S:T10-F:TB1`};function eh(e,t,n){if(!e)return{elements:{}};let r={};for(let i of t||[]){if(!i?.label||i.hide)continue;let t=document.createElement(`button`);i.id&&(r[i.id]=t,t.id=i.id),t.style.marginRight=`.5em`,t.className=`button font-medium`,i.intent&&t.classList.add(i.intent),t.innerHTML=i.label,i.disabled&&(t.disabled=!0),t.onclick=e=>{e.stopPropagation(),!e.target.disabled&&B(i.onClick)&&i.onClick(),n&&B(n)&&n()},e.appendChild(t)}return{elements:r}}var th=(e,t)=>n=>n?.trim().length>=e&&(!t||n?.trim().length<=t);function nh(e){return t.tools.isConvertableInteger(e)&&parseInt(e.toString())>=0}var rh=(e,t)=>n=>nh(n)&&Number(n)>=e&&Number(n)<=t,ih=e=>/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)(?=.*?[#?!@$%^&*-]).{8,12}$/.test(e);function ah(e){return t.tools.dateTime.dateValidation.test(e)}var oh=(e,t)=>n=>{let r=(n||``).trim().split(` `).length;return r>=e&&(!t||r<=t)},sh=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,ch=e=>sh.exec(e),lh=u({dateValidator:()=>ah,emailValidator:()=>ch,nameValidator:()=>th,numericRange:()=>rh,numericValidator:()=>nh,passwordValidator:()=>ih,wordValidator:()=>oh}),uh=class{constructor({tournamentRecord:e,drawId:n,structureId:r,eventId:i}){this.tournamentRecord=e,this.drawId=n,this.structureId=r,this.eventId=i||e.events?.[0]?.eventId,t.tournamentEngine.setState(e)}setRenderCallback(e){this.renderCallback=e}getDrawEntryParticipantIds(){let{event:e,drawDefinition:n}=t.tournamentEngine.getEvent({drawId:this.drawId})||{};if(!e)return[];let{flightProfile:r}=t.tournamentEngine.getFlightProfile({eventId:this.eventId})||{};return(r?.flights?.find(e=>e.drawId===this.drawId)?.drawEntries||n?.entries||[]).map(e=>e.participantId).filter(Boolean)}getAllParticipants(){t.tournamentEngine.setState(this.tournamentRecord);let e=this.getDrawEntryParticipantIds();if(!e.length)return[];let{participants:n=[]}=t.tournamentEngine.getParticipants({participantFilters:{participantIds:e}})||{};return n.map(e=>({participantId:e.participantId,participantName:e.participantName,participantType:e.participantType,person:e.person,individualParticipants:e.individualParticipants}))}getAvailableParticipants(){t.tournamentEngine.setState(this.tournamentRecord);let e=this.getAllParticipants(),{assignedParticipantIds:n=[]}=t.tournamentEngine.getAssignedParticipantIds({drawId:this.drawId})||{};return e.filter(e=>!n.includes(e.participantId))}removeAssignment({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=this.getMatchUps().find(t=>t.sides?.some(t=>t.drawPosition===e))?.sides?.find(t=>t.drawPosition===e)?.bye===!0,r=t.tournamentEngine.removeDrawPositionAssignment({drawId:this.drawId,structureId:this.structureId,drawPosition:e});if(r.error)return{success:!1,error:r.error};let{tournamentRecord:i}=t.tournamentEngine.getState()||{};return this.tournamentRecord=i,n&&this.renderCallback&&this.renderCallback(),{success:!0}}assignParticipant({drawPosition:e,participantId:n}){t.tournamentEngine.setState(this.tournamentRecord);let r=t.tournamentEngine.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:e,participantId:n});if(r.error)return{success:!1,error:r.error};let{tournamentRecord:i}=t.tournamentEngine.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}getAndClearFocusDrawPosition(){let e=this.focusDrawPosition;return this.focusDrawPosition=void 0,e}assignBye({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=t.tournamentEngine.assignDrawPositionBye({drawId:this.drawId,structureId:this.structureId,drawPosition:e});if(n.error)return{success:!1,error:n.error};let{tournamentRecord:r}=t.tournamentEngine.getState()||{};return this.tournamentRecord=r,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}assignQualifier({drawPosition:e}){t.tournamentEngine.setState(this.tournamentRecord);let n=t.tournamentEngine.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:e,qualifier:!0});if(n.error)return{success:!1,error:n.error};let{tournamentRecord:r}=t.tournamentEngine.getState()||{};return this.tournamentRecord=r,this.focusDrawPosition=e+1,this.renderCallback&&this.renderCallback(),{success:!0}}getMatchUps(){t.tournamentEngine.setState(this.tournamentRecord);let{eventData:e}=t.tournamentEngine.getEventData({eventId:this.eventId})||{},n=(e?.drawsData?.find(e=>e.drawId===this.drawId))?.structures?.find(e=>e.structureId===this.structureId)?.roundMatchUps;return n?Object.values(n).flat():[]}getState(){return this.tournamentRecord}getContext(){return{drawId:this.drawId,structureId:this.structureId}}};function dh(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fh(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ph(e){let t,n,r;e.length===2?(t=e===dh||e===fh?e:mh,n=e,r=e):(t=dh,n=(t,n)=>dh(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function mh(){return 0}function hh(e){return e===null?NaN:+e}var gh=ph(dh),_h=gh.right;gh.left,ph(hh).center;var vh=Math.sqrt(50),yh=Math.sqrt(10),bh=Math.sqrt(2);function xh(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=vh?10:a>=yh?5:a>=bh?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?xh(e,t,n*2):[s,c,l]}function Sh(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?xh(t,e,n):xh(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function Ch(e,t,n){return t=+t,e=+e,n=+n,xh(e,t,n)[2]}function wh(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Ch(t,e,n):Ch(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Th(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}var Eh={value:()=>{}};function Dh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Oh(n)}function Oh(e){this._=e}function kh(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Oh.prototype=Dh.prototype={constructor:Oh,on:function(e,t){var n=this._,r=kh(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ah(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=jh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=jh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Oh(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ah(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function jh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Eh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mh={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Nh(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Mh.hasOwnProperty(t)?{space:Mh[t],local:e}:e}function Ph(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Fh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ih(e){var t=Nh(e);return(t.local?Fh:Ph)(t)}function Lh(){}function Rh(e){return e==null?Lh:function(){return this.querySelector(e)}}function zh(e){typeof e!=`function`&&(e=Rh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new D_(r,this._parents)}function Bh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Vh(){return[]}function Hh(e){return e==null?Vh:function(){return this.querySelectorAll(e)}}function Uh(e){return function(){return Bh(e.apply(this,arguments))}}function Wh(e){e=typeof e==`function`?Uh(e):Hh(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new D_(r,i)}function Gh(e){return function(){return this.matches(e)}}function Kh(e){return function(t){return t.matches(e)}}var qh=Array.prototype.find;function Jh(e){return function(){return qh.call(this.children,e)}}function Yh(){return this.firstElementChild}function Xh(e){return this.select(e==null?Yh:Jh(typeof e==`function`?e:Kh(e)))}var Zh=Array.prototype.filter;function Qh(){return Array.from(this.children)}function $h(e){return function(){return Zh.call(this.children,e)}}function eg(e){return this.selectAll(e==null?Qh:$h(typeof e==`function`?e:Kh(e)))}function tg(e){typeof e!=`function`&&(e=Gh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new D_(r,this._parents)}function ng(e){return Array(e.length)}function rg(){return new D_(this._enter||this._groups.map(ng),this._parents)}function ig(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ig.prototype={constructor:ig,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ag(e){return function(){return e}}function og(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ig(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function sg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ig(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function cg(e){return e.__data__}function lg(e,t){if(!arguments.length)return Array.from(this,cg);var n=t?sg:og,r=this._parents,i=this._groups;typeof e!=`function`&&(e=ag(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=ug(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new D_(o,r),o._enter=s,o._exit=c,o}function ug(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function dg(){return new D_(this._exit||this._groups.map(ng),this._parents)}function fg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function pg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new D_(s,this._parents)}function mg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function hg(e){e||=gg;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new D_(i,this._parents).order()}function gg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _g(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vg(){return Array.from(this)}function yg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function bg(){let e=0;for(let t of this)++e;return e}function xg(){return!this.node()}function Sg(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Cg(e){return function(){this.removeAttribute(e)}}function wg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tg(e,t){return function(){this.setAttribute(e,t)}}function Eg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Dg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Og(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function kg(e,t){var n=Nh(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wg:Cg:typeof t==`function`?n.local?Og:Dg:n.local?Eg:Tg)(n,t))}function Ag(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function jg(e){return function(){this.style.removeProperty(e)}}function Mg(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ng(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Pg(e,t,n){return arguments.length>1?this.each((t==null?jg:typeof t==`function`?Ng:Mg)(e,t,n??``)):Fg(this.node(),e)}function Fg(e,t){return e.style.getPropertyValue(t)||Ag(e).getComputedStyle(e,null).getPropertyValue(t)}function Ig(e){return function(){delete this[e]}}function Lg(e,t){return function(){this[e]=t}}function Rg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zg(e,t){return arguments.length>1?this.each((t==null?Ig:typeof t==`function`?Rg:Lg)(e,t)):this.node()[e]}function Bg(e){return e.trim().split(/^|\s+/)}function Vg(e){return e.classList||new Hg(e)}function Hg(e){this._node=e,this._names=Bg(e.getAttribute(`class`)||``)}Hg.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Ug(e,t){for(var n=Vg(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Wg(e,t){for(var n=Vg(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Gg(e){return function(){Ug(this,e)}}function Kg(e){return function(){Wg(this,e)}}function qg(e,t){return function(){(t.apply(this,arguments)?Ug:Wg)(this,e)}}function Jg(e,t){var n=Bg(e+``);if(arguments.length<2){for(var r=Vg(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?qg:t?Gg:Kg)(n,t))}function Yg(){this.textContent=``}function Xg(e){return function(){this.textContent=e}}function Zg(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Qg(e){return arguments.length?this.each(e==null?Yg:(typeof e==`function`?Zg:Xg)(e)):this.node().textContent}function $g(){this.innerHTML=``}function e_(e){return function(){this.innerHTML=e}}function t_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function n_(e){return arguments.length?this.each(e==null?$g:(typeof e==`function`?t_:e_)(e)):this.node().innerHTML}function r_(){this.nextSibling&&this.parentNode.appendChild(this)}function i_(){return this.each(r_)}function a_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function o_(){return this.each(a_)}function s_(e){var t=typeof e==`function`?e:Ih(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function c_(){return null}function l_(e,t){var n=typeof e==`function`?e:Ih(e),r=t==null?c_:typeof t==`function`?t:Rh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function u_(){var e=this.parentNode;e&&e.removeChild(this)}function d_(){return this.each(u_)}function f_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function p_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m_(e){return this.select(e?p_:f_)}function h_(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function g_(e){return function(t){e.call(this,t,this.__data__)}}function __(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function v_(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function y_(e,t,n){return function(){var r=this.__on,i,a=g_(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function b_(e,t,n){var r=__(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?y_:v_,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function x_(e,t,n){var r=Ag(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function S_(e,t){return function(){return x_(this,e,t)}}function C_(e,t){return function(){return x_(this,e,t.apply(this,arguments))}}function w_(e,t){return this.each((typeof t==`function`?C_:S_)(e,t))}function*T_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var E_=[null];function D_(e,t){this._groups=e,this._parents=t}function O_(){return new D_([[document.documentElement]],E_)}function k_(){return this}D_.prototype=O_.prototype={constructor:D_,select:zh,selectAll:Wh,selectChild:Xh,selectChildren:eg,filter:tg,data:lg,enter:rg,exit:dg,join:fg,merge:pg,selection:k_,order:mg,sort:hg,call:_g,nodes:vg,node:yg,size:bg,empty:xg,each:Sg,attr:kg,style:Pg,property:zg,classed:Jg,text:Qg,html:n_,raise:i_,lower:o_,append:s_,insert:l_,remove:d_,clone:m_,datum:h_,on:b_,dispatch:w_,[Symbol.iterator]:T_};function A_(e){return typeof e==`string`?new D_([[document.querySelector(e)]],[document.documentElement]):new D_([[e]],E_)}function j_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function M_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function N_(){}var P_=.7,F_=1/P_,I_=`\\s*([+-]?\\d+)\\s*`,L_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,R_=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,z_=/^#([0-9a-f]{3,8})$/,B_=RegExp(`^rgb\\(${I_},${I_},${I_}\\)$`),V_=RegExp(`^rgb\\(${R_},${R_},${R_}\\)$`),H_=RegExp(`^rgba\\(${I_},${I_},${I_},${L_}\\)$`),U_=RegExp(`^rgba\\(${R_},${R_},${R_},${L_}\\)$`),W_=RegExp(`^hsl\\(${L_},${R_},${R_}\\)$`),G_=RegExp(`^hsla\\(${L_},${R_},${R_},${L_}\\)$`),K_={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};j_(N_,Z_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:q_,formatHex:q_,formatHex8:J_,formatHsl:Y_,formatRgb:X_,toString:X_});function q_(){return this.rgb().formatHex()}function J_(){return this.rgb().formatHex8()}function Y_(){return uv(this).formatHsl()}function X_(){return this.rgb().formatRgb()}function Z_(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=z_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Q_(t):n===3?new nv(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=B_.exec(e))?new nv(t[1],t[2],t[3],1):(t=V_.exec(e))?new nv(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H_.exec(e))?$_(t[1],t[2],t[3],t[4]):(t=U_.exec(e))?$_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=W_.exec(e))?lv(t[1],t[2]/100,t[3]/100,1):(t=G_.exec(e))?lv(t[1],t[2]/100,t[3]/100,t[4]):K_.hasOwnProperty(e)?Q_(K_[e]):e===`transparent`?new nv(NaN,NaN,NaN,0):null}function Q_(e){return new nv(e>>16&255,e>>8&255,e&255,1)}function $_(e,t,n,r){return r<=0&&(e=t=n=NaN),new nv(e,t,n,r)}function ev(e){return e instanceof N_||(e=Z_(e)),e?(e=e.rgb(),new nv(e.r,e.g,e.b,e.opacity)):new nv}function tv(e,t,n,r){return arguments.length===1?ev(e):new nv(e,t,n,r??1)}function nv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}j_(nv,tv,M_(N_,{brighter(e){return e=e==null?F_:F_**+e,new nv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?P_:P_**+e,new nv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nv(sv(this.r),sv(this.g),sv(this.b),ov(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:rv,formatHex:rv,formatHex8:iv,formatRgb:av,toString:av}));function rv(){return`#${cv(this.r)}${cv(this.g)}${cv(this.b)}`}function iv(){return`#${cv(this.r)}${cv(this.g)}${cv(this.b)}${cv((isNaN(this.opacity)?1:this.opacity)*255)}`}function av(){let e=ov(this.opacity);return`${e===1?`rgb(`:`rgba(`}${sv(this.r)}, ${sv(this.g)}, ${sv(this.b)}${e===1?`)`:`, ${e})`}`}function ov(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cv(e){return e=sv(e),(e<16?`0`:``)+e.toString(16)}function lv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fv(e,t,n,r)}function uv(e){if(e instanceof fv)return new fv(e.h,e.s,e.l,e.opacity);if(e instanceof N_||(e=Z_(e)),!e)return new fv;if(e instanceof fv)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new fv(o,s,c,e.opacity)}function dv(e,t,n,r){return arguments.length===1?uv(e):new fv(e,t,n,r??1)}function fv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}j_(fv,dv,M_(N_,{brighter(e){return e=e==null?F_:F_**+e,new fv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?P_:P_**+e,new fv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new nv(hv(e>=240?e-240:e+120,i,r),hv(e,i,r),hv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fv(pv(this.h),mv(this.s),mv(this.l),ov(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(){let e=ov(this.opacity);return`${e===1?`hsl(`:`hsla(`}${pv(this.h)}, ${mv(this.s)*100}%, ${mv(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function pv(e){return e=(e||0)%360,e<0?e+360:e}function mv(e){return Math.max(0,Math.min(1,e||0))}function hv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var gv=e=>()=>e;function _v(e,t){return function(n){return e+n*t}}function vv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function yv(e){return(e=+e)==1?bv:function(t,n){return n-t?vv(t,n,e):gv(isNaN(t)?n:t)}}function bv(e,t){var n=t-e;return n?_v(e,n):gv(isNaN(e)?t:e)}var xv=(function e(t){var n=yv(t);function r(e,t){var r=n((e=tv(e)).r,(t=tv(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=bv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Sv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Cv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wv(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=Nv(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Tv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ev(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dv(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Nv(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Ov=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kv=new RegExp(Ov.source,`g`);function Av(e){return function(){return e}}function jv(e){return function(t){return e(t)+``}}function Mv(e,t){var n=Ov.lastIndex=kv.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Ov.exec(e))&&(i=kv.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ev(r,i)})),n=kv.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?jv(c[0].x):Av(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Nv(e,t){var n=typeof t,r;return t==null||n===`boolean`?gv(t):(n===`number`?Ev:n===`string`?(r=Z_(t))?(t=r,xv):Mv:t instanceof Z_?xv:t instanceof Date?Tv:Cv(t)?Sv:Array.isArray(t)?wv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Dv:Ev)(e,t)}function Pv(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Fv=180/Math.PI,Iv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lv(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Fv,skewX:Math.atan(c)*Fv,scaleX:o,scaleY:s}}var Rv;function zv(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Iv:Lv(t.a,t.b,t.c,t.d,t.e,t.f)}function Bv(e){return e==null||(Rv||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Rv.setAttribute(`transform`,e),!(e=Rv.transform.baseVal.consolidate()))?Iv:(e=e.matrix,Lv(e.a,e.b,e.c,e.d,e.e,e.f))}function Vv(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Ev(e,i)},{i:c-2,x:Ev(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Ev(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Ev(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Ev(e,n)},{i:s-2,x:Ev(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Hv=Vv(zv,`px, `,`px)`,`deg)`),Uv=Vv(Bv,`, `,`)`,`)`),Wv=0,Gv=0,Kv=0,qv=1e3,Jv,Yv,Xv=0,Zv=0,Qv=0,$v=typeof performance==`object`&&performance.now?performance:Date,ey=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ty(){return Zv||=(ey(ny),$v.now()+Qv)}function ny(){Zv=0}function ry(){this._call=this._time=this._next=null}ry.prototype=iy.prototype={constructor:ry,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?ty():+n)+(t==null?0:+t),!this._next&&Yv!==this&&(Yv?Yv._next=this:Jv=this,Yv=this),this._call=e,this._time=n,ly()},stop:function(){this._call&&(this._call=null,this._time=1/0,ly())}};function iy(e,t,n){var r=new ry;return r.restart(e,t,n),r}function ay(){ty(),++Wv;for(var e=Jv,t;e;)(t=Zv-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wv}function oy(){Zv=(Xv=$v.now())+Qv,Wv=Gv=0;try{ay()}finally{Wv=0,cy(),Zv=0}}function sy(){var e=$v.now(),t=e-Xv;t>qv&&(Qv-=t,Xv=e)}function cy(){for(var e,t=Jv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jv=n);Yv=e,ly(r)}function ly(e){Wv||(Gv&&=clearTimeout(Gv),e-Zv>24?(e<1/0&&(Gv=setTimeout(oy,e-$v.now()-Qv)),Kv&&=clearInterval(Kv)):(Kv||=(Xv=$v.now(),setInterval(sy,qv)),Wv=1,ey(oy)))}function uy(e,t,n){var r=new ry;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var dy=Dh(`start`,`end`,`cancel`,`interrupt`),fy=[];function py(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;_y(e,n,{name:t,index:r,group:i,on:dy,tween:fy,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function my(e,t){var n=gy(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function hy(e,t){var n=gy(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function gy(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function _y(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=iy(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return uy(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(uy(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function vy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function yy(e){return this.each(function(){vy(this,e)})}function by(e,t){var n,r;return function(){var i=hy(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function xy(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=hy(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Sy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=gy(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?by:xy)(n,e,t))}function Cy(e,t,n){var r=e._id;return e.each(function(){var e=hy(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return gy(e,r).value[t]}}function wy(e,t){var n;return(typeof t==`number`?Ev:t instanceof Z_?xv:(n=Z_(t))?(t=n,xv):Mv)(e,t)}function Ty(e){return function(){this.removeAttribute(e)}}function Ey(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Oy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ky(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Ay(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function jy(e,t){var n=Nh(e),r=n===`transform`?Uv:wy;return this.attrTween(e,typeof t==`function`?(n.local?Ay:ky)(n,r,Cy(this,`attr.`+e,t)):t==null?(n.local?Ey:Ty)(n):(n.local?Oy:Dy)(n,r,t))}function My(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ny(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Py(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ny(e,i)),n}return i._value=t,i}function Fy(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&My(e,i)),n}return i._value=t,i}function Iy(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Nh(e);return this.tween(n,(r.local?Py:Fy)(r,t))}function Ly(e,t){return function(){my(this,e).delay=+t.apply(this,arguments)}}function Ry(e,t){return t=+t,function(){my(this,e).delay=t}}function zy(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ly:Ry)(t,e)):gy(this.node(),t).delay}function By(e,t){return function(){hy(this,e).duration=+t.apply(this,arguments)}}function Vy(e,t){return t=+t,function(){hy(this,e).duration=t}}function Hy(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?By:Vy)(t,e)):gy(this.node(),t).duration}function Uy(e,t){if(typeof t!=`function`)throw Error();return function(){hy(this,e).ease=t}}function Wy(e){var t=this._id;return arguments.length?this.each(Uy(t,e)):gy(this.node(),t).ease}function Gy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();hy(this,e).ease=n}}function Ky(e){if(typeof e!=`function`)throw Error();return this.each(Gy(this._id,e))}function qy(e){typeof e!=`function`&&(e=Gh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Sb(r,this._parents,this._name,this._id)}function Jy(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Sb(o,this._parents,this._name,this._id)}function Yy(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Xy(e,t,n){var r,i,a=Yy(t)?my:hy;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Zy(e,t){var n=this._id;return arguments.length<2?gy(this.node(),n).on.on(e):this.each(Xy(n,e,t))}function Qy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $y(){return this.on(`end.remove`,Qy(this._id))}function eb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Rh(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,py(l[f],t,n,f,l,gy(u,n)));return new Sb(a,this._parents,t,n)}function tb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Hh(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=gy(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&py(p,t,n,h,f,m);a.push(f),o.push(u)}return new Sb(a,o,t,n)}var nb=O_.prototype.constructor;function rb(){return new nb(this._groups,this._parents)}function ib(e,t){var n,r,i;return function(){var a=Fg(this,e),o=(this.style.removeProperty(e),Fg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ab(e){return function(){this.style.removeProperty(e)}}function ob(e,t,n){var r,i=n+``,a;return function(){var o=Fg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function sb(e,t,n){var r,i,a;return function(){var o=Fg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Fg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function cb(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=hy(this,e),l=c.on,u=c.value[a]==null?s||=ab(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function lb(e,t,n){var r=(e+=``)==`transform`?Hv:wy;return t==null?this.styleTween(e,ib(e,r)).on(`end.style.`+e,ab(e)):typeof t==`function`?this.styleTween(e,sb(e,r,Cy(this,`style.`+e,t))).each(cb(this._id,e)):this.styleTween(e,ob(e,r,t),n).on(`end.style.`+e,null)}function ub(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function db(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ub(e,a,n)),r}return a._value=t,a}function fb(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,db(e,t,n??``))}function pb(e){return function(){this.textContent=e}}function mb(e){return function(){var t=e(this);this.textContent=t??``}}function hb(e){return this.tween(`text`,typeof e==`function`?mb(Cy(this,`text`,e)):pb(e==null?``:e+``))}function gb(e){return function(t){this.textContent=e.call(this,t)}}function _b(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&gb(r)),t}return r._value=e,r}function vb(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,_b(e))}function yb(){for(var e=this._name,t=this._id,n=wb(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=gy(c,t);py(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Sb(r,this._parents,e,n)}function bb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=hy(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var xb=0;function Sb(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Cb(e){return O_().transition(e)}function wb(){return++xb}var Tb=O_.prototype;Sb.prototype=Cb.prototype={constructor:Sb,select:eb,selectAll:tb,selectChild:Tb.selectChild,selectChildren:Tb.selectChildren,filter:qy,merge:Jy,selection:rb,transition:yb,call:Tb.call,nodes:Tb.nodes,node:Tb.node,size:Tb.size,empty:Tb.empty,each:Tb.each,on:Zy,attr:jy,attrTween:Iy,style:lb,styleTween:fb,text:hb,textTween:vb,remove:$y,tween:Sy,delay:zy,duration:Hy,ease:Wy,easeVarying:Ky,end:bb,[Symbol.iterator]:Tb[Symbol.iterator]};function Eb(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Db={time:null,delay:0,duration:250,ease:Eb};function Ob(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function kb(e){var t,n;e instanceof Sb?(t=e._id,e=e._name):(t=wb(),(n=Db).time=ty(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&py(c,e,t,l,o,n||Ob(c,t));return new Sb(r,this._parents,e,t)}O_.prototype.interrupt=yy,O_.prototype.transition=kb;var{abs:Ab,max:jb,min:Mb}=Math;[`w`,`e`].map(Nb),[`n`,`s`].map(Nb),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(Nb);function Nb(e){return{type:e}}var Pb=Math.PI,Fb=2*Pb,Ib=1e-6,Lb=Fb-Ib;function Rb(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zb(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Rb;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Bb=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Rb:zb(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Ib)if(!(Math.abs(u*s-c*l)>Ib)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((Pb-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Ib&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Ib||Math.abs(this._y1-l)>Ib)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Fb+Fb),d>Lb?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Ib&&this._append`A${n},${n},0,${+(d>=Pb)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Vb(){return new Bb}Vb.prototype=Bb.prototype;function Hb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Ub(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Wb(e){return e=Ub(Math.abs(e)),e?e[1]:NaN}function Gb(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Kb(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var qb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jb(e){if(!(t=qb.exec(e)))throw Error(`invalid format: `+e);var t;return new Yb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Jb.prototype=Yb.prototype;function Yb(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}Yb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Xb(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Zb;function Qb(e,t){var n=Ub(e,t);if(!n)return Zb=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Zb=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Ub(e,Math.max(0,t+a-1))[0]}function $b(e,t){var n=Ub(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var ex={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Hb,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$b(e*100,t),r:$b,s:Qb,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function tx(e){return e}var nx=Array.prototype.map,rx=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function ix(e){var t=e.grouping===void 0||e.thousands===void 0?tx:Gb(nx.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?tx:Kb(nx.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=Jb(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):ex[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=ex[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Xb(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&Zb!==void 0?rx[8+Zb/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(Wb(t)/3)))*3,r=10**-n,i=l((e=Jb(e),e.type=`f`,e),{suffix:rx[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var ax,ox,sx;cx({thousands:`,`,grouping:[3],currency:[`$`,``]});function cx(e){return ax=ix(e),ox=ax.format,sx=ax.formatPrefix,ax}function lx(e){return Math.max(0,-Wb(Math.abs(e)))}function ux(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wb(t)/3)))*3-Wb(Math.abs(e)))}function dx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wb(t)-Wb(e))+1}function fx(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function px(){return this.eachAfter(fx)}function mx(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function hx(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function gx(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function _x(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function vx(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function yx(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bx(e){for(var t=this,n=xx(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function xx(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Sx(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Cx(){return Array.from(this)}function wx(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Tx(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ex(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function Dx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ax)):t===void 0&&(t=kx);for(var n=new Nx(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Nx(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Mx)}function Ox(){return Dx(this).eachBefore(jx)}function kx(e){return e.children}function Ax(e){return Array.isArray(e)?e[1]:null}function jx(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mx(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Nx(e){this.data=e,this.depth=this.height=0,this.parent=null}Nx.prototype=Dx.prototype={constructor:Nx,count:px,each:mx,eachAfter:gx,eachBefore:hx,find:_x,sum:vx,sort:yx,path:bx,ancestors:Sx,descendants:Cx,leaves:wx,links:Tx,copy:Ox,[Symbol.iterator]:Ex};function Px(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Fx(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function Ix(){var e=1,t=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=e,i.y1=t/o,i.eachBefore(a(t,o)),r&&i.eachBefore(Px),i}function a(e,t){return function(r){r.children&&Fx(r,r.x0,e*(r.depth+1)/t,r.x1,e*(r.depth+2)/t);var i=r.x0,a=r.y0,o=r.x1-n,s=r.y1-n;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),r.x0=i,r.y0=a,r.x1=o,r.y1=s}}return i.round=function(e){return arguments.length?(r=!!e,i):r},i.size=function(n){return arguments.length?(e=+n[0],t=+n[1],i):[e,t]},i.padding=function(e){return arguments.length?(n=+e,i):n},i}function Lx(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Rx(e){return function(){return e}}function zx(e){return+e}var Bx=[0,1];function Vx(e){return e}function Hx(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Rx(isNaN(t)?NaN:.5)}function Ux(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Wx(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Hx(i,r),a=n(o,a)):(r=Hx(r,i),a=n(a,o)),function(e){return a(r(e))}}function Gx(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Hx(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=_h(e,t,1,r)-1;return a[n](i[n](t))}}function Kx(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qx(){var e=Bx,t=Bx,n=Nv,r,i,a,o=Vx,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Vx&&(o=Ux(e[0],e[n-1])),s=n>2?Gx:Wx,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Ev))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,zx),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Pv,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Vx,u()):o!==Vx},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Jx(){return qx()(Vx,Vx)}function Yx(e,t,n,r){var i=wh(e,t,n),a;switch(r=Jb(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ux(i,o))&&(r.precision=a),sx(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=dx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=lx(i))&&(r.precision=a-(r.type===`%`)*2);break}return ox(r)}function Xx(e){var t=e.domain;return e.ticks=function(e){var n=t();return Sh(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Yx(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=Ch(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Zx(){var e=Jx();return e.copy=function(){return Kx(e,Zx())},Lx.apply(e,arguments),Xx(e)}function Qx(e){return function(){return e}}var $x=Math.abs,eS=Math.atan2,tS=Math.cos,nS=Math.max,rS=Math.min,iS=Math.sin,aS=Math.sqrt,oS=Math.PI,sS=oS/2,cS=2*oS;function lS(e){return e>1?0:e<-1?oS:Math.acos(e)}function uS(e){return e>=1?sS:e<=-1?-sS:Math.asin(e)}function dS(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Bb(t)}function fS(e){return e.innerRadius}function pS(e){return e.outerRadius}function mS(e){return e.startAngle}function hS(e){return e.endAngle}function gS(e){return e&&e.padAngle}function _S(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function vS(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/aS(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*aS(nS(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function yS(){var e=fS,t=pS,n=Qx(0),r=null,i=mS,a=hS,o=gS,s=null,c=dS(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-sS,m=a.apply(this,arguments)-sS,h=$x(m-p),g=m>p;if(s||=l=c(),f<d&&(u=f,f=d,d=u),!(f>1e-12))s.moveTo(0,0);else if(h>cS-1e-12)s.moveTo(f*tS(p),f*iS(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*tS(m),d*iS(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):aS(d*d+f*f)),T=rS($x(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var A=uS(w/d*iS(C)),j=uS(w/f*iS(C));(x-=A*2)>1e-12?(A*=g?1:-1,y+=A,b-=A):(x=0,y=b=(p+m)/2),(S-=j*2)>1e-12?(j*=g?1:-1,_+=j,v-=j):(S=0,_=v=(p+m)/2)}var M=f*tS(_),N=f*iS(_),P=d*tS(b),F=d*iS(b);if(T>1e-12){var I=f*tS(v),L=f*iS(v),R=d*tS(y),z=d*iS(y),B;if(h<oS)if(B=_S(M,N,R,z,I,L,P,F)){var ee=M-B[0],te=N-B[1],ne=I-B[0],V=L-B[1],re=1/iS(lS((ee*ne+te*V)/(aS(ee*ee+te*te)*aS(ne*ne+V*V)))/2),ie=aS(B[0]*B[0]+B[1]*B[1]);E=rS(T,(d-ie)/(re-1)),D=rS(T,(f-ie)/(re+1))}else E=D=0}S>1e-12?D>1e-12?(O=vS(R,z,M,N,f,D,g),k=vS(I,L,P,F,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D<T?s.arc(O.cx,O.cy,D,eS(O.y01,O.x01),eS(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,D,eS(O.y01,O.x01),eS(O.y11,O.x11),!g),s.arc(0,0,f,eS(O.cy+O.y11,O.cx+O.x11),eS(k.cy+k.y11,k.cx+k.x11),!g),s.arc(k.cx,k.cy,D,eS(k.y11,k.x11),eS(k.y01,k.x01),!g))):(s.moveTo(M,N),s.arc(0,0,f,_,v,!g)):s.moveTo(M,N),!(d>1e-12)||!(x>1e-12)?s.lineTo(P,F):E>1e-12?(O=vS(P,F,I,L,d,-E,g),k=vS(M,N,R,z,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E<T?s.arc(O.cx,O.cy,E,eS(O.y01,O.x01),eS(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,E,eS(O.y01,O.x01),eS(O.y11,O.x11),!g),s.arc(0,0,d,eS(O.cy+O.y11,O.cx+O.x11),eS(k.cy+k.y11,k.cx+k.x11),g),s.arc(k.cx,k.cy,E,eS(k.y11,k.x11),eS(k.y01,k.x01),!g))):s.arc(0,0,d,b,y,g)}if(s.closePath(),l)return s=null,l+``||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-oS/2;return[tS(r)*n,iS(r)*n]},l.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:Qx(+t),l):e},l.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:Qx(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:Qx(+e),l):n},l.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Qx(+e),l):r},l.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Qx(+e),l):i},l.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Qx(+e),l):a},l.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:Qx(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}function bS(e,t,n){this.k=e,this.x=t,this.y=n}bS.prototype={constructor:bS,scale:function(e){return e===1?this:new bS(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new bS(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var xS=new bS(1,0,0);SS.prototype=bS.prototype;function SS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xS;return e.__zoom}function CS(e,t=15){let n=e.split(` `),r=[],i=[],a=0;return n.forEach(e=>{a+e.length>t?(i.length&&r.push(i.join(` `)),i=[e],a=e.length):(i.push(e),a+=e.length+ +(i.length>0))}),i.length&&r.push(i.join(` `)),r}var{WILDCARD:wS,QUALIFIER:TS,LUCKY_LOSER:ES}=t.entryStatusConstants,DS=`text-anchor`,OS=`dominant-baseline`,kS=`fill-opacity`,AS=Object.assign({},...t.fixtures.countries.filter(e=>e.ioc).map(e=>({[e.ioc]:e.iso2})),...t.fixtures.countries.filter(e=>e.iso).map(e=>({[e.iso]:e.iso2})));function jS(e){let t=Math.floor(e.length/2),n=e.slice(0,t),r=e.slice(t).reverse();return[...n,...r]}function MS(e){if(e)switch(e){case wS:return`WC`;case TS:return`Q`;case ES:return`LL`;default:return e}}function NS(e,t){let n=[];for(let r of e)for(let e of r.sides){let i=r.matchUpStatus===`BYE`&&!e.participantName;n.push({name:e.participantName||(i?`BYE`:``),participantName:e.participantName||(i?`BYE`:void 0),drawPosition:e.drawPosition,seedNumber:e.seedNumber,entryStatus:MS(e.entryStatus),nationalityCode:e.nationalityCode,matchUp:r,depth:t,value:1})}return n}function PS(e,t){let n=e.winningSide!==void 0&&e.winningSide!==null?e.sides.find(t=>t.sideNumber===e.winningSide):void 0;!n&&e.matchUpStatus===`BYE`&&(n=e.sides.find(e=>e.participantName));let r=n?.participantName,i=r?t.get(r):void 0;return{winnerName:r,winnerSide:n,winnerLookup:i}}function FS(e,t,n,r){return e.map((e,i)=>{let a=i*2,o=[t[a],t[a+1]].filter(Boolean),{winnerName:s,winnerSide:c,winnerLookup:l}=PS(e,r);return{name:s||``,participantName:s,drawPosition:l?.drawPosition??c?.drawPosition,seedNumber:c?.seedNumber??l?.seedNumber,entryStatus:MS(c?.entryStatus)??l?.entryStatus,nationalityCode:c?.nationalityCode??l?.nationalityCode,scoreString:e.scoreString,matchUpStatus:e.matchUpStatus,matchUp:e,depth:n,children:o.length>0?o:void 0}})}function IS(e){let{roundMatchUps:t}=e,n=Object.keys(t).map(Number).sort((e,t)=>e-t);if(n.length===0)throw Error(`No round data found in draw`);let r=t[n[0]],i=jS(NS(r,n.length)),a=new Map;for(let e of i)e.participantName&&e.participantName!==`BYE`&&a.set(e.participantName,e);let o=FS(jS(r),i,n.length-1,a);for(let e=1;e<n.length;e++)o=FS(jS(t[n[e]]),o,n.length-1-e,a);return o.length===1?o[0]:{name:`Tournament`,depth:0,children:o}}function LS(e,t){if(!e)return;let{seedNumber:n,entryStatus:r,drawPosition:i,participantName:a}=e,o;if(a?.trim().toUpperCase()===`BYE`)o=`#B0BEC5`;else if(n){let e=Number(n),t=Zx().domain([1,32]).range([`0`,`1`]);o=Zx().domain(Th(0,1,1/7)).range([`#81D4FA`,`#42A5F5`,`#1E88E5`,`#1565C0`,`#5C6BC0`,`#673AB7`,`#9C27B0`])(Number(t(e)))}else if(r?.toUpperCase()===`WC`)o=`red`;else if(r&&(r===`Q`||r===`LL`))o=Zx().domain(Th(0,1,1/3)).range([`#FFF176`,`#FBC02D`,`#FF9800`])(t(i));else{let e=[`#C8E6C9`,`#81C784`,`#66BB6A`,`#4CAF50`,`#43A047`,`#388E3C`,`#2E7D32`,`#1B5E20`,`#A5D6A7`,`#90CAF9`,`#64B5F6`,`#42A5F5`,`#2196F3`,`#1E88E5`,`#1976D2`,`#1565C0`];o=Zx().domain(Th(0,1,1/e.length)).range(e)(t(i))}e.color=o,e.children&&e.children.forEach(n=>{n.participantName===e.participantName&&(n.color=o),LS(n,t)})}function RS(e,t){let n=[];return e.seedNumber?n.push(`Seed ${e.seedNumber}`):e.entryStatus&&n.push(e.entryStatus),t===7&&e.drawPosition&&n.push(`Draw ${e.drawPosition}`),n.length>0?n.join(` • `):void 0}function zS(e,t){let n=e.find(e=>e.data.participantName&&e.data.participantName!==t);return n?.data.participantName?n.data:void 0}function BS(e,t){let n=[e.participantName],r;if(t.children&&t.children.length>0)e.scoreString&&n.push(e.scoreString),r=zS(t.children,e.participantName),r&&n.push(r.participantName);else{let r=RS(e,t.depth);r&&n.push(r)}return{messageLines:n,opponentData:r}}function VS(e,t){return-(e*t/2)+t/2}function HS(e,t,n){let r=A_(e).append(`svg`).attr(`width`,t).attr(`height`,n).style(`display`,`block`),i=r.append(`g`).attr(`transform`,`translate(${t/2}, ${n/2})`);return{svg:r,g:i,flagsGroup:i.append(`g`).attr(`class`,`flags-group`),winningFlagsGroup:i.append(`g`).attr(`class`,`winning-flags-group`),losingFlagsGroup:i.append(`g`).attr(`class`,`losing-flags-group`)}}function US(e,t,n,r,i){let a=e.append(`text`).attr(`x`,t/2).attr(`y`,n/2).attr(DS,`middle`).attr(OS,`middle`).attr(`font-size`,`${r}px`).attr(`font-weight`,`bold`).style(`fill`,`var(--chc-text-primary, #333)`).attr(`pointer-events`,`none`),o=r+i*.5;return{centerText:a,centerText2:e.append(`text`).attr(`x`,t/2).attr(`y`,n/2+o).attr(DS,`middle`).attr(OS,`middle`).attr(`font-size`,`${i}px`).style(`fill`,`var(--chc-text-secondary, #666)`).attr(`pointer-events`,`none`)}}function WS(e,t,n,r,i,a,o){n&&(i?(t.flagsGroup.selectAll(`text`).remove(),t.winningFlagsGroup.selectAll(`text`).remove(),t.losingFlagsGroup.selectAll(`text`).remove()):e.selectAll(`text`).remove(),e.append(`text`).attr(`font-size`,`${o}px`).attr(DS,`middle`).attr(OS,`middle`).attr(`transform`,`translate(0, ${r*a})`).text(JS(n)))}function GS(e,n,r,i={}){let a=i.width||800,o=i.height||800,s=Math.min(a,o)/800*(i.textScaleFactor??1),c=28*s,l=24*s,u=30*s,d=r||i.title||`Tournament`,f=Object.assign({},...t.fixtures.countries.filter(e=>e.label).map(e=>({[e.ioc]:e.label}))),p=IS(n),m=Dx(p,e=>e.children).sum(e=>e.value||0),h=Math.min(a,o)/2,g=h/2,_=e=>e*h/200;Ix().size([2*Math.PI,h-g])(m),LS(p,Zx().domain([0,n.drawSize||128]).range([0,1]));let v=m.descendants(),y=yS().startAngle(e=>e.x0).endAngle(e=>e.x1).innerRadius(e=>e.y0+g).outerRadius(e=>e.y1+g),{svg:b,g:x,flagsGroup:S,winningFlagsGroup:C,losingFlagsGroup:w}=HS(e,a,o),T=new Set,E=e=>{e.nationalityCode&&T.add(e.nationalityCode),e.children&&e.children.forEach(E)};E(p);let D=Array.from(T),{centerText:O,centerText2:k}=US(b,a,o,c,l);function A(){let e=CS(d,15);O.text(``),O.selectAll(`tspan`).remove(),k.text(``),k.selectAll(`tspan`).remove(),O.selectAll(`tspan`).data(e).join(`tspan`).attr(`x`,a/2).attr(`dy`,(e,t)=>t===0?0:u).text(e=>e);let t=-(e.length*u/2)+u/2;O.attr(`y`,o/2+t),O.style(`display`,`block`),k.style(`display`,`none`)}function j(){if(S.selectAll(`text`).remove(),C.selectAll(`text`).remove(),w.selectAll(`text`).remove(),D.length===0)return;let e=Zx().domain([0,D.length]).range([0,Math.PI*2]),t=_(20),n=g-t+10;S.selectAll(`text`).data(D).join(`text`).attr(`font-size`,`${t}px`).attr(DS,`middle`).attr(OS,`middle`).attr(`transform`,(t,r)=>{let i=e(r);return`translate(${Math.cos(i)*n}, ${Math.sin(i)*n})`}).text(e=>JS(e)).style(`cursor`,`pointer`).on(`mouseover`,function(e,t){let n=f[t]||t;O.selectAll(`tspan`).remove(),O.attr(`y`,o/2),O.text(n).style(`display`,`block`),k.selectAll(`tspan`).remove(),k.text(``).style(`display`,`none`),N||x.selectAll(`path`).attr(kS,e=>e.data.nationalityCode===t?.9:.3)}).on(`mouseout`,function(){N||x.selectAll(`path`).attr(kS,.8),A()})}j(),A();let M=i.eventHandlers?.clickCenter;M&&x.insert(`circle`,`:first-child`).attr(`r`,g).attr(`fill`,`transparent`).style(`cursor`,`pointer`).on(`click`,M);let N=!1,P;function F(e,t){let n=t.data;if(n.participantName){let{messageLines:e,opponentData:r}=BS(n,t);r&&(n.opponent=r),O.selectAll(`tspan`).remove(),O.text(``),O.selectAll(`tspan`).data(e).join(`tspan`).attr(`x`,a/2).attr(`dy`,(e,t)=>t===0?0:u).text(e=>e);let i=VS(e.length,u);O.attr(`y`,o/2+i),O.style(`display`,`block`),k.style(`display`,`none`)}N?n.participantName?.toLowerCase()!==P?.toLowerCase()&&A_(e.currentTarget).attr(kS,.9):x.selectAll(`path`).attr(kS,e=>e.data.participantName===t.data.participantName?.9:.3);let r=_(30),i=g-r-10,s={flagsGroup:S,winningFlagsGroup:C,losingFlagsGroup:w};WS(C,s,n.nationalityCode,-1,!0,i,r),n.opponent&&WS(w,s,n.opponent.nationalityCode,1,!1,i,r)}function I(e,t){if(N){let n=t.data.participantName?.toLowerCase()===P?.toLowerCase();A_(e.currentTarget).attr(kS,n?1:.2)}else x.selectAll(`path`).attr(kS,.8);j(),A()}let L=i.eventHandlers?.clickSegment;function R(e,t){if(!L)return;let n=t.data;L({participantName:n.participantName,drawPosition:n.drawPosition,seedNumber:n.seedNumber,entryStatus:n.entryStatus,nationalityCode:n.nationalityCode,scoreString:n.scoreString,matchUpStatus:n.matchUpStatus,roundName:n.roundName,depth:n.depth,matchUp:n.matchUp})}let z=x.selectAll(`path`).data(v).join(`path`).attr(`d`,e=>y(e)).attr(`fill`,e=>e.data.color||`#ccc`).attr(kS,.8).attr(`stroke`,`#fff`).attr(`stroke-width`,1).on(`mouseover`,F).on(`mouseout`,I);L&&z.style(`cursor`,`pointer`).on(`click`,R),z.append(`title`).text(e=>{let t=e.data;return t.participantName?`${t.participantName}\nDraw: ${t.drawPosition||`N/A`}`:`${t.name}\nDepth: ${e.depth}`});function B(e){let t=0;return N=!!e,P=e,x.selectAll(`path`).attr(kS,n=>e?n.data.participantName?.toLowerCase()===e.toLowerCase()?(t+=1,1):.2:.8),t}function ee(e){b.style(`display`,e?`none`:`block`)}return{highlightPlayer:B,hide:ee}}function KS(e={}){return{render:(t,n,r)=>GS(t,n,r,e)}}function qS(e){return e?.length===2?e&&String.fromCodePoint!==void 0?e.toUpperCase().replaceAll(/./g,e=>String.fromCodePoint((e.codePointAt(0)??0)+127397)):e:``}function JS(e){return qS(AS[e]||e)}var{LUCKY_LOSER:YS,WILDCARD:XS,QUALIFIER:ZS}=t.entryStatusConstants;function QS(e){let t={};for(let[n,r]of Object.entries(e.roundMatchUps))t[Number(n)]=r.map(e=>({...e,winningSide:e.winningSide,drawPositions:e.drawPositions||[],scoreString:e.winningSide===1?e.score?.scoreStringSide1:e.winningSide===2?e.score?.scoreStringSide2:void 0,sides:(e.sides||[]).map(e=>({sideNumber:e.sideNumber,drawPosition:e.drawPosition,participantName:e.participant?.participantName,nationalityCode:e.participant?.person?.nationalityCode,seedNumber:e.seedNumber,entryStatus:e.participant?.entryStatus}))}));return{drawSize:(t[1]?.length||0)*2,roundMatchUps:t,seedAssignments:e.seedAssignments}}var $S={LL:YS,WC:XS,Q:ZS},eC=[`R128`,`R64`,`R32`,`R16`,`QF`,`SF`,`F`];function tC(e){let t=nC(e);if(t.length===0)return{drawSize:0,roundMatchUps:{}};let n=t[0].data,r=n.length,i=rC(n),a=iC(t,e),o={};o[1]=oC(n,a,t);for(let e=1;e<t.length;e++)o[e+1]=sC(e,t,a,i);return{drawSize:r,roundMatchUps:o}}function nC(e){let t=[],n=!1;for(let r of eC){let i=e[r];i&&i.length>0&&(n=!0),n&&i&&i.length>0&&t.push({key:r,data:i})}return t}function rC(e){let t=new Map;return e.forEach((e,n)=>{let r=cC(e.player);r&&r!==`BYE`&&t.set(r,{drawPosition:e.Draw??n+1,country:e.country,seed:e.seed,entry:e.entry})}),t}function iC(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=r+1<e.length?e[r+1].data:t.W||[],a=new Set;for(let e of i){let t=cC(e.player);t&&a.add(t)}n.set(e[r].key,a)}return n}function aC(e,t,n){if(e===`BYE`||t===`BYE`)return e===`BYE`?2:1;if(n.has(e))return 1;if(n.has(t))return 2}function oC(e,t,n){let r=[],i=t.get(n[0].key)||new Set;for(let t=0;t<e.length;t+=2){let a=e[t],o=e[t+1],s=cC(a?.player),c=cC(o?.player),l=s===`BYE`||c===`BYE`,u=aC(s,c,i),d;if(!l&&n.length>1){let e=n[1].data,t=u===1?s:c;d=e.find(e=>cC(e.player)===t)?.score}let f=l?`BYE`:u?`COMPLETED`:`TO_BE_PLAYED`;r.push({roundNumber:1,matchUpStatus:f,winningSide:u,drawPositions:[a?.Draw??t+1,o?.Draw??t+2],scoreString:d,sides:[uC(1,a,t+1),uC(2,o,t+2)]})}return r}function sC(e,t,n,r){let i=e+1,a=t[e].data,o=n.get(t[e].key)||new Set,s=[];for(let e=0;e<a.length;e+=2){let t=a[e],n=a[e+1],c=cC(t?.player),l=cC(n?.player),u=o.has(c)?1:o.has(l)?2:void 0,d=(u===1?t:u===2?n:void 0)?.score,f=u?`COMPLETED`:`TO_BE_PLAYED`;s.push({roundNumber:i,matchUpStatus:f,winningSide:u,drawPositions:[r.get(c)?.drawPosition??0,r.get(l)?.drawPosition??0],scoreString:d,sides:[dC(1,t,r),dC(2,n,r)]})}return s}function cC(e){if(!e)return``;let t=e.trim();return t.toUpperCase()===`BYE`?`BYE`:t}function lC(e){if(e)return $S[e.toUpperCase()]||e}function uC(e,t,n){if(!t)return{sideNumber:e,drawPosition:n};let r=cC(t.player);return{sideNumber:e,drawPosition:t.Draw??n,participantName:r||void 0,nationalityCode:t.country||void 0,seedNumber:t.seed?Number(t.seed):void 0,entryStatus:lC(t.entry)}}function dC(e,t,n){if(!t)return{sideNumber:e,drawPosition:0};let r=cC(t.player),i=n.get(r);return{sideNumber:e,drawPosition:i?.drawPosition??0,participantName:r||void 0,nationalityCode:t.country||i?.country||void 0,seedNumber:t.seed?Number(t.seed):i?.seed?Number(i.seed):void 0,entryStatus:lC(t.entry||i?.entry)}}var fC=`right`,pC=`font-medium`;function mC({target:e,button:t,stateChange:n}){let r=0,i=()=>(r+=1,`Item${r}`),a=document.createElement(`div`);t.class&&a.classList.add(t.class),a.classList.add(`dropdown`),t.id&&(a.id=t.id),t.align===fC&&a.classList.add(`is-right`);let o=e=>e.classList.contains(`is-active`),s=()=>{o(a)&&a.classList.remove(`is-active`)},c=e=>o(e)?(e.classList.remove(`is-active`),!1):(e.classList.add(`is-active`),!0);a.onmouseleave=s,a.onclick=()=>c(a);let l=document.createElement(`div`);l.classList.add(`dropdown-trigger`);let u=document.createElement(`button`);u.className=`button font-medium`,t.intent&&u.classList.add(t.intent),u.setAttribute(`aria-haspopup`,`true`);let d=document.createElement(`span`);B(t.onClick)&&(d.onclick=t.onClick),d.style.cssText=`margin-right: 1em`,d.innerHTML=t.label,u.appendChild(d);let f=document.createElement(`span`);B(t.onClick)&&(f.onclick=t.onClick),f.innerHTML=`
|
|
215
215
|
<span class="icon is-small font-medium">
|
|
216
216
|
<i class="fas fa-angle-down font-medium" aria-hidden="true"></i>
|
|
217
217
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "courthive-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.19.0 < 25"
|
|
6
6
|
},
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"focus-trap": "^8.0.0",
|
|
108
108
|
"timepicker-ui": "^4.1.2",
|
|
109
109
|
"tippy.js": "6.3.7",
|
|
110
|
-
"tods-competition-factory": "^3.1.
|
|
110
|
+
"tods-competition-factory": "^3.1.3",
|
|
111
111
|
"vanillajs-datepicker": "1.3.4"
|
|
112
112
|
}
|
|
113
113
|
}
|