@decidables/prospectable-elements 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/lib/prospectableElements.esm.js +948 -972
- package/lib/prospectableElements.esm.js.map +1 -1
- package/lib/prospectableElements.esm.min.js +199 -223
- package/lib/prospectableElements.esm.min.js.map +1 -1
- package/lib/prospectableElements.umd.js +948 -972
- package/lib/prospectableElements.umd.js.map +1 -1
- package/lib/prospectableElements.umd.min.js +199 -223
- package/lib/prospectableElements.umd.min.js.map +1 -1
- package/package.json +8 -7
- package/src/components/cpt-parameters.js +1 -0
- package/src/components/cpt-probability.js +7 -7
- package/src/components/cpt-space.js +99 -25
- package/src/components/cpt-value.js +8 -8
- package/src/components/decision-space.js +99 -25
- package/src/components/prospectable-response.js +2 -0
- package/src/components/risky-option.js +18 -21
- package/src/equations/cpt-equation.js +2 -0
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const A=globalThis,L=A.trustedTypes,R=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,m="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+V,Z=`<${S}>`,p=document,E=()=>p.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,W="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,f=/>/g,w=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),v=/'/g,Y=/"/g,J=/^(?:script|style|textarea|title)$/i,k=t=>(B,...s)=>({_$litType$:t,strings:B,values:s}),M=k(1),T=k(2),z=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),O=new WeakMap,P=p.createTreeWalker(p,129);function j(t,B){if(!X(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(B):B}let _=class t{constructor({strings:B,_$litType$:s},Q){let F;this.parts=[];let i=0,U=0;const g=B.length-1,e=this.parts,[I,l]=((t,B)=>{const s=t.length-1,Q=[];let F,i=2===B?"<svg>":3===B?"<math>":"",U=H;for(let B=0;B<s;B++){const s=t[B];let g,e,I=-1,l=0;for(;l<s.length&&(U.lastIndex=l,e=U.exec(s),null!==e);)l=U.lastIndex,U===H?"!--"===e[1]?U=D:void 0!==e[1]?U=f:void 0!==e[2]?(J.test(e[2])&&(F=RegExp("</"+e[2],"g")),U=w):void 0!==e[3]&&(U=w):U===w?">"===e[0]?(U=F??H,I=-1):void 0===e[1]?I=-2:(I=U.lastIndex-e[2].length,g=e[1],U=void 0===e[3]?w:'"'===e[3]?Y:v):U===Y||U===v?U=w:U===D||U===f?U=H:(U=w,F=void 0);const c=U===w&&t[B+1].startsWith("/>")?" ":"";i+=U===H?s+Z:I>=0?(Q.push(g),s.slice(0,I)+m+s.slice(I)+V+c):s+V+(-2===I?B:c)}return[j(t,i+(t[s]||"<?>")+(2===B?"</svg>":3===B?"</math>":"")),Q]})(B,s);if(this.el=t.createElement(I,Q),P.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(F=P.nextNode())&&e.length<g;){if(1===F.nodeType){if(F.hasAttributes())for(const t of F.getAttributeNames())if(t.endsWith(m)){const B=l[U++],s=F.getAttribute(t).split(V),Q=/([.?@])?(.*)/.exec(B);e.push({type:1,index:i,name:Q[2],strings:s,ctor:"."===Q[1]?st:"?"===Q[1]?Qt:"@"===Q[1]?Ft:Bt}),F.removeAttribute(t)}else t.startsWith(V)&&(e.push({type:6,index:i}),F.removeAttribute(t));if(J.test(F.tagName)){const t=F.textContent.split(V),B=t.length-1;if(B>0){F.textContent=L?L.emptyScript:"";for(let s=0;s<B;s++)F.append(t[s],E()),P.nextNode(),e.push({type:2,index:++i});F.append(t[B],E())}}}else if(8===F.nodeType)if(F.data===S)e.push({type:2,index:i});else{let t=-1;for(;-1!==(t=F.data.indexOf(V,t+1));)e.push({type:7,index:i}),t+=V.length-1}i++}}static createElement(t,B){const s=p.createElement("template");return s.innerHTML=t,s}};function $(t,B,s=t,Q){if(B===z)return B;let F=void 0!==Q?s._$Co?.[Q]:s._$Cl;const i=N(B)?void 0:B._$litDirective$;return F?.constructor!==i&&(F?._$AO?.(!1),void 0===i?F=void 0:(F=new i(t),F._$AT(t,s,Q)),void 0!==Q?(s._$Co??=[])[Q]=F:s._$Cl=F),void 0!==F&&(B=$(t,F._$AS(t,B.values),F,Q)),B}let q=class{constructor(t,B){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=B}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:B},parts:s}=this._$AD,Q=(t?.creationScope??p).importNode(B,!0);P.currentNode=Q;let F=P.nextNode(),i=0,U=0,g=s[0];for(;void 0!==g;){if(i===g.index){let B;2===g.type?B=new tt(F,F.nextSibling,this,t):1===g.type?B=new g.ctor(F,g.name,g.strings,this,t):6===g.type&&(B=new Ut(F,this,t)),this._$AV.push(B),g=s[++U]}i!==g?.index&&(F=P.nextNode(),i++)}return P.currentNode=p,Q}p(t){let B=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,B),B+=s.strings.length-2):s._$AI(t[B])),B++}};class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,B,s,Q){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=B,this._$AM=s,this.options=Q,this._$Cv=Q?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const B=this._$AM;return void 0!==B&&11===t?.nodeType&&(t=B.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,B=this){t=$(this,t,B),N(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>X(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==K&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(p.createTextNode(t)),this._$AH=t}$(t){const{values:B,_$litType$:s}=t,Q="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=_.createElement(j(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===Q)this._$AH.p(B);else{const t=new q(Q,this),s=t.u(this.options);t.p(B),this.T(s),this._$AH=t}}_$AC(t){let B=O.get(t.strings);return void 0===B&&O.set(t.strings,B=new _(t)),B}k(t){X(this._$AH)||(this._$AH=[],this._$AR());const B=this._$AH;let s,Q=0;for(const F of t)Q===B.length?B.push(s=new tt(this.O(E()),this.O(E()),this,this.options)):s=B[Q],s._$AI(F),Q++;Q<B.length&&(this._$AR(s&&s._$AB.nextSibling,Q),B.length=Q)}_$AR(t=this._$AA.nextSibling,B){for(this._$AP?.(!1,!0,B);t!==this._$AB;){const B=t.nextSibling;t.remove(),t=B}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let Bt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,B,s,Q,F){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=B,this._$AM=Q,this.options=F,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=K}_$AI(t,B=this,s,Q){const F=this.strings;let i=!1;if(void 0===F)t=$(this,t,B,0),i=!N(t)||t!==this._$AH&&t!==z,i&&(this._$AH=t);else{const Q=t;let U,g;for(t=F[0],U=0;U<F.length-1;U++)g=$(this,Q[s+U],B,U),g===z&&(g=this._$AH[U]),i||=!N(g)||g!==this._$AH[U],g===K?t=K:t!==K&&(t+=(g??"")+F[U+1]),this._$AH[U]=g}i&&!Q&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class st extends Bt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class Qt extends Bt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class Ft extends Bt{constructor(t,B,s,Q,F){super(t,B,s,Q,F),this.type=5}_$AI(t,B=this){if((t=$(this,t,B,0)??K)===z)return;const s=this._$AH,Q=t===K&&s!==K||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,F=t!==K&&(s===K||Q);Q&&this.element.removeEventListener(this.name,this,s),F&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}
|
|
17
|
+
const A=globalThis,L=A.trustedTypes,R=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,m="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+V,Z=`<${S}>`,p=document,E=()=>p.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,W="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,f=/>/g,w=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),v=/'/g,Y=/"/g,J=/^(?:script|style|textarea|title)$/i,k=t=>(B,...s)=>({_$litType$:t,strings:B,values:s}),M=k(1),T=k(2),z=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),O=new WeakMap,P=p.createTreeWalker(p,129);function j(t,B){if(!X(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(B):B}let _=class t{constructor({strings:B,_$litType$:s},Q){let F;this.parts=[];let i=0,U=0;const g=B.length-1,e=this.parts,[I,l]=((t,B)=>{const s=t.length-1,Q=[];let F,i=2===B?"<svg>":3===B?"<math>":"",U=H;for(let B=0;B<s;B++){const s=t[B];let g,e,I=-1,l=0;for(;l<s.length&&(U.lastIndex=l,e=U.exec(s),null!==e);)l=U.lastIndex,U===H?"!--"===e[1]?U=D:void 0!==e[1]?U=f:void 0!==e[2]?(J.test(e[2])&&(F=RegExp("</"+e[2],"g")),U=w):void 0!==e[3]&&(U=w):U===w?">"===e[0]?(U=F??H,I=-1):void 0===e[1]?I=-2:(I=U.lastIndex-e[2].length,g=e[1],U=void 0===e[3]?w:'"'===e[3]?Y:v):U===Y||U===v?U=w:U===D||U===f?U=H:(U=w,F=void 0);const c=U===w&&t[B+1].startsWith("/>")?" ":"";i+=U===H?s+Z:I>=0?(Q.push(g),s.slice(0,I)+m+s.slice(I)+V+c):s+V+(-2===I?B:c)}return[j(t,i+(t[s]||"<?>")+(2===B?"</svg>":3===B?"</math>":"")),Q]})(B,s);if(this.el=t.createElement(I,Q),P.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(F=P.nextNode())&&e.length<g;){if(1===F.nodeType){if(F.hasAttributes())for(const t of F.getAttributeNames())if(t.endsWith(m)){const B=l[U++],s=F.getAttribute(t).split(V),Q=/([.?@])?(.*)/.exec(B);e.push({type:1,index:i,name:Q[2],strings:s,ctor:"."===Q[1]?st:"?"===Q[1]?Qt:"@"===Q[1]?Ft:Bt}),F.removeAttribute(t)}else t.startsWith(V)&&(e.push({type:6,index:i}),F.removeAttribute(t));if(J.test(F.tagName)){const t=F.textContent.split(V),B=t.length-1;if(B>0){F.textContent=L?L.emptyScript:"";for(let s=0;s<B;s++)F.append(t[s],E()),P.nextNode(),e.push({type:2,index:++i});F.append(t[B],E())}}}else if(8===F.nodeType)if(F.data===S)e.push({type:2,index:i});else{let t=-1;for(;-1!==(t=F.data.indexOf(V,t+1));)e.push({type:7,index:i}),t+=V.length-1}i++}}static createElement(t,B){const s=p.createElement("template");return s.innerHTML=t,s}};function $(t,B,s=t,Q){if(B===z)return B;let F=void 0!==Q?s._$Co?.[Q]:s._$Cl;const i=N(B)?void 0:B._$litDirective$;return F?.constructor!==i&&(F?._$AO?.(!1),void 0===i?F=void 0:(F=new i(t),F._$AT(t,s,Q)),void 0!==Q?(s._$Co??=[])[Q]=F:s._$Cl=F),void 0!==F&&(B=$(t,F._$AS(t,B.values),F,Q)),B}let q=class{constructor(t,B){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=B}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:B},parts:s}=this._$AD,Q=(t?.creationScope??p).importNode(B,!0);P.currentNode=Q;let F=P.nextNode(),i=0,U=0,g=s[0];for(;void 0!==g;){if(i===g.index){let B;2===g.type?B=new tt(F,F.nextSibling,this,t):1===g.type?B=new g.ctor(F,g.name,g.strings,this,t):6===g.type&&(B=new Ut(F,this,t)),this._$AV.push(B),g=s[++U]}i!==g?.index&&(F=P.nextNode(),i++)}return P.currentNode=p,Q}p(t){let B=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,B),B+=s.strings.length-2):s._$AI(t[B])),B++}};class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,B,s,Q){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=B,this._$AM=s,this.options=Q,this._$Cv=Q?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const B=this._$AM;return void 0!==B&&11===t?.nodeType&&(t=B.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,B=this){t=$(this,t,B),N(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>X(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==K&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(p.createTextNode(t)),this._$AH=t}$(t){const{values:B,_$litType$:s}=t,Q="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=_.createElement(j(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===Q)this._$AH.p(B);else{const t=new q(Q,this),s=t.u(this.options);t.p(B),this.T(s),this._$AH=t}}_$AC(t){let B=O.get(t.strings);return void 0===B&&O.set(t.strings,B=new _(t)),B}k(t){X(this._$AH)||(this._$AH=[],this._$AR());const B=this._$AH;let s,Q=0;for(const F of t)Q===B.length?B.push(s=new tt(this.O(E()),this.O(E()),this,this.options)):s=B[Q],s._$AI(F),Q++;Q<B.length&&(this._$AR(s&&s._$AB.nextSibling,Q),B.length=Q)}_$AR(t=this._$AA.nextSibling,B){for(this._$AP?.(!1,!0,B);t!==this._$AB;){const B=t.nextSibling;t.remove(),t=B}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let Bt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,B,s,Q,F){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=B,this._$AM=Q,this.options=F,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=K}_$AI(t,B=this,s,Q){const F=this.strings;let i=!1;if(void 0===F)t=$(this,t,B,0),i=!N(t)||t!==this._$AH&&t!==z,i&&(this._$AH=t);else{const Q=t;let U,g;for(t=F[0],U=0;U<F.length-1;U++)g=$(this,Q[s+U],B,U),g===z&&(g=this._$AH[U]),i||=!N(g)||g!==this._$AH[U],g===K?t=K:t!==K&&(t+=(g??"")+F[U+1]),this._$AH[U]=g}i&&!Q&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class st extends Bt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class Qt extends Bt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class Ft extends Bt{constructor(t,B,s,Q,F){super(t,B,s,Q,F),this.type=5}_$AI(t,B=this){if((t=$(this,t,B,0)??K)===z)return;const s=this._$AH,Q=t===K&&s!==K||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,F=t!==K&&(s===K||Q);Q&&this.element.removeEventListener(this.name,this,s),F&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ut{constructor(t,B,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=B,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){$(this,t)}}const gt=A.litHtmlPolyfillSupport;gt?.(_,tt),(A.litHtmlVersions??=[]).push("3.3.1");const et=(t,B,s)=>{const Q=s?.renderBefore??B;let F=Q._$litPart$;if(void 0===F){const t=s?.renderBefore??null;Q._$litPart$=F=new tt(B.insertBefore(E(),t),t,void 0,s??{})}return F._$AI(t),F},It=globalThis;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/let lt=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const B=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=et(B,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};lt._$litElement$=!0,lt.finalized=!0,It.litElementHydrateSupport?.({LitElement:lt});const ct=It.litElementPolyfillSupport;function nt(t,B){return null==t||null==B?NaN:t<B?-1:t>B?1:t>=B?0:NaN}function at(t,B){return null==t||null==B?NaN:B<t?-1:B>t?1:B>=t?0:NaN}function dt(t){let B,s,Q;function F(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<0?F=B+1:i=B}while(F<i)}return F}return 2!==t.length?(B=nt,s=(B,s)=>nt(t(B),s),Q=(B,s)=>t(B)-s):(B=t===nt||t===at?t:ot,s=t,Q=t),{left:F,center:function(t,B,s=0,i=t.length){const U=F(t,B,s,i-1);return U>s&&Q(t[U-1],B)>-Q(t[U],B)?U-1:U},right:function(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<=0?F=B+1:i=B}while(F<i)}return F}}}function ot(){return 0}function bt(t){return null===t?NaN:+t}ct?.({LitElement:lt}),(It.litElementVersions??=[]).push("4.2.1");const Ct=dt(nt).right;function rt(t,B){let s=0;for(let B of t)null!=B&&(B=+B)>=B&&++s;return s}function ut(t){return 0|t.length}function ht(t){return!(t>0)}function xt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function Gt(t,B){var s=0;return Float64Array.from(t,t=>s+=+t||0)}function yt(t,B){let s,Q=0,F=0,i=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(s=B-F,F+=s/++Q,i+=s*(B-F));else{let U=-1;for(let g of t)null!=(g=B(g,++U,t))&&(g=+g)>=g&&(s=g-F,F+=s/++Q,i+=s*(g-F))}if(Q>1)return i/(Q-1)}function At(t,B){const s=yt(t,B);return s?Math.sqrt(s):s}function Lt(t,B){let s,Q;if(void 0===B)for(const B of t)null!=B&&(void 0===s?B>=B&&(s=Q=B):(s>B&&(s=B),Q<B&&(Q=B)));else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(void 0===s?i>=i&&(s=Q=i):(s>i&&(s=i),Q<i&&(Q=i)))}return[s,Q]}dt(bt).center;class Rt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const B=this._partials;let s=0;for(let Q=0;Q<this._n&&Q<32;Q++){const F=B[Q],i=t+F,U=Math.abs(t)<Math.abs(F)?t-(i-F):F-(i-t);U&&(B[s++]=U),t=i}return B[s]=t,this._n=s+1,this}valueOf(){const t=this._partials;let B,s,Q,F=this._n,i=0;if(F>0){for(i=t[--F];F>0&&(B=i,s=t[--F],i=B+s,Q=s-(i-B),!Q););F>0&&(Q<0&&t[F-1]<0||Q>0&&t[F-1]>0)&&(s=2*Q,B=i+s,s==B-i&&(i=B))}return i}}class mt extends Map{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const[B,s]of t)this.set(B,s)}get(t){return super.get(St(this,t))}has(t){return super.has(St(this,t))}set(t,B){return super.set(Zt(this,t),B)}delete(t){return super.delete(pt(this,t))}}class Vt extends Set{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const B of t)this.add(B)}has(t){return super.has(St(this,t))}add(t){return super.add(Zt(this,t))}delete(t){return super.delete(pt(this,t))}}function St({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):s}function Zt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):(t.set(Q,s),s)}function pt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)&&(s=t.get(Q),t.delete(Q)),s}function Et(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Nt(t){return t}function Xt(t,...B){return Dt(t,Nt,Nt,B)}function Wt(t,B,...s){return Dt(t,Nt,B,s)}function Ht(t,B,...s){return Dt(t,Array.from,B,s)}function Dt(t,B,s,Q){return function t(F,i){if(i>=Q.length)return s(F);const U=new mt,g=Q[i++];let e=-1;for(const t of F){const B=g(t,++e,F),s=U.get(B);s?s.push(t):U.set(B,[t])}for(const[B,s]of U)U.set(B,t(s,i));return B(U)}(t,0)}function ft(t,...B){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[s]=B;if(s&&2!==s.length||B.length>1){const i=Uint32Array.from(t,(t,B)=>B);return B.length>1?(B=B.map(B=>t.map(B)),i.sort((t,s)=>{for(const Q of B){const B=vt(Q[t],Q[s]);if(B)return B}})):(s=t.map(s),i.sort((t,B)=>vt(s[t],s[B]))),Q=t,F=i,Array.from(F,t=>Q[t])}var Q,F;return t.sort(wt(s))}function wt(t=nt){if(t===nt)return vt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(B,s)=>{const Q=t(B,s);return Q||0===Q?Q:(0===t(s,s))-(0===t(B,B))}}function vt(t,B){return(null==t||!(t>=t))-(null==B||!(B>=B))||(t<B?-1:t>B?1:0)}function Yt(t,B,s){return(2!==B.length?ft(Wt(t,B,s),([t,B],[s,Q])=>nt(B,Q)||nt(t,s)):ft(Xt(t,s),([t,s],[Q,F])=>B(s,F)||nt(t,Q))).map(([t])=>t)}const Jt=Math.sqrt(50),kt=Math.sqrt(10),Mt=Math.sqrt(2);function Tt(t,B,s){const Q=(B-t)/Math.max(0,s),F=Math.floor(Math.log10(Q)),i=Q/Math.pow(10,F),U=i>=Jt?10:i>=kt?5:i>=Mt?2:1;let g,e,I;return F<0?(I=Math.pow(10,-F)/U,g=Math.round(t*I),e=Math.round(B*I),g/I<t&&++g,e/I>B&&--e,I=-I):(I=Math.pow(10,F)*U,g=Math.round(t/I),e=Math.round(B/I),g*I<t&&++g,e*I>B&&--e),e<g&&.5<=s&&s<2?Tt(t,B,2*s):[g,e,I]}function zt(t,B,s){if(!((s=+s)>0))return[];if((t=+t)===(B=+B))return[t];const Q=B<t,[F,i,U]=Q?Tt(B,t,s):Tt(t,B,s);if(!(i>=F))return[];const g=i-F+1,e=new Array(g);if(Q)if(U<0)for(let t=0;t<g;++t)e[t]=(i-t)/-U;else for(let t=0;t<g;++t)e[t]=(i-t)*U;else if(U<0)for(let t=0;t<g;++t)e[t]=(F+t)/-U;else for(let t=0;t<g;++t)e[t]=(F+t)*U;return e}function Kt(t,B,s){return Tt(t=+t,B=+B,s=+s)[2]}function Ot(t,B,s){s=+s;const Q=(B=+B)<(t=+t),F=Q?Kt(B,t,s):Kt(t,B,s);return(Q?-1:1)*(F<0?1/-F:F)}function Pt(t){return Math.max(1,Math.ceil(Math.log(rt(t))/Math.LN2)+1)}function jt(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s<B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s<F||void 0===s&&F>=F)&&(s=F)}return s}function _t(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s<B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s<i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function $t(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s>B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s>F||void 0===s&&F>=F)&&(s=F)}return s}function qt(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s>B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s>i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function tB(t,B,s=0,Q=1/0,F){if(B=Math.floor(B),s=Math.floor(Math.max(0,s)),Q=Math.floor(Math.min(t.length-1,Q)),!(s<=B&&B<=Q))return t;for(F=void 0===F?vt:wt(F);Q>s;){if(Q-s>600){const i=Q-s+1,U=B-s+1,g=Math.log(i),e=.5*Math.exp(2*g/3),I=.5*Math.sqrt(g*e*(i-e)/i)*(U-i/2<0?-1:1);tB(t,B,Math.max(s,Math.floor(B-U*e/i+I)),Math.min(Q,Math.floor(B+(i-U)*e/i+I)),F)}const i=t[B];let U=s,g=Q;for(BB(t,s,B),F(t[Q],i)>0&&BB(t,s,Q);U<g;){for(BB(t,U,g),++U,--g;F(t[U],i)<0;)++U;for(;F(t[g],i)>0;)--g}0===F(t[s],i)?BB(t,s,g):(++g,BB(t,g,Q)),g<=B&&(s=g+1),B<=g&&(Q=g-1)}return t}function BB(t,B,s){const Q=t[B];t[B]=t[s],t[s]=Q}function sB(t,B=nt){let s,Q=!1;if(1===B.length){let F;for(const i of t){const t=B(i);(Q?nt(t,F)>0:0===nt(t,t))&&(s=i,F=t,Q=!0)}}else for(const F of t)(Q?B(F,s)>0:0===B(F,F))&&(s=F,Q=!0);return s}function QB(t,B,s){if(t=Float64Array.from(function*(t,B){if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(yield B);else{let s=-1;for(let Q of t)null!=(Q=B(Q,++s,t))&&(Q=+Q)>=Q&&(yield Q)}}(t,s)),(Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return $t(t);if(B>=1)return jt(t);var Q,F=(Q-1)*B,i=Math.floor(F),U=jt(tB(t,i).subarray(0,i+1));return U+($t(t.subarray(i+1))-U)*(F-i)}}function FB(t,B,s=bt){if((Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return+s(t[0],0,t);if(B>=1)return+s(t[Q-1],Q-1,t);var Q,F=(Q-1)*B,i=Math.floor(F),U=+s(t[i],i,t);return U+(+s(t[i+1],i+1,t)-U)*(F-i)}}function iB(t,B,s){const Q=rt(t),F=QB(t,.75)-QB(t,.25);return Q&&F?Math.ceil((s-B)/(2*F*Math.pow(Q,-1/3))):1}function UB(t,B,s){const Q=rt(t),F=At(t);return Q&&F?Math.ceil((s-B)*Math.cbrt(Q)/(3.49*F)):1}function gB(t,B){let s=0,Q=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(++s,Q+=B);else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(i=+i)>=i&&(++s,Q+=i)}if(s)return Q/s}function eB(t,B){return QB(t,.5,B)}function IB(t){return Array.from(function*(t){for(const B of t)yield*B}(t))}function lB(t,B){const s=new mt;if(void 0===B)for(let B of t)null!=B&&B>=B&&s.set(B,(s.get(B)||0)+1);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&F>=F&&s.set(F,(s.get(F)||0)+1)}let Q,F=0;for(const[t,B]of s)B>F&&(F=B,Q=t);return Q}function cB(t,B){return[t,B]}function nB(t,B,s){t=+t,B=+B,s=(F=arguments.length)<2?(B=t,t=0,1):F<3?1:+s;for(var Q=-1,F=0|Math.max(0,Math.ceil((B-t)/s)),i=new Array(F);++Q<F;)i[Q]=t+Q*s;return i}function aB(t,B){let s=0;if(void 0===B)for(let B of t)(B=+B)&&(s+=B);else{let Q=-1;for(let F of t)(F=+B(F,++Q,t))&&(s+=F)}return s}function dB(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function oB(t){return t}var bB=1e-6;function CB(t){return"translate("+t+",0)"}function rB(t){return"translate(0,"+t+")"}function uB(t){return B=>+t(B)}function hB(t,B){return B=Math.max(0,t.bandwidth()-2*B)/2,t.round()&&(B=Math.round(B)),s=>+t(s)+B}function xB(){return!this.__axis}function GB(t,B){var s=[],Q=null,F=null,i=6,U=6,g=3,e="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,I=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",c=1===t||3===t?CB:rB;function n(n){var a=null==Q?B.ticks?B.ticks.apply(B,s):B.domain():Q,d=null==F?B.tickFormat?B.tickFormat.apply(B,s):oB:F,o=Math.max(i,0)+g,b=B.range(),C=+b[0]+e,r=+b[b.length-1]+e,u=(B.bandwidth?hB:uB)(B.copy(),e),h=n.selection?n.selection():n,x=h.selectAll(".domain").data([null]),G=h.selectAll(".tick").data(a,B).order(),y=G.exit(),A=G.enter().append("g").attr("class","tick"),L=G.select("line"),R=G.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),G=G.merge(A),L=L.merge(A.append("line").attr("stroke","currentColor").attr(l+"2",I*i)),R=R.merge(A.append("text").attr("fill","currentColor").attr(l,I*o).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),n!==h&&(x=x.transition(n),G=G.transition(n),L=L.transition(n),R=R.transition(n),y=y.transition(n).attr("opacity",bB).attr("transform",function(t){return isFinite(t=u(t))?c(t+e):this.getAttribute("transform")}),A.attr("opacity",bB).attr("transform",function(t){var B=this.parentNode.__axis;return c((B&&isFinite(B=B(t))?B:u(t))+e)})),y.remove(),x.attr("d",4===t||2===t?U?"M"+I*U+","+C+"H"+e+"V"+r+"H"+I*U:"M"+e+","+C+"V"+r:U?"M"+C+","+I*U+"V"+e+"H"+r+"V"+I*U:"M"+C+","+e+"H"+r),G.attr("opacity",1).attr("transform",function(t){return c(u(t)+e)}),L.attr(l+"2",I*i),R.attr(l,I*o).text(d),h.filter(xB).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),h.each(function(){this.__axis=u})}return n.scale=function(t){return arguments.length?(B=t,n):B},n.ticks=function(){return s=Array.from(arguments),n},n.tickArguments=function(t){return arguments.length?(s=null==t?[]:Array.from(t),n):s.slice()},n.tickValues=function(t){return arguments.length?(Q=null==t?null:Array.from(t),n):Q&&Q.slice()},n.tickFormat=function(t){return arguments.length?(F=t,n):F},n.tickSize=function(t){return arguments.length?(i=U=+t,n):i},n.tickSizeInner=function(t){return arguments.length?(i=+t,n):i},n.tickSizeOuter=function(t){return arguments.length?(U=+t,n):U},n.tickPadding=function(t){return arguments.length?(g=+t,n):g},n.offset=function(t){return arguments.length?(e=+t,n):e},n}function yB(t){return GB(3,t)}function AB(t){return GB(4,t)}var LB={value:()=>{}};function RB(){for(var t,B=0,s=arguments.length,Q={};B<s;++B){if(!(t=arguments[B]+"")||t in Q||/[\s.]/.test(t))throw new Error("illegal type: "+t);Q[t]=[]}return new mB(Q)}function mB(t){this._=t}function VB(t,B){for(var s,Q=0,F=t.length;Q<F;++Q)if((s=t[Q]).name===B)return s.value}function SB(t,B,s){for(var Q=0,F=t.length;Q<F;++Q)if(t[Q].name===B){t[Q]=LB,t=t.slice(0,Q).concat(t.slice(Q+1));break}return null!=s&&t.push({name:B,value:s}),t}mB.prototype=RB.prototype={constructor:mB,on:function(t,B){var s,Q,F=this._,i=(Q=F,(t+"").trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");if(s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),t&&!Q.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:B}})),U=-1,g=i.length;if(!(arguments.length<2)){if(null!=B&&"function"!=typeof B)throw new Error("invalid callback: "+B);for(;++U<g;)if(s=(t=i[U]).type)F[s]=SB(F[s],t.name,B);else if(null==B)for(s in F)F[s]=SB(F[s],t.name,null);return this}for(;++U<g;)if((s=(t=i[U]).type)&&(s=VB(F[s],t.name)))return s},copy:function(){var t={},B=this._;for(var s in B)t[s]=B[s].slice();return new mB(t)},call:function(t,B){if((s=arguments.length-2)>0)for(var s,Q,F=new Array(s),i=0;i<s;++i)F[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,s=(Q=this._[t]).length;i<s;++i)Q[i].value.apply(B,F)},apply:function(t,B,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var Q=this._[t],F=0,i=Q.length;F<i;++F)Q[F].value.apply(B,s)}};var ZB="http://www.w3.org/1999/xhtml",pB={svg:"http://www.w3.org/2000/svg",xhtml:ZB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function EB(t){var B=t+="",s=B.indexOf(":");return s>=0&&"xmlns"!==(B=t.slice(0,s))&&(t=t.slice(s+1)),pB.hasOwnProperty(B)?{space:pB[B],local:t}:t}function NB(t){return function(){var B=this.ownerDocument,s=this.namespaceURI;return s===ZB&&B.documentElement.namespaceURI===ZB?B.createElement(t):B.createElementNS(s,t)}}function XB(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function WB(t){var B=EB(t);return(B.local?XB:NB)(B)}function HB(){}function DB(t){return null==t?HB:function(){return this.querySelector(t)}}function fB(){return[]}function wB(t){return null==t?fB:function(){return this.querySelectorAll(t)}}function vB(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function YB(t){return function(){return this.matches(t)}}function JB(t){return function(B){return B.matches(t)}}var kB=Array.prototype.find;function MB(){return this.firstElementChild}var TB=Array.prototype.filter;function zB(){return Array.from(this.children)}function KB(t){return new Array(t.length)}function OB(t,B){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=B}function PB(t,B,s,Q,F,i){for(var U,g=0,e=B.length,I=i.length;g<I;++g)(U=B[g])?(U.__data__=i[g],Q[g]=U):s[g]=new OB(t,i[g]);for(;g<e;++g)(U=B[g])&&(F[g]=U)}function jB(t,B,s,Q,F,i,U){var g,e,I,l=new Map,c=B.length,n=i.length,a=new Array(c);for(g=0;g<c;++g)(e=B[g])&&(a[g]=I=U.call(e,e.__data__,g,B)+"",l.has(I)?F[g]=e:l.set(I,e));for(g=0;g<n;++g)I=U.call(t,i[g],g,i)+"",(e=l.get(I))?(Q[g]=e,e.__data__=i[g],l.delete(I)):s[g]=new OB(t,i[g]);for(g=0;g<c;++g)(e=B[g])&&l.get(a[g])===e&&(F[g]=e)}function _B(t){return t.__data__}function $B(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function qB(t,B){return t<B?-1:t>B?1:t>=B?0:NaN}function ts(t){return function(){this.removeAttribute(t)}}function Bs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ss(t,B){return function(){this.setAttribute(t,B)}}function Qs(t,B){return function(){this.setAttributeNS(t.space,t.local,B)}}function Fs(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttribute(t):this.setAttribute(t,s)}}function is(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function Us(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function gs(t){return function(){this.style.removeProperty(t)}}function es(t,B,s){return function(){this.style.setProperty(t,B,s)}}function Is(t,B,s){return function(){var Q=B.apply(this,arguments);null==Q?this.style.removeProperty(t):this.style.setProperty(t,Q,s)}}function ls(t,B){return t.style.getPropertyValue(B)||Us(t).getComputedStyle(t,null).getPropertyValue(B)}function cs(t){return function(){delete this[t]}}function ns(t,B){return function(){this[t]=B}}function as(t,B){return function(){var s=B.apply(this,arguments);null==s?delete this[t]:this[t]=s}}function ds(t){return t.trim().split(/^|\s+/)}function os(t){return t.classList||new bs(t)}function bs(t){this._node=t,this._names=ds(t.getAttribute("class")||"")}function Cs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.add(B[Q])}function rs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.remove(B[Q])}function us(t){return function(){Cs(this,t)}}function hs(t){return function(){rs(this,t)}}function xs(t,B){return function(){(B.apply(this,arguments)?Cs:rs)(this,t)}}function Gs(){this.textContent=""}function ys(t){return function(){this.textContent=t}}function As(t){return function(){var B=t.apply(this,arguments);this.textContent=null==B?"":B}}function Ls(){this.innerHTML=""}function Rs(t){return function(){this.innerHTML=t}}function ms(t){return function(){var B=t.apply(this,arguments);this.innerHTML=null==B?"":B}}function Vs(){this.nextSibling&&this.parentNode.appendChild(this)}function Ss(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zs(){return null}function ps(){var t=this.parentNode;t&&t.removeChild(this)}function Es(){var t=this.cloneNode(!1),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Ns(){var t=this.cloneNode(!0),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Xs(t){return function(){var B=this.__on;if(B){for(var s,Q=0,F=-1,i=B.length;Q<i;++Q)s=B[Q],t.type&&s.type!==t.type||s.name!==t.name?B[++F]=s:this.removeEventListener(s.type,s.listener,s.options);++F?B.length=F:delete this.__on}}}function Ws(t,B,s){return function(){var Q,F=this.__on,i=function(t){return function(B){t.call(this,B,this.__data__)}}(B);if(F)for(var U=0,g=F.length;U<g;++U)if((Q=F[U]).type===t.type&&Q.name===t.name)return this.removeEventListener(Q.type,Q.listener,Q.options),this.addEventListener(Q.type,Q.listener=i,Q.options=s),void(Q.value=B);this.addEventListener(t.type,i,s),Q={type:t.type,name:t.name,value:B,listener:i,options:s},F?F.push(Q):this.__on=[Q]}}function Hs(t,B,s){var Q=Us(t),F=Q.CustomEvent;"function"==typeof F?F=new F(B,s):(F=Q.document.createEvent("Event"),s?(F.initEvent(B,s.bubbles,s.cancelable),F.detail=s.detail):F.initEvent(B,!1,!1)),t.dispatchEvent(F)}function Ds(t,B){return function(){return Hs(this,t,B)}}function fs(t,B){return function(){return Hs(this,t,B.apply(this,arguments))}}OB.prototype={constructor:OB,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,B){return this._parent.insertBefore(t,B)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},bs.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var B=this._names.indexOf(t);B>=0&&(this._names.splice(B,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ws=[null];function vs(t,B){this._groups=t,this._parents=B}function Ys(){return new vs([[document.documentElement]],ws)}function Js(t){return"string"==typeof t?new vs([[document.querySelector(t)]],[document.documentElement]):new vs([[t]],ws)}function ks(t,B){if(t=function(t){let B;for(;B=t.sourceEvent;)t=B;return t}(t),void 0===B&&(B=t.currentTarget),B){var s=B.ownerSVGElement||B;if(s.createSVGPoint){var Q=s.createSVGPoint();return Q.x=t.clientX,Q.y=t.clientY,[(Q=Q.matrixTransform(B.getScreenCTM().inverse())).x,Q.y]}if(B.getBoundingClientRect){var F=B.getBoundingClientRect();return[t.clientX-F.left-B.clientLeft,t.clientY-F.top-B.clientTop]}}return[t.pageX,t.pageY]}vs.prototype=Ys.prototype={constructor:vs,select:function(t){"function"!=typeof t&&(t=DB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U,g=B[F],e=g.length,I=Q[F]=new Array(e),l=0;l<e;++l)(i=g[l])&&(U=t.call(i,i.__data__,l,g))&&("__data__"in i&&(U.__data__=i.__data__),I[l]=U);return new vs(Q,this._parents)},selectAll:function(t){t="function"==typeof t?vB(t):wB(t);for(var B=this._groups,s=B.length,Q=[],F=[],i=0;i<s;++i)for(var U,g=B[i],e=g.length,I=0;I<e;++I)(U=g[I])&&(Q.push(t.call(U,U.__data__,I,g)),F.push(U));return new vs(Q,F)},selectChild:function(t){return this.select(null==t?MB:function(t){return function(){return kB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},selectChildren:function(t){return this.selectAll(null==t?zB:function(t){return function(){return TB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},filter:function(t){"function"!=typeof t&&(t=YB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new vs(Q,this._parents)},data:function(t,B){if(!arguments.length)return Array.from(this,_B);var s=B?jB:PB,Q=this._parents,F=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var i=F.length,U=new Array(i),g=new Array(i),e=new Array(i),I=0;I<i;++I){var l=Q[I],c=F[I],n=c.length,a=$B(t.call(l,l&&l.__data__,I,Q)),d=a.length,o=g[I]=new Array(d),b=U[I]=new Array(d);s(l,c,o,b,e[I]=new Array(n),a,B);for(var C,r,u=0,h=0;u<d;++u)if(C=o[u]){for(u>=h&&(h=u+1);!(r=b[h])&&++h<d;);C._next=r||null}}return(U=new vs(U,Q))._enter=g,U._exit=e,U},enter:function(){return new vs(this._enter||this._groups.map(KB),this._parents)},exit:function(){return new vs(this._exit||this._groups.map(KB),this._parents)},join:function(t,B,s){var Q=this.enter(),F=this,i=this.exit();return"function"==typeof t?(Q=t(Q))&&(Q=Q.selection()):Q=Q.append(t+""),null!=B&&(F=B(F))&&(F=F.selection()),null==s?i.remove():s(i),Q&&F?Q.merge(F).order():F},merge:function(t){for(var B=t.selection?t.selection():t,s=this._groups,Q=B._groups,F=s.length,i=Q.length,U=Math.min(F,i),g=new Array(F),e=0;e<U;++e)for(var I,l=s[e],c=Q[e],n=l.length,a=g[e]=new Array(n),d=0;d<n;++d)(I=l[d]||c[d])&&(a[d]=I);for(;e<F;++e)g[e]=s[e];return new vs(g,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,B=-1,s=t.length;++B<s;)for(var Q,F=t[B],i=F.length-1,U=F[i];--i>=0;)(Q=F[i])&&(U&&4^Q.compareDocumentPosition(U)&&U.parentNode.insertBefore(Q,U),U=Q);return this},sort:function(t){function B(B,s){return B&&s?t(B.__data__,s.__data__):!B-!s}t||(t=qB);for(var s=this._groups,Q=s.length,F=new Array(Q),i=0;i<Q;++i){for(var U,g=s[i],e=g.length,I=F[i]=new Array(e),l=0;l<e;++l)(U=g[l])&&(I[l]=U);I.sort(B)}return new vs(F,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q=t[B],F=0,i=Q.length;F<i;++F){var U=Q[F];if(U)return U}return null},size:function(){let t=0;for(const B of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var B=this._groups,s=0,Q=B.length;s<Q;++s)for(var F,i=B[s],U=0,g=i.length;U<g;++U)(F=i[U])&&t.call(F,F.__data__,U,i);return this},attr:function(t,B){var s=EB(t);if(arguments.length<2){var Q=this.node();return s.local?Q.getAttributeNS(s.space,s.local):Q.getAttribute(s)}return this.each((null==B?s.local?Bs:ts:"function"==typeof B?s.local?is:Fs:s.local?Qs:ss)(s,B))},style:function(t,B,s){return arguments.length>1?this.each((null==B?gs:"function"==typeof B?Is:es)(t,B,null==s?"":s)):ls(this.node(),t)},property:function(t,B){return arguments.length>1?this.each((null==B?cs:"function"==typeof B?as:ns)(t,B)):this.node()[t]},classed:function(t,B){var s=ds(t+"");if(arguments.length<2){for(var Q=os(this.node()),F=-1,i=s.length;++F<i;)if(!Q.contains(s[F]))return!1;return!0}return this.each(("function"==typeof B?xs:B?us:hs)(s,B))},text:function(t){return arguments.length?this.each(null==t?Gs:("function"==typeof t?As:ys)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Ls:("function"==typeof t?ms:Rs)(t)):this.node().innerHTML},raise:function(){return this.each(Vs)},lower:function(){return this.each(Ss)},append:function(t){var B="function"==typeof t?t:WB(t);return this.select(function(){return this.appendChild(B.apply(this,arguments))})},insert:function(t,B){var s="function"==typeof t?t:WB(t),Q=null==B?Zs:"function"==typeof B?B:DB(B);return this.select(function(){return this.insertBefore(s.apply(this,arguments),Q.apply(this,arguments)||null)})},remove:function(){return this.each(ps)},clone:function(t){return this.select(t?Ns:Es)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,B,s){var Q,F,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");return s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),{type:t,name:B}})}(t+""),U=i.length;if(!(arguments.length<2)){for(g=B?Ws:Xs,Q=0;Q<U;++Q)this.each(g(i[Q],B,s));return this}var g=this.node().__on;if(g)for(var e,I=0,l=g.length;I<l;++I)for(Q=0,e=g[I];Q<U;++Q)if((F=i[Q]).type===e.type&&F.name===e.name)return e.value},dispatch:function(t,B){return this.each(("function"==typeof B?fs:Ds)(t,B))},[Symbol.iterator]:function*(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q,F=t[B],i=0,U=F.length;i<U;++i)(Q=F[i])&&(yield Q)}};const Ms={passive:!1},Ts={capture:!0,passive:!1};function zs(t){t.stopImmediatePropagation()}function Ks(t){t.preventDefault(),t.stopImmediatePropagation()}var Os=t=>()=>t;function Ps(t,{sourceEvent:B,subject:s,target:Q,identifier:F,active:i,x:U,y:g,dx:e,dy:I,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:B,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:Q,enumerable:!0,configurable:!0},identifier:{value:F,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:U,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:e,enumerable:!0,configurable:!0},dy:{value:I,enumerable:!0,configurable:!0},_:{value:l}})}function js(t){return!t.ctrlKey&&!t.button}function _s(){return this.parentNode}function $s(t,B){return null==B?{x:t.x,y:t.y}:B}function qs(){return navigator.maxTouchPoints||"ontouchstart"in this}function tQ(){var t,B,s,Q,F=js,i=_s,U=$s,g=qs,e={},I=RB("start","drag","end"),l=0,c=0;function n(t){t.on("mousedown.drag",a).filter(g).on("touchstart.drag",b).on("touchmove.drag",C,Ms).on("touchend.drag touchcancel.drag",r).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function a(U,g){if(!Q&&F.call(this,U,g)){var e=u(this,i.call(this,U,g),U,g,"mouse");e&&(Js(U.view).on("mousemove.drag",d,Ts).on("mouseup.drag",o,Ts),function(t){var B=t.document.documentElement,s=Js(t).on("dragstart.drag",Ks,Ts);"onselectstart"in B?s.on("selectstart.drag",Ks,Ts):(B.__noselect=B.style.MozUserSelect,B.style.MozUserSelect="none")}(U.view),zs(U),s=!1,t=U.clientX,B=U.clientY,e("start",U))}}function d(Q){if(Ks(Q),!s){var F=Q.clientX-t,i=Q.clientY-B;s=F*F+i*i>c}e.mouse("drag",Q)}function o(t){Js(t.view).on("mousemove.drag mouseup.drag",null),function(t,B){var s=t.document.documentElement,Q=Js(t).on("dragstart.drag",null);B&&(Q.on("click.drag",Ks,Ts),setTimeout(function(){Q.on("click.drag",null)},0)),"onselectstart"in s?Q.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}(t.view,s),Ks(t),e.mouse("end",t)}function b(t,B){if(F.call(this,t,B)){var s,Q,U=t.changedTouches,g=i.call(this,t,B),e=U.length;for(s=0;s<e;++s)(Q=u(this,g,t,B,U[s].identifier,U[s]))&&(zs(t),Q("start",t,U[s]))}}function C(t){var B,s,Q=t.changedTouches,F=Q.length;for(B=0;B<F;++B)(s=e[Q[B].identifier])&&(Ks(t),s("drag",t,Q[B]))}function r(t){var B,s,F=t.changedTouches,i=F.length;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),B=0;B<i;++B)(s=e[F[B].identifier])&&(zs(t),s("end",t,F[B]))}function u(t,B,s,Q,F,i){var g,c,a,d=I.copy(),o=ks(i||s,B);if(null!=(a=U.call(t,new Ps("beforestart",{sourceEvent:s,target:n,identifier:F,active:l,x:o[0],y:o[1],dx:0,dy:0,dispatch:d}),Q)))return g=a.x-o[0]||0,c=a.y-o[1]||0,function s(i,U,I){var b,C=o;switch(i){case"start":e[F]=s,b=l++;break;case"end":delete e[F],--l;case"drag":o=ks(I||U,B),b=l}d.call(i,t,new Ps(i,{sourceEvent:U,subject:a,target:n,identifier:F,active:b,x:o[0]+g,y:o[1]+c,dx:o[0]-C[0],dy:o[1]-C[1],dispatch:d}),Q)}}return n.filter=function(t){return arguments.length?(F="function"==typeof t?t:Os(!!t),n):F},n.container=function(t){return arguments.length?(i="function"==typeof t?t:Os(t),n):i},n.subject=function(t){return arguments.length?(U="function"==typeof t?t:Os(t),n):U},n.touchable=function(t){return arguments.length?(g="function"==typeof t?t:Os(!!t),n):g},n.on=function(){var t=I.on.apply(I,arguments);return t===I?n:t},n.clickDistance=function(t){return arguments.length?(c=(t=+t)*t,n):Math.sqrt(c)},n}function BQ(t,B,s){t.prototype=B.prototype=s,s.constructor=t}function sQ(t,B){var s=Object.create(t.prototype);for(var Q in B)s[Q]=B[Q];return s}function QQ(){}Ps.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var FQ=.7,iQ=1/FQ,UQ="\\s*([+-]?\\d+)\\s*",gQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IQ=/^#([0-9a-f]{3,8})$/,lQ=new RegExp(`^rgb\\(${UQ},${UQ},${UQ}\\)$`),cQ=new RegExp(`^rgb\\(${eQ},${eQ},${eQ}\\)$`),nQ=new RegExp(`^rgba\\(${UQ},${UQ},${UQ},${gQ}\\)$`),aQ=new RegExp(`^rgba\\(${eQ},${eQ},${eQ},${gQ}\\)$`),dQ=new RegExp(`^hsl\\(${gQ},${eQ},${eQ}\\)$`),oQ=new RegExp(`^hsla\\(${gQ},${eQ},${eQ},${gQ}\\)$`),bQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function CQ(){return this.rgb().formatHex()}function rQ(){return this.rgb().formatRgb()}function uQ(t){var B,s;return t=(t+"").trim().toLowerCase(),(B=IQ.exec(t))?(s=B[1].length,B=parseInt(B[1],16),6===s?hQ(B):3===s?new AQ(B>>8&15|B>>4&240,B>>4&15|240&B,(15&B)<<4|15&B,1):8===s?xQ(B>>24&255,B>>16&255,B>>8&255,(255&B)/255):4===s?xQ(B>>12&15|B>>8&240,B>>8&15|B>>4&240,B>>4&15|240&B,((15&B)<<4|15&B)/255):null):(B=lQ.exec(t))?new AQ(B[1],B[2],B[3],1):(B=cQ.exec(t))?new AQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,1):(B=nQ.exec(t))?xQ(B[1],B[2],B[3],B[4]):(B=aQ.exec(t))?xQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,B[4]):(B=dQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,1):(B=oQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,B[4]):bQ.hasOwnProperty(t)?hQ(bQ[t]):"transparent"===t?new AQ(NaN,NaN,NaN,0):null}function hQ(t){return new AQ(t>>16&255,t>>8&255,255&t,1)}function xQ(t,B,s,Q){return Q<=0&&(t=B=s=NaN),new AQ(t,B,s,Q)}function GQ(t){return t instanceof QQ||(t=uQ(t)),t?new AQ((t=t.rgb()).r,t.g,t.b,t.opacity):new AQ}function yQ(t,B,s,Q){return 1===arguments.length?GQ(t):new AQ(t,B,s,null==Q?1:Q)}function AQ(t,B,s,Q){this.r=+t,this.g=+B,this.b=+s,this.opacity=+Q}function LQ(){return`#${SQ(this.r)}${SQ(this.g)}${SQ(this.b)}`}function RQ(){const t=mQ(this.opacity);return`${1===t?"rgb(":"rgba("}${VQ(this.r)}, ${VQ(this.g)}, ${VQ(this.b)}${1===t?")":`, ${t})`}`}function mQ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function VQ(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function SQ(t){return((t=VQ(t))<16?"0":"")+t.toString(16)}function ZQ(t,B,s,Q){return Q<=0?t=B=s=NaN:s<=0||s>=1?t=B=NaN:B<=0&&(t=NaN),new NQ(t,B,s,Q)}function pQ(t){if(t instanceof NQ)return new NQ(t.h,t.s,t.l,t.opacity);if(t instanceof QQ||(t=uQ(t)),!t)return new NQ;if(t instanceof NQ)return t;var B=(t=t.rgb()).r/255,s=t.g/255,Q=t.b/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=NaN,g=i-F,e=(i+F)/2;return g?(U=B===i?(s-Q)/g+6*(s<Q):s===i?(Q-B)/g+2:(B-s)/g+4,g/=e<.5?i+F:2-i-F,U*=60):g=e>0&&e<1?0:U,new NQ(U,g,e,t.opacity)}function EQ(t,B,s,Q){return 1===arguments.length?pQ(t):new NQ(t,B,s,null==Q?1:Q)}function NQ(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}function XQ(t){return(t=(t||0)%360)<0?t+360:t}function WQ(t){return Math.max(0,Math.min(1,t||0))}function HQ(t,B,s){return 255*(t<60?B+(s-B)*t/60:t<180?s:t<240?B+(s-B)*(240-t)/60:B)}BQ(QQ,uQ,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:CQ,formatHex:CQ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return pQ(this).formatHsl()},formatRgb:rQ,toString:rQ}),BQ(AQ,yQ,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new AQ(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new AQ(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new AQ(VQ(this.r),VQ(this.g),VQ(this.b),mQ(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:LQ,formatHex:LQ,formatHex8:function(){return`#${SQ(this.r)}${SQ(this.g)}${SQ(this.b)}${SQ(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:RQ,toString:RQ})),BQ(NQ,EQ,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new NQ(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new NQ(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),B=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,Q=s+(s<.5?s:1-s)*B,F=2*s-Q;return new AQ(HQ(t>=240?t-240:t+120,F,Q),HQ(t,F,Q),HQ(t<120?t+240:t-120,F,Q),this.opacity)},clamp(){return new NQ(XQ(this.h),WQ(this.s),WQ(this.l),mQ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=mQ(this.opacity);return`${1===t?"hsl(":"hsla("}${XQ(this.h)}, ${100*WQ(this.s)}%, ${100*WQ(this.l)}%${1===t?")":`, ${t})`}`}}));const DQ=Math.PI/180,fQ=180/Math.PI,wQ=.96422,vQ=.82521,YQ=4/29,JQ=6/29,kQ=3*JQ*JQ,MQ=JQ*JQ*JQ;function TQ(t){if(t instanceof KQ)return new KQ(t.l,t.a,t.b,t.opacity);if(t instanceof qQ)return tF(t);t instanceof AQ||(t=GQ(t));var B,s,Q=_Q(t.r),F=_Q(t.g),i=_Q(t.b),U=OQ((.2225045*Q+.7168786*F+.0606169*i)/1);return Q===F&&F===i?B=s=U:(B=OQ((.4360747*Q+.3850649*F+.1430804*i)/wQ),s=OQ((.0139322*Q+.0971045*F+.7141733*i)/vQ)),new KQ(116*U-16,500*(B-U),200*(U-s),t.opacity)}function zQ(t,B,s,Q){return 1===arguments.length?TQ(t):new KQ(t,B,s,null==Q?1:Q)}function KQ(t,B,s,Q){this.l=+t,this.a=+B,this.b=+s,this.opacity=+Q}function OQ(t){return t>MQ?Math.pow(t,1/3):t/kQ+YQ}function PQ(t){return t>JQ?t*t*t:kQ*(t-YQ)}function jQ(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _Q(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $Q(t,B,s,Q){return 1===arguments.length?function(t){if(t instanceof qQ)return new qQ(t.h,t.c,t.l,t.opacity);if(t instanceof KQ||(t=TQ(t)),0===t.a&&0===t.b)return new qQ(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var B=Math.atan2(t.b,t.a)*fQ;return new qQ(B<0?B+360:B,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new qQ(t,B,s,null==Q?1:Q)}function qQ(t,B,s,Q){this.h=+t,this.c=+B,this.l=+s,this.opacity=+Q}function tF(t){if(isNaN(t.h))return new KQ(t.l,0,0,t.opacity);var B=t.h*DQ;return new KQ(t.l,Math.cos(B)*t.c,Math.sin(B)*t.c,t.opacity)}BQ(KQ,zQ,sQ(QQ,{brighter(t){return new KQ(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new KQ(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,B=isNaN(this.a)?t:t+this.a/500,s=isNaN(this.b)?t:t-this.b/200;return new AQ(jQ(3.1338561*(B=wQ*PQ(B))-1.6168667*(t=1*PQ(t))-.4906146*(s=vQ*PQ(s))),jQ(-.9787684*B+1.9161415*t+.033454*s),jQ(.0719453*B-.2289914*t+1.4052427*s),this.opacity)}})),BQ(qQ,$Q,sQ(QQ,{brighter(t){return new qQ(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new qQ(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return tF(this).rgb()}}));var BF=-.14861,sF=1.78277,QF=-.29227,FF=-.90649,iF=1.97294,UF=iF*FF,gF=iF*sF,eF=sF*QF-FF*BF;function IF(t,B,s,Q){return 1===arguments.length?function(t){if(t instanceof lF)return new lF(t.h,t.s,t.l,t.opacity);t instanceof AQ||(t=GQ(t));var B=t.r/255,s=t.g/255,Q=t.b/255,F=(eF*Q+UF*B-gF*s)/(eF+UF-gF),i=Q-F,U=(iF*(s-F)-QF*i)/FF,g=Math.sqrt(U*U+i*i)/(iF*F*(1-F)),e=g?Math.atan2(U,i)*fQ-120:NaN;return new lF(e<0?e+360:e,g,F,t.opacity)}(t):new lF(t,B,s,null==Q?1:Q)}function lF(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}BQ(lF,IF,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new lF(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new lF(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*DQ,B=+this.l,s=isNaN(this.s)?0:this.s*B*(1-B),Q=Math.cos(t),F=Math.sin(t);return new AQ(255*(B+s*(BF*Q+sF*F)),255*(B+s*(QF*Q+FF*F)),255*(B+s*(iF*Q)),this.opacity)}}));var cF=t=>()=>t;function nF(t,B){return function(s){return t+s*B}}function aF(t,B){var s=B-t;return s?nF(t,s>180||s<-180?s-360*Math.round(s/360):s):cF(isNaN(t)?B:t)}function dF(t){return 1===(t=+t)?oF:function(B,s){return s-B?function(t,B,s){return t=Math.pow(t,s),B=Math.pow(B,s)-t,s=1/s,function(Q){return Math.pow(t+Q*B,s)}}(B,s,t):cF(isNaN(B)?s:B)}}function oF(t,B){var s=B-t;return s?nF(t,s):cF(isNaN(t)?B:t)}var bF=function t(B){var s=dF(B);function Q(t,B){var Q=s((t=yQ(t)).r,(B=yQ(B)).r),F=s(t.g,B.g),i=s(t.b,B.b),U=oF(t.opacity,B.opacity);return function(B){return t.r=Q(B),t.g=F(B),t.b=i(B),t.opacity=U(B),t+""}}return Q.gamma=t,Q}(1);var CF,rF=(CF=function(t){var B=t.length-1;return function(s){var Q=s<=0?s=0:s>=1?(s=1,B-1):Math.floor(s*B),F=t[Q],i=t[Q+1],U=Q>0?t[Q-1]:2*F-i,g=Q<B-1?t[Q+2]:2*i-F;return function(t,B,s,Q,F){var i=t*t,U=i*t;return((1-3*t+3*i-U)*B+(4-6*i+3*U)*s+(1+3*t+3*i-3*U)*Q+U*F)/6}((s-Q/B)*B,U,F,i,g)}},function(t){var B,s,Q=t.length,F=new Array(Q),i=new Array(Q),U=new Array(Q);for(B=0;B<Q;++B)s=yQ(t[B]),F[B]=s.r||0,i[B]=s.g||0,U[B]=s.b||0;return F=CF(F),i=CF(i),U=CF(U),s.opacity=1,function(t){return s.r=F(t),s.g=i(t),s.b=U(t),s+""}});function uF(t,B){B||(B=[]);var s,Q=t?Math.min(B.length,t.length):0,F=B.slice();return function(i){for(s=0;s<Q;++s)F[s]=t[s]*(1-i)+B[s]*i;return F}}function hF(t,B){var s,Q=B?B.length:0,F=t?Math.min(Q,t.length):0,i=new Array(F),U=new Array(Q);for(s=0;s<F;++s)i[s]=mF(t[s],B[s]);for(;s<Q;++s)U[s]=B[s];return function(t){for(s=0;s<F;++s)U[s]=i[s](t);return U}}function xF(t,B){var s=new Date;return t=+t,B=+B,function(Q){return s.setTime(t*(1-Q)+B*Q),s}}function GF(t,B){return t=+t,B=+B,function(s){return t*(1-s)+B*s}}function yF(t,B){var s,Q={},F={};for(s in null!==t&&"object"==typeof t||(t={}),null!==B&&"object"==typeof B||(B={}),B)s in t?Q[s]=mF(t[s],B[s]):F[s]=B[s];return function(t){for(s in Q)F[s]=Q[s](t);return F}}var AF=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,LF=new RegExp(AF.source,"g");function RF(t,B){var s,Q,F,i=AF.lastIndex=LF.lastIndex=0,U=-1,g=[],e=[];for(t+="",B+="";(s=AF.exec(t))&&(Q=LF.exec(B));)(F=Q.index)>i&&(F=B.slice(i,F),g[U]?g[U]+=F:g[++U]=F),(s=s[0])===(Q=Q[0])?g[U]?g[U]+=Q:g[++U]=Q:(g[++U]=null,e.push({i:U,x:GF(s,Q)})),i=LF.lastIndex;return i<B.length&&(F=B.slice(i),g[U]?g[U]+=F:g[++U]=F),g.length<2?e[0]?function(t){return function(B){return t(B)+""}}(e[0].x):function(t){return function(){return t}}(B):(B=e.length,function(t){for(var s,Q=0;Q<B;++Q)g[(s=e[Q]).i]=s.x(t);return g.join("")})}function mF(t,B){var s,Q=typeof B;return null==B||"boolean"===Q?cF(B):("number"===Q?GF:"string"===Q?(s=uQ(B))?(B=s,bF):RF:B instanceof uQ?bF:B instanceof Date?xF:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(B)?uF:Array.isArray(B)?hF:"function"!=typeof B.valueOf&&"function"!=typeof B.toString||isNaN(B)?yF:GF)(t,B)}function VF(t,B){return t=+t,B=+B,function(s){return Math.round(t*(1-s)+B*s)}}var SF,ZF=180/Math.PI,pF={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function EF(t,B,s,Q,F,i){var U,g,e;return(U=Math.sqrt(t*t+B*B))&&(t/=U,B/=U),(e=t*s+B*Q)&&(s-=t*e,Q-=B*e),(g=Math.sqrt(s*s+Q*Q))&&(s/=g,Q/=g,e/=g),t*Q<B*s&&(t=-t,B=-B,e=-e,U=-U),{translateX:F,translateY:i,rotate:Math.atan2(B,t)*ZF,skewX:Math.atan(e)*ZF,scaleX:U,scaleY:g}}function NF(t,B,s,Q){function F(t){return t.length?t.pop()+" ":""}return function(i,U){var g=[],e=[];return i=t(i),U=t(U),function(t,Q,F,i,U,g){if(t!==F||Q!==i){var e=U.push("translate(",null,B,null,s);g.push({i:e-4,x:GF(t,F)},{i:e-2,x:GF(Q,i)})}else(F||i)&&U.push("translate("+F+B+i+s)}(i.translateX,i.translateY,U.translateX,U.translateY,g,e),function(t,B,s,i){t!==B?(t-B>180?B+=360:B-t>180&&(t+=360),i.push({i:s.push(F(s)+"rotate(",null,Q)-2,x:GF(t,B)})):B&&s.push(F(s)+"rotate("+B+Q)}(i.rotate,U.rotate,g,e),function(t,B,s,i){t!==B?i.push({i:s.push(F(s)+"skewX(",null,Q)-2,x:GF(t,B)}):B&&s.push(F(s)+"skewX("+B+Q)}(i.skewX,U.skewX,g,e),function(t,B,s,Q,i,U){if(t!==s||B!==Q){var g=i.push(F(i)+"scale(",null,",",null,")");U.push({i:g-4,x:GF(t,s)},{i:g-2,x:GF(B,Q)})}else 1===s&&1===Q||i.push(F(i)+"scale("+s+","+Q+")")}(i.scaleX,i.scaleY,U.scaleX,U.scaleY,g,e),i=U=null,function(t){for(var B,s=-1,Q=e.length;++s<Q;)g[(B=e[s]).i]=B.x(t);return g.join("")}}}var XF=NF(function(t){const B=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return B.isIdentity?pF:EF(B.a,B.b,B.c,B.d,B.e,B.f)},"px, ","px)","deg)"),WF=NF(function(t){return null==t?pF:(SF||(SF=document.createElementNS("http://www.w3.org/2000/svg","g")),SF.setAttribute("transform",t),(t=SF.transform.baseVal.consolidate())?EF((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):pF)},", ",")",")");var HF=function(t){return function(B,s){var Q=t((B=EQ(B)).h,(s=EQ(s)).h),F=oF(B.s,s.s),i=oF(B.l,s.l),U=oF(B.opacity,s.opacity);return function(t){return B.h=Q(t),B.s=F(t),B.l=i(t),B.opacity=U(t),B+""}}}(aF);var DF=function(t){return function(B,s){var Q=t((B=$Q(B)).h,(s=$Q(s)).h),F=oF(B.c,s.c),i=oF(B.l,s.l),U=oF(B.opacity,s.opacity);return function(t){return B.h=Q(t),B.c=F(t),B.l=i(t),B.opacity=U(t),B+""}}}(aF);function fF(t){return function B(s){function Q(B,Q){var F=t((B=IF(B)).h,(Q=IF(Q)).h),i=oF(B.s,Q.s),U=oF(B.l,Q.l),g=oF(B.opacity,Q.opacity);return function(t){return B.h=F(t),B.s=i(t),B.l=U(Math.pow(t,s)),B.opacity=g(t),B+""}}return s=+s,Q.gamma=B,Q}(1)}fF(aF);var wF=fF(oF);function vF(t,B){void 0===B&&(B=t,t=mF);for(var s=0,Q=B.length-1,F=B[0],i=new Array(Q<0?0:Q);s<Q;)i[s]=t(F,F=B[++s]);return function(t){var B=Math.max(0,Math.min(Q-1,Math.floor(t*=Q)));return i[B](t-B)}}function YF(t,B){for(var s=new Array(B),Q=0;Q<B;++Q)s[Q]=t(Q/(B-1));return s}var JF,kF,MF=0,TF=0,zF=0,KF=0,OF=0,PF=0,jF="object"==typeof performance&&performance.now?performance:Date,_F="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $F(){return OF||(_F(qF),OF=jF.now()+PF)}function qF(){OF=0}function ti(){this._call=this._time=this._next=null}function Bi(t,B,s){var Q=new ti;return Q.restart(t,B,s),Q}function si(){OF=(KF=jF.now())+PF,MF=TF=0;try{!function(){$F(),++MF;for(var t,B=JF;B;)(t=OF-B._time)>=0&&B._call.call(void 0,t),B=B._next;--MF}()}finally{MF=0,function(){var t,B,s=JF,Q=1/0;for(;s;)s._call?(Q>s._time&&(Q=s._time),t=s,s=s._next):(B=s._next,s._next=null,s=t?t._next=B:JF=B);kF=t,Fi(Q)}(),OF=0}}function Qi(){var t=jF.now(),B=t-KF;B>1e3&&(PF-=B,KF=t)}function Fi(t){MF||(TF&&(TF=clearTimeout(TF)),t-OF>24?(t<1/0&&(TF=setTimeout(si,t-jF.now()-PF)),zF&&(zF=clearInterval(zF))):(zF||(KF=jF.now(),zF=setInterval(Qi,1e3)),MF=1,_F(si)))}function ii(t,B,s){var Q=new ti;return B=null==B?0:+B,Q.restart(s=>{Q.stop(),t(s+B)},B,s),Q}ti.prototype=Bi.prototype={constructor:ti,restart:function(t,B,s){if("function"!=typeof t)throw new TypeError("callback is not a function");s=(null==s?$F():+s)+(null==B?0:+B),this._next||kF===this||(kF?kF._next=this:JF=this,kF=this),this._call=t,this._time=s,Fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fi())}};var Ui=RB("start","end","cancel","interrupt"),gi=[];function ei(t,B,s,Q,F,i){var U=t.__transition;if(U){if(s in U)return}else t.__transition={};!function(t,B,s){var Q,F=t.__transition;function i(t){s.state=1,s.timer.restart(U,s.delay,s.time),s.delay<=t&&U(t-s.delay)}function U(i){var I,l,c,n;if(1!==s.state)return e();for(I in F)if((n=F[I]).name===s.name){if(3===n.state)return ii(U);4===n.state?(n.state=6,n.timer.stop(),n.on.call("interrupt",t,t.__data__,n.index,n.group),delete F[I]):+I<B&&(n.state=6,n.timer.stop(),n.on.call("cancel",t,t.__data__,n.index,n.group),delete F[I])}if(ii(function(){3===s.state&&(s.state=4,s.timer.restart(g,s.delay,s.time),g(i))}),s.state=2,s.on.call("start",t,t.__data__,s.index,s.group),2===s.state){for(s.state=3,Q=new Array(c=s.tween.length),I=0,l=-1;I<c;++I)(n=s.tween[I].value.call(t,t.__data__,s.index,s.group))&&(Q[++l]=n);Q.length=l+1}}function g(B){for(var F=B<s.duration?s.ease.call(null,B/s.duration):(s.timer.restart(e),s.state=5,1),i=-1,U=Q.length;++i<U;)Q[i].call(t,F);5===s.state&&(s.on.call("end",t,t.__data__,s.index,s.group),e())}function e(){for(var Q in s.state=6,s.timer.stop(),delete F[B],F)return;delete t.__transition}F[B]=s,s.timer=Bi(i,0,s.time)}(t,s,{name:B,index:Q,group:F,on:Ui,tween:gi,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Ii(t,B){var s=ci(t,B);if(s.state>0)throw new Error("too late; already scheduled");return s}function li(t,B){var s=ci(t,B);if(s.state>3)throw new Error("too late; already running");return s}function ci(t,B){var s=t.__transition;if(!s||!(s=s[B]))throw new Error("transition not found");return s}function ni(t,B){var s,Q;return function(){var F=li(this,t),i=F.tween;if(i!==s)for(var U=0,g=(Q=s=i).length;U<g;++U)if(Q[U].name===B){(Q=Q.slice()).splice(U,1);break}F.tween=Q}}function ai(t,B,s){var Q,F;if("function"!=typeof s)throw new Error;return function(){var i=li(this,t),U=i.tween;if(U!==Q){F=(Q=U).slice();for(var g={name:B,value:s},e=0,I=F.length;e<I;++e)if(F[e].name===B){F[e]=g;break}e===I&&F.push(g)}i.tween=F}}function di(t,B,s){var Q=t._id;return t.each(function(){var t=li(this,Q);(t.value||(t.value={}))[B]=s.apply(this,arguments)}),function(t){return ci(t,Q).value[B]}}function oi(t,B){var s;return("number"==typeof B?GF:B instanceof uQ?bF:(s=uQ(B))?(B=s,bF):RF)(t,B)}function bi(t){return function(){this.removeAttribute(t)}}function Ci(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ri(t,B,s){var Q,F,i=s+"";return function(){var U=this.getAttribute(t);return U===i?null:U===Q?F:F=B(Q=U,s)}}function ui(t,B,s){var Q,F,i=s+"";return function(){var U=this.getAttributeNS(t.space,t.local);return U===i?null:U===Q?F:F=B(Q=U,s)}}function hi(t,B,s){var Q,F,i;return function(){var U,g,e=s(this);if(null!=e)return(U=this.getAttribute(t))===(g=e+"")?null:U===Q&&g===F?i:(F=g,i=B(Q=U,e));this.removeAttribute(t)}}function xi(t,B,s){var Q,F,i;return function(){var U,g,e=s(this);if(null!=e)return(U=this.getAttributeNS(t.space,t.local))===(g=e+"")?null:U===Q&&g===F?i:(F=g,i=B(Q=U,e));this.removeAttributeNS(t.space,t.local)}}function Gi(t,B){var s,Q;function F(){var F=B.apply(this,arguments);return F!==Q&&(s=(Q=F)&&function(t,B){return function(s){this.setAttributeNS(t.space,t.local,B.call(this,s))}}(t,F)),s}return F._value=B,F}function yi(t,B){var s,Q;function F(){var F=B.apply(this,arguments);return F!==Q&&(s=(Q=F)&&function(t,B){return function(s){this.setAttribute(t,B.call(this,s))}}(t,F)),s}return F._value=B,F}function Ai(t,B){return function(){Ii(this,t).delay=+B.apply(this,arguments)}}function Li(t,B){return B=+B,function(){Ii(this,t).delay=B}}function Ri(t,B){return function(){li(this,t).duration=+B.apply(this,arguments)}}function mi(t,B){return B=+B,function(){li(this,t).duration=B}}var Vi=Ys.prototype.constructor;function Si(t){return function(){this.style.removeProperty(t)}}var Zi=0;function pi(t,B,s,Q){this._groups=t,this._parents=B,this._name=s,this._id=Q}function Ei(){return++Zi}var Ni=Ys.prototype;function Xi(t){return t*t*t}function Wi(t){return--t*t*t+1}pi.prototype={constructor:pi,select:function(t){var B=this._name,s=this._id;"function"!=typeof t&&(t=DB(t));for(var Q=this._groups,F=Q.length,i=new Array(F),U=0;U<F;++U)for(var g,e,I=Q[U],l=I.length,c=i[U]=new Array(l),n=0;n<l;++n)(g=I[n])&&(e=t.call(g,g.__data__,n,I))&&("__data__"in g&&(e.__data__=g.__data__),c[n]=e,ei(c[n],B,s,n,c,ci(g,s)));return new pi(i,this._parents,B,s)},selectAll:function(t){var B=this._name,s=this._id;"function"!=typeof t&&(t=wB(t));for(var Q=this._groups,F=Q.length,i=[],U=[],g=0;g<F;++g)for(var e,I=Q[g],l=I.length,c=0;c<l;++c)if(e=I[c]){for(var n,a=t.call(e,e.__data__,c,I),d=ci(e,s),o=0,b=a.length;o<b;++o)(n=a[o])&&ei(n,B,s,o,a,d);i.push(a),U.push(e)}return new pi(i,U,B,s)},selectChild:Ni.selectChild,selectChildren:Ni.selectChildren,filter:function(t){"function"!=typeof t&&(t=YB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new pi(Q,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var B=this._groups,s=t._groups,Q=B.length,F=s.length,i=Math.min(Q,F),U=new Array(Q),g=0;g<i;++g)for(var e,I=B[g],l=s[g],c=I.length,n=U[g]=new Array(c),a=0;a<c;++a)(e=I[a]||l[a])&&(n[a]=e);for(;g<Q;++g)U[g]=B[g];return new pi(U,this._parents,this._name,this._id)},selection:function(){return new Vi(this._groups,this._parents)},transition:function(){for(var t=this._name,B=this._id,s=Ei(),Q=this._groups,F=Q.length,i=0;i<F;++i)for(var U,g=Q[i],e=g.length,I=0;I<e;++I)if(U=g[I]){var l=ci(U,B);ei(U,t,s,I,g,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new pi(Q,this._parents,t,s)},call:Ni.call,nodes:Ni.nodes,node:Ni.node,size:Ni.size,empty:Ni.empty,each:Ni.each,on:function(t,B){var s=this._id;return arguments.length<2?ci(this.node(),s).on.on(t):this.each(function(t,B,s){var Q,F,i=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var B=t.indexOf(".");return B>=0&&(t=t.slice(0,B)),!t||"start"===t})}(B)?Ii:li;return function(){var U=i(this,t),g=U.on;g!==Q&&(F=(Q=g).copy()).on(B,s),U.on=F}}(s,t,B))},attr:function(t,B){var s=EB(t),Q="transform"===s?WF:oi;return this.attrTween(t,"function"==typeof B?(s.local?xi:hi)(s,Q,di(this,"attr."+t,B)):null==B?(s.local?Ci:bi)(s):(s.local?ui:ri)(s,Q,B))},attrTween:function(t,B){var s="attr."+t;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(null==B)return this.tween(s,null);if("function"!=typeof B)throw new Error;var Q=EB(t);return this.tween(s,(Q.local?Gi:yi)(Q,B))},style:function(t,B,s){var Q="transform"==(t+="")?XF:oi;return null==B?this.styleTween(t,function(t,B){var s,Q,F;return function(){var i=ls(this,t),U=(this.style.removeProperty(t),ls(this,t));return i===U?null:i===s&&U===Q?F:F=B(s=i,Q=U)}}(t,Q)).on("end.style."+t,Si(t)):"function"==typeof B?this.styleTween(t,function(t,B,s){var Q,F,i;return function(){var U=ls(this,t),g=s(this),e=g+"";return null==g&&(this.style.removeProperty(t),e=g=ls(this,t)),U===e?null:U===Q&&e===F?i:(F=e,i=B(Q=U,g))}}(t,Q,di(this,"style."+t,B))).each(function(t,B){var s,Q,F,i,U="style."+B,g="end."+U;return function(){var e=li(this,t),I=e.on,l=null==e.value[U]?i||(i=Si(B)):void 0;I===s&&F===l||(Q=(s=I).copy()).on(g,F=l),e.on=Q}}(this._id,t)):this.styleTween(t,function(t,B,s){var Q,F,i=s+"";return function(){var U=ls(this,t);return U===i?null:U===Q?F:F=B(Q=U,s)}}(t,Q,B),s).on("end.style."+t,null)},styleTween:function(t,B,s){var Q="style."+(t+="");if(arguments.length<2)return(Q=this.tween(Q))&&Q._value;if(null==B)return this.tween(Q,null);if("function"!=typeof B)throw new Error;return this.tween(Q,function(t,B,s){var Q,F;function i(){var i=B.apply(this,arguments);return i!==F&&(Q=(F=i)&&function(t,B,s){return function(Q){this.style.setProperty(t,B.call(this,Q),s)}}(t,i,s)),Q}return i._value=B,i}(t,B,null==s?"":s))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var B=t(this);this.textContent=null==B?"":B}}(di(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var B="text";if(arguments.length<1)return(B=this.tween(B))&&B._value;if(null==t)return this.tween(B,null);if("function"!=typeof t)throw new Error;return this.tween(B,function(t){var B,s;function Q(){var Q=t.apply(this,arguments);return Q!==s&&(B=(s=Q)&&function(t){return function(B){this.textContent=t.call(this,B)}}(Q)),B}return Q._value=t,Q}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var B=this.parentNode;for(var s in this.__transition)if(+s!==t)return;B&&B.removeChild(this)}}(this._id))},tween:function(t,B){var s=this._id;if(t+="",arguments.length<2){for(var Q,F=ci(this.node(),s).tween,i=0,U=F.length;i<U;++i)if((Q=F[i]).name===t)return Q.value;return null}return this.each((null==B?ni:ai)(s,t,B))},delay:function(t){var B=this._id;return arguments.length?this.each(("function"==typeof t?Ai:Li)(B,t)):ci(this.node(),B).delay},duration:function(t){var B=this._id;return arguments.length?this.each(("function"==typeof t?Ri:mi)(B,t)):ci(this.node(),B).duration},ease:function(t){var B=this._id;return arguments.length?this.each(function(t,B){if("function"!=typeof B)throw new Error;return function(){li(this,t).ease=B}}(B,t)):ci(this.node(),B).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,B){return function(){var s=B.apply(this,arguments);if("function"!=typeof s)throw new Error;li(this,t).ease=s}}(this._id,t))},end:function(){var t,B,s=this,Q=s._id,F=s.size();return new Promise(function(i,U){var g={value:U},e={value:function(){0===--F&&i()}};s.each(function(){var s=li(this,Q),F=s.on;F!==t&&((B=(t=F).copy())._.cancel.push(g),B._.interrupt.push(g),B._.end.push(e)),s.on=B}),0===F&&i()})},[Symbol.iterator]:Ni[Symbol.iterator]};var Hi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Di(t,B){for(var s;!(s=t.__transition)||!(s=s[B]);)if(!(t=t.parentNode))throw new Error(`transition ${B} not found`);return s}Ys.prototype.interrupt=function(t){return this.each(function(){!function(t,B){var s,Q,F,i=t.__transition,U=!0;if(i){for(F in B=null==B?null:B+"",i)(s=i[F]).name===B?(Q=s.state>2&&s.state<5,s.state=6,s.timer.stop(),s.on.call(Q?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[F]):U=!1;U&&delete t.__transition}}(this,t)})},Ys.prototype.transition=function(t){var B,s;t instanceof pi?(B=t._id,t=t._name):(B=Ei(),(s=Hi).time=$F(),t=null==t?null:t+"");for(var Q=this._groups,F=Q.length,i=0;i<F;++i)for(var U,g=Q[i],e=g.length,I=0;I<e;++I)(U=g[I])&&ei(U,t,B,I,g,s||Di(U,B));return new pi(Q,this._parents,t,B)};const fi=Math.PI,wi=2*fi,vi=1e-6,Yi=wi-vi;function Ji(t){this._+=t[0];for(let B=1,s=t.length;B<s;++B)this._+=arguments[B]+t[B]}class ki{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ji:function(t){let B=Math.floor(t);if(!(B>=0))throw new Error(`invalid digits: ${t}`);if(B>15)return Ji;const s=10**B;return function(t){this._+=t[0];for(let B=1,Q=t.length;B<Q;++B)this._+=Math.round(arguments[B]*s)/s+t[B]}}(t)}moveTo(t,B){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+B}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,B){this._append`L${this._x1=+t},${this._y1=+B}`}quadraticCurveTo(t,B,s,Q){this._append`Q${+t},${+B},${this._x1=+s},${this._y1=+Q}`}bezierCurveTo(t,B,s,Q,F,i){this._append`C${+t},${+B},${+s},${+Q},${this._x1=+F},${this._y1=+i}`}arcTo(t,B,s,Q,F){if(t=+t,B=+B,s=+s,Q=+Q,(F=+F)<0)throw new Error(`negative radius: ${F}`);let i=this._x1,U=this._y1,g=s-t,e=Q-B,I=i-t,l=U-B,c=I*I+l*l;if(null===this._x1)this._append`M${this._x1=t},${this._y1=B}`;else if(c>vi)if(Math.abs(l*g-e*I)>vi&&F){let n=s-i,a=Q-U,d=g*g+e*e,o=n*n+a*a,b=Math.sqrt(d),C=Math.sqrt(c),r=F*Math.tan((fi-Math.acos((d+c-o)/(2*b*C)))/2),u=r/C,h=r/b;Math.abs(u-1)>vi&&this._append`L${t+u*I},${B+u*l}`,this._append`A${F},${F},0,0,${+(l*n>I*a)},${this._x1=t+h*g},${this._y1=B+h*e}`}else this._append`L${this._x1=t},${this._y1=B}`;else;}arc(t,B,s,Q,F,i){if(t=+t,B=+B,i=!!i,(s=+s)<0)throw new Error(`negative radius: ${s}`);let U=s*Math.cos(Q),g=s*Math.sin(Q),e=t+U,I=B+g,l=1^i,c=i?Q-F:F-Q;null===this._x1?this._append`M${e},${I}`:(Math.abs(this._x1-e)>vi||Math.abs(this._y1-I)>vi)&&this._append`L${e},${I}`,s&&(c<0&&(c=c%wi+wi),c>Yi?this._append`A${s},${s},0,1,${l},${t-U},${B-g}A${s},${s},0,1,${l},${this._x1=e},${this._y1=I}`:c>vi&&this._append`A${s},${s},0,${+(c>=fi)},${l},${this._x1=t+s*Math.cos(F)},${this._y1=B+s*Math.sin(F)}`)}rect(t,B,s,Q){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+B}h${s=+s}v${+Q}h${-s}Z`}toString(){return this._}}function Mi(t=3){return new ki(+t)}function Ti(t,B){if((s=(t=B?t.toExponential(B-1):t.toExponential()).indexOf("e"))<0)return null;var s,Q=t.slice(0,s);return[Q.length>1?Q[0]+Q.slice(2):Q,+t.slice(s+1)]}function zi(t){return(t=Ti(Math.abs(t)))?t[1]:NaN}var Ki,Oi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pi(t){if(!(B=Oi.exec(t)))throw new Error("invalid format: "+t);var B;return new ji({fill:B[1],align:B[2],sign:B[3],symbol:B[4],zero:B[5],width:B[6],comma:B[7],precision:B[8]&&B[8].slice(1),trim:B[9],type:B[10]})}function ji(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function _i(t,B){var s=Ti(t,B);if(!s)return t+"";var Q=s[0],F=s[1];return F<0?"0."+new Array(-F).join("0")+Q:Q.length>F+1?Q.slice(0,F+1)+"."+Q.slice(F+1):Q+new Array(F-Q.length+2).join("0")}Pi.prototype=ji.prototype,ji.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var $i={"%":(t,B)=>(100*t).toFixed(B),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,B)=>t.toExponential(B),f:(t,B)=>t.toFixed(B),g:(t,B)=>t.toPrecision(B),o:t=>Math.round(t).toString(8),p:(t,B)=>_i(100*t,B),r:_i,s:function(t,B){var s=Ti(t,B);if(!s)return t+"";var Q=s[0],F=s[1],i=F-(Ki=3*Math.max(-8,Math.min(8,Math.floor(F/3))))+1,U=Q.length;return i===U?Q:i>U?Q+new Array(i-U+1).join("0"):i>0?Q.slice(0,i)+"."+Q.slice(i):"0."+new Array(1-i).join("0")+Ti(t,Math.max(0,B+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qi(t){return t}var tU,BU,sU,QU=Array.prototype.map,FU=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iU(t){var B,s,Q=void 0===t.grouping||void 0===t.thousands?qi:(B=QU.call(t.grouping,Number),s=t.thousands+"",function(t,Q){for(var F=t.length,i=[],U=0,g=B[0],e=0;F>0&&g>0&&(e+g+1>Q&&(g=Math.max(1,Q-e)),i.push(t.substring(F-=g,F+g)),!((e+=g+1)>Q));)g=B[U=(U+1)%B.length];return i.reverse().join(s)}),F=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",U=void 0===t.decimal?".":t.decimal+"",g=void 0===t.numerals?qi:function(t){return function(B){return B.replace(/[0-9]/g,function(B){return t[+B]})}}(QU.call(t.numerals,String)),e=void 0===t.percent?"%":t.percent+"",I=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function c(t){var B=(t=Pi(t)).fill,s=t.align,c=t.sign,n=t.symbol,a=t.zero,d=t.width,o=t.comma,b=t.precision,C=t.trim,r=t.type;"n"===r?(o=!0,r="g"):$i[r]||(void 0===b&&(b=12),C=!0,r="g"),(a||"0"===B&&"="===s)&&(a=!0,B="0",s="=");var u="$"===n?F:"#"===n&&/[boxX]/.test(r)?"0"+r.toLowerCase():"",h="$"===n?i:/[%p]/.test(r)?e:"",x=$i[r],G=/[defgprs%]/.test(r);function y(t){var F,i,e,n=u,y=h;if("c"===r)y=x(t)+y,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),b),C&&(t=function(t){t:for(var B,s=t.length,Q=1,F=-1;Q<s;++Q)switch(t[Q]){case".":F=B=Q;break;case"0":0===F&&(F=Q),B=Q;break;default:if(!+t[Q])break t;F>0&&(F=0)}return F>0?t.slice(0,F)+t.slice(B+1):t}(t)),A&&0===+t&&"+"!==c&&(A=!1),n=(A?"("===c?c:I:"-"===c||"("===c?"":c)+n,y=("s"===r?FU[8+Ki/3]:"")+y+(A&&"("===c?")":""),G)for(F=-1,i=t.length;++F<i;)if(48>(e=t.charCodeAt(F))||e>57){y=(46===e?U+t.slice(F+1):t.slice(F))+y,t=t.slice(0,F);break}}o&&!a&&(t=Q(t,1/0));var L=n.length+t.length+y.length,R=L<d?new Array(d-L+1).join(B):"";switch(o&&a&&(t=Q(R+t,R.length?d-y.length:1/0),R=""),s){case"<":t=n+t+y+R;break;case"=":t=n+R+t+y;break;case"^":t=R.slice(0,L=R.length>>1)+n+t+y+R.slice(L);break;default:t=R+n+t+y}return g(t)}return b=void 0===b?6:/[gprs]/.test(r)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),y.toString=function(){return t+""},y}return{format:c,formatPrefix:function(t,B){var s=c(((t=Pi(t)).type="f",t)),Q=3*Math.max(-8,Math.min(8,Math.floor(zi(B)/3))),F=Math.pow(10,-Q),i=FU[8+Q/3];return function(t){return s(F*t)+i}}}}tU=iU({thousands:",",grouping:[3],currency:["$",""]}),BU=tU.format,sU=tU.formatPrefix;var UU=1e-6,gU=Math.PI,eU=gU/2,IU=gU/4,lU=2*gU,cU=180/gU,nU=gU/180,aU=Math.abs,dU=Math.atan,oU=Math.atan2,bU=Math.cos,CU=Math.exp,rU=Math.log,uU=Math.pow,hU=Math.sin,xU=Math.sign||function(t){return t>0?1:t<0?-1:0},GU=Math.sqrt,yU=Math.tan;function AU(t){return t>1?0:t<-1?gU:Math.acos(t)}function LU(t){return t>1?eU:t<-1?-eU:Math.asin(t)}function RU(){}function mU(t,B){t&&SU.hasOwnProperty(t.type)&&SU[t.type](t,B)}var VU={Feature:function(t,B){mU(t.geometry,B)},FeatureCollection:function(t,B){for(var s=t.features,Q=-1,F=s.length;++Q<F;)mU(s[Q].geometry,B)}},SU={Sphere:function(t,B){B.sphere()},Point:function(t,B){t=t.coordinates,B.point(t[0],t[1],t[2])},MultiPoint:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)t=s[Q],B.point(t[0],t[1],t[2])},LineString:function(t,B){ZU(t.coordinates,B,0)},MultiLineString:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)ZU(s[Q],B,0)},Polygon:function(t,B){pU(t.coordinates,B)},MultiPolygon:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)pU(s[Q],B)},GeometryCollection:function(t,B){for(var s=t.geometries,Q=-1,F=s.length;++Q<F;)mU(s[Q],B)}};function ZU(t,B,s){var Q,F=-1,i=t.length-s;for(B.lineStart();++F<i;)Q=t[F],B.point(Q[0],Q[1],Q[2]);B.lineEnd()}function pU(t,B){var s=-1,Q=t.length;for(B.polygonStart();++s<Q;)ZU(t[s],B,1);B.polygonEnd()}function EU(t,B){t&&VU.hasOwnProperty(t.type)?VU[t.type](t,B):mU(t,B)}function NU(t){return[oU(t[1],t[0]),LU(t[2])]}function XU(t){var B=t[0],s=t[1],Q=bU(s);return[Q*bU(B),Q*hU(B),hU(s)]}function WU(t,B){return t[0]*B[0]+t[1]*B[1]+t[2]*B[2]}function HU(t,B){return[t[1]*B[2]-t[2]*B[1],t[2]*B[0]-t[0]*B[2],t[0]*B[1]-t[1]*B[0]]}function DU(t,B){t[0]+=B[0],t[1]+=B[1],t[2]+=B[2]}function fU(t,B){return[t[0]*B,t[1]*B,t[2]*B]}function wU(t){var B=GU(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=B,t[1]/=B,t[2]/=B}function vU(t,B){function s(s,Q){return s=t(s,Q),B(s[0],s[1])}return t.invert&&B.invert&&(s.invert=function(s,Q){return(s=B.invert(s,Q))&&t.invert(s[0],s[1])}),s}function YU(t,B){return aU(t)>gU&&(t-=Math.round(t/lU)*lU),[t,B]}function JU(t,B,s){return(t%=lU)?B||s?vU(MU(t),TU(B,s)):MU(t):B||s?TU(B,s):YU}function kU(t){return function(B,s){return aU(B+=t)>gU&&(B-=Math.round(B/lU)*lU),[B,s]}}function MU(t){var B=kU(t);return B.invert=kU(-t),B}function TU(t,B){var s=bU(t),Q=hU(t),F=bU(B),i=hU(B);function U(t,B){var U=bU(B),g=bU(t)*U,e=hU(t)*U,I=hU(B),l=I*s+g*Q;return[oU(e*F-l*i,g*s-I*Q),LU(l*F+e*i)]}return U.invert=function(t,B){var U=bU(B),g=bU(t)*U,e=hU(t)*U,I=hU(B),l=I*F-e*i;return[oU(e*F+I*i,g*s+l*Q),LU(l*s-g*Q)]},U}function zU(t,B){(B=XU(B))[0]-=t,wU(B);var s=AU(-B[1]);return((-B[2]<0?-s:s)+lU-UU)%lU}function KU(){var t,B=[];return{point:function(B,s,Q){t.push([B,s,Q])},lineStart:function(){B.push(t=[])},lineEnd:RU,rejoin:function(){B.length>1&&B.push(B.pop().concat(B.shift()))},result:function(){var s=B;return B=[],t=null,s}}}function OU(t,B){return aU(t[0]-B[0])<UU&&aU(t[1]-B[1])<UU}function PU(t,B,s,Q){this.x=t,this.z=B,this.o=s,this.e=Q,this.v=!1,this.n=this.p=null}function jU(t,B,s,Q,F){var i,U,g=[],e=[];if(t.forEach(function(t){if(!((B=t.length-1)<=0)){var B,s,Q=t[0],U=t[B];if(OU(Q,U)){if(!Q[2]&&!U[2]){for(F.lineStart(),i=0;i<B;++i)F.point((Q=t[i])[0],Q[1]);return void F.lineEnd()}U[0]+=2e-6}g.push(s=new PU(Q,t,null,!0)),e.push(s.o=new PU(Q,null,s,!1)),g.push(s=new PU(U,t,null,!1)),e.push(s.o=new PU(U,null,s,!0))}}),g.length){for(e.sort(B),_U(g),_U(e),i=0,U=e.length;i<U;++i)e[i].e=s=!s;for(var I,l,c=g[0];;){for(var n=c,a=!0;n.v;)if((n=n.n)===c)return;I=n.z,F.lineStart();do{if(n.v=n.o.v=!0,n.e){if(a)for(i=0,U=I.length;i<U;++i)F.point((l=I[i])[0],l[1]);else Q(n.x,n.n.x,1,F);n=n.n}else{if(a)for(I=n.p.z,i=I.length-1;i>=0;--i)F.point((l=I[i])[0],l[1]);else Q(n.x,n.p.x,-1,F);n=n.p}I=(n=n.o).z,a=!a}while(!n.v);F.lineEnd()}}}function _U(t){if(B=t.length){for(var B,s,Q=0,F=t[0];++Q<B;)F.n=s=t[Q],s.p=F,F=s;F.n=s=t[0],s.p=F}}function $U(t){return aU(t[0])<=gU?t[0]:xU(t[0])*((aU(t[0])+gU)%lU-gU)}function qU(t,B,s,Q){return function(F){var i,U,g,e=B(F),I=KU(),l=B(I),c=!1,n={point:a,lineStart:o,lineEnd:b,polygonStart:function(){n.point=C,n.lineStart=r,n.lineEnd=u,U=[],i=[]},polygonEnd:function(){n.point=a,n.lineStart=o,n.lineEnd=b,U=IB(U);var t=function(t,B){var s=$U(B),Q=B[1],F=hU(Q),i=[hU(s),-bU(s),0],U=0,g=0,e=new Rt;1===F?Q=eU+UU:-1===F&&(Q=-eU-UU);for(var I=0,l=t.length;I<l;++I)if(n=(c=t[I]).length)for(var c,n,a=c[n-1],d=$U(a),o=a[1]/2+IU,b=hU(o),C=bU(o),r=0;r<n;++r,d=h,b=G,C=y,a=u){var u=c[r],h=$U(u),x=u[1]/2+IU,G=hU(x),y=bU(x),A=h-d,L=A>=0?1:-1,R=L*A,m=R>gU,V=b*G;if(e.add(oU(V*L*hU(R),C*y+V*bU(R))),U+=m?A+L*lU:A,m^d>=s^h>=s){var S=HU(XU(a),XU(u));wU(S);var Z=HU(i,S);wU(Z);var p=(m^A>=0?-1:1)*LU(Z[2]);(Q>p||Q===p&&(S[0]||S[1]))&&(g+=m^A>=0?1:-1)}}return(U<-1e-6||U<UU&&e<-1e-12)^1&g}(i,Q);U.length?(c||(F.polygonStart(),c=!0),jU(U,Bg,t,s,F)):t&&(c||(F.polygonStart(),c=!0),F.lineStart(),s(null,null,1,F),F.lineEnd()),c&&(F.polygonEnd(),c=!1),U=i=null},sphere:function(){F.polygonStart(),F.lineStart(),s(null,null,1,F),F.lineEnd(),F.polygonEnd()}};function a(B,s){t(B,s)&&F.point(B,s)}function d(t,B){e.point(t,B)}function o(){n.point=d,e.lineStart()}function b(){n.point=a,e.lineEnd()}function C(t,B){g.push([t,B]),l.point(t,B)}function r(){l.lineStart(),g=[]}function u(){C(g[0][0],g[0][1]),l.lineEnd();var t,B,s,Q,e=l.clean(),n=I.result(),a=n.length;if(g.pop(),i.push(g),g=null,a)if(1&e){if((B=(s=n[0]).length-1)>0){for(c||(F.polygonStart(),c=!0),F.lineStart(),t=0;t<B;++t)F.point((Q=s[t])[0],Q[1]);F.lineEnd()}}else a>1&&2&e&&n.push(n.pop().concat(n.shift())),U.push(n.filter(tg))}return n}}function tg(t){return t.length>1}function Bg(t,B){return((t=t.x)[0]<0?t[1]-eU-UU:eU-t[1])-((B=B.x)[0]<0?B[1]-eU-UU:eU-B[1])}YU.invert=YU;var sg=qU(function(){return!0},function(t){var B,s=NaN,Q=NaN,F=NaN;return{lineStart:function(){t.lineStart(),B=1},point:function(i,U){var g=i>0?gU:-gU,e=aU(i-s);aU(e-gU)<UU?(t.point(s,Q=(Q+U)/2>0?eU:-eU),t.point(F,Q),t.lineEnd(),t.lineStart(),t.point(g,Q),t.point(i,Q),B=0):F!==g&&e>=gU&&(aU(s-F)<UU&&(s-=F*UU),aU(i-g)<UU&&(i-=g*UU),Q=function(t,B,s,Q){var F,i,U=hU(t-s);return aU(U)>UU?dU((hU(B)*(i=bU(Q))*hU(s)-hU(Q)*(F=bU(B))*hU(t))/(F*i*U)):(B+Q)/2}(s,Q,i,U),t.point(F,Q),t.lineEnd(),t.lineStart(),t.point(g,Q),B=0),t.point(s=i,Q=U),F=g},lineEnd:function(){t.lineEnd(),s=Q=NaN},clean:function(){return 2-B}}},function(t,B,s,Q){var F;if(null==t)F=s*eU,Q.point(-gU,F),Q.point(0,F),Q.point(gU,F),Q.point(gU,0),Q.point(gU,-F),Q.point(0,-F),Q.point(-gU,-F),Q.point(-gU,0),Q.point(-gU,F);else if(aU(t[0]-B[0])>UU){var i=t[0]<B[0]?gU:-gU;F=s*i/2,Q.point(-i,F),Q.point(0,F),Q.point(i,F)}else Q.point(B[0],B[1])},[-gU,-eU]);function Qg(t){var B=bU(t),s=2*nU,Q=B>0,F=aU(B)>UU;function i(t,s){return bU(t)*bU(s)>B}function U(t,s,Q){var F=[1,0,0],i=HU(XU(t),XU(s)),U=WU(i,i),g=i[0],e=U-g*g;if(!e)return!Q&&t;var I=B*U/e,l=-B*g/e,c=HU(F,i),n=fU(F,I);DU(n,fU(i,l));var a=c,d=WU(n,a),o=WU(a,a),b=d*d-o*(WU(n,n)-1);if(!(b<0)){var C=GU(b),r=fU(a,(-d-C)/o);if(DU(r,n),r=NU(r),!Q)return r;var u,h=t[0],x=s[0],G=t[1],y=s[1];x<h&&(u=h,h=x,x=u);var A=x-h,L=aU(A-gU)<UU;if(!L&&y<G&&(u=G,G=y,y=u),L||A<UU?L?G+y>0^r[1]<(aU(r[0]-h)<UU?G:y):G<=r[1]&&r[1]<=y:A>gU^(h<=r[0]&&r[0]<=x)){var R=fU(a,(-d+C)/o);return DU(R,n),[r,NU(R)]}}}function g(B,s){var F=Q?t:gU-t,i=0;return B<-F?i|=1:B>F&&(i|=2),s<-F?i|=4:s>F&&(i|=8),i}return qU(i,function(t){var B,s,e,I,l;return{lineStart:function(){I=e=!1,l=1},point:function(c,n){var a,d=[c,n],o=i(c,n),b=Q?o?0:g(c,n):o?g(c+(c<0?gU:-gU),n):0;if(!B&&(I=e=o)&&t.lineStart(),o!==e&&(!(a=U(B,d))||OU(B,a)||OU(d,a))&&(d[2]=1),o!==e)l=0,o?(t.lineStart(),a=U(d,B),t.point(a[0],a[1])):(a=U(B,d),t.point(a[0],a[1],2),t.lineEnd()),B=a;else if(F&&B&&Q^o){var C;b&s||!(C=U(d,B,!0))||(l=0,Q?(t.lineStart(),t.point(C[0][0],C[0][1]),t.point(C[1][0],C[1][1]),t.lineEnd()):(t.point(C[1][0],C[1][1]),t.lineEnd(),t.lineStart(),t.point(C[0][0],C[0][1],3)))}!o||B&&OU(B,d)||t.point(d[0],d[1]),B=d,e=o,s=b},lineEnd:function(){e&&t.lineEnd(),B=null},clean:function(){return l|(I&&e)<<1}}},function(B,Q,F,i){!function(t,B,s,Q,F,i){if(s){var U=bU(B),g=hU(B),e=Q*s;null==F?(F=B+Q*lU,i=B-e/2):(F=zU(U,F),i=zU(U,i),(Q>0?F<i:F>i)&&(F+=Q*lU));for(var I,l=F;Q>0?l>i:l<i;l-=e)I=NU([U,-g*bU(l),-g*hU(l)]),t.point(I[0],I[1])}}(i,t,s,F,B,Q)},Q?[0,-t]:[-gU,t-gU])}var Fg=1e9,ig=-Fg;function Ug(t,B,s,Q){function F(F,i){return t<=F&&F<=s&&B<=i&&i<=Q}function i(F,i,g,I){var l=0,c=0;if(null==F||(l=U(F,g))!==(c=U(i,g))||e(F,i)<0^g>0)do{I.point(0===l||3===l?t:s,l>1?Q:B)}while((l=(l+g+4)%4)!==c);else I.point(i[0],i[1])}function U(Q,F){return aU(Q[0]-t)<UU?F>0?0:3:aU(Q[0]-s)<UU?F>0?2:1:aU(Q[1]-B)<UU?F>0?1:0:F>0?3:2}function g(t,B){return e(t.x,B.x)}function e(t,B){var s=U(t,1),Q=U(B,1);return s!==Q?s-Q:0===s?B[1]-t[1]:1===s?t[0]-B[0]:2===s?t[1]-B[1]:B[0]-t[0]}return function(U){var e,I,l,c,n,a,d,o,b,C,r,u=U,h=KU(),x={point:G,lineStart:function(){x.point=y,I&&I.push(l=[]);C=!0,b=!1,d=o=NaN},lineEnd:function(){e&&(y(c,n),a&&b&&h.rejoin(),e.push(h.result()));x.point=G,b&&u.lineEnd()},polygonStart:function(){u=h,e=[],I=[],r=!0},polygonEnd:function(){var B=function(){for(var B=0,s=0,F=I.length;s<F;++s)for(var i,U,g=I[s],e=1,l=g.length,c=g[0],n=c[0],a=c[1];e<l;++e)i=n,U=a,n=(c=g[e])[0],a=c[1],U<=Q?a>Q&&(n-i)*(Q-U)>(a-U)*(t-i)&&++B:a<=Q&&(n-i)*(Q-U)<(a-U)*(t-i)&&--B;return B}(),s=r&&B,F=(e=IB(e)).length;(s||F)&&(U.polygonStart(),s&&(U.lineStart(),i(null,null,1,U),U.lineEnd()),F&&jU(e,g,B,i,U),U.polygonEnd());u=U,e=I=l=null}};function G(t,B){F(t,B)&&u.point(t,B)}function y(i,U){var g=F(i,U);if(I&&l.push([i,U]),C)c=i,n=U,a=g,C=!1,g&&(u.lineStart(),u.point(i,U));else if(g&&b)u.point(i,U);else{var e=[d=Math.max(ig,Math.min(Fg,d)),o=Math.max(ig,Math.min(Fg,o))],h=[i=Math.max(ig,Math.min(Fg,i)),U=Math.max(ig,Math.min(Fg,U))];!function(t,B,s,Q,F,i){var U,g=t[0],e=t[1],I=0,l=1,c=B[0]-g,n=B[1]-e;if(U=s-g,c||!(U>0)){if(U/=c,c<0){if(U<I)return;U<l&&(l=U)}else if(c>0){if(U>l)return;U>I&&(I=U)}if(U=F-g,c||!(U<0)){if(U/=c,c<0){if(U>l)return;U>I&&(I=U)}else if(c>0){if(U<I)return;U<l&&(l=U)}if(U=Q-e,n||!(U>0)){if(U/=n,n<0){if(U<I)return;U<l&&(l=U)}else if(n>0){if(U>l)return;U>I&&(I=U)}if(U=i-e,n||!(U<0)){if(U/=n,n<0){if(U>l)return;U>I&&(I=U)}else if(n>0){if(U<I)return;U<l&&(l=U)}return I>0&&(t[0]=g+I*c,t[1]=e+I*n),l<1&&(B[0]=g+l*c,B[1]=e+l*n),!0}}}}}(e,h,t,B,s,Q)?g&&(u.lineStart(),u.point(i,U),r=!1):(b||(u.lineStart(),u.point(e[0],e[1])),u.point(h[0],h[1]),g||u.lineEnd(),r=!1)}d=i,o=U,b=g}return x}}var gg,eg,Ig,lg,cg=t=>t,ng=new Rt,ag=new Rt,dg={point:RU,lineStart:RU,lineEnd:RU,polygonStart:function(){dg.lineStart=og,dg.lineEnd=rg},polygonEnd:function(){dg.lineStart=dg.lineEnd=dg.point=RU,ng.add(aU(ag)),ag=new Rt},result:function(){var t=ng/2;return ng=new Rt,t}};function og(){dg.point=bg}function bg(t,B){dg.point=Cg,gg=Ig=t,eg=lg=B}function Cg(t,B){ag.add(lg*t-Ig*B),Ig=t,lg=B}function rg(){Cg(gg,eg)}var ug=1/0,hg=ug,xg=-ug,Gg=xg,yg={point:function(t,B){t<ug&&(ug=t);t>xg&&(xg=t);B<hg&&(hg=B);B>Gg&&(Gg=B)},lineStart:RU,lineEnd:RU,polygonStart:RU,polygonEnd:RU,result:function(){var t=[[ug,hg],[xg,Gg]];return xg=Gg=-(hg=ug=1/0),t}};var Ag,Lg,Rg,mg,Vg=0,Sg=0,Zg=0,pg=0,Eg=0,Ng=0,Xg=0,Wg=0,Hg=0,Dg={point:fg,lineStart:wg,lineEnd:Jg,polygonStart:function(){Dg.lineStart=kg,Dg.lineEnd=Mg},polygonEnd:function(){Dg.point=fg,Dg.lineStart=wg,Dg.lineEnd=Jg},result:function(){var t=Hg?[Xg/Hg,Wg/Hg]:Ng?[pg/Ng,Eg/Ng]:Zg?[Vg/Zg,Sg/Zg]:[NaN,NaN];return Vg=Sg=Zg=pg=Eg=Ng=Xg=Wg=Hg=0,t}};function fg(t,B){Vg+=t,Sg+=B,++Zg}function wg(){Dg.point=vg}function vg(t,B){Dg.point=Yg,fg(Rg=t,mg=B)}function Yg(t,B){var s=t-Rg,Q=B-mg,F=GU(s*s+Q*Q);pg+=F*(Rg+t)/2,Eg+=F*(mg+B)/2,Ng+=F,fg(Rg=t,mg=B)}function Jg(){Dg.point=fg}function kg(){Dg.point=Tg}function Mg(){zg(Ag,Lg)}function Tg(t,B){Dg.point=zg,fg(Ag=Rg=t,Lg=mg=B)}function zg(t,B){var s=t-Rg,Q=B-mg,F=GU(s*s+Q*Q);pg+=F*(Rg+t)/2,Eg+=F*(mg+B)/2,Ng+=F,Xg+=(F=mg*t-Rg*B)*(Rg+t),Wg+=F*(mg+B),Hg+=3*F,fg(Rg=t,mg=B)}function Kg(t){this._context=t}Kg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,B){switch(this._point){case 0:this._context.moveTo(t,B),this._point=1;break;case 1:this._context.lineTo(t,B);break;default:this._context.moveTo(t+this._radius,B),this._context.arc(t,B,this._radius,0,lU)}},result:RU};var Og,Pg,jg,_g,$g,qg=new Rt,te={point:RU,lineStart:function(){te.point=Be},lineEnd:function(){Og&&se(Pg,jg),te.point=RU},polygonStart:function(){Og=!0},polygonEnd:function(){Og=null},result:function(){var t=+qg;return qg=new Rt,t}};function Be(t,B){te.point=se,Pg=_g=t,jg=$g=B}function se(t,B){_g-=t,$g-=B,qg.add(GU(_g*_g+$g*$g)),_g=t,$g=B}let Qe,Fe,ie,Ue;class ge{constructor(t){this._append=null==t?ee:function(t){const B=Math.floor(t);if(!(B>=0))throw new RangeError(`invalid digits: ${t}`);if(B>15)return ee;if(B!==Qe){const t=10**B;Qe=B,Fe=function(B){let s=1;this._+=B[0];for(const Q=B.length;s<Q;++s)this._+=Math.round(arguments[s]*t)/t+B[s]}}return Fe}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,B){switch(this._point){case 0:this._append`M${t},${B}`,this._point=1;break;case 1:this._append`L${t},${B}`;break;default:if(this._append`M${t},${B}`,this._radius!==ie||this._append!==Fe){const t=this._radius,B=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,ie=t,Fe=this._append,Ue=this._,this._=B}this._+=Ue}}result(){const t=this._;return this._="",t.length?t:null}}function ee(t){let B=1;this._+=t[0];for(const s=t.length;B<s;++B)this._+=arguments[B]+t[B]}function Ie(t,B){let s,Q,F=3,i=4.5;function U(t){return t&&("function"==typeof i&&Q.pointRadius(+i.apply(this,arguments)),EU(t,s(Q))),Q.result()}return U.area=function(t){return EU(t,s(dg)),dg.result()},U.measure=function(t){return EU(t,s(te)),te.result()},U.bounds=function(t){return EU(t,s(yg)),yg.result()},U.centroid=function(t){return EU(t,s(Dg)),Dg.result()},U.projection=function(B){return arguments.length?(s=null==B?(t=null,cg):(t=B).stream,U):t},U.context=function(t){return arguments.length?(Q=null==t?(B=null,new ge(F)):new Kg(B=t),"function"!=typeof i&&Q.pointRadius(i),U):B},U.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(Q.pointRadius(+t),+t),U):i},U.digits=function(t){if(!arguments.length)return F;if(null==t)F=null;else{const B=Math.floor(t);if(!(B>=0))throw new RangeError(`invalid digits: ${t}`);F=B}return null===B&&(Q=new ge(F)),U},U.projection(t).digits(F).context(B)}function le(t){return{stream:ce(t)}}function ce(t){return function(B){var s=new ne;for(var Q in t)s[Q]=t[Q];return s.stream=B,s}}function ne(){}function ae(t,B,s){var Q=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=Q&&t.clipExtent(null),EU(s,t.stream(yg)),B(yg.result()),null!=Q&&t.clipExtent(Q),t}function de(t,B,s){return ae(t,function(s){var Q=B[1][0]-B[0][0],F=B[1][1]-B[0][1],i=Math.min(Q/(s[1][0]-s[0][0]),F/(s[1][1]-s[0][1])),U=+B[0][0]+(Q-i*(s[1][0]+s[0][0]))/2,g=+B[0][1]+(F-i*(s[1][1]+s[0][1]))/2;t.scale(150*i).translate([U,g])},s)}function oe(t,B,s){return de(t,[[0,0],B],s)}function be(t,B,s){return ae(t,function(s){var Q=+B,F=Q/(s[1][0]-s[0][0]),i=(Q-F*(s[1][0]+s[0][0]))/2,U=-F*s[0][1];t.scale(150*F).translate([i,U])},s)}function Ce(t,B,s){return ae(t,function(s){var Q=+B,F=Q/(s[1][1]-s[0][1]),i=-F*s[0][0],U=(Q-F*(s[1][1]+s[0][1]))/2;t.scale(150*F).translate([i,U])},s)}ne.prototype={constructor:ne,point:function(t,B){this.stream.point(t,B)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var re=bU(30*nU);function ue(t,B){return+B?function(t,B){function s(Q,F,i,U,g,e,I,l,c,n,a,d,o,b){var C=I-Q,r=l-F,u=C*C+r*r;if(u>4*B&&o--){var h=U+n,x=g+a,G=e+d,y=GU(h*h+x*x+G*G),A=LU(G/=y),L=aU(aU(G)-1)<UU||aU(i-c)<UU?(i+c)/2:oU(x,h),R=t(L,A),m=R[0],V=R[1],S=m-Q,Z=V-F,p=r*S-C*Z;(p*p/u>B||aU((C*S+r*Z)/u-.5)>.3||U*n+g*a+e*d<re)&&(s(Q,F,i,U,g,e,m,V,L,h/=y,x/=y,G,o,b),b.point(m,V),s(m,V,L,h,x,G,I,l,c,n,a,d,o,b))}}return function(B){var Q,F,i,U,g,e,I,l,c,n,a,d,o={point:b,lineStart:C,lineEnd:u,polygonStart:function(){B.polygonStart(),o.lineStart=h},polygonEnd:function(){B.polygonEnd(),o.lineStart=C}};function b(s,Q){s=t(s,Q),B.point(s[0],s[1])}function C(){l=NaN,o.point=r,B.lineStart()}function r(Q,F){var i=XU([Q,F]),U=t(Q,F);s(l,c,I,n,a,d,l=U[0],c=U[1],I=Q,n=i[0],a=i[1],d=i[2],16,B),B.point(l,c)}function u(){o.point=b,B.lineEnd()}function h(){C(),o.point=x,o.lineEnd=G}function x(t,B){r(Q=t,B),F=l,i=c,U=n,g=a,e=d,o.point=r}function G(){s(l,c,I,n,a,d,F,i,Q,U,g,e,16,B),o.lineEnd=u,u()}return o}}(t,B):function(t){return ce({point:function(B,s){B=t(B,s),this.stream.point(B[0],B[1])}})}(t)}var he=ce({point:function(t,B){this.stream.point(t*nU,B*nU)}});function xe(t,B,s,Q,F,i){if(!i)return function(t,B,s,Q,F){function i(i,U){return[B+t*(i*=Q),s-t*(U*=F)]}return i.invert=function(i,U){return[(i-B)/t*Q,(s-U)/t*F]},i}(t,B,s,Q,F);var U=bU(i),g=hU(i),e=U*t,I=g*t,l=U/t,c=g/t,n=(g*s-U*B)/t,a=(g*B+U*s)/t;function d(t,i){return[e*(t*=Q)-I*(i*=F)+B,s-I*t-e*i]}return d.invert=function(t,B){return[Q*(l*t-c*B+n),F*(a-c*t-l*B)]},d}function Ge(t){return ye(function(){return t})()}function ye(t){var B,s,Q,F,i,U,g,e,I,l,c=150,n=480,a=250,d=0,o=0,b=0,C=0,r=0,u=0,h=1,x=1,G=null,y=sg,A=null,L=cg,R=.5;function m(t){return e(t[0]*nU,t[1]*nU)}function V(t){return(t=e.invert(t[0],t[1]))&&[t[0]*cU,t[1]*cU]}function S(){var t=xe(c,0,0,h,x,u).apply(null,B(d,o)),Q=xe(c,n-t[0],a-t[1],h,x,u);return s=JU(b,C,r),g=vU(B,Q),e=vU(s,g),U=ue(g,R),Z()}function Z(){return I=l=null,m}return m.stream=function(t){return I&&l===t?I:I=he(function(t){return ce({point:function(B,s){var Q=t(B,s);return this.stream.point(Q[0],Q[1])}})}(s)(y(U(L(l=t)))))},m.preclip=function(t){return arguments.length?(y=t,G=void 0,Z()):y},m.postclip=function(t){return arguments.length?(L=t,A=Q=F=i=null,Z()):L},m.clipAngle=function(t){return arguments.length?(y=+t?Qg(G=t*nU):(G=null,sg),Z()):G*cU},m.clipExtent=function(t){return arguments.length?(L=null==t?(A=Q=F=i=null,cg):Ug(A=+t[0][0],Q=+t[0][1],F=+t[1][0],i=+t[1][1]),Z()):null==A?null:[[A,Q],[F,i]]},m.scale=function(t){return arguments.length?(c=+t,S()):c},m.translate=function(t){return arguments.length?(n=+t[0],a=+t[1],S()):[n,a]},m.center=function(t){return arguments.length?(d=t[0]%360*nU,o=t[1]%360*nU,S()):[d*cU,o*cU]},m.rotate=function(t){return arguments.length?(b=t[0]%360*nU,C=t[1]%360*nU,r=t.length>2?t[2]%360*nU:0,S()):[b*cU,C*cU,r*cU]},m.angle=function(t){return arguments.length?(u=t%360*nU,S()):u*cU},m.reflectX=function(t){return arguments.length?(h=t?-1:1,S()):h<0},m.reflectY=function(t){return arguments.length?(x=t?-1:1,S()):x<0},m.precision=function(t){return arguments.length?(U=ue(g,R=t*t),Z()):GU(R)},m.fitExtent=function(t,B){return de(m,t,B)},m.fitSize=function(t,B){return oe(m,t,B)},m.fitWidth=function(t,B){return be(m,t,B)},m.fitHeight=function(t,B){return Ce(m,t,B)},function(){return B=t.apply(this,arguments),m.invert=B.invert&&V,S()}}function Ae(t){var B=0,s=gU/3,Q=ye(t),F=Q(B,s);return F.parallels=function(t){return arguments.length?Q(B=t[0]*nU,s=t[1]*nU):[B*cU,s*cU]},F}function Le(t,B){var s=hU(t),Q=(s+hU(B))/2;if(aU(Q)<UU)return function(t){var B=bU(t);function s(t,s){return[t*B,hU(s)/B]}return s.invert=function(t,s){return[t/B,LU(s*B)]},s}(t);var F=1+s*(2*Q-s),i=GU(F)/Q;function U(t,B){var s=GU(F-2*Q*hU(B))/Q;return[s*hU(t*=Q),i-s*bU(t)]}return U.invert=function(t,B){var s=i-B,U=oU(t,aU(s))*xU(s);return s*Q<0&&(U-=gU*xU(t)*xU(s)),[U/Q,LU((F-(t*t+s*s)*Q*Q)/(2*Q))]},U}function Re(){return Ae(Le).scale(155.424).center([0,33.6442])}function me(){return Re().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ve(){var t,B,s,Q,F,i,U=me(),g=Re().rotate([154,0]).center([-2,58.5]).parallels([55,65]),e=Re().rotate([157,0]).center([-3,19.9]).parallels([8,18]),I={point:function(t,B){i=[t,B]}};function l(t){var B=t[0],U=t[1];return i=null,s.point(B,U),i||(Q.point(B,U),i)||(F.point(B,U),i)}function c(){return t=B=null,l}return l.invert=function(t){var B=U.scale(),s=U.translate(),Q=(t[0]-s[0])/B,F=(t[1]-s[1])/B;return(F>=.12&&F<.234&&Q>=-.425&&Q<-.214?g:F>=.166&&F<.234&&Q>=-.214&&Q<-.115?e:U).invert(t)},l.stream=function(s){return t&&B===s?t:t=function(t){var B=t.length;return{point:function(s,Q){for(var F=-1;++F<B;)t[F].point(s,Q)},sphere:function(){for(var s=-1;++s<B;)t[s].sphere()},lineStart:function(){for(var s=-1;++s<B;)t[s].lineStart()},lineEnd:function(){for(var s=-1;++s<B;)t[s].lineEnd()},polygonStart:function(){for(var s=-1;++s<B;)t[s].polygonStart()},polygonEnd:function(){for(var s=-1;++s<B;)t[s].polygonEnd()}}}([U.stream(B=s),g.stream(s),e.stream(s)])},l.precision=function(t){return arguments.length?(U.precision(t),g.precision(t),e.precision(t),c()):U.precision()},l.scale=function(t){return arguments.length?(U.scale(t),g.scale(.35*t),e.scale(t),l.translate(U.translate())):U.scale()},l.translate=function(t){if(!arguments.length)return U.translate();var B=U.scale(),i=+t[0],l=+t[1];return s=U.translate(t).clipExtent([[i-.455*B,l-.238*B],[i+.455*B,l+.238*B]]).stream(I),Q=g.translate([i-.307*B,l+.201*B]).clipExtent([[i-.425*B+UU,l+.12*B+UU],[i-.214*B-UU,l+.234*B-UU]]).stream(I),F=e.translate([i-.205*B,l+.212*B]).clipExtent([[i-.214*B+UU,l+.166*B+UU],[i-.115*B-UU,l+.234*B-UU]]).stream(I),c()},l.fitExtent=function(t,B){return de(l,t,B)},l.fitSize=function(t,B){return oe(l,t,B)},l.fitWidth=function(t,B){return be(l,t,B)},l.fitHeight=function(t,B){return Ce(l,t,B)},l.scale(1070)}function Se(t){return function(B,s){var Q=bU(B),F=bU(s),i=t(Q*F);return i===1/0?[2,0]:[i*F*hU(B),i*hU(s)]}}function Ze(t){return function(B,s){var Q=GU(B*B+s*s),F=t(Q),i=hU(F),U=bU(F);return[oU(B*i,Q*U),LU(Q&&s*i/Q)]}}var pe=Se(function(t){return GU(2/(1+t))});function Ee(){return Ge(pe).scale(124.75).clipAngle(179.999)}pe.invert=Ze(function(t){return 2*LU(t/2)});var Ne=Se(function(t){return(t=AU(t))&&t/hU(t)});function Xe(){return Ge(Ne).scale(79.4188).clipAngle(179.999)}function We(t,B){return[t,rU(yU((eU+B)/2))]}function He(){return De(We).scale(961/lU)}function De(t){var B,s,Q,F=Ge(t),i=F.center,U=F.scale,g=F.translate,e=F.clipExtent,I=null;function l(){var i=gU*U(),g=F(function(t){function B(B){return(B=t(B[0]*nU,B[1]*nU))[0]*=cU,B[1]*=cU,B}return t=JU(t[0]*nU,t[1]*nU,t.length>2?t[2]*nU:0),B.invert=function(B){return(B=t.invert(B[0]*nU,B[1]*nU))[0]*=cU,B[1]*=cU,B},B}(F.rotate()).invert([0,0]));return e(null==I?[[g[0]-i,g[1]-i],[g[0]+i,g[1]+i]]:t===We?[[Math.max(g[0]-i,I),B],[Math.min(g[0]+i,s),Q]]:[[I,Math.max(g[1]-i,B)],[s,Math.min(g[1]+i,Q)]])}return F.scale=function(t){return arguments.length?(U(t),l()):U()},F.translate=function(t){return arguments.length?(g(t),l()):g()},F.center=function(t){return arguments.length?(i(t),l()):i()},F.clipExtent=function(t){return arguments.length?(null==t?I=B=s=Q=null:(I=+t[0][0],B=+t[0][1],s=+t[1][0],Q=+t[1][1]),l()):null==I?null:[[I,B],[s,Q]]},l()}function fe(t){return yU((eU+t)/2)}function we(t,B){var s=bU(t),Q=t===B?hU(t):rU(s/bU(B))/rU(fe(B)/fe(t)),F=s*uU(fe(t),Q)/Q;if(!Q)return We;function i(t,B){F>0?B<-eU+UU&&(B=-eU+UU):B>eU-UU&&(B=eU-UU);var s=F/uU(fe(B),Q);return[s*hU(Q*t),F-s*bU(Q*t)]}return i.invert=function(t,B){var s=F-B,i=xU(Q)*GU(t*t+s*s),U=oU(t,aU(s))*xU(s);return s*Q<0&&(U-=gU*xU(t)*xU(s)),[U/Q,2*dU(uU(F/i,1/Q))-eU]},i}function ve(){return Ae(we).scale(109.5).parallels([30,30])}function Ye(t,B){return[t,B]}function Je(){return Ge(Ye).scale(152.63)}function ke(t,B){var s=bU(t),Q=t===B?hU(t):(s-bU(B))/(B-t),F=s/Q+t;if(aU(Q)<UU)return Ye;function i(t,B){var s=F-B,i=Q*t;return[s*hU(i),F-s*bU(i)]}return i.invert=function(t,B){var s=F-B,i=oU(t,aU(s))*xU(s);return s*Q<0&&(i-=gU*xU(t)*xU(s)),[i/Q,F-xU(Q)*GU(t*t+s*s)]},i}function Me(){return Ae(ke).scale(131.154).center([0,13.9389])}Ne.invert=Ze(function(t){return t}),We.invert=function(t,B){return[t,2*dU(CU(B))-eU]},Ye.invert=Ye;var Te=1.340264,ze=-.081106,Ke=893e-6,Oe=.003796,Pe=GU(3)/2;function je(t,B){var s=LU(Pe*hU(B)),Q=s*s,F=Q*Q*Q;return[t*bU(s)/(Pe*(Te+3*ze*Q+F*(7*Ke+9*Oe*Q))),s*(Te+ze*Q+F*(Ke+Oe*Q))]}function _e(){return Ge(je).scale(177.158)}function $e(t,B){var s=bU(B),Q=bU(t)*s;return[s*hU(t)/Q,hU(B)/Q]}function qe(){return Ge($e).scale(144.049).clipAngle(60)}function tI(t,B){return[bU(B)*hU(t),hU(B)]}function BI(){return Ge(tI).scale(249.5).clipAngle(90.000001)}function sI(t,B){var s=bU(B),Q=1+bU(t)*s;return[s*hU(t)/Q,hU(B)/Q]}function QI(){return Ge(sI).scale(250).clipAngle(142)}function FI(t,B){return[rU(yU((eU+B)/2)),-t]}function iI(){var t=De(FI),B=t.center,s=t.rotate;return t.center=function(t){return arguments.length?B([-t[1],t[0]]):[(t=B())[1],-t[0]]},t.rotate=function(t){return arguments.length?s([t[0],t[1],t.length>2?t[2]+90:90]):[(t=s())[0],t[1],t[2]-90]},s([0,0,90]).scale(159.155)}function UI(t,B){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(B).domain(t)}return this}function gI(t,B){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof B?this.interpolator(B):this.range(B)}return this}je.invert=function(t,B){for(var s,Q=B,F=Q*Q,i=F*F*F,U=0;U<12&&(i=(F=(Q-=s=(Q*(Te+ze*F+i*(Ke+Oe*F))-B)/(Te+3*ze*F+i*(7*Ke+9*Oe*F)))*Q)*F*F,!(aU(s)<1e-12));++U);return[Pe*t*(Te+3*ze*F+i*(7*Ke+9*Oe*F))/bU(Q),LU(hU(Q)/Pe)]},$e.invert=Ze(dU),tI.invert=Ze(LU),sI.invert=Ze(function(t){return 2*dU(t)}),FI.invert=function(t,B){return[-B,2*dU(CU(t))-eU]};const eI=Symbol("implicit");function II(){var t=new mt,B=[],s=[],Q=eI;function F(F){let i=t.get(F);if(void 0===i){if(Q!==eI)return Q;t.set(F,i=B.push(F)-1)}return s[i%s.length]}return F.domain=function(s){if(!arguments.length)return B.slice();B=[],t=new mt;for(const Q of s)t.has(Q)||t.set(Q,B.push(Q)-1);return F},F.range=function(t){return arguments.length?(s=Array.from(t),F):s.slice()},F.unknown=function(t){return arguments.length?(Q=t,F):Q},F.copy=function(){return II(B,s).unknown(Q)},UI.apply(F,arguments),F}function lI(){var t,B,s=II().unknown(void 0),Q=s.domain,F=s.range,i=0,U=1,g=!1,e=0,I=0,l=.5;function c(){var s=Q().length,c=U<i,n=c?U:i,a=c?i:U;t=(a-n)/Math.max(1,s-e+2*I),g&&(t=Math.floor(t)),n+=(a-n-t*(s-e))*l,B=t*(1-e),g&&(n=Math.round(n),B=Math.round(B));var d=nB(s).map(function(B){return n+t*B});return F(c?d.reverse():d)}return delete s.unknown,s.domain=function(t){return arguments.length?(Q(t),c()):Q()},s.range=function(t){return arguments.length?([i,U]=t,i=+i,U=+U,c()):[i,U]},s.rangeRound=function(t){return[i,U]=t,i=+i,U=+U,g=!0,c()},s.bandwidth=function(){return B},s.step=function(){return t},s.round=function(t){return arguments.length?(g=!!t,c()):g},s.padding=function(t){return arguments.length?(e=Math.min(1,I=+t),c()):e},s.paddingInner=function(t){return arguments.length?(e=Math.min(1,t),c()):e},s.paddingOuter=function(t){return arguments.length?(I=+t,c()):I},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},s.copy=function(){return lI(Q(),[i,U]).round(g).paddingInner(e).paddingOuter(I).align(l)},UI.apply(c(),arguments)}function cI(t){var B=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return cI(B())},t}function nI(){return cI(lI.apply(null,arguments).paddingInner(1))}function aI(t){return+t}var dI=[0,1];function oI(t){return t}function bI(t,B){return(B-=t=+t)?function(s){return(s-t)/B}:function(t){return function(){return t}}(isNaN(B)?NaN:.5)}function CI(t,B,s){var Q=t[0],F=t[1],i=B[0],U=B[1];return F<Q?(Q=bI(F,Q),i=s(U,i)):(Q=bI(Q,F),i=s(i,U)),function(t){return i(Q(t))}}function rI(t,B,s){var Q=Math.min(t.length,B.length)-1,F=new Array(Q),i=new Array(Q),U=-1;for(t[Q]<t[0]&&(t=t.slice().reverse(),B=B.slice().reverse());++U<Q;)F[U]=bI(t[U],t[U+1]),i[U]=s(B[U],B[U+1]);return function(B){var s=Ct(t,B,1,Q)-1;return i[s](F[s](B))}}function uI(t,B){return B.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function hI(){var t,B,s,Q,F,i,U=dI,g=dI,e=mF,I=oI;function l(){var t=Math.min(U.length,g.length);return I!==oI&&(I=function(t,B){var s;return t>B&&(s=t,t=B,B=s),function(s){return Math.max(t,Math.min(B,s))}}(U[0],U[t-1])),Q=t>2?rI:CI,F=i=null,c}function c(B){return null==B||isNaN(B=+B)?s:(F||(F=Q(U.map(t),g,e)))(t(I(B)))}return c.invert=function(s){return I(B((i||(i=Q(g,U.map(t),GF)))(s)))},c.domain=function(t){return arguments.length?(U=Array.from(t,aI),l()):U.slice()},c.range=function(t){return arguments.length?(g=Array.from(t),l()):g.slice()},c.rangeRound=function(t){return g=Array.from(t),e=VF,l()},c.clamp=function(t){return arguments.length?(I=!!t||oI,l()):I!==oI},c.interpolate=function(t){return arguments.length?(e=t,l()):e},c.unknown=function(t){return arguments.length?(s=t,c):s},function(s,Q){return t=s,B=Q,l()}}function xI(){return hI()(oI,oI)}function GI(t,B,s,Q){var F,i=Ot(t,B,s);switch((Q=Pi(null==Q?",f":Q)).type){case"s":var U=Math.max(Math.abs(t),Math.abs(B));return null!=Q.precision||isNaN(F=function(t,B){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zi(B)/3)))-zi(Math.abs(t)))}(i,U))||(Q.precision=F),sU(Q,U);case"":case"e":case"g":case"p":case"r":null!=Q.precision||isNaN(F=function(t,B){return t=Math.abs(t),B=Math.abs(B)-t,Math.max(0,zi(B)-zi(t))+1}(i,Math.max(Math.abs(t),Math.abs(B))))||(Q.precision=F-("e"===Q.type));break;case"f":case"%":null!=Q.precision||isNaN(F=function(t){return Math.max(0,-zi(Math.abs(t)))}(i))||(Q.precision=F-2*("%"===Q.type))}return BU(Q)}function yI(t){var B=t.domain;return t.ticks=function(t){var s=B();return zt(s[0],s[s.length-1],null==t?10:t)},t.tickFormat=function(t,s){var Q=B();return GI(Q[0],Q[Q.length-1],null==t?10:t,s)},t.nice=function(s){null==s&&(s=10);var Q,F,i=B(),U=0,g=i.length-1,e=i[U],I=i[g],l=10;for(I<e&&(F=e,e=I,I=F,F=U,U=g,g=F);l-- >0;){if((F=Kt(e,I,s))===Q)return i[U]=e,i[g]=I,B(i);if(F>0)e=Math.floor(e/F)*F,I=Math.ceil(I/F)*F;else{if(!(F<0))break;e=Math.ceil(e*F)/F,I=Math.floor(I*F)/F}Q=F}return t},t}function AI(){var t=xI();return t.copy=function(){return uI(t,AI())},UI.apply(t,arguments),yI(t)}function LI(t){var B;function s(t){return null==t||isNaN(t=+t)?B:t}return s.invert=s,s.domain=s.range=function(B){return arguments.length?(t=Array.from(B,aI),s):t.slice()},s.unknown=function(t){return arguments.length?(B=t,s):B},s.copy=function(){return LI(t).unknown(B)},t=arguments.length?Array.from(t,aI):[0,1],yI(s)}function RI(t,B){var s,Q=0,F=(t=t.slice()).length-1,i=t[Q],U=t[F];return U<i&&(s=Q,Q=F,F=s,s=i,i=U,U=s),t[Q]=B.floor(i),t[F]=B.ceil(U),t}function mI(t){return Math.log(t)}function VI(t){return Math.exp(t)}function SI(t){return-Math.log(-t)}function ZI(t){return-Math.exp(-t)}function pI(t){return isFinite(t)?+("1e"+t):t<0?0:t}function EI(t){return(B,s)=>-t(-B,s)}function NI(t){const B=t(mI,VI),s=B.domain;let Q,F,i=10;function U(){return Q=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),B=>Math.log(B)/t)}(i),F=function(t){return 10===t?pI:t===Math.E?Math.exp:B=>Math.pow(t,B)}(i),s()[0]<0?(Q=EI(Q),F=EI(F),t(SI,ZI)):t(mI,VI),B}return B.base=function(t){return arguments.length?(i=+t,U()):i},B.domain=function(t){return arguments.length?(s(t),U()):s()},B.ticks=t=>{const B=s();let U=B[0],g=B[B.length-1];const e=g<U;e&&([U,g]=[g,U]);let I,l,c=Q(U),n=Q(g);const a=null==t?10:+t;let d=[];if(!(i%1)&&n-c<a){if(c=Math.floor(c),n=Math.ceil(n),U>0){for(;c<=n;++c)for(I=1;I<i;++I)if(l=c<0?I/F(-c):I*F(c),!(l<U)){if(l>g)break;d.push(l)}}else for(;c<=n;++c)for(I=i-1;I>=1;--I)if(l=c>0?I/F(-c):I*F(c),!(l<U)){if(l>g)break;d.push(l)}2*d.length<a&&(d=zt(U,g,a))}else d=zt(c,n,Math.min(n-c,a)).map(F);return e?d.reverse():d},B.tickFormat=(t,s)=>{if(null==t&&(t=10),null==s&&(s=10===i?"s":","),"function"!=typeof s&&(i%1||null!=(s=Pi(s)).precision||(s.trim=!0),s=BU(s)),t===1/0)return s;const U=Math.max(1,i*t/B.ticks().length);return t=>{let B=t/F(Math.round(Q(t)));return B*i<i-.5&&(B*=i),B<=U?s(t):""}},B.nice=()=>s(RI(s(),{floor:t=>F(Math.floor(Q(t))),ceil:t=>F(Math.ceil(Q(t)))})),B}function XI(){const t=NI(hI()).domain([1,10]);return t.copy=()=>uI(t,XI()).base(t.base()),UI.apply(t,arguments),t}function WI(t){return function(B){return Math.sign(B)*Math.log1p(Math.abs(B/t))}}function HI(t){return function(B){return Math.sign(B)*Math.expm1(Math.abs(B))*t}}function DI(t){var B=1,s=t(WI(B),HI(B));return s.constant=function(s){return arguments.length?t(WI(B=+s),HI(B)):B},yI(s)}function fI(){var t=DI(hI());return t.copy=function(){return uI(t,fI()).constant(t.constant())},UI.apply(t,arguments)}function wI(t){return function(B){return B<0?-Math.pow(-B,t):Math.pow(B,t)}}function vI(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function YI(t){return t<0?-t*t:t*t}function JI(t){var B=t(oI,oI),s=1;return B.exponent=function(B){return arguments.length?1===(s=+B)?t(oI,oI):.5===s?t(vI,YI):t(wI(s),wI(1/s)):s},yI(B)}function kI(){var t=JI(hI());return t.copy=function(){return uI(t,kI()).exponent(t.exponent())},UI.apply(t,arguments),t}function MI(){var t,B=[],s=[],Q=[];function F(){var t=0,F=Math.max(1,s.length);for(Q=new Array(F-1);++t<F;)Q[t-1]=FB(B,t/F);return i}function i(B){return null==B||isNaN(B=+B)?t:s[Ct(Q,B)]}return i.invertExtent=function(t){var F=s.indexOf(t);return F<0?[NaN,NaN]:[F>0?Q[F-1]:B[0],F<Q.length?Q[F]:B[B.length-1]]},i.domain=function(t){if(!arguments.length)return B.slice();B=[];for(let s of t)null==s||isNaN(s=+s)||B.push(s);return B.sort(nt),F()},i.range=function(t){return arguments.length?(s=Array.from(t),F()):s.slice()},i.unknown=function(B){return arguments.length?(t=B,i):t},i.quantiles=function(){return Q.slice()},i.copy=function(){return MI().domain(B).range(s).unknown(t)},UI.apply(i,arguments)}function TI(){var t,B=[.5],s=[0,1],Q=1;function F(F){return null!=F&&F<=F?s[Ct(B,F,0,Q)]:t}return F.domain=function(t){return arguments.length?(B=Array.from(t),Q=Math.min(B.length,s.length-1),F):B.slice()},F.range=function(t){return arguments.length?(s=Array.from(t),Q=Math.min(B.length,s.length-1),F):s.slice()},F.invertExtent=function(t){var Q=s.indexOf(t);return[B[Q-1],B[Q]]},F.unknown=function(B){return arguments.length?(t=B,F):t},F.copy=function(){return TI().domain(B).range(s).unknown(t)},UI.apply(F,arguments)}const zI=new Date,KI=new Date;function OI(t,B,s,Q){function F(B){return t(B=0===arguments.length?new Date:new Date(+B)),B}return F.floor=B=>(t(B=new Date(+B)),B),F.ceil=s=>(t(s=new Date(s-1)),B(s,1),t(s),s),F.round=t=>{const B=F(t),s=F.ceil(t);return t-B<s-t?B:s},F.offset=(t,s)=>(B(t=new Date(+t),null==s?1:Math.floor(s)),t),F.range=(s,Q,i)=>{const U=[];if(s=F.ceil(s),i=null==i?1:Math.floor(i),!(s<Q&&i>0))return U;let g;do{U.push(g=new Date(+s)),B(s,i),t(s)}while(g<s&&s<Q);return U},F.filter=s=>OI(B=>{if(B>=B)for(;t(B),!s(B);)B.setTime(B-1)},(t,Q)=>{if(t>=t)if(Q<0)for(;++Q<=0;)for(;B(t,-1),!s(t););else for(;--Q>=0;)for(;B(t,1),!s(t););}),s&&(F.count=(B,Q)=>(zI.setTime(+B),KI.setTime(+Q),t(zI),t(KI),Math.floor(s(zI,KI))),F.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?F.filter(Q?B=>Q(B)%t===0:B=>F.count(0,B)%t===0):F:null)),F}const PI=OI(()=>{},(t,B)=>{t.setTime(+t+B)},(t,B)=>B-t);PI.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?OI(B=>{B.setTime(Math.floor(B/t)*t)},(B,s)=>{B.setTime(+B+s*t)},(B,s)=>(s-B)/t):PI:null),PI.range;const jI=1e3,_I=6e4,$I=36e5,qI=864e5,tl=6048e5,Bl=2592e6,sl=31536e6,Ql=OI(t=>{t.setTime(t-t.getMilliseconds())},(t,B)=>{t.setTime(+t+B*jI)},(t,B)=>(B-t)/jI,t=>t.getUTCSeconds());Ql.range;const Fl=OI(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jI)},(t,B)=>{t.setTime(+t+B*_I)},(t,B)=>(B-t)/_I,t=>t.getMinutes());Fl.range;const il=OI(t=>{t.setUTCSeconds(0,0)},(t,B)=>{t.setTime(+t+B*_I)},(t,B)=>(B-t)/_I,t=>t.getUTCMinutes());il.range;const Ul=OI(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jI-t.getMinutes()*_I)},(t,B)=>{t.setTime(+t+B*$I)},(t,B)=>(B-t)/$I,t=>t.getHours());Ul.range;const gl=OI(t=>{t.setUTCMinutes(0,0,0)},(t,B)=>{t.setTime(+t+B*$I)},(t,B)=>(B-t)/$I,t=>t.getUTCHours());gl.range;const el=OI(t=>t.setHours(0,0,0,0),(t,B)=>t.setDate(t.getDate()+B),(t,B)=>(B-t-(B.getTimezoneOffset()-t.getTimezoneOffset())*_I)/qI,t=>t.getDate()-1);el.range;const Il=OI(t=>{t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+B)},(t,B)=>(B-t)/qI,t=>t.getUTCDate()-1);Il.range;const ll=OI(t=>{t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+B)},(t,B)=>(B-t)/qI,t=>Math.floor(t/qI));function cl(t){return OI(B=>{B.setDate(B.getDate()-(B.getDay()+7-t)%7),B.setHours(0,0,0,0)},(t,B)=>{t.setDate(t.getDate()+7*B)},(t,B)=>(B-t-(B.getTimezoneOffset()-t.getTimezoneOffset())*_I)/tl)}ll.range;const nl=cl(0),al=cl(1),dl=cl(2),ol=cl(3),bl=cl(4),Cl=cl(5),rl=cl(6);function ul(t){return OI(B=>{B.setUTCDate(B.getUTCDate()-(B.getUTCDay()+7-t)%7),B.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+7*B)},(t,B)=>(B-t)/tl)}nl.range,al.range,dl.range,ol.range,bl.range,Cl.range,rl.range;const hl=ul(0),xl=ul(1),Gl=ul(2),yl=ul(3),Al=ul(4),Ll=ul(5),Rl=ul(6);hl.range,xl.range,Gl.range,yl.range,Al.range,Ll.range,Rl.range;const ml=OI(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,B)=>{t.setMonth(t.getMonth()+B)},(t,B)=>B.getMonth()-t.getMonth()+12*(B.getFullYear()-t.getFullYear()),t=>t.getMonth());ml.range;const Vl=OI(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCMonth(t.getUTCMonth()+B)},(t,B)=>B.getUTCMonth()-t.getUTCMonth()+12*(B.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth());Vl.range;const Sl=OI(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,B)=>{t.setFullYear(t.getFullYear()+B)},(t,B)=>B.getFullYear()-t.getFullYear(),t=>t.getFullYear());Sl.every=t=>isFinite(t=Math.floor(t))&&t>0?OI(B=>{B.setFullYear(Math.floor(B.getFullYear()/t)*t),B.setMonth(0,1),B.setHours(0,0,0,0)},(B,s)=>{B.setFullYear(B.getFullYear()+s*t)}):null,Sl.range;const Zl=OI(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCFullYear(t.getUTCFullYear()+B)},(t,B)=>B.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function pl(t,B,s,Q,F,i){const U=[[Ql,1,jI],[Ql,5,5e3],[Ql,15,15e3],[Ql,30,3e4],[i,1,_I],[i,5,3e5],[i,15,9e5],[i,30,18e5],[F,1,$I],[F,3,108e5],[F,6,216e5],[F,12,432e5],[Q,1,qI],[Q,2,1728e5],[s,1,tl],[B,1,Bl],[B,3,7776e6],[t,1,sl]];function g(B,s,Q){const F=Math.abs(s-B)/Q,i=dt(([,,t])=>t).right(U,F);if(i===U.length)return t.every(Ot(B/sl,s/sl,Q));if(0===i)return PI.every(Math.max(Ot(B,s,Q),1));const[g,e]=U[F/U[i-1][2]<U[i][2]/F?i-1:i];return g.every(e)}return[function(t,B,s){const Q=B<t;Q&&([t,B]=[B,t]);const F=s&&"function"==typeof s.range?s:g(t,B,s),i=F?F.range(t,+B+1):[];return Q?i.reverse():i},g]}Zl.every=t=>isFinite(t=Math.floor(t))&&t>0?OI(B=>{B.setUTCFullYear(Math.floor(B.getUTCFullYear()/t)*t),B.setUTCMonth(0,1),B.setUTCHours(0,0,0,0)},(B,s)=>{B.setUTCFullYear(B.getUTCFullYear()+s*t)}):null,Zl.range;const[El,Nl]=pl(Zl,Vl,hl,ll,gl,il),[Xl,Wl]=pl(Sl,ml,nl,el,Ul,Fl);function Hl(t){if(0<=t.y&&t.y<100){var B=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return B.setFullYear(t.y),B}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Dl(t){if(0<=t.y&&t.y<100){var B=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return B.setUTCFullYear(t.y),B}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function fl(t,B,s){return{y:t,m:B,d:s,H:0,M:0,S:0,L:0}}var wl,vl,Yl,Jl={"-":"",_:" ",0:"0"},kl=/^\s*\d+/,Ml=/^%/,Tl=/[\\^$*+?|[\]().{}]/g;function zl(t,B,s){var Q=t<0?"-":"",F=(Q?-t:t)+"",i=F.length;return Q+(i<s?new Array(s-i+1).join(B)+F:F)}function Kl(t){return t.replace(Tl,"\\$&")}function Ol(t){return new RegExp("^(?:"+t.map(Kl).join("|")+")","i")}function Pl(t){return new Map(t.map((t,B)=>[t.toLowerCase(),B]))}function jl(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.w=+Q[0],s+Q[0].length):-1}function _l(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.u=+Q[0],s+Q[0].length):-1}function $l(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.U=+Q[0],s+Q[0].length):-1}function ql(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.V=+Q[0],s+Q[0].length):-1}function tc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.W=+Q[0],s+Q[0].length):-1}function Bc(t,B,s){var Q=kl.exec(B.slice(s,s+4));return Q?(t.y=+Q[0],s+Q[0].length):-1}function sc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.y=+Q[0]+(+Q[0]>68?1900:2e3),s+Q[0].length):-1}function Qc(t,B,s){var Q=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(B.slice(s,s+6));return Q?(t.Z=Q[1]?0:-(Q[2]+(Q[3]||"00")),s+Q[0].length):-1}function Fc(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.q=3*Q[0]-3,s+Q[0].length):-1}function ic(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.m=Q[0]-1,s+Q[0].length):-1}function Uc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.d=+Q[0],s+Q[0].length):-1}function gc(t,B,s){var Q=kl.exec(B.slice(s,s+3));return Q?(t.m=0,t.d=+Q[0],s+Q[0].length):-1}function ec(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.H=+Q[0],s+Q[0].length):-1}function Ic(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.M=+Q[0],s+Q[0].length):-1}function lc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.S=+Q[0],s+Q[0].length):-1}function cc(t,B,s){var Q=kl.exec(B.slice(s,s+3));return Q?(t.L=+Q[0],s+Q[0].length):-1}function nc(t,B,s){var Q=kl.exec(B.slice(s,s+6));return Q?(t.L=Math.floor(Q[0]/1e3),s+Q[0].length):-1}function ac(t,B,s){var Q=Ml.exec(B.slice(s,s+1));return Q?s+Q[0].length:-1}function dc(t,B,s){var Q=kl.exec(B.slice(s));return Q?(t.Q=+Q[0],s+Q[0].length):-1}function oc(t,B,s){var Q=kl.exec(B.slice(s));return Q?(t.s=+Q[0],s+Q[0].length):-1}function bc(t,B){return zl(t.getDate(),B,2)}function Cc(t,B){return zl(t.getHours(),B,2)}function rc(t,B){return zl(t.getHours()%12||12,B,2)}function uc(t,B){return zl(1+el.count(Sl(t),t),B,3)}function hc(t,B){return zl(t.getMilliseconds(),B,3)}function xc(t,B){return hc(t,B)+"000"}function Gc(t,B){return zl(t.getMonth()+1,B,2)}function yc(t,B){return zl(t.getMinutes(),B,2)}function Ac(t,B){return zl(t.getSeconds(),B,2)}function Lc(t){var B=t.getDay();return 0===B?7:B}function Rc(t,B){return zl(nl.count(Sl(t)-1,t),B,2)}function mc(t){var B=t.getDay();return B>=4||0===B?bl(t):bl.ceil(t)}function Vc(t,B){return t=mc(t),zl(bl.count(Sl(t),t)+(4===Sl(t).getDay()),B,2)}function Sc(t){return t.getDay()}function Zc(t,B){return zl(al.count(Sl(t)-1,t),B,2)}function pc(t,B){return zl(t.getFullYear()%100,B,2)}function Ec(t,B){return zl((t=mc(t)).getFullYear()%100,B,2)}function Nc(t,B){return zl(t.getFullYear()%1e4,B,4)}function Xc(t,B){var s=t.getDay();return zl((t=s>=4||0===s?bl(t):bl.ceil(t)).getFullYear()%1e4,B,4)}function Wc(t){var B=t.getTimezoneOffset();return(B>0?"-":(B*=-1,"+"))+zl(B/60|0,"0",2)+zl(B%60,"0",2)}function Hc(t,B){return zl(t.getUTCDate(),B,2)}function Dc(t,B){return zl(t.getUTCHours(),B,2)}function fc(t,B){return zl(t.getUTCHours()%12||12,B,2)}function wc(t,B){return zl(1+Il.count(Zl(t),t),B,3)}function vc(t,B){return zl(t.getUTCMilliseconds(),B,3)}function Yc(t,B){return vc(t,B)+"000"}function Jc(t,B){return zl(t.getUTCMonth()+1,B,2)}function kc(t,B){return zl(t.getUTCMinutes(),B,2)}function Mc(t,B){return zl(t.getUTCSeconds(),B,2)}function Tc(t){var B=t.getUTCDay();return 0===B?7:B}function zc(t,B){return zl(hl.count(Zl(t)-1,t),B,2)}function Kc(t){var B=t.getUTCDay();return B>=4||0===B?Al(t):Al.ceil(t)}function Oc(t,B){return t=Kc(t),zl(Al.count(Zl(t),t)+(4===Zl(t).getUTCDay()),B,2)}function Pc(t){return t.getUTCDay()}function jc(t,B){return zl(xl.count(Zl(t)-1,t),B,2)}function _c(t,B){return zl(t.getUTCFullYear()%100,B,2)}function $c(t,B){return zl((t=Kc(t)).getUTCFullYear()%100,B,2)}function qc(t,B){return zl(t.getUTCFullYear()%1e4,B,4)}function tn(t,B){var s=t.getUTCDay();return zl((t=s>=4||0===s?Al(t):Al.ceil(t)).getUTCFullYear()%1e4,B,4)}function Bn(){return"+0000"}function sn(){return"%"}function Qn(t){return+t}function Fn(t){return Math.floor(+t/1e3)}function Un(t){return new Date(t)}function gn(t){return t instanceof Date?+t:+new Date(+t)}function en(t,B,s,Q,F,i,U,g,e,I){var l=xI(),c=l.invert,n=l.domain,a=I(".%L"),d=I(":%S"),o=I("%I:%M"),b=I("%I %p"),C=I("%a %d"),r=I("%b %d"),u=I("%B"),h=I("%Y");function x(t){return(e(t)<t?a:g(t)<t?d:U(t)<t?o:i(t)<t?b:Q(t)<t?F(t)<t?C:r:s(t)<t?u:h)(t)}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?n(Array.from(t,gn)):n().map(Un)},l.ticks=function(B){var s=n();return t(s[0],s[s.length-1],null==B?10:B)},l.tickFormat=function(t,B){return null==B?x:I(B)},l.nice=function(t){var s=n();return t&&"function"==typeof t.range||(t=B(s[0],s[s.length-1],null==t?10:t)),t?n(RI(s,t)):l},l.copy=function(){return uI(l,en(t,B,s,Q,F,i,U,g,e,I))},l}function In(t,B){return B.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ln(){var t,B,s,Q,F,i,U,g=0,e=.5,I=1,l=1,c=oI,n=!1;function a(t){return isNaN(t=+t)?U:(t=.5+((t=+i(t))-B)*(l*t<l*B?Q:F),c(n?Math.max(0,Math.min(1,t)):t))}function d(t){return function(B){var s,Q,F;return arguments.length?([s,Q,F]=B,c=vF(t,[s,Q,F]),a):[c(0),c(.5),c(1)]}}return a.domain=function(U){return arguments.length?([g,e,I]=U,t=i(g=+g),B=i(e=+e),s=i(I=+I),Q=t===B?0:.5/(B-t),F=B===s?0:.5/(s-B),l=B<t?-1:1,a):[g,e,I]},a.clamp=function(t){return arguments.length?(n=!!t,a):n},a.interpolator=function(t){return arguments.length?(c=t,a):c},a.range=d(mF),a.rangeRound=d(VF),a.unknown=function(t){return arguments.length?(U=t,a):U},function(U){return i=U,t=U(g),B=U(e),s=U(I),Q=t===B?0:.5/(B-t),F=B===s?0:.5/(s-B),l=B<t?-1:1,a}}function cn(){var t=yI(ln()(oI));return t.copy=function(){return In(t,cn())},gI.apply(t,arguments)}function nn(){var t=NI(ln()).domain([.1,1,10]);return t.copy=function(){return In(t,nn()).base(t.base())},gI.apply(t,arguments)}function an(){var t=DI(ln());return t.copy=function(){return In(t,an()).constant(t.constant())},gI.apply(t,arguments)}function dn(){var t=JI(ln());return t.copy=function(){return In(t,dn()).exponent(t.exponent())},gI.apply(t,arguments)}function on(t){for(var B=t.length/6|0,s=new Array(B),Q=0;Q<B;)s[Q]="#"+t.slice(6*Q,6*++Q);return s}!function(t){wl=function(t){var B=t.dateTime,s=t.date,Q=t.time,F=t.periods,i=t.days,U=t.shortDays,g=t.months,e=t.shortMonths,I=Ol(F),l=Pl(F),c=Ol(i),n=Pl(i),a=Ol(U),d=Pl(U),o=Ol(g),b=Pl(g),C=Ol(e),r=Pl(e),u={a:function(t){return U[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return e[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:null,d:bc,e:bc,f:xc,g:Ec,G:Xc,H:Cc,I:rc,j:uc,L:hc,m:Gc,M:yc,p:function(t){return F[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Qn,s:Fn,S:Ac,u:Lc,U:Rc,V:Vc,w:Sc,W:Zc,x:null,X:null,y:pc,Y:Nc,Z:Wc,"%":sn},h={a:function(t){return U[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return e[t.getUTCMonth()]},B:function(t){return g[t.getUTCMonth()]},c:null,d:Hc,e:Hc,f:Yc,g:$c,G:tn,H:Dc,I:fc,j:wc,L:vc,m:Jc,M:kc,p:function(t){return F[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Qn,s:Fn,S:Mc,u:Tc,U:zc,V:Oc,w:Pc,W:jc,x:null,X:null,y:_c,Y:qc,Z:Bn,"%":sn},x={a:function(t,B,s){var Q=a.exec(B.slice(s));return Q?(t.w=d.get(Q[0].toLowerCase()),s+Q[0].length):-1},A:function(t,B,s){var Q=c.exec(B.slice(s));return Q?(t.w=n.get(Q[0].toLowerCase()),s+Q[0].length):-1},b:function(t,B,s){var Q=C.exec(B.slice(s));return Q?(t.m=r.get(Q[0].toLowerCase()),s+Q[0].length):-1},B:function(t,B,s){var Q=o.exec(B.slice(s));return Q?(t.m=b.get(Q[0].toLowerCase()),s+Q[0].length):-1},c:function(t,s,Q){return A(t,B,s,Q)},d:Uc,e:Uc,f:nc,g:sc,G:Bc,H:ec,I:ec,j:gc,L:cc,m:ic,M:Ic,p:function(t,B,s){var Q=I.exec(B.slice(s));return Q?(t.p=l.get(Q[0].toLowerCase()),s+Q[0].length):-1},q:Fc,Q:dc,s:oc,S:lc,u:_l,U:$l,V:ql,w:jl,W:tc,x:function(t,B,Q){return A(t,s,B,Q)},X:function(t,B,s){return A(t,Q,B,s)},y:sc,Y:Bc,Z:Qc,"%":ac};function G(t,B){return function(s){var Q,F,i,U=[],g=-1,e=0,I=t.length;for(s instanceof Date||(s=new Date(+s));++g<I;)37===t.charCodeAt(g)&&(U.push(t.slice(e,g)),null!=(F=Jl[Q=t.charAt(++g)])?Q=t.charAt(++g):F="e"===Q?" ":"0",(i=B[Q])&&(Q=i(s,F)),U.push(Q),e=g+1);return U.push(t.slice(e,g)),U.join("")}}function y(t,B){return function(s){var Q,F,i=fl(1900,void 0,1);if(A(i,t,s+="",0)!=s.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(B&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(F=(Q=Dl(fl(i.y,0,1))).getUTCDay(),Q=F>4||0===F?xl.ceil(Q):xl(Q),Q=Il.offset(Q,7*(i.V-1)),i.y=Q.getUTCFullYear(),i.m=Q.getUTCMonth(),i.d=Q.getUTCDate()+(i.w+6)%7):(F=(Q=Hl(fl(i.y,0,1))).getDay(),Q=F>4||0===F?al.ceil(Q):al(Q),Q=el.offset(Q,7*(i.V-1)),i.y=Q.getFullYear(),i.m=Q.getMonth(),i.d=Q.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),F="Z"in i?Dl(fl(i.y,0,1)).getUTCDay():Hl(fl(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(F+5)%7:i.w+7*i.U-(F+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Dl(i)):Hl(i)}}function A(t,B,s,Q){for(var F,i,U=0,g=B.length,e=s.length;U<g;){if(Q>=e)return-1;if(37===(F=B.charCodeAt(U++))){if(F=B.charAt(U++),!(i=x[F in Jl?B.charAt(U++):F])||(Q=i(t,s,Q))<0)return-1}else if(F!=s.charCodeAt(Q++))return-1}return Q}return u.x=G(s,u),u.X=G(Q,u),u.c=G(B,u),h.x=G(s,h),h.X=G(Q,h),h.c=G(B,h),{format:function(t){var B=G(t+="",u);return B.toString=function(){return t},B},parse:function(t){var B=y(t+="",!1);return B.toString=function(){return t},B},utcFormat:function(t){var B=G(t+="",h);return B.toString=function(){return t},B},utcParse:function(t){var B=y(t+="",!0);return B.toString=function(){return t},B}}}(t),vl=wl.format,wl.parse,Yl=wl.utcFormat,wl.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var bn=on("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Cn=on("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),rn=on("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),un=on("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),hn=on("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),xn=on("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Gn=on("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),yn=on("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),An=on("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Ln=on("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Rn=on("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),mn=t=>rF(t[t.length-1]),Vn=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(on),Sn=mn(Vn),Zn=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(on),pn=mn(Zn),En=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(on),Nn=mn(En),Xn=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(on),Wn=mn(Xn),Hn=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(on),Dn=mn(Hn),fn=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(on),wn=mn(fn),vn=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(on),Yn=mn(vn),Jn=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(on),kn=mn(Jn),Mn=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(on),Tn=mn(Mn),zn=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(on),Kn=mn(zn),On=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(on),Pn=mn(On),jn=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(on),_n=mn(jn),$n=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(on),qn=mn($n),ta=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(on),Ba=mn(ta),sa=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(on),Qa=mn(sa),Fa=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(on),ia=mn(Fa),Ua=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(on),ga=mn(Ua),ea=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(on),Ia=mn(ea),la=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(on),ca=mn(la),na=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(on),aa=mn(na),da=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(on),oa=mn(da),ba=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(on),Ca=mn(ba),ra=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(on),ua=mn(ra),ha=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(on),xa=mn(ha),Ga=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(on),ya=mn(Ga),Aa=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(on),La=mn(Aa),Ra=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(on),ma=mn(Ra);function Va(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}var Sa=wF(IF(300,.5,0),IF(-240,.5,1)),Za=wF(IF(-100,.75,.35),IF(80,1.5,.8)),pa=wF(IF(260,.75,.35),IF(80,1.5,.8)),Ea=IF();function Na(t){(t<0||t>1)&&(t-=Math.floor(t));var B=Math.abs(t-.5);return Ea.h=360*t-100,Ea.s=1.5-1.5*B,Ea.l=.8-.9*B,Ea+""}var Xa=yQ(),Wa=Math.PI/3,Ha=2*Math.PI/3;function Da(t){var B;return t=(.5-t)*Math.PI,Xa.r=255*(B=Math.sin(t))*B,Xa.g=255*(B=Math.sin(t+Wa))*B,Xa.b=255*(B=Math.sin(t+Ha))*B,Xa+""}function fa(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function wa(t){var B=t.length;return function(s){return t[Math.max(0,Math.min(B-1,Math.floor(s*B)))]}}var va=wa(on("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ya=wa(on("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ja=wa(on("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ka=wa(on("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ma(t){return function(){return t}}const Ta=Math.abs,za=Math.atan2,Ka=Math.cos,Oa=Math.max,Pa=Math.min,ja=Math.sin,_a=Math.sqrt,$a=1e-12,qa=Math.PI,td=qa/2,Bd=2*qa;function sd(t){return t>=1?td:t<=-1?-td:Math.asin(t)}function Qd(t){let B=3;return t.digits=function(s){if(!arguments.length)return B;if(null==s)B=null;else{const t=Math.floor(s);if(!(t>=0))throw new RangeError(`invalid digits: ${s}`);B=t}return t},()=>new ki(B)}function Fd(t){return t.innerRadius}function id(t){return t.outerRadius}function Ud(t){return t.startAngle}function gd(t){return t.endAngle}function ed(t){return t&&t.padAngle}function Id(t,B,s,Q,F,i,U){var g=t-s,e=B-Q,I=(U?i:-i)/_a(g*g+e*e),l=I*e,c=-I*g,n=t+l,a=B+c,d=s+l,o=Q+c,b=(n+d)/2,C=(a+o)/2,r=d-n,u=o-a,h=r*r+u*u,x=F-i,G=n*o-d*a,y=(u<0?-1:1)*_a(Oa(0,x*x*h-G*G)),A=(G*u-r*y)/h,L=(-G*r-u*y)/h,R=(G*u+r*y)/h,m=(-G*r+u*y)/h,V=A-b,S=L-C,Z=R-b,p=m-C;return V*V+S*S>Z*Z+p*p&&(A=R,L=m),{cx:A,cy:L,x01:-l,y01:-c,x11:A*(F/x-1),y11:L*(F/x-1)}}function ld(){var t=Fd,B=id,s=Ma(0),Q=null,F=Ud,i=gd,U=ed,g=null,e=Qd(I);function I(){var I,l,c=+t.apply(this,arguments),n=+B.apply(this,arguments),a=F.apply(this,arguments)-td,d=i.apply(this,arguments)-td,o=Ta(d-a),b=d>a;if(g||(g=I=e()),n<c&&(l=n,n=c,c=l),n>$a)if(o>Bd-$a)g.moveTo(n*Ka(a),n*ja(a)),g.arc(0,0,n,a,d,!b),c>$a&&(g.moveTo(c*Ka(d),c*ja(d)),g.arc(0,0,c,d,a,b));else{var C,r,u=a,h=d,x=a,G=d,y=o,A=o,L=U.apply(this,arguments)/2,R=L>$a&&(Q?+Q.apply(this,arguments):_a(c*c+n*n)),m=Pa(Ta(n-c)/2,+s.apply(this,arguments)),V=m,S=m;if(R>$a){var Z=sd(R/c*ja(L)),p=sd(R/n*ja(L));(y-=2*Z)>$a?(x+=Z*=b?1:-1,G-=Z):(y=0,x=G=(a+d)/2),(A-=2*p)>$a?(u+=p*=b?1:-1,h-=p):(A=0,u=h=(a+d)/2)}var E=n*Ka(u),N=n*ja(u),X=c*Ka(G),W=c*ja(G);if(m>$a){var H,D=n*Ka(h),f=n*ja(h),w=c*Ka(x),v=c*ja(x);if(o<qa)if(H=function(t,B,s,Q,F,i,U,g){var e=s-t,I=Q-B,l=U-F,c=g-i,n=c*e-l*I;if(!(n*n<$a))return[t+(n=(l*(B-i)-c*(t-F))/n)*e,B+n*I]}(E,N,w,v,D,f,X,W)){var Y=E-H[0],J=N-H[1],k=D-H[0],M=f-H[1],T=1/ja(function(t){return t>1?0:t<-1?qa:Math.acos(t)}((Y*k+J*M)/(_a(Y*Y+J*J)*_a(k*k+M*M)))/2),z=_a(H[0]*H[0]+H[1]*H[1]);V=Pa(m,(c-z)/(T-1)),S=Pa(m,(n-z)/(T+1))}else V=S=0}A>$a?S>$a?(C=Id(w,v,E,N,n,S,b),r=Id(D,f,X,W,n,S,b),g.moveTo(C.cx+C.x01,C.cy+C.y01),S<m?g.arc(C.cx,C.cy,S,za(C.y01,C.x01),za(r.y01,r.x01),!b):(g.arc(C.cx,C.cy,S,za(C.y01,C.x01),za(C.y11,C.x11),!b),g.arc(0,0,n,za(C.cy+C.y11,C.cx+C.x11),za(r.cy+r.y11,r.cx+r.x11),!b),g.arc(r.cx,r.cy,S,za(r.y11,r.x11),za(r.y01,r.x01),!b))):(g.moveTo(E,N),g.arc(0,0,n,u,h,!b)):g.moveTo(E,N),c>$a&&y>$a?V>$a?(C=Id(X,W,D,f,c,-V,b),r=Id(E,N,w,v,c,-V,b),g.lineTo(C.cx+C.x01,C.cy+C.y01),V<m?g.arc(C.cx,C.cy,V,za(C.y01,C.x01),za(r.y01,r.x01),!b):(g.arc(C.cx,C.cy,V,za(C.y01,C.x01),za(C.y11,C.x11),!b),g.arc(0,0,c,za(C.cy+C.y11,C.cx+C.x11),za(r.cy+r.y11,r.cx+r.x11),b),g.arc(r.cx,r.cy,V,za(r.y11,r.x11),za(r.y01,r.x01),!b))):g.arc(0,0,c,G,x,b):g.lineTo(X,W)}else g.moveTo(0,0);if(g.closePath(),I)return g=null,I+""||null}return I.centroid=function(){var s=(+t.apply(this,arguments)+ +B.apply(this,arguments))/2,Q=(+F.apply(this,arguments)+ +i.apply(this,arguments))/2-qa/2;return[Ka(Q)*s,ja(Q)*s]},I.innerRadius=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),I):t},I.outerRadius=function(t){return arguments.length?(B="function"==typeof t?t:Ma(+t),I):B},I.cornerRadius=function(t){return arguments.length?(s="function"==typeof t?t:Ma(+t),I):s},I.padRadius=function(t){return arguments.length?(Q=null==t?null:"function"==typeof t?t:Ma(+t),I):Q},I.startAngle=function(t){return arguments.length?(F="function"==typeof t?t:Ma(+t),I):F},I.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ma(+t),I):i},I.padAngle=function(t){return arguments.length?(U="function"==typeof t?t:Ma(+t),I):U},I.context=function(t){return arguments.length?(g=null==t?null:t,I):g},I}function cd(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function nd(t){this._context=t}function ad(t){return new nd(t)}function dd(t){return t[0]}function od(t){return t[1]}function bd(t,B){var s=Ma(!0),Q=null,F=ad,i=null,U=Qd(g);function g(g){var e,I,l,c=(g=cd(g)).length,n=!1;for(null==Q&&(i=F(l=U())),e=0;e<=c;++e)!(e<c&&s(I=g[e],e,g))===n&&((n=!n)?i.lineStart():i.lineEnd()),n&&i.point(+t(I,e,g),+B(I,e,g));if(l)return i=null,l+""||null}return t="function"==typeof t?t:void 0===t?dd:Ma(t),B="function"==typeof B?B:void 0===B?od:Ma(B),g.x=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),g):t},g.y=function(t){return arguments.length?(B="function"==typeof t?t:Ma(+t),g):B},g.defined=function(t){return arguments.length?(s="function"==typeof t?t:Ma(!!t),g):s},g.curve=function(t){return arguments.length?(F=t,null!=Q&&(i=F(Q)),g):F},g.context=function(t){return arguments.length?(null==t?Q=i=null:i=F(Q=t),g):Q},g}function Cd(t,B){return B<t?-1:B>t?1:B>=t?0:NaN}function rd(t){return t}nd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:this._context.lineTo(t,B)}}};class ud{constructor(t,B){this._context=t,this._x=B}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,B,t,B):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+B)/2,t,this._y0,t,B)}this._x0=t,this._y0=B}}const hd=_a(3);var xd={draw(t,B){const s=.59436*_a(B+Pa(B/28,.75)),Q=s/2,F=Q*hd;t.moveTo(0,s),t.lineTo(0,-s),t.moveTo(-F,-Q),t.lineTo(F,Q),t.moveTo(-F,Q),t.lineTo(F,-Q)}},Gd={draw(t,B){const s=_a(B/qa);t.moveTo(s,0),t.arc(0,0,s,0,Bd)}},yd={draw(t,B){const s=_a(B/5)/2;t.moveTo(-3*s,-s),t.lineTo(-s,-s),t.lineTo(-s,-3*s),t.lineTo(s,-3*s),t.lineTo(s,-s),t.lineTo(3*s,-s),t.lineTo(3*s,s),t.lineTo(s,s),t.lineTo(s,3*s),t.lineTo(-s,3*s),t.lineTo(-s,s),t.lineTo(-3*s,s),t.closePath()}};const Ad=_a(1/3),Ld=2*Ad;var Rd={draw(t,B){const s=_a(B/Ld),Q=s*Ad;t.moveTo(0,-s),t.lineTo(Q,0),t.lineTo(0,s),t.lineTo(-Q,0),t.closePath()}},md={draw(t,B){const s=.62625*_a(B);t.moveTo(0,-s),t.lineTo(s,0),t.lineTo(0,s),t.lineTo(-s,0),t.closePath()}},Vd={draw(t,B){const s=.87559*_a(B-Pa(B/7,2));t.moveTo(-s,0),t.lineTo(s,0),t.moveTo(0,s),t.lineTo(0,-s)}},Sd={draw(t,B){const s=_a(B),Q=-s/2;t.rect(Q,Q,s,s)}},Zd={draw(t,B){const s=.4431*_a(B);t.moveTo(s,s),t.lineTo(s,-s),t.lineTo(-s,-s),t.lineTo(-s,s),t.closePath()}};const pd=ja(qa/10)/ja(7*qa/10),Ed=ja(Bd/10)*pd,Nd=-Ka(Bd/10)*pd;var Xd={draw(t,B){const s=_a(.8908130915292852*B),Q=Ed*s,F=Nd*s;t.moveTo(0,-s),t.lineTo(Q,F);for(let B=1;B<5;++B){const i=Bd*B/5,U=Ka(i),g=ja(i);t.lineTo(g*s,-U*s),t.lineTo(U*Q-g*F,g*Q+U*F)}t.closePath()}};const Wd=_a(3);var Hd={draw(t,B){const s=-_a(B/(3*Wd));t.moveTo(0,2*s),t.lineTo(-Wd*s,-s),t.lineTo(Wd*s,-s),t.closePath()}};const Dd=_a(3);var fd={draw(t,B){const s=.6824*_a(B),Q=s/2,F=s*Dd/2;t.moveTo(0,-s),t.lineTo(F,Q),t.lineTo(-F,Q),t.closePath()}};const wd=-.5,vd=_a(3)/2,Yd=1/_a(12),Jd=3*(Yd/2+1);var kd={draw(t,B){const s=_a(B/Jd),Q=s/2,F=s*Yd,i=Q,U=s*Yd+s,g=-i,e=U;t.moveTo(Q,F),t.lineTo(i,U),t.lineTo(g,e),t.lineTo(wd*Q-vd*F,vd*Q+wd*F),t.lineTo(wd*i-vd*U,vd*i+wd*U),t.lineTo(wd*g-vd*e,vd*g+wd*e),t.lineTo(wd*Q+vd*F,wd*F-vd*Q),t.lineTo(wd*i+vd*U,wd*U-vd*i),t.lineTo(wd*g+vd*e,wd*e-vd*g),t.closePath()}},Md={draw(t,B){const s=.6189*_a(B-Pa(B/6,1.7));t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(-s,s),t.lineTo(s,-s)}};const Td=[Gd,yd,Rd,Sd,Xd,Hd,kd],zd=[Gd,Vd,Md,fd,xd,Zd,md];function Kd(){}function Od(t,B,s){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+B)/6,(t._y0+4*t._y1+s)/6)}function Pd(t){this._context=t}function jd(t){this._context=t}function _d(t){this._context=t}function $d(t,B){this._basis=new Pd(t),this._beta=B}Pd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Od(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},jd.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._x2=t,this._y2=B;break;case 1:this._point=2,this._x3=t,this._y3=B;break;case 2:this._point=3,this._x4=t,this._y4=B,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+B)/6);break;default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},_d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var s=(this._x0+4*this._x1+t)/6,Q=(this._y0+4*this._y1+B)/6;this._line?this._context.lineTo(s,Q):this._context.moveTo(s,Q);break;case 3:this._point=4;default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},$d.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,B=this._y,s=t.length-1;if(s>0)for(var Q,F=t[0],i=B[0],U=t[s]-F,g=B[s]-i,e=-1;++e<=s;)Q=e/s,this._basis.point(this._beta*t[e]+(1-this._beta)*(F+Q*U),this._beta*B[e]+(1-this._beta)*(i+Q*g));this._x=this._y=null,this._basis.lineEnd()},point:function(t,B){this._x.push(+t),this._y.push(+B)}};var qd=function t(B){function s(t){return 1===B?new Pd(t):new $d(t,B)}return s.beta=function(B){return t(+B)},s}(.85);function to(t,B,s){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-B),t._y2+t._k*(t._y1-s),t._x2,t._y2)}function Bo(t,B){this._context=t,this._k=(1-B)/6}Bo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:to(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2,this._x1=t,this._y1=B;break;case 2:this._point=3;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var so=function t(B){function s(t){return new Bo(t,B)}return s.tension=function(B){return t(+B)},s}(0);function Qo(t,B){this._context=t,this._k=(1-B)/6}Qo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._x3=t,this._y3=B;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=B);break;case 2:this._point=3,this._x5=t,this._y5=B;break;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Fo=function t(B){function s(t){return new Qo(t,B)}return s.tension=function(B){return t(+B)},s}(0);function io(t,B){this._context=t,this._k=(1-B)/6}io.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Uo=function t(B){function s(t){return new io(t,B)}return s.tension=function(B){return t(+B)},s}(0);function go(t,B,s){var Q=t._x1,F=t._y1,i=t._x2,U=t._y2;if(t._l01_a>$a){var g=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,e=3*t._l01_a*(t._l01_a+t._l12_a);Q=(Q*g-t._x0*t._l12_2a+t._x2*t._l01_2a)/e,F=(F*g-t._y0*t._l12_2a+t._y2*t._l01_2a)/e}if(t._l23_a>$a){var I=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*I+t._x1*t._l23_2a-B*t._l12_2a)/l,U=(U*I+t._y1*t._l23_2a-s*t._l12_2a)/l}t._context.bezierCurveTo(Q,F,i,U,t._x2,t._y2)}function eo(t,B){this._context=t,this._alpha=B}eo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Io=function t(B){function s(t){return B?new eo(t,B):new Bo(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function lo(t,B){this._context=t,this._alpha=B}lo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=B;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=B);break;case 2:this._point=3,this._x5=t,this._y5=B;break;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var co=function t(B){function s(t){return B?new lo(t,B):new Qo(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function no(t,B){this._context=t,this._alpha=B}no.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var ao=function t(B){function s(t){return B?new no(t,B):new io(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function oo(t){this._context=t}function bo(t){return t<0?-1:1}function Co(t,B,s){var Q=t._x1-t._x0,F=B-t._x1,i=(t._y1-t._y0)/(Q||F<0&&-0),U=(s-t._y1)/(F||Q<0&&-0),g=(i*F+U*Q)/(Q+F);return(bo(i)+bo(U))*Math.min(Math.abs(i),Math.abs(U),.5*Math.abs(g))||0}function ro(t,B){var s=t._x1-t._x0;return s?(3*(t._y1-t._y0)/s-B)/2:B}function uo(t,B,s){var Q=t._x0,F=t._y0,i=t._x1,U=t._y1,g=(i-Q)/3;t._context.bezierCurveTo(Q+g,F+g*B,i-g,U-g*s,i,U)}function ho(t){this._context=t}function xo(t){this._context=new Go(t)}function Go(t){this._context=t}function yo(t){this._context=t}function Ao(t){var B,s,Q=t.length-1,F=new Array(Q),i=new Array(Q),U=new Array(Q);for(F[0]=0,i[0]=2,U[0]=t[0]+2*t[1],B=1;B<Q-1;++B)F[B]=1,i[B]=4,U[B]=4*t[B]+2*t[B+1];for(F[Q-1]=2,i[Q-1]=7,U[Q-1]=8*t[Q-1]+t[Q],B=1;B<Q;++B)s=F[B]/i[B-1],i[B]-=s,U[B]-=s*U[B-1];for(F[Q-1]=U[Q-1]/i[Q-1],B=Q-2;B>=0;--B)F[B]=(U[B]-F[B+1])/i[B];for(i[Q-1]=(t[Q]+F[Q-1])/2,B=0;B<Q-1;++B)i[B]=2*t[B+1]-F[B+1];return[F,i]}function Lo(t,B){this._context=t,this._t=B}function Ro(t,B,s){this.k=t,this.x=B,this.y=s}oo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,B){t=+t,B=+B,this._point?this._context.lineTo(t,B):(this._point=1,this._context.moveTo(t,B))}},ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:uo(this,this._t0,ro(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){var s=NaN;if(B=+B,(t=+t)!==this._x1||B!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3,uo(this,ro(this,s=Co(this,t,B)),s);break;default:uo(this,this._t0,s=Co(this,t,B))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B,this._t0=s}}},(xo.prototype=Object.create(ho.prototype)).point=function(t,B){ho.prototype.point.call(this,B,t)},Go.prototype={moveTo:function(t,B){this._context.moveTo(B,t)},closePath:function(){this._context.closePath()},lineTo:function(t,B){this._context.lineTo(B,t)},bezierCurveTo:function(t,B,s,Q,F,i){this._context.bezierCurveTo(B,t,Q,s,i,F)}},yo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,B=this._y,s=t.length;if(s)if(this._line?this._context.lineTo(t[0],B[0]):this._context.moveTo(t[0],B[0]),2===s)this._context.lineTo(t[1],B[1]);else for(var Q=Ao(t),F=Ao(B),i=0,U=1;U<s;++i,++U)this._context.bezierCurveTo(Q[0][i],F[0][i],Q[1][i],F[1][i],t[U],B[U]);(this._line||0!==this._line&&1===s)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,B){this._x.push(+t),this._y.push(+B)}},Lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,B),this._context.lineTo(t,B);else{var s=this._x*(1-this._t)+t*this._t;this._context.lineTo(s,this._y),this._context.lineTo(s,B)}}this._x=t,this._y=B}},Ro.prototype={constructor:Ro,scale:function(t){return 1===t?this:new Ro(this.k*t,this.x,this.y)},translate:function(t,B){return 0===t&0===B?this:new Ro(this.k,this.x+this.k*t,this.y+this.k*B)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Ro.prototype;class mo extends lt{getComputedStyleValue(t){return getComputedStyle(this).getPropertyValue(t).trim()}firstUpdated(t){super.firstUpdated(t),Js(this.renderRoot.host).classed("keyboard",!0).on("mousemove.keyboard touchstart.keyboard",t=>{Js(t.currentTarget.renderRoot.host).classed("keyboard",!1).on("mousemove.keyboard touchstart.keyboard",null)}).on("keydown.keyboard",t=>{Js(t.currentTarget.renderRoot.host).classed("keyboard",!0).on("keydown.keyboard mousemove.keyboard touchstart.keyboard",null)})}static get greys(){const t="#999999",B={white:"#ffffff"};return B.light75=bF(t,"#ffffff")(.75),B.light50=bF(t,"#ffffff")(.5),B.light25=bF(t,"#ffffff")(.25),B.grey=t,B.dark25=bF(t,"#000000")(.25),B.dark50=bF(t,"#000000")(.5),B.dark75=bF(t,"#000000")(.75),B.black="#000000",B}static get shadows(){return{elevations:[0,2,4,8,16],baselineColor:"#000000",baselineColorString:"0, 0, 0",inverseBaselineColor:"#FFFFFF",inverseBaselineColorString:"255, 255, 255",opacityUmbra:.2,opacityPenumbra:.14,opacityAmbient:.12,opacityBoost:.2,mapUmbra:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:3,b:1,s:-2},4:{x:0,y:2,b:4,s:-1},8:{x:0,y:5,b:5,s:-3},16:{x:0,y:8,b:10,s:-5}},mapPenumbra:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:2,b:2,s:0},4:{x:0,y:4,b:5,s:0},8:{x:0,y:8,b:10,s:1},16:{x:0,y:16,b:24,s:2}},mapAmbient:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:1,b:5,s:0},4:{x:0,y:1,b:10,s:0},8:{x:0,y:3,b:14,s:2},16:{x:0,y:6,b:30,s:5}}}}static cssBoxShadow(t,B=!1,s=!1){const Q=this.shadows.opacityUmbra+this.shadows.opacityBoost,F=this.shadows.opacityPenumbra+this.shadows.opacityBoost,i=this.shadows.opacityAmbient+this.shadows.opacityBoost,U=s?`rgba(${this.shadows.inverseBaselineColorString}, ${Q})`:`rgba(${this.shadows.baselineColorString}, ${Q})`,g=s?`rgba(${this.shadows.inverseBaselineColorString}, ${F})`:`rgba(${this.shadows.baselineColorString}, ${F})`,e=s?`rgba(${this.shadows.inverseBaselineColorString}, ${i})`:`rgba(${this.shadows.baselineColorString}, ${i})`,I=this.shadows.mapUmbra[t],l=this.shadows.mapPenumbra[t],c=this.shadows.mapAmbient[t];return`${B?`${-I.y}px ${I.y/2}px ${I.b}px ${I.s}px`:`${I.y/2}px ${I.y}px ${I.b}px ${I.s}px`} ${U}, ${B?`${-l.y}px ${l.y/2}px ${l.b}px ${l.s}px`:`${l.y/2}px ${l.y}px ${l.b}px ${l.s}px`} ${g}, ${B?`${-c.y}px ${c.y/2}px ${c.b}px ${c.s}px`:`${c.y/2}px ${c.y}px ${c.b}px ${c.s}px`} ${e}`}static get svgFilters(){const t=mo.shadows,B=t.elevations.map(B=>T`
|
|
22
|
+
*/let lt=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const B=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=et(B,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};lt._$litElement$=!0,lt.finalized=!0,It.litElementHydrateSupport?.({LitElement:lt});const ct=It.litElementPolyfillSupport;function nt(t,B){return null==t||null==B?NaN:t<B?-1:t>B?1:t>=B?0:NaN}function at(t,B){return null==t||null==B?NaN:B<t?-1:B>t?1:B>=t?0:NaN}function dt(t){let B,s,Q;function F(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<0?F=B+1:i=B}while(F<i)}return F}return 2!==t.length?(B=nt,s=(B,s)=>nt(t(B),s),Q=(B,s)=>t(B)-s):(B=t===nt||t===at?t:ot,s=t,Q=t),{left:F,center:function(t,B,s=0,i=t.length){const U=F(t,B,s,i-1);return U>s&&Q(t[U-1],B)>-Q(t[U],B)?U-1:U},right:function(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<=0?F=B+1:i=B}while(F<i)}return F}}}function ot(){return 0}function bt(t){return null===t?NaN:+t}ct?.({LitElement:lt}),(It.litElementVersions??=[]).push("4.2.1");const Ct=dt(nt).right;function rt(t,B){let s=0;for(let B of t)null!=B&&(B=+B)>=B&&++s;return s}function ut(t){return 0|t.length}function ht(t){return!(t>0)}function xt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function Gt(t,B){var s=0;return Float64Array.from(t,t=>s+=+t||0)}function yt(t,B){let s,Q=0,F=0,i=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(s=B-F,F+=s/++Q,i+=s*(B-F));else{let U=-1;for(let g of t)null!=(g=B(g,++U,t))&&(g=+g)>=g&&(s=g-F,F+=s/++Q,i+=s*(g-F))}if(Q>1)return i/(Q-1)}function At(t,B){const s=yt(t,B);return s?Math.sqrt(s):s}function Lt(t,B){let s,Q;if(void 0===B)for(const B of t)null!=B&&(void 0===s?B>=B&&(s=Q=B):(s>B&&(s=B),Q<B&&(Q=B)));else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(void 0===s?i>=i&&(s=Q=i):(s>i&&(s=i),Q<i&&(Q=i)))}return[s,Q]}dt(bt).center;class Rt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const B=this._partials;let s=0;for(let Q=0;Q<this._n&&Q<32;Q++){const F=B[Q],i=t+F,U=Math.abs(t)<Math.abs(F)?t-(i-F):F-(i-t);U&&(B[s++]=U),t=i}return B[s]=t,this._n=s+1,this}valueOf(){const t=this._partials;let B,s,Q,F=this._n,i=0;if(F>0){for(i=t[--F];F>0&&(B=i,s=t[--F],i=B+s,Q=s-(i-B),!Q););F>0&&(Q<0&&t[F-1]<0||Q>0&&t[F-1]>0)&&(s=2*Q,B=i+s,s==B-i&&(i=B))}return i}}class mt extends Map{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const[B,s]of t)this.set(B,s)}get(t){return super.get(St(this,t))}has(t){return super.has(St(this,t))}set(t,B){return super.set(Zt(this,t),B)}delete(t){return super.delete(pt(this,t))}}class Vt extends Set{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const B of t)this.add(B)}has(t){return super.has(St(this,t))}add(t){return super.add(Zt(this,t))}delete(t){return super.delete(pt(this,t))}}function St({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):s}function Zt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):(t.set(Q,s),s)}function pt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)&&(s=t.get(Q),t.delete(Q)),s}function Et(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Nt(t){return t}function Xt(t,...B){return Dt(t,Nt,Nt,B)}function Wt(t,B,...s){return Dt(t,Nt,B,s)}function Ht(t,B,...s){return Dt(t,Array.from,B,s)}function Dt(t,B,s,Q){return function t(F,i){if(i>=Q.length)return s(F);const U=new mt,g=Q[i++];let e=-1;for(const t of F){const B=g(t,++e,F),s=U.get(B);s?s.push(t):U.set(B,[t])}for(const[B,s]of U)U.set(B,t(s,i));return B(U)}(t,0)}function ft(t,...B){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[s]=B;if(s&&2!==s.length||B.length>1){const i=Uint32Array.from(t,(t,B)=>B);return B.length>1?(B=B.map(B=>t.map(B)),i.sort((t,s)=>{for(const Q of B){const B=vt(Q[t],Q[s]);if(B)return B}})):(s=t.map(s),i.sort((t,B)=>vt(s[t],s[B]))),Q=t,F=i,Array.from(F,t=>Q[t])}var Q,F;return t.sort(wt(s))}function wt(t=nt){if(t===nt)return vt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(B,s)=>{const Q=t(B,s);return Q||0===Q?Q:(0===t(s,s))-(0===t(B,B))}}function vt(t,B){return(null==t||!(t>=t))-(null==B||!(B>=B))||(t<B?-1:t>B?1:0)}function Yt(t,B,s){return(2!==B.length?ft(Wt(t,B,s),([t,B],[s,Q])=>nt(B,Q)||nt(t,s)):ft(Xt(t,s),([t,s],[Q,F])=>B(s,F)||nt(t,Q))).map(([t])=>t)}const Jt=Math.sqrt(50),kt=Math.sqrt(10),Mt=Math.sqrt(2);function Tt(t,B,s){const Q=(B-t)/Math.max(0,s),F=Math.floor(Math.log10(Q)),i=Q/Math.pow(10,F),U=i>=Jt?10:i>=kt?5:i>=Mt?2:1;let g,e,I;return F<0?(I=Math.pow(10,-F)/U,g=Math.round(t*I),e=Math.round(B*I),g/I<t&&++g,e/I>B&&--e,I=-I):(I=Math.pow(10,F)*U,g=Math.round(t/I),e=Math.round(B/I),g*I<t&&++g,e*I>B&&--e),e<g&&.5<=s&&s<2?Tt(t,B,2*s):[g,e,I]}function zt(t,B,s){if(!((s=+s)>0))return[];if((t=+t)===(B=+B))return[t];const Q=B<t,[F,i,U]=Q?Tt(B,t,s):Tt(t,B,s);if(!(i>=F))return[];const g=i-F+1,e=new Array(g);if(Q)if(U<0)for(let t=0;t<g;++t)e[t]=(i-t)/-U;else for(let t=0;t<g;++t)e[t]=(i-t)*U;else if(U<0)for(let t=0;t<g;++t)e[t]=(F+t)/-U;else for(let t=0;t<g;++t)e[t]=(F+t)*U;return e}function Kt(t,B,s){return Tt(t=+t,B=+B,s=+s)[2]}function Ot(t,B,s){s=+s;const Q=(B=+B)<(t=+t),F=Q?Kt(B,t,s):Kt(t,B,s);return(Q?-1:1)*(F<0?1/-F:F)}function Pt(t){return Math.max(1,Math.ceil(Math.log(rt(t))/Math.LN2)+1)}function jt(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s<B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s<F||void 0===s&&F>=F)&&(s=F)}return s}function _t(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s<B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s<i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function $t(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s>B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s>F||void 0===s&&F>=F)&&(s=F)}return s}function qt(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s>B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s>i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function tB(t,B,s=0,Q=1/0,F){if(B=Math.floor(B),s=Math.floor(Math.max(0,s)),Q=Math.floor(Math.min(t.length-1,Q)),!(s<=B&&B<=Q))return t;for(F=void 0===F?vt:wt(F);Q>s;){if(Q-s>600){const i=Q-s+1,U=B-s+1,g=Math.log(i),e=.5*Math.exp(2*g/3),I=.5*Math.sqrt(g*e*(i-e)/i)*(U-i/2<0?-1:1);tB(t,B,Math.max(s,Math.floor(B-U*e/i+I)),Math.min(Q,Math.floor(B+(i-U)*e/i+I)),F)}const i=t[B];let U=s,g=Q;for(BB(t,s,B),F(t[Q],i)>0&&BB(t,s,Q);U<g;){for(BB(t,U,g),++U,--g;F(t[U],i)<0;)++U;for(;F(t[g],i)>0;)--g}0===F(t[s],i)?BB(t,s,g):(++g,BB(t,g,Q)),g<=B&&(s=g+1),B<=g&&(Q=g-1)}return t}function BB(t,B,s){const Q=t[B];t[B]=t[s],t[s]=Q}function sB(t,B=nt){let s,Q=!1;if(1===B.length){let F;for(const i of t){const t=B(i);(Q?nt(t,F)>0:0===nt(t,t))&&(s=i,F=t,Q=!0)}}else for(const F of t)(Q?B(F,s)>0:0===B(F,F))&&(s=F,Q=!0);return s}function QB(t,B,s){if(t=Float64Array.from(function*(t,B){if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(yield B);else{let s=-1;for(let Q of t)null!=(Q=B(Q,++s,t))&&(Q=+Q)>=Q&&(yield Q)}}(t,s)),(Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return $t(t);if(B>=1)return jt(t);var Q,F=(Q-1)*B,i=Math.floor(F),U=jt(tB(t,i).subarray(0,i+1));return U+($t(t.subarray(i+1))-U)*(F-i)}}function FB(t,B,s=bt){if((Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return+s(t[0],0,t);if(B>=1)return+s(t[Q-1],Q-1,t);var Q,F=(Q-1)*B,i=Math.floor(F),U=+s(t[i],i,t);return U+(+s(t[i+1],i+1,t)-U)*(F-i)}}function iB(t,B,s){const Q=rt(t),F=QB(t,.75)-QB(t,.25);return Q&&F?Math.ceil((s-B)/(2*F*Math.pow(Q,-1/3))):1}function UB(t,B,s){const Q=rt(t),F=At(t);return Q&&F?Math.ceil((s-B)*Math.cbrt(Q)/(3.49*F)):1}function gB(t,B){let s=0,Q=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(++s,Q+=B);else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(i=+i)>=i&&(++s,Q+=i)}if(s)return Q/s}function eB(t,B){return QB(t,.5,B)}function IB(t){return Array.from(function*(t){for(const B of t)yield*B}(t))}function lB(t,B){const s=new mt;if(void 0===B)for(let B of t)null!=B&&B>=B&&s.set(B,(s.get(B)||0)+1);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&F>=F&&s.set(F,(s.get(F)||0)+1)}let Q,F=0;for(const[t,B]of s)B>F&&(F=B,Q=t);return Q}function cB(t,B){return[t,B]}function nB(t,B,s){t=+t,B=+B,s=(F=arguments.length)<2?(B=t,t=0,1):F<3?1:+s;for(var Q=-1,F=0|Math.max(0,Math.ceil((B-t)/s)),i=new Array(F);++Q<F;)i[Q]=t+Q*s;return i}function aB(t,B){let s=0;if(void 0===B)for(let B of t)(B=+B)&&(s+=B);else{let Q=-1;for(let F of t)(F=+B(F,++Q,t))&&(s+=F)}return s}function dB(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function oB(t){return t}var bB=1e-6;function CB(t){return"translate("+t+",0)"}function rB(t){return"translate(0,"+t+")"}function uB(t){return B=>+t(B)}function hB(t,B){return B=Math.max(0,t.bandwidth()-2*B)/2,t.round()&&(B=Math.round(B)),s=>+t(s)+B}function xB(){return!this.__axis}function GB(t,B){var s=[],Q=null,F=null,i=6,U=6,g=3,e="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,I=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",c=1===t||3===t?CB:rB;function n(n){var a=null==Q?B.ticks?B.ticks.apply(B,s):B.domain():Q,d=null==F?B.tickFormat?B.tickFormat.apply(B,s):oB:F,o=Math.max(i,0)+g,b=B.range(),C=+b[0]+e,r=+b[b.length-1]+e,u=(B.bandwidth?hB:uB)(B.copy(),e),h=n.selection?n.selection():n,x=h.selectAll(".domain").data([null]),G=h.selectAll(".tick").data(a,B).order(),y=G.exit(),A=G.enter().append("g").attr("class","tick"),L=G.select("line"),R=G.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),G=G.merge(A),L=L.merge(A.append("line").attr("stroke","currentColor").attr(l+"2",I*i)),R=R.merge(A.append("text").attr("fill","currentColor").attr(l,I*o).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),n!==h&&(x=x.transition(n),G=G.transition(n),L=L.transition(n),R=R.transition(n),y=y.transition(n).attr("opacity",bB).attr("transform",function(t){return isFinite(t=u(t))?c(t+e):this.getAttribute("transform")}),A.attr("opacity",bB).attr("transform",function(t){var B=this.parentNode.__axis;return c((B&&isFinite(B=B(t))?B:u(t))+e)})),y.remove(),x.attr("d",4===t||2===t?U?"M"+I*U+","+C+"H"+e+"V"+r+"H"+I*U:"M"+e+","+C+"V"+r:U?"M"+C+","+I*U+"V"+e+"H"+r+"V"+I*U:"M"+C+","+e+"H"+r),G.attr("opacity",1).attr("transform",function(t){return c(u(t)+e)}),L.attr(l+"2",I*i),R.attr(l,I*o).text(d),h.filter(xB).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),h.each(function(){this.__axis=u})}return n.scale=function(t){return arguments.length?(B=t,n):B},n.ticks=function(){return s=Array.from(arguments),n},n.tickArguments=function(t){return arguments.length?(s=null==t?[]:Array.from(t),n):s.slice()},n.tickValues=function(t){return arguments.length?(Q=null==t?null:Array.from(t),n):Q&&Q.slice()},n.tickFormat=function(t){return arguments.length?(F=t,n):F},n.tickSize=function(t){return arguments.length?(i=U=+t,n):i},n.tickSizeInner=function(t){return arguments.length?(i=+t,n):i},n.tickSizeOuter=function(t){return arguments.length?(U=+t,n):U},n.tickPadding=function(t){return arguments.length?(g=+t,n):g},n.offset=function(t){return arguments.length?(e=+t,n):e},n}function yB(t){return GB(3,t)}function AB(t){return GB(4,t)}var LB={value:()=>{}};function RB(){for(var t,B=0,s=arguments.length,Q={};B<s;++B){if(!(t=arguments[B]+"")||t in Q||/[\s.]/.test(t))throw new Error("illegal type: "+t);Q[t]=[]}return new mB(Q)}function mB(t){this._=t}function VB(t,B){for(var s,Q=0,F=t.length;Q<F;++Q)if((s=t[Q]).name===B)return s.value}function SB(t,B,s){for(var Q=0,F=t.length;Q<F;++Q)if(t[Q].name===B){t[Q]=LB,t=t.slice(0,Q).concat(t.slice(Q+1));break}return null!=s&&t.push({name:B,value:s}),t}mB.prototype=RB.prototype={constructor:mB,on:function(t,B){var s,Q,F=this._,i=(Q=F,(t+"").trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");if(s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),t&&!Q.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:B}})),U=-1,g=i.length;if(!(arguments.length<2)){if(null!=B&&"function"!=typeof B)throw new Error("invalid callback: "+B);for(;++U<g;)if(s=(t=i[U]).type)F[s]=SB(F[s],t.name,B);else if(null==B)for(s in F)F[s]=SB(F[s],t.name,null);return this}for(;++U<g;)if((s=(t=i[U]).type)&&(s=VB(F[s],t.name)))return s},copy:function(){var t={},B=this._;for(var s in B)t[s]=B[s].slice();return new mB(t)},call:function(t,B){if((s=arguments.length-2)>0)for(var s,Q,F=new Array(s),i=0;i<s;++i)F[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,s=(Q=this._[t]).length;i<s;++i)Q[i].value.apply(B,F)},apply:function(t,B,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var Q=this._[t],F=0,i=Q.length;F<i;++F)Q[F].value.apply(B,s)}};var ZB="http://www.w3.org/1999/xhtml",pB={svg:"http://www.w3.org/2000/svg",xhtml:ZB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function EB(t){var B=t+="",s=B.indexOf(":");return s>=0&&"xmlns"!==(B=t.slice(0,s))&&(t=t.slice(s+1)),pB.hasOwnProperty(B)?{space:pB[B],local:t}:t}function NB(t){return function(){var B=this.ownerDocument,s=this.namespaceURI;return s===ZB&&B.documentElement.namespaceURI===ZB?B.createElement(t):B.createElementNS(s,t)}}function XB(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function WB(t){var B=EB(t);return(B.local?XB:NB)(B)}function HB(){}function DB(t){return null==t?HB:function(){return this.querySelector(t)}}function fB(){return[]}function wB(t){return null==t?fB:function(){return this.querySelectorAll(t)}}function vB(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function YB(t){return function(){return this.matches(t)}}function JB(t){return function(B){return B.matches(t)}}var kB=Array.prototype.find;function MB(){return this.firstElementChild}var TB=Array.prototype.filter;function zB(){return Array.from(this.children)}function KB(t){return new Array(t.length)}function OB(t,B){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=B}function PB(t,B,s,Q,F,i){for(var U,g=0,e=B.length,I=i.length;g<I;++g)(U=B[g])?(U.__data__=i[g],Q[g]=U):s[g]=new OB(t,i[g]);for(;g<e;++g)(U=B[g])&&(F[g]=U)}function jB(t,B,s,Q,F,i,U){var g,e,I,l=new Map,c=B.length,n=i.length,a=new Array(c);for(g=0;g<c;++g)(e=B[g])&&(a[g]=I=U.call(e,e.__data__,g,B)+"",l.has(I)?F[g]=e:l.set(I,e));for(g=0;g<n;++g)I=U.call(t,i[g],g,i)+"",(e=l.get(I))?(Q[g]=e,e.__data__=i[g],l.delete(I)):s[g]=new OB(t,i[g]);for(g=0;g<c;++g)(e=B[g])&&l.get(a[g])===e&&(F[g]=e)}function _B(t){return t.__data__}function $B(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function qB(t,B){return t<B?-1:t>B?1:t>=B?0:NaN}function ts(t){return function(){this.removeAttribute(t)}}function Bs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ss(t,B){return function(){this.setAttribute(t,B)}}function Qs(t,B){return function(){this.setAttributeNS(t.space,t.local,B)}}function Fs(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttribute(t):this.setAttribute(t,s)}}function is(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function Us(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function gs(t){return function(){this.style.removeProperty(t)}}function es(t,B,s){return function(){this.style.setProperty(t,B,s)}}function Is(t,B,s){return function(){var Q=B.apply(this,arguments);null==Q?this.style.removeProperty(t):this.style.setProperty(t,Q,s)}}function ls(t,B){return t.style.getPropertyValue(B)||Us(t).getComputedStyle(t,null).getPropertyValue(B)}function cs(t){return function(){delete this[t]}}function ns(t,B){return function(){this[t]=B}}function as(t,B){return function(){var s=B.apply(this,arguments);null==s?delete this[t]:this[t]=s}}function ds(t){return t.trim().split(/^|\s+/)}function os(t){return t.classList||new bs(t)}function bs(t){this._node=t,this._names=ds(t.getAttribute("class")||"")}function Cs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.add(B[Q])}function rs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.remove(B[Q])}function us(t){return function(){Cs(this,t)}}function hs(t){return function(){rs(this,t)}}function xs(t,B){return function(){(B.apply(this,arguments)?Cs:rs)(this,t)}}function Gs(){this.textContent=""}function ys(t){return function(){this.textContent=t}}function As(t){return function(){var B=t.apply(this,arguments);this.textContent=null==B?"":B}}function Ls(){this.innerHTML=""}function Rs(t){return function(){this.innerHTML=t}}function ms(t){return function(){var B=t.apply(this,arguments);this.innerHTML=null==B?"":B}}function Vs(){this.nextSibling&&this.parentNode.appendChild(this)}function Ss(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zs(){return null}function ps(){var t=this.parentNode;t&&t.removeChild(this)}function Es(){var t=this.cloneNode(!1),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Ns(){var t=this.cloneNode(!0),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Xs(t){return function(){var B=this.__on;if(B){for(var s,Q=0,F=-1,i=B.length;Q<i;++Q)s=B[Q],t.type&&s.type!==t.type||s.name!==t.name?B[++F]=s:this.removeEventListener(s.type,s.listener,s.options);++F?B.length=F:delete this.__on}}}function Ws(t,B,s){return function(){var Q,F=this.__on,i=function(t){return function(B){t.call(this,B,this.__data__)}}(B);if(F)for(var U=0,g=F.length;U<g;++U)if((Q=F[U]).type===t.type&&Q.name===t.name)return this.removeEventListener(Q.type,Q.listener,Q.options),this.addEventListener(Q.type,Q.listener=i,Q.options=s),void(Q.value=B);this.addEventListener(t.type,i,s),Q={type:t.type,name:t.name,value:B,listener:i,options:s},F?F.push(Q):this.__on=[Q]}}function Hs(t,B,s){var Q=Us(t),F=Q.CustomEvent;"function"==typeof F?F=new F(B,s):(F=Q.document.createEvent("Event"),s?(F.initEvent(B,s.bubbles,s.cancelable),F.detail=s.detail):F.initEvent(B,!1,!1)),t.dispatchEvent(F)}function Ds(t,B){return function(){return Hs(this,t,B)}}function fs(t,B){return function(){return Hs(this,t,B.apply(this,arguments))}}OB.prototype={constructor:OB,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,B){return this._parent.insertBefore(t,B)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},bs.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var B=this._names.indexOf(t);B>=0&&(this._names.splice(B,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ws=[null];function vs(t,B){this._groups=t,this._parents=B}function Ys(){return new vs([[document.documentElement]],ws)}function Js(t){return"string"==typeof t?new vs([[document.querySelector(t)]],[document.documentElement]):new vs([[t]],ws)}function ks(t,B){if(t=function(t){let B;for(;B=t.sourceEvent;)t=B;return t}(t),void 0===B&&(B=t.currentTarget),B){var s=B.ownerSVGElement||B;if(s.createSVGPoint){var Q=s.createSVGPoint();return Q.x=t.clientX,Q.y=t.clientY,[(Q=Q.matrixTransform(B.getScreenCTM().inverse())).x,Q.y]}if(B.getBoundingClientRect){var F=B.getBoundingClientRect();return[t.clientX-F.left-B.clientLeft,t.clientY-F.top-B.clientTop]}}return[t.pageX,t.pageY]}vs.prototype=Ys.prototype={constructor:vs,select:function(t){"function"!=typeof t&&(t=DB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U,g=B[F],e=g.length,I=Q[F]=new Array(e),l=0;l<e;++l)(i=g[l])&&(U=t.call(i,i.__data__,l,g))&&("__data__"in i&&(U.__data__=i.__data__),I[l]=U);return new vs(Q,this._parents)},selectAll:function(t){t="function"==typeof t?vB(t):wB(t);for(var B=this._groups,s=B.length,Q=[],F=[],i=0;i<s;++i)for(var U,g=B[i],e=g.length,I=0;I<e;++I)(U=g[I])&&(Q.push(t.call(U,U.__data__,I,g)),F.push(U));return new vs(Q,F)},selectChild:function(t){return this.select(null==t?MB:function(t){return function(){return kB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},selectChildren:function(t){return this.selectAll(null==t?zB:function(t){return function(){return TB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},filter:function(t){"function"!=typeof t&&(t=YB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new vs(Q,this._parents)},data:function(t,B){if(!arguments.length)return Array.from(this,_B);var s=B?jB:PB,Q=this._parents,F=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var i=F.length,U=new Array(i),g=new Array(i),e=new Array(i),I=0;I<i;++I){var l=Q[I],c=F[I],n=c.length,a=$B(t.call(l,l&&l.__data__,I,Q)),d=a.length,o=g[I]=new Array(d),b=U[I]=new Array(d);s(l,c,o,b,e[I]=new Array(n),a,B);for(var C,r,u=0,h=0;u<d;++u)if(C=o[u]){for(u>=h&&(h=u+1);!(r=b[h])&&++h<d;);C._next=r||null}}return(U=new vs(U,Q))._enter=g,U._exit=e,U},enter:function(){return new vs(this._enter||this._groups.map(KB),this._parents)},exit:function(){return new vs(this._exit||this._groups.map(KB),this._parents)},join:function(t,B,s){var Q=this.enter(),F=this,i=this.exit();return"function"==typeof t?(Q=t(Q))&&(Q=Q.selection()):Q=Q.append(t+""),null!=B&&(F=B(F))&&(F=F.selection()),null==s?i.remove():s(i),Q&&F?Q.merge(F).order():F},merge:function(t){for(var B=t.selection?t.selection():t,s=this._groups,Q=B._groups,F=s.length,i=Q.length,U=Math.min(F,i),g=new Array(F),e=0;e<U;++e)for(var I,l=s[e],c=Q[e],n=l.length,a=g[e]=new Array(n),d=0;d<n;++d)(I=l[d]||c[d])&&(a[d]=I);for(;e<F;++e)g[e]=s[e];return new vs(g,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,B=-1,s=t.length;++B<s;)for(var Q,F=t[B],i=F.length-1,U=F[i];--i>=0;)(Q=F[i])&&(U&&4^Q.compareDocumentPosition(U)&&U.parentNode.insertBefore(Q,U),U=Q);return this},sort:function(t){function B(B,s){return B&&s?t(B.__data__,s.__data__):!B-!s}t||(t=qB);for(var s=this._groups,Q=s.length,F=new Array(Q),i=0;i<Q;++i){for(var U,g=s[i],e=g.length,I=F[i]=new Array(e),l=0;l<e;++l)(U=g[l])&&(I[l]=U);I.sort(B)}return new vs(F,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q=t[B],F=0,i=Q.length;F<i;++F){var U=Q[F];if(U)return U}return null},size:function(){let t=0;for(const B of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var B=this._groups,s=0,Q=B.length;s<Q;++s)for(var F,i=B[s],U=0,g=i.length;U<g;++U)(F=i[U])&&t.call(F,F.__data__,U,i);return this},attr:function(t,B){var s=EB(t);if(arguments.length<2){var Q=this.node();return s.local?Q.getAttributeNS(s.space,s.local):Q.getAttribute(s)}return this.each((null==B?s.local?Bs:ts:"function"==typeof B?s.local?is:Fs:s.local?Qs:ss)(s,B))},style:function(t,B,s){return arguments.length>1?this.each((null==B?gs:"function"==typeof B?Is:es)(t,B,null==s?"":s)):ls(this.node(),t)},property:function(t,B){return arguments.length>1?this.each((null==B?cs:"function"==typeof B?as:ns)(t,B)):this.node()[t]},classed:function(t,B){var s=ds(t+"");if(arguments.length<2){for(var Q=os(this.node()),F=-1,i=s.length;++F<i;)if(!Q.contains(s[F]))return!1;return!0}return this.each(("function"==typeof B?xs:B?us:hs)(s,B))},text:function(t){return arguments.length?this.each(null==t?Gs:("function"==typeof t?As:ys)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Ls:("function"==typeof t?ms:Rs)(t)):this.node().innerHTML},raise:function(){return this.each(Vs)},lower:function(){return this.each(Ss)},append:function(t){var B="function"==typeof t?t:WB(t);return this.select(function(){return this.appendChild(B.apply(this,arguments))})},insert:function(t,B){var s="function"==typeof t?t:WB(t),Q=null==B?Zs:"function"==typeof B?B:DB(B);return this.select(function(){return this.insertBefore(s.apply(this,arguments),Q.apply(this,arguments)||null)})},remove:function(){return this.each(ps)},clone:function(t){return this.select(t?Ns:Es)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,B,s){var Q,F,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");return s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),{type:t,name:B}})}(t+""),U=i.length;if(!(arguments.length<2)){for(g=B?Ws:Xs,Q=0;Q<U;++Q)this.each(g(i[Q],B,s));return this}var g=this.node().__on;if(g)for(var e,I=0,l=g.length;I<l;++I)for(Q=0,e=g[I];Q<U;++Q)if((F=i[Q]).type===e.type&&F.name===e.name)return e.value},dispatch:function(t,B){return this.each(("function"==typeof B?fs:Ds)(t,B))},[Symbol.iterator]:function*(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q,F=t[B],i=0,U=F.length;i<U;++i)(Q=F[i])&&(yield Q)}};const Ms={passive:!1},Ts={capture:!0,passive:!1};function zs(t){t.stopImmediatePropagation()}function Ks(t){t.preventDefault(),t.stopImmediatePropagation()}var Os=t=>()=>t;function Ps(t,{sourceEvent:B,subject:s,target:Q,identifier:F,active:i,x:U,y:g,dx:e,dy:I,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:B,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:Q,enumerable:!0,configurable:!0},identifier:{value:F,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:U,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:e,enumerable:!0,configurable:!0},dy:{value:I,enumerable:!0,configurable:!0},_:{value:l}})}function js(t){return!t.ctrlKey&&!t.button}function _s(){return this.parentNode}function $s(t,B){return null==B?{x:t.x,y:t.y}:B}function qs(){return navigator.maxTouchPoints||"ontouchstart"in this}function tQ(){var t,B,s,Q,F=js,i=_s,U=$s,g=qs,e={},I=RB("start","drag","end"),l=0,c=0;function n(t){t.on("mousedown.drag",a).filter(g).on("touchstart.drag",b).on("touchmove.drag",C,Ms).on("touchend.drag touchcancel.drag",r).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function a(U,g){if(!Q&&F.call(this,U,g)){var e=u(this,i.call(this,U,g),U,g,"mouse");e&&(Js(U.view).on("mousemove.drag",d,Ts).on("mouseup.drag",o,Ts),function(t){var B=t.document.documentElement,s=Js(t).on("dragstart.drag",Ks,Ts);"onselectstart"in B?s.on("selectstart.drag",Ks,Ts):(B.__noselect=B.style.MozUserSelect,B.style.MozUserSelect="none")}(U.view),zs(U),s=!1,t=U.clientX,B=U.clientY,e("start",U))}}function d(Q){if(Ks(Q),!s){var F=Q.clientX-t,i=Q.clientY-B;s=F*F+i*i>c}e.mouse("drag",Q)}function o(t){Js(t.view).on("mousemove.drag mouseup.drag",null),function(t,B){var s=t.document.documentElement,Q=Js(t).on("dragstart.drag",null);B&&(Q.on("click.drag",Ks,Ts),setTimeout(function(){Q.on("click.drag",null)},0)),"onselectstart"in s?Q.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}(t.view,s),Ks(t),e.mouse("end",t)}function b(t,B){if(F.call(this,t,B)){var s,Q,U=t.changedTouches,g=i.call(this,t,B),e=U.length;for(s=0;s<e;++s)(Q=u(this,g,t,B,U[s].identifier,U[s]))&&(zs(t),Q("start",t,U[s]))}}function C(t){var B,s,Q=t.changedTouches,F=Q.length;for(B=0;B<F;++B)(s=e[Q[B].identifier])&&(Ks(t),s("drag",t,Q[B]))}function r(t){var B,s,F=t.changedTouches,i=F.length;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),B=0;B<i;++B)(s=e[F[B].identifier])&&(zs(t),s("end",t,F[B]))}function u(t,B,s,Q,F,i){var g,c,a,d=I.copy(),o=ks(i||s,B);if(null!=(a=U.call(t,new Ps("beforestart",{sourceEvent:s,target:n,identifier:F,active:l,x:o[0],y:o[1],dx:0,dy:0,dispatch:d}),Q)))return g=a.x-o[0]||0,c=a.y-o[1]||0,function s(i,U,I){var b,C=o;switch(i){case"start":e[F]=s,b=l++;break;case"end":delete e[F],--l;case"drag":o=ks(I||U,B),b=l}d.call(i,t,new Ps(i,{sourceEvent:U,subject:a,target:n,identifier:F,active:b,x:o[0]+g,y:o[1]+c,dx:o[0]-C[0],dy:o[1]-C[1],dispatch:d}),Q)}}return n.filter=function(t){return arguments.length?(F="function"==typeof t?t:Os(!!t),n):F},n.container=function(t){return arguments.length?(i="function"==typeof t?t:Os(t),n):i},n.subject=function(t){return arguments.length?(U="function"==typeof t?t:Os(t),n):U},n.touchable=function(t){return arguments.length?(g="function"==typeof t?t:Os(!!t),n):g},n.on=function(){var t=I.on.apply(I,arguments);return t===I?n:t},n.clickDistance=function(t){return arguments.length?(c=(t=+t)*t,n):Math.sqrt(c)},n}function BQ(t,B,s){t.prototype=B.prototype=s,s.constructor=t}function sQ(t,B){var s=Object.create(t.prototype);for(var Q in B)s[Q]=B[Q];return s}function QQ(){}Ps.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var FQ=.7,iQ=1/FQ,UQ="\\s*([+-]?\\d+)\\s*",gQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IQ=/^#([0-9a-f]{3,8})$/,lQ=new RegExp(`^rgb\\(${UQ},${UQ},${UQ}\\)$`),cQ=new RegExp(`^rgb\\(${eQ},${eQ},${eQ}\\)$`),nQ=new RegExp(`^rgba\\(${UQ},${UQ},${UQ},${gQ}\\)$`),aQ=new RegExp(`^rgba\\(${eQ},${eQ},${eQ},${gQ}\\)$`),dQ=new RegExp(`^hsl\\(${gQ},${eQ},${eQ}\\)$`),oQ=new RegExp(`^hsla\\(${gQ},${eQ},${eQ},${gQ}\\)$`),bQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function CQ(){return this.rgb().formatHex()}function rQ(){return this.rgb().formatRgb()}function uQ(t){var B,s;return t=(t+"").trim().toLowerCase(),(B=IQ.exec(t))?(s=B[1].length,B=parseInt(B[1],16),6===s?hQ(B):3===s?new AQ(B>>8&15|B>>4&240,B>>4&15|240&B,(15&B)<<4|15&B,1):8===s?xQ(B>>24&255,B>>16&255,B>>8&255,(255&B)/255):4===s?xQ(B>>12&15|B>>8&240,B>>8&15|B>>4&240,B>>4&15|240&B,((15&B)<<4|15&B)/255):null):(B=lQ.exec(t))?new AQ(B[1],B[2],B[3],1):(B=cQ.exec(t))?new AQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,1):(B=nQ.exec(t))?xQ(B[1],B[2],B[3],B[4]):(B=aQ.exec(t))?xQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,B[4]):(B=dQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,1):(B=oQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,B[4]):bQ.hasOwnProperty(t)?hQ(bQ[t]):"transparent"===t?new AQ(NaN,NaN,NaN,0):null}function hQ(t){return new AQ(t>>16&255,t>>8&255,255&t,1)}function xQ(t,B,s,Q){return Q<=0&&(t=B=s=NaN),new AQ(t,B,s,Q)}function GQ(t){return t instanceof QQ||(t=uQ(t)),t?new AQ((t=t.rgb()).r,t.g,t.b,t.opacity):new AQ}function yQ(t,B,s,Q){return 1===arguments.length?GQ(t):new AQ(t,B,s,null==Q?1:Q)}function AQ(t,B,s,Q){this.r=+t,this.g=+B,this.b=+s,this.opacity=+Q}function LQ(){return`#${SQ(this.r)}${SQ(this.g)}${SQ(this.b)}`}function RQ(){const t=mQ(this.opacity);return`${1===t?"rgb(":"rgba("}${VQ(this.r)}, ${VQ(this.g)}, ${VQ(this.b)}${1===t?")":`, ${t})`}`}function mQ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function VQ(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function SQ(t){return((t=VQ(t))<16?"0":"")+t.toString(16)}function ZQ(t,B,s,Q){return Q<=0?t=B=s=NaN:s<=0||s>=1?t=B=NaN:B<=0&&(t=NaN),new NQ(t,B,s,Q)}function pQ(t){if(t instanceof NQ)return new NQ(t.h,t.s,t.l,t.opacity);if(t instanceof QQ||(t=uQ(t)),!t)return new NQ;if(t instanceof NQ)return t;var B=(t=t.rgb()).r/255,s=t.g/255,Q=t.b/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=NaN,g=i-F,e=(i+F)/2;return g?(U=B===i?(s-Q)/g+6*(s<Q):s===i?(Q-B)/g+2:(B-s)/g+4,g/=e<.5?i+F:2-i-F,U*=60):g=e>0&&e<1?0:U,new NQ(U,g,e,t.opacity)}function EQ(t,B,s,Q){return 1===arguments.length?pQ(t):new NQ(t,B,s,null==Q?1:Q)}function NQ(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}function XQ(t){return(t=(t||0)%360)<0?t+360:t}function WQ(t){return Math.max(0,Math.min(1,t||0))}function HQ(t,B,s){return 255*(t<60?B+(s-B)*t/60:t<180?s:t<240?B+(s-B)*(240-t)/60:B)}BQ(QQ,uQ,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:CQ,formatHex:CQ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return pQ(this).formatHsl()},formatRgb:rQ,toString:rQ}),BQ(AQ,yQ,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new AQ(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new AQ(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new AQ(VQ(this.r),VQ(this.g),VQ(this.b),mQ(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:LQ,formatHex:LQ,formatHex8:function(){return`#${SQ(this.r)}${SQ(this.g)}${SQ(this.b)}${SQ(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:RQ,toString:RQ})),BQ(NQ,EQ,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new NQ(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new NQ(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),B=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,Q=s+(s<.5?s:1-s)*B,F=2*s-Q;return new AQ(HQ(t>=240?t-240:t+120,F,Q),HQ(t,F,Q),HQ(t<120?t+240:t-120,F,Q),this.opacity)},clamp(){return new NQ(XQ(this.h),WQ(this.s),WQ(this.l),mQ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=mQ(this.opacity);return`${1===t?"hsl(":"hsla("}${XQ(this.h)}, ${100*WQ(this.s)}%, ${100*WQ(this.l)}%${1===t?")":`, ${t})`}`}}));const DQ=Math.PI/180,fQ=180/Math.PI,wQ=.96422,vQ=.82521,YQ=4/29,JQ=6/29,kQ=3*JQ*JQ,MQ=JQ*JQ*JQ;function TQ(t){if(t instanceof KQ)return new KQ(t.l,t.a,t.b,t.opacity);if(t instanceof qQ)return tF(t);t instanceof AQ||(t=GQ(t));var B,s,Q=_Q(t.r),F=_Q(t.g),i=_Q(t.b),U=OQ((.2225045*Q+.7168786*F+.0606169*i)/1);return Q===F&&F===i?B=s=U:(B=OQ((.4360747*Q+.3850649*F+.1430804*i)/wQ),s=OQ((.0139322*Q+.0971045*F+.7141733*i)/vQ)),new KQ(116*U-16,500*(B-U),200*(U-s),t.opacity)}function zQ(t,B,s,Q){return 1===arguments.length?TQ(t):new KQ(t,B,s,null==Q?1:Q)}function KQ(t,B,s,Q){this.l=+t,this.a=+B,this.b=+s,this.opacity=+Q}function OQ(t){return t>MQ?Math.pow(t,1/3):t/kQ+YQ}function PQ(t){return t>JQ?t*t*t:kQ*(t-YQ)}function jQ(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function _Q(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $Q(t,B,s,Q){return 1===arguments.length?function(t){if(t instanceof qQ)return new qQ(t.h,t.c,t.l,t.opacity);if(t instanceof KQ||(t=TQ(t)),0===t.a&&0===t.b)return new qQ(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var B=Math.atan2(t.b,t.a)*fQ;return new qQ(B<0?B+360:B,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new qQ(t,B,s,null==Q?1:Q)}function qQ(t,B,s,Q){this.h=+t,this.c=+B,this.l=+s,this.opacity=+Q}function tF(t){if(isNaN(t.h))return new KQ(t.l,0,0,t.opacity);var B=t.h*DQ;return new KQ(t.l,Math.cos(B)*t.c,Math.sin(B)*t.c,t.opacity)}BQ(KQ,zQ,sQ(QQ,{brighter(t){return new KQ(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new KQ(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,B=isNaN(this.a)?t:t+this.a/500,s=isNaN(this.b)?t:t-this.b/200;return new AQ(jQ(3.1338561*(B=wQ*PQ(B))-1.6168667*(t=1*PQ(t))-.4906146*(s=vQ*PQ(s))),jQ(-.9787684*B+1.9161415*t+.033454*s),jQ(.0719453*B-.2289914*t+1.4052427*s),this.opacity)}})),BQ(qQ,$Q,sQ(QQ,{brighter(t){return new qQ(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new qQ(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return tF(this).rgb()}}));var BF=-.14861,sF=1.78277,QF=-.29227,FF=-.90649,iF=1.97294,UF=iF*FF,gF=iF*sF,eF=sF*QF-FF*BF;function IF(t,B,s,Q){return 1===arguments.length?function(t){if(t instanceof lF)return new lF(t.h,t.s,t.l,t.opacity);t instanceof AQ||(t=GQ(t));var B=t.r/255,s=t.g/255,Q=t.b/255,F=(eF*Q+UF*B-gF*s)/(eF+UF-gF),i=Q-F,U=(iF*(s-F)-QF*i)/FF,g=Math.sqrt(U*U+i*i)/(iF*F*(1-F)),e=g?Math.atan2(U,i)*fQ-120:NaN;return new lF(e<0?e+360:e,g,F,t.opacity)}(t):new lF(t,B,s,null==Q?1:Q)}function lF(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}BQ(lF,IF,sQ(QQ,{brighter(t){return t=null==t?iQ:Math.pow(iQ,t),new lF(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?FQ:Math.pow(FQ,t),new lF(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*DQ,B=+this.l,s=isNaN(this.s)?0:this.s*B*(1-B),Q=Math.cos(t),F=Math.sin(t);return new AQ(255*(B+s*(BF*Q+sF*F)),255*(B+s*(QF*Q+FF*F)),255*(B+s*(iF*Q)),this.opacity)}}));var cF=t=>()=>t;function nF(t,B){return function(s){return t+s*B}}function aF(t,B){var s=B-t;return s?nF(t,s>180||s<-180?s-360*Math.round(s/360):s):cF(isNaN(t)?B:t)}function dF(t){return 1===(t=+t)?oF:function(B,s){return s-B?function(t,B,s){return t=Math.pow(t,s),B=Math.pow(B,s)-t,s=1/s,function(Q){return Math.pow(t+Q*B,s)}}(B,s,t):cF(isNaN(B)?s:B)}}function oF(t,B){var s=B-t;return s?nF(t,s):cF(isNaN(t)?B:t)}var bF=function t(B){var s=dF(B);function Q(t,B){var Q=s((t=yQ(t)).r,(B=yQ(B)).r),F=s(t.g,B.g),i=s(t.b,B.b),U=oF(t.opacity,B.opacity);return function(B){return t.r=Q(B),t.g=F(B),t.b=i(B),t.opacity=U(B),t+""}}return Q.gamma=t,Q}(1);var CF,rF=(CF=function(t){var B=t.length-1;return function(s){var Q=s<=0?s=0:s>=1?(s=1,B-1):Math.floor(s*B),F=t[Q],i=t[Q+1],U=Q>0?t[Q-1]:2*F-i,g=Q<B-1?t[Q+2]:2*i-F;return function(t,B,s,Q,F){var i=t*t,U=i*t;return((1-3*t+3*i-U)*B+(4-6*i+3*U)*s+(1+3*t+3*i-3*U)*Q+U*F)/6}((s-Q/B)*B,U,F,i,g)}},function(t){var B,s,Q=t.length,F=new Array(Q),i=new Array(Q),U=new Array(Q);for(B=0;B<Q;++B)s=yQ(t[B]),F[B]=s.r||0,i[B]=s.g||0,U[B]=s.b||0;return F=CF(F),i=CF(i),U=CF(U),s.opacity=1,function(t){return s.r=F(t),s.g=i(t),s.b=U(t),s+""}});function uF(t,B){B||(B=[]);var s,Q=t?Math.min(B.length,t.length):0,F=B.slice();return function(i){for(s=0;s<Q;++s)F[s]=t[s]*(1-i)+B[s]*i;return F}}function hF(t,B){var s,Q=B?B.length:0,F=t?Math.min(Q,t.length):0,i=new Array(F),U=new Array(Q);for(s=0;s<F;++s)i[s]=mF(t[s],B[s]);for(;s<Q;++s)U[s]=B[s];return function(t){for(s=0;s<F;++s)U[s]=i[s](t);return U}}function xF(t,B){var s=new Date;return t=+t,B=+B,function(Q){return s.setTime(t*(1-Q)+B*Q),s}}function GF(t,B){return t=+t,B=+B,function(s){return t*(1-s)+B*s}}function yF(t,B){var s,Q={},F={};for(s in null!==t&&"object"==typeof t||(t={}),null!==B&&"object"==typeof B||(B={}),B)s in t?Q[s]=mF(t[s],B[s]):F[s]=B[s];return function(t){for(s in Q)F[s]=Q[s](t);return F}}var AF=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,LF=new RegExp(AF.source,"g");function RF(t,B){var s,Q,F,i=AF.lastIndex=LF.lastIndex=0,U=-1,g=[],e=[];for(t+="",B+="";(s=AF.exec(t))&&(Q=LF.exec(B));)(F=Q.index)>i&&(F=B.slice(i,F),g[U]?g[U]+=F:g[++U]=F),(s=s[0])===(Q=Q[0])?g[U]?g[U]+=Q:g[++U]=Q:(g[++U]=null,e.push({i:U,x:GF(s,Q)})),i=LF.lastIndex;return i<B.length&&(F=B.slice(i),g[U]?g[U]+=F:g[++U]=F),g.length<2?e[0]?function(t){return function(B){return t(B)+""}}(e[0].x):function(t){return function(){return t}}(B):(B=e.length,function(t){for(var s,Q=0;Q<B;++Q)g[(s=e[Q]).i]=s.x(t);return g.join("")})}function mF(t,B){var s,Q=typeof B;return null==B||"boolean"===Q?cF(B):("number"===Q?GF:"string"===Q?(s=uQ(B))?(B=s,bF):RF:B instanceof uQ?bF:B instanceof Date?xF:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(B)?uF:Array.isArray(B)?hF:"function"!=typeof B.valueOf&&"function"!=typeof B.toString||isNaN(B)?yF:GF)(t,B)}function VF(t,B){return t=+t,B=+B,function(s){return Math.round(t*(1-s)+B*s)}}var SF,ZF=180/Math.PI,pF={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function EF(t,B,s,Q,F,i){var U,g,e;return(U=Math.sqrt(t*t+B*B))&&(t/=U,B/=U),(e=t*s+B*Q)&&(s-=t*e,Q-=B*e),(g=Math.sqrt(s*s+Q*Q))&&(s/=g,Q/=g,e/=g),t*Q<B*s&&(t=-t,B=-B,e=-e,U=-U),{translateX:F,translateY:i,rotate:Math.atan2(B,t)*ZF,skewX:Math.atan(e)*ZF,scaleX:U,scaleY:g}}function NF(t,B,s,Q){function F(t){return t.length?t.pop()+" ":""}return function(i,U){var g=[],e=[];return i=t(i),U=t(U),function(t,Q,F,i,U,g){if(t!==F||Q!==i){var e=U.push("translate(",null,B,null,s);g.push({i:e-4,x:GF(t,F)},{i:e-2,x:GF(Q,i)})}else(F||i)&&U.push("translate("+F+B+i+s)}(i.translateX,i.translateY,U.translateX,U.translateY,g,e),function(t,B,s,i){t!==B?(t-B>180?B+=360:B-t>180&&(t+=360),i.push({i:s.push(F(s)+"rotate(",null,Q)-2,x:GF(t,B)})):B&&s.push(F(s)+"rotate("+B+Q)}(i.rotate,U.rotate,g,e),function(t,B,s,i){t!==B?i.push({i:s.push(F(s)+"skewX(",null,Q)-2,x:GF(t,B)}):B&&s.push(F(s)+"skewX("+B+Q)}(i.skewX,U.skewX,g,e),function(t,B,s,Q,i,U){if(t!==s||B!==Q){var g=i.push(F(i)+"scale(",null,",",null,")");U.push({i:g-4,x:GF(t,s)},{i:g-2,x:GF(B,Q)})}else 1===s&&1===Q||i.push(F(i)+"scale("+s+","+Q+")")}(i.scaleX,i.scaleY,U.scaleX,U.scaleY,g,e),i=U=null,function(t){for(var B,s=-1,Q=e.length;++s<Q;)g[(B=e[s]).i]=B.x(t);return g.join("")}}}var XF=NF(function(t){const B=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return B.isIdentity?pF:EF(B.a,B.b,B.c,B.d,B.e,B.f)},"px, ","px)","deg)"),WF=NF(function(t){return null==t?pF:(SF||(SF=document.createElementNS("http://www.w3.org/2000/svg","g")),SF.setAttribute("transform",t),(t=SF.transform.baseVal.consolidate())?EF((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):pF)},", ",")",")");var HF=function(t){return function(B,s){var Q=t((B=EQ(B)).h,(s=EQ(s)).h),F=oF(B.s,s.s),i=oF(B.l,s.l),U=oF(B.opacity,s.opacity);return function(t){return B.h=Q(t),B.s=F(t),B.l=i(t),B.opacity=U(t),B+""}}}(aF);var DF=function(t){return function(B,s){var Q=t((B=$Q(B)).h,(s=$Q(s)).h),F=oF(B.c,s.c),i=oF(B.l,s.l),U=oF(B.opacity,s.opacity);return function(t){return B.h=Q(t),B.c=F(t),B.l=i(t),B.opacity=U(t),B+""}}}(aF);function fF(t){return function B(s){function Q(B,Q){var F=t((B=IF(B)).h,(Q=IF(Q)).h),i=oF(B.s,Q.s),U=oF(B.l,Q.l),g=oF(B.opacity,Q.opacity);return function(t){return B.h=F(t),B.s=i(t),B.l=U(Math.pow(t,s)),B.opacity=g(t),B+""}}return s=+s,Q.gamma=B,Q}(1)}fF(aF);var wF=fF(oF);function vF(t,B){void 0===B&&(B=t,t=mF);for(var s=0,Q=B.length-1,F=B[0],i=new Array(Q<0?0:Q);s<Q;)i[s]=t(F,F=B[++s]);return function(t){var B=Math.max(0,Math.min(Q-1,Math.floor(t*=Q)));return i[B](t-B)}}function YF(t,B){for(var s=new Array(B),Q=0;Q<B;++Q)s[Q]=t(Q/(B-1));return s}var JF,kF,MF=0,TF=0,zF=0,KF=0,OF=0,PF=0,jF="object"==typeof performance&&performance.now?performance:Date,_F="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $F(){return OF||(_F(qF),OF=jF.now()+PF)}function qF(){OF=0}function ti(){this._call=this._time=this._next=null}function Bi(t,B,s){var Q=new ti;return Q.restart(t,B,s),Q}function si(){OF=(KF=jF.now())+PF,MF=TF=0;try{!function(){$F(),++MF;for(var t,B=JF;B;)(t=OF-B._time)>=0&&B._call.call(void 0,t),B=B._next;--MF}()}finally{MF=0,function(){var t,B,s=JF,Q=1/0;for(;s;)s._call?(Q>s._time&&(Q=s._time),t=s,s=s._next):(B=s._next,s._next=null,s=t?t._next=B:JF=B);kF=t,Fi(Q)}(),OF=0}}function Qi(){var t=jF.now(),B=t-KF;B>1e3&&(PF-=B,KF=t)}function Fi(t){MF||(TF&&(TF=clearTimeout(TF)),t-OF>24?(t<1/0&&(TF=setTimeout(si,t-jF.now()-PF)),zF&&(zF=clearInterval(zF))):(zF||(KF=jF.now(),zF=setInterval(Qi,1e3)),MF=1,_F(si)))}function ii(t,B,s){var Q=new ti;return B=null==B?0:+B,Q.restart(s=>{Q.stop(),t(s+B)},B,s),Q}ti.prototype=Bi.prototype={constructor:ti,restart:function(t,B,s){if("function"!=typeof t)throw new TypeError("callback is not a function");s=(null==s?$F():+s)+(null==B?0:+B),this._next||kF===this||(kF?kF._next=this:JF=this,kF=this),this._call=t,this._time=s,Fi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fi())}};var Ui=RB("start","end","cancel","interrupt"),gi=[];function ei(t,B,s,Q,F,i){var U=t.__transition;if(U){if(s in U)return}else t.__transition={};!function(t,B,s){var Q,F=t.__transition;function i(t){s.state=1,s.timer.restart(U,s.delay,s.time),s.delay<=t&&U(t-s.delay)}function U(i){var I,l,c,n;if(1!==s.state)return e();for(I in F)if((n=F[I]).name===s.name){if(3===n.state)return ii(U);4===n.state?(n.state=6,n.timer.stop(),n.on.call("interrupt",t,t.__data__,n.index,n.group),delete F[I]):+I<B&&(n.state=6,n.timer.stop(),n.on.call("cancel",t,t.__data__,n.index,n.group),delete F[I])}if(ii(function(){3===s.state&&(s.state=4,s.timer.restart(g,s.delay,s.time),g(i))}),s.state=2,s.on.call("start",t,t.__data__,s.index,s.group),2===s.state){for(s.state=3,Q=new Array(c=s.tween.length),I=0,l=-1;I<c;++I)(n=s.tween[I].value.call(t,t.__data__,s.index,s.group))&&(Q[++l]=n);Q.length=l+1}}function g(B){for(var F=B<s.duration?s.ease.call(null,B/s.duration):(s.timer.restart(e),s.state=5,1),i=-1,U=Q.length;++i<U;)Q[i].call(t,F);5===s.state&&(s.on.call("end",t,t.__data__,s.index,s.group),e())}function e(){for(var Q in s.state=6,s.timer.stop(),delete F[B],F)return;delete t.__transition}F[B]=s,s.timer=Bi(i,0,s.time)}(t,s,{name:B,index:Q,group:F,on:Ui,tween:gi,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Ii(t,B){var s=ci(t,B);if(s.state>0)throw new Error("too late; already scheduled");return s}function li(t,B){var s=ci(t,B);if(s.state>3)throw new Error("too late; already running");return s}function ci(t,B){var s=t.__transition;if(!s||!(s=s[B]))throw new Error("transition not found");return s}function ni(t,B){var s,Q;return function(){var F=li(this,t),i=F.tween;if(i!==s)for(var U=0,g=(Q=s=i).length;U<g;++U)if(Q[U].name===B){(Q=Q.slice()).splice(U,1);break}F.tween=Q}}function ai(t,B,s){var Q,F;if("function"!=typeof s)throw new Error;return function(){var i=li(this,t),U=i.tween;if(U!==Q){F=(Q=U).slice();for(var g={name:B,value:s},e=0,I=F.length;e<I;++e)if(F[e].name===B){F[e]=g;break}e===I&&F.push(g)}i.tween=F}}function di(t,B,s){var Q=t._id;return t.each(function(){var t=li(this,Q);(t.value||(t.value={}))[B]=s.apply(this,arguments)}),function(t){return ci(t,Q).value[B]}}function oi(t,B){var s;return("number"==typeof B?GF:B instanceof uQ?bF:(s=uQ(B))?(B=s,bF):RF)(t,B)}function bi(t){return function(){this.removeAttribute(t)}}function Ci(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ri(t,B,s){var Q,F,i=s+"";return function(){var U=this.getAttribute(t);return U===i?null:U===Q?F:F=B(Q=U,s)}}function ui(t,B,s){var Q,F,i=s+"";return function(){var U=this.getAttributeNS(t.space,t.local);return U===i?null:U===Q?F:F=B(Q=U,s)}}function hi(t,B,s){var Q,F,i;return function(){var U,g,e=s(this);if(null!=e)return(U=this.getAttribute(t))===(g=e+"")?null:U===Q&&g===F?i:(F=g,i=B(Q=U,e));this.removeAttribute(t)}}function xi(t,B,s){var Q,F,i;return function(){var U,g,e=s(this);if(null!=e)return(U=this.getAttributeNS(t.space,t.local))===(g=e+"")?null:U===Q&&g===F?i:(F=g,i=B(Q=U,e));this.removeAttributeNS(t.space,t.local)}}function Gi(t,B){var s,Q;function F(){var F=B.apply(this,arguments);return F!==Q&&(s=(Q=F)&&function(t,B){return function(s){this.setAttributeNS(t.space,t.local,B.call(this,s))}}(t,F)),s}return F._value=B,F}function yi(t,B){var s,Q;function F(){var F=B.apply(this,arguments);return F!==Q&&(s=(Q=F)&&function(t,B){return function(s){this.setAttribute(t,B.call(this,s))}}(t,F)),s}return F._value=B,F}function Ai(t,B){return function(){Ii(this,t).delay=+B.apply(this,arguments)}}function Li(t,B){return B=+B,function(){Ii(this,t).delay=B}}function Ri(t,B){return function(){li(this,t).duration=+B.apply(this,arguments)}}function mi(t,B){return B=+B,function(){li(this,t).duration=B}}var Vi=Ys.prototype.constructor;function Si(t){return function(){this.style.removeProperty(t)}}var Zi=0;function pi(t,B,s,Q){this._groups=t,this._parents=B,this._name=s,this._id=Q}function Ei(){return++Zi}var Ni=Ys.prototype;function Xi(t){return t*t*t}function Wi(t){return--t*t*t+1}pi.prototype={constructor:pi,select:function(t){var B=this._name,s=this._id;"function"!=typeof t&&(t=DB(t));for(var Q=this._groups,F=Q.length,i=new Array(F),U=0;U<F;++U)for(var g,e,I=Q[U],l=I.length,c=i[U]=new Array(l),n=0;n<l;++n)(g=I[n])&&(e=t.call(g,g.__data__,n,I))&&("__data__"in g&&(e.__data__=g.__data__),c[n]=e,ei(c[n],B,s,n,c,ci(g,s)));return new pi(i,this._parents,B,s)},selectAll:function(t){var B=this._name,s=this._id;"function"!=typeof t&&(t=wB(t));for(var Q=this._groups,F=Q.length,i=[],U=[],g=0;g<F;++g)for(var e,I=Q[g],l=I.length,c=0;c<l;++c)if(e=I[c]){for(var n,a=t.call(e,e.__data__,c,I),d=ci(e,s),o=0,b=a.length;o<b;++o)(n=a[o])&&ei(n,B,s,o,a,d);i.push(a),U.push(e)}return new pi(i,U,B,s)},selectChild:Ni.selectChild,selectChildren:Ni.selectChildren,filter:function(t){"function"!=typeof t&&(t=YB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new pi(Q,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var B=this._groups,s=t._groups,Q=B.length,F=s.length,i=Math.min(Q,F),U=new Array(Q),g=0;g<i;++g)for(var e,I=B[g],l=s[g],c=I.length,n=U[g]=new Array(c),a=0;a<c;++a)(e=I[a]||l[a])&&(n[a]=e);for(;g<Q;++g)U[g]=B[g];return new pi(U,this._parents,this._name,this._id)},selection:function(){return new Vi(this._groups,this._parents)},transition:function(){for(var t=this._name,B=this._id,s=Ei(),Q=this._groups,F=Q.length,i=0;i<F;++i)for(var U,g=Q[i],e=g.length,I=0;I<e;++I)if(U=g[I]){var l=ci(U,B);ei(U,t,s,I,g,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new pi(Q,this._parents,t,s)},call:Ni.call,nodes:Ni.nodes,node:Ni.node,size:Ni.size,empty:Ni.empty,each:Ni.each,on:function(t,B){var s=this._id;return arguments.length<2?ci(this.node(),s).on.on(t):this.each(function(t,B,s){var Q,F,i=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var B=t.indexOf(".");return B>=0&&(t=t.slice(0,B)),!t||"start"===t})}(B)?Ii:li;return function(){var U=i(this,t),g=U.on;g!==Q&&(F=(Q=g).copy()).on(B,s),U.on=F}}(s,t,B))},attr:function(t,B){var s=EB(t),Q="transform"===s?WF:oi;return this.attrTween(t,"function"==typeof B?(s.local?xi:hi)(s,Q,di(this,"attr."+t,B)):null==B?(s.local?Ci:bi)(s):(s.local?ui:ri)(s,Q,B))},attrTween:function(t,B){var s="attr."+t;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(null==B)return this.tween(s,null);if("function"!=typeof B)throw new Error;var Q=EB(t);return this.tween(s,(Q.local?Gi:yi)(Q,B))},style:function(t,B,s){var Q="transform"==(t+="")?XF:oi;return null==B?this.styleTween(t,function(t,B){var s,Q,F;return function(){var i=ls(this,t),U=(this.style.removeProperty(t),ls(this,t));return i===U?null:i===s&&U===Q?F:F=B(s=i,Q=U)}}(t,Q)).on("end.style."+t,Si(t)):"function"==typeof B?this.styleTween(t,function(t,B,s){var Q,F,i;return function(){var U=ls(this,t),g=s(this),e=g+"";return null==g&&(this.style.removeProperty(t),e=g=ls(this,t)),U===e?null:U===Q&&e===F?i:(F=e,i=B(Q=U,g))}}(t,Q,di(this,"style."+t,B))).each(function(t,B){var s,Q,F,i,U="style."+B,g="end."+U;return function(){var e=li(this,t),I=e.on,l=null==e.value[U]?i||(i=Si(B)):void 0;I===s&&F===l||(Q=(s=I).copy()).on(g,F=l),e.on=Q}}(this._id,t)):this.styleTween(t,function(t,B,s){var Q,F,i=s+"";return function(){var U=ls(this,t);return U===i?null:U===Q?F:F=B(Q=U,s)}}(t,Q,B),s).on("end.style."+t,null)},styleTween:function(t,B,s){var Q="style."+(t+="");if(arguments.length<2)return(Q=this.tween(Q))&&Q._value;if(null==B)return this.tween(Q,null);if("function"!=typeof B)throw new Error;return this.tween(Q,function(t,B,s){var Q,F;function i(){var i=B.apply(this,arguments);return i!==F&&(Q=(F=i)&&function(t,B,s){return function(Q){this.style.setProperty(t,B.call(this,Q),s)}}(t,i,s)),Q}return i._value=B,i}(t,B,null==s?"":s))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var B=t(this);this.textContent=null==B?"":B}}(di(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var B="text";if(arguments.length<1)return(B=this.tween(B))&&B._value;if(null==t)return this.tween(B,null);if("function"!=typeof t)throw new Error;return this.tween(B,function(t){var B,s;function Q(){var Q=t.apply(this,arguments);return Q!==s&&(B=(s=Q)&&function(t){return function(B){this.textContent=t.call(this,B)}}(Q)),B}return Q._value=t,Q}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var B=this.parentNode;for(var s in this.__transition)if(+s!==t)return;B&&B.removeChild(this)}}(this._id))},tween:function(t,B){var s=this._id;if(t+="",arguments.length<2){for(var Q,F=ci(this.node(),s).tween,i=0,U=F.length;i<U;++i)if((Q=F[i]).name===t)return Q.value;return null}return this.each((null==B?ni:ai)(s,t,B))},delay:function(t){var B=this._id;return arguments.length?this.each(("function"==typeof t?Ai:Li)(B,t)):ci(this.node(),B).delay},duration:function(t){var B=this._id;return arguments.length?this.each(("function"==typeof t?Ri:mi)(B,t)):ci(this.node(),B).duration},ease:function(t){var B=this._id;return arguments.length?this.each(function(t,B){if("function"!=typeof B)throw new Error;return function(){li(this,t).ease=B}}(B,t)):ci(this.node(),B).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,B){return function(){var s=B.apply(this,arguments);if("function"!=typeof s)throw new Error;li(this,t).ease=s}}(this._id,t))},end:function(){var t,B,s=this,Q=s._id,F=s.size();return new Promise(function(i,U){var g={value:U},e={value:function(){0===--F&&i()}};s.each(function(){var s=li(this,Q),F=s.on;F!==t&&((B=(t=F).copy())._.cancel.push(g),B._.interrupt.push(g),B._.end.push(e)),s.on=B}),0===F&&i()})},[Symbol.iterator]:Ni[Symbol.iterator]};var Hi={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Di(t,B){for(var s;!(s=t.__transition)||!(s=s[B]);)if(!(t=t.parentNode))throw new Error(`transition ${B} not found`);return s}Ys.prototype.interrupt=function(t){return this.each(function(){!function(t,B){var s,Q,F,i=t.__transition,U=!0;if(i){for(F in B=null==B?null:B+"",i)(s=i[F]).name===B?(Q=s.state>2&&s.state<5,s.state=6,s.timer.stop(),s.on.call(Q?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[F]):U=!1;U&&delete t.__transition}}(this,t)})},Ys.prototype.transition=function(t){var B,s;t instanceof pi?(B=t._id,t=t._name):(B=Ei(),(s=Hi).time=$F(),t=null==t?null:t+"");for(var Q=this._groups,F=Q.length,i=0;i<F;++i)for(var U,g=Q[i],e=g.length,I=0;I<e;++I)(U=g[I])&&ei(U,t,B,I,g,s||Di(U,B));return new pi(Q,this._parents,t,B)};const fi=Math.PI,wi=2*fi,vi=1e-6,Yi=wi-vi;function Ji(t){this._+=t[0];for(let B=1,s=t.length;B<s;++B)this._+=arguments[B]+t[B]}class ki{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ji:function(t){let B=Math.floor(t);if(!(B>=0))throw new Error(`invalid digits: ${t}`);if(B>15)return Ji;const s=10**B;return function(t){this._+=t[0];for(let B=1,Q=t.length;B<Q;++B)this._+=Math.round(arguments[B]*s)/s+t[B]}}(t)}moveTo(t,B){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+B}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,B){this._append`L${this._x1=+t},${this._y1=+B}`}quadraticCurveTo(t,B,s,Q){this._append`Q${+t},${+B},${this._x1=+s},${this._y1=+Q}`}bezierCurveTo(t,B,s,Q,F,i){this._append`C${+t},${+B},${+s},${+Q},${this._x1=+F},${this._y1=+i}`}arcTo(t,B,s,Q,F){if(t=+t,B=+B,s=+s,Q=+Q,(F=+F)<0)throw new Error(`negative radius: ${F}`);let i=this._x1,U=this._y1,g=s-t,e=Q-B,I=i-t,l=U-B,c=I*I+l*l;if(null===this._x1)this._append`M${this._x1=t},${this._y1=B}`;else if(c>vi)if(Math.abs(l*g-e*I)>vi&&F){let n=s-i,a=Q-U,d=g*g+e*e,o=n*n+a*a,b=Math.sqrt(d),C=Math.sqrt(c),r=F*Math.tan((fi-Math.acos((d+c-o)/(2*b*C)))/2),u=r/C,h=r/b;Math.abs(u-1)>vi&&this._append`L${t+u*I},${B+u*l}`,this._append`A${F},${F},0,0,${+(l*n>I*a)},${this._x1=t+h*g},${this._y1=B+h*e}`}else this._append`L${this._x1=t},${this._y1=B}`;else;}arc(t,B,s,Q,F,i){if(t=+t,B=+B,i=!!i,(s=+s)<0)throw new Error(`negative radius: ${s}`);let U=s*Math.cos(Q),g=s*Math.sin(Q),e=t+U,I=B+g,l=1^i,c=i?Q-F:F-Q;null===this._x1?this._append`M${e},${I}`:(Math.abs(this._x1-e)>vi||Math.abs(this._y1-I)>vi)&&this._append`L${e},${I}`,s&&(c<0&&(c=c%wi+wi),c>Yi?this._append`A${s},${s},0,1,${l},${t-U},${B-g}A${s},${s},0,1,${l},${this._x1=e},${this._y1=I}`:c>vi&&this._append`A${s},${s},0,${+(c>=fi)},${l},${this._x1=t+s*Math.cos(F)},${this._y1=B+s*Math.sin(F)}`)}rect(t,B,s,Q){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+B}h${s=+s}v${+Q}h${-s}Z`}toString(){return this._}}function Mi(t=3){return new ki(+t)}function Ti(t,B){if((s=(t=B?t.toExponential(B-1):t.toExponential()).indexOf("e"))<0)return null;var s,Q=t.slice(0,s);return[Q.length>1?Q[0]+Q.slice(2):Q,+t.slice(s+1)]}function zi(t){return(t=Ti(Math.abs(t)))?t[1]:NaN}var Ki,Oi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pi(t){if(!(B=Oi.exec(t)))throw new Error("invalid format: "+t);var B;return new ji({fill:B[1],align:B[2],sign:B[3],symbol:B[4],zero:B[5],width:B[6],comma:B[7],precision:B[8]&&B[8].slice(1),trim:B[9],type:B[10]})}function ji(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function _i(t,B){var s=Ti(t,B);if(!s)return t+"";var Q=s[0],F=s[1];return F<0?"0."+new Array(-F).join("0")+Q:Q.length>F+1?Q.slice(0,F+1)+"."+Q.slice(F+1):Q+new Array(F-Q.length+2).join("0")}Pi.prototype=ji.prototype,ji.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var $i={"%":(t,B)=>(100*t).toFixed(B),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,B)=>t.toExponential(B),f:(t,B)=>t.toFixed(B),g:(t,B)=>t.toPrecision(B),o:t=>Math.round(t).toString(8),p:(t,B)=>_i(100*t,B),r:_i,s:function(t,B){var s=Ti(t,B);if(!s)return t+"";var Q=s[0],F=s[1],i=F-(Ki=3*Math.max(-8,Math.min(8,Math.floor(F/3))))+1,U=Q.length;return i===U?Q:i>U?Q+new Array(i-U+1).join("0"):i>0?Q.slice(0,i)+"."+Q.slice(i):"0."+new Array(1-i).join("0")+Ti(t,Math.max(0,B+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qi(t){return t}var tU,BU,sU,QU=Array.prototype.map,FU=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iU(t){var B,s,Q=void 0===t.grouping||void 0===t.thousands?qi:(B=QU.call(t.grouping,Number),s=t.thousands+"",function(t,Q){for(var F=t.length,i=[],U=0,g=B[0],e=0;F>0&&g>0&&(e+g+1>Q&&(g=Math.max(1,Q-e)),i.push(t.substring(F-=g,F+g)),!((e+=g+1)>Q));)g=B[U=(U+1)%B.length];return i.reverse().join(s)}),F=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",U=void 0===t.decimal?".":t.decimal+"",g=void 0===t.numerals?qi:function(t){return function(B){return B.replace(/[0-9]/g,function(B){return t[+B]})}}(QU.call(t.numerals,String)),e=void 0===t.percent?"%":t.percent+"",I=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function c(t){var B=(t=Pi(t)).fill,s=t.align,c=t.sign,n=t.symbol,a=t.zero,d=t.width,o=t.comma,b=t.precision,C=t.trim,r=t.type;"n"===r?(o=!0,r="g"):$i[r]||(void 0===b&&(b=12),C=!0,r="g"),(a||"0"===B&&"="===s)&&(a=!0,B="0",s="=");var u="$"===n?F:"#"===n&&/[boxX]/.test(r)?"0"+r.toLowerCase():"",h="$"===n?i:/[%p]/.test(r)?e:"",x=$i[r],G=/[defgprs%]/.test(r);function y(t){var F,i,e,n=u,y=h;if("c"===r)y=x(t)+y,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),b),C&&(t=function(t){t:for(var B,s=t.length,Q=1,F=-1;Q<s;++Q)switch(t[Q]){case".":F=B=Q;break;case"0":0===F&&(F=Q),B=Q;break;default:if(!+t[Q])break t;F>0&&(F=0)}return F>0?t.slice(0,F)+t.slice(B+1):t}(t)),A&&0===+t&&"+"!==c&&(A=!1),n=(A?"("===c?c:I:"-"===c||"("===c?"":c)+n,y=("s"===r?FU[8+Ki/3]:"")+y+(A&&"("===c?")":""),G)for(F=-1,i=t.length;++F<i;)if(48>(e=t.charCodeAt(F))||e>57){y=(46===e?U+t.slice(F+1):t.slice(F))+y,t=t.slice(0,F);break}}o&&!a&&(t=Q(t,1/0));var L=n.length+t.length+y.length,R=L<d?new Array(d-L+1).join(B):"";switch(o&&a&&(t=Q(R+t,R.length?d-y.length:1/0),R=""),s){case"<":t=n+t+y+R;break;case"=":t=n+R+t+y;break;case"^":t=R.slice(0,L=R.length>>1)+n+t+y+R.slice(L);break;default:t=R+n+t+y}return g(t)}return b=void 0===b?6:/[gprs]/.test(r)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),y.toString=function(){return t+""},y}return{format:c,formatPrefix:function(t,B){var s=c(((t=Pi(t)).type="f",t)),Q=3*Math.max(-8,Math.min(8,Math.floor(zi(B)/3))),F=Math.pow(10,-Q),i=FU[8+Q/3];return function(t){return s(F*t)+i}}}}tU=iU({thousands:",",grouping:[3],currency:["$",""]}),BU=tU.format,sU=tU.formatPrefix;var UU=1e-6,gU=Math.PI,eU=gU/2,IU=gU/4,lU=2*gU,cU=180/gU,nU=gU/180,aU=Math.abs,dU=Math.atan,oU=Math.atan2,bU=Math.cos,CU=Math.exp,rU=Math.log,uU=Math.pow,hU=Math.sin,xU=Math.sign||function(t){return t>0?1:t<0?-1:0},GU=Math.sqrt,yU=Math.tan;function AU(t){return t>1?0:t<-1?gU:Math.acos(t)}function LU(t){return t>1?eU:t<-1?-eU:Math.asin(t)}function RU(){}function mU(t,B){t&&SU.hasOwnProperty(t.type)&&SU[t.type](t,B)}var VU={Feature:function(t,B){mU(t.geometry,B)},FeatureCollection:function(t,B){for(var s=t.features,Q=-1,F=s.length;++Q<F;)mU(s[Q].geometry,B)}},SU={Sphere:function(t,B){B.sphere()},Point:function(t,B){t=t.coordinates,B.point(t[0],t[1],t[2])},MultiPoint:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)t=s[Q],B.point(t[0],t[1],t[2])},LineString:function(t,B){ZU(t.coordinates,B,0)},MultiLineString:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)ZU(s[Q],B,0)},Polygon:function(t,B){pU(t.coordinates,B)},MultiPolygon:function(t,B){for(var s=t.coordinates,Q=-1,F=s.length;++Q<F;)pU(s[Q],B)},GeometryCollection:function(t,B){for(var s=t.geometries,Q=-1,F=s.length;++Q<F;)mU(s[Q],B)}};function ZU(t,B,s){var Q,F=-1,i=t.length-s;for(B.lineStart();++F<i;)Q=t[F],B.point(Q[0],Q[1],Q[2]);B.lineEnd()}function pU(t,B){var s=-1,Q=t.length;for(B.polygonStart();++s<Q;)ZU(t[s],B,1);B.polygonEnd()}function EU(t,B){t&&VU.hasOwnProperty(t.type)?VU[t.type](t,B):mU(t,B)}function NU(t){return[oU(t[1],t[0]),LU(t[2])]}function XU(t){var B=t[0],s=t[1],Q=bU(s);return[Q*bU(B),Q*hU(B),hU(s)]}function WU(t,B){return t[0]*B[0]+t[1]*B[1]+t[2]*B[2]}function HU(t,B){return[t[1]*B[2]-t[2]*B[1],t[2]*B[0]-t[0]*B[2],t[0]*B[1]-t[1]*B[0]]}function DU(t,B){t[0]+=B[0],t[1]+=B[1],t[2]+=B[2]}function fU(t,B){return[t[0]*B,t[1]*B,t[2]*B]}function wU(t){var B=GU(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=B,t[1]/=B,t[2]/=B}function vU(t,B){function s(s,Q){return s=t(s,Q),B(s[0],s[1])}return t.invert&&B.invert&&(s.invert=function(s,Q){return(s=B.invert(s,Q))&&t.invert(s[0],s[1])}),s}function YU(t,B){return aU(t)>gU&&(t-=Math.round(t/lU)*lU),[t,B]}function JU(t,B,s){return(t%=lU)?B||s?vU(MU(t),TU(B,s)):MU(t):B||s?TU(B,s):YU}function kU(t){return function(B,s){return aU(B+=t)>gU&&(B-=Math.round(B/lU)*lU),[B,s]}}function MU(t){var B=kU(t);return B.invert=kU(-t),B}function TU(t,B){var s=bU(t),Q=hU(t),F=bU(B),i=hU(B);function U(t,B){var U=bU(B),g=bU(t)*U,e=hU(t)*U,I=hU(B),l=I*s+g*Q;return[oU(e*F-l*i,g*s-I*Q),LU(l*F+e*i)]}return U.invert=function(t,B){var U=bU(B),g=bU(t)*U,e=hU(t)*U,I=hU(B),l=I*F-e*i;return[oU(e*F+I*i,g*s+l*Q),LU(l*s-g*Q)]},U}function zU(t,B){(B=XU(B))[0]-=t,wU(B);var s=AU(-B[1]);return((-B[2]<0?-s:s)+lU-UU)%lU}function KU(){var t,B=[];return{point:function(B,s,Q){t.push([B,s,Q])},lineStart:function(){B.push(t=[])},lineEnd:RU,rejoin:function(){B.length>1&&B.push(B.pop().concat(B.shift()))},result:function(){var s=B;return B=[],t=null,s}}}function OU(t,B){return aU(t[0]-B[0])<UU&&aU(t[1]-B[1])<UU}function PU(t,B,s,Q){this.x=t,this.z=B,this.o=s,this.e=Q,this.v=!1,this.n=this.p=null}function jU(t,B,s,Q,F){var i,U,g=[],e=[];if(t.forEach(function(t){if(!((B=t.length-1)<=0)){var B,s,Q=t[0],U=t[B];if(OU(Q,U)){if(!Q[2]&&!U[2]){for(F.lineStart(),i=0;i<B;++i)F.point((Q=t[i])[0],Q[1]);return void F.lineEnd()}U[0]+=2e-6}g.push(s=new PU(Q,t,null,!0)),e.push(s.o=new PU(Q,null,s,!1)),g.push(s=new PU(U,t,null,!1)),e.push(s.o=new PU(U,null,s,!0))}}),g.length){for(e.sort(B),_U(g),_U(e),i=0,U=e.length;i<U;++i)e[i].e=s=!s;for(var I,l,c=g[0];;){for(var n=c,a=!0;n.v;)if((n=n.n)===c)return;I=n.z,F.lineStart();do{if(n.v=n.o.v=!0,n.e){if(a)for(i=0,U=I.length;i<U;++i)F.point((l=I[i])[0],l[1]);else Q(n.x,n.n.x,1,F);n=n.n}else{if(a)for(I=n.p.z,i=I.length-1;i>=0;--i)F.point((l=I[i])[0],l[1]);else Q(n.x,n.p.x,-1,F);n=n.p}I=(n=n.o).z,a=!a}while(!n.v);F.lineEnd()}}}function _U(t){if(B=t.length){for(var B,s,Q=0,F=t[0];++Q<B;)F.n=s=t[Q],s.p=F,F=s;F.n=s=t[0],s.p=F}}function $U(t){return aU(t[0])<=gU?t[0]:xU(t[0])*((aU(t[0])+gU)%lU-gU)}function qU(t,B,s,Q){return function(F){var i,U,g,e=B(F),I=KU(),l=B(I),c=!1,n={point:a,lineStart:o,lineEnd:b,polygonStart:function(){n.point=C,n.lineStart=r,n.lineEnd=u,U=[],i=[]},polygonEnd:function(){n.point=a,n.lineStart=o,n.lineEnd=b,U=IB(U);var t=function(t,B){var s=$U(B),Q=B[1],F=hU(Q),i=[hU(s),-bU(s),0],U=0,g=0,e=new Rt;1===F?Q=eU+UU:-1===F&&(Q=-eU-UU);for(var I=0,l=t.length;I<l;++I)if(n=(c=t[I]).length)for(var c,n,a=c[n-1],d=$U(a),o=a[1]/2+IU,b=hU(o),C=bU(o),r=0;r<n;++r,d=h,b=G,C=y,a=u){var u=c[r],h=$U(u),x=u[1]/2+IU,G=hU(x),y=bU(x),A=h-d,L=A>=0?1:-1,R=L*A,m=R>gU,V=b*G;if(e.add(oU(V*L*hU(R),C*y+V*bU(R))),U+=m?A+L*lU:A,m^d>=s^h>=s){var S=HU(XU(a),XU(u));wU(S);var Z=HU(i,S);wU(Z);var p=(m^A>=0?-1:1)*LU(Z[2]);(Q>p||Q===p&&(S[0]||S[1]))&&(g+=m^A>=0?1:-1)}}return(U<-1e-6||U<UU&&e<-1e-12)^1&g}(i,Q);U.length?(c||(F.polygonStart(),c=!0),jU(U,Bg,t,s,F)):t&&(c||(F.polygonStart(),c=!0),F.lineStart(),s(null,null,1,F),F.lineEnd()),c&&(F.polygonEnd(),c=!1),U=i=null},sphere:function(){F.polygonStart(),F.lineStart(),s(null,null,1,F),F.lineEnd(),F.polygonEnd()}};function a(B,s){t(B,s)&&F.point(B,s)}function d(t,B){e.point(t,B)}function o(){n.point=d,e.lineStart()}function b(){n.point=a,e.lineEnd()}function C(t,B){g.push([t,B]),l.point(t,B)}function r(){l.lineStart(),g=[]}function u(){C(g[0][0],g[0][1]),l.lineEnd();var t,B,s,Q,e=l.clean(),n=I.result(),a=n.length;if(g.pop(),i.push(g),g=null,a)if(1&e){if((B=(s=n[0]).length-1)>0){for(c||(F.polygonStart(),c=!0),F.lineStart(),t=0;t<B;++t)F.point((Q=s[t])[0],Q[1]);F.lineEnd()}}else a>1&&2&e&&n.push(n.pop().concat(n.shift())),U.push(n.filter(tg))}return n}}function tg(t){return t.length>1}function Bg(t,B){return((t=t.x)[0]<0?t[1]-eU-UU:eU-t[1])-((B=B.x)[0]<0?B[1]-eU-UU:eU-B[1])}YU.invert=YU;var sg=qU(function(){return!0},function(t){var B,s=NaN,Q=NaN,F=NaN;return{lineStart:function(){t.lineStart(),B=1},point:function(i,U){var g=i>0?gU:-gU,e=aU(i-s);aU(e-gU)<UU?(t.point(s,Q=(Q+U)/2>0?eU:-eU),t.point(F,Q),t.lineEnd(),t.lineStart(),t.point(g,Q),t.point(i,Q),B=0):F!==g&&e>=gU&&(aU(s-F)<UU&&(s-=F*UU),aU(i-g)<UU&&(i-=g*UU),Q=function(t,B,s,Q){var F,i,U=hU(t-s);return aU(U)>UU?dU((hU(B)*(i=bU(Q))*hU(s)-hU(Q)*(F=bU(B))*hU(t))/(F*i*U)):(B+Q)/2}(s,Q,i,U),t.point(F,Q),t.lineEnd(),t.lineStart(),t.point(g,Q),B=0),t.point(s=i,Q=U),F=g},lineEnd:function(){t.lineEnd(),s=Q=NaN},clean:function(){return 2-B}}},function(t,B,s,Q){var F;if(null==t)F=s*eU,Q.point(-gU,F),Q.point(0,F),Q.point(gU,F),Q.point(gU,0),Q.point(gU,-F),Q.point(0,-F),Q.point(-gU,-F),Q.point(-gU,0),Q.point(-gU,F);else if(aU(t[0]-B[0])>UU){var i=t[0]<B[0]?gU:-gU;F=s*i/2,Q.point(-i,F),Q.point(0,F),Q.point(i,F)}else Q.point(B[0],B[1])},[-gU,-eU]);function Qg(t){var B=bU(t),s=2*nU,Q=B>0,F=aU(B)>UU;function i(t,s){return bU(t)*bU(s)>B}function U(t,s,Q){var F=[1,0,0],i=HU(XU(t),XU(s)),U=WU(i,i),g=i[0],e=U-g*g;if(!e)return!Q&&t;var I=B*U/e,l=-B*g/e,c=HU(F,i),n=fU(F,I);DU(n,fU(i,l));var a=c,d=WU(n,a),o=WU(a,a),b=d*d-o*(WU(n,n)-1);if(!(b<0)){var C=GU(b),r=fU(a,(-d-C)/o);if(DU(r,n),r=NU(r),!Q)return r;var u,h=t[0],x=s[0],G=t[1],y=s[1];x<h&&(u=h,h=x,x=u);var A=x-h,L=aU(A-gU)<UU;if(!L&&y<G&&(u=G,G=y,y=u),L||A<UU?L?G+y>0^r[1]<(aU(r[0]-h)<UU?G:y):G<=r[1]&&r[1]<=y:A>gU^(h<=r[0]&&r[0]<=x)){var R=fU(a,(-d+C)/o);return DU(R,n),[r,NU(R)]}}}function g(B,s){var F=Q?t:gU-t,i=0;return B<-F?i|=1:B>F&&(i|=2),s<-F?i|=4:s>F&&(i|=8),i}return qU(i,function(t){var B,s,e,I,l;return{lineStart:function(){I=e=!1,l=1},point:function(c,n){var a,d=[c,n],o=i(c,n),b=Q?o?0:g(c,n):o?g(c+(c<0?gU:-gU),n):0;if(!B&&(I=e=o)&&t.lineStart(),o!==e&&(!(a=U(B,d))||OU(B,a)||OU(d,a))&&(d[2]=1),o!==e)l=0,o?(t.lineStart(),a=U(d,B),t.point(a[0],a[1])):(a=U(B,d),t.point(a[0],a[1],2),t.lineEnd()),B=a;else if(F&&B&&Q^o){var C;b&s||!(C=U(d,B,!0))||(l=0,Q?(t.lineStart(),t.point(C[0][0],C[0][1]),t.point(C[1][0],C[1][1]),t.lineEnd()):(t.point(C[1][0],C[1][1]),t.lineEnd(),t.lineStart(),t.point(C[0][0],C[0][1],3)))}!o||B&&OU(B,d)||t.point(d[0],d[1]),B=d,e=o,s=b},lineEnd:function(){e&&t.lineEnd(),B=null},clean:function(){return l|(I&&e)<<1}}},function(B,Q,F,i){!function(t,B,s,Q,F,i){if(s){var U=bU(B),g=hU(B),e=Q*s;null==F?(F=B+Q*lU,i=B-e/2):(F=zU(U,F),i=zU(U,i),(Q>0?F<i:F>i)&&(F+=Q*lU));for(var I,l=F;Q>0?l>i:l<i;l-=e)I=NU([U,-g*bU(l),-g*hU(l)]),t.point(I[0],I[1])}}(i,t,s,F,B,Q)},Q?[0,-t]:[-gU,t-gU])}var Fg=1e9,ig=-Fg;function Ug(t,B,s,Q){function F(F,i){return t<=F&&F<=s&&B<=i&&i<=Q}function i(F,i,g,I){var l=0,c=0;if(null==F||(l=U(F,g))!==(c=U(i,g))||e(F,i)<0^g>0)do{I.point(0===l||3===l?t:s,l>1?Q:B)}while((l=(l+g+4)%4)!==c);else I.point(i[0],i[1])}function U(Q,F){return aU(Q[0]-t)<UU?F>0?0:3:aU(Q[0]-s)<UU?F>0?2:1:aU(Q[1]-B)<UU?F>0?1:0:F>0?3:2}function g(t,B){return e(t.x,B.x)}function e(t,B){var s=U(t,1),Q=U(B,1);return s!==Q?s-Q:0===s?B[1]-t[1]:1===s?t[0]-B[0]:2===s?t[1]-B[1]:B[0]-t[0]}return function(U){var e,I,l,c,n,a,d,o,b,C,r,u=U,h=KU(),x={point:G,lineStart:function(){x.point=y,I&&I.push(l=[]);C=!0,b=!1,d=o=NaN},lineEnd:function(){e&&(y(c,n),a&&b&&h.rejoin(),e.push(h.result()));x.point=G,b&&u.lineEnd()},polygonStart:function(){u=h,e=[],I=[],r=!0},polygonEnd:function(){var B=function(){for(var B=0,s=0,F=I.length;s<F;++s)for(var i,U,g=I[s],e=1,l=g.length,c=g[0],n=c[0],a=c[1];e<l;++e)i=n,U=a,n=(c=g[e])[0],a=c[1],U<=Q?a>Q&&(n-i)*(Q-U)>(a-U)*(t-i)&&++B:a<=Q&&(n-i)*(Q-U)<(a-U)*(t-i)&&--B;return B}(),s=r&&B,F=(e=IB(e)).length;(s||F)&&(U.polygonStart(),s&&(U.lineStart(),i(null,null,1,U),U.lineEnd()),F&&jU(e,g,B,i,U),U.polygonEnd());u=U,e=I=l=null}};function G(t,B){F(t,B)&&u.point(t,B)}function y(i,U){var g=F(i,U);if(I&&l.push([i,U]),C)c=i,n=U,a=g,C=!1,g&&(u.lineStart(),u.point(i,U));else if(g&&b)u.point(i,U);else{var e=[d=Math.max(ig,Math.min(Fg,d)),o=Math.max(ig,Math.min(Fg,o))],h=[i=Math.max(ig,Math.min(Fg,i)),U=Math.max(ig,Math.min(Fg,U))];!function(t,B,s,Q,F,i){var U,g=t[0],e=t[1],I=0,l=1,c=B[0]-g,n=B[1]-e;if(U=s-g,c||!(U>0)){if(U/=c,c<0){if(U<I)return;U<l&&(l=U)}else if(c>0){if(U>l)return;U>I&&(I=U)}if(U=F-g,c||!(U<0)){if(U/=c,c<0){if(U>l)return;U>I&&(I=U)}else if(c>0){if(U<I)return;U<l&&(l=U)}if(U=Q-e,n||!(U>0)){if(U/=n,n<0){if(U<I)return;U<l&&(l=U)}else if(n>0){if(U>l)return;U>I&&(I=U)}if(U=i-e,n||!(U<0)){if(U/=n,n<0){if(U>l)return;U>I&&(I=U)}else if(n>0){if(U<I)return;U<l&&(l=U)}return I>0&&(t[0]=g+I*c,t[1]=e+I*n),l<1&&(B[0]=g+l*c,B[1]=e+l*n),!0}}}}}(e,h,t,B,s,Q)?g&&(u.lineStart(),u.point(i,U),r=!1):(b||(u.lineStart(),u.point(e[0],e[1])),u.point(h[0],h[1]),g||u.lineEnd(),r=!1)}d=i,o=U,b=g}return x}}var gg,eg,Ig,lg,cg=t=>t,ng=new Rt,ag=new Rt,dg={point:RU,lineStart:RU,lineEnd:RU,polygonStart:function(){dg.lineStart=og,dg.lineEnd=rg},polygonEnd:function(){dg.lineStart=dg.lineEnd=dg.point=RU,ng.add(aU(ag)),ag=new Rt},result:function(){var t=ng/2;return ng=new Rt,t}};function og(){dg.point=bg}function bg(t,B){dg.point=Cg,gg=Ig=t,eg=lg=B}function Cg(t,B){ag.add(lg*t-Ig*B),Ig=t,lg=B}function rg(){Cg(gg,eg)}var ug=1/0,hg=ug,xg=-ug,Gg=xg,yg={point:function(t,B){t<ug&&(ug=t);t>xg&&(xg=t);B<hg&&(hg=B);B>Gg&&(Gg=B)},lineStart:RU,lineEnd:RU,polygonStart:RU,polygonEnd:RU,result:function(){var t=[[ug,hg],[xg,Gg]];return xg=Gg=-(hg=ug=1/0),t}};var Ag,Lg,Rg,mg,Vg=0,Sg=0,Zg=0,pg=0,Eg=0,Ng=0,Xg=0,Wg=0,Hg=0,Dg={point:fg,lineStart:wg,lineEnd:Jg,polygonStart:function(){Dg.lineStart=kg,Dg.lineEnd=Mg},polygonEnd:function(){Dg.point=fg,Dg.lineStart=wg,Dg.lineEnd=Jg},result:function(){var t=Hg?[Xg/Hg,Wg/Hg]:Ng?[pg/Ng,Eg/Ng]:Zg?[Vg/Zg,Sg/Zg]:[NaN,NaN];return Vg=Sg=Zg=pg=Eg=Ng=Xg=Wg=Hg=0,t}};function fg(t,B){Vg+=t,Sg+=B,++Zg}function wg(){Dg.point=vg}function vg(t,B){Dg.point=Yg,fg(Rg=t,mg=B)}function Yg(t,B){var s=t-Rg,Q=B-mg,F=GU(s*s+Q*Q);pg+=F*(Rg+t)/2,Eg+=F*(mg+B)/2,Ng+=F,fg(Rg=t,mg=B)}function Jg(){Dg.point=fg}function kg(){Dg.point=Tg}function Mg(){zg(Ag,Lg)}function Tg(t,B){Dg.point=zg,fg(Ag=Rg=t,Lg=mg=B)}function zg(t,B){var s=t-Rg,Q=B-mg,F=GU(s*s+Q*Q);pg+=F*(Rg+t)/2,Eg+=F*(mg+B)/2,Ng+=F,Xg+=(F=mg*t-Rg*B)*(Rg+t),Wg+=F*(mg+B),Hg+=3*F,fg(Rg=t,mg=B)}function Kg(t){this._context=t}Kg.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,B){switch(this._point){case 0:this._context.moveTo(t,B),this._point=1;break;case 1:this._context.lineTo(t,B);break;default:this._context.moveTo(t+this._radius,B),this._context.arc(t,B,this._radius,0,lU)}},result:RU};var Og,Pg,jg,_g,$g,qg=new Rt,te={point:RU,lineStart:function(){te.point=Be},lineEnd:function(){Og&&se(Pg,jg),te.point=RU},polygonStart:function(){Og=!0},polygonEnd:function(){Og=null},result:function(){var t=+qg;return qg=new Rt,t}};function Be(t,B){te.point=se,Pg=_g=t,jg=$g=B}function se(t,B){_g-=t,$g-=B,qg.add(GU(_g*_g+$g*$g)),_g=t,$g=B}let Qe,Fe,ie,Ue;class ge{constructor(t){this._append=null==t?ee:function(t){const B=Math.floor(t);if(!(B>=0))throw new RangeError(`invalid digits: ${t}`);if(B>15)return ee;if(B!==Qe){const t=10**B;Qe=B,Fe=function(B){let s=1;this._+=B[0];for(const Q=B.length;s<Q;++s)this._+=Math.round(arguments[s]*t)/t+B[s]}}return Fe}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,B){switch(this._point){case 0:this._append`M${t},${B}`,this._point=1;break;case 1:this._append`L${t},${B}`;break;default:if(this._append`M${t},${B}`,this._radius!==ie||this._append!==Fe){const t=this._radius,B=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,ie=t,Fe=this._append,Ue=this._,this._=B}this._+=Ue}}result(){const t=this._;return this._="",t.length?t:null}}function ee(t){let B=1;this._+=t[0];for(const s=t.length;B<s;++B)this._+=arguments[B]+t[B]}function Ie(t,B){let s,Q,F=3,i=4.5;function U(t){return t&&("function"==typeof i&&Q.pointRadius(+i.apply(this,arguments)),EU(t,s(Q))),Q.result()}return U.area=function(t){return EU(t,s(dg)),dg.result()},U.measure=function(t){return EU(t,s(te)),te.result()},U.bounds=function(t){return EU(t,s(yg)),yg.result()},U.centroid=function(t){return EU(t,s(Dg)),Dg.result()},U.projection=function(B){return arguments.length?(s=null==B?(t=null,cg):(t=B).stream,U):t},U.context=function(t){return arguments.length?(Q=null==t?(B=null,new ge(F)):new Kg(B=t),"function"!=typeof i&&Q.pointRadius(i),U):B},U.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(Q.pointRadius(+t),+t),U):i},U.digits=function(t){if(!arguments.length)return F;if(null==t)F=null;else{const B=Math.floor(t);if(!(B>=0))throw new RangeError(`invalid digits: ${t}`);F=B}return null===B&&(Q=new ge(F)),U},U.projection(t).digits(F).context(B)}function le(t){return{stream:ce(t)}}function ce(t){return function(B){var s=new ne;for(var Q in t)s[Q]=t[Q];return s.stream=B,s}}function ne(){}function ae(t,B,s){var Q=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=Q&&t.clipExtent(null),EU(s,t.stream(yg)),B(yg.result()),null!=Q&&t.clipExtent(Q),t}function de(t,B,s){return ae(t,function(s){var Q=B[1][0]-B[0][0],F=B[1][1]-B[0][1],i=Math.min(Q/(s[1][0]-s[0][0]),F/(s[1][1]-s[0][1])),U=+B[0][0]+(Q-i*(s[1][0]+s[0][0]))/2,g=+B[0][1]+(F-i*(s[1][1]+s[0][1]))/2;t.scale(150*i).translate([U,g])},s)}function oe(t,B,s){return de(t,[[0,0],B],s)}function be(t,B,s){return ae(t,function(s){var Q=+B,F=Q/(s[1][0]-s[0][0]),i=(Q-F*(s[1][0]+s[0][0]))/2,U=-F*s[0][1];t.scale(150*F).translate([i,U])},s)}function Ce(t,B,s){return ae(t,function(s){var Q=+B,F=Q/(s[1][1]-s[0][1]),i=-F*s[0][0],U=(Q-F*(s[1][1]+s[0][1]))/2;t.scale(150*F).translate([i,U])},s)}ne.prototype={constructor:ne,point:function(t,B){this.stream.point(t,B)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var re=bU(30*nU);function ue(t,B){return+B?function(t,B){function s(Q,F,i,U,g,e,I,l,c,n,a,d,o,b){var C=I-Q,r=l-F,u=C*C+r*r;if(u>4*B&&o--){var h=U+n,x=g+a,G=e+d,y=GU(h*h+x*x+G*G),A=LU(G/=y),L=aU(aU(G)-1)<UU||aU(i-c)<UU?(i+c)/2:oU(x,h),R=t(L,A),m=R[0],V=R[1],S=m-Q,Z=V-F,p=r*S-C*Z;(p*p/u>B||aU((C*S+r*Z)/u-.5)>.3||U*n+g*a+e*d<re)&&(s(Q,F,i,U,g,e,m,V,L,h/=y,x/=y,G,o,b),b.point(m,V),s(m,V,L,h,x,G,I,l,c,n,a,d,o,b))}}return function(B){var Q,F,i,U,g,e,I,l,c,n,a,d,o={point:b,lineStart:C,lineEnd:u,polygonStart:function(){B.polygonStart(),o.lineStart=h},polygonEnd:function(){B.polygonEnd(),o.lineStart=C}};function b(s,Q){s=t(s,Q),B.point(s[0],s[1])}function C(){l=NaN,o.point=r,B.lineStart()}function r(Q,F){var i=XU([Q,F]),U=t(Q,F);s(l,c,I,n,a,d,l=U[0],c=U[1],I=Q,n=i[0],a=i[1],d=i[2],16,B),B.point(l,c)}function u(){o.point=b,B.lineEnd()}function h(){C(),o.point=x,o.lineEnd=G}function x(t,B){r(Q=t,B),F=l,i=c,U=n,g=a,e=d,o.point=r}function G(){s(l,c,I,n,a,d,F,i,Q,U,g,e,16,B),o.lineEnd=u,u()}return o}}(t,B):function(t){return ce({point:function(B,s){B=t(B,s),this.stream.point(B[0],B[1])}})}(t)}var he=ce({point:function(t,B){this.stream.point(t*nU,B*nU)}});function xe(t,B,s,Q,F,i){if(!i)return function(t,B,s,Q,F){function i(i,U){return[B+t*(i*=Q),s-t*(U*=F)]}return i.invert=function(i,U){return[(i-B)/t*Q,(s-U)/t*F]},i}(t,B,s,Q,F);var U=bU(i),g=hU(i),e=U*t,I=g*t,l=U/t,c=g/t,n=(g*s-U*B)/t,a=(g*B+U*s)/t;function d(t,i){return[e*(t*=Q)-I*(i*=F)+B,s-I*t-e*i]}return d.invert=function(t,B){return[Q*(l*t-c*B+n),F*(a-c*t-l*B)]},d}function Ge(t){return ye(function(){return t})()}function ye(t){var B,s,Q,F,i,U,g,e,I,l,c=150,n=480,a=250,d=0,o=0,b=0,C=0,r=0,u=0,h=1,x=1,G=null,y=sg,A=null,L=cg,R=.5;function m(t){return e(t[0]*nU,t[1]*nU)}function V(t){return(t=e.invert(t[0],t[1]))&&[t[0]*cU,t[1]*cU]}function S(){var t=xe(c,0,0,h,x,u).apply(null,B(d,o)),Q=xe(c,n-t[0],a-t[1],h,x,u);return s=JU(b,C,r),g=vU(B,Q),e=vU(s,g),U=ue(g,R),Z()}function Z(){return I=l=null,m}return m.stream=function(t){return I&&l===t?I:I=he(function(t){return ce({point:function(B,s){var Q=t(B,s);return this.stream.point(Q[0],Q[1])}})}(s)(y(U(L(l=t)))))},m.preclip=function(t){return arguments.length?(y=t,G=void 0,Z()):y},m.postclip=function(t){return arguments.length?(L=t,A=Q=F=i=null,Z()):L},m.clipAngle=function(t){return arguments.length?(y=+t?Qg(G=t*nU):(G=null,sg),Z()):G*cU},m.clipExtent=function(t){return arguments.length?(L=null==t?(A=Q=F=i=null,cg):Ug(A=+t[0][0],Q=+t[0][1],F=+t[1][0],i=+t[1][1]),Z()):null==A?null:[[A,Q],[F,i]]},m.scale=function(t){return arguments.length?(c=+t,S()):c},m.translate=function(t){return arguments.length?(n=+t[0],a=+t[1],S()):[n,a]},m.center=function(t){return arguments.length?(d=t[0]%360*nU,o=t[1]%360*nU,S()):[d*cU,o*cU]},m.rotate=function(t){return arguments.length?(b=t[0]%360*nU,C=t[1]%360*nU,r=t.length>2?t[2]%360*nU:0,S()):[b*cU,C*cU,r*cU]},m.angle=function(t){return arguments.length?(u=t%360*nU,S()):u*cU},m.reflectX=function(t){return arguments.length?(h=t?-1:1,S()):h<0},m.reflectY=function(t){return arguments.length?(x=t?-1:1,S()):x<0},m.precision=function(t){return arguments.length?(U=ue(g,R=t*t),Z()):GU(R)},m.fitExtent=function(t,B){return de(m,t,B)},m.fitSize=function(t,B){return oe(m,t,B)},m.fitWidth=function(t,B){return be(m,t,B)},m.fitHeight=function(t,B){return Ce(m,t,B)},function(){return B=t.apply(this,arguments),m.invert=B.invert&&V,S()}}function Ae(t){var B=0,s=gU/3,Q=ye(t),F=Q(B,s);return F.parallels=function(t){return arguments.length?Q(B=t[0]*nU,s=t[1]*nU):[B*cU,s*cU]},F}function Le(t,B){var s=hU(t),Q=(s+hU(B))/2;if(aU(Q)<UU)return function(t){var B=bU(t);function s(t,s){return[t*B,hU(s)/B]}return s.invert=function(t,s){return[t/B,LU(s*B)]},s}(t);var F=1+s*(2*Q-s),i=GU(F)/Q;function U(t,B){var s=GU(F-2*Q*hU(B))/Q;return[s*hU(t*=Q),i-s*bU(t)]}return U.invert=function(t,B){var s=i-B,U=oU(t,aU(s))*xU(s);return s*Q<0&&(U-=gU*xU(t)*xU(s)),[U/Q,LU((F-(t*t+s*s)*Q*Q)/(2*Q))]},U}function Re(){return Ae(Le).scale(155.424).center([0,33.6442])}function me(){return Re().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ve(){var t,B,s,Q,F,i,U=me(),g=Re().rotate([154,0]).center([-2,58.5]).parallels([55,65]),e=Re().rotate([157,0]).center([-3,19.9]).parallels([8,18]),I={point:function(t,B){i=[t,B]}};function l(t){var B=t[0],U=t[1];return i=null,s.point(B,U),i||(Q.point(B,U),i)||(F.point(B,U),i)}function c(){return t=B=null,l}return l.invert=function(t){var B=U.scale(),s=U.translate(),Q=(t[0]-s[0])/B,F=(t[1]-s[1])/B;return(F>=.12&&F<.234&&Q>=-.425&&Q<-.214?g:F>=.166&&F<.234&&Q>=-.214&&Q<-.115?e:U).invert(t)},l.stream=function(s){return t&&B===s?t:t=function(t){var B=t.length;return{point:function(s,Q){for(var F=-1;++F<B;)t[F].point(s,Q)},sphere:function(){for(var s=-1;++s<B;)t[s].sphere()},lineStart:function(){for(var s=-1;++s<B;)t[s].lineStart()},lineEnd:function(){for(var s=-1;++s<B;)t[s].lineEnd()},polygonStart:function(){for(var s=-1;++s<B;)t[s].polygonStart()},polygonEnd:function(){for(var s=-1;++s<B;)t[s].polygonEnd()}}}([U.stream(B=s),g.stream(s),e.stream(s)])},l.precision=function(t){return arguments.length?(U.precision(t),g.precision(t),e.precision(t),c()):U.precision()},l.scale=function(t){return arguments.length?(U.scale(t),g.scale(.35*t),e.scale(t),l.translate(U.translate())):U.scale()},l.translate=function(t){if(!arguments.length)return U.translate();var B=U.scale(),i=+t[0],l=+t[1];return s=U.translate(t).clipExtent([[i-.455*B,l-.238*B],[i+.455*B,l+.238*B]]).stream(I),Q=g.translate([i-.307*B,l+.201*B]).clipExtent([[i-.425*B+UU,l+.12*B+UU],[i-.214*B-UU,l+.234*B-UU]]).stream(I),F=e.translate([i-.205*B,l+.212*B]).clipExtent([[i-.214*B+UU,l+.166*B+UU],[i-.115*B-UU,l+.234*B-UU]]).stream(I),c()},l.fitExtent=function(t,B){return de(l,t,B)},l.fitSize=function(t,B){return oe(l,t,B)},l.fitWidth=function(t,B){return be(l,t,B)},l.fitHeight=function(t,B){return Ce(l,t,B)},l.scale(1070)}function Se(t){return function(B,s){var Q=bU(B),F=bU(s),i=t(Q*F);return i===1/0?[2,0]:[i*F*hU(B),i*hU(s)]}}function Ze(t){return function(B,s){var Q=GU(B*B+s*s),F=t(Q),i=hU(F),U=bU(F);return[oU(B*i,Q*U),LU(Q&&s*i/Q)]}}var pe=Se(function(t){return GU(2/(1+t))});function Ee(){return Ge(pe).scale(124.75).clipAngle(179.999)}pe.invert=Ze(function(t){return 2*LU(t/2)});var Ne=Se(function(t){return(t=AU(t))&&t/hU(t)});function Xe(){return Ge(Ne).scale(79.4188).clipAngle(179.999)}function We(t,B){return[t,rU(yU((eU+B)/2))]}function He(){return De(We).scale(961/lU)}function De(t){var B,s,Q,F=Ge(t),i=F.center,U=F.scale,g=F.translate,e=F.clipExtent,I=null;function l(){var i=gU*U(),g=F(function(t){function B(B){return(B=t(B[0]*nU,B[1]*nU))[0]*=cU,B[1]*=cU,B}return t=JU(t[0]*nU,t[1]*nU,t.length>2?t[2]*nU:0),B.invert=function(B){return(B=t.invert(B[0]*nU,B[1]*nU))[0]*=cU,B[1]*=cU,B},B}(F.rotate()).invert([0,0]));return e(null==I?[[g[0]-i,g[1]-i],[g[0]+i,g[1]+i]]:t===We?[[Math.max(g[0]-i,I),B],[Math.min(g[0]+i,s),Q]]:[[I,Math.max(g[1]-i,B)],[s,Math.min(g[1]+i,Q)]])}return F.scale=function(t){return arguments.length?(U(t),l()):U()},F.translate=function(t){return arguments.length?(g(t),l()):g()},F.center=function(t){return arguments.length?(i(t),l()):i()},F.clipExtent=function(t){return arguments.length?(null==t?I=B=s=Q=null:(I=+t[0][0],B=+t[0][1],s=+t[1][0],Q=+t[1][1]),l()):null==I?null:[[I,B],[s,Q]]},l()}function fe(t){return yU((eU+t)/2)}function we(t,B){var s=bU(t),Q=t===B?hU(t):rU(s/bU(B))/rU(fe(B)/fe(t)),F=s*uU(fe(t),Q)/Q;if(!Q)return We;function i(t,B){F>0?B<-eU+UU&&(B=-eU+UU):B>eU-UU&&(B=eU-UU);var s=F/uU(fe(B),Q);return[s*hU(Q*t),F-s*bU(Q*t)]}return i.invert=function(t,B){var s=F-B,i=xU(Q)*GU(t*t+s*s),U=oU(t,aU(s))*xU(s);return s*Q<0&&(U-=gU*xU(t)*xU(s)),[U/Q,2*dU(uU(F/i,1/Q))-eU]},i}function ve(){return Ae(we).scale(109.5).parallels([30,30])}function Ye(t,B){return[t,B]}function Je(){return Ge(Ye).scale(152.63)}function ke(t,B){var s=bU(t),Q=t===B?hU(t):(s-bU(B))/(B-t),F=s/Q+t;if(aU(Q)<UU)return Ye;function i(t,B){var s=F-B,i=Q*t;return[s*hU(i),F-s*bU(i)]}return i.invert=function(t,B){var s=F-B,i=oU(t,aU(s))*xU(s);return s*Q<0&&(i-=gU*xU(t)*xU(s)),[i/Q,F-xU(Q)*GU(t*t+s*s)]},i}function Me(){return Ae(ke).scale(131.154).center([0,13.9389])}Ne.invert=Ze(function(t){return t}),We.invert=function(t,B){return[t,2*dU(CU(B))-eU]},Ye.invert=Ye;var Te=1.340264,ze=-.081106,Ke=893e-6,Oe=.003796,Pe=GU(3)/2;function je(t,B){var s=LU(Pe*hU(B)),Q=s*s,F=Q*Q*Q;return[t*bU(s)/(Pe*(Te+3*ze*Q+F*(7*Ke+9*Oe*Q))),s*(Te+ze*Q+F*(Ke+Oe*Q))]}function _e(){return Ge(je).scale(177.158)}function $e(t,B){var s=bU(B),Q=bU(t)*s;return[s*hU(t)/Q,hU(B)/Q]}function qe(){return Ge($e).scale(144.049).clipAngle(60)}function tI(t,B){return[bU(B)*hU(t),hU(B)]}function BI(){return Ge(tI).scale(249.5).clipAngle(90.000001)}function sI(t,B){var s=bU(B),Q=1+bU(t)*s;return[s*hU(t)/Q,hU(B)/Q]}function QI(){return Ge(sI).scale(250).clipAngle(142)}function FI(t,B){return[rU(yU((eU+B)/2)),-t]}function iI(){var t=De(FI),B=t.center,s=t.rotate;return t.center=function(t){return arguments.length?B([-t[1],t[0]]):[(t=B())[1],-t[0]]},t.rotate=function(t){return arguments.length?s([t[0],t[1],t.length>2?t[2]+90:90]):[(t=s())[0],t[1],t[2]-90]},s([0,0,90]).scale(159.155)}function UI(t,B){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(B).domain(t)}return this}function gI(t,B){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof B?this.interpolator(B):this.range(B)}return this}je.invert=function(t,B){for(var s,Q=B,F=Q*Q,i=F*F*F,U=0;U<12&&(i=(F=(Q-=s=(Q*(Te+ze*F+i*(Ke+Oe*F))-B)/(Te+3*ze*F+i*(7*Ke+9*Oe*F)))*Q)*F*F,!(aU(s)<1e-12));++U);return[Pe*t*(Te+3*ze*F+i*(7*Ke+9*Oe*F))/bU(Q),LU(hU(Q)/Pe)]},$e.invert=Ze(dU),tI.invert=Ze(LU),sI.invert=Ze(function(t){return 2*dU(t)}),FI.invert=function(t,B){return[-B,2*dU(CU(t))-eU]};const eI=Symbol("implicit");function II(){var t=new mt,B=[],s=[],Q=eI;function F(F){let i=t.get(F);if(void 0===i){if(Q!==eI)return Q;t.set(F,i=B.push(F)-1)}return s[i%s.length]}return F.domain=function(s){if(!arguments.length)return B.slice();B=[],t=new mt;for(const Q of s)t.has(Q)||t.set(Q,B.push(Q)-1);return F},F.range=function(t){return arguments.length?(s=Array.from(t),F):s.slice()},F.unknown=function(t){return arguments.length?(Q=t,F):Q},F.copy=function(){return II(B,s).unknown(Q)},UI.apply(F,arguments),F}function lI(){var t,B,s=II().unknown(void 0),Q=s.domain,F=s.range,i=0,U=1,g=!1,e=0,I=0,l=.5;function c(){var s=Q().length,c=U<i,n=c?U:i,a=c?i:U;t=(a-n)/Math.max(1,s-e+2*I),g&&(t=Math.floor(t)),n+=(a-n-t*(s-e))*l,B=t*(1-e),g&&(n=Math.round(n),B=Math.round(B));var d=nB(s).map(function(B){return n+t*B});return F(c?d.reverse():d)}return delete s.unknown,s.domain=function(t){return arguments.length?(Q(t),c()):Q()},s.range=function(t){return arguments.length?([i,U]=t,i=+i,U=+U,c()):[i,U]},s.rangeRound=function(t){return[i,U]=t,i=+i,U=+U,g=!0,c()},s.bandwidth=function(){return B},s.step=function(){return t},s.round=function(t){return arguments.length?(g=!!t,c()):g},s.padding=function(t){return arguments.length?(e=Math.min(1,I=+t),c()):e},s.paddingInner=function(t){return arguments.length?(e=Math.min(1,t),c()):e},s.paddingOuter=function(t){return arguments.length?(I=+t,c()):I},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},s.copy=function(){return lI(Q(),[i,U]).round(g).paddingInner(e).paddingOuter(I).align(l)},UI.apply(c(),arguments)}function cI(t){var B=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return cI(B())},t}function nI(){return cI(lI.apply(null,arguments).paddingInner(1))}function aI(t){return+t}var dI=[0,1];function oI(t){return t}function bI(t,B){return(B-=t=+t)?function(s){return(s-t)/B}:function(t){return function(){return t}}(isNaN(B)?NaN:.5)}function CI(t,B,s){var Q=t[0],F=t[1],i=B[0],U=B[1];return F<Q?(Q=bI(F,Q),i=s(U,i)):(Q=bI(Q,F),i=s(i,U)),function(t){return i(Q(t))}}function rI(t,B,s){var Q=Math.min(t.length,B.length)-1,F=new Array(Q),i=new Array(Q),U=-1;for(t[Q]<t[0]&&(t=t.slice().reverse(),B=B.slice().reverse());++U<Q;)F[U]=bI(t[U],t[U+1]),i[U]=s(B[U],B[U+1]);return function(B){var s=Ct(t,B,1,Q)-1;return i[s](F[s](B))}}function uI(t,B){return B.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function hI(){var t,B,s,Q,F,i,U=dI,g=dI,e=mF,I=oI;function l(){var t=Math.min(U.length,g.length);return I!==oI&&(I=function(t,B){var s;return t>B&&(s=t,t=B,B=s),function(s){return Math.max(t,Math.min(B,s))}}(U[0],U[t-1])),Q=t>2?rI:CI,F=i=null,c}function c(B){return null==B||isNaN(B=+B)?s:(F||(F=Q(U.map(t),g,e)))(t(I(B)))}return c.invert=function(s){return I(B((i||(i=Q(g,U.map(t),GF)))(s)))},c.domain=function(t){return arguments.length?(U=Array.from(t,aI),l()):U.slice()},c.range=function(t){return arguments.length?(g=Array.from(t),l()):g.slice()},c.rangeRound=function(t){return g=Array.from(t),e=VF,l()},c.clamp=function(t){return arguments.length?(I=!!t||oI,l()):I!==oI},c.interpolate=function(t){return arguments.length?(e=t,l()):e},c.unknown=function(t){return arguments.length?(s=t,c):s},function(s,Q){return t=s,B=Q,l()}}function xI(){return hI()(oI,oI)}function GI(t,B,s,Q){var F,i=Ot(t,B,s);switch((Q=Pi(null==Q?",f":Q)).type){case"s":var U=Math.max(Math.abs(t),Math.abs(B));return null!=Q.precision||isNaN(F=function(t,B){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zi(B)/3)))-zi(Math.abs(t)))}(i,U))||(Q.precision=F),sU(Q,U);case"":case"e":case"g":case"p":case"r":null!=Q.precision||isNaN(F=function(t,B){return t=Math.abs(t),B=Math.abs(B)-t,Math.max(0,zi(B)-zi(t))+1}(i,Math.max(Math.abs(t),Math.abs(B))))||(Q.precision=F-("e"===Q.type));break;case"f":case"%":null!=Q.precision||isNaN(F=function(t){return Math.max(0,-zi(Math.abs(t)))}(i))||(Q.precision=F-2*("%"===Q.type))}return BU(Q)}function yI(t){var B=t.domain;return t.ticks=function(t){var s=B();return zt(s[0],s[s.length-1],null==t?10:t)},t.tickFormat=function(t,s){var Q=B();return GI(Q[0],Q[Q.length-1],null==t?10:t,s)},t.nice=function(s){null==s&&(s=10);var Q,F,i=B(),U=0,g=i.length-1,e=i[U],I=i[g],l=10;for(I<e&&(F=e,e=I,I=F,F=U,U=g,g=F);l-- >0;){if((F=Kt(e,I,s))===Q)return i[U]=e,i[g]=I,B(i);if(F>0)e=Math.floor(e/F)*F,I=Math.ceil(I/F)*F;else{if(!(F<0))break;e=Math.ceil(e*F)/F,I=Math.floor(I*F)/F}Q=F}return t},t}function AI(){var t=xI();return t.copy=function(){return uI(t,AI())},UI.apply(t,arguments),yI(t)}function LI(t){var B;function s(t){return null==t||isNaN(t=+t)?B:t}return s.invert=s,s.domain=s.range=function(B){return arguments.length?(t=Array.from(B,aI),s):t.slice()},s.unknown=function(t){return arguments.length?(B=t,s):B},s.copy=function(){return LI(t).unknown(B)},t=arguments.length?Array.from(t,aI):[0,1],yI(s)}function RI(t,B){var s,Q=0,F=(t=t.slice()).length-1,i=t[Q],U=t[F];return U<i&&(s=Q,Q=F,F=s,s=i,i=U,U=s),t[Q]=B.floor(i),t[F]=B.ceil(U),t}function mI(t){return Math.log(t)}function VI(t){return Math.exp(t)}function SI(t){return-Math.log(-t)}function ZI(t){return-Math.exp(-t)}function pI(t){return isFinite(t)?+("1e"+t):t<0?0:t}function EI(t){return(B,s)=>-t(-B,s)}function NI(t){const B=t(mI,VI),s=B.domain;let Q,F,i=10;function U(){return Q=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),B=>Math.log(B)/t)}(i),F=function(t){return 10===t?pI:t===Math.E?Math.exp:B=>Math.pow(t,B)}(i),s()[0]<0?(Q=EI(Q),F=EI(F),t(SI,ZI)):t(mI,VI),B}return B.base=function(t){return arguments.length?(i=+t,U()):i},B.domain=function(t){return arguments.length?(s(t),U()):s()},B.ticks=t=>{const B=s();let U=B[0],g=B[B.length-1];const e=g<U;e&&([U,g]=[g,U]);let I,l,c=Q(U),n=Q(g);const a=null==t?10:+t;let d=[];if(!(i%1)&&n-c<a){if(c=Math.floor(c),n=Math.ceil(n),U>0){for(;c<=n;++c)for(I=1;I<i;++I)if(l=c<0?I/F(-c):I*F(c),!(l<U)){if(l>g)break;d.push(l)}}else for(;c<=n;++c)for(I=i-1;I>=1;--I)if(l=c>0?I/F(-c):I*F(c),!(l<U)){if(l>g)break;d.push(l)}2*d.length<a&&(d=zt(U,g,a))}else d=zt(c,n,Math.min(n-c,a)).map(F);return e?d.reverse():d},B.tickFormat=(t,s)=>{if(null==t&&(t=10),null==s&&(s=10===i?"s":","),"function"!=typeof s&&(i%1||null!=(s=Pi(s)).precision||(s.trim=!0),s=BU(s)),t===1/0)return s;const U=Math.max(1,i*t/B.ticks().length);return t=>{let B=t/F(Math.round(Q(t)));return B*i<i-.5&&(B*=i),B<=U?s(t):""}},B.nice=()=>s(RI(s(),{floor:t=>F(Math.floor(Q(t))),ceil:t=>F(Math.ceil(Q(t)))})),B}function XI(){const t=NI(hI()).domain([1,10]);return t.copy=()=>uI(t,XI()).base(t.base()),UI.apply(t,arguments),t}function WI(t){return function(B){return Math.sign(B)*Math.log1p(Math.abs(B/t))}}function HI(t){return function(B){return Math.sign(B)*Math.expm1(Math.abs(B))*t}}function DI(t){var B=1,s=t(WI(B),HI(B));return s.constant=function(s){return arguments.length?t(WI(B=+s),HI(B)):B},yI(s)}function fI(){var t=DI(hI());return t.copy=function(){return uI(t,fI()).constant(t.constant())},UI.apply(t,arguments)}function wI(t){return function(B){return B<0?-Math.pow(-B,t):Math.pow(B,t)}}function vI(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function YI(t){return t<0?-t*t:t*t}function JI(t){var B=t(oI,oI),s=1;return B.exponent=function(B){return arguments.length?1===(s=+B)?t(oI,oI):.5===s?t(vI,YI):t(wI(s),wI(1/s)):s},yI(B)}function kI(){var t=JI(hI());return t.copy=function(){return uI(t,kI()).exponent(t.exponent())},UI.apply(t,arguments),t}function MI(){var t,B=[],s=[],Q=[];function F(){var t=0,F=Math.max(1,s.length);for(Q=new Array(F-1);++t<F;)Q[t-1]=FB(B,t/F);return i}function i(B){return null==B||isNaN(B=+B)?t:s[Ct(Q,B)]}return i.invertExtent=function(t){var F=s.indexOf(t);return F<0?[NaN,NaN]:[F>0?Q[F-1]:B[0],F<Q.length?Q[F]:B[B.length-1]]},i.domain=function(t){if(!arguments.length)return B.slice();B=[];for(let s of t)null==s||isNaN(s=+s)||B.push(s);return B.sort(nt),F()},i.range=function(t){return arguments.length?(s=Array.from(t),F()):s.slice()},i.unknown=function(B){return arguments.length?(t=B,i):t},i.quantiles=function(){return Q.slice()},i.copy=function(){return MI().domain(B).range(s).unknown(t)},UI.apply(i,arguments)}function TI(){var t,B=[.5],s=[0,1],Q=1;function F(F){return null!=F&&F<=F?s[Ct(B,F,0,Q)]:t}return F.domain=function(t){return arguments.length?(B=Array.from(t),Q=Math.min(B.length,s.length-1),F):B.slice()},F.range=function(t){return arguments.length?(s=Array.from(t),Q=Math.min(B.length,s.length-1),F):s.slice()},F.invertExtent=function(t){var Q=s.indexOf(t);return[B[Q-1],B[Q]]},F.unknown=function(B){return arguments.length?(t=B,F):t},F.copy=function(){return TI().domain(B).range(s).unknown(t)},UI.apply(F,arguments)}const zI=new Date,KI=new Date;function OI(t,B,s,Q){function F(B){return t(B=0===arguments.length?new Date:new Date(+B)),B}return F.floor=B=>(t(B=new Date(+B)),B),F.ceil=s=>(t(s=new Date(s-1)),B(s,1),t(s),s),F.round=t=>{const B=F(t),s=F.ceil(t);return t-B<s-t?B:s},F.offset=(t,s)=>(B(t=new Date(+t),null==s?1:Math.floor(s)),t),F.range=(s,Q,i)=>{const U=[];if(s=F.ceil(s),i=null==i?1:Math.floor(i),!(s<Q&&i>0))return U;let g;do{U.push(g=new Date(+s)),B(s,i),t(s)}while(g<s&&s<Q);return U},F.filter=s=>OI(B=>{if(B>=B)for(;t(B),!s(B);)B.setTime(B-1)},(t,Q)=>{if(t>=t)if(Q<0)for(;++Q<=0;)for(;B(t,-1),!s(t););else for(;--Q>=0;)for(;B(t,1),!s(t););}),s&&(F.count=(B,Q)=>(zI.setTime(+B),KI.setTime(+Q),t(zI),t(KI),Math.floor(s(zI,KI))),F.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?F.filter(Q?B=>Q(B)%t===0:B=>F.count(0,B)%t===0):F:null)),F}const PI=OI(()=>{},(t,B)=>{t.setTime(+t+B)},(t,B)=>B-t);PI.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?OI(B=>{B.setTime(Math.floor(B/t)*t)},(B,s)=>{B.setTime(+B+s*t)},(B,s)=>(s-B)/t):PI:null),PI.range;const jI=1e3,_I=6e4,$I=36e5,qI=864e5,tl=6048e5,Bl=2592e6,sl=31536e6,Ql=OI(t=>{t.setTime(t-t.getMilliseconds())},(t,B)=>{t.setTime(+t+B*jI)},(t,B)=>(B-t)/jI,t=>t.getUTCSeconds());Ql.range;const Fl=OI(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jI)},(t,B)=>{t.setTime(+t+B*_I)},(t,B)=>(B-t)/_I,t=>t.getMinutes());Fl.range;const il=OI(t=>{t.setUTCSeconds(0,0)},(t,B)=>{t.setTime(+t+B*_I)},(t,B)=>(B-t)/_I,t=>t.getUTCMinutes());il.range;const Ul=OI(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*jI-t.getMinutes()*_I)},(t,B)=>{t.setTime(+t+B*$I)},(t,B)=>(B-t)/$I,t=>t.getHours());Ul.range;const gl=OI(t=>{t.setUTCMinutes(0,0,0)},(t,B)=>{t.setTime(+t+B*$I)},(t,B)=>(B-t)/$I,t=>t.getUTCHours());gl.range;const el=OI(t=>t.setHours(0,0,0,0),(t,B)=>t.setDate(t.getDate()+B),(t,B)=>(B-t-(B.getTimezoneOffset()-t.getTimezoneOffset())*_I)/qI,t=>t.getDate()-1);el.range;const Il=OI(t=>{t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+B)},(t,B)=>(B-t)/qI,t=>t.getUTCDate()-1);Il.range;const ll=OI(t=>{t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+B)},(t,B)=>(B-t)/qI,t=>Math.floor(t/qI));function cl(t){return OI(B=>{B.setDate(B.getDate()-(B.getDay()+7-t)%7),B.setHours(0,0,0,0)},(t,B)=>{t.setDate(t.getDate()+7*B)},(t,B)=>(B-t-(B.getTimezoneOffset()-t.getTimezoneOffset())*_I)/tl)}ll.range;const nl=cl(0),al=cl(1),dl=cl(2),ol=cl(3),bl=cl(4),Cl=cl(5),rl=cl(6);function ul(t){return OI(B=>{B.setUTCDate(B.getUTCDate()-(B.getUTCDay()+7-t)%7),B.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCDate(t.getUTCDate()+7*B)},(t,B)=>(B-t)/tl)}nl.range,al.range,dl.range,ol.range,bl.range,Cl.range,rl.range;const hl=ul(0),xl=ul(1),Gl=ul(2),yl=ul(3),Al=ul(4),Ll=ul(5),Rl=ul(6);hl.range,xl.range,Gl.range,yl.range,Al.range,Ll.range,Rl.range;const ml=OI(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,B)=>{t.setMonth(t.getMonth()+B)},(t,B)=>B.getMonth()-t.getMonth()+12*(B.getFullYear()-t.getFullYear()),t=>t.getMonth());ml.range;const Vl=OI(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCMonth(t.getUTCMonth()+B)},(t,B)=>B.getUTCMonth()-t.getUTCMonth()+12*(B.getUTCFullYear()-t.getUTCFullYear()),t=>t.getUTCMonth());Vl.range;const Sl=OI(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,B)=>{t.setFullYear(t.getFullYear()+B)},(t,B)=>B.getFullYear()-t.getFullYear(),t=>t.getFullYear());Sl.every=t=>isFinite(t=Math.floor(t))&&t>0?OI(B=>{B.setFullYear(Math.floor(B.getFullYear()/t)*t),B.setMonth(0,1),B.setHours(0,0,0,0)},(B,s)=>{B.setFullYear(B.getFullYear()+s*t)}):null,Sl.range;const Zl=OI(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,B)=>{t.setUTCFullYear(t.getUTCFullYear()+B)},(t,B)=>B.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function pl(t,B,s,Q,F,i){const U=[[Ql,1,jI],[Ql,5,5e3],[Ql,15,15e3],[Ql,30,3e4],[i,1,_I],[i,5,3e5],[i,15,9e5],[i,30,18e5],[F,1,$I],[F,3,108e5],[F,6,216e5],[F,12,432e5],[Q,1,qI],[Q,2,1728e5],[s,1,tl],[B,1,Bl],[B,3,7776e6],[t,1,sl]];function g(B,s,Q){const F=Math.abs(s-B)/Q,i=dt(([,,t])=>t).right(U,F);if(i===U.length)return t.every(Ot(B/sl,s/sl,Q));if(0===i)return PI.every(Math.max(Ot(B,s,Q),1));const[g,e]=U[F/U[i-1][2]<U[i][2]/F?i-1:i];return g.every(e)}return[function(t,B,s){const Q=B<t;Q&&([t,B]=[B,t]);const F=s&&"function"==typeof s.range?s:g(t,B,s),i=F?F.range(t,+B+1):[];return Q?i.reverse():i},g]}Zl.every=t=>isFinite(t=Math.floor(t))&&t>0?OI(B=>{B.setUTCFullYear(Math.floor(B.getUTCFullYear()/t)*t),B.setUTCMonth(0,1),B.setUTCHours(0,0,0,0)},(B,s)=>{B.setUTCFullYear(B.getUTCFullYear()+s*t)}):null,Zl.range;const[El,Nl]=pl(Zl,Vl,hl,ll,gl,il),[Xl,Wl]=pl(Sl,ml,nl,el,Ul,Fl);function Hl(t){if(0<=t.y&&t.y<100){var B=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return B.setFullYear(t.y),B}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Dl(t){if(0<=t.y&&t.y<100){var B=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return B.setUTCFullYear(t.y),B}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function fl(t,B,s){return{y:t,m:B,d:s,H:0,M:0,S:0,L:0}}var wl,vl,Yl,Jl={"-":"",_:" ",0:"0"},kl=/^\s*\d+/,Ml=/^%/,Tl=/[\\^$*+?|[\]().{}]/g;function zl(t,B,s){var Q=t<0?"-":"",F=(Q?-t:t)+"",i=F.length;return Q+(i<s?new Array(s-i+1).join(B)+F:F)}function Kl(t){return t.replace(Tl,"\\$&")}function Ol(t){return new RegExp("^(?:"+t.map(Kl).join("|")+")","i")}function Pl(t){return new Map(t.map((t,B)=>[t.toLowerCase(),B]))}function jl(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.w=+Q[0],s+Q[0].length):-1}function _l(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.u=+Q[0],s+Q[0].length):-1}function $l(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.U=+Q[0],s+Q[0].length):-1}function ql(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.V=+Q[0],s+Q[0].length):-1}function tc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.W=+Q[0],s+Q[0].length):-1}function Bc(t,B,s){var Q=kl.exec(B.slice(s,s+4));return Q?(t.y=+Q[0],s+Q[0].length):-1}function sc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.y=+Q[0]+(+Q[0]>68?1900:2e3),s+Q[0].length):-1}function Qc(t,B,s){var Q=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(B.slice(s,s+6));return Q?(t.Z=Q[1]?0:-(Q[2]+(Q[3]||"00")),s+Q[0].length):-1}function Fc(t,B,s){var Q=kl.exec(B.slice(s,s+1));return Q?(t.q=3*Q[0]-3,s+Q[0].length):-1}function ic(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.m=Q[0]-1,s+Q[0].length):-1}function Uc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.d=+Q[0],s+Q[0].length):-1}function gc(t,B,s){var Q=kl.exec(B.slice(s,s+3));return Q?(t.m=0,t.d=+Q[0],s+Q[0].length):-1}function ec(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.H=+Q[0],s+Q[0].length):-1}function Ic(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.M=+Q[0],s+Q[0].length):-1}function lc(t,B,s){var Q=kl.exec(B.slice(s,s+2));return Q?(t.S=+Q[0],s+Q[0].length):-1}function cc(t,B,s){var Q=kl.exec(B.slice(s,s+3));return Q?(t.L=+Q[0],s+Q[0].length):-1}function nc(t,B,s){var Q=kl.exec(B.slice(s,s+6));return Q?(t.L=Math.floor(Q[0]/1e3),s+Q[0].length):-1}function ac(t,B,s){var Q=Ml.exec(B.slice(s,s+1));return Q?s+Q[0].length:-1}function dc(t,B,s){var Q=kl.exec(B.slice(s));return Q?(t.Q=+Q[0],s+Q[0].length):-1}function oc(t,B,s){var Q=kl.exec(B.slice(s));return Q?(t.s=+Q[0],s+Q[0].length):-1}function bc(t,B){return zl(t.getDate(),B,2)}function Cc(t,B){return zl(t.getHours(),B,2)}function rc(t,B){return zl(t.getHours()%12||12,B,2)}function uc(t,B){return zl(1+el.count(Sl(t),t),B,3)}function hc(t,B){return zl(t.getMilliseconds(),B,3)}function xc(t,B){return hc(t,B)+"000"}function Gc(t,B){return zl(t.getMonth()+1,B,2)}function yc(t,B){return zl(t.getMinutes(),B,2)}function Ac(t,B){return zl(t.getSeconds(),B,2)}function Lc(t){var B=t.getDay();return 0===B?7:B}function Rc(t,B){return zl(nl.count(Sl(t)-1,t),B,2)}function mc(t){var B=t.getDay();return B>=4||0===B?bl(t):bl.ceil(t)}function Vc(t,B){return t=mc(t),zl(bl.count(Sl(t),t)+(4===Sl(t).getDay()),B,2)}function Sc(t){return t.getDay()}function Zc(t,B){return zl(al.count(Sl(t)-1,t),B,2)}function pc(t,B){return zl(t.getFullYear()%100,B,2)}function Ec(t,B){return zl((t=mc(t)).getFullYear()%100,B,2)}function Nc(t,B){return zl(t.getFullYear()%1e4,B,4)}function Xc(t,B){var s=t.getDay();return zl((t=s>=4||0===s?bl(t):bl.ceil(t)).getFullYear()%1e4,B,4)}function Wc(t){var B=t.getTimezoneOffset();return(B>0?"-":(B*=-1,"+"))+zl(B/60|0,"0",2)+zl(B%60,"0",2)}function Hc(t,B){return zl(t.getUTCDate(),B,2)}function Dc(t,B){return zl(t.getUTCHours(),B,2)}function fc(t,B){return zl(t.getUTCHours()%12||12,B,2)}function wc(t,B){return zl(1+Il.count(Zl(t),t),B,3)}function vc(t,B){return zl(t.getUTCMilliseconds(),B,3)}function Yc(t,B){return vc(t,B)+"000"}function Jc(t,B){return zl(t.getUTCMonth()+1,B,2)}function kc(t,B){return zl(t.getUTCMinutes(),B,2)}function Mc(t,B){return zl(t.getUTCSeconds(),B,2)}function Tc(t){var B=t.getUTCDay();return 0===B?7:B}function zc(t,B){return zl(hl.count(Zl(t)-1,t),B,2)}function Kc(t){var B=t.getUTCDay();return B>=4||0===B?Al(t):Al.ceil(t)}function Oc(t,B){return t=Kc(t),zl(Al.count(Zl(t),t)+(4===Zl(t).getUTCDay()),B,2)}function Pc(t){return t.getUTCDay()}function jc(t,B){return zl(xl.count(Zl(t)-1,t),B,2)}function _c(t,B){return zl(t.getUTCFullYear()%100,B,2)}function $c(t,B){return zl((t=Kc(t)).getUTCFullYear()%100,B,2)}function qc(t,B){return zl(t.getUTCFullYear()%1e4,B,4)}function tn(t,B){var s=t.getUTCDay();return zl((t=s>=4||0===s?Al(t):Al.ceil(t)).getUTCFullYear()%1e4,B,4)}function Bn(){return"+0000"}function sn(){return"%"}function Qn(t){return+t}function Fn(t){return Math.floor(+t/1e3)}function Un(t){return new Date(t)}function gn(t){return t instanceof Date?+t:+new Date(+t)}function en(t,B,s,Q,F,i,U,g,e,I){var l=xI(),c=l.invert,n=l.domain,a=I(".%L"),d=I(":%S"),o=I("%I:%M"),b=I("%I %p"),C=I("%a %d"),r=I("%b %d"),u=I("%B"),h=I("%Y");function x(t){return(e(t)<t?a:g(t)<t?d:U(t)<t?o:i(t)<t?b:Q(t)<t?F(t)<t?C:r:s(t)<t?u:h)(t)}return l.invert=function(t){return new Date(c(t))},l.domain=function(t){return arguments.length?n(Array.from(t,gn)):n().map(Un)},l.ticks=function(B){var s=n();return t(s[0],s[s.length-1],null==B?10:B)},l.tickFormat=function(t,B){return null==B?x:I(B)},l.nice=function(t){var s=n();return t&&"function"==typeof t.range||(t=B(s[0],s[s.length-1],null==t?10:t)),t?n(RI(s,t)):l},l.copy=function(){return uI(l,en(t,B,s,Q,F,i,U,g,e,I))},l}function In(t,B){return B.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ln(){var t,B,s,Q,F,i,U,g=0,e=.5,I=1,l=1,c=oI,n=!1;function a(t){return isNaN(t=+t)?U:(t=.5+((t=+i(t))-B)*(l*t<l*B?Q:F),c(n?Math.max(0,Math.min(1,t)):t))}function d(t){return function(B){var s,Q,F;return arguments.length?([s,Q,F]=B,c=vF(t,[s,Q,F]),a):[c(0),c(.5),c(1)]}}return a.domain=function(U){return arguments.length?([g,e,I]=U,t=i(g=+g),B=i(e=+e),s=i(I=+I),Q=t===B?0:.5/(B-t),F=B===s?0:.5/(s-B),l=B<t?-1:1,a):[g,e,I]},a.clamp=function(t){return arguments.length?(n=!!t,a):n},a.interpolator=function(t){return arguments.length?(c=t,a):c},a.range=d(mF),a.rangeRound=d(VF),a.unknown=function(t){return arguments.length?(U=t,a):U},function(U){return i=U,t=U(g),B=U(e),s=U(I),Q=t===B?0:.5/(B-t),F=B===s?0:.5/(s-B),l=B<t?-1:1,a}}function cn(){var t=yI(ln()(oI));return t.copy=function(){return In(t,cn())},gI.apply(t,arguments)}function nn(){var t=NI(ln()).domain([.1,1,10]);return t.copy=function(){return In(t,nn()).base(t.base())},gI.apply(t,arguments)}function an(){var t=DI(ln());return t.copy=function(){return In(t,an()).constant(t.constant())},gI.apply(t,arguments)}function dn(){var t=JI(ln());return t.copy=function(){return In(t,dn()).exponent(t.exponent())},gI.apply(t,arguments)}function on(t){for(var B=t.length/6|0,s=new Array(B),Q=0;Q<B;)s[Q]="#"+t.slice(6*Q,6*++Q);return s}!function(t){wl=function(t){var B=t.dateTime,s=t.date,Q=t.time,F=t.periods,i=t.days,U=t.shortDays,g=t.months,e=t.shortMonths,I=Ol(F),l=Pl(F),c=Ol(i),n=Pl(i),a=Ol(U),d=Pl(U),o=Ol(g),b=Pl(g),C=Ol(e),r=Pl(e),u={a:function(t){return U[t.getDay()]},A:function(t){return i[t.getDay()]},b:function(t){return e[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:null,d:bc,e:bc,f:xc,g:Ec,G:Xc,H:Cc,I:rc,j:uc,L:hc,m:Gc,M:yc,p:function(t){return F[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Qn,s:Fn,S:Ac,u:Lc,U:Rc,V:Vc,w:Sc,W:Zc,x:null,X:null,y:pc,Y:Nc,Z:Wc,"%":sn},h={a:function(t){return U[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return e[t.getUTCMonth()]},B:function(t){return g[t.getUTCMonth()]},c:null,d:Hc,e:Hc,f:Yc,g:$c,G:tn,H:Dc,I:fc,j:wc,L:vc,m:Jc,M:kc,p:function(t){return F[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Qn,s:Fn,S:Mc,u:Tc,U:zc,V:Oc,w:Pc,W:jc,x:null,X:null,y:_c,Y:qc,Z:Bn,"%":sn},x={a:function(t,B,s){var Q=a.exec(B.slice(s));return Q?(t.w=d.get(Q[0].toLowerCase()),s+Q[0].length):-1},A:function(t,B,s){var Q=c.exec(B.slice(s));return Q?(t.w=n.get(Q[0].toLowerCase()),s+Q[0].length):-1},b:function(t,B,s){var Q=C.exec(B.slice(s));return Q?(t.m=r.get(Q[0].toLowerCase()),s+Q[0].length):-1},B:function(t,B,s){var Q=o.exec(B.slice(s));return Q?(t.m=b.get(Q[0].toLowerCase()),s+Q[0].length):-1},c:function(t,s,Q){return A(t,B,s,Q)},d:Uc,e:Uc,f:nc,g:sc,G:Bc,H:ec,I:ec,j:gc,L:cc,m:ic,M:Ic,p:function(t,B,s){var Q=I.exec(B.slice(s));return Q?(t.p=l.get(Q[0].toLowerCase()),s+Q[0].length):-1},q:Fc,Q:dc,s:oc,S:lc,u:_l,U:$l,V:ql,w:jl,W:tc,x:function(t,B,Q){return A(t,s,B,Q)},X:function(t,B,s){return A(t,Q,B,s)},y:sc,Y:Bc,Z:Qc,"%":ac};function G(t,B){return function(s){var Q,F,i,U=[],g=-1,e=0,I=t.length;for(s instanceof Date||(s=new Date(+s));++g<I;)37===t.charCodeAt(g)&&(U.push(t.slice(e,g)),null!=(F=Jl[Q=t.charAt(++g)])?Q=t.charAt(++g):F="e"===Q?" ":"0",(i=B[Q])&&(Q=i(s,F)),U.push(Q),e=g+1);return U.push(t.slice(e,g)),U.join("")}}function y(t,B){return function(s){var Q,F,i=fl(1900,void 0,1);if(A(i,t,s+="",0)!=s.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(B&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(F=(Q=Dl(fl(i.y,0,1))).getUTCDay(),Q=F>4||0===F?xl.ceil(Q):xl(Q),Q=Il.offset(Q,7*(i.V-1)),i.y=Q.getUTCFullYear(),i.m=Q.getUTCMonth(),i.d=Q.getUTCDate()+(i.w+6)%7):(F=(Q=Hl(fl(i.y,0,1))).getDay(),Q=F>4||0===F?al.ceil(Q):al(Q),Q=el.offset(Q,7*(i.V-1)),i.y=Q.getFullYear(),i.m=Q.getMonth(),i.d=Q.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),F="Z"in i?Dl(fl(i.y,0,1)).getUTCDay():Hl(fl(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(F+5)%7:i.w+7*i.U-(F+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,Dl(i)):Hl(i)}}function A(t,B,s,Q){for(var F,i,U=0,g=B.length,e=s.length;U<g;){if(Q>=e)return-1;if(37===(F=B.charCodeAt(U++))){if(F=B.charAt(U++),!(i=x[F in Jl?B.charAt(U++):F])||(Q=i(t,s,Q))<0)return-1}else if(F!=s.charCodeAt(Q++))return-1}return Q}return u.x=G(s,u),u.X=G(Q,u),u.c=G(B,u),h.x=G(s,h),h.X=G(Q,h),h.c=G(B,h),{format:function(t){var B=G(t+="",u);return B.toString=function(){return t},B},parse:function(t){var B=y(t+="",!1);return B.toString=function(){return t},B},utcFormat:function(t){var B=G(t+="",h);return B.toString=function(){return t},B},utcParse:function(t){var B=y(t+="",!0);return B.toString=function(){return t},B}}}(t),vl=wl.format,wl.parse,Yl=wl.utcFormat,wl.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var bn=on("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Cn=on("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),rn=on("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),un=on("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),hn=on("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),xn=on("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Gn=on("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),yn=on("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),An=on("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Ln=on("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Rn=on("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),mn=t=>rF(t[t.length-1]),Vn=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(on),Sn=mn(Vn),Zn=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(on),pn=mn(Zn),En=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(on),Nn=mn(En),Xn=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(on),Wn=mn(Xn),Hn=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(on),Dn=mn(Hn),fn=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(on),wn=mn(fn),vn=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(on),Yn=mn(vn),Jn=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(on),kn=mn(Jn),Mn=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(on),Tn=mn(Mn),zn=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(on),Kn=mn(zn),On=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(on),Pn=mn(On),jn=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(on),_n=mn(jn),$n=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(on),qn=mn($n),ta=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(on),Ba=mn(ta),sa=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(on),Qa=mn(sa),Fa=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(on),ia=mn(Fa),Ua=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(on),ga=mn(Ua),ea=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(on),Ia=mn(ea),la=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(on),ca=mn(la),na=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(on),aa=mn(na),da=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(on),oa=mn(da),ba=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(on),Ca=mn(ba),ra=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(on),ua=mn(ra),ha=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(on),xa=mn(ha),Ga=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(on),ya=mn(Ga),Aa=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(on),La=mn(Aa),Ra=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(on),ma=mn(Ra);function Va(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}var Sa=wF(IF(300,.5,0),IF(-240,.5,1)),Za=wF(IF(-100,.75,.35),IF(80,1.5,.8)),pa=wF(IF(260,.75,.35),IF(80,1.5,.8)),Ea=IF();function Na(t){(t<0||t>1)&&(t-=Math.floor(t));var B=Math.abs(t-.5);return Ea.h=360*t-100,Ea.s=1.5-1.5*B,Ea.l=.8-.9*B,Ea+""}var Xa=yQ(),Wa=Math.PI/3,Ha=2*Math.PI/3;function Da(t){var B;return t=(.5-t)*Math.PI,Xa.r=255*(B=Math.sin(t))*B,Xa.g=255*(B=Math.sin(t+Wa))*B,Xa.b=255*(B=Math.sin(t+Ha))*B,Xa+""}function fa(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function wa(t){var B=t.length;return function(s){return t[Math.max(0,Math.min(B-1,Math.floor(s*B)))]}}var va=wa(on("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ya=wa(on("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Ja=wa(on("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ka=wa(on("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Ma(t){return function(){return t}}const Ta=Math.abs,za=Math.atan2,Ka=Math.cos,Oa=Math.max,Pa=Math.min,ja=Math.sin,_a=Math.sqrt,$a=1e-12,qa=Math.PI,td=qa/2,Bd=2*qa;function sd(t){return t>=1?td:t<=-1?-td:Math.asin(t)}function Qd(t){let B=3;return t.digits=function(s){if(!arguments.length)return B;if(null==s)B=null;else{const t=Math.floor(s);if(!(t>=0))throw new RangeError(`invalid digits: ${s}`);B=t}return t},()=>new ki(B)}function Fd(t){return t.innerRadius}function id(t){return t.outerRadius}function Ud(t){return t.startAngle}function gd(t){return t.endAngle}function ed(t){return t&&t.padAngle}function Id(t,B,s,Q,F,i,U){var g=t-s,e=B-Q,I=(U?i:-i)/_a(g*g+e*e),l=I*e,c=-I*g,n=t+l,a=B+c,d=s+l,o=Q+c,b=(n+d)/2,C=(a+o)/2,r=d-n,u=o-a,h=r*r+u*u,x=F-i,G=n*o-d*a,y=(u<0?-1:1)*_a(Oa(0,x*x*h-G*G)),A=(G*u-r*y)/h,L=(-G*r-u*y)/h,R=(G*u+r*y)/h,m=(-G*r+u*y)/h,V=A-b,S=L-C,Z=R-b,p=m-C;return V*V+S*S>Z*Z+p*p&&(A=R,L=m),{cx:A,cy:L,x01:-l,y01:-c,x11:A*(F/x-1),y11:L*(F/x-1)}}function ld(){var t=Fd,B=id,s=Ma(0),Q=null,F=Ud,i=gd,U=ed,g=null,e=Qd(I);function I(){var I,l,c=+t.apply(this,arguments),n=+B.apply(this,arguments),a=F.apply(this,arguments)-td,d=i.apply(this,arguments)-td,o=Ta(d-a),b=d>a;if(g||(g=I=e()),n<c&&(l=n,n=c,c=l),n>$a)if(o>Bd-$a)g.moveTo(n*Ka(a),n*ja(a)),g.arc(0,0,n,a,d,!b),c>$a&&(g.moveTo(c*Ka(d),c*ja(d)),g.arc(0,0,c,d,a,b));else{var C,r,u=a,h=d,x=a,G=d,y=o,A=o,L=U.apply(this,arguments)/2,R=L>$a&&(Q?+Q.apply(this,arguments):_a(c*c+n*n)),m=Pa(Ta(n-c)/2,+s.apply(this,arguments)),V=m,S=m;if(R>$a){var Z=sd(R/c*ja(L)),p=sd(R/n*ja(L));(y-=2*Z)>$a?(x+=Z*=b?1:-1,G-=Z):(y=0,x=G=(a+d)/2),(A-=2*p)>$a?(u+=p*=b?1:-1,h-=p):(A=0,u=h=(a+d)/2)}var E=n*Ka(u),N=n*ja(u),X=c*Ka(G),W=c*ja(G);if(m>$a){var H,D=n*Ka(h),f=n*ja(h),w=c*Ka(x),v=c*ja(x);if(o<qa)if(H=function(t,B,s,Q,F,i,U,g){var e=s-t,I=Q-B,l=U-F,c=g-i,n=c*e-l*I;if(!(n*n<$a))return[t+(n=(l*(B-i)-c*(t-F))/n)*e,B+n*I]}(E,N,w,v,D,f,X,W)){var Y=E-H[0],J=N-H[1],k=D-H[0],M=f-H[1],T=1/ja(function(t){return t>1?0:t<-1?qa:Math.acos(t)}((Y*k+J*M)/(_a(Y*Y+J*J)*_a(k*k+M*M)))/2),z=_a(H[0]*H[0]+H[1]*H[1]);V=Pa(m,(c-z)/(T-1)),S=Pa(m,(n-z)/(T+1))}else V=S=0}A>$a?S>$a?(C=Id(w,v,E,N,n,S,b),r=Id(D,f,X,W,n,S,b),g.moveTo(C.cx+C.x01,C.cy+C.y01),S<m?g.arc(C.cx,C.cy,S,za(C.y01,C.x01),za(r.y01,r.x01),!b):(g.arc(C.cx,C.cy,S,za(C.y01,C.x01),za(C.y11,C.x11),!b),g.arc(0,0,n,za(C.cy+C.y11,C.cx+C.x11),za(r.cy+r.y11,r.cx+r.x11),!b),g.arc(r.cx,r.cy,S,za(r.y11,r.x11),za(r.y01,r.x01),!b))):(g.moveTo(E,N),g.arc(0,0,n,u,h,!b)):g.moveTo(E,N),c>$a&&y>$a?V>$a?(C=Id(X,W,D,f,c,-V,b),r=Id(E,N,w,v,c,-V,b),g.lineTo(C.cx+C.x01,C.cy+C.y01),V<m?g.arc(C.cx,C.cy,V,za(C.y01,C.x01),za(r.y01,r.x01),!b):(g.arc(C.cx,C.cy,V,za(C.y01,C.x01),za(C.y11,C.x11),!b),g.arc(0,0,c,za(C.cy+C.y11,C.cx+C.x11),za(r.cy+r.y11,r.cx+r.x11),b),g.arc(r.cx,r.cy,V,za(r.y11,r.x11),za(r.y01,r.x01),!b))):g.arc(0,0,c,G,x,b):g.lineTo(X,W)}else g.moveTo(0,0);if(g.closePath(),I)return g=null,I+""||null}return I.centroid=function(){var s=(+t.apply(this,arguments)+ +B.apply(this,arguments))/2,Q=(+F.apply(this,arguments)+ +i.apply(this,arguments))/2-qa/2;return[Ka(Q)*s,ja(Q)*s]},I.innerRadius=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),I):t},I.outerRadius=function(t){return arguments.length?(B="function"==typeof t?t:Ma(+t),I):B},I.cornerRadius=function(t){return arguments.length?(s="function"==typeof t?t:Ma(+t),I):s},I.padRadius=function(t){return arguments.length?(Q=null==t?null:"function"==typeof t?t:Ma(+t),I):Q},I.startAngle=function(t){return arguments.length?(F="function"==typeof t?t:Ma(+t),I):F},I.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ma(+t),I):i},I.padAngle=function(t){return arguments.length?(U="function"==typeof t?t:Ma(+t),I):U},I.context=function(t){return arguments.length?(g=null==t?null:t,I):g},I}function cd(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function nd(t){this._context=t}function ad(t){return new nd(t)}function dd(t){return t[0]}function od(t){return t[1]}function bd(t,B){var s=Ma(!0),Q=null,F=ad,i=null,U=Qd(g);function g(g){var e,I,l,c=(g=cd(g)).length,n=!1;for(null==Q&&(i=F(l=U())),e=0;e<=c;++e)!(e<c&&s(I=g[e],e,g))===n&&((n=!n)?i.lineStart():i.lineEnd()),n&&i.point(+t(I,e,g),+B(I,e,g));if(l)return i=null,l+""||null}return t="function"==typeof t?t:void 0===t?dd:Ma(t),B="function"==typeof B?B:void 0===B?od:Ma(B),g.x=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),g):t},g.y=function(t){return arguments.length?(B="function"==typeof t?t:Ma(+t),g):B},g.defined=function(t){return arguments.length?(s="function"==typeof t?t:Ma(!!t),g):s},g.curve=function(t){return arguments.length?(F=t,null!=Q&&(i=F(Q)),g):F},g.context=function(t){return arguments.length?(null==t?Q=i=null:i=F(Q=t),g):Q},g}function Cd(t,B){return B<t?-1:B>t?1:B>=t?0:NaN}function rd(t){return t}nd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:this._context.lineTo(t,B)}}};class ud{constructor(t,B){this._context=t,this._x=B}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,B,t,B):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+B)/2,t,this._y0,t,B)}this._x0=t,this._y0=B}}const hd=_a(3);var xd={draw(t,B){const s=.59436*_a(B+Pa(B/28,.75)),Q=s/2,F=Q*hd;t.moveTo(0,s),t.lineTo(0,-s),t.moveTo(-F,-Q),t.lineTo(F,Q),t.moveTo(-F,Q),t.lineTo(F,-Q)}},Gd={draw(t,B){const s=_a(B/qa);t.moveTo(s,0),t.arc(0,0,s,0,Bd)}},yd={draw(t,B){const s=_a(B/5)/2;t.moveTo(-3*s,-s),t.lineTo(-s,-s),t.lineTo(-s,-3*s),t.lineTo(s,-3*s),t.lineTo(s,-s),t.lineTo(3*s,-s),t.lineTo(3*s,s),t.lineTo(s,s),t.lineTo(s,3*s),t.lineTo(-s,3*s),t.lineTo(-s,s),t.lineTo(-3*s,s),t.closePath()}};const Ad=_a(1/3),Ld=2*Ad;var Rd={draw(t,B){const s=_a(B/Ld),Q=s*Ad;t.moveTo(0,-s),t.lineTo(Q,0),t.lineTo(0,s),t.lineTo(-Q,0),t.closePath()}},md={draw(t,B){const s=.62625*_a(B);t.moveTo(0,-s),t.lineTo(s,0),t.lineTo(0,s),t.lineTo(-s,0),t.closePath()}},Vd={draw(t,B){const s=.87559*_a(B-Pa(B/7,2));t.moveTo(-s,0),t.lineTo(s,0),t.moveTo(0,s),t.lineTo(0,-s)}},Sd={draw(t,B){const s=_a(B),Q=-s/2;t.rect(Q,Q,s,s)}},Zd={draw(t,B){const s=.4431*_a(B);t.moveTo(s,s),t.lineTo(s,-s),t.lineTo(-s,-s),t.lineTo(-s,s),t.closePath()}};const pd=ja(qa/10)/ja(7*qa/10),Ed=ja(Bd/10)*pd,Nd=-Ka(Bd/10)*pd;var Xd={draw(t,B){const s=_a(.8908130915292852*B),Q=Ed*s,F=Nd*s;t.moveTo(0,-s),t.lineTo(Q,F);for(let B=1;B<5;++B){const i=Bd*B/5,U=Ka(i),g=ja(i);t.lineTo(g*s,-U*s),t.lineTo(U*Q-g*F,g*Q+U*F)}t.closePath()}};const Wd=_a(3);var Hd={draw(t,B){const s=-_a(B/(3*Wd));t.moveTo(0,2*s),t.lineTo(-Wd*s,-s),t.lineTo(Wd*s,-s),t.closePath()}};const Dd=_a(3);var fd={draw(t,B){const s=.6824*_a(B),Q=s/2,F=s*Dd/2;t.moveTo(0,-s),t.lineTo(F,Q),t.lineTo(-F,Q),t.closePath()}};const wd=-.5,vd=_a(3)/2,Yd=1/_a(12),Jd=3*(Yd/2+1);var kd={draw(t,B){const s=_a(B/Jd),Q=s/2,F=s*Yd,i=Q,U=s*Yd+s,g=-i,e=U;t.moveTo(Q,F),t.lineTo(i,U),t.lineTo(g,e),t.lineTo(wd*Q-vd*F,vd*Q+wd*F),t.lineTo(wd*i-vd*U,vd*i+wd*U),t.lineTo(wd*g-vd*e,vd*g+wd*e),t.lineTo(wd*Q+vd*F,wd*F-vd*Q),t.lineTo(wd*i+vd*U,wd*U-vd*i),t.lineTo(wd*g+vd*e,wd*e-vd*g),t.closePath()}},Md={draw(t,B){const s=.6189*_a(B-Pa(B/6,1.7));t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(-s,s),t.lineTo(s,-s)}};const Td=[Gd,yd,Rd,Sd,Xd,Hd,kd],zd=[Gd,Vd,Md,fd,xd,Zd,md];function Kd(){}function Od(t,B,s){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+B)/6,(t._y0+4*t._y1+s)/6)}function Pd(t){this._context=t}function jd(t){this._context=t}function _d(t){this._context=t}function $d(t,B){this._basis=new Pd(t),this._beta=B}Pd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Od(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},jd.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._x2=t,this._y2=B;break;case 1:this._point=2,this._x3=t,this._y3=B;break;case 2:this._point=3,this._x4=t,this._y4=B,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+B)/6);break;default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},_d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var s=(this._x0+4*this._x1+t)/6,Q=(this._y0+4*this._y1+B)/6;this._line?this._context.lineTo(s,Q):this._context.moveTo(s,Q);break;case 3:this._point=4;default:Od(this,t,B)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B}},$d.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,B=this._y,s=t.length-1;if(s>0)for(var Q,F=t[0],i=B[0],U=t[s]-F,g=B[s]-i,e=-1;++e<=s;)Q=e/s,this._basis.point(this._beta*t[e]+(1-this._beta)*(F+Q*U),this._beta*B[e]+(1-this._beta)*(i+Q*g));this._x=this._y=null,this._basis.lineEnd()},point:function(t,B){this._x.push(+t),this._y.push(+B)}};var qd=function t(B){function s(t){return 1===B?new Pd(t):new $d(t,B)}return s.beta=function(B){return t(+B)},s}(.85);function to(t,B,s){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-B),t._y2+t._k*(t._y1-s),t._x2,t._y2)}function Bo(t,B){this._context=t,this._k=(1-B)/6}Bo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:to(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2,this._x1=t,this._y1=B;break;case 2:this._point=3;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var so=function t(B){function s(t){return new Bo(t,B)}return s.tension=function(B){return t(+B)},s}(0);function Qo(t,B){this._context=t,this._k=(1-B)/6}Qo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._x3=t,this._y3=B;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=B);break;case 2:this._point=3,this._x5=t,this._y5=B;break;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Fo=function t(B){function s(t){return new Qo(t,B)}return s.tension=function(B){return t(+B)},s}(0);function io(t,B){this._context=t,this._k=(1-B)/6}io.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:to(this,t,B)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Uo=function t(B){function s(t){return new io(t,B)}return s.tension=function(B){return t(+B)},s}(0);function go(t,B,s){var Q=t._x1,F=t._y1,i=t._x2,U=t._y2;if(t._l01_a>$a){var g=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,e=3*t._l01_a*(t._l01_a+t._l12_a);Q=(Q*g-t._x0*t._l12_2a+t._x2*t._l01_2a)/e,F=(F*g-t._y0*t._l12_2a+t._y2*t._l01_2a)/e}if(t._l23_a>$a){var I=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*I+t._x1*t._l23_2a-B*t._l12_2a)/l,U=(U*I+t._y1*t._l23_2a-s*t._l12_2a)/l}t._context.bezierCurveTo(Q,F,i,U,t._x2,t._y2)}function eo(t,B){this._context=t,this._alpha=B}eo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var Io=function t(B){function s(t){return B?new eo(t,B):new Bo(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function lo(t,B){this._context=t,this._alpha=B}lo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=B;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=B);break;case 2:this._point=3,this._x5=t,this._y5=B;break;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var co=function t(B){function s(t){return B?new lo(t,B):new Qo(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function no(t,B){this._context=t,this._alpha=B}no.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){if(t=+t,B=+B,this._point){var s=this._x2-t,Q=this._y2-B;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(s*s+Q*Q,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:go(this,t,B)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=B}};var ao=function t(B){function s(t){return B?new no(t,B):new io(t,0)}return s.alpha=function(B){return t(+B)},s}(.5);function oo(t){this._context=t}function bo(t){return t<0?-1:1}function Co(t,B,s){var Q=t._x1-t._x0,F=B-t._x1,i=(t._y1-t._y0)/(Q||F<0&&-0),U=(s-t._y1)/(F||Q<0&&-0),g=(i*F+U*Q)/(Q+F);return(bo(i)+bo(U))*Math.min(Math.abs(i),Math.abs(U),.5*Math.abs(g))||0}function ro(t,B){var s=t._x1-t._x0;return s?(3*(t._y1-t._y0)/s-B)/2:B}function uo(t,B,s){var Q=t._x0,F=t._y0,i=t._x1,U=t._y1,g=(i-Q)/3;t._context.bezierCurveTo(Q+g,F+g*B,i-g,U-g*s,i,U)}function ho(t){this._context=t}function xo(t){this._context=new Go(t)}function Go(t){this._context=t}function yo(t){this._context=t}function Ao(t){var B,s,Q=t.length-1,F=new Array(Q),i=new Array(Q),U=new Array(Q);for(F[0]=0,i[0]=2,U[0]=t[0]+2*t[1],B=1;B<Q-1;++B)F[B]=1,i[B]=4,U[B]=4*t[B]+2*t[B+1];for(F[Q-1]=2,i[Q-1]=7,U[Q-1]=8*t[Q-1]+t[Q],B=1;B<Q;++B)s=F[B]/i[B-1],i[B]-=s,U[B]-=s*U[B-1];for(F[Q-1]=U[Q-1]/i[Q-1],B=Q-2;B>=0;--B)F[B]=(U[B]-F[B+1])/i[B];for(i[Q-1]=(t[Q]+F[Q-1])/2,B=0;B<Q-1;++B)i[B]=2*t[B+1]-F[B+1];return[F,i]}function Lo(t,B){this._context=t,this._t=B}function Ro(t,B,s){this.k=t,this.x=B,this.y=s}oo.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,B){t=+t,B=+B,this._point?this._context.lineTo(t,B):(this._point=1,this._context.moveTo(t,B))}},ho.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:uo(this,this._t0,ro(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,B){var s=NaN;if(B=+B,(t=+t)!==this._x1||B!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;break;case 2:this._point=3,uo(this,ro(this,s=Co(this,t,B)),s);break;default:uo(this,this._t0,s=Co(this,t,B))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=B,this._t0=s}}},(xo.prototype=Object.create(ho.prototype)).point=function(t,B){ho.prototype.point.call(this,B,t)},Go.prototype={moveTo:function(t,B){this._context.moveTo(B,t)},closePath:function(){this._context.closePath()},lineTo:function(t,B){this._context.lineTo(B,t)},bezierCurveTo:function(t,B,s,Q,F,i){this._context.bezierCurveTo(B,t,Q,s,i,F)}},yo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,B=this._y,s=t.length;if(s)if(this._line?this._context.lineTo(t[0],B[0]):this._context.moveTo(t[0],B[0]),2===s)this._context.lineTo(t[1],B[1]);else for(var Q=Ao(t),F=Ao(B),i=0,U=1;U<s;++i,++U)this._context.bezierCurveTo(Q[0][i],F[0][i],Q[1][i],F[1][i],t[U],B[U]);(this._line||0!==this._line&&1===s)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,B){this._x.push(+t),this._y.push(+B)}},Lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,B){switch(t=+t,B=+B,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,B):this._context.moveTo(t,B);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,B),this._context.lineTo(t,B);else{var s=this._x*(1-this._t)+t*this._t;this._context.lineTo(s,this._y),this._context.lineTo(s,B)}}this._x=t,this._y=B}},Ro.prototype={constructor:Ro,scale:function(t){return 1===t?this:new Ro(this.k*t,this.x,this.y)},translate:function(t,B){return 0===t&0===B?this:new Ro(this.k,this.x+this.k*t,this.y+this.k*B)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Ro.prototype;class mo extends lt{getComputedStyleValue(t){return getComputedStyle(this).getPropertyValue(t).trim()}static get greys(){const t="#999999",B={white:"#ffffff"};return B.light75=bF(t,"#ffffff")(.75),B.light50=bF(t,"#ffffff")(.5),B.light25=bF(t,"#ffffff")(.25),B.grey=t,B.dark25=bF(t,"#000000")(.25),B.dark50=bF(t,"#000000")(.5),B.dark75=bF(t,"#000000")(.75),B.black="#000000",B}static get shadows(){return{elevations:[0,2,4,8,16],baselineColor:"#000000",baselineColorString:"0, 0, 0",inverseBaselineColor:"#FFFFFF",inverseBaselineColorString:"255, 255, 255",opacityUmbra:.2,opacityPenumbra:.14,opacityAmbient:.12,opacityBoost:.2,mapUmbra:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:3,b:1,s:-2},4:{x:0,y:2,b:4,s:-1},8:{x:0,y:5,b:5,s:-3},16:{x:0,y:8,b:10,s:-5}},mapPenumbra:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:2,b:2,s:0},4:{x:0,y:4,b:5,s:0},8:{x:0,y:8,b:10,s:1},16:{x:0,y:16,b:24,s:2}},mapAmbient:{0:{x:0,y:0,b:0,s:0},2:{x:0,y:1,b:5,s:0},4:{x:0,y:1,b:10,s:0},8:{x:0,y:3,b:14,s:2},16:{x:0,y:6,b:30,s:5}}}}static cssBoxShadow(t,B=!1){const s=this.shadows.opacityUmbra+this.shadows.opacityBoost,Q=this.shadows.opacityPenumbra+this.shadows.opacityBoost,F=this.shadows.opacityAmbient+this.shadows.opacityBoost,i=B?`rgba(${this.shadows.inverseBaselineColorString}, ${s})`:`rgba(${this.shadows.baselineColorString}, ${s})`,U=B?`rgba(${this.shadows.inverseBaselineColorString}, ${Q})`:`rgba(${this.shadows.baselineColorString}, ${Q})`,g=B?`rgba(${this.shadows.inverseBaselineColorString}, ${F})`:`rgba(${this.shadows.baselineColorString}, ${F})`,e=this.shadows.mapUmbra[t],I=this.shadows.mapPenumbra[t],l=this.shadows.mapAmbient[t];return`${`${e.y/2}px ${e.y}px ${e.b}px ${e.s}px`} ${i}, ${`${I.y/2}px ${I.y}px ${I.b}px ${I.s}px`} ${U}, ${`${l.y/2}px ${l.y}px ${l.b}px ${l.s}px`} ${g}`}static get svgFilters(){const t=mo.shadows,B=t.elevations.map(B=>T`
|
|
23
23
|
<filter id=${`shadow-${B}`} filterUnits="userSpaceOnUse" x="-100%" y="-100%" width="200%" height="200%">
|
|
24
24
|
<feComponentTransfer in="SourceAlpha" result="solid">
|
|
25
25
|
<feFuncA type="table" tableValues="0 1 1"/>
|
|
@@ -122,49 +122,58 @@ const A=globalThis,L=A.trustedTypes,R=L?L.createPolicy("lit-html",{createHTML:t=
|
|
|
122
122
|
button {
|
|
123
123
|
width: 100%;
|
|
124
124
|
height: 100%;
|
|
125
|
+
|
|
125
126
|
padding: 0.375rem 0.75rem;
|
|
126
127
|
|
|
127
128
|
font-family: var(---font-family-base);
|
|
128
129
|
font-size: 1.125rem;
|
|
130
|
+
|
|
129
131
|
line-height: 1.5;
|
|
132
|
+
|
|
130
133
|
color: var(---color-text-inverse);
|
|
131
134
|
|
|
135
|
+
outline: none;
|
|
136
|
+
|
|
132
137
|
border: 0;
|
|
133
138
|
border-radius: var(---border-radius);
|
|
134
|
-
outline: none;
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
button:disabled {
|
|
138
|
-
background-color: var(---decidables-button-background-color-disabled);
|
|
139
142
|
outline: none;
|
|
143
|
+
|
|
144
|
+
background-color: var(---decidables-button-background-color-disabled);
|
|
140
145
|
box-shadow: none;
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
button:enabled {
|
|
144
149
|
cursor: pointer;
|
|
150
|
+
outline: none;
|
|
145
151
|
|
|
146
152
|
background-color: var(---decidables-button-background-color-enabled);
|
|
147
|
-
outline: none;
|
|
148
153
|
box-shadow: var(---shadow-2);
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
button:enabled:hover {
|
|
152
157
|
outline: none;
|
|
158
|
+
|
|
153
159
|
box-shadow: var(---shadow-4);
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
button:enabled:active {
|
|
157
163
|
outline: none;
|
|
164
|
+
|
|
158
165
|
box-shadow: var(---shadow-8);
|
|
159
166
|
}
|
|
160
167
|
|
|
161
|
-
|
|
168
|
+
button:enabled:focus-visible {
|
|
162
169
|
outline: none;
|
|
170
|
+
|
|
163
171
|
box-shadow: var(---shadow-4);
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
|
|
174
|
+
button:enabled:focus-visible:active {
|
|
167
175
|
outline: none;
|
|
176
|
+
|
|
168
177
|
box-shadow: var(---shadow-8);
|
|
169
178
|
}
|
|
170
179
|
`]}render(){return M`
|
|
@@ -183,10 +192,6 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
183
192
|
---decidables-slider-color: var(--decidables-slider-color, var(---color-element-enabled));
|
|
184
193
|
---decidables-spinner-background-color: var(--decidables-slider-background-color, none);
|
|
185
194
|
|
|
186
|
-
---shadow-2-rotate: var(--shadow-2-rotate, ${U(this.cssBoxShadow(2,!0,!1))});
|
|
187
|
-
---shadow-4-rotate: var(--shadow-4-rotate, ${U(this.cssBoxShadow(4,!0,!1))});
|
|
188
|
-
---shadow-8-rotate: var(--shadow-8-rotate, ${U(this.cssBoxShadow(8,!0,!1))});
|
|
189
|
-
|
|
190
195
|
display: flex;
|
|
191
196
|
|
|
192
197
|
flex-direction: column;
|
|
@@ -201,12 +206,14 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
201
206
|
|
|
202
207
|
.range {
|
|
203
208
|
position: relative;
|
|
209
|
+
|
|
204
210
|
display: flex;
|
|
205
211
|
|
|
206
212
|
flex-direction: row;
|
|
207
213
|
|
|
208
214
|
width: 3.5rem;
|
|
209
215
|
height: 4.75rem;
|
|
216
|
+
|
|
210
217
|
margin: 0 0.25rem 0.25rem;
|
|
211
218
|
}
|
|
212
219
|
|
|
@@ -218,21 +225,20 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
218
225
|
background: var(---decidables-spinner-background-color);
|
|
219
226
|
}
|
|
220
227
|
|
|
221
|
-
/* Adapted from http://danielstern.ca/range.css/#/ */
|
|
222
228
|
/* Overall */
|
|
223
229
|
input[type=range] {
|
|
224
|
-
width:
|
|
225
|
-
height:
|
|
230
|
+
width: 3.5rem;
|
|
231
|
+
height: 4.75rem;
|
|
232
|
+
|
|
226
233
|
padding: 0;
|
|
227
234
|
margin: 0;
|
|
235
|
+
|
|
236
|
+
appearance: none;
|
|
228
237
|
|
|
229
238
|
background-color: unset;
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
235
|
-
-webkit-appearance: none;
|
|
240
|
+
direction: rtl;
|
|
241
|
+
writing-mode: vertical-lr;
|
|
236
242
|
}
|
|
237
243
|
|
|
238
244
|
input[type=range]:enabled {
|
|
@@ -243,16 +249,10 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
243
249
|
outline: none;
|
|
244
250
|
}
|
|
245
251
|
|
|
246
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
247
|
-
input[type=range]::-ms-tooltip {
|
|
248
|
-
display: none;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
252
|
/* Track */
|
|
252
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
253
253
|
input[type=range]::-webkit-slider-runnable-track {
|
|
254
|
-
width:
|
|
255
|
-
height:
|
|
254
|
+
width: 4px;
|
|
255
|
+
height: 100%;
|
|
256
256
|
|
|
257
257
|
background: var(---decidables-slider-background-color);
|
|
258
258
|
border: 0;
|
|
@@ -264,10 +264,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
264
264
|
background: var(---decidables-slider-background-color);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
268
267
|
input[type=range]::-moz-range-track {
|
|
269
|
-
width:
|
|
270
|
-
height:
|
|
268
|
+
width: 4px;
|
|
269
|
+
height: 100%;
|
|
271
270
|
|
|
272
271
|
background: var(---decidables-slider-background-color);
|
|
273
272
|
border: 0;
|
|
@@ -275,57 +274,17 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
275
274
|
box-shadow: none;
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
279
|
-
input[type=range]::-ms-track {
|
|
280
|
-
width: 100%;
|
|
281
|
-
height: 4px;
|
|
282
|
-
|
|
283
|
-
color: transparent;
|
|
284
|
-
|
|
285
|
-
background: transparent;
|
|
286
|
-
border-color: transparent;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
290
|
-
input[type=range]::-ms-fill-lower {
|
|
291
|
-
background: #cccccc;
|
|
292
|
-
/* background: var(---decidables-slider-background-color); */
|
|
293
|
-
border: 0;
|
|
294
|
-
border-radius: 2px;
|
|
295
|
-
box-shadow: none;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
299
|
-
input[type=range]::-ms-fill-upper {
|
|
300
|
-
background: #cccccc;
|
|
301
|
-
/* background: var(---decidables-slider-background-color); */
|
|
302
|
-
border: 0;
|
|
303
|
-
border-radius: 2px;
|
|
304
|
-
box-shadow: none;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
308
|
-
input[type=range]:focus::-ms-fill-lower {
|
|
309
|
-
background: var(---decidables-slider-background-color);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
313
|
-
input[type=range]:focus::-ms-fill-upper {
|
|
314
|
-
background: var(---decidables-slider-background-color);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
277
|
/* Thumb */
|
|
318
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
319
278
|
input[type=range]::-webkit-slider-thumb {
|
|
320
|
-
width:
|
|
321
|
-
height:
|
|
322
|
-
|
|
279
|
+
width: 20px;
|
|
280
|
+
height: 10px;
|
|
281
|
+
|
|
282
|
+
margin-left: -8px;
|
|
283
|
+
|
|
284
|
+
appearance: none;
|
|
323
285
|
|
|
324
286
|
border: 0;
|
|
325
287
|
border-radius: 4px;
|
|
326
|
-
|
|
327
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
328
|
-
-webkit-appearance: none;
|
|
329
288
|
}
|
|
330
289
|
|
|
331
290
|
input[type=range]:disabled::-webkit-slider-thumb {
|
|
@@ -335,112 +294,65 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
335
294
|
|
|
336
295
|
input[type=range]:enabled::-webkit-slider-thumb {
|
|
337
296
|
background: var(---decidables-slider-color);
|
|
338
|
-
box-shadow: var(---shadow-2
|
|
297
|
+
box-shadow: var(---shadow-2);
|
|
339
298
|
}
|
|
340
299
|
|
|
341
300
|
input[type=range]:enabled:hover::-webkit-slider-thumb {
|
|
342
|
-
box-shadow: var(---shadow-4
|
|
301
|
+
box-shadow: var(---shadow-4);
|
|
343
302
|
}
|
|
344
303
|
|
|
345
304
|
input[type=range]:enabled:active::-webkit-slider-thumb {
|
|
346
|
-
box-shadow: var(---shadow-8
|
|
305
|
+
box-shadow: var(---shadow-8);
|
|
347
306
|
}
|
|
348
307
|
|
|
349
|
-
|
|
350
|
-
box-shadow: var(---shadow-4
|
|
308
|
+
input[type=range]:enabled:focus-visible::-webkit-slider-thumb {
|
|
309
|
+
box-shadow: var(---shadow-4);
|
|
351
310
|
}
|
|
352
311
|
|
|
353
|
-
|
|
354
|
-
box-shadow: var(---shadow-8
|
|
312
|
+
input[type=range]:enabled:focus-visible:active::-webkit-slider-thumb {
|
|
313
|
+
box-shadow: var(---shadow-8);
|
|
355
314
|
}
|
|
356
315
|
|
|
357
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
358
316
|
input[type=range]::-moz-range-thumb {
|
|
359
|
-
width:
|
|
360
|
-
height:
|
|
317
|
+
width: 20px;
|
|
318
|
+
height: 10px;
|
|
361
319
|
|
|
362
320
|
border: 0;
|
|
363
321
|
border-radius: 4px;
|
|
364
322
|
}
|
|
365
323
|
|
|
366
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
367
324
|
input[type=range]:disabled::-moz-range-thumb {
|
|
368
325
|
background: var(---decidables-slider-background-color);
|
|
369
326
|
box-shadow: none;
|
|
370
327
|
}
|
|
371
328
|
|
|
372
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
373
329
|
input[type=range]:enabled::-moz-range-thumb {
|
|
374
330
|
background: var(---decidables-slider-color);
|
|
375
|
-
box-shadow: var(---shadow-2
|
|
331
|
+
box-shadow: var(---shadow-2);
|
|
376
332
|
}
|
|
377
333
|
|
|
378
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
379
334
|
input[type=range]:enabled:hover::-moz-range-thumb {
|
|
380
|
-
box-shadow: var(---shadow-4
|
|
335
|
+
box-shadow: var(---shadow-4);
|
|
381
336
|
}
|
|
382
337
|
|
|
383
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
384
338
|
input[type=range]:enabled:active::-moz-range-thumb {
|
|
385
|
-
box-shadow: var(---shadow-8
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
:host(.keyboard) input[type=range]:enabled:focus::-moz-range-thumb {
|
|
389
|
-
box-shadow: var(---shadow-4-rotate);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
:host(.keyboard) input[type=range]:enabled:focus:active::-moz-range-thumb {
|
|
393
|
-
box-shadow: var(---shadow-8-rotate);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
397
|
-
input[type=range]::-ms-thumb {
|
|
398
|
-
width: 10px;
|
|
399
|
-
height: 20px;
|
|
400
|
-
margin-top: 0;
|
|
401
|
-
|
|
402
|
-
background: #999999;
|
|
403
|
-
/* background: var(---color-element-enabled); */
|
|
404
|
-
border: 0;
|
|
405
|
-
border-radius: 4px;
|
|
406
|
-
box-shadow: var(---shadow-2-rotate);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
410
|
-
input[type=range]:disabled::-ms-thumb {
|
|
411
|
-
background: var(---decidables-slider-background-color);
|
|
412
|
-
box-shadow: none;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
416
|
-
input[type=range]:enabled::-ms-thumb {
|
|
417
|
-
background: var(---decidables-slider-color);
|
|
418
|
-
box-shadow: var(---shadow-2-rotate);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
422
|
-
input[type=range]:enabled:hover::-ms-thumb {
|
|
423
|
-
box-shadow: var(---shadow-4-rotate);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/* stylelint-disable-next-line no-descending-specificity */ /* stylelint ERROR */
|
|
427
|
-
input[type=range]:enabled:active::-ms-thumb {
|
|
428
|
-
box-shadow: var(---shadow-8-rotate);
|
|
339
|
+
box-shadow: var(---shadow-8);
|
|
429
340
|
}
|
|
430
341
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
box-shadow: var(---shadow-4-rotate);
|
|
342
|
+
input[type=range]:enabled:focus-visible::-moz-range-thumb {
|
|
343
|
+
box-shadow: var(---shadow-4);
|
|
434
344
|
}
|
|
435
345
|
|
|
436
|
-
|
|
437
|
-
box-shadow: var(---shadow-8
|
|
346
|
+
input[type=range]:enabled:focus-visible:active::-moz-range-thumb {
|
|
347
|
+
box-shadow: var(---shadow-8);
|
|
438
348
|
}
|
|
439
349
|
|
|
440
|
-
|
|
350
|
+
/* Tick marks */
|
|
351
|
+
.datalist {
|
|
441
352
|
position: absolute;
|
|
442
353
|
left: 2rem;
|
|
443
354
|
z-index: -1;
|
|
355
|
+
|
|
444
356
|
display: flex;
|
|
445
357
|
|
|
446
358
|
flex-direction: column;
|
|
@@ -453,14 +365,13 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
453
365
|
font-size: 0.75rem;
|
|
454
366
|
}
|
|
455
367
|
|
|
456
|
-
option {
|
|
457
|
-
padding: 0;
|
|
458
|
-
|
|
368
|
+
.option {
|
|
459
369
|
line-height: 0.8;
|
|
460
|
-
|
|
370
|
+
|
|
371
|
+
white-space: nowrap;
|
|
461
372
|
}
|
|
462
373
|
|
|
463
|
-
option::before {
|
|
374
|
+
.option::before {
|
|
464
375
|
content: "– ";
|
|
465
376
|
}
|
|
466
377
|
`]}render(){return M`
|
|
@@ -470,10 +381,10 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
470
381
|
<div class="range">
|
|
471
382
|
<input ?disabled=${this.disabled} type="range" id="slider" min=${Vo(this.rangeMin)} max=${Vo(this.rangeMax)} step=${Vo(this.rangeStep)} .value=${this.rangeValue} @change=${this.rangeChanged.bind(this)} @input=${this.rangeInputted.bind(this)}>
|
|
472
383
|
${this.scale?M`
|
|
473
|
-
<
|
|
474
|
-
<option
|
|
475
|
-
<option
|
|
476
|
-
</
|
|
384
|
+
<div class="datalist">
|
|
385
|
+
<div class="option">${Vo(this.max)}</div>
|
|
386
|
+
<div class="option">${Vo(this.min)}</div>
|
|
387
|
+
</div>
|
|
477
388
|
`:M``}
|
|
478
389
|
</div>
|
|
479
390
|
<decidables-spinner ?disabled=${this.disabled} min=${Vo(this.min)} max=${Vo(this.max)} step=${Vo(this.step)} .value=${this.value} @input=${this.spinnerInputted.bind(this)}></decidables-spinner>
|
|
@@ -484,13 +395,14 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
484
395
|
---decidables-spinner-prefix: var(--decidables-spinner-prefix, "");
|
|
485
396
|
|
|
486
397
|
---decidables-spinner-postfix: var(--decidables-spinner-postfix, "");
|
|
487
|
-
---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding,
|
|
398
|
+
---decidables-spinner-postfix-padding: var(--decidables-spinner-postfix-padding, 0rem);
|
|
488
399
|
|
|
489
400
|
display: block;
|
|
490
401
|
}
|
|
491
402
|
|
|
492
403
|
label {
|
|
493
404
|
position: relative;
|
|
405
|
+
|
|
494
406
|
display: flex;
|
|
495
407
|
|
|
496
408
|
flex-direction: column;
|
|
@@ -508,6 +420,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
508
420
|
left: calc(50% - var(---decidables-spinner-input-width) / 2 + 0.25rem);
|
|
509
421
|
|
|
510
422
|
font-size: var(---decidables-spinner-font-size);
|
|
423
|
+
|
|
511
424
|
line-height: normal;
|
|
512
425
|
|
|
513
426
|
content: var(---decidables-spinner-prefix);
|
|
@@ -519,6 +432,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
519
432
|
bottom: 1px;
|
|
520
433
|
|
|
521
434
|
font-size: var(---decidables-spinner-font-size);
|
|
435
|
+
|
|
522
436
|
line-height: normal;
|
|
523
437
|
|
|
524
438
|
content: var(---decidables-spinner-postfix);
|
|
@@ -526,20 +440,24 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
526
440
|
|
|
527
441
|
input[type=number] {
|
|
528
442
|
width: var(---decidables-spinner-input-width);
|
|
529
|
-
|
|
443
|
+
|
|
444
|
+
padding: 1px var(---decidables-spinner-postfix-padding) 1px 2px;
|
|
445
|
+
margin: 0;
|
|
530
446
|
|
|
531
447
|
font-family: var(---font-family-base);
|
|
532
448
|
font-size: var(---decidables-spinner-font-size);
|
|
449
|
+
|
|
533
450
|
color: inherit;
|
|
451
|
+
|
|
534
452
|
text-align: right;
|
|
535
453
|
|
|
454
|
+
appearance: none;
|
|
455
|
+
outline: none;
|
|
456
|
+
|
|
536
457
|
background: none;
|
|
537
458
|
border: 0;
|
|
538
459
|
border-radius: 0;
|
|
539
|
-
outline: none;
|
|
540
460
|
box-shadow: var(---shadow-2);
|
|
541
|
-
|
|
542
|
-
-webkit-appearance: none; /* stylelint-disable-line property-no-vendor-prefix */
|
|
543
461
|
}
|
|
544
462
|
|
|
545
463
|
input[type=number]:hover {
|
|
@@ -556,20 +474,54 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
556
474
|
|
|
557
475
|
border: 0;
|
|
558
476
|
box-shadow: none;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* HACK: Manage spinners in Firefox */
|
|
480
|
+
@supports (-moz-appearance: textfield) {
|
|
481
|
+
input[type=number] {
|
|
482
|
+
padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
|
|
483
|
+
|
|
484
|
+
appearance: textfield;
|
|
485
|
+
}
|
|
559
486
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
487
|
+
input[type=number]:hover,
|
|
488
|
+
input[type=number]:focus,
|
|
489
|
+
input[type=number]:active {
|
|
490
|
+
padding-right: var(---decidables-spinner-postfix-padding);
|
|
491
|
+
|
|
492
|
+
appearance: none;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
input[type=number]:disabled {
|
|
496
|
+
padding-right: calc(18px + var(---decidables-spinner-postfix-padding));
|
|
497
|
+
|
|
498
|
+
appearance: textfield;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* HACK: Manage spinners in Chrome/Edge/Safari */
|
|
503
|
+
input[type=number]::-webkit-inner-spin-button {
|
|
504
|
+
/* Avoid oversized spinners in Safari */
|
|
505
|
+
font-size: 1.125rem;
|
|
506
|
+
|
|
507
|
+
opacity: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
input[type=number]:hover::-webkit-inner-spin-button,
|
|
511
|
+
input[type=number]:focus::-webkit-inner-spin-button,
|
|
512
|
+
input[type=number]:active::-webkit-inner-spin-button {
|
|
513
|
+
opacity: 1;
|
|
566
514
|
}
|
|
567
515
|
|
|
568
|
-
/* HACK: Hide spinners in disabled input for Firefox and Safari */
|
|
569
|
-
input[type=number]:disabled::-webkit-outer-spin-button,
|
|
570
516
|
input[type=number]:disabled::-webkit-inner-spin-button {
|
|
571
|
-
|
|
572
|
-
|
|
517
|
+
opacity: 0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/* HACK: Adjust padding on mobile w/o spinners */
|
|
521
|
+
@media only screen and (hover: none) and (pointer: coarse) {
|
|
522
|
+
input[type=number] {
|
|
523
|
+
padding-right: calc(1.125rem + var(---decidables-spinner-postfix-padding));
|
|
524
|
+
}
|
|
573
525
|
}
|
|
574
526
|
`]}render(){return M`
|
|
575
527
|
<label>
|
|
@@ -593,13 +545,16 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
593
545
|
|
|
594
546
|
width: 1px;
|
|
595
547
|
height: 1px;
|
|
548
|
+
|
|
596
549
|
padding: 0;
|
|
597
550
|
margin: -1px;
|
|
551
|
+
|
|
598
552
|
overflow: hidden;
|
|
599
553
|
|
|
600
554
|
white-space: nowrap;
|
|
601
555
|
|
|
602
556
|
border: 0;
|
|
557
|
+
|
|
603
558
|
clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
|
|
604
559
|
}
|
|
605
560
|
|
|
@@ -615,6 +570,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
615
570
|
position: relative;
|
|
616
571
|
|
|
617
572
|
min-width: 24px;
|
|
573
|
+
|
|
618
574
|
padding: 0 0 36px;
|
|
619
575
|
margin: 0.25rem 0.25rem 0;
|
|
620
576
|
|
|
@@ -626,17 +582,17 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
626
582
|
input[type=checkbox] + label + label::before,
|
|
627
583
|
input[type=checkbox] + label + label::after {
|
|
628
584
|
position: absolute;
|
|
629
|
-
|
|
630
585
|
left: 50%;
|
|
631
586
|
|
|
632
587
|
margin: 0;
|
|
633
588
|
|
|
634
|
-
content: "";
|
|
635
|
-
|
|
636
589
|
outline: 0;
|
|
637
590
|
|
|
638
|
-
|
|
591
|
+
content: "";
|
|
592
|
+
|
|
639
593
|
transform: translate(-50%, 0);
|
|
594
|
+
|
|
595
|
+
transition: all var(---transition-duration) ease;
|
|
640
596
|
}
|
|
641
597
|
|
|
642
598
|
input[type=checkbox] + label + label::before {
|
|
@@ -684,17 +640,14 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
684
640
|
box-shadow: var(---shadow-8);
|
|
685
641
|
}
|
|
686
642
|
|
|
687
|
-
|
|
688
|
-
:host(.keyboard) input[type=checkbox]:enabled:focus + label + label::after {
|
|
643
|
+
input[type=checkbox]:enabled:focus-visible + label + label::after {
|
|
689
644
|
box-shadow: var(---shadow-4);
|
|
690
645
|
}
|
|
691
646
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
:host(.keyboard) input[type=checkbox]:enabled:focus:active + label + label::after {
|
|
647
|
+
input[type=checkbox]:enabled:focus-visible + label + label:active::after,
|
|
648
|
+
input[type=checkbox]:enabled:focus-visible:active + label + label::after {
|
|
695
649
|
box-shadow: var(---shadow-8);
|
|
696
650
|
}
|
|
697
|
-
/* stylelint-enable selector-max-compound-selectors */
|
|
698
651
|
`]}render(){return M`
|
|
699
652
|
<input type="checkbox" id="switch" ?checked=${this.checked} ?disabled=${this.disabled} @change=${this.changed.bind(this)}>
|
|
700
653
|
<label for="switch">
|
|
@@ -736,39 +689,46 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
736
689
|
|
|
737
690
|
width: 1px;
|
|
738
691
|
height: 1px;
|
|
692
|
+
|
|
739
693
|
padding: 0;
|
|
740
694
|
margin: -1px;
|
|
695
|
+
|
|
741
696
|
overflow: hidden;
|
|
742
697
|
|
|
743
698
|
white-space: nowrap;
|
|
744
699
|
|
|
745
700
|
border: 0;
|
|
701
|
+
|
|
746
702
|
clip-path: inset(100%); /* May cause a performance issue: https://github.com/h5bp/html5-boilerplate/issues/2021 */
|
|
747
703
|
}
|
|
748
704
|
|
|
749
705
|
input[type=radio] + label {
|
|
750
706
|
width: 100%;
|
|
707
|
+
|
|
751
708
|
padding: 0.375rem 0.75rem;
|
|
752
709
|
|
|
753
710
|
font-family: var(---font-family-base);
|
|
754
711
|
font-size: 1.125rem;
|
|
712
|
+
|
|
755
713
|
line-height: 1.5;
|
|
714
|
+
|
|
756
715
|
color: var(---color-text-inverse);
|
|
716
|
+
|
|
757
717
|
text-align: center;
|
|
758
718
|
|
|
759
719
|
cursor: pointer;
|
|
720
|
+
outline: none;
|
|
760
721
|
|
|
761
722
|
background-color: var(---color-element-enabled);
|
|
762
723
|
border: 0;
|
|
763
724
|
border-radius: 0;
|
|
764
|
-
outline: none;
|
|
765
|
-
|
|
766
725
|
box-shadow: var(---shadow-2);
|
|
767
726
|
}
|
|
768
727
|
|
|
769
728
|
input[type=radio]:checked + label {
|
|
770
|
-
background-color: var(---color-element-selected);
|
|
771
729
|
outline: none;
|
|
730
|
+
|
|
731
|
+
background-color: var(---color-element-selected);
|
|
772
732
|
box-shadow: var(---shadow-2);
|
|
773
733
|
}
|
|
774
734
|
|
|
@@ -776,6 +736,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
776
736
|
z-index: 1;
|
|
777
737
|
|
|
778
738
|
outline: none;
|
|
739
|
+
|
|
779
740
|
box-shadow: var(---shadow-4);
|
|
780
741
|
}
|
|
781
742
|
|
|
@@ -783,6 +744,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
783
744
|
z-index: 2;
|
|
784
745
|
|
|
785
746
|
outline: none;
|
|
747
|
+
|
|
786
748
|
box-shadow: var(---shadow-8);
|
|
787
749
|
}
|
|
788
750
|
|
|
@@ -796,25 +758,28 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
796
758
|
border-bottom-left-radius: 0.25rem;
|
|
797
759
|
}
|
|
798
760
|
|
|
799
|
-
|
|
761
|
+
input[type=radio]:focus-visible + label {
|
|
800
762
|
z-index: 1;
|
|
801
763
|
|
|
802
764
|
outline: none;
|
|
765
|
+
|
|
803
766
|
box-shadow: var(---shadow-4);
|
|
804
767
|
}
|
|
805
768
|
|
|
806
|
-
|
|
769
|
+
input[type=radio]:focus-visible:checked + label {
|
|
807
770
|
z-index: 1;
|
|
808
771
|
|
|
809
|
-
background-color: var(---color-element-selected);
|
|
810
772
|
outline: none;
|
|
773
|
+
|
|
774
|
+
background-color: var(---color-element-selected);
|
|
811
775
|
box-shadow: var(---shadow-4);
|
|
812
776
|
}
|
|
813
777
|
|
|
814
|
-
|
|
778
|
+
input[type=radio]:focus-visible + label:active {
|
|
815
779
|
z-index: 2;
|
|
816
780
|
|
|
817
781
|
outline: none;
|
|
782
|
+
|
|
818
783
|
box-shadow: var(---shadow-8);
|
|
819
784
|
}
|
|
820
785
|
`]}render(){return M`
|
|
@@ -887,7 +852,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
887
852
|
* @license
|
|
888
853
|
* Copyright 2017 Google LLC
|
|
889
854
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
890
|
-
*/function fo(t){void 0!==this._$AN?(Ho(this),this._$AM=t,Do(this)):this._$AM=t}function wo(t,B=!1,s=0){const Q=this._$AH,F=this._$AN;if(void 0!==F&&0!==F.size)if(B)if(Array.isArray(Q))for(let t=s;t<Q.length;t++)Wo(Q[t],!1),Ho(Q[t]);else null!=Q&&(Wo(Q,!1),Ho(Q));else Wo(this,t)}const vo=t=>{t.type==No&&(t._$AP??=wo,t._$AQ??=fo)};class Yo extends Xo{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,B,s){super._$AT(t,B,s),Do(this),this.isConnected=t._$AU}_$AO(t,B=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),B&&(Wo(this,t),Ho(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const B=[...this._$Ct._$AH];B[this._$Ci]=t,this._$Ct._$AI(B,this,0)}}disconnected(){}reconnected(){}}const Jo=new WeakMap;let ko=0;const Mo=new Map,To=new WeakSet,zo=()=>new Promise(t=>requestAnimationFrame(t)),Ko=[{transform:"translateX(-100%) scale(0)",opacity:0}],Oo=[{opacity:0},{opacity:1}],Po=(t,B)=>{const s=t-B;return 0===s?void 0:s},jo=(t,B)=>{const s=t/B;return 1===s?void 0:s},_o={left:(t,B)=>{const s=Po(t,B);return{value:s,transform:null==s||isNaN(s)?void 0:`translateX(${s}px)`}},top:(t,B)=>{const s=Po(t,B);return{value:s,transform:null==s||isNaN(s)?void 0:`translateY(${s}px)`}},width:(t,B)=>{let s;0===B&&(B=1,s={width:"1px"});const Q=jo(t,B);return{value:Q,overrideFrom:s,transform:null==Q||isNaN(Q)?void 0:`scaleX(${Q})`}},height:(t,B)=>{let s;0===B&&(B=1,s={height:"1px"});const Q=jo(t,B);return{value:Q,overrideFrom:s,transform:null==Q||isNaN(Q)?void 0:`scaleY(${Q})`}}},$o={duration:333,easing:"ease-in-out"},qo=["left","top","width","height","opacity","color","background"],tb=new WeakMap;const Bb=(t=>(...B)=>({_$litDirective$:t,values:B}))(class extends Yo{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===No)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){this.l?.(),this.l=void 0}render(t){return K}getController(){return Jo.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(t,[B]){const s=void 0===this.u;return s&&(this.u=t.options?.host,this.u.addController(this),this.u.updateComplete.then(t=>this.t=!0),this.element=t.element,tb.set(this.element,this)),this.optionsOrCallback=B,(s||"function"!=typeof B)&&this.
|
|
855
|
+
*/function fo(t){void 0!==this._$AN?(Ho(this),this._$AM=t,Do(this)):this._$AM=t}function wo(t,B=!1,s=0){const Q=this._$AH,F=this._$AN;if(void 0!==F&&0!==F.size)if(B)if(Array.isArray(Q))for(let t=s;t<Q.length;t++)Wo(Q[t],!1),Ho(Q[t]);else null!=Q&&(Wo(Q,!1),Ho(Q));else Wo(this,t)}const vo=t=>{t.type==No&&(t._$AP??=wo,t._$AQ??=fo)};class Yo extends Xo{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,B,s){super._$AT(t,B,s),Do(this),this.isConnected=t._$AU}_$AO(t,B=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),B&&(Wo(this,t),Ho(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const B=[...this._$Ct._$AH];B[this._$Ci]=t,this._$Ct._$AI(B,this,0)}}disconnected(){}reconnected(){}}const Jo=new WeakMap;let ko=0;const Mo=new Map,To=new WeakSet,zo=()=>new Promise(t=>requestAnimationFrame(t)),Ko=[{transform:"translateX(-100%) scale(0)",opacity:0}],Oo=[{opacity:0},{opacity:1}],Po=(t,B)=>{const s=t-B;return 0===s?void 0:s},jo=(t,B)=>{const s=t/B;return 1===s?void 0:s},_o={left:(t,B)=>{const s=Po(t,B);return{value:s,transform:null==s||isNaN(s)?void 0:`translateX(${s}px)`}},top:(t,B)=>{const s=Po(t,B);return{value:s,transform:null==s||isNaN(s)?void 0:`translateY(${s}px)`}},width:(t,B)=>{let s;0===B&&(B=1,s={width:"1px"});const Q=jo(t,B);return{value:Q,overrideFrom:s,transform:null==Q||isNaN(Q)?void 0:`scaleX(${Q})`}},height:(t,B)=>{let s;0===B&&(B=1,s={height:"1px"});const Q=jo(t,B);return{value:Q,overrideFrom:s,transform:null==Q||isNaN(Q)?void 0:`scaleY(${Q})`}}},$o={duration:333,easing:"ease-in-out"},qo=["left","top","width","height","opacity","color","background"],tb=new WeakMap;const Bb=(t=>(...B)=>({_$litDirective$:t,values:B}))(class extends Yo{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===No)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){this.l?.(),this.l=void 0}render(t){return K}getController(){return Jo.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(t,[B]){const s=void 0===this.u;return s&&(this.u=t.options?.host,this.u.addController(this),this.u.updateComplete.then(t=>this.t=!0),this.element=t.element,tb.set(this.element,this)),this.optionsOrCallback=B,(s||"function"!=typeof B)&&this.m(B),this.render(B)}m(t){t=t??{};const B=this.getController();void 0!==B&&((t={...B.defaultOptions,...t}).keyframeOptions={...B.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??=qo,this.options=t}p(){const t={},B=this.element.getBoundingClientRect(),s=getComputedStyle(this.element);return this.options.properties.forEach(Q=>{const F=B[Q]??(_o[Q]?void 0:s[Q]),i=Number(F);t[Q]=isNaN(i)?F+"":i}),t}v(){let t,B=!0;return this.options.guard&&(t=this.options.guard(),B=((t,B)=>{if(Array.isArray(t)){if(Array.isArray(B)&&B.length===t.length&&t.every((t,s)=>t===B[s]))return!1}else if(B===t)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&B&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){"function"==typeof this.optionsOrCallback&&this.m(this.optionsOrCallback()),this.v()&&(this.A=this.p(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await zo;const B=this.P(),s=this.V(this.options.keyframeOptions,B),Q=this.p();if(void 0!==this.A){const{from:s,to:F}=this.O(this.A,Q,B);this.log("measured",[this.A,Q,s,F]),t=this.calculateKeyframes(s,F)}else{const s=Mo.get(this.options.inId);if(s){Mo.delete(this.options.inId);const{from:F,to:i}=this.O(s,Q,B);t=this.calculateKeyframes(F,i),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,ko++,t.forEach(t=>t.zIndex=ko)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,s)}resetStyles(){void 0!==this.j&&(this.element.setAttribute("style",this.j??""),this.j=void 0)}commitStyles(){this.j=this.element.getAttribute("style"),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h)return;if(void 0!==this.options.id&&Mo.set(this.options.id,this.A),void 0===this.options.out)return;if(this.prepare(),await zo(),this.i?.isConnected){const t=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,t),this.options.stabilizeOut){const t=this.p();this.log("stabilizing out");const B=this.A.left-t.left,s=this.A.top-t.top;!("static"===getComputedStyle(this.element).position)||0===B&&0===s||(this.element.style.position="relative"),0!==B&&(this.element.style.left=B+"px"),0!==s&&(this.element.style.top=s+"px")}}const t=this.V(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(t){t&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}P(){const t=[];for(let B=this.element.parentNode;B;B=B?.parentNode){const s=tb.get(B);s&&!s.isDisabled()&&s&&t.push(s)}return t}get isHostRendered(){const t=To.has(this.u);return t||this.u.updateComplete.then(()=>{To.add(this.u)}),t}V(t,B=this.P()){const s={...$o};return B.forEach(t=>Object.assign(s,t.options.keyframeOptions)),Object.assign(s,t),s}O(t,B,s){t={...t},B={...B};const Q=s.map(t=>t.animatingProperties).filter(t=>void 0!==t);let F=1,i=1;return Q.length>0&&(Q.forEach(t=>{t.width&&(F/=t.width),t.height&&(i/=t.height)}),void 0!==t.left&&void 0!==B.left&&(t.left=F*t.left,B.left=F*B.left),void 0!==t.top&&void 0!==B.top&&(t.top=i*t.top,B.top=i*B.top)),{from:t,to:B}}calculateKeyframes(t,B,s=!1){const Q={},F={};let i=!1;const U={};for(const s in B){const g=t[s],e=B[s];if(s in _o){const t=_o[s];if(void 0===g||void 0===e)continue;const B=t(g,e);void 0!==B.transform&&(U[s]=B.value,i=!0,Q.transform=`${Q.transform??""} ${B.transform}`,void 0!==B.overrideFrom&&Object.assign(Q,B.overrideFrom))}else g!==e&&void 0!==g&&void 0!==e&&(i=!0,Q[s]=g,F[s]=e)}return Q.transformOrigin=F.transformOrigin=s?"center center":"top left",this.animatingProperties=U,i?[Q,F]:void 0}async animate(t,B=this.options.keyframeOptions){this.start(),this.frames=t;let s=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),void 0!==t)){this.log("animate",[t,B]),s=!0,this.webAnimation=this.element.animate(t,B);const Q=this.getController();Q?.add(this);try{await this.webAnimation.finished}catch(t){}Q?.remove(this)}return this.didFinish(s),s}isAnimating(){return"running"===this.webAnimation?.playState||this.webAnimation?.pending}log(t,B){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,B)}});class sb{static a={DEFAULT:.5,MIN:0,MAX:1,STEP:.01,JUMP:.05};static l={DEFAULT:2,MIN:0,MAX:10,STEP:.01,JUMP:.05};static g={DEFAULT:.5,MIN:0,MAX:1,STEP:.01,JUMP:.05};static xal2v(t,B,s){return t>=0?t**B:-s*(-t)**B}static xlv2a(t,B,s){return t>=0?Math.log(s)/Math.log(t):(Math.log(-s)-Math.log(B))/Math.log(-t)}static xav2l(t,B,s){return t>=0?NaN:-s/(-t)**B}static pg2w(t,B){return t**B/(t**B+(1-t)**B)**(1/B)}static vw2u(t,B){if("number"==typeof t&&"number"==typeof B)return t*B;if(t instanceof Array&&B instanceof Array&&t.length>0&&t.length===B.length){let s=0;for(let Q=0;Q<t.length;Q+=1)s+=t[Q]*B[Q];return s}return NaN}}class Qb extends Eo{static get properties(){return{numeric:{attribute:"numeric",type:Boolean,reflect:!0}}}constructor(){super(),this.numeric=!1}static get styles(){return[super.styles,g`
|
|
891
856
|
:host {
|
|
892
857
|
display: block;
|
|
893
858
|
|
|
@@ -948,11 +913,13 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
948
913
|
|
|
949
914
|
.addend {
|
|
950
915
|
position: relative;
|
|
916
|
+
|
|
951
917
|
display: inline-block;
|
|
952
918
|
}
|
|
953
919
|
|
|
954
920
|
.comparison {
|
|
955
921
|
position: relative;
|
|
922
|
+
|
|
956
923
|
display: inline-block;
|
|
957
924
|
|
|
958
925
|
font-size: 125%;
|
|
@@ -1247,6 +1214,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1247
1214
|
|
|
1248
1215
|
decidables-slider {
|
|
1249
1216
|
line-height: 1;
|
|
1217
|
+
|
|
1250
1218
|
text-align: center;
|
|
1251
1219
|
}
|
|
1252
1220
|
|
|
@@ -1323,9 +1291,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1323
1291
|
|
|
1324
1292
|
.curve.interactive {
|
|
1325
1293
|
cursor: nwse-resize;
|
|
1294
|
+
outline: none;
|
|
1326
1295
|
|
|
1327
1296
|
filter: url("#shadow-2");
|
|
1328
|
-
outline: none;
|
|
1329
1297
|
}
|
|
1330
1298
|
|
|
1331
1299
|
.curve.interactive:hover {
|
|
@@ -1343,7 +1311,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1343
1311
|
transform: translateY(0);
|
|
1344
1312
|
}
|
|
1345
1313
|
|
|
1346
|
-
|
|
1314
|
+
.curve.interactive:focus-visible {
|
|
1347
1315
|
filter: url("#shadow-8");
|
|
1348
1316
|
|
|
1349
1317
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -1352,9 +1320,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1352
1320
|
|
|
1353
1321
|
.point.interactive {
|
|
1354
1322
|
cursor: nesw-resize;
|
|
1323
|
+
outline: none;
|
|
1355
1324
|
|
|
1356
1325
|
filter: url("#shadow-2");
|
|
1357
|
-
outline: none;
|
|
1358
1326
|
|
|
1359
1327
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
1360
1328
|
stroke: #000000;
|
|
@@ -1376,7 +1344,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1376
1344
|
stroke: #00ff00;
|
|
1377
1345
|
}
|
|
1378
1346
|
|
|
1379
|
-
|
|
1347
|
+
.point.interactive:focus-visible {
|
|
1380
1348
|
filter: url("#shadow-8");
|
|
1381
1349
|
|
|
1382
1350
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -1410,8 +1378,8 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1410
1378
|
|
|
1411
1379
|
.diagonal {
|
|
1412
1380
|
stroke: var(---color-element-border);
|
|
1413
|
-
stroke-dasharray: 4;
|
|
1414
1381
|
stroke-width: 1;
|
|
1382
|
+
stroke-dasharray: 4;
|
|
1415
1383
|
}
|
|
1416
1384
|
|
|
1417
1385
|
.curve {
|
|
@@ -1444,8 +1412,8 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1444
1412
|
font-size: 0.75rem;
|
|
1445
1413
|
|
|
1446
1414
|
dominant-baseline: middle;
|
|
1447
|
-
text-anchor: middle;
|
|
1448
1415
|
|
|
1416
|
+
text-anchor: middle;
|
|
1449
1417
|
fill: var(---color-text-inverse);
|
|
1450
1418
|
}
|
|
1451
1419
|
|
|
@@ -1457,11 +1425,11 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1457
1425
|
|
|
1458
1426
|
@media (pointer: coarse) {
|
|
1459
1427
|
.interactive .touch {
|
|
1460
|
-
stroke-linecap: round;
|
|
1461
1428
|
stroke-width: 12;
|
|
1429
|
+
stroke-linecap: round;
|
|
1462
1430
|
}
|
|
1463
1431
|
}
|
|
1464
|
-
`]}render(){return M``}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=2*this.rem,i=3*this.rem,U=3*this.rem,g=Q-(F+i),e=Q-(U+2*this.rem),I=parseInt(this.getComputedStyleValue("---transition-duration"),10),l=AI().domain([0,1]).range([0,e]).clamp(!0);this.xScale=l;const c=AI().domain([1,0]).range([0,g]);this.yScale=c;const n=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.pg2w(this.xScale.invert(t.x),B.g)),p:this.xScale.invert(t.x),g:B.g,w:sb.pg2w(this.xScale.invert(t.x),B.g)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=s-t.subject.p,i=Q-t.subject.w,U=(F**2+i**2)**.5,g=t.subject.p>t.subject.w?F>i?t.subject.g-U:t.subject.g+U:F>i?t.subject.g+U:t.subject.g-U;B.g=g>sb.g.MAX?sb.g.MAX:g<sb.g.MIN?sb.g.MIN:g,"default"===B.name&&(this.g=B.g),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),a=tQ().subject((t,B)=>({x:this.xScale(B.p),y:this.yScale(B.w)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x);B.p=s<0?0:s>1?1:s,"default"===B.name&&(this.p=B.p),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:{name:B.name,p:B.p,w:B.w,label:B.label,g:this.getFunction(B.function).g},bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),d=bd().x(t=>l(t.p)).y(t=>c(t.w)),o=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),b=o.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),C=b.merge(o).attr("viewBox",`0 0 ${Q} ${Q}`),r=b.append("g").classed("plot",!0),u=C.select(".plot").attr("transform",`translate(${U}, ${F})`);r.append("clipPath").attr("id","clip-cpt-value").append("rect"),u.select("clipPath rect").attr("height",g+1).attr("width",e+1);const h=r.append("g").classed("underlayer",!0),x=u.select(".underlayer");h.append("rect").classed("background",!0),x.select(".background").attr("height",g).attr("width",e),h.append("g").classed("scale-x",!0);x.select(".scale-x").attr("transform",`translate(0, ${g})`).transition().duration(2*I).ease(Wi).call(yB(l)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null);const G=h.append("text").classed("title-x",!0).attr("text-anchor","middle");G.append("tspan").classed("name",!0).text("Probability ("),G.append("tspan").classed("math-var p",!0).text("p"),G.append("tspan").classed("name",!0).text(")"),x.select(".title-x").attr("transform",`translate(${e/2}, ${g+2.25*this.rem})`),h.append("g").classed("scale-y",!0);x.select(".scale-y").transition().duration(2*I).ease(Wi).call(AB(c)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null);const y=h.append("text").classed("title-y",!0).attr("text-anchor","middle");y.append("tspan").classed("name",!0).text("Decision Weight ("),y.append("tspan").classed("math-var v",!0).text("w"),y.append("tspan").classed("name",!0).text(")"),x.select(".title-y").attr("transform",`translate(${-2*this.rem}, ${g/2})rotate(-90)`),h.append("line").classed("diagonal",!0),x.select(".diagonal").transition().duration(2*I).attr("x1",l(0)).attr("y1",c(0)).attr("x2",l(1)).attr("y2",c(1)),r.append("g").classed("content",!0);const A=u.select(".content"),L=A.selectAll(".lines").data(this.probabilities.filter(t=>null!=t.p),t=>t.name),R=L.enter().append("g").classed("lines",!0);R.each((t,B,s)=>{const Q=Js(s[B]);Q.append("line").classed("line-p above",!0),Q.append("line").classed("line-p below",!0),Q.append("line").classed("line-w before",!0),Q.append("line").classed("line-w after",!0)}),R.filter(t=>t.new).attr("data-animating-ease-time-1",0).attr("data-animating-ease-time-2",0).each((t,B,s)=>{const Q=Js(s[B]);Q.select(".line-p.above").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(1)).attr("y2",c(1)),Q.select(".line-p.below").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(0)).attr("y2",c(0)),Q.select(".line-w.before").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(t.w)).attr("y2",c(t.w)),Q.select(".line-w.after").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(t.w)).attr("y2",c(t.w))});const m=R.merge(L),V=m.filter(t=>t.new&&!t.paused);if(!V.empty()){const t=V.attr("data-animating-ease-time-1"),B=V.attr("data-animating-ease-time-2"),s=B=>AI().domain([0,1]).range([t,1])(B),Q=B=>AI().range([0,1]).domain([t,1])(B),F=t=>AI().domain([0,1]).range([B,1])(t),i=t=>AI().range([0,1]).domain([B,1])(t),U=B=>s=>AI().domain([B(t),1]).range([0,1])(B(s)),g=t=>s=>AI().domain([t(B),1]).range([0,1])(t(s));V.transition("new-1").duration(()=>Math.floor(I*(1-t))).ease(s).attr("data-animating-ease-time-1",1).tween("animating",(t,B,s)=>{const F=s[B],i=Js(F),g=mF(void 0!==F.p?F.p:t.p,t.p),e=mF(void 0!==F.g?F.g:this.getFunction(t.function).g,this.getFunction(t.function).g),I=mF(c.invert(i.select(".line-p.above").attr("y1")),t.w),n=mF(c.invert(i.select(".line-p.below").attr("y1")),t.w);return t=>{F.p=g(Wi(Q(t))),F.g=e(Wi(Q(t))),F.w=sb.pg2w(F.p,F.g),i.select(".line-p.above").attr("x1",l(F.p)).attr("x2",l(F.p)).attr("y1",c(I(U(Xi)(t)))).attr("y2",c(1)),i.select(".line-p.below").attr("x1",l(F.p)).attr("x2",l(F.p)).attr("y1",c(n(U(Xi)(t)))).attr("y2",c(0))}}).transition("new-2").duration(()=>Math.floor(I*(1-B))).ease(F).attr("data-animating-ease-time-2",1).tween("animating",(t,B,s)=>{const Q=s[B],F=Js(Q),U=mF(void 0!==Q.p?Q.p:t.p,t.p),e=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g),I=mF(l.invert(F.select(".line-w.before").attr("x1")),0),n=mF(l.invert(F.select(".line-w.after").attr("x1")),1);return t=>{Q.p=U(Wi(i(t))),Q.g=e(Wi(i(t))),Q.w=sb.pg2w(Q.p,Q.g),F.select(".line-w.before").attr("x1",l(I(g(Wi)(t)))).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w)),F.select(".line-w.after").attr("x1",l(n(g(Wi)(t)))).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w))}}).on("end",(t,B,s)=>{const Q=s[B];Q.removeAttribute("data-animating-ease-time-1"),Q.removeAttribute("data-animating-ease-time-2"),t.new=!1,this.dispatchEvent(new CustomEvent("prospectable-response",{detail:{trial:this.trialCount,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,response:this.response},bubbles:!0}))})}const S=m.filter(t=>t.new&&t.paused);if(!S.empty()){const t=S.attr("data-animating-ease-time-1"),B=S.attr("data-animating-ease-time-2");S.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("paused",(s,Q,F)=>{const i=F[Q],U=Js(i),g=mF(void 0!==i.p?i.p:s.p,s.p),e=mF(void 0!==i.g?i.g:this.getFunction(s.function).g,this.getFunction(s.function).g),I=mF(1,s.w),n=mF(0,s.w),a=mF(s.p,0),d=mF(s.p,1);return s=>{i.p=g(s),i.g=e(s),i.w=sb.pg2w(i.p,i.g),U.select(".line-p.above").attr("x1",l(i.p)).attr("x2",l(i.p)).attr("y1",c(I(Xi(t)))).attr("y2",c(1)),U.select(".line-p.below").attr("x1",l(i.p)).attr("x2",l(i.p)).attr("y1",c(n(Xi(t)))).attr("y2",c(0)),U.select(".line-w.before").attr("x1",l(a(Wi(B)))).attr("x2",l(i.p)).attr("y1",c(i.w)).attr("y2",c(i.w)),U.select(".line-w.after").attr("x1",l(d(Wi(B)))).attr("x2",l(i.p)).attr("y1",c(i.w)).attr("y2",c(i.w))}})}m.filter(t=>!t.new).transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("non-animating",(t,B,s)=>{const Q=s[B],F=Js(Q),i=mF(void 0!==Q.p?Q.p:t.p,t.p),U=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g);return t=>{Q.p=i(t),Q.g=U(t),Q.w=sb.pg2w(Q.p,Q.g),F.select(".line-p.above").attr("x1",l(Q.p)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(1)),F.select(".line-p.below").attr("x1",l(Q.p)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(0)),F.select(".line-w.before").attr("x1",l(0)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w)),F.select(".line-w.after").attr("x1",l(1)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w))}}),L.exit().remove();const Z=A.selectAll(".curve").data(this.functions,t=>t.name),p=Z.enter().append("g").classed("curve",!0).attr("clip-path","url(#clip-cpt-value)");p.append("path").classed("path",!0),p.append("path").classed("path touch",!0);const E=p.merge(Z);(this.firstUpdate||t.has("interactive"))&&(this.interactive?E.attr("tabindex",0).classed("interactive",!0).call(n).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.g;switch(t.key){case"ArrowUp":case"ArrowLeft":s+=t.shiftKey?sb.g.STEP:sb.g.JUMP;break;case"ArrowDown":case"ArrowRight":s-=t.shiftKey?sb.g.STEP:sb.g.JUMP}s=s<sb.g.MIN?sb.g.MIN:s>sb.g.MAX?sb.g.MAX:s,s!==B.g&&(B.g=s,"default"===B.name&&(this.g=B.g),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):E.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),E.select(".path").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.g?Q.g:t.g,t.g);return t=>{Q.g=F(t);const B=nB(l.range()[0],l.range()[1]+1,1).map(t=>({p:l.invert(t),w:sb.pg2w(l.invert(t),Q.g)}));return d(B)}}),E.select(".path.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.g?Q.g:t.g,t.g);return t=>{Q.g=F(t);const B=nB(l.range()[0],l.range()[1]+1,1).map(t=>({p:l.invert(t),w:sb.pg2w(l.invert(t),Q.g)}));return d(B)}}),Z.exit().remove();const N=A.selectAll(".point").data(this.probabilities.filter(t=>null!=t.p),t=>t.name),X=N.enter().append("g").classed("point",!0);X.append("circle").classed("circle touch",!0),X.append("text").classed("label",!0);const W=X.merge(N);W.select("text").text(t=>t.label),W.filter(B=>(this.firstUpdate||t.has("interactive"))&&this.interactive&&!B.trial).attr("tabindex",0).classed("interactive",!0).call(a).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.p;switch(t.key){case"ArrowUp":case"ArrowRight":s+=t.shiftKey?.01:.05;break;case"ArrowDown":case"ArrowLeft":s-=t.shiftKey?.01:.05}s=s<0?0:s>1?1:s,s!==B.p&&(B.p=s,"default"===B.name&&(this.p=B.p),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:{name:B.name,p:B.p,w:B.w,label:B.label,g:this.getFunction(B.function).g},bubbles:!0}))),t.preventDefault()}}),W.filter(B=>(this.firstUpdate||t.has("interactive"))&&!this.interactive||B.trial).attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null),W.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("transform",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.p?Q.p:t.p,t.p),i=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g);return t=>(Q.p=F(t),Q.g=i(t),`translate(\n ${l(Q.p)},\n ${c(sb.pg2w(Q.p,Q.g))}\n )`)}),N.exit().remove(),this.drag=!1,this.firstUpdate=!1}}function lL(t,B){return{x:B.origin.x+B.scale*t.x,y:B.origin.y+B.scale*t.y}}function cL(t){return t.x}function nL(t){return t.y}function aL(t){return t.z}function dL(t,B){const s=t.centroid.z,Q=B.centroid.z;return s<Q?-1:s>Q?1:s>=Q?0:NaN}function oL(t,B){let s=0,Q=0,F=0,i={x:0,y:0},U={x:0,y:0,z:0},g=1,e=cL,I=nL,l=aL,c=0;function n(B){return t(B,{scale:g,origin:i,project:lL,row:c},{x:e,y:I,z:l},{x:s,y:Q,z:F,rotateCenter:U})}return n.origin=function(t){return arguments.length?(i=t,n):i},n.scale=function(t){return arguments.length?(g=t,n):g},n.rotateX=function(t){return arguments.length?(s=t,n):s},n.rotateY=function(t){return arguments.length?(Q=t,n):Q},n.rotateZ=function(t){return arguments.length?(F=t,n):F},n.rotationCenter=function(t){return arguments.length?(U=t,n):U},n.x=function(t){return arguments.length?(e="function"==typeof t?t:+t,n):e},n.y=function(t){return arguments.length?(I="function"==typeof t?t:+t,n):I},n.z=function(t){return arguments.length?(l="function"==typeof t?t:+t,n):l},n.rows=function(t){return arguments.length?(c="function"==typeof t?t:+t,n):c},n.draw=B,n.sort=dL,n}function bL(t){const B=[...t,t[0]];let s=0;for(let Q=0;Q<t.length;Q++){const t=Q+1,F=B[Q].rotated,i=B[t].rotated;s+=(i.x-F.x)*(i.y+F.y)}return s>0}function CL(t){let B=0,s=0,Q=0,F=t.length;for(let i=F-1;i>=0;i--){const F=t[i].rotated;B+=F.x,s+=F.y,Q+=F.z}return{x:B/F,y:s/F,z:Q/F}}function rL(t,B){const s=B.rotateCenter;t.x-=s.x,t.y-=s.y,t.z-=s.z;const Q=function(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.x*Q-t.y*s,y:t.x*s+t.y*Q,z:t.z}}(t,B.z),F=function(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.z*s+t.x*Q,y:t.y,z:t.z*Q-t.x*s}}(Q,B.y),i=function(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.x,y:t.y*Q-t.z*s,z:t.y*s+t.z*Q}}(F,B.x);return i.x+=s.x,i.y+=s.y,i.z+=s.z,i}function uL(t,B,s,Q){for(let F=t.length-1;F>=0;F--){const i=t[F];i.rotated=rL({x:s.x(i),y:s.y(i),z:s.z(i)},Q),i.centroid=i.rotated,i.projected=B.project(i.rotated,B)}return t}function hL(){return oL(uL,void 0)}function xL(t){return`M${t[0].projected.x},${t[0].projected.y}L${t[1].projected.x},${t[1].projected.y}L${t[2].projected.x},${t[2].projected.y}L${t[3].projected.x},${t[3].projected.y}Z`}function GL(t,B,s,Q){const F=uL(t,B,s,Q),i=[],U=B.row;let g=0;for(var e=F.length/U-1;e>0;e--)for(var I=U-1;I>0;I--){var l=I+e*U,c=l-1,n=c-U+1,a=n-1,d=[F[l],F[n],F[a],F[c]];d.plane="plane-"+g++,d.ccw=bL(d),d.centroid=CL(d),i.push(d)}return i}function yL(){return oL(GL,xL)}function AL(t){const B=t[t.length-1];let s=`M${B.projected.x},${B.projected.y}`;for(var Q=t.length-2;Q>=0;Q--){const B=t[Q].projected;s+=`L${B.x},${B.y}`}return s}function LL(t,B,s,Q){for(let F=t.length-1;F>=0;F--){const i=t[F],U=i.length/2,g=parseInt(U);for(let t=i.length-1;t>=0;t--){const F=i[t];F.rotated=rL({x:s.x(F),y:s.y(F),z:s.z(F)},Q),F.projected=B.project(F.rotated,B)}i.centroid=g===U?CL([i[U-1],i[U]]):{x:i[g].rotated.x,y:i[g].rotated.y,z:i[g].rotated.z}}return t}function RL(){return oL(LL,AL)}customElements.define("cpt-probability",IL);var mL={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const VL=Object.create(null);for(const t in mL)Object.hasOwn(mL,t)&&(VL[mL[t]]=t);const SL={to:{},get:{}};function ZL(t,B,s){return Math.min(Math.max(B,t),s)}function pL(t){const B=Math.round(t).toString(16).toUpperCase();return B.length<2?"0"+B:B}SL.get=function(t){let B,s;switch(t.slice(0,3).toLowerCase()){case"hsl":B=SL.get.hsl(t),s="hsl";break;case"hwb":B=SL.get.hwb(t),s="hwb";break;default:B=SL.get.rgb(t),s="rgb"}return B?{model:s,value:B}:null},SL.get.rgb=function(t){if(!t)return null;let B,s,Q,F=[0,0,0,1];if(B=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(Q=B[2],B=B[1],s=0;s<3;s++){const t=2*s;F[s]=Number.parseInt(B.slice(t,t+2),16)}Q&&(F[3]=Number.parseInt(Q,16)/255)}else if(B=t.match(/^#([a-f\d]{3,4})$/i)){for(B=B[1],Q=B[3],s=0;s<3;s++)F[s]=Number.parseInt(B[s]+B[s],16);Q&&(F[3]=Number.parseInt(Q+Q,16)/255)}else if(B=t.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(s=0;s<3;s++)F[s]=Number.parseFloat(B[s+1]);B[4]&&(F[3]=B[5]?.01*Number.parseFloat(B[4]):Number.parseFloat(B[4]))}else{if(!(B=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(B=t.toLowerCase().match(/^(\w+)$/))?"transparent"===B[1]?[0,0,0,0]:Object.hasOwn(mL,B[1])?(F=mL[B[1]].slice(),F[3]=1,F):null:null;for(s=0;s<3;s++)F[s]=Math.round(2.55*Number.parseFloat(B[s+1]));B[4]&&(F[3]=B[5]?.01*Number.parseFloat(B[4]):Number.parseFloat(B[4]))}for(s=0;s<3;s++)F[s]=ZL(F[s],0,255);return F[3]=ZL(F[3],0,1),F},SL.get.hsl=function(t){if(!t)return null;const B=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(B){const t=Number.parseFloat(B[4]);return[(Number.parseFloat(B[1])%360+360)%360,ZL(Number.parseFloat(B[2]),0,100),ZL(Number.parseFloat(B[3]),0,100),ZL(Number.isNaN(t)?1:t,0,1)]}return null},SL.get.hwb=function(t){if(!t)return null;const B=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(B){const t=Number.parseFloat(B[4]);return[(Number.parseFloat(B[1])%360+360)%360,ZL(Number.parseFloat(B[2]),0,100),ZL(Number.parseFloat(B[3]),0,100),ZL(Number.isNaN(t)?1:t,0,1)]}return null},SL.to.hex=function(...t){return"#"+pL(t[0])+pL(t[1])+pL(t[2])+(t[3]<1?pL(Math.round(255*t[3])):"")},SL.to.rgb=function(...t){return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},SL.to.rgb.percent=function(...t){const B=Math.round(t[0]/255*100),s=Math.round(t[1]/255*100),Q=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+B+"%, "+s+"%, "+Q+"%)":"rgba("+B+"%, "+s+"%, "+Q+"%, "+t[3]+")"},SL.to.hsl=function(...t){return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},SL.to.hwb=function(...t){let B="";return t.length>=4&&1!==t[3]&&(B=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+B+")"},SL.to.keyword=function(...t){return VL[t.slice(0,3)]};const EL={};for(const t of Object.keys(mL))EL[mL[t]]=t;const NL={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},XL=(6/29)**3;function WL(t){const B=t>.0031308?1.055*t**(1/2.4)-.055:12.92*t;return Math.min(Math.max(0,B),1)}function HL(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(const t of Object.keys(NL)){if(!("channels"in NL[t]))throw new Error("missing channels property: "+t);if(!("labels"in NL[t]))throw new Error("missing channel labels property: "+t);if(NL[t].labels.length!==NL[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:B,labels:s}=NL[t];delete NL[t].channels,delete NL[t].labels,Object.defineProperty(NL[t],"channels",{value:B}),Object.defineProperty(NL[t],"labels",{value:s})}function DL(t,B){return(t[0]-B[0])**2+(t[1]-B[1])**2+(t[2]-B[2])**2}function fL(t){const B=function(){const t={},B=Object.keys(NL);for(let{length:s}=B,Q=0;Q<s;Q++)t[B[Q]]={distance:-1,parent:null};return t}(),s=[t];for(B[t].distance=0;s.length>0;){const t=s.pop(),Q=Object.keys(NL[t]);for(let{length:F}=Q,i=0;i<F;i++){const F=Q[i],U=B[F];-1===U.distance&&(U.distance=B[t].distance+1,U.parent=t,s.unshift(F))}}return B}function wL(t,B){return function(s){return B(t(s))}}function vL(t,B){const s=[B[t].parent,t];let Q=NL[B[t].parent][t],F=B[t].parent;for(;B[F].parent;)s.unshift(B[F].parent),Q=wL(NL[B[F].parent][F],Q),F=B[F].parent;return Q.conversion=s,Q}function YL(t){const B=fL(t),s={},Q=Object.keys(B);for(let{length:t}=Q,F=0;F<t;F++){const t=Q[F];null!==B[t].parent&&(s[t]=vL(t,B))}return s}NL.rgb.hsl=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=i-F;let g,e;switch(i){case F:g=0;break;case B:g=(s-Q)/U;break;case s:g=2+(Q-B)/U;break;case Q:g=4+(B-s)/U}g=Math.min(60*g,360),g<0&&(g+=360);const I=(F+i)/2;return e=i===F?0:I<=.5?U/(i+F):U/(2-i-F),[g,100*e,100*I]},NL.rgb.hsv=function(t){let B,s,Q,F,i;const U=t[0]/255,g=t[1]/255,e=t[2]/255,I=Math.max(U,g,e),l=I-Math.min(U,g,e),c=function(t){return(I-t)/6/l+.5};if(0===l)F=0,i=0;else{switch(i=l/I,B=c(U),s=c(g),Q=c(e),I){case U:F=Q-s;break;case g:F=1/3+B-Q;break;case e:F=2/3+s-B}F<0?F+=1:F>1&&(F-=1)}return[360*F,100*i,100*I]},NL.rgb.hwb=function(t){const B=t[0],s=t[1];let Q=t[2];const F=NL.rgb.hsl(t)[0],i=1/255*Math.min(B,Math.min(s,Q));return Q=1-1/255*Math.max(B,Math.max(s,Q)),[F,100*i,100*Q]},NL.rgb.oklab=function(t){const B=HL(t[0]/255),s=HL(t[1]/255),Q=HL(t[2]/255),F=Math.cbrt(.4122214708*B+.5363325363*s+.0514459929*Q),i=Math.cbrt(.2119034982*B+.6806995451*s+.1073969566*Q),U=Math.cbrt(.0883024619*B+.2817188376*s+.6299787005*Q);return[100*(.2104542553*F+.793617785*i-.0040720468*U),100*(1.9779984951*F-2.428592205*i+.4505937099*U),100*(.0259040371*F+.7827717662*i-.808675766*U)]},NL.rgb.cmyk=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.min(1-B,1-s,1-Q);return[100*((1-B-F)/(1-F)||0),100*((1-s-F)/(1-F)||0),100*((1-Q-F)/(1-F)||0),100*F]},NL.rgb.keyword=function(t){const B=EL[t];if(B)return B;let s,Q=Number.POSITIVE_INFINITY;for(const B of Object.keys(mL)){const F=DL(t,mL[B]);F<Q&&(Q=F,s=B)}return s},NL.keyword.rgb=function(t){return[...mL[t]]},NL.rgb.xyz=function(t){const B=HL(t[0]/255),s=HL(t[1]/255),Q=HL(t[2]/255);return[100*(.4124564*B+.3575761*s+.1804375*Q),100*(.2126729*B+.7151522*s+.072175*Q),100*(.0193339*B+.119192*s+.9503041*Q)]},NL.rgb.lab=function(t){const B=NL.rgb.xyz(t);let s=B[0],Q=B[1],F=B[2];s/=95.047,Q/=100,F/=108.883,s=s>XL?s**(1/3):7.787*s+16/116,Q=Q>XL?Q**(1/3):7.787*Q+16/116,F=F>XL?F**(1/3):7.787*F+16/116;return[116*Q-16,500*(s-Q),200*(Q-F)]},NL.hsl.rgb=function(t){const B=t[0]/360,s=t[1]/100,Q=t[2]/100;let F,i;if(0===s)return i=255*Q,[i,i,i];const U=Q<.5?Q*(1+s):Q+s-Q*s,g=2*Q-U,e=[0,0,0];for(let t=0;t<3;t++)F=B+1/3*-(t-1),F<0&&F++,F>1&&F--,i=6*F<1?g+6*(U-g)*F:2*F<1?U:3*F<2?g+(U-g)*(2/3-F)*6:g,e[t]=255*i;return e},NL.hsl.hsv=function(t){const B=t[0];let s=t[1]/100,Q=t[2]/100,F=s;const i=Math.max(Q,.01);Q*=2,s*=Q<=1?Q:2-Q,F*=i<=1?i:2-i;return[B,100*(0===Q?2*F/(i+F):2*s/(Q+s)),100*((Q+s)/2)]},NL.hsv.rgb=function(t){const B=t[0]/60,s=t[1]/100;let Q=t[2]/100;const F=Math.floor(B)%6,i=B-Math.floor(B),U=255*Q*(1-s),g=255*Q*(1-s*i),e=255*Q*(1-s*(1-i));switch(Q*=255,F){case 0:return[Q,e,U];case 1:return[g,Q,U];case 2:return[U,Q,e];case 3:return[U,g,Q];case 4:return[e,U,Q];case 5:return[Q,U,g]}},NL.hsv.hsl=function(t){const B=t[0],s=t[1]/100,Q=t[2]/100,F=Math.max(Q,.01);let i,U;U=(2-s)*Q;const g=(2-s)*F;return i=s*F,i/=g<=1?g:2-g,i=i||0,U/=2,[B,100*i,100*U]},NL.hwb.rgb=function(t){const B=t[0]/360;let s=t[1]/100,Q=t[2]/100;const F=s+Q;let i;F>1&&(s/=F,Q/=F);const U=Math.floor(6*B),g=1-Q;i=6*B-U,1&U&&(i=1-i);const e=s+i*(g-s);let I,l,c;switch(U){default:case 6:case 0:I=g,l=e,c=s;break;case 1:I=e,l=g,c=s;break;case 2:I=s,l=g,c=e;break;case 3:I=s,l=e,c=g;break;case 4:I=e,l=s,c=g;break;case 5:I=g,l=s,c=e}return[255*I,255*l,255*c]},NL.cmyk.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=t[3]/100;return[255*(1-Math.min(1,B*(1-F)+F)),255*(1-Math.min(1,s*(1-F)+F)),255*(1-Math.min(1,Q*(1-F)+F))]},NL.xyz.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100;let F,i,U;return F=3.2404542*B+-1.5371385*s+-.4985314*Q,i=-.969266*B+1.8760108*s+.041556*Q,U=.0556434*B+-.2040259*s+1.0572252*Q,F=WL(F),i=WL(i),U=WL(U),[255*F,255*i,255*U]},NL.xyz.lab=function(t){let B=t[0],s=t[1],Q=t[2];B/=95.047,s/=100,Q/=108.883,B=B>XL?B**(1/3):7.787*B+16/116,s=s>XL?s**(1/3):7.787*s+16/116,Q=Q>XL?Q**(1/3):7.787*Q+16/116;return[116*s-16,500*(B-s),200*(s-Q)]},NL.xyz.oklab=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=Math.cbrt(.8189330101*B+.3618667424*s-.1288597137*Q),i=Math.cbrt(.0329845436*B+.9293118715*s+.0361456387*Q),U=Math.cbrt(.0482003018*B+.2643662691*s+.633851707*Q);return[100*(.2104542553*F+.793617785*i-.0040720468*U),100*(1.9779984951*F-2.428592205*i+.4505937099*U),100*(.0259040371*F+.7827717662*i-.808675766*U)]},NL.oklab.oklch=function(t){return NL.lab.lch(t)},NL.oklab.xyz=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=(.999999998*B+.396337792*s+.215803758*Q)**3,i=(1.000000008*B-.105561342*s-.063854175*Q)**3,U=(1.000000055*B-.089484182*s-1.291485538*Q)**3;return[100*(1.227013851*F-.55779998*i+.281256149*U),100*(-.040580178*F+1.11225687*i-.071676679*U),100*(-.076381285*F-.421481978*i+1.58616322*U)]},NL.oklab.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=(B+.3963377774*s+.2158037573*Q)**3,i=(B-.1055613458*s-.0638541728*Q)**3,U=(B-.0894841775*s-1.291485548*Q)**3;return[255*WL(4.0767416621*F-3.3077115913*i+.2309699292*U),255*WL(-1.2684380046*F+2.6097574011*i-.3413193965*U),255*WL(-.0041960863*F-.7034186147*i+1.707614701*U)]},NL.oklch.oklab=function(t){return NL.lch.lab(t)},NL.lab.xyz=function(t){let B,s,Q;s=(t[0]+16)/116,B=t[1]/500+s,Q=s-t[2]/200;const F=s**3,i=B**3,U=Q**3;return s=F>XL?F:(s-16/116)/7.787,B=i>XL?i:(B-16/116)/7.787,Q=U>XL?U:(Q-16/116)/7.787,B*=95.047,s*=100,Q*=108.883,[B,s,Q]},NL.lab.lch=function(t){const B=t[0],s=t[1],Q=t[2];let F;F=360*Math.atan2(Q,s)/2/Math.PI,F<0&&(F+=360);return[B,Math.sqrt(s*s+Q*Q),F]},NL.lch.lab=function(t){const B=t[0],s=t[1],Q=t[2]/360*2*Math.PI;return[B,s*Math.cos(Q),s*Math.sin(Q)]},NL.rgb.ansi16=function(t,B=null){const[s,Q,F]=t;let i=null===B?NL.rgb.hsv(t)[2]:B;if(i=Math.round(i/50),0===i)return 30;let U=30+(Math.round(F/255)<<2|Math.round(Q/255)<<1|Math.round(s/255));return 2===i&&(U+=60),U},NL.hsv.ansi16=function(t){return NL.rgb.ansi16(NL.hsv.rgb(t),t[2])},NL.rgb.ansi256=function(t){const B=t[0],s=t[1],Q=t[2];if(B>>4==s>>4&&s>>4==Q>>4)return B<8?16:B>248?231:Math.round((B-8)/247*24)+232;return 16+36*Math.round(B/255*5)+6*Math.round(s/255*5)+Math.round(Q/255*5)},NL.ansi16.rgb=function(t){let B=(t=t[0])%10;if(0===B||7===B)return t>50&&(B+=3.5),B=B/10.5*255,[B,B,B];const s=.5*(Math.trunc(t>50)+1);return[(1&B)*s*255,(B>>1&1)*s*255,(B>>2&1)*s*255]},NL.ansi256.rgb=function(t){if((t=t[0])>=232){const B=10*(t-232)+8;return[B,B,B]}let B;t-=16;return[Math.floor(t/36)/5*255,Math.floor((B=t%36)/6)/5*255,B%6/5*255]},NL.rgb.hex=function(t){const B=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(B.length)+B},NL.hex.rgb=function(t){const B=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!B)return[0,0,0];let s=B[0];3===B[0].length&&(s=[...s].map(t=>t+t).join(""));const Q=Number.parseInt(s,16);return[Q>>16&255,Q>>8&255,255&Q]},NL.rgb.hcg=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.max(Math.max(B,s),Q),i=Math.min(Math.min(B,s),Q),U=F-i;let g;return g=U<=0?0:F===B?(s-Q)/U%6:F===s?2+(Q-B)/U:4+(B-s)/U,g/=6,g%=1,[360*g,100*U,100*(U<1?i/(1-U):0)]},NL.hsl.hcg=function(t){const B=t[1]/100,s=t[2]/100,Q=s<.5?2*B*s:2*B*(1-s);let F=0;return Q<1&&(F=(s-.5*Q)/(1-Q)),[t[0],100*Q,100*F]},NL.hsv.hcg=function(t){const B=t[1]/100,s=t[2]/100,Q=B*s;let F=0;return Q<1&&(F=(s-Q)/(1-Q)),[t[0],100*Q,100*F]},NL.hcg.rgb=function(t){const B=t[0]/360,s=t[1]/100,Q=t[2]/100;if(0===s)return[255*Q,255*Q,255*Q];const F=[0,0,0],i=B%1*6,U=i%1,g=1-U;let e=0;switch(Math.floor(i)){case 0:F[0]=1,F[1]=U,F[2]=0;break;case 1:F[0]=g,F[1]=1,F[2]=0;break;case 2:F[0]=0,F[1]=1,F[2]=U;break;case 3:F[0]=0,F[1]=g,F[2]=1;break;case 4:F[0]=U,F[1]=0,F[2]=1;break;default:F[0]=1,F[1]=0,F[2]=g}return e=(1-s)*Q,[255*(s*F[0]+e),255*(s*F[1]+e),255*(s*F[2]+e)]},NL.hcg.hsv=function(t){const B=t[1]/100,s=B+t[2]/100*(1-B);let Q=0;return s>0&&(Q=B/s),[t[0],100*Q,100*s]},NL.hcg.hsl=function(t){const B=t[1]/100,s=t[2]/100*(1-B)+.5*B;let Q=0;return s>0&&s<.5?Q=B/(2*s):s>=.5&&s<1&&(Q=B/(2*(1-s))),[t[0],100*Q,100*s]},NL.hcg.hwb=function(t){const B=t[1]/100,s=B+t[2]/100*(1-B);return[t[0],100*(s-B),100*(1-s)]},NL.hwb.hcg=function(t){const B=t[1]/100,s=1-t[2]/100,Q=s-B;let F=0;return Q<1&&(F=(s-Q)/(1-Q)),[t[0],100*Q,100*F]},NL.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},NL.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},NL.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},NL.gray.hsl=function(t){return[0,0,t[0]]},NL.gray.hsv=NL.gray.hsl,NL.gray.hwb=function(t){return[0,100,t[0]]},NL.gray.cmyk=function(t){return[0,0,0,t[0]]},NL.gray.lab=function(t){return[t[0],0,0]},NL.gray.hex=function(t){const B=255&Math.round(t[0]/100*255),s=((B<<16)+(B<<8)+B).toString(16).toUpperCase();return"000000".slice(s.length)+s},NL.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const JL={},kL=Object.keys(NL);function ML(t){const B=function(...B){const s=B[0];return null==s?s:(s.length>1&&(B=s),t(B))};return"conversion"in t&&(B.conversion=t.conversion),B}function TL(t){const B=function(...B){const s=B[0];if(null==s)return s;s.length>1&&(B=s);const Q=t(B);if("object"==typeof Q)for(let{length:t}=Q,B=0;B<t;B++)Q[B]=Math.round(Q[B]);return Q};return"conversion"in t&&(B.conversion=t.conversion),B}for(const t of kL){JL[t]={},Object.defineProperty(JL[t],"channels",{value:NL[t].channels}),Object.defineProperty(JL[t],"labels",{value:NL[t].labels});const B=YL(t),s=Object.keys(B);for(const Q of s){const s=B[Q];JL[t][Q]=TL(s),JL[t][Q].raw=ML(s)}}const zL=["keyword","gray","hex"],KL={};for(const t of Object.keys(JL))KL[[...JL[t].labels].sort().join("")]=t;const OL={};function PL(t,B){if(!(this instanceof PL))return new PL(t,B);if(B&&B in zL&&(B=null),B&&!(B in JL))throw new Error("Unknown model: "+B);let s,Q;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof PL)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const B=SL.get(t);if(null===B)throw new Error("Unable to parse color from string: "+t);this.model=B.model,Q=JL[this.model].channels,this.color=B.value.slice(0,Q),this.valpha="number"==typeof B.value[Q]?B.value[Q]:1}else if(t.length>0){this.model=B||"rgb",Q=JL[this.model].channels;const s=Array.prototype.slice.call(t,0,Q);this.color=qL(s,Q),this.valpha="number"==typeof t[Q]?t[Q]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const B=Object.keys(t);"alpha"in t&&(B.splice(B.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const Q=B.sort().join("");if(!(Q in KL))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=KL[Q];const{labels:F}=JL[this.model],i=[];for(s=0;s<F.length;s++)i.push(t[F[s]]);this.color=qL(i)}if(OL[this.model])for(Q=JL[this.model].channels,s=0;s<Q;s++){const t=OL[this.model][s];t&&(this.color[s]=t(this.color[s]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}PL.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let B=this.model in SL.to?this:this.rgb();B=B.round("number"==typeof t?t:1);const s=1===B.valpha?B.color:[...B.color,this.valpha];return SL.to[B.model](...s)},percentString(t){const B=this.rgb().round("number"==typeof t?t:1),s=1===B.valpha?B.color:[...B.color,this.valpha];return SL.to.rgb.percent(...s)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const t={},{channels:B}=JL[this.model],{labels:s}=JL[this.model];for(let Q=0;Q<B;Q++)t[s[Q]]=this.color[Q];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray(){const t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject(){const t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new PL([...this.color.map(jL(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new PL([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},red:_L("rgb",0,$L(255)),green:_L("rgb",1,$L(255)),blue:_L("rgb",2,$L(255)),hue:_L(["hsl","hsv","hsl","hwb","hcg"],0,t=>(t%360+360)%360),saturationl:_L("hsl",1,$L(100)),lightness:_L("hsl",2,$L(100)),saturationv:_L("hsv",1,$L(100)),value:_L("hsv",2,$L(100)),chroma:_L("hcg",1,$L(100)),gray:_L("hcg",2,$L(100)),white:_L("hwb",1,$L(100)),wblack:_L("hwb",2,$L(100)),cyan:_L("cmyk",0,$L(100)),magenta:_L("cmyk",1,$L(100)),yellow:_L("cmyk",2,$L(100)),black:_L("cmyk",3,$L(100)),x:_L("xyz",0,$L(95.047)),y:_L("xyz",1,$L(100)),z:_L("xyz",2,$L(108.833)),l:_L("lab",0,$L(100)),a:_L("lab",1),b:_L("lab",2),keyword(t){return void 0!==t?new PL(t):JL[this.model].keyword(this.color)},hex(t){return void 0!==t?new PL(t):SL.to.hex(...this.rgb().round().color)},hexa(t){if(void 0!==t)return new PL(t);const B=this.rgb().round().color;let s=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===s.length&&(s="0"+s),SL.to.hex(...B)+s},rgbNumber(){const t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity(){const t=this.rgb().color,B=[];for(const[s,Q]of t.entries()){const t=Q/255;B[s]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}return.2126*B[0]+.7152*B[1]+.0722*B[2]},contrast(t){const B=this.luminosity(),s=t.luminosity();return B>s?(B+.05)/(s+.05):(s+.05)/(B+.05)},level(t){const B=this.contrast(t);return B>=7?"AAA":B>=4.5?"AA":""},isDark(){const t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let B=0;B<3;B++)t.color[B]=255-t.color[B];return t},lighten(t){const B=this.hsl();return B.color[2]+=B.color[2]*t,B},darken(t){const B=this.hsl();return B.color[2]-=B.color[2]*t,B},saturate(t){const B=this.hsl();return B.color[1]+=B.color[1]*t,B},desaturate(t){const B=this.hsl();return B.color[1]-=B.color[1]*t,B},whiten(t){const B=this.hwb();return B.color[1]+=B.color[1]*t,B},blacken(t){const B=this.hwb();return B.color[2]+=B.color[2]*t,B},grayscale(){const t=this.rgb().color,B=.3*t[0]+.59*t[1]+.11*t[2];return PL.rgb(B,B,B)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const B=this.hsl();let s=B.color[0];return s=(s+t)%360,s=s<0?360+s:s,B.color[0]=s,B},mix(t,B){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);const s=t.rgb(),Q=this.rgb(),F=void 0===B?.5:B,i=2*F-1,U=s.alpha()-Q.alpha(),g=((i*U===-1?i:(i+U)/(1+i*U))+1)/2,e=1-g;return PL.rgb(g*s.red()+e*Q.red(),g*s.green()+e*Q.green(),g*s.blue()+e*Q.blue(),s.alpha()*F+Q.alpha()*(1-F))}};for(const t of Object.keys(JL)){if(zL.includes(t))continue;const{channels:B}=JL[t];PL.prototype[t]=function(...B){return this.model===t?new PL(this):B.length>0?new PL(B,t):new PL([...(s=JL[this.model][t].raw(this.color),Array.isArray(s)?s:[s]),this.valpha],t);var s},PL[t]=function(...s){let Q=s[0];return"number"==typeof Q&&(Q=qL(s,B)),new PL(Q,t)}}function jL(t){return function(B){return function(t,B){return Number(t.toFixed(B))}(B,t)}}function _L(t,B,s){t=Array.isArray(t)?t:[t];for(const Q of t)(OL[Q]||=[])[B]=s;return t=t[0],function(Q){let F;return void 0!==Q?(s&&(Q=s(Q)),F=this[t](),F.color[B]=Q,F):(F=this[t]().color[B],s&&(F=s(F)),F)}}function $L(t){return function(B){return Math.max(0,Math.min(t,B))}}function qL(t,B){for(let s=0;s<B;s++)"number"!=typeof t[s]&&(t[s]=0);return t}class tR extends(Zo(Eo)){static get properties(){return{surface:{attribute:"surface",type:Boolean,reflect:!0},point:{attribute:"point",type:Boolean,reflect:!0},updateable:{attribute:"updateable",type:Boolean,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.firstUpdate=!0,this.surface=!0,this.point=!0,this.updateable=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.response=this.DEFAULT,this.range={a:{start:1e-4,stop:1,step:.05},l:{start:0,stop:10,step:.5},g:{start:0,stop:1,step:.05},uDiff:{start:-20,stop:20}},this.boundary=[],this.mapXY=[],this.mapXZ=[],this.mapYZ=[],this.rotationX=0,this.rotationY=0,this.mx=0,this.my=0,this.mouseX=0,this.mouseY=0,this.alignState()}alignState(){this.updateable&&(this.response=sb.xal2v(this.xw,this.a,this.l)*sb.pg2w(this.pw,this.g)+sb.xal2v(this.xl,this.a,this.l)*(1-sb.pg2w(this.pw,this.g))>sb.xal2v(this.xs,this.a,this.l)?"gamble":"sure");const t=(t,B)=>{const s=sb.pg2w(t,B);return Number.isNaN(s)?t:s},B=(B,s,Q,F,i,U,g)=>sb.xal2v(B,i,U)*t(Q,g)+sb.xal2v(s,i,U)*(1-t(Q,g))-sb.xal2v(F,i,U);this.boundary=nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).flatMap(t=>nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).map(s=>{let Q=this.range.a.start,F=10,i=(Q+F)/2;const U=B(this.xw,this.xl,this.pw,this.xs,Q,t,s),g=B(this.xw,this.xl,this.pw,this.xs,F,t,s);let e;return U>0?i=-1/0:g<0?i=1/0:nB(0,15,1).forEach(()=>{e=B(this.xw,this.xl,this.pw,this.xs,i,t,s),e<0?Q=i:F=i,i=(Q+F)/2}),{a:i,l:t,g:s}}));const s=t=>t?.a>=this.range.a.start&&t?.a<=this.range.a.stop;this.boundary=this.boundary.map((t,B,Q)=>{if(s(t))return t;const F=nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length,i=nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length,U=B%F===0?null:Q[B-1],g=B%F===F-1?null:Q[B+1],e=0===Math.trunc(B/F)?null:Q[B-F],I=Math.trunc(B/F)===i-1?null:Q[B+F],l=s(U)?1:0,c=s(g)?1:0,n=s(e)?1:0,a=l+c+n+(s(I)?1:0);if(0===a||2===a&&l+c!==1||3===a||4===a)return t;const d={a:t.a<this.range.a.start?this.range.a.start:this.range.a.stop,g:t.g,l:t.l};let o;if(1===a)o=l?U:c?g:n?e:I;else{const t=l?U:g,B=n?e:I;o={a:(t.a+B.a)/2,g:(t.g+B.g)/2,l:(t.l+B.l)/2}}const b=(d.a-o.a)/(t.a-o.a);return d.g=o.g+(t.g-o.g)*b,d.l=o.l+(t.l-o.l)*b,d});const Q=this.range.l.stop;this.mapXY=nB(this.range.a.start,this.range.a.stop+.01,this.range.a.step).flatMap(t=>nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).map(s=>{const F=B(this.xw,this.xl,this.pw,this.xs,t,Q,s);return{a:t,l:Q,g:s,uDiff:F}}));const F=this.range.g.start;this.mapXZ=nB(this.range.a.start,this.range.a.stop+.01,this.range.a.step).flatMap(t=>nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).map(s=>{const Q=B(this.xw,this.xl,this.pw,this.xs,t,s,F);return{a:t,l:s,g:F,uDiff:Q}}));const i=this.range.a.stop;this.mapYZ=nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).flatMap(t=>nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).map(s=>{const Q=B(this.xw,this.xl,this.pw,this.xs,i,s,t);return{a:i,l:s,g:t,uDiff:Q}}))}static get styles(){return[super.styles,g`
|
|
1432
|
+
`]}render(){return M``}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=2*this.rem,i=3*this.rem,U=3*this.rem,g=Q-(F+i),e=Q-(U+2*this.rem),I=parseInt(this.getComputedStyleValue("---transition-duration"),10),l=AI().domain([0,1]).range([0,e]).clamp(!0);this.xScale=l;const c=AI().domain([1,0]).range([0,g]);this.yScale=c;const n=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.pg2w(this.xScale.invert(t.x),B.g)),p:this.xScale.invert(t.x),g:B.g,w:sb.pg2w(this.xScale.invert(t.x),B.g)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=s-t.subject.p,i=Q-t.subject.w,U=(F**2+i**2)**.5,g=t.subject.p>t.subject.w?F>i?t.subject.g-U:t.subject.g+U:F>i?t.subject.g+U:t.subject.g-U;B.g=g>sb.g.MAX?sb.g.MAX:g<sb.g.MIN?sb.g.MIN:g,"default"===B.name&&(this.g=B.g),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),a=tQ().subject((t,B)=>({x:this.xScale(B.p),y:this.yScale(B.w)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x);B.p=s<0?0:s>1?1:s,"default"===B.name&&(this.p=B.p),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:{name:B.name,p:B.p,w:B.w,label:B.label,g:this.getFunction(B.function).g},bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),d=bd().x(t=>l(t.p)).y(t=>c(t.w)),o=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),b=o.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),C=b.merge(o).attr("viewBox",`0 0 ${Q} ${Q}`),r=b.append("g").classed("plot",!0),u=C.select(".plot").attr("transform",`translate(${U}, ${F})`);r.append("clipPath").attr("id","clip-cpt-value").append("rect"),u.select("clipPath rect").attr("height",g+1).attr("width",e+1);const h=r.append("g").classed("underlayer",!0),x=u.select(".underlayer");h.append("rect").classed("background",!0),x.select(".background").attr("height",g).attr("width",e),h.append("g").classed("scale-x",!0);x.select(".scale-x").attr("transform",`translate(0, ${g})`).transition().duration(2*I).ease(Wi).call(yB(l)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null);const G=h.append("text").classed("title-x",!0).attr("text-anchor","middle");G.append("tspan").classed("name",!0).text("Probability ("),G.append("tspan").classed("math-var p",!0).text("p"),G.append("tspan").classed("name",!0).text(")"),x.select(".title-x").attr("transform",`translate(${e/2}, ${g+2.25*this.rem})`),h.append("g").classed("scale-y",!0);x.select(".scale-y").transition().duration(2*I).ease(Wi).call(AB(c)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null);const y=h.append("text").classed("title-y",!0).attr("text-anchor","middle");y.append("tspan").classed("name",!0).text("Decision Weight ("),y.append("tspan").classed("math-var v",!0).text("w"),y.append("tspan").classed("name",!0).text(")"),x.select(".title-y").attr("transform",`translate(${-2*this.rem}, ${g/2})rotate(-90)`),h.append("line").classed("diagonal",!0),x.select(".diagonal").transition().duration(2*I).attr("x1",l(0)).attr("y1",c(0)).attr("x2",l(1)).attr("y2",c(1)),r.append("g").classed("content",!0);const A=u.select(".content"),L=A.selectAll(".lines").data(this.probabilities.filter(t=>null!=t.p),t=>t.name),R=L.enter().append("g").classed("lines",!0);R.each((t,B,s)=>{const Q=Js(s[B]);Q.append("line").classed("line-p above",!0),Q.append("line").classed("line-p below",!0),Q.append("line").classed("line-w before",!0),Q.append("line").classed("line-w after",!0)}),R.filter(t=>t.new).attr("data-animating-ease-time-1",0).attr("data-animating-ease-time-2",0).each((t,B,s)=>{const Q=Js(s[B]);Q.select(".line-p.above").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(1)).attr("y2",c(1)),Q.select(".line-p.below").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(0)).attr("y2",c(0)),Q.select(".line-w.before").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(t.w)).attr("y2",c(t.w)),Q.select(".line-w.after").attr("x1",l(t.p)).attr("x2",l(t.p)).attr("y1",c(t.w)).attr("y2",c(t.w))});const m=R.merge(L),V=m.filter(t=>t.new&&!t.paused);if(!V.empty()){const t=V.attr("data-animating-ease-time-1"),B=V.attr("data-animating-ease-time-2"),s=B=>AI().domain([0,1]).range([t,1])(B),Q=B=>AI().range([0,1]).domain([t,1])(B),F=t=>AI().domain([0,1]).range([B,1])(t),i=t=>AI().range([0,1]).domain([B,1])(t),U=B=>s=>AI().domain([B(t),1]).range([0,1])(B(s)),g=t=>s=>AI().domain([t(B),1]).range([0,1])(t(s));V.transition("new-1").duration(()=>Math.floor(I*(1-t))).ease(s).attr("data-animating-ease-time-1",1).tween("animating",(t,B,s)=>{const F=s[B],i=Js(F),g=mF(void 0!==F.p?F.p:t.p,t.p),e=mF(void 0!==F.g?F.g:this.getFunction(t.function).g,this.getFunction(t.function).g),I=mF(c.invert(i.select(".line-p.above").attr("y1")),t.w),n=mF(c.invert(i.select(".line-p.below").attr("y1")),t.w);return t=>{F.p=g(Wi(Q(t))),F.g=e(Wi(Q(t))),F.w=sb.pg2w(F.p,F.g),i.select(".line-p.above").attr("x1",l(F.p)).attr("x2",l(F.p)).attr("y1",c(I(U(Xi)(t)))).attr("y2",c(1)),i.select(".line-p.below").attr("x1",l(F.p)).attr("x2",l(F.p)).attr("y1",c(n(U(Xi)(t)))).attr("y2",c(0))}}).transition("new-2").duration(()=>Math.floor(I*(1-B))).ease(F).attr("data-animating-ease-time-2",1).tween("animating",(t,B,s)=>{const Q=s[B],F=Js(Q),U=mF(void 0!==Q.p?Q.p:t.p,t.p),e=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g),I=mF(l.invert(F.select(".line-w.before").attr("x1")),0),n=mF(l.invert(F.select(".line-w.after").attr("x1")),1);return t=>{Q.p=U(Wi(i(t))),Q.g=e(Wi(i(t))),Q.w=sb.pg2w(Q.p,Q.g),F.select(".line-w.before").attr("x1",l(I(g(Wi)(t)))).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w)),F.select(".line-w.after").attr("x1",l(n(g(Wi)(t)))).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w))}}).on("end",(t,B,s)=>{const Q=s[B];Q.removeAttribute("data-animating-ease-time-1"),Q.removeAttribute("data-animating-ease-time-2"),t.new=!1,this.dispatchEvent(new CustomEvent("prospectable-response",{detail:{trial:this.trialCount,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,response:this.response},bubbles:!0}))})}const S=m.filter(t=>t.new&&t.paused);if(!S.empty()){const t=S.attr("data-animating-ease-time-1"),B=S.attr("data-animating-ease-time-2");S.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("paused",(s,Q,F)=>{const i=F[Q],U=Js(i),g=mF(void 0!==i.p?i.p:s.p,s.p),e=mF(void 0!==i.g?i.g:this.getFunction(s.function).g,this.getFunction(s.function).g),I=mF(1,s.w),n=mF(0,s.w),a=mF(s.p,0),d=mF(s.p,1);return s=>{i.p=g(s),i.g=e(s),i.w=sb.pg2w(i.p,i.g),U.select(".line-p.above").attr("x1",l(i.p)).attr("x2",l(i.p)).attr("y1",c(I(Xi(t)))).attr("y2",c(1)),U.select(".line-p.below").attr("x1",l(i.p)).attr("x2",l(i.p)).attr("y1",c(n(Xi(t)))).attr("y2",c(0)),U.select(".line-w.before").attr("x1",l(a(Wi(B)))).attr("x2",l(i.p)).attr("y1",c(i.w)).attr("y2",c(i.w)),U.select(".line-w.after").attr("x1",l(d(Wi(B)))).attr("x2",l(i.p)).attr("y1",c(i.w)).attr("y2",c(i.w))}})}m.filter(t=>!t.new).transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("non-animating",(t,B,s)=>{const Q=s[B],F=Js(Q),i=mF(void 0!==Q.p?Q.p:t.p,t.p),U=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g);return t=>{Q.p=i(t),Q.g=U(t),Q.w=sb.pg2w(Q.p,Q.g),F.select(".line-p.above").attr("x1",l(Q.p)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(1)),F.select(".line-p.below").attr("x1",l(Q.p)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(0)),F.select(".line-w.before").attr("x1",l(0)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w)),F.select(".line-w.after").attr("x1",l(1)).attr("x2",l(Q.p)).attr("y1",c(Q.w)).attr("y2",c(Q.w))}}),L.exit().remove();const Z=A.selectAll(".curve").data(this.functions,t=>t.name),p=Z.enter().append("g").classed("curve",!0).attr("clip-path","url(#clip-cpt-value)");p.append("path").classed("path",!0),p.append("path").classed("path touch",!0);const E=p.merge(Z);(this.firstUpdate||t.has("interactive"))&&(this.interactive?E.attr("tabindex",0).classed("interactive",!0).call(n).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.g;switch(t.key){case"ArrowUp":case"ArrowLeft":s+=t.shiftKey?sb.g.STEP:sb.g.JUMP;break;case"ArrowDown":case"ArrowRight":s-=t.shiftKey?sb.g.STEP:sb.g.JUMP}s=s<sb.g.MIN?sb.g.MIN:s>sb.g.MAX?sb.g.MAX:s,s!==B.g&&(B.g=s,"default"===B.name&&(this.g=B.g),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):E.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),E.select(".path").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.g?Q.g:t.g,t.g);return t=>{Q.g=F(t);const B=nB(l.range()[0],l.range()[1]+1,1).map(t=>({p:l.invert(t),w:sb.pg2w(l.invert(t),Q.g)}));return d(B)}}),E.select(".path.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.g?Q.g:t.g,t.g);return t=>{Q.g=F(t);const B=nB(l.range()[0],l.range()[1]+1,1).map(t=>({p:l.invert(t),w:sb.pg2w(l.invert(t),Q.g)}));return d(B)}}),Z.exit().remove();const N=A.selectAll(".point").data(this.probabilities.filter(t=>null!=t.p),t=>t.name),X=N.enter().append("g").classed("point",!0);X.append("circle").classed("circle touch",!0),X.append("text").classed("label",!0);const W=X.merge(N);W.select("text").text(t=>t.label),W.filter(B=>(this.firstUpdate||t.has("interactive"))&&this.interactive&&!B.trial).attr("tabindex",0).classed("interactive",!0).call(a).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.p;switch(t.key){case"ArrowUp":case"ArrowRight":s+=t.shiftKey?.01:.05;break;case"ArrowDown":case"ArrowLeft":s-=t.shiftKey?.01:.05}s=s<0?0:s>1?1:s,s!==B.p&&(B.p=s,"default"===B.name&&(this.p=B.p),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-probability-change",{detail:{name:B.name,p:B.p,w:B.w,label:B.label,g:this.getFunction(B.function).g},bubbles:!0}))),t.preventDefault()}}),W.filter(B=>(this.firstUpdate||t.has("interactive"))&&!this.interactive||B.trial).attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null),W.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("transform",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.p?Q.p:t.p,t.p),i=mF(void 0!==Q.g?Q.g:this.getFunction(t.function).g,this.getFunction(t.function).g);return t=>(Q.p=F(t),Q.g=i(t),`translate(\n ${l(Q.p)},\n ${c(sb.pg2w(Q.p,Q.g))}\n )`)}),N.exit().remove(),this.drag=!1,this.firstUpdate=!1}}customElements.define("cpt-probability",IL);var lL={exports:{}};(function(t){function B(t){return`M${t[0].projected.x},${t[0].projected.y}L${t[1].projected.x},${t[1].projected.y}L${t[2].projected.x},${t[2].projected.y}L${t[3].projected.x},${t[3].projected.y}Z`}function s(t){return t.x}function Q(t){return t.y}function F(t){return t.z}class i{constructor(){this._scale=1,this._origin={x:0,y:0},this._rotateX=0,this._rotateY=0,this._rotateZ=0,this._x=s,this._y=Q,this._z=F,this._rotationCenter={x:0,y:0,z:0}}scale(t){return t?(this._scale=t,this):this._scale}origin(t){return t?(this._origin=t,this):this._origin}rotationCenter(t){return t?(this._rotationCenter=t,this):this._rotationCenter}rotateX(t){return t?(this._rotateX=t,this):this._rotateX}rotateY(t){return t?(this._rotateY=t,this):this._rotateY}rotateZ(t){return t?(this._rotateZ=t,this):this._rotateZ}x(t){return"function"==typeof t?(this._x=t,this):this._x}y(t){return"function"==typeof t?(this._y=t,this):this._y}z(t){return"function"==typeof t?(this._z=t,this):this._z}}function U(t){const B=[...t,t[0]];let s=0;for(let Q=0;Q<t.length;Q+=1){const t=B[Q].rotated,F=B[Q+1].rotated;s+=(F.x-t.x)*(F.y+t.y)}return s>0}function g(t){let B=0,s=0,Q=0;for(let F=t.length-1;F>=0;F-=1){const i=t[F].rotated;B+=i.x,s+=i.y,Q+=i.z}return{x:B/t.length,y:s/t.length,z:Q/t.length}}function e(t,B){const s=B.rotateCenter,Q=I(l(c({x:t.x-s.x,y:t.y-s.y,z:t.z-s.z},B.z),B.y),B.x);return{x:Q.x+s.x,y:Q.y+s.y,z:Q.z+s.z}}function I(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.x,y:t.y*Q-t.z*s,z:t.y*s+t.z*Q}}function l(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.z*s+t.x*Q,y:t.y,z:t.z*Q-t.x*s}}function c(t,B){const s=Math.sin(B),Q=Math.cos(B);return{x:t.x*Q-t.y*s,y:t.x*s+t.y*Q,z:t.z}}function n(t,B){return{x:B.origin.x+B.scale*t.x,y:B.origin.y+B.scale*t.y}}const a=(t,B)=>t.map(t=>{const s=e({x:B.x(t),y:B.y(t),z:B.z(t)},{x:B.rotateX,y:B.rotateY,z:B.rotateZ,rotateCenter:B.rotateCenter}),Q=n(s,{scale:B.scale,origin:B.origin});return{...t,rotated:s,projected:Q}});function d(t,B){const s=t;return s.centroid=g(s),s.ccw=U(s),s.face=B,s}class o extends i{data(t){return t.map(t=>{const B=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()}),s=d([B[0],B[1],B[2],B[3]],"front"),Q=d([B[7],B[6],B[5],B[4]],"back"),F=d([B[4],B[5],B[1],B[0]],"left"),i=d([B[3],B[2],B[6],B[7]],"right"),U=d([B[4],B[0],B[3],B[7]],"top"),g=d([B[1],B[5],B[6],B[2]],"bottom");return B.faces=[s,Q,F,i,U,g],B.centroid={x:(F.centroid.x+i.centroid.x)/2,y:(U.centroid.y+g.centroid.y)/2,z:(s.centroid.z+Q.centroid.z)/2},B})}draw(t){return B(t)}}function b(){return new o}class C extends i{constructor(){super(...arguments),this._rows=1}rows(t){return t?(this._rows=t,this):this._rows}data(t){const B=this._rows,s=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()}),Q=[];let F=0;for(let t=s.length/B-1;t>0;t-=1)for(let i=B-1;i>0;i-=1){const e=i+t*B,I=e-1,l=I-B+1,c=l-1,n=[s[e],s[l],s[c],s[I]];n.plane=`plane-${F}`,n.ccw=U(n),n.centroid=g(n),Q.push(n),F+=1}return Q}draw(t){return B(t)}}function r(){return new C}class u extends i{data(t){return t.map(t=>{const B=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()});return B.centroid=g(B),B})}}function h(){return new u}function x(t){const B=t[t.length-1];let s=`M${B.projected.x},${B.projected.y}`;for(let B=t.length-2;B>=0;B-=1){const Q=t[B].projected;s+=`L${Q.x},${Q.y}`}return s}class G extends i{data(t){return t.map(t=>{const B=t.length/2,s=Math.trunc(B),Q=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()});return Q.centroid=s===B?g([Q[B-1],Q[B]]):Q[s].rotated,Q})}draw(t){return x(t)}}function y(){return new G}class A extends i{data(t){return t.map(t=>{const B=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()});return B.ccw=U(B),B.centroid=g(B),B})}draw(t){return B(t)}}function L(){return new A}class R extends i{data(t){return t.map(t=>{const B={x:this.x()(t),y:this.y()(t),z:this.z()(t)},s=e(B,{x:this.rotateX(),y:this.rotateY(),z:this.rotateZ(),rotateCenter:this.rotationCenter()}),Q=n(B,{scale:this.scale(),origin:this.origin()});return{...t,rotated:s,centroid:s,projected:Q}})}}function m(){return new R}function V(t){const B=t[t.length-1];let s=`M${B.projected.x},${B.projected.y}`;for(let B=t.length-2;B>=0;B-=1){const Q=t[B].projected;s+=`L${Q.x},${Q.y}`}return`${s}Z`}class S extends i{data(t){return t.map(t=>{const B=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()});return B.ccw=U(B),B.centroid=g(B),B})}draw(t){return V(t)}}function Z(){return new S}const p=t=>`M${t[0].projected.x},${t[0].projected.y}L${t[1].projected.x},${t[1].projected.y}L${t[2].projected.x},${t[2].projected.y}Z`;class E extends i{data(t){return t.map(t=>{const B=a(t,{origin:this.origin(),rotateCenter:this.rotationCenter(),rotateX:this.rotateX(),rotateY:this.rotateY(),rotateZ:this.rotateZ(),scale:this.scale(),x:this.x(),y:this.y(),z:this.z()});return B.ccw=U(B),B.centroid=g(B),B})}draw(t){return p(t)}}function N(){return new E}function X(t,B){const s=t.centroid.z,Q=B.centroid.z;return s<Q?-1:s>Q?1:0}t.cubes3D=b,t.gridPlanes3D=r,t.lineStrips3D=y,t.lines3D=h,t.planes3D=L,t.points3D=m,t.polygons3D=Z,t.sort=X,t.triangles3D=N,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})})(lL.exports);var cL=lL.exports,nL={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const aL=Object.create(null);for(const t in nL)Object.hasOwn(nL,t)&&(aL[nL[t]]=t);const dL={to:{},get:{}};function oL(t,B,s){return Math.min(Math.max(B,t),s)}function bL(t){const B=Math.round(t).toString(16).toUpperCase();return B.length<2?"0"+B:B}dL.get=function(t){let B,s;switch(t.slice(0,3).toLowerCase()){case"hsl":B=dL.get.hsl(t),s="hsl";break;case"hwb":B=dL.get.hwb(t),s="hwb";break;default:B=dL.get.rgb(t),s="rgb"}return B?{model:s,value:B}:null},dL.get.rgb=function(t){if(!t)return null;let B,s,Q,F=[0,0,0,1];if(B=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(Q=B[2],B=B[1],s=0;s<3;s++){const t=2*s;F[s]=Number.parseInt(B.slice(t,t+2),16)}Q&&(F[3]=Number.parseInt(Q,16)/255)}else if(B=t.match(/^#([a-f\d]{3,4})$/i)){for(B=B[1],Q=B[3],s=0;s<3;s++)F[s]=Number.parseInt(B[s]+B[s],16);Q&&(F[3]=Number.parseInt(Q+Q,16)/255)}else if(B=t.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(s=0;s<3;s++)F[s]=Number.parseFloat(B[s+1]);B[4]&&(F[3]=B[5]?.01*Number.parseFloat(B[4]):Number.parseFloat(B[4]))}else{if(!(B=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(B=t.toLowerCase().match(/^(\w+)$/))?"transparent"===B[1]?[0,0,0,0]:Object.hasOwn(nL,B[1])?(F=nL[B[1]].slice(),F[3]=1,F):null:null;for(s=0;s<3;s++)F[s]=Math.round(2.55*Number.parseFloat(B[s+1]));B[4]&&(F[3]=B[5]?.01*Number.parseFloat(B[4]):Number.parseFloat(B[4]))}for(s=0;s<3;s++)F[s]=oL(F[s],0,255);return F[3]=oL(F[3],0,1),F},dL.get.hsl=function(t){if(!t)return null;const B=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(B){const t=Number.parseFloat(B[4]);return[(Number.parseFloat(B[1])%360+360)%360,oL(Number.parseFloat(B[2]),0,100),oL(Number.parseFloat(B[3]),0,100),oL(Number.isNaN(t)?1:t,0,1)]}return null},dL.get.hwb=function(t){if(!t)return null;const B=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(B){const t=Number.parseFloat(B[4]);return[(Number.parseFloat(B[1])%360+360)%360,oL(Number.parseFloat(B[2]),0,100),oL(Number.parseFloat(B[3]),0,100),oL(Number.isNaN(t)?1:t,0,1)]}return null},dL.to.hex=function(...t){return"#"+bL(t[0])+bL(t[1])+bL(t[2])+(t[3]<1?bL(Math.round(255*t[3])):"")},dL.to.rgb=function(...t){return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},dL.to.rgb.percent=function(...t){const B=Math.round(t[0]/255*100),s=Math.round(t[1]/255*100),Q=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+B+"%, "+s+"%, "+Q+"%)":"rgba("+B+"%, "+s+"%, "+Q+"%, "+t[3]+")"},dL.to.hsl=function(...t){return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},dL.to.hwb=function(...t){let B="";return t.length>=4&&1!==t[3]&&(B=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+B+")"},dL.to.keyword=function(...t){return aL[t.slice(0,3)]};const CL={};for(const t of Object.keys(nL))CL[nL[t]]=t;const rL={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},uL=(6/29)**3;function hL(t){const B=t>.0031308?1.055*t**(1/2.4)-.055:12.92*t;return Math.min(Math.max(0,B),1)}function xL(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(const t of Object.keys(rL)){if(!("channels"in rL[t]))throw new Error("missing channels property: "+t);if(!("labels"in rL[t]))throw new Error("missing channel labels property: "+t);if(rL[t].labels.length!==rL[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:B,labels:s}=rL[t];delete rL[t].channels,delete rL[t].labels,Object.defineProperty(rL[t],"channels",{value:B}),Object.defineProperty(rL[t],"labels",{value:s})}function GL(t,B){return(t[0]-B[0])**2+(t[1]-B[1])**2+(t[2]-B[2])**2}function yL(t){const B=function(){const t={},B=Object.keys(rL);for(let{length:s}=B,Q=0;Q<s;Q++)t[B[Q]]={distance:-1,parent:null};return t}(),s=[t];for(B[t].distance=0;s.length>0;){const t=s.pop(),Q=Object.keys(rL[t]);for(let{length:F}=Q,i=0;i<F;i++){const F=Q[i],U=B[F];-1===U.distance&&(U.distance=B[t].distance+1,U.parent=t,s.unshift(F))}}return B}function AL(t,B){return function(s){return B(t(s))}}function LL(t,B){const s=[B[t].parent,t];let Q=rL[B[t].parent][t],F=B[t].parent;for(;B[F].parent;)s.unshift(B[F].parent),Q=AL(rL[B[F].parent][F],Q),F=B[F].parent;return Q.conversion=s,Q}function RL(t){const B=yL(t),s={},Q=Object.keys(B);for(let{length:t}=Q,F=0;F<t;F++){const t=Q[F];null!==B[t].parent&&(s[t]=LL(t,B))}return s}rL.rgb.hsl=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=i-F;let g,e;switch(i){case F:g=0;break;case B:g=(s-Q)/U;break;case s:g=2+(Q-B)/U;break;case Q:g=4+(B-s)/U}g=Math.min(60*g,360),g<0&&(g+=360);const I=(F+i)/2;return e=i===F?0:I<=.5?U/(i+F):U/(2-i-F),[g,100*e,100*I]},rL.rgb.hsv=function(t){let B,s,Q,F,i;const U=t[0]/255,g=t[1]/255,e=t[2]/255,I=Math.max(U,g,e),l=I-Math.min(U,g,e),c=function(t){return(I-t)/6/l+.5};if(0===l)F=0,i=0;else{switch(i=l/I,B=c(U),s=c(g),Q=c(e),I){case U:F=Q-s;break;case g:F=1/3+B-Q;break;case e:F=2/3+s-B}F<0?F+=1:F>1&&(F-=1)}return[360*F,100*i,100*I]},rL.rgb.hwb=function(t){const B=t[0],s=t[1];let Q=t[2];const F=rL.rgb.hsl(t)[0],i=1/255*Math.min(B,Math.min(s,Q));return Q=1-1/255*Math.max(B,Math.max(s,Q)),[F,100*i,100*Q]},rL.rgb.oklab=function(t){const B=xL(t[0]/255),s=xL(t[1]/255),Q=xL(t[2]/255),F=Math.cbrt(.4122214708*B+.5363325363*s+.0514459929*Q),i=Math.cbrt(.2119034982*B+.6806995451*s+.1073969566*Q),U=Math.cbrt(.0883024619*B+.2817188376*s+.6299787005*Q);return[100*(.2104542553*F+.793617785*i-.0040720468*U),100*(1.9779984951*F-2.428592205*i+.4505937099*U),100*(.0259040371*F+.7827717662*i-.808675766*U)]},rL.rgb.cmyk=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.min(1-B,1-s,1-Q);return[100*((1-B-F)/(1-F)||0),100*((1-s-F)/(1-F)||0),100*((1-Q-F)/(1-F)||0),100*F]},rL.rgb.keyword=function(t){const B=CL[t];if(B)return B;let s,Q=Number.POSITIVE_INFINITY;for(const B of Object.keys(nL)){const F=GL(t,nL[B]);F<Q&&(Q=F,s=B)}return s},rL.keyword.rgb=function(t){return[...nL[t]]},rL.rgb.xyz=function(t){const B=xL(t[0]/255),s=xL(t[1]/255),Q=xL(t[2]/255);return[100*(.4124564*B+.3575761*s+.1804375*Q),100*(.2126729*B+.7151522*s+.072175*Q),100*(.0193339*B+.119192*s+.9503041*Q)]},rL.rgb.lab=function(t){const B=rL.rgb.xyz(t);let s=B[0],Q=B[1],F=B[2];s/=95.047,Q/=100,F/=108.883,s=s>uL?s**(1/3):7.787*s+16/116,Q=Q>uL?Q**(1/3):7.787*Q+16/116,F=F>uL?F**(1/3):7.787*F+16/116;return[116*Q-16,500*(s-Q),200*(Q-F)]},rL.hsl.rgb=function(t){const B=t[0]/360,s=t[1]/100,Q=t[2]/100;let F,i;if(0===s)return i=255*Q,[i,i,i];const U=Q<.5?Q*(1+s):Q+s-Q*s,g=2*Q-U,e=[0,0,0];for(let t=0;t<3;t++)F=B+1/3*-(t-1),F<0&&F++,F>1&&F--,i=6*F<1?g+6*(U-g)*F:2*F<1?U:3*F<2?g+(U-g)*(2/3-F)*6:g,e[t]=255*i;return e},rL.hsl.hsv=function(t){const B=t[0];let s=t[1]/100,Q=t[2]/100,F=s;const i=Math.max(Q,.01);Q*=2,s*=Q<=1?Q:2-Q,F*=i<=1?i:2-i;return[B,100*(0===Q?2*F/(i+F):2*s/(Q+s)),100*((Q+s)/2)]},rL.hsv.rgb=function(t){const B=t[0]/60,s=t[1]/100;let Q=t[2]/100;const F=Math.floor(B)%6,i=B-Math.floor(B),U=255*Q*(1-s),g=255*Q*(1-s*i),e=255*Q*(1-s*(1-i));switch(Q*=255,F){case 0:return[Q,e,U];case 1:return[g,Q,U];case 2:return[U,Q,e];case 3:return[U,g,Q];case 4:return[e,U,Q];case 5:return[Q,U,g]}},rL.hsv.hsl=function(t){const B=t[0],s=t[1]/100,Q=t[2]/100,F=Math.max(Q,.01);let i,U;U=(2-s)*Q;const g=(2-s)*F;return i=s*F,i/=g<=1?g:2-g,i=i||0,U/=2,[B,100*i,100*U]},rL.hwb.rgb=function(t){const B=t[0]/360;let s=t[1]/100,Q=t[2]/100;const F=s+Q;let i;F>1&&(s/=F,Q/=F);const U=Math.floor(6*B),g=1-Q;i=6*B-U,1&U&&(i=1-i);const e=s+i*(g-s);let I,l,c;switch(U){default:case 6:case 0:I=g,l=e,c=s;break;case 1:I=e,l=g,c=s;break;case 2:I=s,l=g,c=e;break;case 3:I=s,l=e,c=g;break;case 4:I=e,l=s,c=g;break;case 5:I=g,l=s,c=e}return[255*I,255*l,255*c]},rL.cmyk.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=t[3]/100;return[255*(1-Math.min(1,B*(1-F)+F)),255*(1-Math.min(1,s*(1-F)+F)),255*(1-Math.min(1,Q*(1-F)+F))]},rL.xyz.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100;let F,i,U;return F=3.2404542*B+-1.5371385*s+-.4985314*Q,i=-.969266*B+1.8760108*s+.041556*Q,U=.0556434*B+-.2040259*s+1.0572252*Q,F=hL(F),i=hL(i),U=hL(U),[255*F,255*i,255*U]},rL.xyz.lab=function(t){let B=t[0],s=t[1],Q=t[2];B/=95.047,s/=100,Q/=108.883,B=B>uL?B**(1/3):7.787*B+16/116,s=s>uL?s**(1/3):7.787*s+16/116,Q=Q>uL?Q**(1/3):7.787*Q+16/116;return[116*s-16,500*(B-s),200*(s-Q)]},rL.xyz.oklab=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=Math.cbrt(.8189330101*B+.3618667424*s-.1288597137*Q),i=Math.cbrt(.0329845436*B+.9293118715*s+.0361456387*Q),U=Math.cbrt(.0482003018*B+.2643662691*s+.633851707*Q);return[100*(.2104542553*F+.793617785*i-.0040720468*U),100*(1.9779984951*F-2.428592205*i+.4505937099*U),100*(.0259040371*F+.7827717662*i-.808675766*U)]},rL.oklab.oklch=function(t){return rL.lab.lch(t)},rL.oklab.xyz=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=(.999999998*B+.396337792*s+.215803758*Q)**3,i=(1.000000008*B-.105561342*s-.063854175*Q)**3,U=(1.000000055*B-.089484182*s-1.291485538*Q)**3;return[100*(1.227013851*F-.55779998*i+.281256149*U),100*(-.040580178*F+1.11225687*i-.071676679*U),100*(-.076381285*F-.421481978*i+1.58616322*U)]},rL.oklab.rgb=function(t){const B=t[0]/100,s=t[1]/100,Q=t[2]/100,F=(B+.3963377774*s+.2158037573*Q)**3,i=(B-.1055613458*s-.0638541728*Q)**3,U=(B-.0894841775*s-1.291485548*Q)**3;return[255*hL(4.0767416621*F-3.3077115913*i+.2309699292*U),255*hL(-1.2684380046*F+2.6097574011*i-.3413193965*U),255*hL(-.0041960863*F-.7034186147*i+1.707614701*U)]},rL.oklch.oklab=function(t){return rL.lch.lab(t)},rL.lab.xyz=function(t){let B,s,Q;s=(t[0]+16)/116,B=t[1]/500+s,Q=s-t[2]/200;const F=s**3,i=B**3,U=Q**3;return s=F>uL?F:(s-16/116)/7.787,B=i>uL?i:(B-16/116)/7.787,Q=U>uL?U:(Q-16/116)/7.787,B*=95.047,s*=100,Q*=108.883,[B,s,Q]},rL.lab.lch=function(t){const B=t[0],s=t[1],Q=t[2];let F;F=360*Math.atan2(Q,s)/2/Math.PI,F<0&&(F+=360);return[B,Math.sqrt(s*s+Q*Q),F]},rL.lch.lab=function(t){const B=t[0],s=t[1],Q=t[2]/360*2*Math.PI;return[B,s*Math.cos(Q),s*Math.sin(Q)]},rL.rgb.ansi16=function(t,B=null){const[s,Q,F]=t;let i=null===B?rL.rgb.hsv(t)[2]:B;if(i=Math.round(i/50),0===i)return 30;let U=30+(Math.round(F/255)<<2|Math.round(Q/255)<<1|Math.round(s/255));return 2===i&&(U+=60),U},rL.hsv.ansi16=function(t){return rL.rgb.ansi16(rL.hsv.rgb(t),t[2])},rL.rgb.ansi256=function(t){const B=t[0],s=t[1],Q=t[2];if(B>>4==s>>4&&s>>4==Q>>4)return B<8?16:B>248?231:Math.round((B-8)/247*24)+232;return 16+36*Math.round(B/255*5)+6*Math.round(s/255*5)+Math.round(Q/255*5)},rL.ansi16.rgb=function(t){let B=(t=t[0])%10;if(0===B||7===B)return t>50&&(B+=3.5),B=B/10.5*255,[B,B,B];const s=.5*(Math.trunc(t>50)+1);return[(1&B)*s*255,(B>>1&1)*s*255,(B>>2&1)*s*255]},rL.ansi256.rgb=function(t){if((t=t[0])>=232){const B=10*(t-232)+8;return[B,B,B]}let B;t-=16;return[Math.floor(t/36)/5*255,Math.floor((B=t%36)/6)/5*255,B%6/5*255]},rL.rgb.hex=function(t){const B=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(B.length)+B},rL.hex.rgb=function(t){const B=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!B)return[0,0,0];let s=B[0];3===B[0].length&&(s=[...s].map(t=>t+t).join(""));const Q=Number.parseInt(s,16);return[Q>>16&255,Q>>8&255,255&Q]},rL.rgb.hcg=function(t){const B=t[0]/255,s=t[1]/255,Q=t[2]/255,F=Math.max(Math.max(B,s),Q),i=Math.min(Math.min(B,s),Q),U=F-i;let g;return g=U<=0?0:F===B?(s-Q)/U%6:F===s?2+(Q-B)/U:4+(B-s)/U,g/=6,g%=1,[360*g,100*U,100*(U<1?i/(1-U):0)]},rL.hsl.hcg=function(t){const B=t[1]/100,s=t[2]/100,Q=s<.5?2*B*s:2*B*(1-s);let F=0;return Q<1&&(F=(s-.5*Q)/(1-Q)),[t[0],100*Q,100*F]},rL.hsv.hcg=function(t){const B=t[1]/100,s=t[2]/100,Q=B*s;let F=0;return Q<1&&(F=(s-Q)/(1-Q)),[t[0],100*Q,100*F]},rL.hcg.rgb=function(t){const B=t[0]/360,s=t[1]/100,Q=t[2]/100;if(0===s)return[255*Q,255*Q,255*Q];const F=[0,0,0],i=B%1*6,U=i%1,g=1-U;let e=0;switch(Math.floor(i)){case 0:F[0]=1,F[1]=U,F[2]=0;break;case 1:F[0]=g,F[1]=1,F[2]=0;break;case 2:F[0]=0,F[1]=1,F[2]=U;break;case 3:F[0]=0,F[1]=g,F[2]=1;break;case 4:F[0]=U,F[1]=0,F[2]=1;break;default:F[0]=1,F[1]=0,F[2]=g}return e=(1-s)*Q,[255*(s*F[0]+e),255*(s*F[1]+e),255*(s*F[2]+e)]},rL.hcg.hsv=function(t){const B=t[1]/100,s=B+t[2]/100*(1-B);let Q=0;return s>0&&(Q=B/s),[t[0],100*Q,100*s]},rL.hcg.hsl=function(t){const B=t[1]/100,s=t[2]/100*(1-B)+.5*B;let Q=0;return s>0&&s<.5?Q=B/(2*s):s>=.5&&s<1&&(Q=B/(2*(1-s))),[t[0],100*Q,100*s]},rL.hcg.hwb=function(t){const B=t[1]/100,s=B+t[2]/100*(1-B);return[t[0],100*(s-B),100*(1-s)]},rL.hwb.hcg=function(t){const B=t[1]/100,s=1-t[2]/100,Q=s-B;let F=0;return Q<1&&(F=(s-Q)/(1-Q)),[t[0],100*Q,100*F]},rL.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},rL.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},rL.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},rL.gray.hsl=function(t){return[0,0,t[0]]},rL.gray.hsv=rL.gray.hsl,rL.gray.hwb=function(t){return[0,100,t[0]]},rL.gray.cmyk=function(t){return[0,0,0,t[0]]},rL.gray.lab=function(t){return[t[0],0,0]},rL.gray.hex=function(t){const B=255&Math.round(t[0]/100*255),s=((B<<16)+(B<<8)+B).toString(16).toUpperCase();return"000000".slice(s.length)+s},rL.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const mL={},VL=Object.keys(rL);function SL(t){const B=function(...B){const s=B[0];return null==s?s:(s.length>1&&(B=s),t(B))};return"conversion"in t&&(B.conversion=t.conversion),B}function ZL(t){const B=function(...B){const s=B[0];if(null==s)return s;s.length>1&&(B=s);const Q=t(B);if("object"==typeof Q)for(let{length:t}=Q,B=0;B<t;B++)Q[B]=Math.round(Q[B]);return Q};return"conversion"in t&&(B.conversion=t.conversion),B}for(const t of VL){mL[t]={},Object.defineProperty(mL[t],"channels",{value:rL[t].channels}),Object.defineProperty(mL[t],"labels",{value:rL[t].labels});const B=RL(t),s=Object.keys(B);for(const Q of s){const s=B[Q];mL[t][Q]=ZL(s),mL[t][Q].raw=SL(s)}}const pL=["keyword","gray","hex"],EL={};for(const t of Object.keys(mL))EL[[...mL[t].labels].sort().join("")]=t;const NL={};function XL(t,B){if(!(this instanceof XL))return new XL(t,B);if(B&&B in pL&&(B=null),B&&!(B in mL))throw new Error("Unknown model: "+B);let s,Q;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof XL)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const B=dL.get(t);if(null===B)throw new Error("Unable to parse color from string: "+t);this.model=B.model,Q=mL[this.model].channels,this.color=B.value.slice(0,Q),this.valpha="number"==typeof B.value[Q]?B.value[Q]:1}else if(t.length>0){this.model=B||"rgb",Q=mL[this.model].channels;const s=Array.prototype.slice.call(t,0,Q);this.color=fL(s,Q),this.valpha="number"==typeof t[Q]?t[Q]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const B=Object.keys(t);"alpha"in t&&(B.splice(B.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const Q=B.sort().join("");if(!(Q in EL))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=EL[Q];const{labels:F}=mL[this.model],i=[];for(s=0;s<F.length;s++)i.push(t[F[s]]);this.color=fL(i)}if(NL[this.model])for(Q=mL[this.model].channels,s=0;s<Q;s++){const t=NL[this.model][s];t&&(this.color[s]=t(this.color[s]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}XL.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let B=this.model in dL.to?this:this.rgb();B=B.round("number"==typeof t?t:1);const s=1===B.valpha?B.color:[...B.color,this.valpha];return dL.to[B.model](...s)},percentString(t){const B=this.rgb().round("number"==typeof t?t:1),s=1===B.valpha?B.color:[...B.color,this.valpha];return dL.to.rgb.percent(...s)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const t={},{channels:B}=mL[this.model],{labels:s}=mL[this.model];for(let Q=0;Q<B;Q++)t[s[Q]]=this.color[Q];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray(){const t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject(){const t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new XL([...this.color.map(WL(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new XL([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},red:HL("rgb",0,DL(255)),green:HL("rgb",1,DL(255)),blue:HL("rgb",2,DL(255)),hue:HL(["hsl","hsv","hsl","hwb","hcg"],0,t=>(t%360+360)%360),saturationl:HL("hsl",1,DL(100)),lightness:HL("hsl",2,DL(100)),saturationv:HL("hsv",1,DL(100)),value:HL("hsv",2,DL(100)),chroma:HL("hcg",1,DL(100)),gray:HL("hcg",2,DL(100)),white:HL("hwb",1,DL(100)),wblack:HL("hwb",2,DL(100)),cyan:HL("cmyk",0,DL(100)),magenta:HL("cmyk",1,DL(100)),yellow:HL("cmyk",2,DL(100)),black:HL("cmyk",3,DL(100)),x:HL("xyz",0,DL(95.047)),y:HL("xyz",1,DL(100)),z:HL("xyz",2,DL(108.833)),l:HL("lab",0,DL(100)),a:HL("lab",1),b:HL("lab",2),keyword(t){return void 0!==t?new XL(t):mL[this.model].keyword(this.color)},hex(t){return void 0!==t?new XL(t):dL.to.hex(...this.rgb().round().color)},hexa(t){if(void 0!==t)return new XL(t);const B=this.rgb().round().color;let s=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===s.length&&(s="0"+s),dL.to.hex(...B)+s},rgbNumber(){const t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity(){const t=this.rgb().color,B=[];for(const[s,Q]of t.entries()){const t=Q/255;B[s]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}return.2126*B[0]+.7152*B[1]+.0722*B[2]},contrast(t){const B=this.luminosity(),s=t.luminosity();return B>s?(B+.05)/(s+.05):(s+.05)/(B+.05)},level(t){const B=this.contrast(t);return B>=7?"AAA":B>=4.5?"AA":""},isDark(){const t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let B=0;B<3;B++)t.color[B]=255-t.color[B];return t},lighten(t){const B=this.hsl();return B.color[2]+=B.color[2]*t,B},darken(t){const B=this.hsl();return B.color[2]-=B.color[2]*t,B},saturate(t){const B=this.hsl();return B.color[1]+=B.color[1]*t,B},desaturate(t){const B=this.hsl();return B.color[1]-=B.color[1]*t,B},whiten(t){const B=this.hwb();return B.color[1]+=B.color[1]*t,B},blacken(t){const B=this.hwb();return B.color[2]+=B.color[2]*t,B},grayscale(){const t=this.rgb().color,B=.3*t[0]+.59*t[1]+.11*t[2];return XL.rgb(B,B,B)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const B=this.hsl();let s=B.color[0];return s=(s+t)%360,s=s<0?360+s:s,B.color[0]=s,B},mix(t,B){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);const s=t.rgb(),Q=this.rgb(),F=void 0===B?.5:B,i=2*F-1,U=s.alpha()-Q.alpha(),g=((i*U===-1?i:(i+U)/(1+i*U))+1)/2,e=1-g;return XL.rgb(g*s.red()+e*Q.red(),g*s.green()+e*Q.green(),g*s.blue()+e*Q.blue(),s.alpha()*F+Q.alpha()*(1-F))}};for(const t of Object.keys(mL)){if(pL.includes(t))continue;const{channels:B}=mL[t];XL.prototype[t]=function(...B){return this.model===t?new XL(this):B.length>0?new XL(B,t):new XL([...(s=mL[this.model][t].raw(this.color),Array.isArray(s)?s:[s]),this.valpha],t);var s},XL[t]=function(...s){let Q=s[0];return"number"==typeof Q&&(Q=fL(s,B)),new XL(Q,t)}}function WL(t){return function(B){return function(t,B){return Number(t.toFixed(B))}(B,t)}}function HL(t,B,s){t=Array.isArray(t)?t:[t];for(const Q of t)(NL[Q]||=[])[B]=s;return t=t[0],function(Q){let F;return void 0!==Q?(s&&(Q=s(Q)),F=this[t](),F.color[B]=Q,F):(F=this[t]().color[B],s&&(F=s(F)),F)}}function DL(t){return function(B){return Math.max(0,Math.min(t,B))}}function fL(t,B){for(let s=0;s<B;s++)"number"!=typeof t[s]&&(t[s]=0);return t}class wL extends(Zo(Eo)){static get properties(){return{surface:{attribute:"surface",type:Boolean,reflect:!0},point:{attribute:"point",type:Boolean,reflect:!0},updateable:{attribute:"updateable",type:Boolean,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.firstUpdate=!0,this.surface=!0,this.point=!0,this.updateable=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.response=this.DEFAULT,this.range={a:{start:1e-4,stop:1,step:.05},l:{start:0,stop:10,step:.5},g:{start:0,stop:1,step:.05},uDiff:{start:-20,stop:20}},this.boundary=[],this.mapXY=[],this.mapXZ=[],this.mapYZ=[],this.rotationX=0,this.rotationY=0,this.mx=0,this.my=0,this.mouseX=0,this.mouseY=0,this.alignState()}alignState(){this.updateable&&(this.response=sb.xal2v(this.xw,this.a,this.l)*sb.pg2w(this.pw,this.g)+sb.xal2v(this.xl,this.a,this.l)*(1-sb.pg2w(this.pw,this.g))>sb.xal2v(this.xs,this.a,this.l)?"gamble":"sure");const t=(t,B)=>{const s=sb.pg2w(t,B);return Number.isNaN(s)?t:s},B=(B,s,Q,F,i,U,g)=>sb.xal2v(B,i,U)*t(Q,g)+sb.xal2v(s,i,U)*(1-t(Q,g))-sb.xal2v(F,i,U);this.boundary=nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).flatMap(t=>nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).map(s=>{let Q=this.range.a.start,F=10,i=(Q+F)/2;const U=B(this.xw,this.xl,this.pw,this.xs,Q,t,s),g=B(this.xw,this.xl,this.pw,this.xs,F,t,s);let e;return U>0?i=-1/0:g<0?i=1/0:nB(0,15,1).forEach(()=>{e=B(this.xw,this.xl,this.pw,this.xs,i,t,s),e<0?Q=i:F=i,i=(Q+F)/2}),{a:i,l:t,g:s}}));const s=t=>t?.a>=this.range.a.start&&t?.a<=this.range.a.stop;this.boundary=this.boundary.map((t,B,Q)=>{if(s(t))return t;const F=nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length,i=nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length,U=B%F===0?null:Q[B-1],g=B%F===F-1?null:Q[B+1],e=0===Math.trunc(B/F)?null:Q[B-F],I=Math.trunc(B/F)===i-1?null:Q[B+F],l=s(U)?1:0,c=s(g)?1:0,n=s(e)?1:0,a=l+c+n+(s(I)?1:0);if(0===a||2===a&&l+c!==1||3===a||4===a)return t;const d={a:t.a<this.range.a.start?this.range.a.start:this.range.a.stop,g:t.g,l:t.l};let o;if(1===a)o=l?U:c?g:n?e:I;else{const t=l?U:g,B=n?e:I;o={a:(t.a+B.a)/2,g:(t.g+B.g)/2,l:(t.l+B.l)/2}}const b=(d.a-o.a)/(t.a-o.a);return d.g=o.g+(t.g-o.g)*b,d.l=o.l+(t.l-o.l)*b,d});const Q=this.range.l.stop;this.mapXY=nB(this.range.a.start,this.range.a.stop+.01,this.range.a.step).flatMap(t=>nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).map(s=>{const F=B(this.xw,this.xl,this.pw,this.xs,t,Q,s);return{a:t,l:Q,g:s,uDiff:F}}));const F=this.range.g.start;this.mapXZ=nB(this.range.a.start,this.range.a.stop+.01,this.range.a.step).flatMap(t=>nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).map(s=>{const Q=B(this.xw,this.xl,this.pw,this.xs,t,s,F);return{a:t,l:s,g:F,uDiff:Q}}));const i=this.range.a.stop;this.mapYZ=nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).flatMap(t=>nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).map(s=>{const Q=B(this.xw,this.xl,this.pw,this.xs,i,s,t);return{a:i,l:s,g:t,uDiff:Q}}))}static get styles(){return[super.styles,g`
|
|
1465
1433
|
:host {
|
|
1466
1434
|
display: inline-block;
|
|
1467
1435
|
|
|
@@ -1495,6 +1463,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1495
1463
|
font-weight: 600;
|
|
1496
1464
|
|
|
1497
1465
|
alignment-baseline: middle;
|
|
1466
|
+
|
|
1498
1467
|
text-anchor: middle;
|
|
1499
1468
|
}
|
|
1500
1469
|
|
|
@@ -1518,6 +1487,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1518
1487
|
font-size: 0.75rem;
|
|
1519
1488
|
|
|
1520
1489
|
alignment-baseline: middle;
|
|
1490
|
+
|
|
1521
1491
|
text-anchor: end;
|
|
1522
1492
|
}
|
|
1523
1493
|
|
|
@@ -1558,6 +1528,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1558
1528
|
font-weight: 600;
|
|
1559
1529
|
|
|
1560
1530
|
alignment-baseline: middle;
|
|
1531
|
+
|
|
1561
1532
|
text-anchor: middle;
|
|
1562
1533
|
}
|
|
1563
1534
|
|
|
@@ -1568,7 +1539,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1568
1539
|
stroke: none;
|
|
1569
1540
|
}
|
|
1570
1541
|
`]}render(){return M`
|
|
1571
|
-
`}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F={top:3*this.rem,bottom:5*this.rem,left:2*this.rem,right:6*this.rem},i=Q-(F.top+F.bottom),U=Q-(F.left+F.right),g=AI().domain([this.range.a.start,this.range.a.stop]).range([0,U]),e=AI().domain([this.range.g.start,this.range.g.stop]).range([0,-i]),I=AI().domain([this.range.l.start,this.range.l.stop]).range([0,-i]),l=PL(this.getComputedStyleValue("---color-element-background")).hex(),c=PL(this.getComputedStyleValue("---color-better-dark")).hex(),n=PL(this.getComputedStyleValue("---color-better")).hex(),a=PL(this.getComputedStyleValue("---color-nr")).hex(),d=PL(this.getComputedStyleValue("---color-worse")).hex(),o=PL(this.getComputedStyleValue("---color-worse-dark")).hex(),b=cn().domain([this.range.uDiff.start,0,this.range.uDiff.stop]).clamp(!0).interpolator(vF([c,n,a,d,o])),C=AI().domain([this.range.uDiff.start,this.range.uDiff.stop]).range([0,-s+4*this.rem]),r={x:F.left,y:Q-F.bottom},u={x:g((this.range.a.start+this.range.a.stop)/2),y:e((this.range.g.start+this.range.g.stop)/2),z:I((this.range.l.start+this.range.l.stop)/2)},h=-.85*Math.PI/8,x=3*Math.PI/8,G=RL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),y=hL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),A=yL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),L=tQ().on("start",t=>{this.mx=t.x,this.my=t.y}).on("drag",t=>{this.rotationY=(t.x-this.mx+this.mouseX)*(Math.PI/230),this.rotationX=(t.y-this.my+this.mouseY)*(Math.PI/230)*-1,this.requestUpdate()}).on("end",t=>{this.mouseX=t.x-this.mx+this.mouseX,this.mouseY=t.y-this.my+this.mouseY}),R=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),m=R.enter().append("svg").classed("main",!0).call(L),V=m.merge(R).attr("viewBox",`0 0 ${Q} ${Q}`),S=m.append("defs").append("linearGradient").attr("id","gradient-legend").attr("x1",0).attr("x2",0).attr("y1",1).attr("y2",0);S.append("stop").attr("offset","0%").attr("stop-color",c),S.append("stop").attr("offset","25%").attr("stop-color",n),S.append("stop").attr("offset","50%").attr("stop-color",a),S.append("stop").attr("offset","75%").attr("stop-color",d),S.append("stop").attr("offset","100%").attr("stop-color",o);const Z=[[{title:'Alpha (<tspan class="math-var">α</tspan>)',id:"max",x:g.range()[1]},{id:"min",x:g.range()[0]}]],p=[[{title:'Gamma (<tspan class="math-var">γ</tspan>)',id:"max",y:e.range()[1]},{id:"min",y:e.range()[0]}]],E=[[{title:'Lambda (<tspan class="math-var">λ</tspan>)',id:"max",z:I.range()[1]},{id:"min",z:I.range()[0]}]],N=V.selectAll(".axis-x").data(G.x(t=>t.x).y(()=>e.range()[0]).z(()=>I.range()[0])(Z)),X=V.selectAll(".axis-y").data(G.x(()=>g.range()[0]).y(t=>t.y).z(()=>I.range()[1])(p)),W=V.selectAll(".axis-z").data(G.x(()=>g.range()[0]).y(()=>e.range()[0]).z(t=>t.z)(E)),H=N.enter().append("path").attr("class","d3-3d axis axis-x"),D=X.enter().append("path").attr("class","d3-3d axis axis-y"),f=W.enter().append("path").attr("class","d3-3d axis axis-z"),w=H.merge(N).attr("d",G.draw),v=D.merge(X).attr("d",G.draw),Y=f.merge(W).attr("d",G.draw);w.exit().remove(),v.exit().remove(),Y.exit().remove();const J=V.selectAll(".title-path-x").data(G.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem)(Z)),k=V.selectAll(".title-path-y").data(G.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem)(p)),M=V.selectAll(".title-path-z").data(G.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem)(E)),T=V.selectAll(".title-x").data(Z,t=>t[0].title),z=V.selectAll(".title-y").data(p,t=>t[0].title),K=V.selectAll(".title-z").data(E,t=>t[0].title),O=J.enter().append("path").attr("class","d3-3d title-path title-path-x").attr("id","title-x"),P=k.enter().append("path").attr("class","d3-3d title-path title-path-y").attr("id","title-y"),j=M.enter().append("path").attr("class","d3-3d title-path title-path-z").attr("id","title-z"),_=T.enter().append("text").attr("class","d3-3d title title-x");_.append("textPath").attr("href","#title-x").attr("startOffset","50%");const $=z.enter().append("text").attr("class","d3-3d title title-y");$.append("textPath").attr("href","#title-y").attr("startOffset","50%");const q=K.enter().append("text").attr("class","d3-3d title title-z");q.append("textPath").attr("href","#title-z").attr("startOffset","50%");const tt=O.merge(J).attr("d",G.draw),Bt=P.merge(k).attr("d",G.draw),st=j.merge(M).attr("d",G.draw),Qt=_.merge(T).select("textPath").html(t=>t[0].title),Ft=$.merge(z).select("textPath").html(t=>t[0].title),it=q.merge(K).select("textPath").html(t=>t[0].title);tt.exit().remove(),Bt.exit().remove(),st.exit().remove(),Qt.exit().remove(),Ft.exit().remove(),it.exit().remove();const Ut=g.ticks(5).map(t=>[{id:"min",label:g.tickFormat()(t),x:g(t)},{id:"max",x:g(t)}]),gt=e.ticks(5).map(t=>[{id:"min",label:e.tickFormat()(t),y:e(t)},{id:"max",y:e(t)}]),et=I.ticks(5).map(t=>[{id:"max",label:I.tickFormat()(t),z:I(t)},{id:"min",z:I(t)}]),It=V.selectAll(".tick-x").data(G.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>"min"===t.id?I.range()[0]:I.range()[0]+.35*this.rem)(Ut)),lt=V.selectAll(".tick-y").data(G.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]:I.range()[1]-.35*this.rem)(gt)),ct=V.selectAll(".tick-z").data(G.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>t.z)(et)),nt=It.enter().append("path").attr("class","d3-3d tick tick-x"),at=lt.enter().append("path").attr("class","d3-3d tick tick-y"),dt=ct.enter().append("path").attr("class","d3-3d tick tick-z"),ot=nt.merge(It).attr("d",G.draw),bt=at.merge(lt).attr("d",G.draw),Ct=dt.merge(ct).attr("d",G.draw);ot.exit().remove(),bt.exit().remove(),Ct.exit().remove();const rt=V.selectAll(".label-path-x").data(G.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem)(Ut),t=>t[0].label),ut=V.selectAll(".label-path-y").data(G.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem)(gt),t=>t[0].label),ht=V.selectAll(".label-path-z").data(G.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z)(et),t=>t[0].label),xt=V.selectAll(".label-x").data(Ut,t=>t[0].label),Gt=V.selectAll(".label-y").data(gt,t=>t[0].label),yt=V.selectAll(".label-z").data(et,t=>t[0].label),At=rt.enter().append("path").attr("class","d3-3d label-path label-path-x").attr("id",(t,B)=>`label-x-${B}`),Lt=ut.enter().append("path").attr("class","d3-3d label-path label-path-y").attr("id",(t,B)=>`label-y-${B}`),Rt=ht.enter().append("path").attr("class","d3-3d label-path label-path-z").attr("id",(t,B)=>`label-z-${B}`),mt=xt.enter().append("text").attr("class","d3-3d label label-x");mt.append("textPath").attr("href",(t,B)=>`#label-x-${B}`).attr("startOffset","0%");const Vt=Gt.enter().append("text").attr("class","d3-3d label label-y");Vt.append("textPath").attr("href",(t,B)=>`#label-y-${B}`).attr("startOffset","100%");const St=yt.enter().append("text").attr("class","d3-3d label label-z");St.append("textPath").attr("href",(t,B)=>`#label-z-${B}`).attr("startOffset","100%");const Zt=At.merge(rt).attr("d",G.draw),pt=Lt.merge(ut).attr("d",G.draw),Et=Rt.merge(ht).attr("d",G.draw),Nt=mt.merge(xt).select("textPath").text(t=>t[0].label),Xt=Vt.merge(Gt).select("textPath").text(t=>t[0].label),Wt=St.merge(yt).select("textPath").text(t=>t[0].label);Zt.exit().remove(),pt.exit().remove(),Et.exit().remove(),Nt.exit().remove(),Xt.exit().remove(),Wt.exit().remove();const Ht=V.selectAll(".point").data(y.x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l))(this.point?[{a:this.a,g:this.g,l:this.l,response:this.response}]:[]));function Dt(t,B){return{x:B.x-t.x,y:B.y-t.y,z:B.z-t.z}}function ft(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function wt(t,B,s){return function(t,B){return{x:t.y*B.z-t.z*B.y,y:t.z*B.x-t.x*B.z,z:t.x*B.y-t.y*B.x}}(Dt(t,B),Dt(t,s))}function vt(t,B){return function(t,B){return t.x*B.x+t.y*B.y+t.z*B.z}(t,B)/(ft(t)*ft(B))}Ht.enter().append("circle").attr("class","d3-3d point").merge(Ht).attr("class",t=>`d3-3d point ${t.response}`).attr("cx",t=>t.projected.x).attr("cy",t=>t.projected.y),Ht.exit().remove();const Yt={x:-.5,y:1,z:-1},Jt=V.selectAll(".boundary").data(this.surface?A.rows(nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l))(this.boundary).filter(t=>t[0].a>=this.range.a.start&&t[0].a<=this.range.a.stop&&t[1].a>=this.range.a.start&&t[1].a<=this.range.a.stop&&t[2].a>=this.range.a.start&&t[2].a<=this.range.a.stop&&t[3].a>=this.range.a.start&&t[3].a<=this.range.a.stop):[]);Jt.enter().append("path").attr("class","d3-3d boundary").merge(Jt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(l).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Jt.exit().remove();const kt=V.selectAll(".map-xy").data(A.rows(nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l))(this.mapXY)),Mt=V.selectAll(".map-xz").data(A.rows(nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l))(this.mapXZ)),Tt=V.selectAll(".map-yz").data(A.rows(nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l))(this.mapYZ)),zt=kt.enter().append("path").attr("class","d3-3d map map-xy"),Kt=Mt.enter().append("path").attr("class","d3-3d map map-xz"),Ot=Tt.enter().append("path").attr("class","d3-3d map map-yz");zt.merge(kt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Kt.merge(Mt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Ot.merge(Tt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),kt.exit().remove(),Mt.exit().remove(),Tt.exit().remove(),Js(this.renderRoot).selectAll(".d3-3d").sort(y.sort);const Pt=V.selectAll(".legend").data([{x:Q+2*this.rem,y:Q-2*this.rem,rem:this.rem}]),jt=Pt.enter().append("g").attr("class","legend"),_t=jt.merge(Pt).attr("transform",t=>`translate(${t.x} ${t.y})`);Pt.exit().remove(),jt.append("g").attr("class","axis axis-legend"),_t.select(".axis-legend").call(AB(C).ticks(7)).attr("font-size",null).attr("font-family",null),jt.append("text").attr("class","title title-legend").html('Difference in Utility (<tspan class="math-var">U<tspan class="subscript">gamble</tspan></tspan> − <tspan class="math-var">U<tspan class="subscript">sure</tspan></tspan>)'),_t.select(".title-legend").attr("transform",`translate(${2.5*-this.rem},${(C(this.range.uDiff.start)+C(this.range.uDiff.stop))/2})rotate(-90)`),jt.append("rect").attr("class","bar bar-legend").attr("fill",'url("#gradient-legend")'),_t.select(".bar-legend").attr("x",0).attr("y",C(this.range.uDiff.stop)).attr("width",this.rem).attr("height",C(this.range.uDiff.start)-C(this.range.uDiff.stop)),this.firstUpdate=!1}}customElements.define("cpt-space",tR);class BR extends(Zo(Eo)){static get properties(){return{x:{attribute:"value",type:Number,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},label:{attribute:"label",type:String,reflect:!0},v:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.firstUpdate=!0,this.drag=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.x=null,this.label="",this.function="default",this.functions=[{name:"default",a:this.a,l:this.l}],this.values=[{name:"default",x:this.x,label:this.label,function:this.function}],this.xl=null,this.xw=null,this.pw=null,this.xs=null,this.trialCount=null,this.response=null,this.alignState()}alignState(){this.functions[0].a=this.a,this.functions[0].l=this.l,this.values[0].x=this.x,this.values[0].label=this.label,this.values[0].function=this.function,this.values.forEach(t=>{const B=this.functions.find(B=>B.name===t.function);t.v=sb.xal2v(t.x,B.a,B.l)}),this.v=this.values[0].v}trial(t,B,s,Q,F,i){this.trialCount&&this.removeValue(`${this.trialCount}-w`),this.trialCount&&this.removeValue(`${this.trialCount}-s`),this.xl=t,this.xw=B,this.pw=s,this.xs=Q,this.trialCount=F,this.response=i,this.setValue(this.xw,`${this.trialCount}-w`,"g","default",!0),this.setValue(this.xs,`${this.trialCount}-s`,"s","default",!0)}pauseTrial(){const t=Js(this.renderRoot).selectAll(".lines[data-animating-ease-time-1]");t.interrupt("new-1"),t.interrupt("new-2"),t.datum(t=>(t.paused=!0,t))}resumeTrial(){Js(this.renderRoot).selectAll(".lines[data-animating-ease-time-1]").datum(t=>(t.paused=!1,t)),this.requestUpdate()}clearFunctions(){this.functions.splice(1),this.requestUpdate()}clearValues(){this.values.splice(1),this.requestUpdate()}clear(){this.clearFunctions(),this.clearValues()}removeFunction(t){this.functions=this.functions.filter(B=>B.name!==t),this.requestUpdate()}removeValue(t){this.values=this.values.filter(B=>B.name!==t),this.requestUpdate()}remove(t){this.removeFunction(t),this.removeValue(t)}getFunction(t="default"){return this.functions.find(B=>B.name===t)}getValue(t="default"){return this.values.find(B=>B.name===t)}get(t="default"){return{...this.getFunction(t),...this.getValue(t)}}setFunction(t,B,s="default"){"default"===s&&(this.a=t,this.l=B);const Q=this.functions.find(t=>t.name===s);void 0===Q?this.functions.push({name:s,a:t,l:B}):(Q.a=t,Q.l=B),this.requestUpdate()}setValue(t,B="default",s="",Q=B,F=!1){"default"===B&&(this.x=t,this.label=s);const i=this.values.find(t=>t.name===B);void 0===i?this.values.push({name:B,x:t,label:s,function:Q,trial:F,new:F}):(i.x=t,i.label=s,i.function=Q),this.requestUpdate()}set(t,B,s,Q="default",F="",i=Q){this.setFunction(B,s,i),this.setValue(t,Q,F,i)}static get styles(){return[super.styles,g`
|
|
1542
|
+
`}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F={top:3*this.rem,bottom:5*this.rem,left:2*this.rem,right:6*this.rem},i=Q-(F.top+F.bottom),U=Q-(F.left+F.right),g=AI().domain([this.range.a.start,this.range.a.stop]).range([0,U]),e=AI().domain([this.range.g.start,this.range.g.stop]).range([0,-i]),I=AI().domain([this.range.l.start,this.range.l.stop]).range([0,-i]),l=XL(this.getComputedStyleValue("---color-element-background")).hex(),c=XL(this.getComputedStyleValue("---color-better-dark")).hex(),n=XL(this.getComputedStyleValue("---color-better")).hex(),a=XL(this.getComputedStyleValue("---color-nr")).hex(),d=XL(this.getComputedStyleValue("---color-worse")).hex(),o=XL(this.getComputedStyleValue("---color-worse-dark")).hex(),b=cn().domain([this.range.uDiff.start,0,this.range.uDiff.stop]).clamp(!0).interpolator(vF([c,n,a,d,o])),C=AI().domain([this.range.uDiff.start,this.range.uDiff.stop]).range([0,-s+4*this.rem]),r={x:F.left,y:Q-F.bottom},u={x:g((this.range.a.start+this.range.a.stop)/2),y:e((this.range.g.start+this.range.g.stop)/2),z:I((this.range.l.start+this.range.l.stop)/2)},h=-.85*Math.PI/8,x=3*Math.PI/8,G=1e-7,y=cL.lineStrips3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),A=cL.points3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),L=cL.gridPlanes3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),R=tQ().on("start",t=>{this.mx=t.x,this.my=t.y}).on("drag",t=>{this.rotationY=(t.x-this.mx+this.mouseX)*(Math.PI/230),this.rotationX=(t.y-this.my+this.mouseY)*(Math.PI/230)*-1,this.requestUpdate()}).on("end",t=>{this.mouseX=t.x-this.mx+this.mouseX,this.mouseY=t.y-this.my+this.mouseY}),m=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),V=m.enter().append("svg").classed("main",!0).call(R),S=V.merge(m).attr("viewBox",`0 0 ${Q} ${Q}`),Z=V.append("defs").append("linearGradient").attr("id","gradient-legend").attr("x1",0).attr("x2",0).attr("y1",1).attr("y2",0);Z.append("stop").attr("offset","0%").attr("stop-color",c),Z.append("stop").attr("offset","25%").attr("stop-color",n),Z.append("stop").attr("offset","50%").attr("stop-color",a),Z.append("stop").attr("offset","75%").attr("stop-color",d),Z.append("stop").attr("offset","100%").attr("stop-color",o);const p=[[{title:'Alpha (<tspan class="math-var">α</tspan>)',id:"max",x:g.range()[1]},{id:"min",x:g.range()[0]}]],E=[[{title:'Gamma (<tspan class="math-var">γ</tspan>)',id:"max",y:e.range()[1]},{id:"min",y:e.range()[0]}]],N=[[{title:'Lambda (<tspan class="math-var">λ</tspan>)',id:"max",z:I.range()[1]},{id:"min",z:I.range()[0]}]],X=S.selectAll(".axis-x").data(y.x(t=>t.x).y(()=>e.range()[0]).z(()=>I.range()[0]).data(p)),W=S.selectAll(".axis-y").data(y.x(()=>g.range()[0]).y(t=>t.y).z(()=>I.range()[1]).data(E)),H=S.selectAll(".axis-z").data(y.x(()=>g.range()[0]).y(()=>e.range()[0]).z(t=>t.z).data(N)),D=X.enter().append("path").attr("class","d3-3d axis axis-x"),f=W.enter().append("path").attr("class","d3-3d axis axis-y"),w=H.enter().append("path").attr("class","d3-3d axis axis-z"),v=D.merge(X).attr("d",y.draw),Y=f.merge(W).attr("d",y.draw),J=w.merge(H).attr("d",y.draw);v.exit().remove(),Y.exit().remove(),J.exit().remove();const k=S.selectAll(".title-path-x").data(y.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem).data(p)),M=S.selectAll(".title-path-y").data(y.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem).data(E)),T=S.selectAll(".title-path-z").data(y.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem).data(N)),z=S.selectAll(".title-x").data(y.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem).data(p),t=>t[0].title),K=S.selectAll(".title-y").data(y.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem).data(E),t=>t[0].title),O=S.selectAll(".title-z").data(y.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem).data(N),t=>t[0].title),P=k.enter().append("path").attr("class","d3-3d title-path title-path-x").attr("id","title-x"),j=M.enter().append("path").attr("class","d3-3d title-path title-path-y").attr("id","title-y"),_=T.enter().append("path").attr("class","d3-3d title-path title-path-z").attr("id","title-z"),$=z.enter().append("text").attr("class","d3-3d title title-x");$.append("textPath").attr("href","#title-x").attr("startOffset","50%");const q=K.enter().append("text").attr("class","d3-3d title title-y");q.append("textPath").attr("href","#title-y").attr("startOffset","50%");const tt=O.enter().append("text").attr("class","d3-3d title title-z");tt.append("textPath").attr("href","#title-z").attr("startOffset","50%");const Bt=P.merge(k).attr("d",y.draw),st=j.merge(M).attr("d",y.draw),Qt=_.merge(T).attr("d",y.draw),Ft=$.merge(z).select("textPath").html(t=>t[0].title),it=q.merge(K).select("textPath").html(t=>t[0].title),Ut=tt.merge(O).select("textPath").html(t=>t[0].title);Bt.exit().remove(),st.exit().remove(),Qt.exit().remove(),Ft.exit().remove(),it.exit().remove(),Ut.exit().remove();const gt=g.ticks(5).map(t=>[{id:"min",label:g.tickFormat()(t),x:g(t)},{id:"max",x:g(t)}]),et=e.ticks(5).map(t=>[{id:"min",label:e.tickFormat()(t),y:e(t)},{id:"max",y:e(t)}]),It=I.ticks(5).map(t=>[{id:"max",label:I.tickFormat()(t),z:I(t)},{id:"min",z:I(t)}]),lt=S.selectAll(".tick-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>"min"===t.id?I.range()[0]:I.range()[0]+.35*this.rem).data(gt)),ct=S.selectAll(".tick-y").data(y.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]:I.range()[1]-.35*this.rem).data(et)),nt=S.selectAll(".tick-z").data(y.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>t.z).data(It)),at=lt.enter().append("path").attr("class","d3-3d tick tick-x"),dt=ct.enter().append("path").attr("class","d3-3d tick tick-y"),ot=nt.enter().append("path").attr("class","d3-3d tick tick-z"),bt=at.merge(lt).attr("d",y.draw),Ct=dt.merge(ct).attr("d",y.draw),rt=ot.merge(nt).attr("d",y.draw);bt.exit().remove(),Ct.exit().remove(),rt.exit().remove();const ut=S.selectAll(".label-path-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem).data(gt),t=>t[0].label),ht=S.selectAll(".label-path-y").data(y.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem).data(et),t=>t[0].label),xt=S.selectAll(".label-path-z").data(y.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z).data(It),t=>t[0].label),Gt=S.selectAll(".label-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem).data(gt),t=>t[0].label),yt=S.selectAll(".label-y").data(y.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem).data(et),t=>t[0].label),At=S.selectAll(".label-z").data(y.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z).data(It),t=>t[0].label),Lt=ut.enter().append("path").attr("class","d3-3d label-path label-path-x").attr("id",(t,B)=>`label-x-${B}`),Rt=ht.enter().append("path").attr("class","d3-3d label-path label-path-y").attr("id",(t,B)=>`label-y-${B}`),mt=xt.enter().append("path").attr("class","d3-3d label-path label-path-z").attr("id",(t,B)=>`label-z-${B}`),Vt=Gt.enter().append("text").attr("class","d3-3d label label-x");Vt.append("textPath").attr("href",(t,B)=>`#label-x-${B}`).attr("startOffset","0%");const St=yt.enter().append("text").attr("class","d3-3d label label-y");St.append("textPath").attr("href",(t,B)=>`#label-y-${B}`).attr("startOffset","100%");const Zt=At.enter().append("text").attr("class","d3-3d label label-z");Zt.append("textPath").attr("href",(t,B)=>`#label-z-${B}`).attr("startOffset","100%");const pt=Lt.merge(ut).attr("d",y.draw),Et=Rt.merge(ht).attr("d",y.draw),Nt=mt.merge(xt).attr("d",y.draw),Xt=Vt.merge(Gt).select("textPath").text(t=>t[0].label),Wt=St.merge(yt).select("textPath").text(t=>t[0].label),Ht=Zt.merge(At).select("textPath").text(t=>t[0].label);pt.exit().remove(),Et.exit().remove(),Nt.exit().remove(),Xt.exit().remove(),Wt.exit().remove(),Ht.exit().remove();const Dt=S.selectAll(".point").data(A.x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l)).data(this.point?[{a:this.a,g:this.g,l:this.l,response:this.response}]:[]));function ft(t,B){return{x:B.x-t.x,y:B.y-t.y,z:B.z-t.z}}function wt(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function vt(t,B,s){return function(t,B){return{x:t.y*B.z-t.z*B.y,y:t.z*B.x-t.x*B.z,z:t.x*B.y-t.y*B.x}}(ft(t,B),ft(t,s))}function Yt(t,B){return function(t,B){return t.x*B.x+t.y*B.y+t.z*B.z}(t,B)/(wt(t)*wt(B))}Dt.enter().append("circle").attr("class","d3-3d point").merge(Dt).attr("class",t=>`d3-3d point ${t.response}`).attr("cx",t=>t.projected.x).attr("cy",t=>t.projected.y),Dt.exit().remove();const Jt={x:-.5,y:1,z:-1},kt=S.selectAll(".boundary").data(this.surface?L.rows(nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l)).data(this.boundary).filter(t=>t[0].a>=this.range.a.start&&t[0].a<=this.range.a.stop&&t[1].a>=this.range.a.start&&t[1].a<=this.range.a.stop&&t[2].a>=this.range.a.start&&t[2].a<=this.range.a.stop&&t[3].a>=this.range.a.start&&t[3].a<=this.range.a.stop):[]);kt.enter().append("path").attr("class","d3-3d boundary").merge(kt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(l).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),kt.exit().remove();const Mt=S.selectAll(".map-xy").data(L.rows(nB(this.range.g.start,this.range.g.stop+.01,this.range.g.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l)).data(this.mapXY)),Tt=S.selectAll(".map-xz").data(L.rows(nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l)).data(this.mapXZ)),zt=S.selectAll(".map-yz").data(L.rows(nB(this.range.l.start,this.range.l.stop+.01,this.range.l.step).length).x(t=>g(t.a)).y(t=>e(t.g)).z(t=>I(t.l)).data(this.mapYZ)),Kt=Mt.enter().append("path").attr("class","d3-3d map map-xy"),Ot=Tt.enter().append("path").attr("class","d3-3d map map-xz"),Pt=zt.enter().append("path").attr("class","d3-3d map map-yz");Kt.merge(Mt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Ot.merge(Tt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Pt.merge(zt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Mt.exit().remove(),Tt.exit().remove(),zt.exit().remove(),Js(this.renderRoot).selectAll(".d3-3d").sort(cL.sort);const jt=S.selectAll(".legend").data([{x:Q+2*this.rem,y:Q-2*this.rem,rem:this.rem}]),_t=jt.enter().append("g").attr("class","legend"),$t=_t.merge(jt).attr("transform",t=>`translate(${t.x} ${t.y})`);jt.exit().remove(),_t.append("g").attr("class","axis axis-legend"),$t.select(".axis-legend").call(AB(C).ticks(7)).attr("font-size",null).attr("font-family",null),_t.append("text").attr("class","title title-legend").html('Difference in Utility (<tspan class="math-var">U<tspan class="subscript">gamble</tspan></tspan> − <tspan class="math-var">U<tspan class="subscript">sure</tspan></tspan>)'),$t.select(".title-legend").attr("transform",`translate(${2.5*-this.rem},${(C(this.range.uDiff.start)+C(this.range.uDiff.stop))/2})rotate(-90)`),_t.append("rect").attr("class","bar bar-legend").attr("fill",'url("#gradient-legend")'),$t.select(".bar-legend").attr("x",0).attr("y",C(this.range.uDiff.stop)).attr("width",this.rem).attr("height",C(this.range.uDiff.start)-C(this.range.uDiff.stop)),this.firstUpdate=!1}}customElements.define("cpt-space",wL);class vL extends(Zo(Eo)){static get properties(){return{x:{attribute:"value",type:Number,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},label:{attribute:"label",type:String,reflect:!0},v:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.firstUpdate=!0,this.drag=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.x=null,this.label="",this.function="default",this.functions=[{name:"default",a:this.a,l:this.l}],this.values=[{name:"default",x:this.x,label:this.label,function:this.function}],this.xl=null,this.xw=null,this.pw=null,this.xs=null,this.trialCount=null,this.response=null,this.alignState()}alignState(){this.functions[0].a=this.a,this.functions[0].l=this.l,this.values[0].x=this.x,this.values[0].label=this.label,this.values[0].function=this.function,this.values.forEach(t=>{const B=this.functions.find(B=>B.name===t.function);t.v=sb.xal2v(t.x,B.a,B.l)}),this.v=this.values[0].v}trial(t,B,s,Q,F,i){this.trialCount&&this.removeValue(`${this.trialCount}-w`),this.trialCount&&this.removeValue(`${this.trialCount}-s`),this.xl=t,this.xw=B,this.pw=s,this.xs=Q,this.trialCount=F,this.response=i,this.setValue(this.xw,`${this.trialCount}-w`,"g","default",!0),this.setValue(this.xs,`${this.trialCount}-s`,"s","default",!0)}pauseTrial(){const t=Js(this.renderRoot).selectAll(".lines[data-animating-ease-time-1]");t.interrupt("new-1"),t.interrupt("new-2"),t.datum(t=>(t.paused=!0,t))}resumeTrial(){Js(this.renderRoot).selectAll(".lines[data-animating-ease-time-1]").datum(t=>(t.paused=!1,t)),this.requestUpdate()}clearFunctions(){this.functions.splice(1),this.requestUpdate()}clearValues(){this.values.splice(1),this.requestUpdate()}clear(){this.clearFunctions(),this.clearValues()}removeFunction(t){this.functions=this.functions.filter(B=>B.name!==t),this.requestUpdate()}removeValue(t){this.values=this.values.filter(B=>B.name!==t),this.requestUpdate()}remove(t){this.removeFunction(t),this.removeValue(t)}getFunction(t="default"){return this.functions.find(B=>B.name===t)}getValue(t="default"){return this.values.find(B=>B.name===t)}get(t="default"){return{...this.getFunction(t),...this.getValue(t)}}setFunction(t,B,s="default"){"default"===s&&(this.a=t,this.l=B);const Q=this.functions.find(t=>t.name===s);void 0===Q?this.functions.push({name:s,a:t,l:B}):(Q.a=t,Q.l=B),this.requestUpdate()}setValue(t,B="default",s="",Q=B,F=!1){"default"===B&&(this.x=t,this.label=s);const i=this.values.find(t=>t.name===B);void 0===i?this.values.push({name:B,x:t,label:s,function:Q,trial:F,new:F}):(i.x=t,i.label=s,i.function=Q),this.requestUpdate()}set(t,B,s,Q="default",F="",i=Q){this.setFunction(B,s,i),this.setValue(t,Q,F,i)}static get styles(){return[super.styles,g`
|
|
1572
1543
|
:host {
|
|
1573
1544
|
display: inline-block;
|
|
1574
1545
|
|
|
@@ -1592,9 +1563,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1592
1563
|
.curve-p.interactive,
|
|
1593
1564
|
.curve-n.interactive {
|
|
1594
1565
|
cursor: nwse-resize;
|
|
1566
|
+
outline: none;
|
|
1595
1567
|
|
|
1596
1568
|
filter: url("#shadow-2");
|
|
1597
|
-
outline: none;
|
|
1598
1569
|
}
|
|
1599
1570
|
|
|
1600
1571
|
.curve-p.interactive:hover,
|
|
@@ -1614,8 +1585,8 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1614
1585
|
transform: translateY(0);
|
|
1615
1586
|
}
|
|
1616
1587
|
|
|
1617
|
-
|
|
1618
|
-
|
|
1588
|
+
.curve-p.interactive:focus-visible,
|
|
1589
|
+
.curve-n.interactive:focus-visible {
|
|
1619
1590
|
filter: url("#shadow-8");
|
|
1620
1591
|
|
|
1621
1592
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -1624,9 +1595,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1624
1595
|
|
|
1625
1596
|
.point.interactive {
|
|
1626
1597
|
cursor: nesw-resize;
|
|
1598
|
+
outline: none;
|
|
1627
1599
|
|
|
1628
1600
|
filter: url("#shadow-2");
|
|
1629
|
-
outline: none;
|
|
1630
1601
|
|
|
1631
1602
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
1632
1603
|
stroke: #000000;
|
|
@@ -1648,7 +1619,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1648
1619
|
stroke: #00ff00;
|
|
1649
1620
|
}
|
|
1650
1621
|
|
|
1651
|
-
|
|
1622
|
+
.point.interactive:focus-visible {
|
|
1652
1623
|
filter: url("#shadow-8");
|
|
1653
1624
|
|
|
1654
1625
|
/* HACK: This gets Safari to correctly apply the filter! */
|
|
@@ -1688,8 +1659,8 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1688
1659
|
|
|
1689
1660
|
.diagonal {
|
|
1690
1661
|
stroke: var(---color-element-border);
|
|
1691
|
-
stroke-dasharray: 4;
|
|
1692
1662
|
stroke-width: 1;
|
|
1663
|
+
stroke-dasharray: 4;
|
|
1693
1664
|
}
|
|
1694
1665
|
|
|
1695
1666
|
.curve-p,
|
|
@@ -1723,8 +1694,8 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1723
1694
|
font-size: 0.75rem;
|
|
1724
1695
|
|
|
1725
1696
|
dominant-baseline: middle;
|
|
1726
|
-
text-anchor: middle;
|
|
1727
1697
|
|
|
1698
|
+
text-anchor: middle;
|
|
1728
1699
|
fill: var(---color-text-inverse);
|
|
1729
1700
|
}
|
|
1730
1701
|
|
|
@@ -1736,11 +1707,11 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1736
1707
|
|
|
1737
1708
|
@media (pointer: coarse) {
|
|
1738
1709
|
.interactive .touch {
|
|
1739
|
-
stroke-linecap: round;
|
|
1740
1710
|
stroke-width: 12;
|
|
1711
|
+
stroke-linecap: round;
|
|
1741
1712
|
}
|
|
1742
1713
|
}
|
|
1743
|
-
`]}render(){return M``}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=2*this.rem,i=3*this.rem,U=3*this.rem,g=Q-(F+i),e=Q-(U+2*this.rem),I=parseInt(this.getComputedStyleValue("---transition-duration"),10),l=20,c=AI().domain([-20,l]).range([0,e]);this.xScale=c;const n=AI().domain([l,-20]).range([0,g]);this.yScale=n;const a=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.xal2v(this.xScale.invert(t.x),B.a,B.l))})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=sb.xlv2a(s,B.l,Q);B.a=Number.isNaN(F)||F<sb.a.MIN||F>sb.a.MAX||s<0||Q<0?s>Q?sb.a.MIN:sb.a.MAX:F,"default"===B.name&&(this.a=B.a),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),d=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.xal2v(this.xScale.invert(t.x),B.a,B.l))})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=sb.xav2l(s,B.a,Q);B.l=Number.isNaN(F)||F<sb.l.MIN||F>sb.l.MAX||s>0||Q>0?s>Q?sb.l.MAX:sb.l.MIN:F,"default"===B.name&&(this.l=B.l),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),o=tQ().subject((t,B)=>({x:this.xScale(B.x),y:this.yScale(B.v)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x);B.x=s<-20?-20:s>l?l:s,"default"===B.name&&(this.x=B.x),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:{name:B.name,x:B.x,v:B.v,label:B.label,a:this.getFunction(B.function).a,l:this.getFunction(B.function).l},bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),b=bd().x(t=>c(t.x)).y(t=>n(t.v)),C=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),r=C.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),u=r.merge(C).attr("viewBox",`0 0 ${Q} ${Q}`),h=r.append("g").classed("plot",!0),x=u.select(".plot").attr("transform",`translate(${U}, ${F})`);h.append("clipPath").attr("id","clip-cpt-value").append("rect"),x.select("clipPath rect").attr("height",g+1).attr("width",e+1);const G=h.append("g").classed("underlayer",!0),y=x.select(".underlayer");G.append("rect").classed("background",!0),y.select(".background").attr("height",g).attr("width",e),G.append("g").classed("scale-x",!0);y.select(".scale-x").attr("transform",`translate(0, ${n(-20)})`).transition().duration(2*I).ease(Wi).call(yB(c)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null),G.append("line").classed("axis-x",!0),y.select(".axis-x").transition().duration(I).ease(Wi).attr("x1",c(-20)).attr("x2",c(l)).attr("y1",n(0)).attr("y2",n(0));const A=G.append("text").classed("title-x",!0).attr("text-anchor","middle");A.append("tspan").classed("name",!0).text("Objective Value ("),A.append("tspan").classed("math-var x",!0).text("x"),A.append("tspan").classed("name",!0).text(")"),y.select(".title-x").attr("transform",`translate(${e/2}, ${g+2.25*this.rem})`),G.append("g").classed("scale-y",!0);y.select(".scale-y").transition().duration(2*I).ease(Wi).call(AB(n)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null),G.append("line").classed("axis-y",!0),y.select(".axis-y").transition().duration(I).ease(Wi).attr("x1",c(0)).attr("x2",c(0)).attr("y1",n(l)).attr("y2",n(-20));const L=G.append("text").classed("title-y",!0).attr("text-anchor","middle");L.append("tspan").classed("name",!0).text("Subjective Value ("),L.append("tspan").classed("math-var v",!0).text("v"),L.append("tspan").classed("name",!0).text(")"),y.select(".title-y").attr("transform",`translate(${-2*this.rem}, ${g/2})rotate(-90)`),G.append("line").classed("diagonal",!0),y.select(".diagonal").transition().duration(2*I).ease(Wi).attr("x1",c(-20)).attr("y1",n(-20)).attr("x2",c(l)).attr("y2",n(l)),h.append("g").classed("content",!0);const R=x.select(".content"),m=R.selectAll(".lines").data(this.values.filter(t=>null!=t.x),t=>t.name),V=m.enter().append("g").classed("lines",!0);V.each((t,B,s)=>{const Q=Js(s[B]);Q.append("line").classed("line-x above",!0),Q.append("line").classed("line-x below",!0),Q.append("line").classed("line-v before",!0),Q.append("line").classed("line-v after",!0)}),V.filter(t=>t.new).attr("data-animating-ease-time-1",0).attr("data-animating-ease-time-2",0).each((t,B,s)=>{const Q=Js(s[B]);Q.select(".line-x.above").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(l)).attr("y2",n(l)),Q.select(".line-x.below").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(-20)).attr("y2",n(-20)),Q.select(".line-v.before").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(t.v)).attr("y2",n(t.v)),Q.select(".line-v.after").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(t.v)).attr("y2",n(t.v))});const S=V.merge(m),Z=S.filter(t=>t.new&&!t.paused);if(!Z.empty()){const t=Z.attr("data-animating-ease-time-1"),B=Z.attr("data-animating-ease-time-2"),s=B=>AI().domain([0,1]).range([t,1])(B),Q=B=>AI().range([0,1]).domain([t,1])(B),F=t=>AI().domain([0,1]).range([B,1])(t),i=t=>AI().range([0,1]).domain([B,1])(t),U=B=>s=>AI().domain([B(t),1]).range([0,1])(B(s)),g=t=>s=>AI().domain([t(B),1]).range([0,1])(t(s));Z.transition("new-1").duration(()=>Math.floor(I*(1-t))).ease(s).attr("data-animating-ease-time-1",1).tween("animating",(t,B,s)=>{const F=s[B],i=Js(F),g=mF(void 0!==F.x?F.x:t.x,t.x),e=mF(void 0!==F.a?F.a:this.getFunction(t.function).a,this.getFunction(t.function).a),I=mF(void 0!==F.l?F.l:this.getFunction(t.function).l,this.getFunction(t.function).l),a=mF(n.invert(i.select(".line-x.above").attr("y1")),t.v),d=mF(n.invert(i.select(".line-x.below").attr("y1")),t.v);return t=>{F.x=g(Wi(Q(t))),F.a=e(Wi(Q(t))),F.l=I(Wi(Q(t))),F.v=sb.xal2v(F.x,F.a,F.l),i.select(".line-x.above").attr("x1",c(F.x)).attr("x2",c(F.x)).attr("y1",n(a(U(Xi)(t)))).attr("y2",n(l)),i.select(".line-x.below").attr("x1",c(F.x)).attr("x2",c(F.x)).attr("y1",n(d(U(Xi)(t)))).attr("y2",n(-20))}}).transition("new-2").duration(()=>Math.floor(I*(1-B))).ease(F).attr("data-animating-ease-time-2",1).tween("animating",(t,B,s)=>{const Q=s[B],F=Js(Q),U=mF(void 0!==Q.x?Q.x:t.x,t.x),e=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),I=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l),a=mF(c.invert(F.select(".line-v.before").attr("x1")),-20),d=mF(c.invert(F.select(".line-v.after").attr("x1")),l);return t=>{Q.x=U(Wi(i(t))),Q.a=e(Wi(i(t))),Q.l=I(Wi(i(t))),Q.v=sb.xal2v(Q.x,Q.a,Q.l),F.select(".line-v.before").attr("x1",c(a(g(Wi)(t)))).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v)),F.select(".line-v.after").attr("x1",c(d(g(Wi)(t)))).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v))}}).on("end",(t,B,s)=>{const Q=s[B];Q.removeAttribute("data-animating-ease-time-1"),Q.removeAttribute("data-animating-ease-time-2"),t.new=!1,this.dispatchEvent(new CustomEvent("prospectable-response",{detail:{trial:this.trialCount,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,response:this.response},bubbles:!0}))})}const p=S.filter(t=>t.new&&t.paused);if(!p.empty()){const t=p.attr("data-animating-ease-time-1"),B=p.attr("data-animating-ease-time-2");p.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("paused",(s,Q,F)=>{const i=F[Q],U=Js(i),g=mF(void 0!==i.x?i.x:s.x,s.x),e=mF(void 0!==i.a?i.a:this.getFunction(s.function).a,this.getFunction(s.function).a),I=mF(void 0!==i.l?i.l:this.getFunction(s.function).l,this.getFunction(s.function).l),a=mF(l,s.v),d=mF(-20,s.v),o=mF(s.x,-20),b=mF(s.x,l);return s=>{i.x=g(s),i.a=e(s),i.l=I(s),i.v=sb.xal2v(i.x,i.a,i.l),U.select(".line-x.above").attr("x1",c(i.x)).attr("x2",c(i.x)).attr("y1",n(a(Xi(t)))).attr("y2",n(l)),U.select(".line-x.below").attr("x1",c(i.x)).attr("x2",c(i.x)).attr("y1",n(d(Xi(t)))).attr("y2",n(-20)),U.select(".line-v.before").attr("x1",c(o(Wi(B)))).attr("x2",c(i.x)).attr("y1",n(i.v)).attr("y2",n(i.v)),U.select(".line-v.after").attr("x1",c(b(Wi(B)))).attr("x2",c(i.x)).attr("y1",n(i.v)).attr("y2",n(i.v))}})}S.filter(t=>!t.new).transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("non-animating",(t,B,s)=>{const Q=s[B],F=Js(Q),i=mF(void 0!==Q.x?Q.x:t.x,t.x),U=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),g=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l);return t=>{Q.x=i(t),Q.a=U(t),Q.l=g(t),Q.v=sb.xal2v(Q.x,Q.a,Q.l),F.select(".line-x.above").attr("x1",c(Q.x)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(l)),F.select(".line-x.below").attr("x1",c(Q.x)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(-20)),F.select(".line-v.before").attr("x1",c(-20)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v)),F.select(".line-v.after").attr("x1",c(l)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v))}}),m.exit().remove();const E=R.selectAll(".curve-p").data(this.functions,t=>t.name),N=E.enter().append("g").classed("curve-p",!0).attr("clip-path","url(#clip-cpt-value)");N.append("path").classed("path-p",!0),N.append("path").classed("path-p touch",!0);const X=N.merge(E);(this.firstUpdate||t.has("interactive"))&&(this.interactive?X.attr("tabindex",0).classed("interactive",!0).call(a).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.a;switch(t.key){case"ArrowUp":case"ArrowLeft":s+=t.shiftKey?sb.a.STEP:sb.a.JUMP;break;case"ArrowDown":case"ArrowRight":s-=t.shiftKey?sb.a.STEP:sb.a.JUMP}s=s<sb.a.MIN?sb.a.MIN:s>sb.a.MAX?sb.a.MAX:s,s!==B.a&&(B.a=s,"default"===B.name&&(this.a=B.a),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):X.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),X.select(".path-p").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c(0),c.range()[1]+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),X.select(".path-p.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c(0),c.range()[1]+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),E.exit().remove();const W=R.selectAll(".curve-n").data(this.functions,t=>t.name),H=W.enter().append("g").classed("curve-n",!0).attr("clip-path","url(#clip-cpt-value)");H.append("path").classed("path-n",!0),H.append("path").classed("path-n touch",!0);const D=H.merge(W);(this.firstUpdate||t.has("interactive"))&&(this.interactive?D.attr("tabindex",0).classed("interactive",!0).call(d).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.l;switch(t.key){case"ArrowUp":case"ArrowLeft":s-=t.shiftKey?sb.l.STEP:sb.l.JUMP;break;case"ArrowDown":case"ArrowRight":s+=t.shiftKey?sb.l.STEP:sb.l.JUMP}s=s<sb.l.MIN?sb.l.MIN:s>sb.l.MAX?sb.l.MAX:s,s!==B.l&&(B.l=s,"default"===B.name&&(this.l=B.l),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):D.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),D.select(".path-n").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c.range()[0],c(0)+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),D.select(".path-n.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c.range()[0],c(0)+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),W.exit().remove();const f=R.selectAll(".point").data(this.values.filter(t=>null!=t.x),t=>t.name),w=f.enter().append("g").classed("point",!0);w.append("circle").classed("circle touch",!0),w.append("text").classed("label",!0);const v=w.merge(f);v.select("text").text(t=>t.label),v.filter(B=>(this.firstUpdate||t.has("interactive"))&&this.interactive&&!B.trial).attr("tabindex",0).classed("interactive",!0).call(o).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.x;switch(t.key){case"ArrowUp":case"ArrowRight":s+=t.shiftKey?.2:1;break;case"ArrowDown":case"ArrowLeft":s-=t.shiftKey?.2:1}s=s<-20?-20:s>l?l:s,s!==B.x&&(B.x=s,"default"===B.name&&(this.x=B.x),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:{name:B.name,x:B.x,v:B.v,label:B.label,a:this.getFunction(B.function).a,l:this.getFunction(B.function).l},bubbles:!0}))),t.preventDefault()}}),v.filter(B=>(this.firstUpdate||t.has("interactive"))&&!this.interactive||B.trial).attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null),v.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("transform",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.x?Q.x:t.x,t.x),i=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),U=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l);return t=>(Q.x=F(t),Q.a=i(t),Q.l=U(t),`translate(\n ${c(Q.x)},\n ${n(sb.xal2v(Q.x,Q.a,Q.l))}\n )`)}),f.exit().remove(),this.drag=!1,this.firstUpdate=!1}}customElements.define("cpt-value",BR);class sR extends(Zo(Eo)){static get properties(){return{surface:{attribute:"surface",type:Boolean,reflect:!0},point:{attribute:"point",type:String,reflect:!0},updateable:{attribute:"updateable",type:Boolean,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.firstUpdate=!0,this.surface=!0,this.points=["all","first","rest","none"],this.point="first",this.updateable=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.response="",this.label="",this.choices=[{name:"default",xw:this.xw,pw:this.pw,xs:this.xs,response:this.response,label:""}],this.range={xs:{start:5,stop:15,step:.5},xw:{start:10,stop:30,step:1},pw:{start:0,stop:1,step:.05},uDiff:{start:-20,stop:20}},this.boundary=[],this.mapXY=[],this.mapXZ=[],this.mapYZ=[],this.rotationX=0,this.rotationY=0,this.mx=0,this.my=0,this.mouseX=0,this.mouseY=0,this.alignState()}alignState(){this.choices[0].name="default",this.choices[0].xw=this.xw,this.choices[0].pw=this.pw,this.choices[0].xs=this.xs,this.choices[0].response=this.response,this.choices[0].label=this.label,this.updateable&&(this.choices.forEach(t=>{t.response=sb.xal2v(t.xw,this.a,this.l)*sb.pg2w(t.pw,this.g)+sb.xal2v(this.xl,this.a,this.l)*(1-sb.pg2w(t.pw,this.g))>sb.xal2v(t.xs,this.a,this.l)?"gamble":"sure"}),this.response=this.choices[0].response);const t=(t,B)=>{const s=sb.pg2w(t,B);return Number.isNaN(s)?t:s},B=(B,s,Q,F,i,U,g)=>sb.xal2v(B,i,U)*t(Q,g)+sb.xal2v(s,i,U)*(1-t(Q,g))-sb.xal2v(F,i,U);this.boundary=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{let Q=this.range.pw.start,F=10,i=(Q+F)/2;const U=B(s,this.xl,Q,t,this.a,this.l,this.g),g=B(s,this.xl,F,t,this.a,this.l,this.g);let e;return U>0?i=-1/0:g<0?i=1/0:nB(0,15,1).forEach(()=>{e=B(s,this.xl,i,t,this.a,this.l,this.g),e<0?Q=i:F=i,i=(Q+F)/2}),{xw:s,xs:t,pw:i}}));const s=t=>t?.pw>=this.range.pw.start&&t?.pw<=this.range.pw.stop;this.boundary=this.boundary.map((t,B,Q)=>{if(s(t))return t;const F=nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length,i=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).length,U=B%F===0?null:Q[B-1],g=B%F===F-1?null:Q[B+1],e=0===Math.trunc(B/F)?null:Q[B-F],I=Math.trunc(B/F)===i-1?null:Q[B+F],l=s(U)?1:0,c=s(g)?1:0,n=s(e)?1:0,a=l+c+n+(s(I)?1:0);if(0===a||2===a&&l+c!==1||3===a||4===a)return t;const d={pw:t.pw<this.range.pw.start?this.range.pw.start:this.range.pw.stop,xw:t.xw,xs:t.xs};let o;if(1===a)o=l?U:c?g:n?e:I;else{const t=l?U:g,B=n?e:I;o={xw:(t.xw+B.xw)/2,xs:(t.xs+B.xs)/2,pw:(t.pw+B.pw)/2}}const b=(d.pw-o.pw)/(t.pw-o.pw);return d.xw=o.xw+(t.xw-o.xw)*b,d.xs=o.xs+(t.xs-o.xs)*b,d});const Q=this.range.xw.stop;this.mapXY=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).map(s=>{const F=B(Q,this.xl,s,t,this.a,this.l,this.g);return{xw:Q,xs:t,pw:s,uDiff:F}}));const F=this.range.pw.start;this.mapXZ=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{const Q=B(s,this.xl,F,t,this.a,this.l,this.g);return{xw:s,xs:t,pw:F,uDiff:Q}}));const i=this.range.xs.stop;this.mapYZ=nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{const Q=B(s,this.xl,t,i,this.a,this.l,this.g);return{xw:s,xs:i,pw:t,uDiff:Q}}))}clear(){this.choices=[{}],this.requestUpdate()}get(t="default"){const B=this.choices.find(B=>B.name===t);return void 0===B?null:B}set(t,B,s,Q,F="default",i=""){"default"===F&&(this.xw=t,this.pw=B,this.xs=s,this.response=Q,this.label=i);const U=this.choices.find(t=>t.name===F);void 0===U?this.choices.push({name:F,xw:t,pw:B,xs:s,response:Q,label:i}):(U.xw=t,U.pw=B,U.xs=s,U.response=Q,U.label=i),this.requestUpdate()}static get styles(){return[super.styles,g`
|
|
1714
|
+
`]}render(){return M``}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=2*this.rem,i=3*this.rem,U=3*this.rem,g=Q-(F+i),e=Q-(U+2*this.rem),I=parseInt(this.getComputedStyleValue("---transition-duration"),10),l=20,c=AI().domain([-20,l]).range([0,e]);this.xScale=c;const n=AI().domain([l,-20]).range([0,g]);this.yScale=n;const a=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.xal2v(this.xScale.invert(t.x),B.a,B.l))})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=sb.xlv2a(s,B.l,Q);B.a=Number.isNaN(F)||F<sb.a.MIN||F>sb.a.MAX||s<0||Q<0?s>Q?sb.a.MIN:sb.a.MAX:F,"default"===B.name&&(this.a=B.a),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),d=tQ().subject((t,B)=>({x:t.x,y:this.yScale(sb.xal2v(this.xScale.invert(t.x),B.a,B.l))})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x),Q=this.yScale.invert(t.y),F=sb.xav2l(s,B.a,Q);B.l=Number.isNaN(F)||F<sb.l.MIN||F>sb.l.MAX||s>0||Q>0?s>Q?sb.l.MAX:sb.l.MIN:F,"default"===B.name&&(this.l=B.l),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),o=tQ().subject((t,B)=>({x:this.xScale(B.x),y:this.yScale(B.v)})).on("start",t=>{Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{this.drag=!0;const s=this.xScale.invert(t.x);B.x=s<-20?-20:s>l?l:s,"default"===B.name&&(this.x=B.x),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:{name:B.name,x:B.x,v:B.v,label:B.label,a:this.getFunction(B.function).a,l:this.getFunction(B.function).l},bubbles:!0}))}).on("end",t=>{Js(t.currentTarget).classed("dragging",!1)}),b=bd().x(t=>c(t.x)).y(t=>n(t.v)),C=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),r=C.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),u=r.merge(C).attr("viewBox",`0 0 ${Q} ${Q}`),h=r.append("g").classed("plot",!0),x=u.select(".plot").attr("transform",`translate(${U}, ${F})`);h.append("clipPath").attr("id","clip-cpt-value").append("rect"),x.select("clipPath rect").attr("height",g+1).attr("width",e+1);const G=h.append("g").classed("underlayer",!0),y=x.select(".underlayer");G.append("rect").classed("background",!0),y.select(".background").attr("height",g).attr("width",e),G.append("g").classed("scale-x",!0);y.select(".scale-x").attr("transform",`translate(0, ${n(-20)})`).transition().duration(2*I).ease(Wi).call(yB(c)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null),G.append("line").classed("axis-x",!0),y.select(".axis-x").transition().duration(I).ease(Wi).attr("x1",c(-20)).attr("x2",c(l)).attr("y1",n(0)).attr("y2",n(0));const A=G.append("text").classed("title-x",!0).attr("text-anchor","middle");A.append("tspan").classed("name",!0).text("Objective Value ("),A.append("tspan").classed("math-var x",!0).text("x"),A.append("tspan").classed("name",!0).text(")"),y.select(".title-x").attr("transform",`translate(${e/2}, ${g+2.25*this.rem})`),G.append("g").classed("scale-y",!0);y.select(".scale-y").transition().duration(2*I).ease(Wi).call(AB(n)).attr("font-size",null).attr("font-family",null).selectAll("line, path").attr("stroke",null),G.append("line").classed("axis-y",!0),y.select(".axis-y").transition().duration(I).ease(Wi).attr("x1",c(0)).attr("x2",c(0)).attr("y1",n(l)).attr("y2",n(-20));const L=G.append("text").classed("title-y",!0).attr("text-anchor","middle");L.append("tspan").classed("name",!0).text("Subjective Value ("),L.append("tspan").classed("math-var v",!0).text("v"),L.append("tspan").classed("name",!0).text(")"),y.select(".title-y").attr("transform",`translate(${-2*this.rem}, ${g/2})rotate(-90)`),G.append("line").classed("diagonal",!0),y.select(".diagonal").transition().duration(2*I).ease(Wi).attr("x1",c(-20)).attr("y1",n(-20)).attr("x2",c(l)).attr("y2",n(l)),h.append("g").classed("content",!0);const R=x.select(".content"),m=R.selectAll(".lines").data(this.values.filter(t=>null!=t.x),t=>t.name),V=m.enter().append("g").classed("lines",!0);V.each((t,B,s)=>{const Q=Js(s[B]);Q.append("line").classed("line-x above",!0),Q.append("line").classed("line-x below",!0),Q.append("line").classed("line-v before",!0),Q.append("line").classed("line-v after",!0)}),V.filter(t=>t.new).attr("data-animating-ease-time-1",0).attr("data-animating-ease-time-2",0).each((t,B,s)=>{const Q=Js(s[B]);Q.select(".line-x.above").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(l)).attr("y2",n(l)),Q.select(".line-x.below").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(-20)).attr("y2",n(-20)),Q.select(".line-v.before").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(t.v)).attr("y2",n(t.v)),Q.select(".line-v.after").attr("x1",c(t.x)).attr("x2",c(t.x)).attr("y1",n(t.v)).attr("y2",n(t.v))});const S=V.merge(m),Z=S.filter(t=>t.new&&!t.paused);if(!Z.empty()){const t=Z.attr("data-animating-ease-time-1"),B=Z.attr("data-animating-ease-time-2"),s=B=>AI().domain([0,1]).range([t,1])(B),Q=B=>AI().range([0,1]).domain([t,1])(B),F=t=>AI().domain([0,1]).range([B,1])(t),i=t=>AI().range([0,1]).domain([B,1])(t),U=B=>s=>AI().domain([B(t),1]).range([0,1])(B(s)),g=t=>s=>AI().domain([t(B),1]).range([0,1])(t(s));Z.transition("new-1").duration(()=>Math.floor(I*(1-t))).ease(s).attr("data-animating-ease-time-1",1).tween("animating",(t,B,s)=>{const F=s[B],i=Js(F),g=mF(void 0!==F.x?F.x:t.x,t.x),e=mF(void 0!==F.a?F.a:this.getFunction(t.function).a,this.getFunction(t.function).a),I=mF(void 0!==F.l?F.l:this.getFunction(t.function).l,this.getFunction(t.function).l),a=mF(n.invert(i.select(".line-x.above").attr("y1")),t.v),d=mF(n.invert(i.select(".line-x.below").attr("y1")),t.v);return t=>{F.x=g(Wi(Q(t))),F.a=e(Wi(Q(t))),F.l=I(Wi(Q(t))),F.v=sb.xal2v(F.x,F.a,F.l),i.select(".line-x.above").attr("x1",c(F.x)).attr("x2",c(F.x)).attr("y1",n(a(U(Xi)(t)))).attr("y2",n(l)),i.select(".line-x.below").attr("x1",c(F.x)).attr("x2",c(F.x)).attr("y1",n(d(U(Xi)(t)))).attr("y2",n(-20))}}).transition("new-2").duration(()=>Math.floor(I*(1-B))).ease(F).attr("data-animating-ease-time-2",1).tween("animating",(t,B,s)=>{const Q=s[B],F=Js(Q),U=mF(void 0!==Q.x?Q.x:t.x,t.x),e=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),I=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l),a=mF(c.invert(F.select(".line-v.before").attr("x1")),-20),d=mF(c.invert(F.select(".line-v.after").attr("x1")),l);return t=>{Q.x=U(Wi(i(t))),Q.a=e(Wi(i(t))),Q.l=I(Wi(i(t))),Q.v=sb.xal2v(Q.x,Q.a,Q.l),F.select(".line-v.before").attr("x1",c(a(g(Wi)(t)))).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v)),F.select(".line-v.after").attr("x1",c(d(g(Wi)(t)))).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v))}}).on("end",(t,B,s)=>{const Q=s[B];Q.removeAttribute("data-animating-ease-time-1"),Q.removeAttribute("data-animating-ease-time-2"),t.new=!1,this.dispatchEvent(new CustomEvent("prospectable-response",{detail:{trial:this.trialCount,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,response:this.response},bubbles:!0}))})}const p=S.filter(t=>t.new&&t.paused);if(!p.empty()){const t=p.attr("data-animating-ease-time-1"),B=p.attr("data-animating-ease-time-2");p.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("paused",(s,Q,F)=>{const i=F[Q],U=Js(i),g=mF(void 0!==i.x?i.x:s.x,s.x),e=mF(void 0!==i.a?i.a:this.getFunction(s.function).a,this.getFunction(s.function).a),I=mF(void 0!==i.l?i.l:this.getFunction(s.function).l,this.getFunction(s.function).l),a=mF(l,s.v),d=mF(-20,s.v),o=mF(s.x,-20),b=mF(s.x,l);return s=>{i.x=g(s),i.a=e(s),i.l=I(s),i.v=sb.xal2v(i.x,i.a,i.l),U.select(".line-x.above").attr("x1",c(i.x)).attr("x2",c(i.x)).attr("y1",n(a(Xi(t)))).attr("y2",n(l)),U.select(".line-x.below").attr("x1",c(i.x)).attr("x2",c(i.x)).attr("y1",n(d(Xi(t)))).attr("y2",n(-20)),U.select(".line-v.before").attr("x1",c(o(Wi(B)))).attr("x2",c(i.x)).attr("y1",n(i.v)).attr("y2",n(i.v)),U.select(".line-v.after").attr("x1",c(b(Wi(B)))).attr("x2",c(i.x)).attr("y1",n(i.v)).attr("y2",n(i.v))}})}S.filter(t=>!t.new).transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).tween("non-animating",(t,B,s)=>{const Q=s[B],F=Js(Q),i=mF(void 0!==Q.x?Q.x:t.x,t.x),U=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),g=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l);return t=>{Q.x=i(t),Q.a=U(t),Q.l=g(t),Q.v=sb.xal2v(Q.x,Q.a,Q.l),F.select(".line-x.above").attr("x1",c(Q.x)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(l)),F.select(".line-x.below").attr("x1",c(Q.x)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(-20)),F.select(".line-v.before").attr("x1",c(-20)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v)),F.select(".line-v.after").attr("x1",c(l)).attr("x2",c(Q.x)).attr("y1",n(Q.v)).attr("y2",n(Q.v))}}),m.exit().remove();const E=R.selectAll(".curve-p").data(this.functions,t=>t.name),N=E.enter().append("g").classed("curve-p",!0).attr("clip-path","url(#clip-cpt-value)");N.append("path").classed("path-p",!0),N.append("path").classed("path-p touch",!0);const X=N.merge(E);(this.firstUpdate||t.has("interactive"))&&(this.interactive?X.attr("tabindex",0).classed("interactive",!0).call(a).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.a;switch(t.key){case"ArrowUp":case"ArrowLeft":s+=t.shiftKey?sb.a.STEP:sb.a.JUMP;break;case"ArrowDown":case"ArrowRight":s-=t.shiftKey?sb.a.STEP:sb.a.JUMP}s=s<sb.a.MIN?sb.a.MIN:s>sb.a.MAX?sb.a.MAX:s,s!==B.a&&(B.a=s,"default"===B.name&&(this.a=B.a),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):X.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),X.select(".path-p").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c(0),c.range()[1]+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),X.select(".path-p.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c(0),c.range()[1]+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),E.exit().remove();const W=R.selectAll(".curve-n").data(this.functions,t=>t.name),H=W.enter().append("g").classed("curve-n",!0).attr("clip-path","url(#clip-cpt-value)");H.append("path").classed("path-n",!0),H.append("path").classed("path-n touch",!0);const D=H.merge(W);(this.firstUpdate||t.has("interactive"))&&(this.interactive?D.attr("tabindex",0).classed("interactive",!0).call(d).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.l;switch(t.key){case"ArrowUp":case"ArrowLeft":s-=t.shiftKey?sb.l.STEP:sb.l.JUMP;break;case"ArrowDown":case"ArrowRight":s+=t.shiftKey?sb.l.STEP:sb.l.JUMP}s=s<sb.l.MIN?sb.l.MIN:s>sb.l.MAX?sb.l.MAX:s,s!==B.l&&(B.l=s,"default"===B.name&&(this.l=B.l),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:this.get(B.name),bubbles:!0}))),t.preventDefault()}}):D.attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null)),D.select(".path-n").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c.range()[0],c(0)+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),D.select(".path-n.touch").transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("d",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.a?Q.a:t.a,t.a),i=mF(void 0!==Q.l?Q.l:t.l,t.l);return t=>{Q.a=F(t),Q.l=i(t);const B=nB(c.range()[0],c(0)+1,1).map(t=>({x:c.invert(t),v:sb.xal2v(c.invert(t),Q.a,Q.l)}));return b(B)}}),W.exit().remove();const f=R.selectAll(".point").data(this.values.filter(t=>null!=t.x),t=>t.name),w=f.enter().append("g").classed("point",!0);w.append("circle").classed("circle touch",!0),w.append("text").classed("label",!0);const v=w.merge(f);v.select("text").text(t=>t.label),v.filter(B=>(this.firstUpdate||t.has("interactive"))&&this.interactive&&!B.trial).attr("tabindex",0).classed("interactive",!0).call(o).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key)){let s=B.x;switch(t.key){case"ArrowUp":case"ArrowRight":s+=t.shiftKey?.2:1;break;case"ArrowDown":case"ArrowLeft":s-=t.shiftKey?.2:1}s=s<-20?-20:s>l?l:s,s!==B.x&&(B.x=s,"default"===B.name&&(this.x=B.x),this.alignState(),this.requestUpdate(),this.dispatchEvent(new CustomEvent("cpt-value-change",{detail:{name:B.name,x:B.x,v:B.v,label:B.label,a:this.getFunction(B.function).a,l:this.getFunction(B.function).l},bubbles:!0}))),t.preventDefault()}}),v.filter(B=>(this.firstUpdate||t.has("interactive"))&&!this.interactive||B.trial).attr("tabindex",null).classed("interactive",!1).on("drag",null).on("keydown",null),v.transition().duration(this.drag?0:this.firstUpdate?2*I:I).ease(Wi).attrTween("transform",(t,B,s)=>{const Q=s[B],F=mF(void 0!==Q.x?Q.x:t.x,t.x),i=mF(void 0!==Q.a?Q.a:this.getFunction(t.function).a,this.getFunction(t.function).a),U=mF(void 0!==Q.l?Q.l:this.getFunction(t.function).l,this.getFunction(t.function).l);return t=>(Q.x=F(t),Q.a=i(t),Q.l=U(t),`translate(\n ${c(Q.x)},\n ${n(sb.xal2v(Q.x,Q.a,Q.l))}\n )`)}),f.exit().remove(),this.drag=!1,this.firstUpdate=!1}}customElements.define("cpt-value",vL);class YL extends(Zo(Eo)){static get properties(){return{surface:{attribute:"surface",type:Boolean,reflect:!0},point:{attribute:"point",type:String,reflect:!0},updateable:{attribute:"updateable",type:Boolean,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.firstUpdate=!0,this.surface=!0,this.points=["all","first","rest","none"],this.point="first",this.updateable=!1,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.response="",this.label="",this.choices=[{name:"default",xw:this.xw,pw:this.pw,xs:this.xs,response:this.response,label:""}],this.range={xs:{start:5,stop:15,step:.5},xw:{start:10,stop:30,step:1},pw:{start:0,stop:1,step:.05},uDiff:{start:-20,stop:20}},this.boundary=[],this.mapXY=[],this.mapXZ=[],this.mapYZ=[],this.rotationX=0,this.rotationY=0,this.mx=0,this.my=0,this.mouseX=0,this.mouseY=0,this.alignState()}alignState(){this.choices[0].name="default",this.choices[0].xw=this.xw,this.choices[0].pw=this.pw,this.choices[0].xs=this.xs,this.choices[0].response=this.response,this.choices[0].label=this.label,this.updateable&&(this.choices.forEach(t=>{t.response=sb.xal2v(t.xw,this.a,this.l)*sb.pg2w(t.pw,this.g)+sb.xal2v(this.xl,this.a,this.l)*(1-sb.pg2w(t.pw,this.g))>sb.xal2v(t.xs,this.a,this.l)?"gamble":"sure"}),this.response=this.choices[0].response);const t=(t,B)=>{const s=sb.pg2w(t,B);return Number.isNaN(s)?t:s},B=(B,s,Q,F,i,U,g)=>sb.xal2v(B,i,U)*t(Q,g)+sb.xal2v(s,i,U)*(1-t(Q,g))-sb.xal2v(F,i,U);this.boundary=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{let Q=this.range.pw.start,F=10,i=(Q+F)/2;const U=B(s,this.xl,Q,t,this.a,this.l,this.g),g=B(s,this.xl,F,t,this.a,this.l,this.g);let e;return U>0?i=-1/0:g<0?i=1/0:nB(0,15,1).forEach(()=>{e=B(s,this.xl,i,t,this.a,this.l,this.g),e<0?Q=i:F=i,i=(Q+F)/2}),{xw:s,xs:t,pw:i}}));const s=t=>t?.pw>=this.range.pw.start&&t?.pw<=this.range.pw.stop;this.boundary=this.boundary.map((t,B,Q)=>{if(s(t))return t;const F=nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length,i=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).length,U=B%F===0?null:Q[B-1],g=B%F===F-1?null:Q[B+1],e=0===Math.trunc(B/F)?null:Q[B-F],I=Math.trunc(B/F)===i-1?null:Q[B+F],l=s(U)?1:0,c=s(g)?1:0,n=s(e)?1:0,a=l+c+n+(s(I)?1:0);if(0===a||2===a&&l+c!==1||3===a||4===a)return t;const d={pw:t.pw<this.range.pw.start?this.range.pw.start:this.range.pw.stop,xw:t.xw,xs:t.xs};let o;if(1===a)o=l?U:c?g:n?e:I;else{const t=l?U:g,B=n?e:I;o={xw:(t.xw+B.xw)/2,xs:(t.xs+B.xs)/2,pw:(t.pw+B.pw)/2}}const b=(d.pw-o.pw)/(t.pw-o.pw);return d.xw=o.xw+(t.xw-o.xw)*b,d.xs=o.xs+(t.xs-o.xs)*b,d});const Q=this.range.xw.stop;this.mapXY=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).map(s=>{const F=B(Q,this.xl,s,t,this.a,this.l,this.g);return{xw:Q,xs:t,pw:s,uDiff:F}}));const F=this.range.pw.start;this.mapXZ=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{const Q=B(s,this.xl,F,t,this.a,this.l,this.g);return{xw:s,xs:t,pw:F,uDiff:Q}}));const i=this.range.xs.stop;this.mapYZ=nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).flatMap(t=>nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).map(s=>{const Q=B(s,this.xl,t,i,this.a,this.l,this.g);return{xw:s,xs:i,pw:t,uDiff:Q}}))}clear(){this.choices=[{}],this.requestUpdate()}get(t="default"){const B=this.choices.find(B=>B.name===t);return void 0===B?null:B}set(t,B,s,Q,F="default",i=""){"default"===F&&(this.xw=t,this.pw=B,this.xs=s,this.response=Q,this.label=i);const U=this.choices.find(t=>t.name===F);void 0===U?this.choices.push({name:F,xw:t,pw:B,xs:s,response:Q,label:i}):(U.xw=t,U.pw=B,U.xs=s,U.response=Q,U.label=i),this.requestUpdate()}static get styles(){return[super.styles,g`
|
|
1744
1715
|
:host {
|
|
1745
1716
|
display: inline-block;
|
|
1746
1717
|
|
|
@@ -1774,6 +1745,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1774
1745
|
font-weight: 600;
|
|
1775
1746
|
|
|
1776
1747
|
alignment-baseline: middle;
|
|
1748
|
+
|
|
1777
1749
|
text-anchor: middle;
|
|
1778
1750
|
}
|
|
1779
1751
|
|
|
@@ -1797,6 +1769,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1797
1769
|
font-size: 0.75rem;
|
|
1798
1770
|
|
|
1799
1771
|
alignment-baseline: middle;
|
|
1772
|
+
|
|
1800
1773
|
text-anchor: end;
|
|
1801
1774
|
}
|
|
1802
1775
|
|
|
@@ -1837,6 +1810,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1837
1810
|
font-weight: 600;
|
|
1838
1811
|
|
|
1839
1812
|
alignment-baseline: middle;
|
|
1813
|
+
|
|
1840
1814
|
text-anchor: middle;
|
|
1841
1815
|
}
|
|
1842
1816
|
|
|
@@ -1847,7 +1821,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1847
1821
|
stroke: none;
|
|
1848
1822
|
}
|
|
1849
1823
|
`]}render(){return M`
|
|
1850
|
-
`}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F={top:3*this.rem,bottom:5*this.rem,left:2*this.rem,right:6*this.rem},i=Q-(F.top+F.bottom),U=Q-(F.left+F.right),g=AI().domain([this.range.xs.start,this.range.xs.stop]).range([0,U]),e=AI().domain([this.range.pw.start,this.range.pw.stop]).range([0,-i]),I=AI().domain([this.range.xw.start,this.range.xw.stop]).range([0,-i]),l=PL(this.getComputedStyleValue("---color-element-background")).hex(),c=this.getComputedStyleValue("---color-better-dark"),n=this.getComputedStyleValue("---color-better"),a=this.getComputedStyleValue("---color-nr"),d=this.getComputedStyleValue("---color-worse"),o=this.getComputedStyleValue("---color-worse-dark"),b=cn().domain([this.range.uDiff.start,0,this.range.uDiff.stop]).clamp(!0).interpolator(vF([c,n,a,d,o])),C=AI().domain([this.range.uDiff.start,this.range.uDiff.stop]).range([0,-s+4*this.rem]),r={x:F.left,y:Q-F.bottom},u={x:g((this.range.xs.start+this.range.xs.stop)/2),y:e((this.range.pw.start+this.range.pw.stop)/2),z:I((this.range.xw.start+this.range.xw.stop)/2)},h=-.85*Math.PI/8,x=3*Math.PI/8,G=RL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),y=hL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),A=yL().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(0),L=tQ().on("start",t=>{this.mx=t.x,this.my=t.y}).on("drag",t=>{this.rotationY=(t.x-this.mx+this.mouseX)*(Math.PI/230),this.rotationX=(t.y-this.my+this.mouseY)*(Math.PI/230)*-1,this.requestUpdate()}).on("end",t=>{this.mouseX=t.x-this.mx+this.mouseX,this.mouseY=t.y-this.my+this.mouseY}),R=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),m=R.enter().append("svg").classed("main",!0).call(L),V=m.merge(R).attr("viewBox",`0 0 ${Q} ${Q}`),S=m.append("defs").append("linearGradient").attr("id","gradient-legend").attr("x1",0).attr("x2",0).attr("y1",1).attr("y2",0);S.append("stop").attr("offset","0%").attr("stop-color",c),S.append("stop").attr("offset","25%").attr("stop-color",n),S.append("stop").attr("offset","50%").attr("stop-color",a),S.append("stop").attr("offset","75%").attr("stop-color",d),S.append("stop").attr("offset","100%").attr("stop-color",o);const Z=[[{title:'Sure Value (<tspan class="math-var">x<tspan class="subscript">sure</tspan></tspan>)',id:"max",x:g.range()[1]},{id:"min",x:g.range()[0]}]],p=[[{title:'Win Probability (<tspan class="math-var">p<tspan class="subscript">win</tspan></tspan>)',id:"max",y:e.range()[1]},{id:"min",y:e.range()[0]}]],E=[[{title:'Win Value (<tspan class="math-var">x<tspan class="subscript">win</tspan></tspan>)',id:"max",z:I.range()[1]},{id:"min",z:I.range()[0]}]],N=V.selectAll(".axis-x").data(G.x(t=>t.x).y(()=>e.range()[0]).z(()=>I.range()[0])(Z)),X=V.selectAll(".axis-y").data(G.x(()=>g.range()[0]).y(t=>t.y).z(()=>I.range()[1])(p)),W=V.selectAll(".axis-z").data(G.x(()=>g.range()[0]).y(()=>e.range()[0]).z(t=>t.z)(E)),H=N.enter().append("path").attr("class","d3-3d axis axis-x"),D=X.enter().append("path").attr("class","d3-3d axis axis-y"),f=W.enter().append("path").attr("class","d3-3d axis axis-z"),w=H.merge(N).attr("d",G.draw),v=D.merge(X).attr("d",G.draw),Y=f.merge(W).attr("d",G.draw);w.exit().remove(),v.exit().remove(),Y.exit().remove();const J=V.selectAll(".title-path-x").data(G.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem)(Z)),k=V.selectAll(".title-path-y").data(G.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem)(p)),M=V.selectAll(".title-path-z").data(G.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem)(E)),T=V.selectAll(".title-x").data(Z,t=>t[0].title),z=V.selectAll(".title-y").data(p,t=>t[0].title),K=V.selectAll(".title-z").data(E,t=>t[0].title),O=J.enter().append("path").attr("class","d3-3d title-path title-path-x").attr("id","title-x"),P=k.enter().append("path").attr("class","d3-3d title-path title-path-y").attr("id","title-y"),j=M.enter().append("path").attr("class","d3-3d title-path title-path-z").attr("id","title-z"),_=T.enter().append("text").attr("class","d3-3d title title-x");_.append("textPath").attr("href","#title-x").attr("startOffset","50%");const $=z.enter().append("text").attr("class","d3-3d title title-y");$.append("textPath").attr("href","#title-y").attr("startOffset","50%");const q=K.enter().append("text").attr("class","d3-3d title title-z");q.append("textPath").attr("href","#title-z").attr("startOffset","50%");const tt=O.merge(J).attr("d",G.draw),Bt=P.merge(k).attr("d",G.draw),st=j.merge(M).attr("d",G.draw),Qt=_.merge(T).select("textPath").html(t=>t[0].title),Ft=$.merge(z).select("textPath").html(t=>t[0].title),it=q.merge(K).select("textPath").html(t=>t[0].title);tt.exit().remove(),Bt.exit().remove(),st.exit().remove(),Qt.exit().remove(),Ft.exit().remove(),it.exit().remove();const Ut=g.ticks(5).map(t=>[{id:"min",label:g.tickFormat()(t),x:g(t)},{id:"max",x:g(t)}]),gt=e.ticks(5).map(t=>[{id:"min",label:e.tickFormat()(t),y:e(t)},{id:"max",y:e(t)}]),et=I.ticks(5).map(t=>[{id:"max",label:I.tickFormat()(t),z:I(t)},{id:"min",z:I(t)}]),It=V.selectAll(".tick-x").data(G.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>"min"===t.id?I.range()[0]:I.range()[0]+.35*this.rem)(Ut)),lt=V.selectAll(".tick-y").data(G.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]:I.range()[1]-.35*this.rem)(gt)),ct=V.selectAll(".tick-z").data(G.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>t.z)(et)),nt=It.enter().append("path").attr("class","d3-3d tick tick-x"),at=lt.enter().append("path").attr("class","d3-3d tick tick-y"),dt=ct.enter().append("path").attr("class","d3-3d tick tick-z"),ot=nt.merge(It).attr("d",G.draw),bt=at.merge(lt).attr("d",G.draw),Ct=dt.merge(ct).attr("d",G.draw);ot.exit().remove(),bt.exit().remove(),Ct.exit().remove();const rt=V.selectAll(".label-path-x").data(G.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem)(Ut),t=>t[0].label),ut=V.selectAll(".label-path-y").data(G.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem)(gt),t=>t[0].label),ht=V.selectAll(".label-path-z").data(G.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z)(et),t=>t[0].label),xt=V.selectAll(".label-x").data(Ut,t=>t[0].label),Gt=V.selectAll(".label-y").data(gt,t=>t[0].label),yt=V.selectAll(".label-z").data(et,t=>t[0].label),At=rt.enter().append("path").attr("class","d3-3d label-path label-path-x").attr("id",(t,B)=>`label-x-${B}`),Lt=ut.enter().append("path").attr("class","d3-3d label-path label-path-y").attr("id",(t,B)=>`label-y-${B}`),Rt=ht.enter().append("path").attr("class","d3-3d label-path label-path-z").attr("id",(t,B)=>`label-z-${B}`),mt=xt.enter().append("text").attr("class","d3-3d label label-x");mt.append("textPath").attr("href",(t,B)=>`#label-x-${B}`).attr("startOffset","0%");const Vt=Gt.enter().append("text").attr("class","d3-3d label label-y");Vt.append("textPath").attr("href",(t,B)=>`#label-y-${B}`).attr("startOffset","100%");const St=yt.enter().append("text").attr("class","d3-3d label label-z");St.append("textPath").attr("href",(t,B)=>`#label-z-${B}`).attr("startOffset","100%");const Zt=At.merge(rt).attr("d",G.draw),pt=Lt.merge(ut).attr("d",G.draw),Et=Rt.merge(ht).attr("d",G.draw),Nt=mt.merge(xt).select("textPath").text(t=>t[0].label),Xt=Vt.merge(Gt).select("textPath").text(t=>t[0].label),Wt=St.merge(yt).select("textPath").text(t=>t[0].label);Zt.exit().remove(),pt.exit().remove(),Et.exit().remove(),Nt.exit().remove(),Xt.exit().remove(),Wt.exit().remove();const Ht=V.selectAll(".point").data(y.x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw))(this.choices.slice("rest"===this.point?1:0,"first"===this.point?1:void 0)),t=>t.name);function Dt(t,B){return{x:B.x-t.x,y:B.y-t.y,z:B.z-t.z}}function ft(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function wt(t,B,s){return function(t,B){return{x:t.y*B.z-t.z*B.y,y:t.z*B.x-t.x*B.z,z:t.x*B.y-t.y*B.x}}(Dt(t,B),Dt(t,s))}function vt(t,B){return function(t,B){return t.x*B.x+t.y*B.y+t.z*B.z}(t,B)/(ft(t)*ft(B))}Ht.enter().append("circle").attr("class","d3-3d point").merge(Ht).attr("class",t=>`d3-3d point ${t.response}`).attr("cx",t=>t.projected.x).attr("cy",t=>t.projected.y),Ht.exit().remove();const Yt={x:-.5,y:1,z:-1},Jt=V.selectAll(".boundary").data(this.surface?A.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw))(this.boundary).filter(t=>t[0].pw>=this.range.pw.start&&t[0].pw<=this.range.pw.stop&&t[1].pw>=this.range.pw.start&&t[1].pw<=this.range.pw.stop&&t[2].pw>=this.range.pw.start&&t[2].pw<=this.range.pw.stop&&t[3].pw>=this.range.pw.start&&t[3].pw<=this.range.pw.stop):[]);Jt.enter().append("path").attr("class","d3-3d boundary").merge(Jt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(l).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Jt.exit().remove();const kt=V.selectAll(".map-xy").data(A.rows(nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw))(this.mapXY)),Mt=V.selectAll(".map-xz").data(A.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw))(this.mapXZ)),Tt=V.selectAll(".map-yz").data(A.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw))(this.mapYZ)),zt=kt.enter().append("path").attr("class","d3-3d map map-xy"),Kt=Mt.enter().append("path").attr("class","d3-3d map map-xz"),Ot=Tt.enter().append("path").attr("class","d3-3d map map-yz");zt.merge(kt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Kt.merge(Mt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Ot.merge(Tt).attr("d",A.draw).each(t=>{const B=t.ccw?wt(t[0].rotated,t[1].rotated,t[2].rotated):wt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=vt(B,Yt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),kt.exit().remove(),Mt.exit().remove(),Tt.exit().remove(),Js(this.renderRoot).selectAll(".d3-3d").sort(y.sort);const Pt=V.selectAll(".legend").data([{x:Q+2*this.rem,y:Q-2*this.rem,rem:this.rem}]),jt=Pt.enter().append("g").attr("class","legend"),_t=jt.merge(Pt).attr("transform",t=>`translate(${t.x} ${t.y})`);Pt.exit().remove(),jt.append("g").attr("class","axis axis-legend"),_t.select(".axis-legend").call(AB(C).ticks(7)).attr("font-size",null).attr("font-family",null),jt.append("text").attr("class","title title-legend").html('Difference in Utility (<tspan class="math-var">U<tspan class="subscript">gamble</tspan></tspan> − <tspan class="math-var">U<tspan class="subscript">sure</tspan></tspan>)'),_t.select(".title-legend").attr("transform",`translate(${2.5*-this.rem},${(C(this.range.uDiff.start)+C(this.range.uDiff.stop))/2})rotate(-90)`),jt.append("rect").attr("class","bar bar-legend").attr("fill",'url("#gradient-legend")'),_t.select(".bar-legend").attr("x",0).attr("y",C(this.range.uDiff.stop)).attr("width",this.rem).attr("height",C(this.range.uDiff.start)-C(this.range.uDiff.stop)),this.firstUpdate=!1}}customElements.define("decision-space",sR);class QR extends Eo{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},run:{attribute:"run",type:Boolean,reflect:!0},pause:{attribute:"pause",type:Boolean,reflect:!0},reset:{attribute:"reset",type:Boolean,reflect:!0},state:{atribute:!1,type:String,reflect:!1}}}constructor(){super(),this.trials=void 0,this.duration=void 0,this.run=!1,this.pause=!1,this.reset=!1,this.states=["resetted","running","paused","ended"],this.state="resetted"}setTrials(t){this.trials=t.target.value,this.dispatchEvent(new CustomEvent("prospectable-control-trials",{detail:{trials:this.trials},bubbles:!0}))}setDuration(t){this.duration=t.target.value,this.dispatchEvent(new CustomEvent("prospectable-control-duration",{detail:{duration:this.duration},bubbles:!0}))}doRun(){this.state="running",this.dispatchEvent(new CustomEvent("prospectable-control-run",{detail:{},bubbles:!0}))}doPause(){this.state="paused",this.dispatchEvent(new CustomEvent("prospectable-control-pause",{detail:{},bubbles:!0}))}doReset(){this.state="resetted",this.dispatchEvent(new CustomEvent("prospectable-control-reset",{detail:{},bubbles:!0}))}complete(){this.state="ended"}static get styles(){return[super.styles,g`
|
|
1824
|
+
`}willUpdate(){this.alignState()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F={top:3*this.rem,bottom:5*this.rem,left:2*this.rem,right:6*this.rem},i=Q-(F.top+F.bottom),U=Q-(F.left+F.right),g=AI().domain([this.range.xs.start,this.range.xs.stop]).range([0,U]),e=AI().domain([this.range.pw.start,this.range.pw.stop]).range([0,-i]),I=AI().domain([this.range.xw.start,this.range.xw.stop]).range([0,-i]),l=XL(this.getComputedStyleValue("---color-element-background")).hex(),c=this.getComputedStyleValue("---color-better-dark"),n=this.getComputedStyleValue("---color-better"),a=this.getComputedStyleValue("---color-nr"),d=this.getComputedStyleValue("---color-worse"),o=this.getComputedStyleValue("---color-worse-dark"),b=cn().domain([this.range.uDiff.start,0,this.range.uDiff.stop]).clamp(!0).interpolator(vF([c,n,a,d,o])),C=AI().domain([this.range.uDiff.start,this.range.uDiff.stop]).range([0,-s+4*this.rem]),r={x:F.left,y:Q-F.bottom},u={x:g((this.range.xs.start+this.range.xs.stop)/2),y:e((this.range.pw.start+this.range.pw.stop)/2),z:I((this.range.xw.start+this.range.xw.stop)/2)},h=-.85*Math.PI/8,x=3*Math.PI/8,G=1e-7,y=cL.lineStrips3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),A=cL.points3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),L=cL.gridPlanes3D().origin(r).scale(1).rotationCenter(u).rotateX(h+this.rotationX).rotateY(x+this.rotationY).rotateZ(G),R=tQ().on("start",t=>{this.mx=t.x,this.my=t.y}).on("drag",t=>{this.rotationY=(t.x-this.mx+this.mouseX)*(Math.PI/230),this.rotationX=(t.y-this.my+this.mouseY)*(Math.PI/230)*-1,this.requestUpdate()}).on("end",t=>{this.mouseX=t.x-this.mx+this.mouseX,this.mouseY=t.y-this.my+this.mouseY}),m=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),V=m.enter().append("svg").classed("main",!0).call(R),S=V.merge(m).attr("viewBox",`0 0 ${Q} ${Q}`),Z=V.append("defs").append("linearGradient").attr("id","gradient-legend").attr("x1",0).attr("x2",0).attr("y1",1).attr("y2",0);Z.append("stop").attr("offset","0%").attr("stop-color",c),Z.append("stop").attr("offset","25%").attr("stop-color",n),Z.append("stop").attr("offset","50%").attr("stop-color",a),Z.append("stop").attr("offset","75%").attr("stop-color",d),Z.append("stop").attr("offset","100%").attr("stop-color",o);const p=[[{title:'Sure Value (<tspan class="math-var">x<tspan class="subscript">sure</tspan></tspan>)',id:"max",x:g.range()[1]},{id:"min",x:g.range()[0]}]],E=[[{title:'Win Probability (<tspan class="math-var">p<tspan class="subscript">win</tspan></tspan>)',id:"max",y:e.range()[1]},{id:"min",y:e.range()[0]}]],N=[[{title:'Win Value (<tspan class="math-var">x<tspan class="subscript">win</tspan></tspan>)',id:"max",z:I.range()[1]},{id:"min",z:I.range()[0]}]],X=S.selectAll(".axis-x").data(y.x(t=>t.x).y(()=>e.range()[0]).z(()=>I.range()[0]).data(p)),W=S.selectAll(".axis-y").data(y.x(()=>g.range()[0]).y(t=>t.y).z(()=>I.range()[1]).data(E)),H=S.selectAll(".axis-z").data(y.x(()=>g.range()[0]).y(()=>e.range()[0]).z(t=>t.z).data(N)),D=X.enter().append("path").attr("class","d3-3d axis axis-x"),f=W.enter().append("path").attr("class","d3-3d axis axis-y"),w=H.enter().append("path").attr("class","d3-3d axis axis-z"),v=D.merge(X).attr("d",y.draw),Y=f.merge(W).attr("d",y.draw),J=w.merge(H).attr("d",y.draw);v.exit().remove(),Y.exit().remove(),J.exit().remove();const k=S.selectAll(".title-path-x").data(y.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem).data(p)),M=S.selectAll(".title-path-y").data(y.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem).data(E)),T=S.selectAll(".title-path-z").data(y.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem).data(N)),z=S.selectAll(".title-x").data(y.x(t=>"min"===t.id?t.x-20*this.rem:t.x+20*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(()=>I.range()[0]+1.75*this.rem).data(p),t=>t[0].title),K=S.selectAll(".title-y").data(y.x(()=>g.range()[0]-1.75*this.rem).y(t=>"min"===t.id?t.y+20*this.rem:t.y-20*this.rem).z(()=>I.range()[1]-1.75*this.rem).data(E),t=>t[0].title),O=S.selectAll(".title-z").data(y.x(()=>g.range()[0]-1.75*this.rem).y(()=>e.range()[0]+1.75*this.rem).z(t=>"min"===t.id?t.z-20*this.rem:t.z+20*this.rem).data(N),t=>t[0].title),P=k.enter().append("path").attr("class","d3-3d title-path title-path-x").attr("id","title-x"),j=M.enter().append("path").attr("class","d3-3d title-path title-path-y").attr("id","title-y"),_=T.enter().append("path").attr("class","d3-3d title-path title-path-z").attr("id","title-z"),$=z.enter().append("text").attr("class","d3-3d title title-x");$.append("textPath").attr("href","#title-x").attr("startOffset","50%");const q=K.enter().append("text").attr("class","d3-3d title title-y");q.append("textPath").attr("href","#title-y").attr("startOffset","50%");const tt=O.enter().append("text").attr("class","d3-3d title title-z");tt.append("textPath").attr("href","#title-z").attr("startOffset","50%");const Bt=P.merge(k).attr("d",y.draw),st=j.merge(M).attr("d",y.draw),Qt=_.merge(T).attr("d",y.draw),Ft=$.merge(z).select("textPath").html(t=>t[0].title),it=q.merge(K).select("textPath").html(t=>t[0].title),Ut=tt.merge(O).select("textPath").html(t=>t[0].title);Bt.exit().remove(),st.exit().remove(),Qt.exit().remove(),Ft.exit().remove(),it.exit().remove(),Ut.exit().remove();const gt=g.ticks(5).map(t=>[{id:"min",label:g.tickFormat()(t),x:g(t)},{id:"max",x:g(t)}]),et=e.ticks(5).map(t=>[{id:"min",label:e.tickFormat()(t),y:e(t)},{id:"max",y:e(t)}]),It=I.ticks(5).map(t=>[{id:"max",label:I.tickFormat()(t),z:I(t)},{id:"min",z:I(t)}]),lt=S.selectAll(".tick-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>"min"===t.id?I.range()[0]:I.range()[0]+.35*this.rem).data(gt)),ct=S.selectAll(".tick-y").data(y.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]:I.range()[1]-.35*this.rem).data(et)),nt=S.selectAll(".tick-z").data(y.x(t=>"min"===t.id?g.range()[0]:g.range()[0]-.35*this.rem).y(t=>"min"===t.id?e.range()[0]:e.range()[0]+.35*this.rem).z(t=>t.z).data(It)),at=lt.enter().append("path").attr("class","d3-3d tick tick-x"),dt=ct.enter().append("path").attr("class","d3-3d tick tick-y"),ot=nt.enter().append("path").attr("class","d3-3d tick tick-z"),bt=at.merge(lt).attr("d",y.draw),Ct=dt.merge(ct).attr("d",y.draw),rt=ot.merge(nt).attr("d",y.draw);bt.exit().remove(),Ct.exit().remove(),rt.exit().remove();const ut=S.selectAll(".label-path-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem).data(gt),t=>t[0].label),ht=S.selectAll(".label-path-y").data(y.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem).data(et),t=>t[0].label),xt=S.selectAll(".label-path-z").data(y.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z).data(It),t=>t[0].label),Gt=S.selectAll(".label-x").data(y.x(t=>t.x).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>"min"===t.id?I.range()[0]+4*this.rem:I.range()[0]+.5*this.rem).data(gt),t=>t[0].label),yt=S.selectAll(".label-y").data(y.x(t=>"min"===t.id?g.range()[0]-.5*this.rem:g.range()[0]-4*this.rem).y(t=>t.y).z(t=>"min"===t.id?I.range()[1]-.5*this.rem:I.range()[1]-4*this.rem).data(et),t=>t[0].label),At=S.selectAll(".label-z").data(y.x(t=>"min"===t.id?g.range()[0]-4*this.rem:g.range()[0]-.5*this.rem).y(t=>"min"===t.id?e.range()[0]+4*this.rem:e.range()[0]+.5*this.rem).z(t=>t.z).data(It),t=>t[0].label),Lt=ut.enter().append("path").attr("class","d3-3d label-path label-path-x").attr("id",(t,B)=>`label-x-${B}`),Rt=ht.enter().append("path").attr("class","d3-3d label-path label-path-y").attr("id",(t,B)=>`label-y-${B}`),mt=xt.enter().append("path").attr("class","d3-3d label-path label-path-z").attr("id",(t,B)=>`label-z-${B}`),Vt=Gt.enter().append("text").attr("class","d3-3d label label-x");Vt.append("textPath").attr("href",(t,B)=>`#label-x-${B}`).attr("startOffset","0%");const St=yt.enter().append("text").attr("class","d3-3d label label-y");St.append("textPath").attr("href",(t,B)=>`#label-y-${B}`).attr("startOffset","100%");const Zt=At.enter().append("text").attr("class","d3-3d label label-z");Zt.append("textPath").attr("href",(t,B)=>`#label-z-${B}`).attr("startOffset","100%");const pt=Lt.merge(ut).attr("d",y.draw),Et=Rt.merge(ht).attr("d",y.draw),Nt=mt.merge(xt).attr("d",y.draw),Xt=Vt.merge(Gt).select("textPath").text(t=>t[0].label),Wt=St.merge(yt).select("textPath").text(t=>t[0].label),Ht=Zt.merge(At).select("textPath").text(t=>t[0].label);pt.exit().remove(),Et.exit().remove(),Nt.exit().remove(),Xt.exit().remove(),Wt.exit().remove(),Ht.exit().remove();const Dt=S.selectAll(".point").data(A.x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw)).data(this.choices.slice("rest"===this.point?1:0,"first"===this.point?1:void 0)),t=>t.name);function ft(t,B){return{x:B.x-t.x,y:B.y-t.y,z:B.z-t.z}}function wt(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)}function vt(t,B,s){return function(t,B){return{x:t.y*B.z-t.z*B.y,y:t.z*B.x-t.x*B.z,z:t.x*B.y-t.y*B.x}}(ft(t,B),ft(t,s))}function Yt(t,B){return function(t,B){return t.x*B.x+t.y*B.y+t.z*B.z}(t,B)/(wt(t)*wt(B))}Dt.enter().append("circle").attr("class","d3-3d point").merge(Dt).attr("class",t=>`d3-3d point ${t.response}`).attr("cx",t=>t.projected.x).attr("cy",t=>t.projected.y),Dt.exit().remove();const Jt={x:-.5,y:1,z:-1},kt=S.selectAll(".boundary").data(this.surface?L.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw)).data(this.boundary).filter(t=>t[0].pw>=this.range.pw.start&&t[0].pw<=this.range.pw.stop&&t[1].pw>=this.range.pw.start&&t[1].pw<=this.range.pw.stop&&t[2].pw>=this.range.pw.start&&t[2].pw<=this.range.pw.stop&&t[3].pw>=this.range.pw.start&&t[3].pw<=this.range.pw.stop):[]);kt.enter().append("path").attr("class","d3-3d boundary").merge(kt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(l).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),kt.exit().remove();const Mt=S.selectAll(".map-xy").data(L.rows(nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw)).data(this.mapXY)),Tt=S.selectAll(".map-xz").data(L.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw)).data(this.mapXZ)),zt=S.selectAll(".map-yz").data(L.rows(nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step).length).x(t=>g(t.xs)).y(t=>e(t.pw)).z(t=>I(t.xw)).data(this.mapYZ)),Kt=Mt.enter().append("path").attr("class","d3-3d map map-xy"),Ot=Tt.enter().append("path").attr("class","d3-3d map map-xz"),Pt=zt.enter().append("path").attr("class","d3-3d map map-yz");Kt.merge(Mt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Ot.merge(Tt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Pt.merge(zt).attr("d",L.draw).each(t=>{const B=t.ccw?vt(t[0].rotated,t[1].rotated,t[2].rotated):vt(t[2].rotated,t[1].rotated,t[0].rotated);t.ratio=Yt(B,Jt)-.5,t.color=uQ(b(t[0].uDiff)).brighter(t.ratio)}).attr("fill",t=>t.color).attr("stroke",t=>t.color),Mt.exit().remove(),Tt.exit().remove(),zt.exit().remove(),Js(this.renderRoot).selectAll(".d3-3d").sort(cL.sort);const jt=S.selectAll(".legend").data([{x:Q+2*this.rem,y:Q-2*this.rem,rem:this.rem}]),_t=jt.enter().append("g").attr("class","legend"),$t=_t.merge(jt).attr("transform",t=>`translate(${t.x} ${t.y})`);jt.exit().remove(),_t.append("g").attr("class","axis axis-legend"),$t.select(".axis-legend").call(AB(C).ticks(7)).attr("font-size",null).attr("font-family",null),_t.append("text").attr("class","title title-legend").html('Difference in Utility (<tspan class="math-var">U<tspan class="subscript">gamble</tspan></tspan> − <tspan class="math-var">U<tspan class="subscript">sure</tspan></tspan>)'),$t.select(".title-legend").attr("transform",`translate(${2.5*-this.rem},${(C(this.range.uDiff.start)+C(this.range.uDiff.stop))/2})rotate(-90)`),_t.append("rect").attr("class","bar bar-legend").attr("fill",'url("#gradient-legend")'),$t.select(".bar-legend").attr("x",0).attr("y",C(this.range.uDiff.stop)).attr("width",this.rem).attr("height",C(this.range.uDiff.start)-C(this.range.uDiff.stop)),this.firstUpdate=!1}}customElements.define("decision-space",YL);class JL extends Eo{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},run:{attribute:"run",type:Boolean,reflect:!0},pause:{attribute:"pause",type:Boolean,reflect:!0},reset:{attribute:"reset",type:Boolean,reflect:!0},state:{atribute:!1,type:String,reflect:!1}}}constructor(){super(),this.trials=void 0,this.duration=void 0,this.run=!1,this.pause=!1,this.reset=!1,this.states=["resetted","running","paused","ended"],this.state="resetted"}setTrials(t){this.trials=t.target.value,this.dispatchEvent(new CustomEvent("prospectable-control-trials",{detail:{trials:this.trials},bubbles:!0}))}setDuration(t){this.duration=t.target.value,this.dispatchEvent(new CustomEvent("prospectable-control-duration",{detail:{duration:this.duration},bubbles:!0}))}doRun(){this.state="running",this.dispatchEvent(new CustomEvent("prospectable-control-run",{detail:{},bubbles:!0}))}doPause(){this.state="paused",this.dispatchEvent(new CustomEvent("prospectable-control-pause",{detail:{},bubbles:!0}))}doReset(){this.state="resetted",this.dispatchEvent(new CustomEvent("prospectable-control-reset",{detail:{},bubbles:!0}))}complete(){this.state="ended"}static get styles(){return[super.styles,g`
|
|
1851
1825
|
:host {
|
|
1852
1826
|
display: inline-block;
|
|
1853
1827
|
}
|
|
@@ -1880,7 +1854,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1880
1854
|
${this.reset?M`<decidables-button name="reset" ?disabled=${"resetted"===this.state} @click=${this.doReset.bind(this)}>Reset</decidables-button>`:M``}
|
|
1881
1855
|
</div>
|
|
1882
1856
|
`:M``}
|
|
1883
|
-
</div>`}}customElements.define("prospectable-control",
|
|
1857
|
+
</div>`}}customElements.define("prospectable-control",JL);class kL extends Eo{static get properties(){return{feedback:{attribute:"feedback",type:String,reflect:!0},trial:{attribute:"trial",type:Boolean,reflect:!0},payoff:{attribute:"payoff",type:String,reflect:!0},state:{attribute:!1,type:String,reflect:!1},trialCount:{attribute:!1,type:Number,reflect:!1},trialTotal:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.feedbacks=["none","outcome"],this.feedback="none",this.trial=!1,this.payoffs=["none","selection","both"],this.payoff="none",this.states=["off","waiting","feedback"],this.state="off",this.trialCount=0,this.trialTotal=0,this.xl=0,this.xw=0,this.pw=0,this.xs=0,this.gamblePayoff=0,this.surePayoff=0,this.nrPayoff=0,this.betters=["gamble","sure","even"],this.better=void 0,this.responses=["gamble","sure","nr"],this.response=void 0,this.outcomes=["better","worse","even","nr"],this.outcome=void 0}get trialPayoff(){switch(this.response){case"gamble":return this.gamblePayoff;case"sure":return this.surePayoff;case"nr":return this.nrPayoff;default:return}}start(t,B,s,Q,F,i,U,g){this.state="waiting",this.xl=t,this.xw=B,this.pw=s,this.xs=Q,this.gamblePayoff=F,this.surePayoff=i,this.better=U,this.trialCount=g,this.response=void 0,this.outcome=void 0}stop(){this.state="feedback",void 0===this.response&&(this.outcome="nr")}gamble(){this.responded("gamble")}sure(){this.responded("sure")}responded(t){this.state="feedback",this.response=t,this.outcome="even"===this.better?"even":this.better===this.response?"better":"worse",this.dispatchEvent(new CustomEvent("prospectable-response",{detail:{trial:this.trialCount,better:this.better,gamblePayoff:this.gamblePayoff,surePayoff:this.surePayoff,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,response:this.response,outcome:this.outcome,payoff:this.trialPayoff},bubbles:!0}))}reset(){this.state="off",this.trialCount=0,this.better=void 0,this.gamblePayoff=0,this.surePayoff=0,this.response=void 0,this.outcome=void 0}keydown(t){"waiting"===this.state&&("ArrowLeft"===t.key?(this.responded("gamble"),t.preventDefault()):"ArrowRight"===t.key&&(this.responded("sure"),t.preventDefault()))}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.keydown.bind(this))}disconnectedCallback(){window.removeEventListener("keydown",this.keydown.bind(this)),super.disconnectedCallback()}static get styles(){return[super.styles,g`
|
|
1884
1858
|
:host {
|
|
1885
1859
|
display: inline-block;
|
|
1886
1860
|
}
|
|
@@ -1955,6 +1929,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1955
1929
|
|
|
1956
1930
|
width: 5.25rem;
|
|
1957
1931
|
height: 3.5rem;
|
|
1932
|
+
|
|
1958
1933
|
padding: 0.375rem 0.75rem;
|
|
1959
1934
|
margin: 0.25rem;
|
|
1960
1935
|
|
|
@@ -1982,6 +1957,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
1982
1957
|
|
|
1983
1958
|
.feedback .outcome {
|
|
1984
1959
|
font-weight: 600;
|
|
1960
|
+
|
|
1985
1961
|
line-height: 1.15;
|
|
1986
1962
|
}
|
|
1987
1963
|
|
|
@@ -2023,12 +1999,14 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2023
1999
|
${"both"===this.payoff||"selection"===this.payoff&&"sure"===this.response?M`<span class="payoff">${"sure"===this.response?"Win:":"Miss:"} $${this.surePayoff}</span>`:M``}
|
|
2024
2000
|
</div>
|
|
2025
2001
|
</div>`:M``}
|
|
2026
|
-
</div>`}}customElements.define("prospectable-response",
|
|
2002
|
+
</div>`}}customElements.define("prospectable-response",kL);class ML extends(Zo(Eo)){static get styles(){return[super.styles,g`
|
|
2027
2003
|
:host {
|
|
2028
2004
|
--decidables-spinner-font-size: 1.75rem;
|
|
2029
2005
|
--decidables-spinner-input-width: 4rem;
|
|
2030
2006
|
--decidables-spinner-prefix: "$";
|
|
2031
2007
|
|
|
2008
|
+
position: relative;
|
|
2009
|
+
|
|
2032
2010
|
display: inline-block;
|
|
2033
2011
|
|
|
2034
2012
|
width: 10rem;
|
|
@@ -2038,6 +2016,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2038
2016
|
.main {
|
|
2039
2017
|
width: 100%;
|
|
2040
2018
|
height: 100%;
|
|
2019
|
+
|
|
2041
2020
|
overflow: visible;
|
|
2042
2021
|
}
|
|
2043
2022
|
|
|
@@ -2054,9 +2033,9 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2054
2033
|
|
|
2055
2034
|
.arc.interactive {
|
|
2056
2035
|
cursor: ns-resize;
|
|
2036
|
+
outline: none;
|
|
2057
2037
|
|
|
2058
2038
|
filter: url("#shadow-2");
|
|
2059
|
-
outline: none;
|
|
2060
2039
|
}
|
|
2061
2040
|
|
|
2062
2041
|
.arc.interactive:hover {
|
|
@@ -2067,7 +2046,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2067
2046
|
filter: url("#shadow-8");
|
|
2068
2047
|
}
|
|
2069
2048
|
|
|
2070
|
-
|
|
2049
|
+
.arc.interactive:focus-visible {
|
|
2071
2050
|
filter: url("#shadow-8");
|
|
2072
2051
|
}
|
|
2073
2052
|
|
|
@@ -2086,23 +2065,20 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2086
2065
|
.label.static {
|
|
2087
2066
|
font-size: 1.75rem;
|
|
2088
2067
|
|
|
2068
|
+
dominant-baseline: middle;
|
|
2069
|
+
|
|
2089
2070
|
user-select: none;
|
|
2090
2071
|
|
|
2091
|
-
dominant-baseline: middle;
|
|
2092
2072
|
text-anchor: middle;
|
|
2093
2073
|
}
|
|
2094
2074
|
|
|
2095
2075
|
.label.interactive {
|
|
2076
|
+
position: absolute;
|
|
2077
|
+
|
|
2096
2078
|
width: var(--decidables-spinner-input-width);
|
|
2097
2079
|
height: calc(var(--decidables-spinner-font-size) * 1.5);
|
|
2098
|
-
overflow: visible;
|
|
2099
|
-
}
|
|
2100
2080
|
|
|
2101
|
-
|
|
2102
|
-
/* https://stackoverflow.com/questions/51313873/svg-foreignobject-not-working-properly-on-safari */
|
|
2103
|
-
/* https://bugs.webkit.org/show_bug.cgi?id=23113 */
|
|
2104
|
-
.label.interactive decidables-spinner {
|
|
2105
|
-
position: fixed;
|
|
2081
|
+
overflow: visible;
|
|
2106
2082
|
}
|
|
2107
2083
|
|
|
2108
2084
|
.label.interactive.win decidables-spinner {
|
|
@@ -2118,11 +2094,11 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2118
2094
|
}
|
|
2119
2095
|
`]}render(){return M`
|
|
2120
2096
|
<slot></slot>
|
|
2121
|
-
`}connectedCallback(){super.connectedCallback(),this.mutationObserver=new MutationObserver(t=>{t.some(t=>"childList"===t.type||"attributes"===t.type&&t.target!==this)&&this.requestUpdate()}),this.mutationObserver.observe(this,{subtree:!0,childList:!0,attributes:!0})}disconnectedCallback(){this.mutationObserver.disconnect(),super.disconnectedCallback()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=Q-(0+0),i=Q-(0+0),U=this.querySelectorAll("risky-outcome"),g=U.length?-U[0].p:0,e=function(){var t=rd,B=Cd,s=null,Q=Ma(0),F=Ma(Bd),i=Ma(0);function U(U){var g,e,I,l,c,n=(U=cd(U)).length,a=0,d=new Array(n),o=new Array(n),b=+Q.apply(this,arguments),C=Math.min(Bd,Math.max(-Bd,F.apply(this,arguments)-b)),r=Math.min(Math.abs(C)/n,i.apply(this,arguments)),u=r*(C<0?-1:1);for(g=0;g<n;++g)(c=o[d[g]=g]=+t(U[g],g,U))>0&&(a+=c);for(null!=B?d.sort(function(t,s){return B(o[t],o[s])}):null!=s&&d.sort(function(t,B){return s(U[t],U[B])}),g=0,I=a?(C-n*u)/a:0;g<n;++g,b=l)e=d[g],l=b+((c=o[e])>0?c*I:0)+u,o[e]={data:U[e],index:g,value:c,startAngle:b,endAngle:l,padAngle:r};return o}return U.value=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),U):t},U.sortValues=function(t){return arguments.length?(B=t,s=null,U):B},U.sort=function(t){return arguments.length?(s=t,B=null,U):s},U.startAngle=function(t){return arguments.length?(Q="function"==typeof t?t:Ma(+t),U):Q},U.endAngle=function(t){return arguments.length?(F="function"==typeof t?t:Ma(+t),U):F},U.padAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ma(+t),U):i},U}().startAngle(g*Math.PI-Math.PI).endAngle(g*Math.PI+Math.PI).sortValues(null).value(t=>t.p)(U),I=e.filter(t=>!t.data.interactive),l=e.filter(t=>t.data.interactive);function c(t){const B=(t+2*Math.PI)%(2*Math.PI);return B>Math.PI?B-2*Math.PI:B<-Math.PI?B+2*Math.PI:B}const n=tQ().subject((t,B)=>{const s=c((B.endAngle+B.startAngle)/2),Q=c(Math.atan2(t.y,t.x)+Math.PI/2);return U.forEach(t=>{t.startP=t.p}),{arcAngle:s,startAngle:c(Q-s)}}).on("start",(t,B)=>{if(!B.data.interactive)return;Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{if(!B.data.interactive)return;const s=c(Math.atan2(t.y,t.x)+Math.PI/2),Q=c(s-t.subject.arcAngle),F=c(t.subject.startAngle>0?Q-t.subject.startAngle:t.subject.startAngle-Q)/Math.PI,i=B.data.startP+F,g=i>.99?.99:i<.01?.01:i;U.forEach(t=>{t.p=t===B.data?g:t.startP/(1-B.data.startP)*(1-g)}),this.dispatchEvent(new CustomEvent("risky-outcome-change",{detail:{x:B.data.x,p:B.data.p,name:B.data.name},bubbles:!0}))}).on("end",(t,B)=>{if(!B.data.interactive)return;Js(t.currentTarget).classed("dragging",!1)}),a=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),d=a.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),o=d.merge(a).attr("viewBox",`0 0 ${Q} ${Q}`),b=d.append("g").classed("pie",!0),C=o.select(".pie").attr("transform",`translate(${i/2}, ${F/2})`);b.append("circle").classed("outline",!0),C.select(".outline").attr("r",Math.min(i,F)/2-1);const r=C.selectAll(".arc").data(e),u=r.enter().append("path").call(n).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown"].includes(t.key)){const s=B.data.p;let Q=B.data.p;switch(t.key){case"ArrowUp":Q-=t.shiftKey?.01:.05;break;case"ArrowDown":Q+=t.shiftKey?.01:.05}const F=Q>.99?.99:Q<.01?.01:Q;U.forEach(t=>{t.p=t===B.data?F:t.p/(1-s)*(1-F)}),this.dispatchEvent(new CustomEvent("risky-outcome-change",{detail:{x:B.data.x,p:B.data.p,name:B.data.name},bubbles:!0})),t.preventDefault()}});u.merge(r).attr("tabindex",t=>l.includes(t)&&e.length>1?0:null).attr("class",t=>`arc ${t.data.name}`).classed("interactive",t=>l.includes(t)&&e.length>1).attr("d",ld().innerRadius(0).outerRadius(Math.min(i,F)/2-1)),r.exit().remove();const h=C.selectAll(".label.static").data(I),x=
|
|
2097
|
+
`}connectedCallback(){super.connectedCallback(),this.mutationObserver=new MutationObserver(t=>{t.some(t=>"childList"===t.type||"attributes"===t.type&&t.target!==this)&&this.requestUpdate()}),this.mutationObserver.observe(this,{subtree:!0,childList:!0,attributes:!0})}disconnectedCallback(){this.mutationObserver.disconnect(),super.disconnectedCallback()}update(t){if(super.update(t),Number.isNaN(this.width)||Number.isNaN(this.height)||Number.isNaN(this.rem))return;const B=this.width,s=this.height,Q=Math.min(B,s),F=Q-(0+0),i=Q-(0+0),U=this.querySelectorAll("risky-outcome"),g=U.length?-U[0].p:0,e=function(){var t=rd,B=Cd,s=null,Q=Ma(0),F=Ma(Bd),i=Ma(0);function U(U){var g,e,I,l,c,n=(U=cd(U)).length,a=0,d=new Array(n),o=new Array(n),b=+Q.apply(this,arguments),C=Math.min(Bd,Math.max(-Bd,F.apply(this,arguments)-b)),r=Math.min(Math.abs(C)/n,i.apply(this,arguments)),u=r*(C<0?-1:1);for(g=0;g<n;++g)(c=o[d[g]=g]=+t(U[g],g,U))>0&&(a+=c);for(null!=B?d.sort(function(t,s){return B(o[t],o[s])}):null!=s&&d.sort(function(t,B){return s(U[t],U[B])}),g=0,I=a?(C-n*u)/a:0;g<n;++g,b=l)e=d[g],l=b+((c=o[e])>0?c*I:0)+u,o[e]={data:U[e],index:g,value:c,startAngle:b,endAngle:l,padAngle:r};return o}return U.value=function(B){return arguments.length?(t="function"==typeof B?B:Ma(+B),U):t},U.sortValues=function(t){return arguments.length?(B=t,s=null,U):B},U.sort=function(t){return arguments.length?(s=t,B=null,U):s},U.startAngle=function(t){return arguments.length?(Q="function"==typeof t?t:Ma(+t),U):Q},U.endAngle=function(t){return arguments.length?(F="function"==typeof t?t:Ma(+t),U):F},U.padAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ma(+t),U):i},U}().startAngle(g*Math.PI-Math.PI).endAngle(g*Math.PI+Math.PI).sortValues(null).value(t=>t.p)(U),I=e.filter(t=>!t.data.interactive),l=e.filter(t=>t.data.interactive);function c(t){const B=(t+2*Math.PI)%(2*Math.PI);return B>Math.PI?B-2*Math.PI:B<-Math.PI?B+2*Math.PI:B}const n=tQ().subject((t,B)=>{const s=c((B.endAngle+B.startAngle)/2),Q=c(Math.atan2(t.y,t.x)+Math.PI/2);return U.forEach(t=>{t.startP=t.p}),{arcAngle:s,startAngle:c(Q-s)}}).on("start",(t,B)=>{if(!B.data.interactive)return;Js(t.currentTarget).classed("dragging",!0)}).on("drag",(t,B)=>{if(!B.data.interactive)return;const s=c(Math.atan2(t.y,t.x)+Math.PI/2),Q=c(s-t.subject.arcAngle),F=c(t.subject.startAngle>0?Q-t.subject.startAngle:t.subject.startAngle-Q)/Math.PI,i=B.data.startP+F,g=i>.99?.99:i<.01?.01:i;U.forEach(t=>{t.p=t===B.data?g:t.startP/(1-B.data.startP)*(1-g)}),this.dispatchEvent(new CustomEvent("risky-outcome-change",{detail:{x:B.data.x,p:B.data.p,name:B.data.name},bubbles:!0}))}).on("end",(t,B)=>{if(!B.data.interactive)return;Js(t.currentTarget).classed("dragging",!1)}),a=Js(this.renderRoot).selectAll(".main").data([{width:this.width,height:this.height,rem:this.rem}]),d=a.enter().append("svg").classed("main",!0).each((t,B,s)=>{et(Eo.svgFilters,s[B])}),o=d.merge(a).attr("viewBox",`0 0 ${Q} ${Q}`),b=d.append("g").classed("pie",!0),C=o.select(".pie").attr("transform",`translate(${i/2}, ${F/2})`);b.append("circle").classed("outline",!0),C.select(".outline").attr("r",Math.min(i,F)/2-1);const r=C.selectAll(".arc").data(e),u=r.enter().append("path").call(n).on("keydown",(t,B)=>{if(["ArrowUp","ArrowDown"].includes(t.key)){const s=B.data.p;let Q=B.data.p;switch(t.key){case"ArrowUp":Q-=t.shiftKey?.01:.05;break;case"ArrowDown":Q+=t.shiftKey?.01:.05}const F=Q>.99?.99:Q<.01?.01:Q;U.forEach(t=>{t.p=t===B.data?F:t.p/(1-s)*(1-F)}),this.dispatchEvent(new CustomEvent("risky-outcome-change",{detail:{x:B.data.x,p:B.data.p,name:B.data.name},bubbles:!0})),t.preventDefault()}});u.merge(r).attr("tabindex",t=>l.includes(t)&&e.length>1?0:null).attr("class",t=>`arc ${t.data.name}`).classed("interactive",t=>l.includes(t)&&e.length>1).attr("d",ld().innerRadius(0).outerRadius(Math.min(i,F)/2-1)),r.exit().remove();const h=C.selectAll(".label.static").data(I),x=Js(this.renderRoot).selectAll(".label.interactive").data(l),G=h.enter().append("text"),y=x.enter().append("xhtml:div");y.append("decidables-spinner").on("input",(t,B)=>{B.data.x=parseFloat(t.target.value),this.dispatchEvent(new CustomEvent("risky-outcome-change",{detail:{x:B.data.x,p:B.data.p,name:B.data.name},bubbles:!0}))}),G.merge(h).attr("class",t=>`label static ${t.data.name}`).attr("transform",t=>{if(1===e.length)return"translate(0, 0)";const B=Math.min(i,F)/2*.6;return`translate(${ld().innerRadius(B).outerRadius(B).centroid(t)})`}).text(t=>`$${t.data.x.toFixed(0)}`);const A=y.merge(x).attr("class",t=>`label interactive ${t.data.name}`).attr("style",t=>{const B=parseFloat(this.getComputedStyleValue("--decidables-spinner-input-width")),s=parseFloat(this.getComputedStyleValue("--decidables-spinner-font-size")),Q=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("font-size"),10),U=i/2+B*Q/-2,g=F/2+s*Q*1.5/-2;if(1===e.length)return`left: ${U}px; top: ${g}px;`;const I=Math.min(i,F)/2*.6,l=ld().innerRadius(I).outerRadius(I);return`left: ${l.centroid(t)[0]+U}px; top: ${l.centroid(t)[1]+g}px;`});A.select("decidables-spinner").attr("value",t=>`${t.data.x.toFixed(0)}`),h.exit().remove(),x.exit().remove()}}customElements.define("risky-option",ML);class TL extends Eo{static get properties(){return{x:{attribute:"value",type:Number,reflect:!0},p:{attribute:"probability",type:Number,reflect:!0},name:{attribute:"name",type:String,reflect:!0}}}constructor(){super(),this.x=0,this.p=0,this.name=""}static get styles(){return[g`
|
|
2122
2098
|
:host {
|
|
2123
2099
|
display: none;
|
|
2124
2100
|
}
|
|
2125
|
-
`]}render(){return M``}}customElements.define("risky-outcome",
|
|
2101
|
+
`]}render(){return M``}}customElements.define("risky-outcome",TL);class zL extends Eo{static get properties(){return{state:{attribute:"state",type:String,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.states=["choice","fixation","blank"],this.state="choice",this.xl=0,this.xw=100,this.pw=.75,this.xs=50}static get styles(){return[super.styles,g`
|
|
2126
2102
|
:host {
|
|
2127
2103
|
display: inline-block;
|
|
2128
2104
|
}
|
|
@@ -2158,14 +2134,14 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2158
2134
|
${"choice"===this.state?M`
|
|
2159
2135
|
<risky-outcome ?interactive=${this.interactive} probability="1" value="${this.xs}" name="sure"></risky-outcome>`:""}
|
|
2160
2136
|
</risky-option>
|
|
2161
|
-
</div>`}}customElements.define("risky-choice",
|
|
2137
|
+
</div>`}}customElements.define("risky-choice",zL);class KL extends Eo{static get properties(){return{duration:{attribute:"duration",type:Number,reflect:!0},iti:{attribute:"iti",type:Number,reflect:!0},trials:{attribute:"trials",type:Number,reflect:!0},running:{attribute:"running",type:Boolean,reflect:!0},state:{attribute:!1,type:String,reflect:!1}}}constructor(){super(),this.duration=2e3,this.iti=2e3,this.trials=5,this.running=!1,this.states=["resetted","iti","stimulus","ended"],this.state="resetted",this.range={},this.range.xl={start:0,stop:0,step:1},this.range.xw={start:10,stop:30,step:1},this.range.pw={start:.1,stop:.9,step:.1},this.range.xs={start:5,stop:15,step:1},this.range.xl.values=nB(this.range.xl.start,this.range.xl.stop+.01,this.range.xl.step),this.range.xw.values=nB(this.range.xw.start,this.range.xw.stop+.01,this.range.xw.step),this.range.pw.values=nB(this.range.pw.start,this.range.pw.stop+.01,this.range.pw.step),this.range.xs.values=nB(this.range.xs.start,this.range.xs.stop+.01,this.range.xs.step),this.firstUpdate=!0,this.xl=0,this.xw=0,this.pw=0,this.xs=0,this.trial=0,this.baseTime=0,this.pauseTime=0,this.startTime=0,this.lastTime=0,this.runner=void 0}static get styles(){return[super.styles,g`
|
|
2162
2138
|
:host {
|
|
2163
2139
|
display: inline-block;
|
|
2164
2140
|
}
|
|
2165
2141
|
`]}render(){return M`
|
|
2166
2142
|
<div class="holder">
|
|
2167
2143
|
<risky-choice state="${"stimulus"===this.state?"choice":"iti"===this.state?"fixation":"blank"}" probability="${this.pw}" win="${this.xw}" loss="${this.xl}" sure="${this.xs}"></risky-choice>
|
|
2168
|
-
</div>`}update(t){super.update(t),(this.firstUpdate||t.has("running"))&&(this.running?(this.pauseTime&&(this.baseTime+=$F()-this.pauseTime,this.pauseTime=0),this.runner=function(t,B,s){var Q=new ti,F=B;return Q._restart=Q.restart,Q.restart=function(t,B,s){B=+B,s=null==s?$F():+s,Q._restart(function i(U){U+=F,Q._restart(i,F+=B,s),t(U)},B,s)},Q.restart(t,B,s),Q}(this.run.bind(this),20)):void 0!==this.runner&&(this.runner.stop(),this.pauseTime=$F())),this.firstUpdate=!1}reset(){this.runner.stop(),this.running=!1,this.trial=0,this.state="resetted",this.xl=0,this.xw=0,this.pw=0,this.xs=0,this.baseTime=0,this.pauseTime=0,this.startTime=0,this.lastTime=0}run(){const t=$F(),B=this.baseTime?t-this.baseTime:0,s=this.baseTime?B-this.startTime:0;this.lastTime=B,"resetted"===this.state?(this.state="iti",this.baseTime=t,this.startTime=0,this.dispatchEvent(new CustomEvent("risky-block-start",{detail:{trials:this.trials},bubbles:!0}))):"iti"===this.state&&s>=this.iti?(this.trial+=1,this.state="stimulus",this.startTime=B,this.xl=this.range.xl.values[Math.floor(Math.random()*this.range.xl.values.length)],this.xw=this.range.xw.values[Math.floor(Math.random()*this.range.xw.values.length)],this.pw=this.range.pw.values[Math.floor(Math.random()*this.range.pw.values.length)],this.xs=this.range.xs.values[Math.floor(Math.random()*this.range.xs.values.length)],this.vDiff=this.xw*this.pw+this.xl*(1-this.pw)-this.xs,this.gamblePayoff=Math.random()<this.pw?this.xw:this.xl,this.surePayoff=this.xs,this.better=this.vDiff>0?"gamble":this.vDiff<0?"sure":"equal",this.dispatchEvent(new CustomEvent("risky-trial-start",{detail:{trials:this.trials,duration:this.duration,iti:this.iti,trial:this.trial,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,better:this.better,gamblePayoff:this.gamblePayoff,surePayoff:this.surePayoff},bubbles:!0}))):"stimulus"===this.state&&s>=this.duration&&(this.dispatchEvent(new CustomEvent("risky-trial-end",{detail:{trials:this.trials,duration:this.duration,iti:this.iti,trial:this.trial,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,better:this.better,gamblePayoff:this.gamblePayoff,surePayoff:this.surePayoff},bubbles:!0})),this.trial>=this.trials?(this.runner.stop(),this.running=!1,this.state="ended",this.baseTime=0,this.pauseTime=0,this.startTime=0,this.lastTime=0,this.dispatchEvent(new CustomEvent("risky-block-end",{detail:{trials:this.trial},bubbles:!0}))):(this.state="iti",this.startTime=B))}}customElements.define("risky-task",
|
|
2144
|
+
</div>`}update(t){super.update(t),(this.firstUpdate||t.has("running"))&&(this.running?(this.pauseTime&&(this.baseTime+=$F()-this.pauseTime,this.pauseTime=0),this.runner=function(t,B,s){var Q=new ti,F=B;return Q._restart=Q.restart,Q.restart=function(t,B,s){B=+B,s=null==s?$F():+s,Q._restart(function i(U){U+=F,Q._restart(i,F+=B,s),t(U)},B,s)},Q.restart(t,B,s),Q}(this.run.bind(this),20)):void 0!==this.runner&&(this.runner.stop(),this.pauseTime=$F())),this.firstUpdate=!1}reset(){this.runner.stop(),this.running=!1,this.trial=0,this.state="resetted",this.xl=0,this.xw=0,this.pw=0,this.xs=0,this.baseTime=0,this.pauseTime=0,this.startTime=0,this.lastTime=0}run(){const t=$F(),B=this.baseTime?t-this.baseTime:0,s=this.baseTime?B-this.startTime:0;this.lastTime=B,"resetted"===this.state?(this.state="iti",this.baseTime=t,this.startTime=0,this.dispatchEvent(new CustomEvent("risky-block-start",{detail:{trials:this.trials},bubbles:!0}))):"iti"===this.state&&s>=this.iti?(this.trial+=1,this.state="stimulus",this.startTime=B,this.xl=this.range.xl.values[Math.floor(Math.random()*this.range.xl.values.length)],this.xw=this.range.xw.values[Math.floor(Math.random()*this.range.xw.values.length)],this.pw=this.range.pw.values[Math.floor(Math.random()*this.range.pw.values.length)],this.xs=this.range.xs.values[Math.floor(Math.random()*this.range.xs.values.length)],this.vDiff=this.xw*this.pw+this.xl*(1-this.pw)-this.xs,this.gamblePayoff=Math.random()<this.pw?this.xw:this.xl,this.surePayoff=this.xs,this.better=this.vDiff>0?"gamble":this.vDiff<0?"sure":"equal",this.dispatchEvent(new CustomEvent("risky-trial-start",{detail:{trials:this.trials,duration:this.duration,iti:this.iti,trial:this.trial,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,better:this.better,gamblePayoff:this.gamblePayoff,surePayoff:this.surePayoff},bubbles:!0}))):"stimulus"===this.state&&s>=this.duration&&(this.dispatchEvent(new CustomEvent("risky-trial-end",{detail:{trials:this.trials,duration:this.duration,iti:this.iti,trial:this.trial,xl:this.xl,xw:this.xw,pw:this.pw,xs:this.xs,better:this.better,gamblePayoff:this.gamblePayoff,surePayoff:this.surePayoff},bubbles:!0})),this.trial>=this.trials?(this.runner.stop(),this.running=!1,this.state="ended",this.baseTime=0,this.pauseTime=0,this.startTime=0,this.lastTime=0,this.dispatchEvent(new CustomEvent("risky-block-end",{detail:{trials:this.trial},bubbles:!0}))):(this.state="iti",this.startTime=B))}}customElements.define("risky-task",KL);class OL extends Qb{static get properties(){return{p:{attribute:"probability",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},w:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.p=.75,this.g=sb.g.DEFAULT,this.alignState()}alignState(){this.w=sb.pg2w(this.p,this.g)}sendEvent(){this.dispatchEvent(new CustomEvent("cpt-equation-pg2w-change",{detail:{p:this.p,g:this.g,w:this.w},bubbles:!0}))}pInput(t){this.p=parseFloat(t.target.value),this.alignState(),this.sendEvent()}gInput(t){this.g=parseFloat(t.target.value),this.alignState(),this.sendEvent()}willUpdate(){this.alignState()}render(){let t,B,s;this.numeric?(t=M`<decidables-spinner class="p bottom"
|
|
2169
2145
|
?disabled=${!this.interactive}
|
|
2170
2146
|
min="0"
|
|
2171
2147
|
max="1"
|
|
@@ -2211,7 +2187,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2211
2187
|
${Q}
|
|
2212
2188
|
</tbody>
|
|
2213
2189
|
</table>
|
|
2214
|
-
</div>`}}customElements.define("cpt-equation-pg2w",
|
|
2190
|
+
</div>`}}customElements.define("cpt-equation-pg2w",OL);class PL extends Qb{static get properties(){return{v:{attribute:"value",converter:So,reflect:!0},w:{attribute:"weight",converter:So,reflect:!0},n:{attribute:"outcomes",type:Number,reflect:!0},u:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.v=[10,0],this.w=[.75,.25],this.n=2,this.nMax=4,this.vMax=new Array(this.nMax).fill(0),this.wMax=new Array(this.nMax).fill(0),this.alignState()}alignState(){this.v=this.v.length<this.n?this.v.concat(this.vMax.slice(this.v.length,this.n)):this.v.length>this.n?this.v.slice(0,this.n):this.v,this.w=this.w.length<this.n?this.w.concat(this.wMax.slice(this.w.length,this.n)):this.w.length>this.n?this.w.slice(0,this.n):this.w,this.v.forEach((t,B)=>{this.vMax[B]=t}),this.w.forEach((t,B)=>{this.wMax[B]=t}),this.u=this.v.reduce((t,B,s)=>t+B*this.w[s],0)}sendEvent(){this.dispatchEvent(new CustomEvent("cpt-equation-vw2u-change",{detail:{v:this.v,w:this.w,n:this.n,u:this.u},bubbles:!0}))}vInput(t,B){this.v[t]=parseFloat(B.target.value),this.alignState(),this.sendEvent()}wInput(t,B){this.w[t]=parseFloat(B.target.value),this.alignState(),this.sendEvent()}nInput(t){this.n=parseFloat(t.target.value),this.alignState(),this.sendEvent()}vTemplate(t="",B="",s=!1){let Q;if(s){const s=Number.parseInt(t,10)-1;Q=M`<decidables-spinner class="v"
|
|
2215
2191
|
?disabled=${!this.interactive}
|
|
2216
2192
|
.value=${this.v[s]}
|
|
2217
2193
|
@input=${this.vInput.bind(this,s)}
|
|
@@ -2265,7 +2241,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2265
2241
|
${s}
|
|
2266
2242
|
</tbody>
|
|
2267
2243
|
</table>
|
|
2268
|
-
</div>`}}customElements.define("cpt-equation-vw2u",
|
|
2244
|
+
</div>`}}customElements.define("cpt-equation-vw2u",PL);class jL extends Qb{static get properties(){return{x:{attribute:"value",type:Number,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},v:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.x=10,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.alignState()}alignState(){this.v=sb.xal2v(this.x,this.a,this.l)}sendEvent(){this.dispatchEvent(new CustomEvent("cpt-equation-xal2v-change",{detail:{x:this.x,a:this.a,l:this.l,v:this.v},bubbles:!0}))}xInput(t){this.x=parseFloat(t.target.value),this.alignState(),this.sendEvent()}aInput(t){this.a=parseFloat(t.target.value),this.alignState(),this.sendEvent()}lInput(t){this.l=parseFloat(t.target.value),this.alignState(),this.sendEvent()}willUpdate(){this.alignState()}render(){let t,B,s,Q;this.numeric?(t=M`<decidables-spinner class="x bottom"
|
|
2269
2245
|
?disabled=${!this.interactive}
|
|
2270
2246
|
step="1"
|
|
2271
2247
|
.value=${this.x}
|
|
@@ -2311,7 +2287,7 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2311
2287
|
${F}
|
|
2312
2288
|
</tbody>
|
|
2313
2289
|
</table>
|
|
2314
|
-
</div>`}}customElements.define("cpt-equation-xal2v",
|
|
2290
|
+
</div>`}}customElements.define("cpt-equation-xal2v",jL);class _L extends Eo{static get styles(){return[super.styles,g`
|
|
2315
2291
|
:host {
|
|
2316
2292
|
---border: var(--border, 1px solid var(---color-border));
|
|
2317
2293
|
display: inline-block;
|
|
@@ -2361,5 +2337,5 @@ const Vo=t=>t??K;customElements.define("decidables-slider",class extends mo{stat
|
|
|
2361
2337
|
<div class="body">
|
|
2362
2338
|
<slot>Empty!</slot>
|
|
2363
2339
|
</div>
|
|
2364
|
-
</div>`}}customElements.define("cpt-example",nR);class aR extends nR{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},a:{attribute:!1,type:Number,reflect:!1},l:{attribute:!1,type:Number,reflect:!1},g:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.trials=10,this.duration=2e3,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.cptFit=null,this.cptParameters=null,this.cptProbability=null,this.cptValue=null,this.decisionSpace=null,this.prospectableControl=null,this.prospectableResponse=null,this.riskyTask=null}connectedCallback(){super.connectedCallback(),this.cptFit=this.querySelector("cpt-fit"),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.prospectableControl=this.querySelector("prospectable-control"),this.prospectableResponse=this.querySelector("prospectable-response"),this.riskyTask=this.querySelector("risky-task"),this.cptFit&&this.cptFit.addEventListener("cpt-fit-update",t=>{this.a=t.detail.a,this.l=t.detail.l,this.g=t.detail.g}),this.prospectableControl&&(this.prospectableControl.addEventListener("prospectable-control-trials",t=>{this.trials=t.detail.trials}),this.prospectableControl.addEventListener("prospectable-control-duration",t=>{this.duration=t.detail.duration}),this.prospectableControl.addEventListener("prospectable-control-run",()=>{this.riskyTask&&(this.riskyTask.running=!0)}),this.prospectableControl.addEventListener("prospectable-control-pause",()=>{this.riskyTask&&(this.riskyTask.running=!1)}),this.prospectableControl.addEventListener("prospectable-control-reset",()=>{this.riskyTask&&this.riskyTask.reset(),this.prospectableResponse&&this.prospectableResponse.reset(),this.decisionSpace&&this.decisionSpace.clear(),this.cptFit&&this.cptFit.clear()})),this.prospectableResponse&&this.prospectableResponse.addEventListener("prospectable-response",t=>{this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString()),this.cptFit&&this.cptFit.set(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())}),this.riskyTask&&(this.riskyTask.addEventListener("risky-trial-start",t=>{this.prospectableResponse&&this.prospectableResponse.start(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.gamblePayoff,t.detail.surePayoff,t.detail.better,t.detail.trial)}),this.riskyTask.addEventListener("risky-trial-end",()=>{this.prospectableResponse&&this.prospectableResponse.stop()}),this.riskyTask.addEventListener("risky-block-end",()=>{this.prospectableControl&&this.prospectableControl.complete()}))}update(t){super.update(t),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&(this.cptProbability.g=this.g),this.cptValue&&(this.cptValue.a=this.a,this.cptValue.l=this.l),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g),this.prospectableControl&&(this.prospectableControl.trials=null!=this.prospectableControl.trials?this.trials:void 0,this.prospectableControl.duration=null!=this.prospectableControl.trials?this.duration:void 0),this.prospectableResponse&&(this.prospectableResponse.trialTotal=this.trials),this.riskyTask&&(this.riskyTask.trials=this.trials,this.riskyTask.duration=this.duration,this.riskyTask.iti=this.duration)}}customElements.define("cpt-example-human",aR);class dR extends nR{static get properties(){return{a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.cptCalculation=null,this.cptParameters=null,this.cptProbability=null,this.cptSpace=null,this.cptValue=null,this.decisionSpace=null,this.riskyChoice=null}connectedCallback(){super.connectedCallback(),this.cptCalculation=this.querySelector("cpt-calculation"),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptSpace=this.querySelector("cpt-space"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.riskyChoice=this.querySelector("risky-choice"),this.cptCalculation&&this.cptCalculation.addEventListener("cpt-calculation-change",t=>{this.a=t.detail.a,this.l=t.detail.l,this.g=t.detail.g,this.xl=t.detail.xl,this.xw=t.detail.xw,this.pw=t.detail.pw,this.xs=t.detail.xs}),this.cptParameters&&(this.cptParameters.addEventListener("cpt-parameters-a",t=>{this.a=t.detail.a}),this.cptParameters.addEventListener("cpt-parameters-l",t=>{this.l=t.detail.l}),this.cptParameters.addEventListener("cpt-parameters-g",t=>{this.g=t.detail.g})),this.cptProbability&&this.cptProbability.addEventListener("cpt-probability-change",t=>{this.g=t.detail.g,this.pw=t.detail.p}),this.cptValue&&this.cptValue.addEventListener("cpt-value-change",t=>{this.a=t.detail.a,this.l=t.detail.l,"default"===t.detail.name?this.xs=t.detail.x:"gamble"===t.detail.name&&(this.xw=t.detail.x)}),this.riskyChoice&&this.riskyChoice.addEventListener("risky-choice-change",t=>{this.xl=t.detail.xl,this.xw=t.detail.xw,this.pw=t.detail.pw,this.xs=t.detail.xs}),this.requestUpdate()}update(t){super.update(t),this.cptCalculation&&(this.cptCalculation.a=this.a,this.cptCalculation.l=this.l,this.cptCalculation.g=this.g,this.cptCalculation.xl=this.xl,this.cptCalculation.xw=this.xw,this.cptCalculation.pw=this.pw,this.cptCalculation.xs=this.xs),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&this.cptProbability.set(this.pw,this.g,"default",""),this.cptSpace&&(this.cptSpace.a=this.a,this.cptSpace.l=this.l,this.cptSpace.g=this.g,this.cptSpace.xl=this.xl,this.cptSpace.xw=this.xw,this.cptSpace.pw=this.pw,this.cptSpace.xs=this.xs),this.cptValue&&(this.cptValue.set(this.xs,this.a,this.l,"default","s"),this.cptValue.set(this.xw,this.a,this.l,"gamble","g","default")),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g,this.decisionSpace.xl=this.xl,this.decisionSpace.xw=this.xw,this.decisionSpace.pw=this.pw,this.decisionSpace.xs=this.xs),this.riskyChoice&&(this.riskyChoice.xl=this.xl,this.riskyChoice.xw=this.xw,this.riskyChoice.pw=this.pw,this.riskyChoice.xs=this.xs)}}customElements.define("cpt-example-interactive",dR);class oR extends nR{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0}}}constructor(){super(),this.trials=10,this.duration=2e3,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.cptParameters=null,this.cptProbability=null,this.cptValue=null,this.decisionSpace=null,this.prospectableControl=null,this.prospectableResponse=null,this.riskyTask=null}connectedCallback(){super.connectedCallback(),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.prospectableControl=this.querySelector("prospectable-control"),this.prospectableResponse=this.querySelector("prospectable-response"),this.riskyTask=this.querySelector("risky-task"),this.cptParameters&&(this.cptParameters.addEventListener("cpt-parameters-a",t=>{this.a=t.detail.a}),this.cptParameters.addEventListener("cpt-parameters-l",t=>{this.l=t.detail.l}),this.cptParameters.addEventListener("cpt-parameters-g",t=>{this.g=t.detail.g})),this.cptProbability&&(this.cptProbability.addEventListener("cpt-probability-change",t=>{this.g=t.detail.g}),this.cptProbability.addEventListener("prospectable-response",t=>{this.prospectableResponse&&this.prospectableResponse.responded(t.detail.response),this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())})),this.cptValue&&(this.cptValue.addEventListener("cpt-value-change",t=>{this.a=t.detail.a,this.l=t.detail.l}),this.cptProbability||this.cptValue.addEventListener("prospectable-response",t=>{this.prospectableResponse&&this.prospectableResponse.responded(t.detail.response),this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())})),this.prospectableControl&&(this.prospectableControl.addEventListener("prospectable-control-trials",t=>{this.trials=t.detail.trials}),this.prospectableControl.addEventListener("prospectable-control-duration",t=>{this.duration=t.detail.duration}),this.prospectableControl.addEventListener("prospectable-control-run",()=>{this.cptProbability&&this.cptProbability.resumeTrial(),this.cptValue&&this.cptValue.resumeTrial(),this.riskyTask&&(this.riskyTask.running=!0)}),this.prospectableControl.addEventListener("prospectable-control-pause",()=>{this.cptProbability&&this.cptProbability.pauseTrial(),this.cptValue&&this.cptValue.pauseTrial(),this.riskyTask&&(this.riskyTask.running=!1)}),this.prospectableControl.addEventListener("prospectable-control-reset",()=>{this.cptProbability&&this.cptProbability.clear(),this.cptValue&&this.cptValue.clear(),this.riskyTask&&this.riskyTask.reset(),this.prospectableResponse&&this.prospectableResponse.reset(),this.decisionSpace&&this.decisionSpace.clear()})),this.riskyTask&&(this.riskyTask.addEventListener("risky-trial-start",t=>{this.prospectableResponse&&this.prospectableResponse.start(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.gamblePayoff,t.detail.surePayoff,t.detail.better,t.detail.trial),this.vw=sb.xal2v(this.xw,this.a,this.l),this.vl=sb.xal2v(this.xl,this.a,this.l),this.ww=sb.pg2w(this.pw,this.g),this.wl=1-this.ww,this.vs=sb.xal2v(this.xs,this.a,this.l),this.ug=this.vw*this.ww+this.vl*this.wl,this.us=this.vs;const B=sb.xal2v(t.detail.xw,this.a,this.l)*sb.pg2w(t.detail.pw,this.g)+sb.xal2v(t.detail.xl,this.a,this.l)*(1-sb.pg2w(t.detail.pw,this.g))>sb.xal2v(t.detail.xs,this.a,this.l)?"gamble":"sure";this.cptProbability&&this.cptProbability.trial(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.trial,B),this.cptValue&&this.cptValue.trial(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.trial,B)}),this.riskyTask.addEventListener("risky-trial-end",()=>{this.prospectableResponse&&this.prospectableResponse.stop()}),this.riskyTask.addEventListener("risky-block-end",()=>{this.prospectableControl&&this.prospectableControl.complete()})),this.requestUpdate()}update(t){super.update(t),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&(this.cptProbability.g=this.g),this.cptValue&&(this.cptValue.a=this.a,this.cptValue.l=this.l),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g),this.prospectableControl&&(this.prospectableControl.trials=null!=this.prospectableControl.trials?this.trials:void 0,this.prospectableControl.duration=null!=this.prospectableControl.trials?this.duration:void 0),this.riskyTask&&(this.riskyTask.trials=this.trials,this.riskyTask.duration=this.duration,this.riskyTask.iti=this.duration)}}customElements.define("cpt-example-model",oR),t.CPTCalculation=Fb,t.CPTEquationPG2W=IR,t.CPTEquationVW2U=lR,t.CPTEquationXAL2V=cR,t.CPTExampleHuman=aR,t.CPTExampleInteractive=dR,t.CPTExampleModel=oR,t.CPTFit=gL,t.CPTParameters=eL,t.CPTProbability=IL,t.CPTSpace=tR,t.CPTValue=BR,t.DecisionSpace=sR,t.ProspectableControl=QR,t.ProspectableElement=Eo,t.ProspectableResponse=FR,t.RiskyChoice=gR,t.RiskyOption=iR,t.RiskyOutcome=UR,t.RiskyTask=eR});
|
|
2340
|
+
</div>`}}customElements.define("cpt-example",_L);class $L extends _L{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},a:{attribute:!1,type:Number,reflect:!1},l:{attribute:!1,type:Number,reflect:!1},g:{attribute:!1,type:Number,reflect:!1}}}constructor(){super(),this.trials=10,this.duration=2e3,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.cptFit=null,this.cptParameters=null,this.cptProbability=null,this.cptValue=null,this.decisionSpace=null,this.prospectableControl=null,this.prospectableResponse=null,this.riskyTask=null}connectedCallback(){super.connectedCallback(),this.cptFit=this.querySelector("cpt-fit"),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.prospectableControl=this.querySelector("prospectable-control"),this.prospectableResponse=this.querySelector("prospectable-response"),this.riskyTask=this.querySelector("risky-task"),this.cptFit&&this.cptFit.addEventListener("cpt-fit-update",t=>{this.a=t.detail.a,this.l=t.detail.l,this.g=t.detail.g}),this.prospectableControl&&(this.prospectableControl.addEventListener("prospectable-control-trials",t=>{this.trials=t.detail.trials}),this.prospectableControl.addEventListener("prospectable-control-duration",t=>{this.duration=t.detail.duration}),this.prospectableControl.addEventListener("prospectable-control-run",()=>{this.riskyTask&&(this.riskyTask.running=!0)}),this.prospectableControl.addEventListener("prospectable-control-pause",()=>{this.riskyTask&&(this.riskyTask.running=!1)}),this.prospectableControl.addEventListener("prospectable-control-reset",()=>{this.riskyTask&&this.riskyTask.reset(),this.prospectableResponse&&this.prospectableResponse.reset(),this.decisionSpace&&this.decisionSpace.clear(),this.cptFit&&this.cptFit.clear()})),this.prospectableResponse&&this.prospectableResponse.addEventListener("prospectable-response",t=>{this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString()),this.cptFit&&this.cptFit.set(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())}),this.riskyTask&&(this.riskyTask.addEventListener("risky-trial-start",t=>{this.prospectableResponse&&this.prospectableResponse.start(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.gamblePayoff,t.detail.surePayoff,t.detail.better,t.detail.trial)}),this.riskyTask.addEventListener("risky-trial-end",()=>{this.prospectableResponse&&this.prospectableResponse.stop()}),this.riskyTask.addEventListener("risky-block-end",()=>{this.prospectableControl&&this.prospectableControl.complete()}))}update(t){super.update(t),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&(this.cptProbability.g=this.g),this.cptValue&&(this.cptValue.a=this.a,this.cptValue.l=this.l),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g),this.prospectableControl&&(this.prospectableControl.trials=null!=this.prospectableControl.trials?this.trials:void 0,this.prospectableControl.duration=null!=this.prospectableControl.trials?this.duration:void 0),this.prospectableResponse&&(this.prospectableResponse.trialTotal=this.trials),this.riskyTask&&(this.riskyTask.trials=this.trials,this.riskyTask.duration=this.duration,this.riskyTask.iti=this.duration)}}customElements.define("cpt-example-human",$L);class qL extends _L{static get properties(){return{a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0},xl:{attribute:"loss",type:Number,reflect:!0},xw:{attribute:"win",type:Number,reflect:!0},pw:{attribute:"probability",type:Number,reflect:!0},xs:{attribute:"sure",type:Number,reflect:!0}}}constructor(){super(),this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.cptCalculation=null,this.cptParameters=null,this.cptProbability=null,this.cptSpace=null,this.cptValue=null,this.decisionSpace=null,this.riskyChoice=null}connectedCallback(){super.connectedCallback(),this.cptCalculation=this.querySelector("cpt-calculation"),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptSpace=this.querySelector("cpt-space"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.riskyChoice=this.querySelector("risky-choice"),this.cptCalculation&&this.cptCalculation.addEventListener("cpt-calculation-change",t=>{this.a=t.detail.a,this.l=t.detail.l,this.g=t.detail.g,this.xl=t.detail.xl,this.xw=t.detail.xw,this.pw=t.detail.pw,this.xs=t.detail.xs}),this.cptParameters&&(this.cptParameters.addEventListener("cpt-parameters-a",t=>{this.a=t.detail.a}),this.cptParameters.addEventListener("cpt-parameters-l",t=>{this.l=t.detail.l}),this.cptParameters.addEventListener("cpt-parameters-g",t=>{this.g=t.detail.g})),this.cptProbability&&this.cptProbability.addEventListener("cpt-probability-change",t=>{this.g=t.detail.g,this.pw=t.detail.p}),this.cptValue&&this.cptValue.addEventListener("cpt-value-change",t=>{this.a=t.detail.a,this.l=t.detail.l,"default"===t.detail.name?this.xs=t.detail.x:"gamble"===t.detail.name&&(this.xw=t.detail.x)}),this.riskyChoice&&this.riskyChoice.addEventListener("risky-choice-change",t=>{this.xl=t.detail.xl,this.xw=t.detail.xw,this.pw=t.detail.pw,this.xs=t.detail.xs}),this.requestUpdate()}update(t){super.update(t),this.cptCalculation&&(this.cptCalculation.a=this.a,this.cptCalculation.l=this.l,this.cptCalculation.g=this.g,this.cptCalculation.xl=this.xl,this.cptCalculation.xw=this.xw,this.cptCalculation.pw=this.pw,this.cptCalculation.xs=this.xs),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&this.cptProbability.set(this.pw,this.g,"default",""),this.cptSpace&&(this.cptSpace.a=this.a,this.cptSpace.l=this.l,this.cptSpace.g=this.g,this.cptSpace.xl=this.xl,this.cptSpace.xw=this.xw,this.cptSpace.pw=this.pw,this.cptSpace.xs=this.xs),this.cptValue&&(this.cptValue.set(this.xs,this.a,this.l,"default","s"),this.cptValue.set(this.xw,this.a,this.l,"gamble","g","default")),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g,this.decisionSpace.xl=this.xl,this.decisionSpace.xw=this.xw,this.decisionSpace.pw=this.pw,this.decisionSpace.xs=this.xs),this.riskyChoice&&(this.riskyChoice.xl=this.xl,this.riskyChoice.xw=this.xw,this.riskyChoice.pw=this.pw,this.riskyChoice.xs=this.xs)}}customElements.define("cpt-example-interactive",qL);class tR extends _L{static get properties(){return{trials:{attribute:"trials",type:Number,reflect:!0},duration:{attribute:"duration",type:Number,reflect:!0},a:{attribute:"alpha",type:Number,reflect:!0},l:{attribute:"lambda",type:Number,reflect:!0},g:{attribute:"gamma",type:Number,reflect:!0}}}constructor(){super(),this.trials=10,this.duration=2e3,this.a=sb.a.DEFAULT,this.l=sb.l.DEFAULT,this.g=sb.g.DEFAULT,this.xl=0,this.xw=20,this.pw=.5,this.xs=10,this.cptParameters=null,this.cptProbability=null,this.cptValue=null,this.decisionSpace=null,this.prospectableControl=null,this.prospectableResponse=null,this.riskyTask=null}connectedCallback(){super.connectedCallback(),this.cptParameters=this.querySelector("cpt-parameters"),this.cptProbability=this.querySelector("cpt-probability"),this.cptValue=this.querySelector("cpt-value"),this.decisionSpace=this.querySelector("decision-space"),this.prospectableControl=this.querySelector("prospectable-control"),this.prospectableResponse=this.querySelector("prospectable-response"),this.riskyTask=this.querySelector("risky-task"),this.cptParameters&&(this.cptParameters.addEventListener("cpt-parameters-a",t=>{this.a=t.detail.a}),this.cptParameters.addEventListener("cpt-parameters-l",t=>{this.l=t.detail.l}),this.cptParameters.addEventListener("cpt-parameters-g",t=>{this.g=t.detail.g})),this.cptProbability&&(this.cptProbability.addEventListener("cpt-probability-change",t=>{this.g=t.detail.g}),this.cptProbability.addEventListener("prospectable-response",t=>{this.prospectableResponse&&this.prospectableResponse.responded(t.detail.response),this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())})),this.cptValue&&(this.cptValue.addEventListener("cpt-value-change",t=>{this.a=t.detail.a,this.l=t.detail.l}),this.cptProbability||this.cptValue.addEventListener("prospectable-response",t=>{this.prospectableResponse&&this.prospectableResponse.responded(t.detail.response),this.decisionSpace&&this.decisionSpace.set(t.detail.xw,t.detail.pw,t.detail.xs,t.detail.response,t.detail.trial.toString(),t.detail.trial.toString())})),this.prospectableControl&&(this.prospectableControl.addEventListener("prospectable-control-trials",t=>{this.trials=t.detail.trials}),this.prospectableControl.addEventListener("prospectable-control-duration",t=>{this.duration=t.detail.duration}),this.prospectableControl.addEventListener("prospectable-control-run",()=>{this.cptProbability&&this.cptProbability.resumeTrial(),this.cptValue&&this.cptValue.resumeTrial(),this.riskyTask&&(this.riskyTask.running=!0)}),this.prospectableControl.addEventListener("prospectable-control-pause",()=>{this.cptProbability&&this.cptProbability.pauseTrial(),this.cptValue&&this.cptValue.pauseTrial(),this.riskyTask&&(this.riskyTask.running=!1)}),this.prospectableControl.addEventListener("prospectable-control-reset",()=>{this.cptProbability&&this.cptProbability.clear(),this.cptValue&&this.cptValue.clear(),this.riskyTask&&this.riskyTask.reset(),this.prospectableResponse&&this.prospectableResponse.reset(),this.decisionSpace&&this.decisionSpace.clear()})),this.riskyTask&&(this.riskyTask.addEventListener("risky-trial-start",t=>{this.prospectableResponse&&this.prospectableResponse.start(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.gamblePayoff,t.detail.surePayoff,t.detail.better,t.detail.trial),this.vw=sb.xal2v(this.xw,this.a,this.l),this.vl=sb.xal2v(this.xl,this.a,this.l),this.ww=sb.pg2w(this.pw,this.g),this.wl=1-this.ww,this.vs=sb.xal2v(this.xs,this.a,this.l),this.ug=this.vw*this.ww+this.vl*this.wl,this.us=this.vs;const B=sb.xal2v(t.detail.xw,this.a,this.l)*sb.pg2w(t.detail.pw,this.g)+sb.xal2v(t.detail.xl,this.a,this.l)*(1-sb.pg2w(t.detail.pw,this.g))>sb.xal2v(t.detail.xs,this.a,this.l)?"gamble":"sure";this.cptProbability&&this.cptProbability.trial(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.trial,B),this.cptValue&&this.cptValue.trial(t.detail.xl,t.detail.xw,t.detail.pw,t.detail.xs,t.detail.trial,B)}),this.riskyTask.addEventListener("risky-trial-end",()=>{this.prospectableResponse&&this.prospectableResponse.stop()}),this.riskyTask.addEventListener("risky-block-end",()=>{this.prospectableControl&&this.prospectableControl.complete()})),this.requestUpdate()}update(t){super.update(t),this.cptParameters&&(this.cptParameters.a=null!=this.cptParameters.a?this.a:void 0,this.cptParameters.l=null!=this.cptParameters.l?this.l:void 0,this.cptParameters.g=null!=this.cptParameters.g?this.g:void 0),this.cptProbability&&(this.cptProbability.g=this.g),this.cptValue&&(this.cptValue.a=this.a,this.cptValue.l=this.l),this.decisionSpace&&(this.decisionSpace.a=this.a,this.decisionSpace.l=this.l,this.decisionSpace.g=this.g),this.prospectableControl&&(this.prospectableControl.trials=null!=this.prospectableControl.trials?this.trials:void 0,this.prospectableControl.duration=null!=this.prospectableControl.trials?this.duration:void 0),this.riskyTask&&(this.riskyTask.trials=this.trials,this.riskyTask.duration=this.duration,this.riskyTask.iti=this.duration)}}customElements.define("cpt-example-model",tR),t.CPTCalculation=Fb,t.CPTEquationPG2W=OL,t.CPTEquationVW2U=PL,t.CPTEquationXAL2V=jL,t.CPTExampleHuman=$L,t.CPTExampleInteractive=qL,t.CPTExampleModel=tR,t.CPTFit=gL,t.CPTParameters=eL,t.CPTProbability=IL,t.CPTSpace=wL,t.CPTValue=vL,t.DecisionSpace=YL,t.ProspectableControl=JL,t.ProspectableElement=Eo,t.ProspectableResponse=kL,t.RiskyChoice=zL,t.RiskyOption=ML,t.RiskyOutcome=TL,t.RiskyTask=KL});
|
|
2365
2341
|
//# sourceMappingURL=prospectableElements.umd.min.js.map
|