diff --git a/nereid/nereid/data/default_data/state/region/config.yml b/nereid/nereid/data/default_data/state/region/config.yml index b1446fb8..62bed8fd 100644 --- a/nereid/nereid/data/default_data/state/region/config.yml +++ b/nereid/nereid/data/default_data/state/region/config.yml @@ -338,3 +338,12 @@ project_reference_data: short_name: dwFC concentration_unit: MPN/_100mL load_unit: mpn +project_spatial_data: + design_storm: + name: 85_percentile_design_storm_depth + url: "https://ocgis.com/arcpub/rest/services/Environmental_Resources/Hydrologic_Response_Unit/FeatureServer/3/query?where=1%3D1&outFields=*&returnGeometry=true&f=geojson" + field: RainfallZo + ref_data_key: + name: ref_data_key_rainzone + url: "https://ocgis.com/arcpub/rest/services/Environmental_Resources/Hydrologic_Response_Unit/FeatureServer/7/query?where=1%3D1&outFields=*&returnGeometry=true&f=geojson" + field: MODEL_BASIN diff --git a/nereid/nereid/factory.py b/nereid/nereid/factory.py index c7ecaff5..7761022a 100644 --- a/nereid/nereid/factory.py +++ b/nereid/nereid/factory.py @@ -91,6 +91,12 @@ async def redoc_html() -> HTMLResponse: async def check_config(context=Depends(get_valid_context)): return context + app.mount( + "/app", + StaticFiles(directory=str(static_path / "frontend/dist"), html=True), + name="app", + ) + @app.get("/ping") @app.get("/") async def ping(): # pragma: no cover diff --git a/nereid/nereid/static/frontend/.gitignore b/nereid/nereid/static/frontend/.gitignore new file mode 100644 index 00000000..a772854d --- /dev/null +++ b/nereid/nereid/static/frontend/.gitignore @@ -0,0 +1,3 @@ +node_modules +!lib +!dist diff --git a/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css b/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css new file mode 100644 index 00000000..6542152c --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/index-DmpQbGXd.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-lg{font-size:1.125rem;line-height:1.7777778}.prose-lg :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2222222em;line-height:1.4545455;margin-top:1.0909091em;margin-bottom:1.0909091em}.prose-lg :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6666667em;margin-bottom:1.6666667em;padding-left:1em}.prose-lg :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.6666667em;margin-top:0;margin-bottom:.8333333em;line-height:1}.prose-lg :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.6666667em;margin-top:1.8666667em;margin-bottom:1.0666667em;line-height:1.3333333}.prose-lg :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.3333333em;margin-top:1.6666667em;margin-bottom:.6666667em;line-height:1.5}.prose-lg :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:.4444444em;line-height:1.5555556}.prose-lg :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;border-radius:.3125rem;padding:.2222222em .4444444em}.prose-lg :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-lg :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8666667em}.prose-lg :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em}.prose-lg :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.75;margin-top:2em;margin-bottom:2em;border-radius:.375rem;padding:1em 1.5em}.prose-lg :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5555556em}.prose-lg :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;margin-bottom:.6666667em}.prose-lg :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4444444em}.prose-lg :where(.prose-lg>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(.prose-lg>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(.prose-lg>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.prose-lg :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8888889em;margin-bottom:.8888889em}.prose-lg :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.prose-lg :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.prose-lg :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;padding-left:1.5555556em}.prose-lg :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:3.1111111em;margin-bottom:3.1111111em}.prose-lg :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5}.prose-lg :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:.75em;padding-bottom:.75em;padding-left:.75em}.prose-lg :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.75em}.prose-lg :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose-lg :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose-lg :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em}.prose-lg :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-lg :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em;line-height:1.5;margin-top:1em}.prose-lg :where(.prose-lg>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-lg :where(.prose-lg>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.btn{border-radius:.25rem;padding:.25rem .5rem;font-weight:700}.btn-blue{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-blue:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.btn-gray{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-gray:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.tab{flex:1 1 0%;cursor:pointer;padding-bottom:.75rem;text-align:center;font-weight:500}.tab:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab.active{flex:1 1 0%;cursor:pointer;padding-bottom:.75rem;text-align:center;font-weight:500;--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab.active:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.tab-slider{position:absolute;bottom:0;left:0;display:block;height:.25rem;width:100%;--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity));transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;transition-timing-function:cubic-bezier(0,0,.2,1)}.button-radio-label{display:flex;height:100%;cursor:pointer;flex-direction:column;border-radius:.5rem;border-width:2px;--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity));padding:.5rem;text-align:center;font-size:.75rem;line-height:1rem;font-weight:700;opacity:.5}.markdown ol{list-style-position:outside;list-style-type:decimal}@media (min-width: 768px){.markdown ol{list-style-position:inside}}.markdown ul{list-style-position:outside;list-style-type:disc}@media (min-width: 768px){.markdown ul{list-style-position:inside}}.markdown h1{padding-top:2rem;font-size:1.5rem;line-height:2rem;font-weight:700}.markdown h2{padding-top:1rem;font-size:1.25rem;line-height:1.75rem;font-weight:600}.markdown h3{padding-top:.5rem;font-size:1.125rem;line-height:1.75rem;font-weight:600;font-style:italic}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.left-0{left:0}.left-1{left:.25rem}.right-0{right:0}.top-0{top:0}.top-1{top:.25rem}.z-10{z-index:10}.col-span-2{grid-column:span 2 / span 2}.m-2{margin:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-ml-8{margin-left:-2rem}.mb-2{margin-bottom:.5rem}.ml-3{margin-left:.75rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0px}.h-10{height:2.5rem}.h-12{height:3rem}.h-20{height:5rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\[500px\]{height:500px}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:24rem}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-20{width:5rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-\[200px\]{width:200px}.w-\[800px\]{width:800px}.w-full{width:100%}.w-screen{width:100vw}.min-w-\[700px\]{min-width:700px}.max-w-\[1000px\]{max-width:1000px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-screen-md{max-width:768px}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-double{--tw-translate-x: 200%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-octa{--tw-translate-x: 800%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-pent{--tw-translate-x: 500%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-quad{--tw-translate-x: 400%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-sept{--tw-translate-x: 700%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-sext{--tw-translate-x: 600%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-triple{--tw-translate-x: 300%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-4{--tw-translate-y: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.content-center{align-content:center}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-y-2{row-gap:.5rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-dashed{border-style:dashed}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.bg-\[\#32cd32\]{--tw-bg-opacity: 1;background-color:rgb(50 205 50 / var(--tw-bg-opacity))}.bg-\[\#4682b4\]{--tw-bg-opacity: 1;background-color:rgb(70 130 180 / var(--tw-bg-opacity))}.bg-\[\#ffa500\]{--tw-bg-opacity: 1;background-color:rgb(255 165 0 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity))}.bg-green-300{--tw-bg-opacity: 1;background-color:rgb(134 239 172 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-300{--tw-bg-opacity: 1;background-color:rgb(252 165 165 / var(--tw-bg-opacity))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity))}.bg-yellow-300{--tw-bg-opacity: 1;background-color:rgb(253 224 71 / var(--tw-bg-opacity))}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-75{--tw-bg-opacity: .75}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-24{padding-left:6rem;padding-right:6rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-10{padding-bottom:2.5rem}.pb-2{padding-bottom:.5rem}.pb-20{padding-bottom:5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-20{padding-top:5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-justify{text-align:justify}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.leading-6{line-height:1.5rem}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity))}.placeholder-gray-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity))}.placeholder-gray-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(75 85 99 / var(--tw-placeholder-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-40{opacity:.4}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.graph-editor path.link{fill:none;stroke:#222;stroke-width:5px;cursor:pointer}.graph-editor text{pointer-events:none}.graph-editor text.id{text-anchor:middle}.graph-editor path.link.selected{stroke-dasharray:10,2}.graph-editor path.link.dragline{pointer-events:none}.graph-editor circle.node{stroke-width:1.5px;cursor:pointer}.no-select{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}#type-form input:checked+label{border-color:#000;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d;color:#fff;opacity:1}input:checked~.dot{transform:translate(100%);background-color:#48bb78}.form-group.required .control-label:before{content:"*";color:red;font-weight:700}@media (min-width: 768px){.md\:prose-2xl{font-size:1.5rem;line-height:1.6666667}.md\:prose-2xl :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.md\:prose-2xl :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.25em;line-height:1.4666667;margin-top:1.0666667em;margin-bottom:1.0666667em}.md\:prose-2xl :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7777778em;margin-bottom:1.7777778em;padding-left:1.1111111em}.md\:prose-2xl :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.6666667em;margin-top:0;margin-bottom:.875em;line-height:1}.md\:prose-2xl :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2em;margin-top:1.5em;margin-bottom:.8333333em;line-height:1.0833333}.md\:prose-2xl :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.5em;margin-top:1.5555556em;margin-bottom:.6666667em;line-height:1.2222222}.md\:prose-2xl :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6666667em;margin-bottom:.6666667em;line-height:1.5}.md\:prose-2xl :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.md\:prose-2xl :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;border-radius:.375rem;padding:.25em .3333333em}.md\:prose-2xl :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em}.md\:prose-2xl :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em}.md\:prose-2xl :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.md\:prose-2xl :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.8;margin-top:2em;margin-bottom:2em;border-radius:.5rem;padding:1.2em 1.6em}.md\:prose-2xl :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5833333em}.md\:prose-2xl :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-left:1.5833333em}.md\:prose-2xl :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.md\:prose-2xl :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4166667em}.md\:prose-2xl :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.4166667em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8333333em;margin-bottom:.8333333em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ul>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ol>li>*:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(.md\:prose-2xl>ol>li>*:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.3333333em}.md\:prose-2xl :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6666667em;margin-bottom:.6666667em}.md\:prose-2xl :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em}.md\:prose-2xl :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em}.md\:prose-2xl :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.5833333em}.md\:prose-2xl :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:3em;margin-bottom:3em}.md\:prose-2xl :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.4}.md\:prose-2xl :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:.6em;padding-bottom:.8em;padding-left:.6em}.md\:prose-2xl :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.md\:prose-2xl :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.md\:prose-2xl :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.8em .6em}.md\:prose-2xl :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.md\:prose-2xl :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.md\:prose-2xl :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.md\:prose-2xl :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.md\:prose-2xl :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8333333em;line-height:1.6;margin-top:1em}.md\:prose-2xl :where(.md\:prose-2xl>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.md\:prose-2xl :where(.md\:prose-2xl>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity))}.hover\:bg-yellow-700:hover{--tw-bg-opacity: 1;background-color:rgb(161 98 7 / var(--tw-bg-opacity))}.hover\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-black:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.focus\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.focus\:ring-green-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(34 197 94 / var(--tw-ring-opacity))}.focus\:ring-red-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity))}.focus\:ring-yellow-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 179 8 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}@media (min-width: 640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:my-8{margin-top:2rem;margin-bottom:2rem}.sm\:-ml-10{margin-left:-2.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:mt-0{margin-top:0}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:items-start{align-items:flex-start}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:pb-4{padding-bottom:1rem}.sm\:pr-4{padding-right:1rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:duration-700{transition-duration:.7s}}@media (min-width: 768px){.md\:flex{display:flex}.md\:max-w-lg{max-width:32rem}}@media (min-width: 1024px){.lg\:max-w-lg{max-width:32rem}} diff --git a/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js b/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js new file mode 100644 index 00000000..70376eec --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/index-m-Qkl2xL.js @@ -0,0 +1,707 @@ +var me=Object.defineProperty;var fe=(i,e,t)=>e in i?me(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var R=(i,e,t)=>(fe(i,typeof e!="symbol"?e+"":e,t),t);import{j as ye,D as he,s as ge,a as be,b as ve,e as we,f as ke,g as Se,c as xe,d as Te,h as $e,i as je,k as Re,q as Fe,l as De,t as Ee,m as Ne,n as Ae,o as qe,p as Oe,r as Le,z as Ce,u as Y,v as Ie,F as W}from"./vendor-QiQdsv75.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const n of s.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();class Me{constructor(){this.events={}}subscribe(e,t){let a=this;return a.events.hasOwnProperty(e)||(a.events[e]=[]),a.events[e].push(t),!0}publish(e,t={}){let a=this;return m.state.DEBUG&&console.log("published event: ",e),a.events.hasOwnProperty(e)?(a.events[e].map(r=>r(t)),!0):(m.state.DEBUG&&console.log(`no subscribers for event ${e}`),a.events[e]=[],!1)}}class z{constructor(e){let t=this;t.actions={},t.mutations={},t.state={},t.status="resting",t.events=new Me,t.state=new Proxy(e.state||{},{set:function(a,r,s){return a[r]=s,m.state.DEBUG&&console.log(`stateChange: ${r}`,s),t.status!=="mutation"&&(m.state.DEBUG&&console.warn(`You should use a mutation to set ${r}`),t.events.publish("stateChange",t.state)),!0}})}dispatch(e,t){let a=this;return typeof a.actions[e]!="function"&&(m.state.DEBUG&&console.log(`Action "${e} doesn't exist.`),a.actions[e]=(r,s)=>{r.commit(e,s)}),m.state.DEBUG&&console.groupCollapsed(`ACTION: ${e}`),a.status="action",a.actions[e](a,t),m.state.DEBUG&&console.groupEnd(),!0}commit(e,t){let a=this;typeof a.mutations[e]!="function"&&(m.state.DEBUG&&console.log(`Mutation "${e}" doesn't exist`),a.mutations[e]=(s,n)=>n),a.status="mutation";let r=a.mutations[e](a.state,t);return a.state=Object.assign(a.state,r),a.events.publish("stateChange",a.state),a.events.publish(e,a.state),a.status="resting",!0}}const Pe={DEBUG:!1,config:{},scenario_name:"New Scenario",nereid_host:"",nereid_api_latest:"/api/v1",nereid_state:"state",nereid_region:"region",facility_types:[],facility_type_map:{},initialScale:1<<20,initialCenter:[-116.9337,32.74337],staged_changes:{},default_nodesize:20,max_graph_size:100,map_mode:!0,show_states:!0,graph_edit_mode:!0,show_info_tooltip:!0,treatment_facility_fields:{state:{region:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type"]}},ca:{cosd:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type","ref_data_key","design_storm_depth_inches"]},soc:{ignored:["is_online","offline_diversion_rate_cfs","eliminate_all_dry_weather_flow_override"],disabled:["facility_type"]}}},node_types:{land_surface:{title:"Land Surface",color:"limegreen"},treatment_facility:{title:"Treatment Facility",color:"steelblue"},treatment_site:{title:"Treatment Site",color:"orangered",disabled:!0},none:{title:"None",color:"dimgrey"}},default_graph:{nodes:[{id:"0",node_type:"treatment_facility"},{id:"1",node_type:"land_surface"}],edges:[{source:"1",target:"0"}]}},m=new z({state:Pe}),Ve=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="land_surface"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),X=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="treatment_facility"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),We=()=>w((p(m,"state.graph.nodes")||[]).filter(i=>(i==null?void 0:i.node_type)==="treatment_site"&&(i==null?void 0:i.data)).map(i=>i==null?void 0:i.data)),Z=()=>({edges:(p(m,"state.graph.edges")||[]).map(e=>({source:e.source.id.toString(),target:e.target.id.toString()})),directed:!0,multigraph:!0}),ze=()=>({graph:Z(),land_surfaces:Ve()||[],treatment_facilities:X()||[],treatment_sites:We()||[]}),D={getOpenApi:async i=>{let e;try{return e=await A(`${i}/openapi.json`),e}catch(t){return console.error(t),Be}},getConfig:async(i,e,t)=>{var r,s;let a;try{return a=await A(`${i}/config?state=${e}®ion=${t}`),(s=(r=a==null?void 0:a.detail)==null?void 0:r.toLowerCase())!=null&&s.includes("no config")?(console.warn(`no config for ${e} ${t}`),G):a}catch(n){return console.error(n),G}},getReferenceData:async(i,e,t,a,r)=>{let s;try{return s=await A(`${i}${e}/reference_data_file?state=${t}®ion=${a}&filename=${r}`),s}catch(n){console.error(n)}},postValidateNetwork:async(i,e,t,a,r)=>{var c;let s=`${i}${e}/network/validate?state=${t}®ion=${a}`,n;try{return n=await C(s,r),(c=n==null?void 0:n.data)!=null&&c.isvalid?{title:"Validation Succeeded",msg:"Success",alert_type:"success"}:{title:"Validation Errors",msg:`
${JSON.stringify(n==null?void 0:n.data,void 0,2)}
`,alert_type:"error"}}catch(_){return{title:"Validation Error",msg:`
${JSON.stringify(_,void 0,2)}
`,alert_type:"error"}}},postValidateTreatmentFacilities:async(i,e,t,a,r)=>{var c,_;let s=`${i}${e}/treatment_facility/validate?state=${t}®ion=${a}`,n;try{n=await C(s,r);let u=[];for(let o of(c=n==null?void 0:n.data)==null?void 0:c.treatment_facilities)o!=null&&o.errors&&u.push(o==null?void 0:o.errors.replace(/\n/g," "));for(let o of(_=n==null?void 0:n.data)==null?void 0:_.errors)o.toLowerCase().substring(0,6).includes("error")&&u.push(o);return u.length==0?{title:"Validation Succeeded",msg:"",alert_type:"success"}:{title:"Validation Errors",msg:`
${JSON.stringify(u,void 0,2)}
`,alert_type:"error"}}catch(u){return{title:"Validation Error",msg:`
${JSON.stringify(u,void 0,2)}
`,alert_type:"error"}}},postSolveWatershed:async(i,e,t,a,r)=>{var c,_,u;let s=`${i}${e}/watershed/solve?state=${t}®ion=${a}`,n;try{if(n=await C(s,r),((_=(c=n==null?void 0:n.data)==null?void 0:c.errors)==null?void 0:_.length)==0)return n}catch(o){console.error(o)}return console.error(n,(u=n==null?void 0:n.data)==null?void 0:u.errors),n}},ee=async i=>{let{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.getReferenceData(e,t,a,r,i)}catch(n){console.error(n)}return s},te=async()=>{let i=Z(),{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postValidateNetwork(e,t,a,r,i)}catch(n){console.error(n)}return s},ae=async()=>{let i={treatment_facilities:X()},{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postValidateTreatmentFacilities(e,t,a,r,i)}catch(n){console.error(n)}return s},re=async()=>{let i=ze(),{nereid_host:e,nereid_api_latest:t,nereid_state:a,nereid_region:r}=p(m,"state"),s;try{s=await D.postSolveWatershed(e,t,a,r,i)}catch(n){console.error(n)}return s};function se(i,e){for(let t in i)if(typeof i[t]=="object"&&i[t]!==null)se(i[t],e);else if(t=="$ref"){let a=i[t].split("/").slice(-1).pop();a&&(delete i.$ref,i=Object.assign(i,e[a]))}}const ie=async({nereid_host:i,nereid_state:e,nereid_region:t})=>{i||(i=window.location.origin);const a=await D.getOpenApi(i),r=await D.getConfig(i,e,t),s=v(a.components.schemas);for(let l in s)se(s[l],s);const n=r.api_recognize.treatment_facility.facility_type,c={};for(const[l,d]of Object.entries(n))c[l]=d.validator;const _={};for(const[l,d]of Object.entries(n))if(d!=null&&d.alias)for(let f of d==null?void 0:d.alias)_[f]=l;else _[l]=l;const u={};for(const[l,d]of Object.entries(n))u[(d==null?void 0:d.label)||l]=l;const o=Object.keys(u);return{nereid_host:i,nereid_state:e,nereid_region:t,config:r,openapi:a,schema:s,facility_types:o,facility_type_map:c,facility_alias_map:_,facility_label_map:u}},G={default_data_directory:"default_data",project_data_directory:"project_data",version:"0.4.3",author:"Austin Orr",contact:"aorr@geosyntec.com",state:"state",region:"region",test:!0,pint_unit_registry:["MPN = count = mpn","_100ml = 100 * milliliter = _100mL"],api_recognize:{land_surfaces:{preprocess:[{expand_fields:[{field:"surface_key",sep:"-",new_column_names:["subbasin","land_use","soil","slope"]}]},{collapse_fields:[{new_column_name:"fuzzy_key",sep:"-",fields:["land_use"]}]},{joins:[{other:"land_surface_table",how:"left",left_on:"surface_key",right_on:"surface_id",validate:"many_to_one",indicator:!0,fuzzy_on:["fuzzy_key"]},{other:"land_surface_emc_table",how:"left",left_on:"land_use",right_on:"land_use",validate:"many_to_one",indicator:!0},{other:"dry_weather_land_surface_emc_table",how:"left",left_on:"land_use",right_on:"land_use",validate:"many_to_one",indicator:!0},{other:"met_table",how:"left",left_on:"subbasin",right_on:"subbasin",validate:"many_to_one",indicator:!0},{other:"dry_weather_flow_table",how:"left",left_on:"rain_gauge",right_on:"rain_gauge",validate:"many_to_one",indicator:!0}]},{remaps:[{left:"soil",right:"imp_pct",how:"addend",mapping:{water:100}},{left:"land_use",right:"is_developed",how:"left",fillna:!1,mapping:{COMM:!0,EDU:!0,IND:!0,UTIL:!0,RESSFH:!0,RESSFL:!0,RESMF:!0,TRFWY:!0,TRANS:!0,TROTH:!0}}]}]},treatment_facility:{preprocess:[{joins:[{other:"met_table",how:"left",left_on:"ref_data_key",right_on:"subbasin",validate:"many_to_one",indicator:!0}]},{remaps:[{left:"hsg",right:"inf_rate_inhr",how:"left",fillna:1e-6,mapping:{a:2.5,b:.8,c:.24,d:.024,lined:1e-6}}]}],facility_type:{no_treatment:{validator:"NTFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_extended_detention:{validator:"RetAndTmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Detention Basin"},infiltration:{validator:"RetentionFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},bioretention:{validator:"BioInfFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Biofiltration"},biofiltration:{validator:"TmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Biofiltration"},wet_detention:{validator:"PermPoolFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Wet Pond"},sand_filter:{validator:"TmntFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Sand Filter"},swale:{validator:"FlowAndRetFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Vegetated Swale"},hydrodynamic_separator:{validator:"FlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Hydrodynamic Separator"},dry_well:{validator:"DryWellFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},cistern:{validator:"CisternFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_weather_diversion:{validator:"DryWeatherDiversionLowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"},dry_weather_treatment:{validator:"DryWeatherTreatmentLowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"Sand Filter"},low_flow_facility:{validator:"LowFlowFacility",validation_fallback:"NTFacility",tmnt_performance_facility_type:"¯\\_(ツ)_/¯"}}}},project_reference_data:{dry_weather_flow_table:{file:"dry_weather_flow.json",seasons:{winter:["oct","nov","dec","jan","feb","mar"],summer:["apr","may","jun","jul","aug","sep"]}},met_table:{file:"met_data.json",volume_nomo:{x_col:"size_fraction",t_col:"ddt_hr",y_col:"capture_fraction"},flow_nomo:{x_col:"intensity_inhr",t_col:"tc_minutes",y_col:"performance_frac"},preprocess:[{remaps:[{left:"rain_gauge",right:"volume_nomograph",how:"left",mapping:{"100_LAGUNABEACH":"nomographs/100_LAGUNABEACH_volume_nomo.csv","1130_LAGUNA_AUDUBON":"nomographs/1130_LAGUNA_AUDUBON_volume_nomo.csv"}},{left:"rain_gauge",right:"flow_nomograph",how:"left",mapping:{"100_LAGUNABEACH":"nomographs/100_LAGUNABEACH_flow_nomo.csv","1130_LAGUNA_AUDUBON":"nomographs/1130_LAGUNA_AUDUBON_flow_nomo.csv"}}]}]},dry_weather_tmnt_performance_table:{file:"dry_weather_bmp_params.json",facility_column:"facility_type",pollutant_column:"pollutant",preprocess:[{remaps:[{left:"unit",right:"--",how:"replace",mapping:{"MPN/100mL":"MPN/_100ml","MPN/100 mL":"MPN/_100ml"}}]}]},tmnt_performance_table:{file:"bmp_params.json",facility_column:"facility_type",pollutant_column:"pollutant",preprocess:[{remaps:[{left:"unit",right:"--",how:"replace",mapping:{"MPN/100mL":"MPN/_100ml","MPN/100 mL":"MPN/_100ml"}}]}]},land_surface_table:{file:"land_surface_data.json"},land_surface_emc_table:{file:"land_surface_emc.json",parameters:[{long_name:"Total Suspended Solids",short_name:"TSS",concentration_unit:"mg/L",load_unit:"lbs"},{long_name:"Total Copper",short_name:"TCu",concentration_unit:"ug/L",load_unit:"lbs"},{long_name:"Fecal Coliform",short_name:"FC",concentration_unit:"MPN/_100mL",load_unit:"mpn"}]},dry_weather_land_surface_emc_table:{file:"dry_weather_land_surface_emc.json",parameters:[{long_name:"Dry Weather Total Suspended Solids",short_name:"dwTSS",concentration_unit:"mg/L",load_unit:"lbs"},{long_name:"Dry Weather Total Copper",short_name:"dwTCu",concentration_unit:"ug/L",load_unit:"lbs"},{long_name:"Dry Weather Fecal Coliform",short_name:"dwFC",concentration_unit:"MPN/_100mL",load_unit:"mpn"}]}},data_path:"nereid/data/default_data/state/region"},Be={openapi:"3.0.2",info:{title:"nereid",version:"0.4.3"},paths:{"/api/v1/network/validate":{post:{tags:["network","validate"],summary:"Validate Network",operationId:"validate_network_api_v1_network_validate_post",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Graph"},example:{directed:!0,nodes:[{id:"A"},{id:"B"}],edges:[{source:"A",target:"B"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/NetworkValidationResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/validate/{task_id}":{get:{tags:["network","validate"],summary:"Get Validate Network Result",operationId:"get_validate_network_result_api_v1_network_validate__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/NetworkValidationResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph":{post:{tags:["network","subgraph"],summary:"Subgraph Network",operationId:"subgraph_network_api_v1_network_subgraph_post",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphRequest"},example:{graph:{directed:!0,edges:[{source:"3",target:"1"},{source:"5",target:"3"},{source:"7",target:"1"},{source:"9",target:"1"},{source:"11",target:"1"},{source:"13",target:"3"},{source:"15",target:"9"},{source:"17",target:"7"},{source:"19",target:"17"},{source:"21",target:"15"},{source:"23",target:"1"},{source:"25",target:"5"},{source:"27",target:"11"},{source:"29",target:"7"},{source:"31",target:"11"},{source:"33",target:"25"},{source:"35",target:"23"},{source:"4",target:"2"},{source:"6",target:"2"},{source:"8",target:"6"},{source:"10",target:"2"},{source:"12",target:"2"},{source:"14",target:"2"},{source:"16",target:"12"},{source:"18",target:"12"},{source:"20",target:"8"},{source:"22",target:"6"},{source:"24",target:"12"}]},nodes:[{id:"3"},{id:"29"},{id:"18"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph/{task_id}":{get:{tags:["network","subgraph"],summary:"Get Subgraph Network Result",operationId:"get_subgraph_network_result_api_v1_network_subgraph__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/subgraph/{task_id}/img":{get:{tags:["network","visualize"],summary:"Get Subgraph Network As Img",operationId:"get_subgraph_network_as_img_api_v1_network_subgraph__task_id__img_get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"},{required:!1,schema:{title:"Media Type",type:"string",default:"svg"},name:"media_type",in:"query"},{required:!1,schema:{title:"Npi",type:"number",default:4},name:"npi",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SubgraphResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence":{post:{tags:["network","sequence"],summary:"Network Solution Sequence",operationId:"network_solution_sequence_api_v1_network_solution_sequence_post",parameters:[{required:!1,schema:{title:"Min Branch Size",type:"integer",default:4},name:"min_branch_size",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Graph"},example:{directed:!0,edges:[{source:"3",target:"1"},{source:"5",target:"3"},{source:"7",target:"1"},{source:"9",target:"1"},{source:"11",target:"1"},{source:"13",target:"3"},{source:"15",target:"9"},{source:"17",target:"7"},{source:"19",target:"17"},{source:"21",target:"15"},{source:"23",target:"1"},{source:"25",target:"5"},{source:"27",target:"11"},{source:"29",target:"7"},{source:"31",target:"11"},{source:"33",target:"25"},{source:"35",target:"23"},{source:"4",target:"2"},{source:"6",target:"2"},{source:"8",target:"6"},{source:"10",target:"2"},{source:"12",target:"2"},{source:"14",target:"2"},{source:"16",target:"12"},{source:"18",target:"12"},{source:"20",target:"8"},{source:"22",target:"6"},{source:"24",target:"12"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence/{task_id}":{get:{tags:["network","sequence"],summary:"Get Network Solution Sequence",operationId:"get_network_solution_sequence_api_v1_network_solution_sequence__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/network/solution_sequence/{task_id}/img":{get:{tags:["network","sequence","visualize"],summary:"Get Network Solution Sequence As Img",operationId:"get_network_solution_sequence_as_img_api_v1_network_solution_sequence__task_id__img_get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"},{required:!1,schema:{title:"Media Type",type:"string",default:"svg"},name:"media_type",in:"query"},{required:!1,schema:{title:"Npi",type:"number",default:4},name:"npi",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/SolutionSequenceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data":{get:{tags:["reference_data"],summary:"Get Reference Data Json",operationId:"get_reference_data_json_api_v1_reference_data_get",parameters:[{required:!1,schema:{title:"Filename",type:"string",default:""},name:"filename",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/ReferenceDataResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data/nomograph":{get:{tags:["reference_data"],summary:"Get Nomograph",operationId:"get_nomograph_api_v1_reference_data_nomograph_get",parameters:[{required:!1,schema:{title:"Filename",type:"string",default:""},name:"filename",in:"query"},{required:!1,schema:{title:"Type",type:"string"},name:"type",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reference_data/{table}":{get:{tags:["reference_data"],summary:"Get Reference Data Table",operationId:"get_reference_data_table_api_v1_reference_data__table__get",parameters:[{required:!0,schema:{title:"Table",type:"string"},name:"table",in:"path"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/land_surface/loading":{post:{tags:["land_surface","loading"],summary:"Calculate Loading",operationId:"calculate_loading_api_v1_land_surface_loading_post",parameters:[{required:!1,schema:{title:"Details",type:"boolean",default:!1},name:"details",in:"query"},{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaces"},example:{land_surfaces:[{node_id:"1",surface_key:"10101100-RESMF-A-5",area_acres:1.834347898661638,imp_area_acres:1.430224547955745},{node_id:"0",surface_key:"10101100-OSDEV-A-0",area_acres:4.458327528535912,imp_area_acres:.4457209193544626},{node_id:"0",surface_key:"10101000-IND-A-10",area_acres:3.337086111390218,imp_area_acres:.47675887386582366},{node_id:"0",surface_key:"10101100-COMM-C-0",area_acres:.5641157902710026,imp_area_acres:.40729090799199347},{node_id:"1",surface_key:"10101200-TRANS-C-5",area_acres:.007787658410143283,imp_area_acres:.007727004694355631}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/land_surface/loading/{task_id}":{get:{tags:["land_surface","loading"],summary:"Get Land Surface Loading Result",operationId:"get_land_surface_loading_result_api_v1_land_surface_loading__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/LandSurfaceResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_facility/validate":{post:{tags:["treatment_facility","validate"],summary:"Initialize Treatment Facility Parameters",operationId:"initialize_treatment_facility_parameters_api_v1_treatment_facility_validate_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{title:"Treatment Facilities",anyOf:[{$ref:"#/components/schemas/TreatmentFacilities"},{$ref:"#/components/schemas/TreatmentFacilitiesStrict"}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentFacilitiesResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_facility/validate/{task_id}":{get:{tags:["treatment_facility","validate"],summary:"Get Treatment Facility Parameters",operationId:"get_treatment_facility_parameters_api_v1_treatment_facility_validate__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentFacilitiesResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/treatment_site/validate":{post:{tags:["treatment_site","validate"],summary:"Initialize Treatment Site",operationId:"initialize_treatment_site_api_v1_treatment_site_validate_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentSites"},example:{treatment_sites:[{node_id:"WQMP-1a-tmnt",facility_type:"bioretention",area_pct:75,captured_pct:80,retained_pct:10},{node_id:"WQMP-1a-tmnt",facility_type:"nt",area_pct:25,captured_pct:0,retained_pct:0},{node_id:"WQMP-1b-tmnt",facility_type:"bioretention",area_pct:75,captured_pct:50,retained_pct:10},{node_id:"WQMP-1b-tmnt",facility_type:"nt",area_pct:25,captured_pct:0,retained_pct:0}]}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/TreatmentSiteResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/watershed/solve":{post:{tags:["watershed","main"],summary:"Post Solve Watershed",operationId:"post_solve_watershed_api_v1_watershed_solve_post",parameters:[{required:!1,schema:{title:"State",type:"string",default:"state"},name:"state",in:"query"},{required:!1,schema:{title:"Region",type:"string",default:"region"},name:"region",in:"query"}],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Watershed"}}},required:!0},responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/WatershedResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/watershed/solve/{task_id}":{get:{tags:["watershed","main"],summary:"Get Watershed Result",operationId:"get_watershed_result_api_v1_watershed_solve__task_id__get",parameters:[{required:!0,schema:{title:"Task Id",type:"string"},name:"task_id",in:"path"}],responses:{200:{description:"Successful Response",content:{"application/json":{schema:{$ref:"#/components/schemas/WatershedResponse"}}}},422:{description:"Validation Error",content:{"application/json":{schema:{$ref:"#/components/schemas/HTTPValidationError"}}}}}}}},components:{schemas:{BioInfFacility:{title:"BioInfFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","retention_volume_cuft","area_sqft","media_filtration_rate_inhr","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},retention_volume_cuft:{title:"Retention Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},media_filtration_rate_inhr:{title:"Media Filtration Rate Inhr",type:"number"},hsg:{title:"Hsg",type:"string"}}},CisternFacility:{title:"CisternFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","winter_demand_cfs","summer_demand_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},winter_demand_cfs:{title:"Winter Demand Cfs",type:"number"},summer_demand_cfs:{title:"Summer Demand Cfs",type:"number"}}},DryWeatherDiversionLowFlowFacility:{title:"DryWeatherDiversionLowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},DryWeatherTreatmentLowFlowFacility:{title:"DryWeatherTreatmentLowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},DryWellFacility:{title:"DryWellFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","treatment_rate_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"}}},Edge:{title:"Edge",required:["source","target"],type:"object",properties:{source:{title:"Source",type:"string"},target:{title:"Target",type:"string"},metadata:{title:"Metadata",type:"object",default:{}}}},FlowAndRetFacility:{title:"FlowAndRetFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","treatment_rate_cfs","area_sqft","depth_ft","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},depth_ft:{title:"Depth Ft",type:"number"},hsg:{title:"Hsg",type:"string"}}},FlowFacility:{title:"FlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","treatment_rate_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5}}},Graph:{title:"Graph",required:["edges"],type:"object",properties:{edges:{title:"Edges",type:"array",items:{$ref:"#/components/schemas/Edge"}},nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}},directed:{title:"Directed",type:"boolean",default:!0},multigraph:{title:"Multigraph",type:"boolean",default:!0},type:{title:"Type",type:"string"},label:{title:"Label",type:"string"},metadata:{title:"Metadata",type:"object"}}},HTTPValidationError:{title:"HTTPValidationError",type:"object",properties:{detail:{title:"Detail",type:"array",items:{$ref:"#/components/schemas/ValidationError"}}}},LandSurface:{title:"LandSurface",required:["node_id","surface_key","area_acres","imp_area_acres"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},surface_key:{title:"Surface Key",type:"string",example:"104506-RESSFH-B-5"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"}}},LandSurfaceDetails:{title:"LandSurfaceDetails",required:["node_id","surface_key","area_acres","imp_area_acres","surface_id","perv_ro_depth_inches","imp_ro_depth_inches","perv_ro_coeff","imp_ro_coeff","perv_area_acres","imp_area_sqft","perv_area_sqft","imp_ro_depth_feet","perv_ro_depth_feet","imp_ro_volume_cuft","perv_ro_volume_cuft","runoff_volume_cuft","imp_eff_area_acres","perv_eff_area_acres","eff_area_acres"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},surface_key:{title:"Surface Key",type:"string"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"},surface_id:{title:"Surface Id",type:"string"},perv_ro_depth_inches:{title:"Perv Ro Depth Inches",type:"number"},imp_ro_depth_inches:{title:"Imp Ro Depth Inches",type:"number"},perv_ro_coeff:{title:"Perv Ro Coeff",type:"number"},imp_ro_coeff:{title:"Imp Ro Coeff",type:"number"},perv_area_acres:{title:"Perv Area Acres",type:"number"},imp_area_sqft:{title:"Imp Area Sqft",type:"number"},perv_area_sqft:{title:"Perv Area Sqft",type:"number"},imp_ro_depth_feet:{title:"Imp Ro Depth Feet",type:"number"},perv_ro_depth_feet:{title:"Perv Ro Depth Feet",type:"number"},imp_ro_volume_cuft:{title:"Imp Ro Volume Cuft",type:"number"},perv_ro_volume_cuft:{title:"Perv Ro Volume Cuft",type:"number"},runoff_volume_cuft:{title:"Runoff Volume Cuft",type:"number"},imp_eff_area_acres:{title:"Imp Eff Area Acres",type:"number"},perv_eff_area_acres:{title:"Perv Eff Area Acres",type:"number"},eff_area_acres:{title:"Eff Area Acres",type:"number"}}},LandSurfaceResponse:{title:"LandSurfaceResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/LandSurfaceResults"}}},LandSurfaceResults:{title:"LandSurfaceResults",required:["summary"],type:"object",properties:{summary:{title:"Summary",type:"array",items:{$ref:"#/components/schemas/LandSurfaceSummary"}},details:{title:"Details",type:"array",items:{$ref:"#/components/schemas/LandSurfaceDetails"}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},LandSurfaceSummary:{title:"LandSurfaceSummary",required:["node_id","area_acres","imp_area_acres","perv_area_acres","imp_ro_volume_cuft","perv_ro_volume_cuft","runoff_volume_cuft","eff_area_acres","land_surfaces_count","imp_pct","ro_coeff"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},area_acres:{title:"Area Acres",type:"number"},imp_area_acres:{title:"Imp Area Acres",type:"number"},perv_area_acres:{title:"Perv Area Acres",type:"number"},imp_ro_volume_cuft:{title:"Imp Ro Volume Cuft",type:"number"},perv_ro_volume_cuft:{title:"Perv Ro Volume Cuft",type:"number"},runoff_volume_cuft:{title:"Runoff Volume Cuft",type:"number"},eff_area_acres:{title:"Eff Area Acres",type:"number"},land_surfaces_count:{title:"Land Surfaces Count",type:"number"},imp_pct:{title:"Imp Pct",type:"number"},ro_coeff:{title:"Ro Coeff",type:"number"}}},LandSurfaces:{title:"LandSurfaces",required:["land_surfaces"],type:"object",properties:{land_surfaces:{title:"Land Surfaces",type:"array",items:{$ref:"#/components/schemas/LandSurface"}}}},LowFlowFacility:{title:"LowFlowFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},treatment_rate_cfs:{title:"Treatment Rate Cfs",type:"number"},design_capacity_cfs:{title:"Design Capacity Cfs",type:"number"},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},months_operational:{title:"Months Operational",pattern:"summer$|winter$|both$",type:"string",default:"both"}}},NTFacility:{title:"NTFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},NetworkValidation:{title:"NetworkValidation",required:["isvalid"],type:"object",properties:{isvalid:{title:"Isvalid",type:"boolean"},node_cycles:{title:"Node Cycles",type:"array",items:{type:"array",items:{type:"string"}}},edge_cycles:{title:"Edge Cycles",type:"array",items:{type:"array",items:{type:"string"}}},multiple_out_edges:{title:"Multiple Out Edges",type:"array",items:{type:"array",items:{type:"string"}}},duplicate_edges:{title:"Duplicate Edges",type:"array",items:{type:"array",items:{type:"string"}}}}},NetworkValidationResponse:{title:"NetworkValidationResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/NetworkValidation"}}},Node:{title:"Node",type:"object",properties:{id:{title:"Id",type:"string"},metadata:{title:"Metadata",type:"object",default:{}}}},Nodes:{title:"Nodes",required:["nodes"],type:"object",properties:{nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}}}},ParallelSeriesSequence:{title:"ParallelSeriesSequence",required:["parallel"],type:"object",properties:{parallel:{title:"Parallel",type:"array",items:{$ref:"#/components/schemas/SeriesSequence"}}}},PermPoolFacility:{title:"PermPoolFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","pool_volume_cuft","pool_drawdown_time_hr","treatment_volume_cuft","treatment_drawdown_time_hr","winter_demand_cfs","summer_demand_cfs"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},pool_volume_cuft:{title:"Pool Volume Cuft",type:"number"},pool_drawdown_time_hr:{title:"Pool Drawdown Time Hr",type:"number"},treatment_volume_cuft:{title:"Treatment Volume Cuft",type:"number"},treatment_drawdown_time_hr:{title:"Treatment Drawdown Time Hr",type:"number"},winter_demand_cfs:{title:"Winter Demand Cfs",type:"number"},summer_demand_cfs:{title:"Summer Demand Cfs",type:"number"}}},PreviousResult:{title:"PreviousResult",required:["node_id"],type:"object",properties:{node_id:{title:"Node Id",type:"string"}}},ReferenceData:{title:"ReferenceData",required:["state","region","file"],type:"object",properties:{state:{title:"State",type:"string"},region:{title:"Region",type:"string"},file:{title:"File",type:"string"},filedata:{title:"Filedata"}}},ReferenceDataResponse:{title:"ReferenceDataResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/ReferenceData"}}},Result:{title:"Result",required:["node_id"],type:"object",properties:{node_id:{title:"Node Id",type:"string"}}},RetAndTmntFacility:{title:"RetAndTmntFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","retention_volume_cuft","area_sqft","treatment_drawdown_time_hr","hsg"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},retention_volume_cuft:{title:"Retention Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},treatment_drawdown_time_hr:{title:"Treatment Drawdown Time Hr",type:"number"},hsg:{title:"Hsg",type:"string"}}},RetentionFacility:{title:"RetentionFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","area_sqft","inf_rate_inhr"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},inf_rate_inhr:{title:"Inf Rate Inhr",type:"number"}}},SeriesSequence:{title:"SeriesSequence",required:["series"],type:"object",properties:{series:{title:"Series",type:"array",items:{$ref:"#/components/schemas/Nodes"}}}},SolutionSequence:{title:"SolutionSequence",required:["solution_sequence"],type:"object",properties:{solution_sequence:{$ref:"#/components/schemas/ParallelSeriesSequence"}}},SolutionSequenceResponse:{title:"SolutionSequenceResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/SolutionSequence"}}},SubgraphNodes:{title:"SubgraphNodes",required:["subgraph_nodes"],type:"object",properties:{subgraph_nodes:{title:"Subgraph Nodes",type:"array",items:{$ref:"#/components/schemas/Nodes"}}}},SubgraphRequest:{title:"SubgraphRequest",required:["graph","nodes"],type:"object",properties:{graph:{$ref:"#/components/schemas/Graph"},nodes:{title:"Nodes",type:"array",items:{$ref:"#/components/schemas/Node"}}}},SubgraphResponse:{title:"SubgraphResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/SubgraphNodes"}}},TmntFacility:{title:"TmntFacility",required:["node_id","facility_type","ref_data_key","design_storm_depth_inches","total_volume_cuft","area_sqft","media_filtration_rate_inhr"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},ref_data_key:{title:"Ref Data Key",type:"string"},design_storm_depth_inches:{title:"Design Storm Depth Inches",exclusiveMinimum:0,type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1},is_online:{title:"Is Online",type:"boolean",default:!0},tributary_area_tc_min:{title:"Tributary Area Tc Min",maximum:60,type:"number",default:5},offline_diversion_rate_cfs:{title:"Offline Diversion Rate Cfs",type:"number"},total_volume_cuft:{title:"Total Volume Cuft",type:"number"},area_sqft:{title:"Area Sqft",type:"number"},media_filtration_rate_inhr:{title:"Media Filtration Rate Inhr",type:"number"}}},TreatmentFacilities:{title:"TreatmentFacilities",required:["treatment_facilities"],type:"object",properties:{treatment_facilities:{title:"Treatment Facilities",type:"array",items:{type:"object"}},errors:{title:"Errors",type:"array",items:{type:"string"}}},example:{treatment_facilities:[{node_id:"1",facility_type:"no_treatment",ref_data_key:"10101200",design_storm_depth_inches:1.45},{node_id:"1",facility_type:"dry_extended_detention",ref_data_key:"10101200",design_storm_depth_inches:1.05,is_online:!0,tributary_area_tc_min:30,total_volume_cuft:5500,retention_volume_cuft:4400,area_sqft:1600,treatment_drawdown_time_hr:72,hsg:"d",offline_diversion_rate_cfs:2.9,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"infiltration",ref_data_key:"10101200",design_storm_depth_inches:.88,is_online:!0,tributary_area_tc_min:25,total_volume_cuft:6200,area_sqft:2e3,inf_rate_inhr:3.5,offline_diversion_rate_cfs:5,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"bioretention",ref_data_key:"10101200",design_storm_depth_inches:.85,is_online:!0,tributary_area_tc_min:15,total_volume_cuft:5800,retention_volume_cuft:3500,area_sqft:1300,media_filtration_rate_inhr:12,hsg:"a",offline_diversion_rate_cfs:6,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"biofiltration",ref_data_key:"10101200",design_storm_depth_inches:.95,is_online:!0,tributary_area_tc_min:40,total_volume_cuft:4400,area_sqft:1200,media_filtration_rate_inhr:15,offline_diversion_rate_cfs:6,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"wet_detention",ref_data_key:"10101200",design_storm_depth_inches:.78,is_online:!0,tributary_area_tc_min:45,pool_volume_cuft:5550,pool_drawdown_time_hr:720,treatment_volume_cuft:2500,treatment_drawdown_time_hr:12,winter_demand_cfs:.05,summer_demand_cfs:.88,offline_diversion_rate_cfs:4,eliminate_all_dry_weather_flow_override:!1},{node_id:"1",facility_type:"sand_filter",ref_data_key:"10101200",design_storm_depth_inches:.78,total_volume_cuft:5e3,area_sqft:2700,media_filtration_rate_inhr:12,is_online:!0,offline_diversion_rate_cfs:2.1,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:20},{node_id:"1",facility_type:"swale",ref_data_key:"10101200",design_storm_depth_inches:1,treatment_rate_cfs:.55,area_sqft:15600,depth_ft:1.5,hsg:"b",is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:25},{node_id:"1",facility_type:"hydrodynamic_separator",ref_data_key:"10101200",design_storm_depth_inches:1.12,treatment_rate_cfs:.2,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:50,is_online:!0},{node_id:"1",facility_type:"dry_well",ref_data_key:"10101200",design_storm_depth_inches:.85,total_volume_cuft:800,treatment_rate_cfs:.5,is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:5},{node_id:"1",facility_type:"cistern",ref_data_key:"10101200",design_storm_depth_inches:1.3,total_volume_cuft:5500,winter_demand_cfs:.05,summer_demand_cfs:.25,is_online:!0,offline_diversion_rate_cfs:.5,eliminate_all_dry_weather_flow_override:!1,tributary_area_tc_min:55},{node_id:"1",facility_type:"dry_weather_diversion",ref_data_key:"10101200",design_storm_depth_inches:1.43,design_capacity_cfs:3.5,months_operational:"summer",tributary_area_tc_min:30,treatment_rate_cfs:2.92,eliminate_all_dry_weather_flow_override:!1,is_online:!0},{node_id:"1",facility_type:"dry_weather_treatment",ref_data_key:"10101200",design_storm_depth_inches:1.32,design_capacity_cfs:6.1,months_operational:"summer",tributary_area_tc_min:10,treatment_rate_cfs:3.5,eliminate_all_dry_weather_flow_override:!1,is_online:!0},{node_id:"1",facility_type:"low_flow_facility",ref_data_key:"10101200",design_storm_depth_inches:.91,design_capacity_cfs:5.1,months_operational:"summer",tributary_area_tc_min:20,treatment_rate_cfs:5,eliminate_all_dry_weather_flow_override:!1,is_online:!0}]}},TreatmentFacilitiesResponse:{title:"TreatmentFacilitiesResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/TreatmentFacilities"}}},TreatmentFacilitiesStrict:{title:"TreatmentFacilitiesStrict",required:["treatment_facilities"],type:"object",properties:{treatment_facilities:{title:"Treatment Facilities",type:"array",items:{anyOf:[{$ref:"#/components/schemas/PermPoolFacility"},{$ref:"#/components/schemas/RetAndTmntFacility"},{$ref:"#/components/schemas/BioInfFacility"},{$ref:"#/components/schemas/FlowAndRetFacility"},{$ref:"#/components/schemas/RetentionFacility"},{$ref:"#/components/schemas/TmntFacility"},{$ref:"#/components/schemas/CisternFacility"},{$ref:"#/components/schemas/DryWellFacility"},{$ref:"#/components/schemas/DryWeatherTreatmentLowFlowFacility"},{$ref:"#/components/schemas/DryWeatherDiversionLowFlowFacility"},{$ref:"#/components/schemas/LowFlowFacility"},{$ref:"#/components/schemas/FlowFacility"},{$ref:"#/components/schemas/NTFacility"}]}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},TreatmentSite:{title:"TreatmentSite",required:["node_id","facility_type","area_pct","captured_pct","retained_pct"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},area_pct:{title:"Area Pct",type:"number"},captured_pct:{title:"Captured Pct",type:"number"},retained_pct:{title:"Retained Pct",type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},TreatmentSiteGroup:{title:"TreatmentSiteGroup",required:["node_id","node_type","treatment_facilities"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},node_type:{title:"Node Type",type:"string"},treatment_facilities:{title:"Treatment Facilities",type:"array",items:{$ref:"#/components/schemas/TreatmentSiteGroupBase"}},errors:{title:"Errors",type:"array",items:{type:"string"}}}},TreatmentSiteGroupBase:{title:"TreatmentSiteGroupBase",required:["node_id","facility_type","area_pct","captured_pct","retained_pct"],type:"object",properties:{node_id:{title:"Node Id",type:"string"},facility_type:{title:"Facility Type",type:"string"},area_pct:{title:"Area Pct",type:"number"},captured_pct:{title:"Captured Pct",type:"number"},retained_pct:{title:"Retained Pct",type:"number"},eliminate_all_dry_weather_flow_override:{title:"Eliminate All Dry Weather Flow Override",type:"boolean",default:!1}}},TreatmentSiteGroups:{title:"TreatmentSiteGroups",required:["treatment_sites"],type:"object",properties:{treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSiteGroup"}}}},TreatmentSiteResponse:{title:"TreatmentSiteResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/TreatmentSiteGroups"}}},TreatmentSites:{title:"TreatmentSites",required:["treatment_sites"],type:"object",properties:{treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSite"}}}},ValidationError:{title:"ValidationError",required:["loc","msg","type"],type:"object",properties:{loc:{title:"Location",type:"array",items:{type:"string"}},msg:{title:"Message",type:"string"},type:{title:"Error Type",type:"string"}}},Watershed:{title:"Watershed",required:["graph","land_surfaces"],type:"object",properties:{graph:{$ref:"#/components/schemas/Graph"},land_surfaces:{title:"Land Surfaces",type:"array",items:{$ref:"#/components/schemas/LandSurface"}},treatment_facilities:{title:"Treatment Facilities",anyOf:[{type:"array",items:{type:"object"}},{type:"array",items:{anyOf:[{$ref:"#/components/schemas/PermPoolFacility"},{$ref:"#/components/schemas/RetAndTmntFacility"},{$ref:"#/components/schemas/BioInfFacility"},{$ref:"#/components/schemas/FlowAndRetFacility"},{$ref:"#/components/schemas/RetentionFacility"},{$ref:"#/components/schemas/TmntFacility"},{$ref:"#/components/schemas/CisternFacility"},{$ref:"#/components/schemas/DryWellFacility"},{$ref:"#/components/schemas/DryWeatherTreatmentLowFlowFacility"},{$ref:"#/components/schemas/DryWeatherDiversionLowFlowFacility"},{$ref:"#/components/schemas/LowFlowFacility"},{$ref:"#/components/schemas/FlowFacility"},{$ref:"#/components/schemas/NTFacility"}]}}]},treatment_sites:{title:"Treatment Sites",type:"array",items:{$ref:"#/components/schemas/TreatmentSite"}},previous_results:{title:"Previous Results",type:"array",items:{$ref:"#/components/schemas/PreviousResult"}}},example:{graph:{directed:!0,multigraph:!1,graph:{},nodes:[{metadata:{},id:"0"},{metadata:{},id:"1"},{metadata:{},id:"2"},{metadata:{},id:"3"},{metadata:{},id:"4"},{metadata:{},id:"5"},{metadata:{},id:"6"}],edges:[{metadata:{},source:"1",target:"0"},{metadata:{},source:"2",target:"1"},{metadata:{},source:"3",target:"2"},{metadata:{},source:"4",target:"2"},{metadata:{},source:"5",target:"2"},{metadata:{},source:"6",target:"1"}]},treatment_facilities:[{node_id:"0",facility_type:"sand_filter",ref_data_key:"10101200",design_storm_depth_inches:.85,total_volume_cuft:335,area_sqft:1532,media_filtration_rate_inhr:22.5,constructor:"treatment_facility_constructor",tributary_area_tc_min:30,is_online:!0},{node_id:"2",facility_type:"bioretention",ref_data_key:"10101000",design_storm_depth_inches:.85,total_volume_cuft:382,retention_volume_cuft:333,area_sqft:2658,media_filtration_rate_inhr:14.6,hsg:"a",constructor:"bioinfiltration_facility_constructor",tributary_area_tc_min:55,is_online:!0}],treatment_sites:[{facility_type:"wet_detention",node_id:"1",area_pct:6,captured_pct:57,retained_pct:38},{facility_type:"cistern",node_id:"1",area_pct:80,captured_pct:74,retained_pct:49},{facility_type:"swale",node_id:"1",area_pct:0,captured_pct:61,retained_pct:44},{facility_type:"dry_weather_diversion",node_id:"1",area_pct:12,captured_pct:80,retained_pct:56},{facility_type:"dry_extended_detention",node_id:"1",area_pct:1,captured_pct:40,retained_pct:0},{facility_type:"infiltration",node_id:"1",area_pct:1,captured_pct:73,retained_pct:59}],land_surfaces:[{node_id:"3",surface_key:"10101000-RESSFH-rock-5",area_acres:.3984569310124453,imp_area_acres:.009673489252693119},{node_id:"3",surface_key:"10101100-RESSFH-D-0",area_acres:8.065001059380828,imp_area_acres:2.16741977121951},{node_id:"3",surface_key:"10101100-EDU-D-5",area_acres:2.5839358997133957,imp_area_acres:2.55343628659585},{node_id:"3",surface_key:"10101100-UTIL-A-5",area_acres:4.312089428850966,imp_area_acres:4.131205425493061},{node_id:"3",surface_key:"10101200-RESSFL-D-5",area_acres:3.9337442224446297,imp_area_acres:.7661658366327859},{node_id:"4",surface_key:"10101200-COMM-A-0",area_acres:.28767325522239817,imp_area_acres:.08026707777353169},{node_id:"4",surface_key:"10101200-TRANS-rock-10",area_acres:6.9571538459344495,imp_area_acres:1.2273914932176564},{node_id:"4",surface_key:"10101200-OSLOW-rock-0",area_acres:2.403387703304852,imp_area_acres:.9959985713261311},{node_id:"4",surface_key:"10101200-OSWET-D-5",area_acres:2.79314881649118,imp_area_acres:.15499820430359323},{node_id:"4",surface_key:"10101100-OSFOR-D-5",area_acres:2.905930886150414,imp_area_acres:1.4925738336538064},{node_id:"4",surface_key:"10101000-TRANS-A-5",area_acres:9.350620373618705,imp_area_acres:5.232513213963891},{node_id:"4",surface_key:"10101200-COMM-C-0",area_acres:2.1979646924219196,imp_area_acres:.2053466380605771},{node_id:"4",surface_key:"10101000-OSWET-D-0",area_acres:9.316054897695937,imp_area_acres:8.379096506045641},{node_id:"4",surface_key:"10101200-TRFWY-A-0",area_acres:1.4272661923917718,imp_area_acres:1.2613822514526472},{node_id:"4",surface_key:"10101200-OSDEV-C-10",area_acres:4.221871721446085,imp_area_acres:.4549400198109034},{node_id:"4",surface_key:"10101100-RESSFH-C-0",area_acres:.26360615441130775,imp_area_acres:.13605449920172205},{node_id:"4",surface_key:"10101000-OSDEV-D-5",area_acres:7.289650539203478,imp_area_acres:6.077668638347337},{node_id:"5",surface_key:"10101000-IND-A-10",area_acres:4.930498275495615,imp_area_acres:4.450757471699112},{node_id:"5",surface_key:"10101200-OSLOW-rock-0",area_acres:7.814106399568224,imp_area_acres:1.078526163782842},{node_id:"5",surface_key:"10101200-RESSFL-D-5",area_acres:6.185417372804003,imp_area_acres:5.76250105686173},{node_id:"5",surface_key:"10101200-OSIRR-water-10",area_acres:.36715726648133273,imp_area_acres:.23531606583046188},{node_id:"5",surface_key:"10101200-RESMF-D-5",area_acres:5.3935429017017515,imp_area_acres:3.810512599072686},{node_id:"5",surface_key:"10101100-RESSFH-A-5",area_acres:2.3620796715469004,imp_area_acres:1.870944109794398},{node_id:"5",surface_key:"10101200-WATER-A-10",area_acres:5.506805596166197,imp_area_acres:2.0512411750860533},{node_id:"5",surface_key:"10101200-TRFWY-A-5",area_acres:2.2549267594382885,imp_area_acres:.059337765905655114},{node_id:"5",surface_key:"10101200-EDU-A-5",area_acres:6.945443095820329,imp_area_acres:2.426366435613679},{node_id:"5",surface_key:"10101100-IND-D-0",area_acres:3.8291536983619254,imp_area_acres:2.4237194475207304},{node_id:"5",surface_key:"10101000-RESSFH-D-10",area_acres:4.720854566650611,imp_area_acres:1.9563886575871627},{node_id:"5",surface_key:"10101000-EDU-C-10",area_acres:1.7804423698966843,imp_area_acres:.3371318723066817},{node_id:"6",surface_key:"10101200-TRANS-D-0",area_acres:2.2754330855140923,imp_area_acres:1.0211331313414405},{node_id:"6",surface_key:"10101100-OSLOW-D-5",area_acres:6.214500618686376,imp_area_acres:.6340460489422389},{node_id:"6",surface_key:"10101100-UTIL-A-10",area_acres:2.555615240745477,imp_area_acres:2.131208949421928},{node_id:"6",surface_key:"10101000-RESSFH-A-5",area_acres:8.175748802007071,imp_area_acres:1.8980919101830314},{node_id:"6",surface_key:"10101200-RESSFH-A-0",area_acres:3.860268456910725,imp_area_acres:1.9184629017741963},{node_id:"6",surface_key:"10101200-OSDEV-C-5",area_acres:.5748050245941472,imp_area_acres:.1411875823737466},{node_id:"6",surface_key:"10101000-RESSFH-D-0",area_acres:7.945535238259879,imp_area_acres:.6302494865328522},{node_id:"6",surface_key:"10101000-RESMF-D-0",area_acres:6.915337959629758,imp_area_acres:3.162694892687792},{node_id:"6",surface_key:"10101000-IND-A-5",area_acres:5.262089934922299,imp_area_acres:.012019588367122497},{node_id:"6",surface_key:"10101200-EDU-D-10",area_acres:9.142141560695912,imp_area_acres:8.229015560695975},{node_id:"6",surface_key:"10101200-OSAGIR-A-10",area_acres:1.1171651349206269,imp_area_acres:.5990037582520297},{node_id:"6",surface_key:"10101100-OSAGIR-C-0",area_acres:3.304545692925136,imp_area_acres:.36222350149989435},{node_id:"6",surface_key:"10101000-RESSFH-D-0",area_acres:9.63416946726306,imp_area_acres:7.1542071673930625},{node_id:"6",surface_key:"10101100-OSLOW-D-0",area_acres:4.8579106327541695,imp_area_acres:.25541389152635474},{node_id:"6",surface_key:"10101200-OSDEV-C-5",area_acres:6.798391444820259,imp_area_acres:2.2112485428708193},{node_id:"6",surface_key:"10101000-RESSFH-D-10",area_acres:3.4948300942486963,imp_area_acres:3.233078107164885},{node_id:"6",surface_key:"10101000-OSAGIR-A-10",area_acres:3.6289953644281625,imp_area_acres:.38263683466075843},{node_id:"6",surface_key:"10101100-OSDEV-D-0",area_acres:5.376760581619445,imp_area_acres:4.5257872671756365}]}},WatershedResponse:{title:"WatershedResponse",type:"object",properties:{status:{title:"Status",type:"string",default:"SUCCESS"},task_id:{title:"Task Id",type:"string"},result_route:{title:"Result Route",type:"string"},data:{$ref:"#/components/schemas/WatershedResults"}}},WatershedResults:{title:"WatershedResults",type:"object",properties:{results:{title:"Results",type:"array",items:{$ref:"#/components/schemas/Result"}},leaf_results:{title:"Leaf Results",type:"array",items:{$ref:"#/components/schemas/Result"}},previous_results_keys:{title:"Previous Results Keys",type:"array",items:{type:"string"}},errors:{title:"Errors",type:"array",items:{type:"string"}},warnings:{title:"Warnings",type:"array",items:{type:"string"}}}}}}},Ue=Object.freeze(Object.defineProperty({__proto__:null,getConfig:ie,getReferenceData:ee,solveWatershed:re,validateNetwork:te,validateTreatmentFacilities:ae},Symbol.toStringTag,{value:"Module"})),p=(i,e="")=>e.split(".").reduce((t,a)=>t==null?t:t[a],i),x=(i,e="")=>{let t=p(i,e);return t===void 0?!1:t};function ne(i){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=t.length;for(let r=0;rObject.keys(i).filter(r=>e.length?e.includes(r):!0).filter(r=>!t.includes(r)).reduce((r,s)=>({...r,[s]:i[s]}),{});function q(i){return Object.entries(i).filter(([e,t])=>t!=""&&t!=null).reduce((e,[t,a])=>({...e,[t]:a===Object(a)?q(a):a}),{})}function v(i){return JSON.parse(JSON.stringify(i))}function B(i){return i.length?i.reduce((e,t)=>e+t)/i.length:void 0}function w(i){return Array.isArray(i)?[].concat(...i.map(w)):i}const O=()=>{let i=(p(m,"state.waiting")||0)+1;m.dispatch("Waiting",{waiting:i})},L=()=>{let i=(p(m,"state.waiting")||0)-1;i<0&&(console.error("waiting counter is negative"),i=0),m.dispatch("Waiting",{waiting:i})};async function A(i){return console.log("fetching with get",i),O(),await fetch(i,{method:"GET"}).then(t=>{if(console.log("getJsonResponse response:",t),t.status==200)return t.json();if(t.status==422)return t.json();throw new Error("got back "+t.content)}).then(t=>(console.log("getJsonResponse data returned:",t),t)).finally(L)}async function C(i,e){return console.log("fetching with post",i,e),O(),await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(a=>{if(console.log("postJsonResponse response:",a),a.status==200)return a.json();if(a.status==422)return a.json();throw new Error("got back "+a)}).then(a=>(console.log("postJsonResponse data returned:",a),a)).finally(L)}const He=({fn:i,validate:e,interval:t,maxAttempts:a})=>{console.log("Start poll...");let r=0;const s=async(n,c)=>{console.log("- poll");const _=await i();if(r++,e(_))return n(_);if(a&&r===a)return c(new Error("Exceeded max attempts"));setTimeout(s,t,n,c)};return new Promise(s)};function U(i){var e,t,a,r,s,n;return n=i.data||null,n==null||!n.length?null:(r=i.columnDelimiter||",",s=i.lineDelimiter||` +`,a=i.keys||Object.keys(n[0]),e="",e+=a.map(c=>String(c).includes(",")?`"${c}"`:`${c}`).join(r),e+=s,n.forEach(function(c){t=0,a.forEach(function(_){t>0&&(e+=r);const u=String(c[_]);u.includes(",")?e+=`"${u}"`:e+=`${u}`,t++}),e+=s}),e)}const le=async()=>{const i=new URLSearchParams(window.location.search);let{state:e,region:t}=Object.fromEntries(i.entries());const a=await ie({nereid_state:e||m.state.nereid_state,nereid_region:t||m.state.nereid_region});return m.dispatch("updateConfig",a),console.log(a),!1},Ge=Object.freeze(Object.defineProperty({__proto__:null,cleanObject:q,convertArrayOfObjectsToCSV:U,decr_waiting:L,deepCopy:v,filter:oe,flatten:w,get:p,getConfigFromUrlQueryParams:le,getJsonResponse:A,getTruthy:x,incr_waiting:O,mean:B,poll:He,postJsonResponse:C,randomString:ne},Symbol.toStringTag,{value:"Module"}));class F{constructor(e,t,a){this.nodes=e||[],this.edges=t||[],this.options=a||{},this.resolve_links(),m.dispatch("newGraph",{graph:this})}resolve_links(){let e=this;e.nodes=e.nodes.filter(r=>r.id!=null),this.edges.forEach(function(r){let s=r.source,n=r.target;r.source=e.nodes.find(c=>c.id===s),r.target=e.nodes.find(c=>c.id===n)});let t=this.options.width||600,a=this.options.height||400;this.nodes.forEach(function(r){r.x||(r.x=t/2+t/3*(Math.random()-1)),r.y||(r.y=a/2+a/3*(Math.random()-1))})}spliceLinksForNode(e){const t=this.edges.filter(a=>a.source.id===e||a.target.id===e);for(const a of t)this.edges.splice(this.edges.indexOf(a),1)}}function M(){let{nodes:i,edges:e,scenario_name:t}=v(p(m,"state.staged_changes"));new F(i,e),m.dispatch("clearStagedChanges",{staged_changes:{}}),t&&m.dispatch("updateScenarioName",{scenario_name:t})}function de(){let i=v(p(m,"state.staged_changes.nodes")),e=v(p(m,"state.staged_changes.edges")),t=v(p(m,"state.graph.nodes")),a=v(p(m,"state.graph.edges")),r=[...a,...e].map(n=>{var c,_;return{source:((c=n.source)==null?void 0:c.id)||n.source,target:((_=n.target)==null?void 0:_.id)||n.target}}),s=i;for(let n of t)i.map(c=>c.id).includes(n.id)||s.push(n);new F(s,r),m.dispatch("clearStagedChanges",{staged_changes:{}})}const Je=()=>{let{graph:i,scenario_name:e}=p(m,"state");sessionStorage.setItem("autosave_graph",JSON.stringify({graph:i,scenario_name:e}))},Ke=()=>{var t;let i=sessionStorage.getItem("autosave_graph"),e=v(p(m,"state.default_graph"));if(i){const{graph:a,scenario_name:r}=JSON.parse(i);sessionStorage.removeItem("autosave_graph"),((t=a==null?void 0:a.nodes)==null?void 0:t.length)>0?new F(a.nodes,a.edges.map(s=>({source:s.source.id,target:s.target.id}))):new F(e.nodes,e.edges),r&&m.dispatch("restoreScenarioName",{scenario_name:r})}else new F(e.nodes,e.edges)};window.addEventListener("beforeunload",Je);window.addEventListener("load",i=>{const t=new URLSearchParams(window.location.search).get("tab");t&&m.dispatch("changedTab",{current_tab:t})});const y=Object.assign({json:ye,Delaunay:he},ge,be,ve,we,ke,Se,xe,Te,$e,je,Re,Fe,De,Ee,Ne,Ae,qe,Oe,Le,Ce);window.d3=y;class b{constructor(e={}){let t=this;this.element,this.element_string,this.id,this._render=this._render||e._render||function(){},e.store instanceof z&&(t.store=e.store),e.hasOwnProperty("events")&&e.store instanceof z&&e.events.forEach(a=>e.store.events.subscribe(a,()=>t.render())),e.hasOwnProperty("element")&&(t.element=e.element),e.hasOwnProperty("element_string")&&(t.element_string=e.element_string,t.element=y.select(element)),e.hasOwnProperty("id")&&(t.id=e.id,t.element_string=`#${t.id}`,t.element=y.select(t.element_string)),e.hasOwnProperty("children")&&(t.children=e.children)}render(){let e=this;this._render(),this!=null&&this.children&&this.children.forEach(t=>{t!=null&&t.parent_id||(t.parent_id=e.id),t.render()})}}class Qe extends b{constructor(e){super({store:m,id:e.id})}enter(){let e=this;e.element.classed("pointer-events-none",!1);let t;t=e.element.select(".background-overlay").node(),t.classList.remove("opacity-0"),t.classList.add("duration-300","opacity-40"),t=e.element.select(".modal-main").node(),t.classList.remove("opacity-0","translate-y-4"),t.classList.add("opacity-100","translate-y-0")}exit(){let e=this,t=e.element;e.element.classed("pointer-events-none",!0);let a;a=t.select(".background-overlay").node(),a.classList.remove("opacity-40","duration-300"),a.classList.add("opacity-0"),a=t.select(".modal-main").node(),a.classList.remove("opacity-100","translate-y-0"),a.classList.add("opacity-0","translate-y-4")}_base_template(){return` + + `}_render(){let e=this;e.element=d3.select("body").append("div").attr("id",e.id),e.element.html(e._base_template()),e.store.events.subscribe("Waiting",({waiting:t})=>{t>0&&e.enter()}),e.store.events.subscribe("Waiting",({waiting:t})=>{t===0&&e.exit()}),d3.select("body")}}const Ye=new Qe({id:"spinner-popup"});class Xe extends b{constructor(e){super({store:m,id:e.id})}enter(e){let t=this;t.element.classed("pointer-events-none",!1);let a=t.element.select("#modal-content");a.html(t._content_template(e)),a.selectAll("button").on("click",this.exit.bind(t));let r;r=t.element.select(".background-overlay").node(),r.classList.remove("opacity-0"),r.classList.add("duration-300","opacity-40"),r=t.element.select(".modal-main").node(),r.classList.remove("opacity-0","translate-y-4"),r.classList.add("opacity-100","translate-y-0")}exit(){let e=this,t=e.element;e.element.classed("pointer-events-none",!0);let a;a=t.select(".background-overlay").node(),a.classList.remove("opacity-40","duration-300"),a.classList.add("opacity-0"),a=t.select(".modal-main").node(),a.classList.remove("opacity-100","translate-y-0"),a.classList.add("opacity-0","translate-y-4")}_content_template(e){e||(e={});let t={icon:` + + + `};switch(e.alert_type){case"error":t.bgcolor="bg-red-300",t.button_style="bg-red-600 hover:bg-red-700 focus:ring-red-500",t.icon_color="text-red-600",t.icon_bgcolor="bg-red-100";break;case"success":t.bgcolor="bg-green-300",t.button_style="bg-green-600 hover:bg-green-700 focus:ring-green-500",t.icon_color="text-green-600",t.icon_bgcolor="bg-green-100",t.icon=` + + + + + `;break;default:t.bgcolor="bg-yellow-300",t.button_style="bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500",t.icon_color="text-yellow-600",t.icon_bgcolor="bg-yellow-100"}return` +
+
+ +
+
+
+ ${t.icon} +
+
+
+ +
+

+ ${(e==null?void 0:e.msg)||""} +

+
+
+
+
+
+ +
+ `}_base_template(){return` + + `}_render(){let e=this;e.element=d3.select("body").append("div").attr("id",e.id).classed("pointer-events-none",!0),e.element.html(e._base_template()),e.store.events.subscribe("raiseModal",({modal_content:t})=>e.enter(t)),e.exit()}}const Ze=new Xe({id:"modal-popup"});class et{constructor(e){this.store=m,this.namespace=e,this.registry_underline={0:"translate-x-0",1:"translate-x-full",2:"translate-x-double",3:"translate-x-triple",4:"translate-x-quad",5:"translate-x-pent",6:"translate-x-sext",7:"translate-x-sept",8:"translate-x-octa"},this.registry={}}init(){let e=this,t=this.namespace;document.querySelectorAll(`${t}`).forEach(r=>{Array.from(r.children).forEach((s,n)=>{e.registry[s.dataset.target]=e.registry_underline[n],s.dataset.target&&(s.addEventListener("click",()=>{e.store.dispatch("changedTab",{current_tab:s.dataset.target}),e.toggle.bind(e)(s.dataset.target)}),s.className.includes("active")&&e.toggle.bind(e)(s.dataset.target))})}),e.store.events.subscribe("changedTab",({current_tab:r})=>{e.toggle(r)});let a=p(e.store,"state.current_tab");a&&e.toggle(a)}toggle(e){let t=this,a=this.namespace,r=document.querySelector(`${a} .tab-slider`);r.className=r.className.replace(/\btranslate-x-.+?\b/g,""),r.classList.add(t.registry[e]),document.querySelectorAll(`${a} .tab-content`).forEach(s=>{s.classList[s.id===e?"remove":"add"]("hidden"),document.querySelector(`[data-target="${s.id}"]`).classList.toggle("active",s.id===e)})}}class tt extends b{constructor({children:e}){super({store:m,children:e}),this.classname="main-tab-group-namespace"}_template(){return` + +
+
+ Editor +
+
+
How To
+
Treatment Results
+
Land Surface Results
+ Logout +
+ + + + + +
+
+
+
+
+
+ + + `}_render(){let e=this;y.select("body").append("div").classed("min-w-[700px]",!0).html(e._template()),new et(`.${this.classname}`).init()}}class at extends b{constructor(e){super({store:m,id:e.id,children:e.children}),this.store.events.subscribe("updateScenarioName",this._update_scenario_name.bind(this))}get scenario_name(){return p(this.store,"state.scenario_name")}_update_scenario_name(){let e=this;y.select(`#${e.id}`).select("#scenario-name").text(e.scenario_name)}_template(){return` +
+ Scenario:  + + ${this.scenario_name} + +
+
+
+
+
+
+
+ +
+
+
+
+ `}_render(){let e=this,t=y.select(`#${e.id}`).classed("flex flex-col justify-center max-w-[1000px]",!0).html(e._template());t.select("#scenario-name").on("input",()=>{let a=t.select("#scenario-name").text().trim();e.store.dispatch("changeScenarioName",{scenario_name:a})})}}class E extends b{constructor(e){super({store:m,id:e.id}),this.parent_id=e.parent_id,this.text=e.text,this.callback=e.callback,this.isActive=e.isActive,this.scale=e.scale||"scale-100",this.button,this._class=e.class_string||""}get class(){return this._class}_render(){let e=this;e.toggle=y.select(`#${e.parent_id}`).append("div"),e.toggle.html(` + +
+ +
+ `),e.toggle.select("input[type=checkbox]").property("checked",e.isActive),e.toggle.select("input").on("change",e.callback.bind(e))}}const N="scale-75",rt=new E({id:"map-edit-toggle",text:"Show BaseMap",isActive:x(m,"state.map_mode"),scale:N,callback:function(){let i=!x(this,"store.state.map_mode");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isMapMode",{map_mode:i})}}),st=new E({id:"graph-edit-toggle",text:"Edit Graph",isActive:x(m,"state.graph_edit_mode"),scale:N,callback:function(){let i=!x(this,"store.state.graph_edit_mode");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isGraphEditMode",{graph_edit_mode:i})}}),it=new E({id:"states-vector-toggle",text:"Show States",isActive:x(m,"state.show_states"),scale:N,callback:function(){let i=!x(this,"store.state.show_states");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isShowStatesMode",{show_states:i})}}),nt=new E({id:"design-storm-vector-toggle",text:"Show Design Storm",isActive:x(m,"state.show_design_storm"),scale:N,callback:function(){let i=!x(this,"store.state.show_design_storm");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isShowDesignStorm",{show_design_storm:i})}}),ot=new E({id:"rain-zone-vector-toggle",text:"Show Rain Zones",isActive:x(m,"state.show_rain_zone"),scale:N,callback:function(){let i=!x(this,"store.state.show_rain_zone");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isShowRainZones",{show_rain_zone:i})}}),lt=new E({id:"into-tooltip-toggle",text:"Show Node Info",isActive:x(m,"state.show_info_tooltip"),scale:N,callback:function(){let i=!x(this,"store.state.show_info_tooltip");this.toggle.select("input[type=checkbox]").property("checked",!!i),this.store.dispatch("isShowInfoTooltip",{show_info_tooltip:i})}}),dt=new b({id:"toggle-container",children:[rt,it,nt,ot,st,lt]});class ct extends b{constructor(t){super({store:m,id:t.id});R(this,"width",()=>y.select(`#${this.id}`).node().getBoundingClientRect().width);R(this,"height",()=>y.select(`#${this.id}`).node().getBoundingClientRect().height);let a=this;a.store.events.subscribe("isMapMode",()=>a.toggleMapMode()),a.store.events.subscribe("changedTransform",r=>a.zoomed(r)),a.svg=t.svg,a.initialScale=p(a,"store.state.initialScale"),a._k={},a.initialCenter=p(a,"store.state.config.project_spatial_data.app.centroid")||p(a,"store.state.initialCenter"),a.tilesize=256,a._current_point,a._zoomed=!1,a.url=(r,s,n)=>`https://${"abc"[Math.abs(r+s)%3]}.basemaps.cartocdn.com/rastertiles/voyager/${n}/${r}/${s}${devicePixelRatio>1?"@2x":""}.png`,a.projection=y.geoMercator().scale(1/(2*Math.PI)).translate([0,0]),a.store.dispatch("setProjection",{projection:a.projection}),a.transform=y.zoomIdentity.translate(a.projection([0,0])[0],a.projection([0,0])[1]).scale(a.projection.scale()*2*Math.PI),a.store.dispatch("setTransform",{transform:a.transform}),a.renderer=y.geoPath(a.projection),a.tile=y.tile().extent([[0,0],[a.width(),a.height()]]).tileSize(a.tilesize),a.image_bg=a.svg.append("svg:g").classed("bg basemap",!0).attr("pointer-events","none").style("overflow","hidden").attr("pointer-events","none").classed("hidden",!a.store.state.map_mode).selectAll("image"),a.image_fg=a.svg.append("svg:g").classed("fg basemap",!0).attr("pointer-events","none").style("overflow","hidden").classed("hidden",!a.store.state.map_mode).selectAll("image"),a.image_group=a.svg.selectAll(".basemap"),a.vector=a.svg.append("svg:g").attr("id","vectors").attr("pointer-events","none"),a.zoom=y.zoom().scaleExtent([64,1<<30]).extent([[0,0],[a.width(),a.height()]]).filter(()=>!a.drag_lock).on("start",r=>{}).on("zoom",r=>{a.store.dispatch("changedTransform",{transform:r.transform})}).on("end",r=>{a.store.dispatch("changedZoomTransform",{zoomTransform:a.zoom.transform})})}get drag_lock(){return p(this,"store.state.drag_lock")}toggleMapMode(){let t=this;t.image_group.classed("hidden",!t.store.state.map_mode),console.log("map mode toggled!")}zoomed({transform:t}){let a=this;a.transform=t,a._k=t.k;const r=a.tile(t);a.image_bg=a.image_bg.data(r,s=>s).join("image").attr("xlink:href",s=>a.url(...s)).attr("x",([s])=>(s+r.translate[0])*r.scale-.5).attr("y",([,s])=>(s+r.translate[1])*r.scale-.5).attr("width",r.scale+1).attr("height",r.scale+1),a.image_fg=a.image_fg.data(r,s=>s).join("image").attr("xlink:href",s=>a.url(...s)).attr("x",([s])=>(s+r.translate[0])*r.scale).attr("y",([,s])=>(s+r.translate[1])*r.scale).attr("width",r.scale).attr("height",r.scale),a.vector.attr("transform",t)}_render(){let t=this;t.svg.call(t.zoom).call(t.zoom.transform,y.zoomIdentity.translate(t.width()/2,t.height()/2).scale(-t.initialScale).translate(...t.projection(t.initialCenter)).scale(-1))}}class _t extends b{constructor(e){super({store:m});let t=this;t.stroke_width=1,t.store.events.subscribe("changedTransform",()=>{t.path.style("stroke-width",t.stroke_width/t.transform.k)}),t.store.events.subscribe("isShowStatesMode",()=>{t.path.classed("hidden",t.hidden)}),t.projection=p(t,"store.state.projection"),t.renderer=y.geoPath(t.projection).digits(15),t.url="https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json",t.vector=e.vector,t.path=t.vector.append("path").attr("pointer-events","all").attr("fill","none").attr("stroke","green").attr("stroke-linecap","round").attr("stroke-linejoin","round").classed("hidden",t.hidden).style("stroke-width",t.stroke_width/t.transform.k)}get hidden(){return!p(this,"store.state.show_states")}get transform(){return p(this,"store.state.transform")}async _render(){let e=this,t=await y.json(e.url),a=Y(t,t.objects.states);e.geojson=a,e.store.dispatch("setStateQuery",{state_query:a}),e.path.attr("d",e.renderer(a))}}class ce extends b{constructor({vector:e}){super({store:m});let t=this;t.group=e.append("g"),t.stroke_width=0,t.domain=[0,1],t.projection=p(t,"store.state.projection"),t.renderer=d3.geoPath(t.projection).digits(15)}get transform(){return p(this,"store.state.transform")}async _load_data(e){let t=this;if(!e)return;let a,r;try{if(e!=null&&e.filepath)r=await ee(e.filepath);else if(e!=null&&e.url)r=await A(e.url);else return}catch(s){console.error(s);return}try{if((r==null?void 0:r.type)==="Topology"){let s=r;a=Y(s,s.objects[e.name])}else(r==null?void 0:r.type)==="FeatureCollection"&&(a=r,a.features=a.features.map(s=>Ie(s,{reverse:!0})))}catch(s){console.error(s);return}if(a){a._field=e.field;let s=a.features.map(n=>n.properties[e.field]);t.domain=[Math.min(...s),Math.max(...s)],t.geojson=a}}}class pt extends ce{constructor({vector:e}){super({vector:e});let t=this;t.store.events.subscribe("changedTransform",()=>{t.group.selectAll("path").style("stroke-width",t.stroke_width/t.transform.k)}),t.store.events.subscribe("isShowDesignStorm",async()=>{let a=p(t,"store.state.design_storm_geojson");if(!a){await t.load_data();return}t._draw(a)}),t.store.events.subscribe("setDesignStormQuery",({design_storm_geojson:a})=>t._draw(a))}get hidden(){return!p(this,"store.state.show_design_storm")}async load_data(){var r;let e=this,t=p(e.store,"state.config"),a=v((r=t==null?void 0:t.project_spatial_data)==null?void 0:r.design_storm);await e._load_data(a),e.geojson&&e.store.dispatch("setDesignStormQuery",{design_storm_geojson:e.geojson})}_draw(e){if(!e)return;let t=this;t.group.selectAll("path").remove(),!t.hidden&&(t.colorScale=y.scaleLinear().domain(t.domain).range(["white","blue"]),t.group.selectAll("path").data(e.features).enter().append("path").attr("d",t.renderer).attr("pointer-events","all").attr("fill",a=>t.colorScale(a.properties[e._field])).attr("stroke",y.gray(.2)).attr("stroke-linecap","round").attr("stroke-linejoin","round").style("stroke-width",t.stroke_width/t.transform.k))}async _render(){let e=this;e.store.events.subscribe("updateConfig",e.load_data.bind(e))}}class ut extends ce{constructor({vector:e}){super({vector:e});let t=this;t.stroke_width=1,t.store.events.subscribe("changedTransform",()=>{t.group.selectAll("path").style("stroke-width",t.stroke_width/t.transform.k)}),t.store.events.subscribe("isShowRainZones",async()=>{let a=p(t,"store.state.ref_data_key_geojson");if(!a){await t.load_data();return}t._draw(a)}),t.store.events.subscribe("setRefDataQuery",({ref_data_key_geojson:a})=>t._draw(a))}get hidden(){return!p(this,"store.state.show_rain_zone")}async load_data(){var r;let e=this,t=p(e.store,"state.config"),a=v((r=t==null?void 0:t.project_spatial_data)==null?void 0:r.ref_data_key);await e._load_data(a),e.geojson&&e.store.dispatch("setRefDataQuery",{ref_data_key_geojson:e.geojson})}_draw(e){if(!e)return;let t=this;t.group.selectAll("path").remove(),!t.hidden&&(t.colorScale=y.scaleOrdinal().domain(t.domain).range(y.schemeSet3),t.group.selectAll("path").data(e.features).enter().append("path").attr("d",t.renderer).attr("pointer-events","all").attr("fill",a=>t.colorScale(a.properties[e._field])).attr("stroke",y.gray(.2)).attr("stroke-linecap","round").attr("stroke-linejoin","round").style("stroke-width",t.stroke_width/t.transform.k))}async _render(){let e=this;e.store.events.subscribe("updateConfig",e.load_data.bind(e))}}class mt extends b{constructor(t){super({store:m,id:t.id});R(this,"fixedScale",()=>!1);R(this,"getScale",()=>{let t=this;return t.fixedScale()?p(t,"store.state.transform.k")/p(t,"store.state.initialScale"):1});R(this,"getLoc",t=>this.longLatToPoint(t.longlat));let a=this;a.svg=t.svg,a.options=t||{},a.default_nodesize=a.options.default_nodesize||12,a.charge=a.options.charge||-300,a.edge_distance=a.options.edge_distance||80,a.node_types=a.options.node_types||{},a.onNodeSelected=typeof a.options.onNodeSelected<"u"?a.options.onNodeSelected:function(){},a.onNodeUnSelected=typeof a.options.onNodeUnSelected<"u"?a.options.onNodeUnSelected:function(){},a._selected_node_id=null,a._mousedown_edge=null,a._mousedown_node=null,a._mouseup_node=null,a._lastKeyDown=-1,a.container=a.svg.append("svg:g").classed("graph-editor",!0).style("pointer-events","all"),a.container.append("svg:defs").append("svg:marker").attr("id","end-arrow").attr("viewBox","0 -5 10 10").attr("refX",5).attr("markerWidth",3).attr("markerHeight",3).attr("orient","auto").style("fill",y.gray(20)).append("svg:path").attr("d","M0,-5L10,0L0,5"),a.dragLine=a.container.append("svg:path").attr("class","link dragline hidden").attr("d","M0,0L0,0"),a.path=a.container.append("svg:g").selectAll("path"),a.circle=a.container.append("svg:g").selectAll("g"),a.drag=y.drag().filter(r=>r.button===0||r.button===2).on("drag",(r,s)=>{s.longlat=a.pointToLongLat([r.x,r.y]),a.update()}).on("end",()=>a.store.dispatch("stateChange")),y.select(window).on("mousemove.graph-editor",a.mousemove.bind(a)).on("keydown.graph-editor",a.keydown.bind(a)).on("keyup.graph-editor",a.keyup.bind(a)),a.svg.on("click.graph-editor",a.mousedown_addNode.bind(a)).on("mouseup.graph-editor",a.mouseup.bind(a)).on("mouseenter",a.mouseenter.bind(a)).on("mouseleave",a.mouseleave.bind(a))}subscribe(){let t=this;t.store.events.subscribe("isConstNodeArea",()=>t.toggleConstNodeArea()),t.store.events.subscribe("changedTransform",()=>t.update()),t.store.events.subscribe("editorUpdate",()=>{t.update()}),t.store.events.subscribe("newGraph",()=>{t.update()}),t.store.events.subscribe("setRefDataQuery",()=>{t.update()}),t.store.events.subscribe("setDesignStormQuery",()=>{t.update()})}get bbox(){return this.svg.node().getBoundingClientRect()}get width(){return this.bbox.width}get height(){return this.bbox.height}get transform(){return p(this,"store.state.transform")}get projection(){return p(this,"store.state.projection")}get editing_mode(){return p(this,"store.state.graph_edit_mode")}get graph(){return p(this,"store.state.graph")}get_node_by_id(t){return this.graph.nodes.find(a=>a.id===t)}pointToLongLat(t){let a=this;return a.projection.invert(a.transform.invert(t))}longLatToPoint(t){let a=this;return a.transform.apply(a.projection(t))}recalculateNodeSize(t){let a=this;return Math.max(3,t.size*a.getScale())*(t.id===a._selected_node_id?1.3:1)}getColor(t){let a=this;if(t!=null&&t.color)return y.rgb(t.color);let r=p(a.store.state.node_types,t.node_type);return y.rgb((r==null?void 0:r.color)||"lightgrey")}tick(){let t=this;t.path.attr("d",a=>{const r=a.target.x-a.source.x,s=a.target.y-a.source.y,n=Math.sqrt(r*r+s*s),c=r/n,_=s/n,u=t.recalculateNodeSize(a.source),o=5+t.recalculateNodeSize(a.target),l=a.source.x+u*c,d=a.source.y+u*_,f=a.target.x-o*c,h=a.target.y-o*_;return r*(f-l)<0||s*(h-d)<0?`M${a.source.x},${a.source.y}L${a.target.x},${a.target.y}`:`M${l},${d}L${f},${h}`}),t.circle.selectAll(".node").attr("r",a=>t.recalculateNodeSize(a)*.95),t.circle.attr("transform",a=>`translate(${a.x},${a.y})`)}getState(t){var c;let r=p(this,"store.state.state_query"),s="undefined",n;return r!=null?(n=r.features.find(_=>y.geoContains(_,t)),((c=n==null?void 0:n.properties)==null?void 0:c.name)||"undefined"):s}getDesignStormDepth(t){var n;let r=p(this,"store.state.design_storm_geojson"),s;if(r!=null)return s=r.features.find(c=>y.geoContains(c,t)),(n=s==null?void 0:s.properties)==null?void 0:n[r._field]}getRefDataKey(t){var n;let r=p(this,"store.state.ref_data_key_geojson"),s;if(r!=null)return s=r.features.find(c=>y.geoContains(c,t)),(n=s==null?void 0:s.properties)==null?void 0:n[r._field]}setNodeDefaults(t){let a=this;t.map(r=>r!=null&&r.size?r:Object.assign(r,{size:a.default_nodesize})),t.map(r=>r!=null&&r.longlat?r:Object.assign(r,{longlat:a.pointToLongLat([r.x,r.y])})),t.map(r=>{let[s,n]=a.longLatToPoint(r.longlat);return r.x=s,r.y=n,r}),t.map(r=>(r.state=a.getState(r.longlat),r)),t.map(r=>{var s;if(!((s=r==null?void 0:r.node_type)!=null&&s.includes("land_surface"))){let n=a.getDesignStormDepth(r.longlat);if(n==null)return r;r.design_storm_depth_inches=+parseFloat(n).toFixed(2),r!=null&&r.data&&(r.data.design_storm_depth_inches=r.design_storm_depth_inches)}return r}),t.map(r=>{var s;if(!((s=r==null?void 0:r.node_type)!=null&&s.includes("land_surface"))){let n=a.getRefDataKey(r.longlat);if(n==null)return r;r.ref_data_key=n,r!=null&&r.data&&(r.data.ref_data_key=r.ref_data_key)}return r})}update(){let t=this,a;a=t.graph.nodes,t.setNodeDefaults(a),t.path=t.path.data(t.graph.edges),t.path.classed("selected",s=>s===t._selected_edge).style("marker-end","url(#end-arrow)"),t.path.exit().remove(),t.path=t.path.enter().append("svg:path").classed("link",!0).classed("selected",s=>s===t._selected_edge).style("marker-end","url(#end-arrow)").on("mousedown",(s,n)=>{s.ctrlKey||(t._mousedown_edge=n,t._selected_edge=t._mousedown_edge===t._selected_edge?null:t._mousedown_edge,t._selected_node_id=null,t.update())}).merge(t.path),t.circle=t.circle.data(a,s=>JSON.stringify(s)),t.circle.selectAll(".node").attr("r",s=>t.recalculateNodeSize(s)).style("fill",s=>{let n=t.getColor(s);return s.id===t._selected_node_id?n.brighter(3):n}).style("stroke",s=>t.getColor(s).darker().toString()),t.circle.selectAll("text").text(s=>s.id),t.circle.exit().remove();const r=t.circle.enter().append("svg:g");r.append("circle").classed("node has-tooltip",!0).attr("r",s=>t.recalculateNodeSize(s)).style("fill",s=>{let n=t.getColor(s);return s.id===t._selected_node_id?n.brighter(3):n}).style("stroke",s=>t.getColor(s).darker().toString()).on("mouseover",function(s,n){t._hovered_node=n,t.store.dispatch("isNodeHovered",{node_hovered:n.id}),!t._selected_node_id&&(p(t,"store.state.current_node_data.id"),n.id),!(!t._mousedown_node||n.id===t._mousedown_node.id)&&y.select(s.target).attr("transform","scale(1.25)")}).on("mouseout",(s,n)=>{t._hovered_node=void 0,t.store.dispatch("isNodeHovered",{node_hovered:void 0}),!(!t._mousedown_node||n.id===t._mousedown_node.id)&&y.select(s.target).attr("transform","")}).on("mousedown",(s,n)=>{s.shiftKey||s.ctrlKey||(t.store.dispatch("drag_lock",{drag_lock:!0}),t._mousedown_node=n,t._mousedown_node.id===t._selected_node_id?(t._selected_node_id=null,t.onNodeUnSelected(n),t.store.dispatch("changedSelectedNode",{selected_node_id:null})):(t._selected_node_id=t._mousedown_node.id,m.dispatch("changedSelectedNode",{selected_node_id:n.id}),t.onNodeSelected(n)),t._selected_edge=null,t.update())}).on("mouseup",(s,n)=>{if(t.dragLine.classed("hidden",!0).style("marker-end",""),t.store.dispatch("drag_lock",{drag_lock:!1}),!t._mousedown_node||!t.editing_mode)return;if(t._mouseup_node=n,t._mouseup_node.id===t._mousedown_node.id){t.resetMouseVars();return}y.select(s.target).attr("transform","");const c=t._mousedown_node.id,_=t._mouseup_node.id,u=t.graph.edges.find(o=>o.source===c&&o.target===_);if(!u){let o=t.graph.nodes.find(d=>d.id===c),l=t.graph.nodes.find(d=>d.id===_);t.graph.edges.push({source:o,target:l})}t._selected_edge=u,t._selected_node_id=null,t.update()}),r.append("text").attr("x",0).attr("y","0.3rem").attr("class","id no-select align-middle text-center font-bold text-base pointer-events-none").text(s=>s.id),t.circle=r.merge(t.circle),t.tick()}zoom_to_group(t){let a=this;const r=a.container.node().getBBox(),[[s,n],[c,_]]=[[r.x,r.y],[r.x+r.width,r.y+r.height]];t==null&&(t=1);let u=a.transform.k;for(;t>0;)t-=1,u=Math.min(1<<28,u*(.9/Math.max((c-s)/a.width,(_-n)/a.height)));const o=[s+r.width/2,n+r.height/2];let l=p(a,"store.state.zoomTransform");a.svg.interrupt().transition().duration(800).call(l,y.zoomIdentity.translate(a.width/2,a.height/2).scale(-u).translate(...a.transform.invert(o)).scale(-1))}mouseenter(){this.svg.classed("listening-to-keys",!0)}mouseleave(){this.svg.classed("listening-to-keys",!1)}keydown(t){let a=this;if(a.svg.classed("listening-to-keys")&&(t.keyCode,t.keyCode===71&&a.zoom_to_group(),!!a.editing_mode)){if(t.keyCode===17){a.circle.call(a.drag),a.svg.classed("ctrl",!0);return}if(!(!this._selected_node_id&&!this._selected_edge))switch(t.keyCode){case 8:case 46:this._selected_node_id?(this.graph.nodes.splice(this.graph.nodes.map(r=>r.id).indexOf(this._selected_node_id),1),this.graph.spliceLinksForNode(this._selected_node_id)):this._selected_edge&&this.graph.edges.splice(this.graph.edges.indexOf(this._selected_edge),1),this._selected_edge=null,this._selected_node_id=null,a.store.dispatch("changedSelectedNode",{selected_node_id:null}),this.resetMouseVars(),this.update();break}}}keyup(t){let a=this;t.keyCode===17&&(a.circle.on(".drag",null),a.svg.classed("ctrl",!1))}mousedown_addNode(t){var u;let a=this;if(this.svg.classed("active",!0),t.shiftKey||t.ctrlKey||!a.editing_mode||a._mousedown_node||a._mousedown_edge||a._hovered_node){a.resetMouseVars();return}const r=y.pointer(t);let[s,n]=r,c=a.pointToLongLat([s,n]);const _={id:ne(5),x:s,y:n,size:a.default_nodesize,longlat:c};_.design_storm_depth_inches=+parseFloat(a.getDesignStormDepth(_.longlat)).toFixed(2),_.ref_data_key=a.getRefDataKey(_.longlat),this.graph.nodes.push(_),a.store.dispatch("changedSelectedNode",{selected_node_id:_.id}),a._selected_node_id=(u=this.graph.nodes.find(o=>o.id===_.id))==null?void 0:u.id,a.update(),a.mouseup()}mouseup(){if(this.svg.classed("active",!1),this._mousedown_node){this.dragLine.classed("hidden",!0).style("marker-end","");return}this.resetMouseVars()}mousemove(t){let a=this;if(!this._mousedown_node||!this.editing_mode)return;let{x:r,y:s}=p(this,"store.state.graph.nodes").find(c=>c.id===this._mousedown_node.id);a.dragLine.style("marker-end","url(#end-arrow)").classed("hidden",!1).attr("d",`M${a._mousedown_node.x},${a._mousedown_node.y}L${a._mousedown_node.x},${a._mousedown_node.y}`);const n=y.pointer(t,this.container.node());this.dragLine.attr("d",`M${r},${s}L${n[0]},${n[1]}`)}resetMouseVars(){this._mousedown_node=null,this._mouseup_node=null,this._mousedown_edge=null}_render(){let t=this;t.subscribe(),t.update(),t.zoom_to_group()}}class ft extends b{constructor(){super({store:m})}_render(){let e=this;e.svg=y.select("#map").append("svg").attr("viewBox",[0,0,y.select("#map").node().getBoundingClientRect().width,y.select("#map").node().getBoundingClientRect().height]),e.map=new ct({id:"map",svg:e.svg});const t=e.map.vector;e.states=new _t({vector:t}),e.designStorm=new pt({vector:t}),e.refData=new ut({vector:t}),e.graphEditor=new mt({svg:e.svg}),e.map.render(),e.states.render(),e.designStorm.render(),e.refData.render(),e.graphEditor.render()}}Ke();const I=new ft;class yt extends b{constructor(e){super({store:m});let t=this;t.parent_id=e.parent_id,t.id=e.id||""}get current_node_data(){let e=p(this,"store.state.selected_node_id")||p(this,"store.state.node_hovered");if(e)return p(this,"store.state.graph.nodes").find(t=>t.id===e)}get show_info_tooltip(){return p(this,"store.state.show_info_tooltip")}tooltip_move(e){let t=this.element.node().getBoundingClientRect().width,a=null,r=null;e.type=="touchstart"?(a=e.touches[0].pageX,r=e.touches[0].pageY):(a=e.pageX,r=e.pageY);let s=Math.max(0,window.innerWidth-aNode ID: ${t.id}`);let r=` + + Node Type: + ${t.node_type||"No Data"} + + `;a.select(".info-tooltip-content table").html(r);let s=Object.keys(t).filter(_=>_.charAt(0)==="_"),n=oe(t,[],s),c=`
${JSON.stringify(n,void 0,2)}
`;a.select(".info-tooltip-json").html(c)}_render(){let e=this,t=d3.select(`#${e.parent_id}`);e.element=t.append("div").attr("id",e.id||"").classed("transition-opacity opacity-0 tooltip rounded shadow-lg p-1 bg-gray-50",!0);let a=e.element.html("");a=a.append("div").classed("info-tooltip p-2",!0),a.append("div").classed("info-tooltip-header mt-2 uppercase text-lg font-bold",!0),a.append("div").classed("info-tooltip-content text-sm",!0).append("table"),a.select(".info-tooltip-content").append("div").classed("info-tooltip-json",!0),a.append("div").classed("info-tooltip-footer",!0),e.store.events.subscribe("stateChange",()=>this.update_contents())}}const ht=new yt({parent_id:"editor-info",id:"node-info-tooltip"});class gt extends b{constructor(e){super({store:m});let t=this;t.parent_id=e.parent_id,t.id=e.id||""}get show_tips(){return p(this,"store.state.graph_edit_mode")}hide(){let e=this.element;e.classed("opacity-100 h-auto",!1),e.classed("opacity-0 h-0",!0)}show(){let e=this.element;e.classed("opacity-100 h-auto",!0),e.classed("opacity-0 h-0",!1)}update_contents(){let e=this;if(!e.show_tips){e.hide();return}e.show()}_template(){return` +
+ Edit Graph is Active +
+
+ Click in the open space to add a node. + +
+ Drag from one node to another to add an edge + +
+ Click a node or an edge to select it. + +
+ Press Ctrl & Drag a node to move the graph node layout. + Dragging will pin the node to the location. + +
+ Press Delete to remove the selected node or edge. + This is possible only when the mouse is within the map editor. + +
+ Press G to zoom the map to the graph extents. + +
+ `}_render(){let e=this,t=d3.select(`#${e.parent_id}`);e.element=t.append("div").attr("id",e.id||"").classed("transition-opacity opacity-0 p-2 h-auto text-justify",!0).html(e._template()),this.update_contents(),e.store.events.subscribe("isGraphEditMode",()=>this.update_contents())}}const bt=new gt({parent_id:"editor-info",id:"editor-tips"});class j extends b{constructor(e){super({store:m});let t=this;t.id=e.id,t.title=e.title,t.icon=e.icon,t.callback=e.callback}_template(){return` + `}_render(){let e=this,t=y.select(`#${this.parent_id}-button-container`).append("div").classed("flex",!0),a=t.html();a+=this._template(),t.html(a),this.button=t.select(`button#${this.id}-button`),this.button.on("click",e.callback.bind(e))}}const vt=new j({id:"node_editor",title:"Configuration",icon:` + + + + `,callback:function(){this.store.dispatch("changedPanel",{active_panel:"node-editor-panel"})}}),wt=new j({id:"load_table",title:"Load from File",icon:` + + + + `,callback:function(){this.store.dispatch("changedPanel",{active_panel:"load-table-panel"})}}),kt=new j({id:"save_files",title:"Save Files",icon:` + + + + +`,callback:function(){this.store.dispatch("changedPanel",{active_panel:"save-files-panel"})}}),St=new j({id:"clear_scenario",title:"Clear Scenario",icon:` +
+ + + + + +
+`,callback:function(){confirm("Are you sure you want to clear all data?")&&new F([],[])}}),xt=new j({id:"check_scenario",title:"Verify Inputs",icon:` +
+ + + + + +
+`,callback:async function(){Promise.all([ae(),te()]).then(i=>{i.length;const e=i.filter(a=>a.alert_type.toLowerCase()=="error");if(e.length>0){let a=e[0];a.msg=`
${e.map(r=>r.msg).join("
")}
`,this.store.dispatch("raiseModal",{modal_content:a});return}if(i.filter(a=>a.alert_type.toLowerCase()=="success").length===i.length){let a={title:"Validation Successful",msg:"",alert_type:"success"};this.store.dispatch("raiseModal",{modal_content:a});return}}).catch(i=>{let e={title:"Validation Failed",msg:`
${JSON.stringify(i,void 0,2)}
`,alert_type:"error"};this.store.dispatch("raiseModal",{modal_content:e})})}}),Tt=new j({id:"run_scenario",title:"Run Scenario",icon:` +
+ + + + + + +
+`,callback:async function(){var e;let i=await re();if(((e=i==null?void 0:i.status)==null?void 0:e.toLowerCase())==="success"){let t=p(i,"data.results")||[],a=p(i,"data.leaf_results")||[];this.store.dispatch("newResults",{results:t.concat(a)})}}}),$t=new j({id:"find_node",title:"Find",icon:` + + + + +`,callback:function(){this.store.dispatch("changedPanel",{active_panel:"find-node-panel"})}});class jt extends b{constructor(e){super({store:m,id:e.id,children:e.children})}_template(){return` +
+
+ +
+
+ `}_render(){this.element=y.select(`#${this.id}`),this.element.html(this._template())}}const Rt=new jt({id:"editor-menu",children:[$t,vt,wt,kt,St,xt,Tt]});class P extends b{constructor(e){super({store:m,id:e.id,children:e.children});let t=this;t.title=e.title,t.options=e}enter(){var r;let e=this,t=e.element;e.transition_direction="entering";let a;a=t.select(".drawer-overlay").node(),a.className=a.className.replace(/\bopacity-.+?\b/g,""),a.classList.add("opacity-40"),a=t.select(".drawer-panel").node(),a.className=a.className.replace(/\btranslate-x-.+?\b/g,""),a.classList.add("translate-x-0"),a.className=a.className.replace(/\bopacity-.+?\b/g,""),a.classList.add("opacity-100"),(r=e==null?void 0:e.options)!=null&&r.enter_callback&&e.options.enter_callback()}exit(){var r;let e=this,t=document.querySelector(`#${this.id}`),a;e.transition_direction="exiting",a=t.querySelector(".drawer-overlay"),a.className=a.className.replace(/\bopacity-.+?\b/g,""),a.classList.add("opacity-0"),a=t.querySelector(".drawer-panel"),a.className=a.className.replace(/\btranslate-x-.+?\b/g,""),a.classList.add("translate-x-full"),(r=e==null?void 0:e.options)!=null&&r.exit_callback&&e.options.exit_callback()}_template(){return` +
+ + +
+ `}_render(){var a;let e=this;e.element=y.select(`#${this.id}`).append("div").classed("drawer-container",!0),e.element.html(this._template()),e.element.select(`#${this.id}-close-button`).on("click",this.exit.bind(this)),((a=this==null?void 0:this.children)==null?void 0:a.length)>0&&e.element.select(`#${this.id}-content`).html("");let t=e.element.select(".drawer-container").classed("hidden",!0);e.exit(),t.classed("hidden",!1)}}class Ft extends P{constructor(e){super(e);let t=this;t.store.events.subscribe("changedPanel",({active_panel:a})=>a==="find-node-panel"?t.enter():null)}}class Dt extends P{constructor({id:e,title:t,children:a}){super({store:m,id:e,title:t,children:a});let r=this;r.store.events.subscribe("changedPanel",({active_panel:s})=>s==="node-editor-panel"?r.enter():null)}}class Et extends P{constructor({id:e,title:t,children:a}){super({store:m,id:e,title:t,children:a});let r=this;r.store.events.subscribe("changedPanel",({active_panel:s})=>s==="load-table-panel"?r.enter():null)}}class Nt extends P{constructor({id:e,title:t,children:a}){super({store:m,id:e,title:t,children:a});let r=this;r.store.events.subscribe("changedPanel",({active_panel:s})=>s==="save-files-panel"?r.enter():null)}}class At extends b{constructor({children:e}){super({store:m,children:e})}_template(){return` +
+
+
+
+ `}_render(){y.select("body").append("div").html(this._template())}}class qt extends b{constructor(e){super({store:m,id:e.id});let t=this;t.primary_callback=a=>{Ct(a.find_node)},t.primary_button_label=e.primary_button_label||"Find"}_template_primary_button(){return this.primary_callback==null?"":``}_template(){return` +
+ + +
+
+
+ + +
+ ${this._template_primary_button()} +
+
+
`}_render(){let e=this;e.element=d3.select(`#${e.parent_id}-content`).append("div"),e.element.html(e._template());let t=e.element.select("form");t.attr("method","get").on("submit",function(a){a.preventDefault(),t.selectAll("input").property("disabled",!1);const r=new FormData(a.target),s=q(Object.fromEntries(r.entries()));return e.primary_callback.bind(e)(s),!1})}}const Ot=new Ft({id:"find-node-drawer",title:"Find Node",children:[new qt({id:"find-node-ui"})],exit_callback:()=>{p(m,"state.graph.nodes").map(e=>_e(e)),m.dispatch("foundNodeIds",{}),m.dispatch("editorUpdate")}}),Lt=i=>{i.color="orange",i.size=40},_e=i=>{i.color=void 0,i.size=void 0},Ct=i=>{let e=p(m,"state.graph.nodes"),t=e.filter(r=>r.id.includes(i));e.map(r=>_e(r));let a=[];for(let r of t)r&&a.push(r);if(a.length){for(let r of a)Lt(r);m.dispatch("foundNodeIds",{found_node_ids:a.map(r=>r.id)})}m.dispatch("editorUpdate")};class It extends b{constructor(e){super({store:m})}get selected_node_id(){return p(this,"store.state.selected_node_id")}update(){let e=this.selected_node_id?`Node: ${this.selected_node_id.toString()}`:'
🡄 Select a Node in the Editor Map
';this.element.html(e)}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div").classed("text-lg font-bold pb-2",!0),e.update(),e.store.events.subscribe("changedSelectedNode",()=>e.update())}}class Mt extends b{constructor(e){super({store:m});let t=this;t.store.events.subscribe("changedSelectedNode",()=>t.update())}get nodes(){return p(this,"store.state.graph.nodes")}get selected_node_id(){return p(this,"store.state.selected_node_id")}toggleNodeType(){let e=this.element.select("input:checked").property("value");this.store.dispatch("nodeEditorType",{node_editor_type:e||"none"})}_template(){return` +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
`}update(){let e=this;e.element.classed("hidden",e.selected_node_id==null);let t=this.nodes.find(a=>a.id===this.selected_node_id);e.element.select(`input[value=${(t==null?void 0:t.node_type)||"none"}]`).property("checked",!0).dispatch("change"),e.toggleNodeType()}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div").classed("hidden",!0),e.element.html(e._template()),e.element.selectAll("input").on("change",this.toggleNodeType.bind(this)),e.update()}}const Pt="modulepreload",Vt=function(i){return"/app/"+i},J={},pe=function(e,t,a){let r=Promise.resolve();if(t&&t.length>0){const s=document.getElementsByTagName("link");r=Promise.all(t.map(n=>{if(n=Vt(n),n in J)return;J[n]=!0;const c=n.endsWith(".css"),_=c?'[rel="stylesheet"]':"";if(!!a)for(let l=s.length-1;l>=0;l--){const d=s[l];if(d.href===n&&(!c||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${_}`))return;const o=document.createElement("link");if(o.rel=c?"stylesheet":Pt,c||(o.as="script",o.crossOrigin=""),o.href=n,document.head.appendChild(o),c)return new Promise((l,d)=>{o.addEventListener("load",l),o.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${n}`)))})}))}return r.then(()=>e()).catch(s=>{const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=s,window.dispatchEvent(n),!n.defaultPrevented)throw s})};async function Wt(i,e){let a=Object.assign({data:[{}],clipboard:!0,clipboardPasteAction:"update",minHeight:100,autoResize:!1,layout:"fitData",responsiveLayout:!1,history:!0,tooltipsHeader:!0,footerElement:'',columns:[]},e),{default:r}=await pe(()=>import("./tabulator.es2015-fNsKARNq.js"),__vite__mapDeps([]));return new r(i,a)}class zt extends b{constructor(e){super({store:m})}get node_editor_type(){return p(this,"store.state.node_editor_type")}get selected_node(){let e=p(this,"store.state.selected_node_id");return p(this,"store.state.graph.nodes").find(a=>a.id===e)}landSurfaceTableOptions(){var a,r;let e=this,t=[{}];return(a=e.selected_node)!=null&&a.data?t=v(e.selected_node.data):t=[{node_id:(r=e.selected_node)==null?void 0:r.id}],{data:t,maxHeight:"500px",rowContextMenu:[{label:" Select Row",action:function(s,n){n.select()}},{label:" Add Row",action:function(s,n){var c;e.table.addRow({node_id:(c=e.selected_node)==null?void 0:c.id})}},{label:" Delete Row",action:function(s,n){n.delete()}}],initialSort:[{column:"surface_key",dir:"asc"}],columns:[{title:"Node Id",field:"node_id",editor:"input",editable:s=>s.getRow().getPosition()<1},{title:"Surface Key",field:"surface_key",editor:"input"},{title:"Area (acres)",field:"area_acres",hozAlign:"center",editor:!0,width:90},{title:"Impervious Area (acres)",field:"imp_area_acres",hozAlign:"center",editor:!0,width:90}]}}setCurrentNodeDataToTableData(){var r;if(!this.selected_node)return alert("no node selected"),!1;let e=v(this.table.getData()),t=this.selected_node,a=(r=e[0])==null?void 0:r.node_id;e.forEach(s=>s.node_id=a),t.node_type=this.node_editor_type,t.id!==a&&(t.id=a,m.dispatch("changedSelectedNode",{selected_node_id:a})),t.data=e,this.store.dispatch("newGraph"),this.update()}async buildLandSurfaceTable({id:e}){let t=this;t.element.select(`#${e}`).remove();let a=t.element.append("div").attr("id",e).classed("grid grid-cols-1 grid-rows-auto pt-8",!0);const r=e+"-landsurface-tabulator";let s=a.append("div").classed("flex flex-row p-2 gap-2",!0),n=s.append("button").classed("btn btn-gray flex flex-row",!0).html(` + + + + + + undo + `),c=s.append("button").classed("btn btn-gray flex flex-row",!0).html(` + redo + + + + + + + `);a.append("div").attr("id",r);let _=t.landSurfaceTableOptions();t.table=await Wt(`#${r}`,_),n.on("click",()=>t.table.undo()),c.on("click",()=>t.table.redo()),a.append("div").classed("flex flex-row justify-end py-4",!0).append("button").classed("btn btn-blue",!0).on("click",()=>{this.setCurrentNodeDataToTableData.bind(this)()}).text("Apply")}async update(){let e=this;if(e.node_editor_type!=="land_surface"){e.element.classed("hidden",!0);return}e.element.classed("hidden",!1);let t=`${e.parent_id}-content-editor`;await e.buildLandSurfaceTable({id:t})}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div").classed("mt-4",!0).classed("hidden",!0),e.update(),e.store.events.subscribe("nodeEditorType",()=>e.update()),e.store.events.subscribe("changedSelectedNode",()=>e.update()),e.store.events.subscribe("changedPanel",()=>e.update()),e.store.events.subscribe("newGraph",()=>e.update())}}class Bt extends b{constructor(e){super({store:m})}get node_editor_type(){return p(this,"store.state.node_editor_type")}get selected_node(){let e=p(this,"store.state.selected_node_id");return p(this,"store.state.graph.nodes").find(a=>a.id===e)}get config(){let{schema:e,facility_types:t,facility_type_map:a,facility_alias_map:r,facility_label_map:s}=p(this,"store.state");return{schema:e,facility_types:t,facility_type_map:a,facility_alias_map:r,facility_label_map:s}}update(){let e=this;e.element.html("").classed("flex flex-col w-full",!0),e.element.classed("hidden",e.node_editor_type!=="treatment_facility");let t=e.element.append("select").classed("px-2 my-4 h-8 border rounded-md",!0).attr("id","facility-picker").on("change",function(){var f,h,S,g,k,T;let s=e.element.select("#facility-picker").property("value");if(!s.length)return!1;let n=e.config.facility_type_map[s],c=v(p(e,"selected_node.data")||{});Array.isArray(c)&&(c={});let _={node_id:e.selected_node.id,facility_type:s,ref_data_key:((h=(f=e.selected_node)==null?void 0:f.data)==null?void 0:h.ref_data_key)||((S=e.selected_node)==null?void 0:S.ref_data_key),design_storm_depth_inches:((k=(g=e.selected_node)==null?void 0:g.data)==null?void 0:k.design_storm_depth_inches)||((T=e.selected_node)==null?void 0:T.design_storm_depth_inches)};_=Object.assign(c,_);const u=$=>{e.selected_node.node_type=e.node_editor_type,e.selected_node.data=Object.assign({facility_type:e.element.select("#facility-picker").property("value")},v($)),e.selected_node.id=$.node_id,e.store.dispatch("newGraph")};let o=p(e,"store.state.nereid_state"),l=p(e,"store.state.nereid_region"),d=p(e,`store.state.treatment_facility_fields.${o}.${l}`)||p(e,"store.state.treatment_facility_fields.state.region");console.log("tmnt facility fields:",d),Ut("#facility-form",e.config.schema[n],_,d.disabled,d.ignored,u.bind(e))});e.element.append("div").attr("id","facility-form");let a=v(e.config.facility_types||[]);a.unshift(""),t.selectAll("option").data(a).enter().append("option").attr("value",s=>s&&e.config.facility_label_map[s]).text(s=>s);let r=p(e,"selected_node.data.facility_type");r&&(e.element.select("#facility-picker").property("value",r),t.on("change")())}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div"),e.id=`${e.parent_id}-content-treatment-form`,e.element.attr("id",e.id),e.update(),e.store.events.subscribe("stateChange",()=>this.update())}}function Ut(i,e,t,a,r,s){let n=[...e.required],c=Object.keys(e.properties).filter(d=>!n.includes(d));n.push(...c);let _=[];for(const d of n.filter(f=>!r.includes(f))){let f=e.properties[d];f.name=d,_.push(f)}let u=y.select(i);u.html("");let o=u.append("form");o.attr("id",i.replace("#","")+"-form").attr("name",i.replace("#","")+"-form").attr("method","get").on("submit",function(d){d.preventDefault(),o.selectAll("input").property("disabled",!1);const f=new FormData(d.target),h=q(Object.fromEntries(f.entries()));return s&&s(h),!1}),o.selectAll("div").data(_).enter().append("div").classed("form-group flex flex-row w-full gap-4 text-sm my-4 h-8 items-center",!0).classed("required",d=>e.required.includes(d.name)).each(function(d,f){let h=e.required.includes(d.name),S=(d.description||d.name)+(h?" (required)":" (optional)"),g=y.select(this);g.append("label").classed("control-label py-2 flex w-1/2 ",!0).attr("title",S).text(d.title);let k;switch(d.type){case"string":k=g.append("input").attr("name",d.name).attr("id",d.name).attr("title",S).property("required",e.required.includes(d.name||"")).property("disabled",a.includes(d.name)).classed("border-2 rounded-md px-2 py-1",!0),k.attr("type","text").attr("pattern",d.pattern||".*").attr("value",d.example||d.default||"");break;case"number":k=g.append("input").attr("name",d.name).attr("id",d.name).attr("title",S).property("required",e.required.includes(d.name||"")).property("disabled",a.includes(d.name)).classed("border-2 rounded-md px-2 py-1",!0),k.attr("type","number").attr("step","0.001").attr("value",d.example||d.default||"");break;case"boolean":k=g.append("div").classed("flex flex-row",!0);for(let T of[!0,!1]){let $=d.name+T.toString(),H=k.append("div").classed("flex flex-row items-center",!0);H.append("input").classed("form-check-input p-2",!0).classed("p-2",!0).attr("type","radio").attr("name",d.name).attr("id",$).attr("title",S).property("checked",d.default==T).property("disabled",a.includes(d.name)).attr("value",T),H.append("label").classed("p-2",!0).attr("for",$).attr("title",S).text(T.toString())}break}});for(let[d,f]of Object.entries(t))if(["true","false"].includes(f))for(let h of["true","false"])y.select("#"+d+h).property("checked",f==h);else y.select("#"+d).property("value",f);let l=o.append("div").classed("flex justify-end",!0);l.append("div"),l.append("button").classed("btn btn-blue",!0).attr("type","submit").text("Apply")}const Ht=new It,Gt=new Mt,Jt=new zt,Kt=new Bt,Qt=new Dt({id:"node-editor-drawer",title:"Edit Nodes",children:[Ht,Gt,Jt,Kt]});class V extends b{constructor(e){super({store:m});let t=this;t.id=e.id,t.title=e.title,t.data=[{}],t.data_callback=e.data_callback||function(a){console.log("loaded data: ",a)},t.primary_callback=e.primary_callback||function(){console.log(`clicked primary button load files UI ${t.id}`)},t.primary_button_label=e.primary_button_label||"Apply",t.secondary_callback=e.secondary_callback||null,t.secondary_button_label=e.secondary_button_label||"Update"}_template_primary_button(){return this.primary_callback==null?"":``}_template_secondary_button(){return this.secondary_callback==null?"":``}_template(){return` +
+
${this.title}
+ +
+
+
+ + +
+ ${this._template_secondary_button()} + ${this._template_primary_button()} +
+
+
`}loadFileAsJson(e,t){let a=e.target.files[0];if(!a.type.match("csv|excel|json")){alert("csv or json please");return}let r=this,s=new FileReader;s.onload=function(n){return function(c){let _;n.type.match("csv|excel")?_=y.csvParse(c.target.result):n.type.match("json")&&(_=JSON.parse(c.target.result)),_=Array.isArray(_)?_.map(u=>q(u)):_,r.data=_,e.target.value=""}}(a),s.readAsText(a)}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div"),e.element.html(e._template()),e.primary_button=e.element.select(`#${this.id}-primary-button`),e.primary_button.on("click",()=>{e.data_callback.bind(e)(e.data),e.primary_callback.bind(e)(),e.element.select(`#${this.id} label`)}),e.secondary_button=e.element.select(`#${this.id}-secondary-button`),e.secondary_button.on("click",()=>{e.data_callback.bind(e)(e.data),e.secondary_callback.bind(e)(),e.element.select(`#${this.id} label`)}),e.input=e.element.select(`#${this.id} input`),e.input.on("change",t=>{e.loadFileAsJson.bind(e)(t);let a=e.element.select(`#${this.id} label`);a.text(t.target.files[0].name),a.classed("font-bold",!0);let r=a.node();r.className=r.className.replace(/\btext-gray-.+?\b/g,""),r.classList.add("text-gray-700")})}}const Yt=new V({id:"graph-file-loader",title:"Load Graph (.csv)",primary_callback:M,secondary_callback:de,data_callback:function(e){let t=[...new Set(e.map(u=>u.source).concat(e.map(u=>u.target)))],a=v(this.store.state.graph.nodes.filter(u=>t.includes(u.id))||[{}]),r=a.map(u=>u.id),s=[],n=50,c=50,_;for(let u of t){if(r.includes(u))_=a.find(o=>o.id===u);else{let o=e.find(l=>l.source===u);_={id:u,x:+(o==null?void 0:o.x)||n+10*Math.random(),y:+(o==null?void 0:o.y)||c+10*Math.random()},(o!=null&&o.x||o!=null&&o.y)&&(_.fx=+(o==null?void 0:o.x),_.fy=+(o==null?void 0:o.y))}s.push(_)}this.store.dispatch("setStagedChanges",{staged_changes:{edges:e,nodes:s}})}}),Xt=new V({id:"land-surface-file-loader",title:"Load Land Surfaces (.csv)",primary_callback:M,data_callback:function(e){var _,u;let t=[...new Set(e.map(o=>o.node_id))],a=v(p(this,"store.state.graph.nodes")),r=v(p(this,"store.state.graph.edges")).map(o=>({source:o.source.id,target:o.target.id})),s=a.map(o=>o.id),n=[],c=()=>400*Math.random();for(let o of t){let l=e.filter(g=>g.node_id===o),d,f=B((_=l.filter(g=>g==null?void 0:g.long))==null?void 0:_.map(g=>+g.long)),h=B((u=l.filter(g=>g==null?void 0:g.lat))==null?void 0:u.map(g=>+g.lat)),S=l.map(({node_id:g,surface_key:k,area_acres:T,imp_area_acres:$})=>({node_id:g,surface_key:k,area_acres:T,imp_area_acres:$}));s.includes(o)?(d=a.find(g=>g.id===o),d.node_type="land_surface",d.data=S,f&&h&&(d.longlat=[+f,+h])):(d={id:o,node_type:"land_surface",x:c(),y:c(),data:S},f&&h&&(d.longlat=[+f,+h]),n.push(d))}a=a.concat(n),this.store.dispatch("setStagedChanges",{staged_changes:{edges:r,nodes:a}})}}),Zt=new V({id:"treatment-facilities-file-loader",title:"Load Treatment Facilities (.csv)",primary_callback:M,data_callback:function(e){let t=[...new Set(e.map(_=>_.node_id))],a=v(p(this,"store.state.graph.nodes")||[{}]),r=v(p(this,"store.state.graph.edges")||[{}]).map(_=>({source:_.source.id,target:_.target.id})),s=a.map(_=>_.id),n=[],c=()=>400*Math.random();for(let _ of t){let u=e.find(f=>f.node_id===_),o,{long:l,lat:d}=u;s.includes(_)?(o=a.find(f=>f.id===_),o.data=u,o.node_type="treatment_facility",l&&d&&(o.longlat=[+l,+d])):(o={id:_,node_type:"treatment_facility",x:c(),y:c(),data:u},l&&d&&(o.longlat=[+l,+d]),n.push(o))}a=a.concat(n),this.store.dispatch("setStagedChanges",{staged_changes:{edges:r,nodes:a}})}}),ea=new V({id:"scenario-file-loader",title:"Load Scenario (.json)",primary_callback:M,secondary_callback:de,data_callback:function(e){let t=e.graph,a=e.name,r=v(t.nodes||[{}]);for(let n of r)n.id==null&&console.error("bad egg:",n);let s=t.edges.map(n=>({source:n.source.id,target:n.target.id}));this.store.dispatch("setStagedChanges",{staged_changes:{edges:s,nodes:r,scenario_name:a}})}}),ta=new Et({id:"load-table-drawer",title:"Load from File",children:[Yt,Xt,Zt,ea]});class aa extends b{constructor(e){super({store:m,id:e.id})}get scenario_name(){return p(this.store,"state.scenario_name")}get scenario(){return{name:this.scenario_name,graph:p(this,"store.state.graph")}}saveScenarioBlob(){let e={filename:(this.scenario.name.replaceAll(" ","_")||"scenario")+".json",json:JSON.stringify(this.scenario,void 0,2)},t=new Blob([e.json],{type:"text/plain;charset=utf-8"});W.saveAs(t,e.filename)}dumpScenario(){let e=`
${JSON.stringify(this.scenario,void 0,2)}
`;this.element.select("#dump-scenario-text").html(e)}clearScenario(){this.element.select("#dump-scenario-text").html("")}_template(){return` +
+
Save Scenario to File (json) + +
+
+ Print Scenario for Review (json) + + +
+
+
+ + `}_render(){let e=this;e.element=y.select(`#${e.parent_id}-content`).append("div").attr("id",e.id),e.element.html(e._template()),e.button=e.element.select("#save-scenario"),e.button.on("click",e.saveScenarioBlob.bind(e)),e.button=e.element.select("#dump-scenario"),e.button.on("click",e.dumpScenario.bind(e)),e.button=e.element.select("#clear-scenario"),e.button.on("click",e.clearScenario.bind(e))}}class ra extends b{constructor(e){super({store:m,id:e.id})}get facility_types(){return Object.keys(p(this,"store.state.facility_type_map"))}get facility_type_map(){return p(this,"store.state.facility_type_map")}get schema(){return p(this,"store.state.schema")}get scenario_name(){return p(this.store,"state.scenario_name")}get facility_properties(){let e=new Set;for(let t of this.facility_types){let a=this.facility_type_map[t],r=this.schema[a];Object.keys(r.properties).forEach(e.add,e)}return["long","lat"].forEach(e.add,e),e}get facility_data(){let e=this.facility_properties,t=[],a=v(p(this,"store.state.graph.nodes")||[{}]).filter(r=>r.node_type=="treatment_facility");return a.length==0&&(a=[{}]),a.forEach(r=>{let s={};for(let c of e)s[c]=p(r.data,c)||"";let n=(r==null?void 0:r.longlat)||["",""];s.long=n[0],s.lat=n[1],t.push(s)}),t}facility_template(){let e=this,t=[],a=p(e,"store.state.nereid_state"),r=p(e,"store.state.nereid_region"),s=p(e,`store.state.treatment_facility_fields.${a}.${r}`),n=[...this.facility_properties].filter(c=>!s.ignored.includes(c));for(let[c,_]of Object.entries(this.facility_type_map)){let u=this.schema[_],o={};for(let l of n){let d=p(u.properties[l],"type")||"";u.required.includes(l)&&(d+="-req"),s.disabled.includes(l)&&(d+="-uneditable"),o[l]=d}o.long="number",o.lat="number",o.facility_type=c,t.push(o)}return t}saveTreatmentCSV(){let e=this.facility_data,a={filename:`${this.scenario_name.replaceAll(" ","-")}-treatment_facilities.csv`,csv:U({data:e})},r=new Blob([a.csv],{type:"text/plain;charset=utf-8"});W.saveAs(r,a.filename)}saveTreatmentTemplateCSV(){let e=this.facility_template(),t=p(this,"store.state.nereid_state"),a=p(this,"store.state.nereid_region"),r={filename:`${t}-${a}-treatment_facilities-template.csv`,csv:U({data:e})},s=new Blob([r.csv],{type:"text/plain;charset=utf-8"});W.saveAs(s,r.filename)}_template(){return` +
+
Save Treatment Facility Info to File (csv) + +
+
+
Save Treatment Facility Template to File (csv) + +
+
{}),e.element.select("#save-tmnt").on("click",e.saveTreatmentCSV.bind(e)),e.element.select("#save-tmnt-template").on("click",e.saveTreatmentTemplateCSV.bind(e))}}const sa=new aa({id:"save-scenario"}),ia=new ra({id:"save-tmnt-facility"}),na=new Nt({id:"save-files-drawer",title:"Save to File",children:[sa,ia]}),oa=new At({children:[Ot,Qt,ta,na]}),la=new at({id:"editor-tab",children:[dt,I,ht,bt,Rt,oa]});async function K(i,e){let a=Object.assign({data:[{}],maxHeight:"500px",minHeight:80,autoResize:!1,layout:"fitData",responsiveLayout:!1,history:!1,tooltipsHeader:!0,footerElement:'',columns:[],initialSort:[{column:"node_id",dir:"asc"}]},e),{default:r}=await pe(()=>import("./tabulator.es2015-fNsKARNq.js"),__vite__mapDeps([]));return r.prototype.extendModule("format","formatters",{gscwmp:function(s,n){let{precision:c}=n;return"before "+s.getValue()+` after ${c}`}}),new r(i,a)}class ue extends b{constructor(e){super({store:m,id:e.id});let t=this;t.table_builders=e.table_builders||[],t.tables=[]}get scenario_name(){return p(this.store,"state.scenario_name")}async buildResultsSummary({id:e,data:t,prep_fnx:a,title:r,description:s,filename_csv:n}){let c=this;c.element.select(`#${e}`).remove();let _=c.element.append("div").attr("id",e).classed("grid grid-cols-1 grid-rows-auto pt-8",!0),u=_.append("div").classed(" flex flex-row w-full justify-between items-center",!0);u.append("div").classed("font-bold",!0).html(r);const[o,l]=a(t);if(!o.length){_.append("div").classed("flex justify-center",!0).html("no results to show for this summary yet...");return}let d=u.append("div").classed("py-2",!0).append("button").text("Download Data (csv)").classed("btn btn-blue",!0);s!=null&&_.append("div").html(s);const f=e+"-results-tabulator";_.append("div").attr("id",f);let h=await K(`#${f}`,{data:o,columns:l.map(g=>{let k={title:g.replaceAll("_"," "),field:g,titleDownload:g};return["_acres","_coeff","_load","_pct","_conc","_lbs","_cuft","_cfs","_mpn","_inhr"].some($=>g.includes($))&&(k.formatter="money",k.formatterParams={precision:2}),g.includes("_pct")&&(k.formatterParams={precision:2,symbol:"%",symbolAfter:"p"}),g.includes("_mpn")&&(k.formatterParams={precision:0}),k})});c.tables.push(h);let S=c.scenario_name.replaceAll(" ","-");d.on("click",()=>h.download("csv",S+"-"+n))}async update(e){let t=this;e=e||[],t.element.html(""),(e==null?void 0:e.length)>0&&t.element.append("div").append("button").classed("btn btn-blue",!0).text("Download All Data Summaries (xlsx)").on("click",async()=>{let r={};t.element.selectAll("[id$='-results-tabulator']").nodes().forEach(n=>{let c=y.select(n).attr("id"),_=c.replace("-results-tabulator","").replace("table-","").replace("facility-","bmp-").slice(0,30);c.includes("table-all-data")||(r[_]="#"+c)}),t.element.select("#dummy_table").remove(),t.element.append("div").attr("id","dummy_table").classed("hidden",!0),(await K("#dummy_table")).download("xlsx","AllData.xlsx",{sheets:r})}),O();try{for(let a of t.table_builders)await t.buildResultsSummary(a(e))}finally{L()}}_template(){return` +
Click 'Run Scenario' in the Editor to calculate results.
+ `}_render(){let e=this;e.element=y.select(`#${e.id}`).classed("relative flex justify-center",!0).append("div").classed("flex flex-col relative max-w-screen-md py-10 ",!0).html(e._template()),e.store.events.subscribe("newResults",({results:t})=>e.update(t)),e.store.events.subscribe("changedTab",({current_tab:t})=>{if(t===e.id){let a=p(e,"store.state.results");e.update(a)}})}}const da=i=>({data:i,id:"table-facility-design-summary",title:"Facility design Summary",filename_csv:"facility_design_summary.csv",prep_fnx:t=>{const a=["node_id","facility_type","valid_model","design_intensity_inhr","design_volume_cuft_cumul"];return[(t||[]).filter(s=>s.node_type).filter(s=>s.node_type.includes("facility")).map(s=>Object.fromEntries(Object.entries(s).filter(([n,c])=>a.includes(n)))),a]}}),ca=i=>({data:i,id:"table-facility-wet-weather-capture",title:"Facility Wet Weather Volume Capture Results",filename_csv:"wet_weather_volume_capture_results.csv",prep_fnx:t=>{const a=["node_id","facility_type","valid_model","captured_pct","treated_pct","retained_pct","bypassed_pct","peak_flow_mitigated_pct"];return[(t||[]).filter(s=>s.node_type).filter(s=>s.node_type.includes("facility")).map(s=>Object.fromEntries(Object.entries(s).filter(([n,c])=>a.includes(n)))),a]}});function _a(i){return{data:i,id:"table-facility-volume-reduction",title:"Facility Volume Reduction Results",filename_csv:"volume_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const r=["inflow","treated","retained","captured","bypassed"],n=[...new Set(w(t.map(l=>Object.keys(l))))].filter(l=>{let d=r.some(h=>l.endsWith(`dry_weather_flow_cuft_${h}`)),f=r.some(h=>l.endsWith(`runoff_volume_cuft_${h}`));return d||f}),c=function(l){return a.includes(l)||n.includes(l)};let _=(t||[]).filter(l=>l.node_type).filter(l=>l.node_type.includes("facility")).map(l=>Object.fromEntries(Object.entries(l).filter(([d,f])=>c(d))));const u=[...new Set(w(_.map(l=>Object.keys(l))))],o=a;for(let l of r){let d=u.filter(f=>f.includes(l)).sort((f,h)=>f.includes("winter")||f.includes("summer")?1:-1);o.push(...d)}return[_,o]}}}function pa(i){return{data:i,id:"table-facility-wet-weather-volume-reduction",title:"Facility Wet Weather Volume Reduction Results",filename_csv:"wet_weather_volume_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const r=["inflow","treated","retained","captured","bypassed"],n=[...new Set(w(t.map(l=>Object.keys(l))))].filter(l=>(r.some(f=>l.endsWith(`dry_weather_flow_cuft_${f}`)),r.some(f=>l.endsWith(`runoff_volume_cuft_${f}`)))),c=function(l){return a.includes(l)||n.includes(l)};let _=(t||[]).filter(l=>l.node_type).filter(l=>l.node_type.includes("facility")).map(l=>Object.fromEntries(Object.entries(l).filter(([d,f])=>c(d))));const u=[...new Set(w(_.map(l=>Object.keys(l))))],o=a;for(let l of r){let d=u.filter(f=>f.includes(l));o.push(...d)}return[_,o]}}}function ua(i){return{data:i,id:"table-facility-dry-weather-volume-reduction",title:"Facility Dry Weather Volume Reduction Results",description:"(calculated as total of summer + winter)",filename_csv:"dry_weather_volume_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const r=["inflow","treated","retained","captured","bypassed"],n=[...new Set(w(t.map(l=>Object.keys(l))))].filter(l=>{let d=r.some(f=>l.endsWith(`dry_weather_flow_cuft_${f}`));return r.some(f=>l.endsWith(`runoff_volume_cuft_${f}`)),d}),c=function(l){return a.includes(l)||n.includes(l)};let _=(t||[]).filter(l=>l.node_type).filter(l=>l.node_type.includes("facility")).map(l=>Object.fromEntries(Object.entries(l).filter(([d,f])=>c(d))));for(let l of _)for(let d of r){let f=l[`summer_dry_weather_flow_cuft_${d}`],h=l[`winter_dry_weather_flow_cuft_${d}`];l[`total_dry_weather_volume_cuft_${d}`]=f+h}const u=[...new Set(w(_.map(l=>Object.keys(l))))],o=a;for(let l of r){let d=u.filter(f=>f.includes(l)).sort((f,h)=>f.includes("total")||f.includes("winter")||f.includes("summer")?1:-1);o.push(...d)}return[_,o]}}}function ma(i){return{data:i,id:"table-facility-total-volume-reduction",title:"Facility Total Volume Reduction Results",description:"(calculated as total of results for wet + summer + winter)",filename_csv:"total_volume_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const r=["inflow","treated","retained","captured","bypassed"],n=[...new Set(w(t.map(l=>Object.keys(l))))].filter(l=>{let d=r.some(h=>l.endsWith(`dry_weather_flow_cuft_${h}`)),f=r.some(h=>l.endsWith(`runoff_volume_cuft_${h}`));return d||f}),c=function(l){return a.includes(l)||n.includes(l)};let _=(t||[]).filter(l=>l.node_type).filter(l=>l.node_type.includes("facility")).map(l=>Object.fromEntries(Object.entries(l).filter(([d,f])=>c(d))));for(let l of _)for(let d of r){let f=l[`runoff_volume_cuft_${d}`],h=l[`summer_dry_weather_flow_cuft_${d}`],S=l[`winter_dry_weather_flow_cuft_${d}`];l[`total_volume_cuft_${d}`]=f+h+S}const u=[...new Set(w(_.map(l=>Object.keys(l))))],o=a;for(let l of r){let d=u.filter(f=>f.includes(l)).filter(f=>f.includes("total"));o.push(...d)}return[_,o]}}}function fa(i){return{data:i,id:"table-facility-load-reduction",title:"Facility Load Reduction Results",description:`These results are separated in to wet weather results, + summer dry weather results, and winter dry weather results.`,filename_csv:"load_reduction_results.csv",prep_fnx:t=>{const a=["node_id"],r=function(o){let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed");return a.includes(o)||l},n=[...new Set(w(t.map(o=>Object.keys(o))))].filter(o=>{let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed"),d=!o.includes("dw");return l&&d});let c=(t||[]).filter(o=>o.node_type).filter(o=>o.node_type.includes("facility")).map(o=>Object.fromEntries(Object.entries(o).filter(([l,d])=>r(l))));const _=[...new Set(w(c.map(o=>Object.keys(o))))],u=a;for(let o of n.sort()){let l=_.filter(d=>d.includes(o)).sort((d,f)=>d.includes("total")||d.includes("winter")||d.includes("summer")?1:-1);u.push(...l)}return[c,u]}}}function ya(i){return{data:i,id:"table-facility-total-load-reduction",title:"Facility Total Load Reduction Results",description:"(calculated as total of results for wet + summer + dry)",filename_csv:"total_load_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const s=[...new Set(w(t.map(o=>Object.keys(o))))].filter(o=>{let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed"),d=!o.includes("dw");return l&&d}),n=function(o){let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed");return a.includes(o)||l};let c=(t||[]).filter(o=>o.node_type).filter(o=>o.node_type.includes("facility")).map(o=>Object.fromEntries(Object.entries(o).filter(([l,d])=>n(l))));for(let o of c)for(let l of s){let d=o[l],f=o[`summer_dw${l}`],h=o[`winter_dw${l}`];o[`total_${l}`]=d+f+h}const _=[...new Set(w(c.map(o=>Object.keys(o))))],u=a;for(let o of s.sort()){let l=_.filter(d=>d.includes(o)).filter(d=>d.includes("total")).sort((d,f)=>d.includes("total")||d.includes("winter")||d.includes("summer")?1:-1);u.push(...l)}return[c,u]}}}function ha(i){return{data:i,id:"table-facility-wet-weather-load-reduction",title:"Facility Wet Weather Load Reduction Results",filename_csv:"wet_weather_load_reduction_results.csv",prep_fnx:t=>{const a=function(n){let c=["node_id"].includes(n),_=n.endsWith("lbs_removed")||n.endsWith("mpn_removed"),u=n.includes("dw");return c||_&&!u};let r=(t||[]).filter(n=>n.node_type).filter(n=>n.node_type.includes("facility")).map(n=>Object.fromEntries(Object.entries(n).filter(([c,_])=>a(c))));const s=[...new Set(w(r.map(n=>Object.keys(n))))];return[r,s]}}}function ga(i){return{data:i,id:"table-facility-dry-weather-load-reduction",title:"Facility Dry Weather Load Reduction Results",description:`Includes summer dry weather, winter dry weather, and total dry + weather results (calculated as summer + winter)`,filename_csv:"dry_weather_load_reduction_results.csv",prep_fnx:t=>{let a=["node_id"];const s=[...new Set(w(t.map(o=>Object.keys(o))))].filter(o=>{let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed"),d=!o.includes("dw");return l&&d}),n=function(o){let l=o.endsWith("lbs_removed")||o.endsWith("mpn_removed"),d=o.includes("dw");return a.includes(o)||l&&d};let c=(t||[]).filter(o=>o.node_type).filter(o=>o.node_type.includes("facility")).map(o=>Object.fromEntries(Object.entries(o).filter(([l,d])=>n(l))));for(let o of c)for(let l of s){let d=o[`summer_dw${l}`],f=o[`winter_dw${l}`];o[`total_dw${l}`]=d+f}const _=[...new Set(w(c.map(o=>Object.keys(o))))],u=a;for(let o of s.sort()){let l=_.filter(d=>d.includes(o)).sort((d,f)=>d.includes("total")||d.includes("winter")||d.includes("summer")?1:-1);u.push(...l)}return[c,u]}}}const ba=i=>({data:i,id:"table-land-surface-summary",title:"Land Surface Summary",filename_csv:"land_surface_summary.csv",prep_fnx:t=>{let a=["node_id","area_acres","ro_coeff","imp_pct"];return[(t||[]).filter(s=>(s==null?void 0:s.land_surfaces_count)>0).map(s=>Object.fromEntries(Object.entries(s))),a]}}),va=i=>({data:i,id:"table-land-surface-load-summary",title:"Land Surface Loading Summary",filename_csv:"land_surface_load_summary.csv",prep_fnx:t=>{let a=["node_id"];const r=function(c){let _=c.endsWith("_load_lbs")||c.endsWith("_load_mpn");return a.includes(c)||_};let s=(t||[]).filter(c=>(c==null?void 0:c.land_surfaces_count)>0).map(c=>Object.fromEntries(Object.entries(c).filter(([_,u])=>r(_))));const n=[...new Set(w(s.map(c=>Object.keys(c))))];return console.log("landsurface load summary:",s),[s,n]}}),wa=[da,ca,_a,ma,pa,ua,fa,ya,ha,ga],ka=[ba,va],Sa=new ue({id:"treatment-facility-results-tab",table_builders:wa}),xa=new ue({id:"land-surface-results-tab",table_builders:ka});class Ta extends b{constructor(e){super({store:m,id:e.id})}_template(){return` +
+
+
+ how to coming soon... +
+
+
+ `}async fetch_page(){let e=this,t=`${m.state.nereid_host}/static/pages/how_to`;console.log(t),O(),fetch(t,{method:"GET"}).then(a=>{if(a.status_code===200)return a.text().then(function(r){e.element.select(".markdown_content").html(r)})}).finally(L)}_render(){let e=this;e.element=y.select(`#${e.id}`).classed("relative flex flex-col justify-center",!0).html(e._template()),e.fetch_page()}}const $a=new Ta({id:"how-to-tab"}),Q=new tt({children:[la,Sa,xa,$a]});async function ja(){await le(),Ye.render(),Q.render(),Ze.render(),window.nereid={tabs:Q,editor:I,util:Ge,nereidUtil:Ue,state:I.store.state},I.store.dispatch("updateConfig",{})}ja(); +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} diff --git a/nereid/nereid/static/frontend/dist/assets/tabulator.es2015-fNsKARNq.js b/nereid/nereid/static/frontend/dist/assets/tabulator.es2015-fNsKARNq.js new file mode 100644 index 00000000..2e2f447b --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/tabulator.es2015-fNsKARNq.js @@ -0,0 +1,7 @@ +var E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(o){if(this==null)throw new TypeError('"this" is null or not defined');var n=Object(this),s=n.length>>>0;if(typeof o!="function")throw new TypeError("predicate must be a function");for(var a=arguments[1],r=0;r>>0;if(typeof o!="function")throw new TypeError("predicate must be a function");for(var a=arguments[1],r=0;r>>0;if(a===0)return!1;var r=n|0,l=Math.max(r>=0?r:a-Math.abs(r),0);function u(d,c){return d===c||typeof d=="number"&&typeof c=="number"&&isNaN(d)&&isNaN(c)}for(;ln?(o=t-n,this.element.style.marginLeft=-o+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()};H.prototype.generateColumnsFromRowData=function(t){var o=[],n=this.table.options.autoColumnsDefinitions,s,a;if(t&&t.length){s=t[0];for(var r in s){var l={field:r,title:r},u=s[r];switch(typeof u>"u"?"undefined":E(u)){case"undefined":a="string";break;case"boolean":a="boolean";break;case"object":Array.isArray(u)?a="array":a="string";break;default:!isNaN(u)&&u!==""?a="number":u.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?a="alphanum":a="string";break}l.sorter=a,o.push(l)}if(n)switch(typeof n>"u"?"undefined":E(n)){case"function":this.table.options.columns=n.call(this.table,o);break;case"object":Array.isArray(n)?o.forEach(function(d){var c=n.find(function(h){return h.field===d.field});c&&Object.assign(d,c)}):o.forEach(function(d){n[d.field]&&Object.assign(d,n[d.field])}),this.table.options.columns=o;break}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}};H.prototype.setColumns=function(t,o){for(var n=this;n.headersElement.firstChild;)n.headersElement.removeChild(n.headersElement.firstChild);n.columns=[],n.columnsByIndex=[],n.columnsByField={},n.table.modExists("frozenColumns")&&n.table.modules.frozenColumns.reset(),t.forEach(function(s,a){n._addColumn(s)}),n._reIndexColumns(),n.table.options.responsiveLayout&&n.table.modExists("responsiveLayout",!0)&&n.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!1,!0),n.redraw(!0)};H.prototype._addColumn=function(t,o,n){var s=new R(t,this),a=s.getElement(),r=n&&this.findColumnIndex(n);if(n&&r>-1){var l=this.columns.indexOf(n.getTopColumn()),u=n.getElement();o?(this.columns.splice(l,0,s),u.parentNode.insertBefore(a,u)):(this.columns.splice(l+1,0,s),u.parentNode.insertBefore(a,u.nextSibling))}else o?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement())),s.columnRendered();return s};H.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)};H.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)};H.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})};H.prototype._verticalAlignHeaders=function(){var t=this,o=0;t.columns.forEach(function(n){var s;n.clearVerticalAlign(),s=n.getHeight(),s>o&&(o=s)}),t.columns.forEach(function(n){n.verticalAlign(t.table.options.columnHeaderVertAlign,o)}),t.rowManager.adjustTableSize()};H.prototype.findColumn=function(t){var o=this;if((typeof t>"u"?"undefined":E(t))=="object"){if(t instanceof R)return t;if(t instanceof N)return t._getSelf()||!1;if(typeof HTMLElement<"u"&&t instanceof HTMLElement){var n=o.columns.find(function(s){return s.element===t});return n||!1}}else return this.columnsByField[t]||!1;return!1};H.prototype.getColumnByField=function(t){return this.columnsByField[t]};H.prototype.getColumnsByFieldRoot=function(t){var o=this,n=[];return Object.keys(this.columnsByField).forEach(function(s){var a=s.split(".")[0];a===t&&n.push(o.columnsByField[s])}),n};H.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]};H.prototype.getFirstVisibileColumn=function(o){var o=this.columnsByIndex.findIndex(function(n){return n.visible});return o>-1?this.columnsByIndex[o]:!1};H.prototype.getColumns=function(){return this.columns};H.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex(function(o){return t===o})};H.prototype.getRealColumns=function(){return this.columnsByIndex};H.prototype.traverse=function(t){var o=this;o.columnsByIndex.forEach(function(n,s){t(n,s)})};H.prototype.getDefinitions=function(t){var o=this,n=[];return o.columnsByIndex.forEach(function(s){(!t||t&&s.visible)&&n.push(s.getDefinition())}),n};H.prototype.getDefinitionTree=function(){var t=this,o=[];return t.columns.forEach(function(n){o.push(n.getDefinition(!0))}),o};H.prototype.getComponents=function(t){var o=this,n=[],s=t?o.columns:o.columnsByIndex;return s.forEach(function(a){n.push(a.getComponent())}),n};H.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach(function(o){o.visible&&(t+=o.getWidth())}),t};H.prototype.moveColumn=function(t,o,n){this.moveColumnActual(t,o,n),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),o.element.parentNode.insertBefore(t.element,o.element),n&&o.element.parentNode.insertBefore(o.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()};H.prototype.moveColumnActual=function(t,o,n){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,o,n):this._moveColumnInArray(this.columns,t,o,n),this._moveColumnInArray(this.columnsByIndex,t,o,n,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!0),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")};H.prototype._moveColumnInArray=function(t,o,n,s,a){var r=this,l=t.indexOf(o),u,d=[];l>-1&&(t.splice(l,1),u=t.indexOf(n),u>-1?s&&(u=u+1):u=l,t.splice(u,0,o),a&&(this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.rowManager.rows.forEach(function(c){d=d.concat(r.table.modules.dataTree.getTreeChildren(c,!1,!0))}),d=d.concat(this.table.rowManager.rows),d.forEach(function(c){if(c.cells.length){var h=c.cells.splice(l,1)[0];c.cells.splice(u,0,h)}})))};H.prototype.scrollToColumn=function(t,o,n){var s=this,a=0,r=0,l=0,u=t.getElement();return new Promise(function(d,c){if(typeof o>"u"&&(o=s.table.options.scrollToColumnPosition),typeof n>"u"&&(n=s.table.options.scrollToColumnIfVisible),t.visible){switch(o){case"middle":case"center":l=-s.element.clientWidth/2;break;case"right":l=u.clientWidth-s.headersElement.clientWidth;break}if(!n&&(r=u.offsetLeft,r>0&&r+u.offsetWidtht.rowManager.element.clientHeight&&(o-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(s){var a,r,l;s.visible&&(a=s.definition.width||0,r=typeof s.minWidth>"u"?t.table.options.columnMinWidth:parseInt(s.minWidth),typeof a=="string"?a.indexOf("%")>-1?l=o/100*parseInt(a):l=parseInt(a):l=a,n+=l>r?l:r)}),n};H.prototype.addColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s._addColumn(t,o,n);s._reIndexColumns(),s.table.options.responsiveLayout&&s.table.modExists("responsiveLayout",!0)&&s.table.modules.responsiveLayout.initialize(),s.table.modExists("columnCalcs")&&s.table.modules.columnCalcs.recalc(s.table.rowManager.activeRows),s.redraw(!0),s.table.modules.layout.getMode()!="fitColumns"&&l.reinitializeWidth(),s._verticalAlignHeaders(),s.table.rowManager.reinitialize(),s.table.options.virtualDomHoz&&s.table.vdomHoz.reinitialize(),a(l)})};H.prototype.deregisterColumn=function(t){var o=t.getField(),n;o&&delete this.columnsByField[o],n=this.columnsByIndex.indexOf(t),n>-1&&this.columnsByIndex.splice(n,1),n=this.columns.indexOf(t),n>-1&&this.columns.splice(n,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this._verticalAlignHeaders(),this.redraw()};H.prototype.redraw=function(t){t&&(p.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1?this.table.modules.layout.layout():t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var N=function(o){this._column=o,this.type="ColumnComponent"};N.prototype.getElement=function(){return this._column.getElement()};N.prototype.getDefinition=function(){return this._column.getDefinition()};N.prototype.getField=function(){return this._column.getField()};N.prototype.getCells=function(){var t=[];return this._column.cells.forEach(function(o){t.push(o.getComponent())}),t};N.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible};N.prototype.isVisible=function(){return this._column.visible};N.prototype.show=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()};N.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()};N.prototype.toggle=function(){this._column.visible?this.hide():this.show()};N.prototype.delete=function(){return this._column.delete()};N.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(o){t.push(o.getComponent())}),t};N.prototype.getParentColumn=function(){return this._column.parent instanceof R?this._column.parent.getComponent():!1};N.prototype._getSelf=function(){return this._column};N.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)};N.prototype.getTable=function(){return this._column.table};N.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)};N.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)};N.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)};N.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)};N.prototype.move=function(t,o){var n=this._column.table.columnManager.findColumn(t);n?this._column.table.columnManager.moveColumn(this._column,n,o):console.warn("Move Error - No matching column found:",n)};N.prototype.getNextColumn=function(){var t=this._column.nextColumn();return t?t.getComponent():!1};N.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return t?t.getComponent():!1};N.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)};N.prototype.getWidth=function(){return this._column.getWidth()};N.prototype.setWidth=function(t){var o;return t===!0?o=this._column.reinitializeWidth(!0):o=this._column.setWidth(t),this._column.table.options.virtualDomHoz&&this._column.table.vdomHoz.reinitialize(!0),o};N.prototype.validate=function(){return this._column.validate()};var R=function t(o,n){var s=this;this.table=n.table,this.definition=o,this.parent=n,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),o.columns?(this.isGroup=!0,o.columns.forEach(function(a,r){var l=new t(a,s);s.attachColumn(l)}),s.checkColumnVisibility()):n.registerColumnField(this),o.rowHandle&&this.table.options.movableRows!==!1&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};R.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t};R.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t};R.prototype.checkDefinition=function(){var t=this;Object.keys(this.definition).forEach(function(o){t.defaultOptionList.indexOf(o)===-1&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",o)})};R.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData};R.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)};R.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)};R.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)};R.prototype._mapDepricatedFunctionality=function(){typeof this.definition.hideInHtml<"u"&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),typeof this.definition.align<"u"&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),typeof this.definition.downloadTitle<"u"&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))};R.prototype.setTooltip=function(){var t=this,o=t.definition,n=o.headerTooltip||o.tooltip===!1?o.headerTooltip:t.table.options.tooltipsHeader;n?n===!0?o.field?t.table.modules.localize.bind("columns|"+o.field,function(s){t.element.setAttribute("title",s||o.title)}):t.element.setAttribute("title",o.title):(typeof n=="function"&&(n=n(t.getComponent()),n===!1&&(n="")),t.element.setAttribute("title",n)):t.element.setAttribute("title","")};R.prototype._buildHeader=function(){for(var t=this,o=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);o.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),o.headerVertical==="flip"&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),o.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(typeof o.headerFilterPlaceholder<"u"&&o.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(o.field,o.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(o.topCalc||o.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",function(n){t.setTooltip()})};R.prototype._bindEvents=function(){var t=this,o=t.definition,n,s,a;typeof o.headerClick=="function"&&t.element.addEventListener("click",function(r){o.headerClick(r,t.getComponent())}),typeof o.headerDblClick=="function"&&t.element.addEventListener("dblclick",function(r){o.headerDblClick(r,t.getComponent())}),typeof o.headerContext=="function"&&t.element.addEventListener("contextmenu",function(r){o.headerContext(r,t.getComponent())}),typeof o.headerTap=="function"&&(a=!1,t.element.addEventListener("touchstart",function(r){a=!0},{passive:!0}),t.element.addEventListener("touchend",function(r){a&&o.headerTap(r,t.getComponent()),a=!1})),typeof o.headerDblTap=="function"&&(n=null,t.element.addEventListener("touchend",function(r){n?(clearTimeout(n),n=null,o.headerDblTap(r,t.getComponent())):n=setTimeout(function(){clearTimeout(n),n=null},300)})),typeof o.headerTapHold=="function"&&(s=null,t.element.addEventListener("touchstart",function(r){clearTimeout(s),s=setTimeout(function(){clearTimeout(s),s=null,a=!1,o.headerTapHold(r,t.getComponent())},1e3)},{passive:!0}),t.element.addEventListener("touchend",function(r){clearTimeout(s),s=null})),typeof o.cellClick=="function"&&(t.cellEvents.cellClick=o.cellClick),typeof o.cellDblClick=="function"&&(t.cellEvents.cellDblClick=o.cellDblClick),typeof o.cellContext=="function"&&(t.cellEvents.cellContext=o.cellContext),typeof o.cellMouseEnter=="function"&&(t.cellEvents.cellMouseEnter=o.cellMouseEnter),typeof o.cellMouseLeave=="function"&&(t.cellEvents.cellMouseLeave=o.cellMouseLeave),typeof o.cellMouseOver=="function"&&(t.cellEvents.cellMouseOver=o.cellMouseOver),typeof o.cellMouseOut=="function"&&(t.cellEvents.cellMouseOut=o.cellMouseOut),typeof o.cellMouseMove=="function"&&(t.cellEvents.cellMouseMove=o.cellMouseMove),typeof o.cellTap=="function"&&(t.cellEvents.cellTap=o.cellTap),typeof o.cellDblTap=="function"&&(t.cellEvents.cellDblTap=o.cellDblTap),typeof o.cellTapHold=="function"&&(t.cellEvents.cellTapHold=o.cellTapHold),typeof o.cellEdited=="function"&&(t.cellEvents.cellEdited=o.cellEdited),typeof o.cellEditing=="function"&&(t.cellEvents.cellEditing=o.cellEditing),typeof o.cellEditCancelled=="function"&&(t.cellEvents.cellEditCancelled=o.cellEditCancelled)};R.prototype._buildColumnHeader=function(){var t=this,o=this.definition,n=this.table;if(n.modExists("sort")&&n.modules.sort.initializeColumn(this,this.titleHolderElement),(o.headerContextMenu||o.headerClickMenu||o.headerMenu)&&n.modExists("menu")&&n.modules.menu.initializeColumnHeader(this),n.modExists("format")&&n.modules.format.initializeColumn(this),typeof o.editor<"u"&&n.modExists("edit")&&n.modules.edit.initializeColumn(this),typeof o.validator<"u"&&n.modExists("validate")&&n.modules.validate.initializeColumn(this),n.modExists("mutator")&&n.modules.mutator.initializeColumn(this),n.modExists("accessor")&&n.modules.accessor.initializeColumn(this),E(n.options.responsiveLayout)&&n.modExists("responsiveLayout")&&n.modules.responsiveLayout.initializeColumn(this),typeof o.visible<"u"&&(o.visible?this.show(!0):this.hide(!0)),o.cssClass){var s=o.cssClass.split(" ");s.forEach(function(a){t.element.classList.add(a)})}o.field&&this.element.setAttribute("tabulator-field",o.field),this.setMinWidth(typeof o.minWidth>"u"?this.table.options.columnMinWidth:parseInt(o.minWidth)),(o.maxWidth||this.table.options.columnMaxWidth)&&o.maxWidth!==!1&&this.setMaxWidth(typeof o.maxWidth>"u"?this.table.options.columnMaxWidth:parseInt(o.maxWidth)),this.reinitializeWidth(),this.tooltip=this.definition.tooltip||this.definition.tooltip===!1?this.definition.tooltip:this.table.options.tooltips,this.hozAlign=typeof this.definition.hozAlign>"u"?this.table.options.cellHozAlign:this.definition.hozAlign,this.vertAlign=typeof this.definition.vertAlign>"u"?this.table.options.cellVertAlign:this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign};R.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var t=document.createElement("div");return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t};R.prototype._buildColumnHeaderTitle=function(){var t=this,o=t.definition,n=t.table,s=document.createElement("div");if(s.classList.add("tabulator-col-title"),o.editableTitle){var a=document.createElement("input");a.classList.add("tabulator-title-editor"),a.addEventListener("click",function(r){r.stopPropagation(),a.focus()}),a.addEventListener("change",function(){o.title=a.value,n.options.columnTitleChanged.call(t.table,t.getComponent())}),s.appendChild(a),o.field?n.modules.localize.bind("columns|"+o.field,function(r){a.value=r||o.title||" "}):a.value=o.title||" "}else o.field?n.modules.localize.bind("columns|"+o.field,function(r){t._formatColumnHeaderTitle(s,r||o.title||" ")}):t._formatColumnHeaderTitle(s,o.title||" ");return s};R.prototype._formatColumnHeaderTitle=function(t,o){var n=this,s,a,r,l,u;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(s=this.table.modules.format.getFormatter(this.definition.titleFormatter),u=function(c){n.titleFormatterRendered=c},l={getValue:function(){return o},getElement:function(){return t}},r=this.definition.titleFormatterParams||{},r=typeof r=="function"?r():r,a=s.call(this.table.modules.format,l,r,u),typeof a>"u"?"undefined":E(a)){case"object":a instanceof Node?t.appendChild(a):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",a));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=a}else t.innerHTML=o};R.prototype._buildGroupHeader=function(){var t=this;if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var o=this.definition.cssClass.split(" ");o.forEach(function(n){t.element.classList.add(n)})}(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign,this.element.appendChild(this.groupElement)};R.prototype._getFlatData=function(t){return t[this.field]};R.prototype._getNestedData=function(t){for(var o=t,n=this.fieldStructure,s=n.length,a,r=0;r-1&&this.columns.splice(o,1),this.columns.length||this.delete()};R.prototype.setWidth=function(t){this.widthFixed=!0,this.setWidthActual(t)};R.prototype.setWidthActual=function(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(o){o.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()};R.prototype.checkCellHeights=function(){var t=[];this.cells.forEach(function(o){o.row.heightInitialized&&(o.row.getElement().offsetParent!==null?(t.push(o.row),o.row.clearCellHeight()):o.row.heightInitialized=!1)}),t.forEach(function(o){o.calcHeight()}),t.forEach(function(o){o.setCellHeight()})};R.prototype.getWidth=function(){var t=0;return this.isGroup?this.columns.forEach(function(o){o.visible&&(t+=o.getWidth())}):t=this.width,t};R.prototype.getHeight=function(){return this.element.offsetHeight};R.prototype.setMinWidth=function(t){this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(o){o.setMinWidth()})};R.prototype.setMaxWidth=function(t){this.maxWidth=t,this.maxWidthStyled=t?t+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach(function(o){o.setMaxWidth()})};R.prototype.delete=function(){var t=this;return new Promise(function(o,n){t.isGroup&&t.columns.forEach(function(r){r.delete()}),t.table.modExists("edit")&&t.table.modules.edit.currentCell.column===t&&t.table.modules.edit.cancelEdit();for(var s=t.cells.length,a=0;a-1?this._nextVisibleColumn(t+1):!1};R.prototype._nextVisibleColumn=function(t){var o=this.table.columnManager.getColumnByIndex(t);return!o||o.visible?o:this._nextVisibleColumn(t+1)};R.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1?this._prevVisibleColumn(t-1):!1};R.prototype._prevVisibleColumn=function(t){var o=this.table.columnManager.getColumnByIndex(t);return!o||o.visible?o:this._prevVisibleColumn(t-1)};R.prototype.reinitializeWidth=function(t){this.widthFixed=!1,typeof this.definition.width<"u"&&!t&&this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()};R.prototype.fitToData=function(){var t=this;this.widthFixed||(this.element.style.width="",t.cells.forEach(function(n){n.clearWidth()}));var o=this.element.offsetWidth;(!t.width||!this.widthFixed)&&(t.cells.forEach(function(n){var s=n.getWidth();s>o&&(o=s)}),o&&t.setWidthActual(o+1))};R.prototype.updateDefinition=function(t){var o=this;return new Promise(function(n,s){var a;o.isGroup||o.parent.isGroup?(console.warn("Column Update Error - The updateDefinition function is only available on ungrouped columns"),s("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(a=Object.assign({},o.getDefinition()),a=Object.assign(a,t),o.table.columnManager.addColumn(a,!1,o).then(function(r){a.field==o.field&&(o.field=!1),o.delete().then(function(){n(r.getComponent())}).catch(function(l){s(l)})}).catch(function(r){s(r)}))})};R.prototype.deleteCell=function(t){var o=this.cells.indexOf(t);o>-1&&this.cells.splice(o,1)};R.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","maxWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","headerHozAlign","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","clickMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"];R.prototype.getComponent=function(){return this.component||(this.component=new N(this)),this.component};var C=function(o){this.table=o,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};C.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t};C.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t};C.prototype.getElement=function(){return this.element};C.prototype.getTableElement=function(){return this.tableElement};C.prototype.getRowPosition=function(t,o){return o?this.activeRows.indexOf(t):this.rows.indexOf(t)};C.prototype.setColumnManager=function(t){this.columnManager=t};C.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",function(){var o=t.element.scrollLeft;t.scrollLeft!=o&&(t.columnManager.scrollHorizontal(o),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(o),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(o),t.table.options.scrollHorizontal(o)),t.scrollLeft=o}),this.renderMode==="virtual"&&t.element.addEventListener("scroll",function(){var o=t.element.scrollTop,n=t.scrollTop>o;t.scrollTop!=o?(t.scrollTop=o,t.scrollVertical(n),t.table.options.ajaxProgressiveLoad=="scroll"&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-o),t.table.options.scrollVertical(o)):t.scrollTop=o})};C.prototype.findRow=function(t){var o=this;if((typeof t>"u"?"undefined":E(t))=="object"){if(t instanceof T)return t;if(t instanceof F)return t._getSelf()||!1;if(typeof HTMLElement<"u"&&t instanceof HTMLElement){var n=o.rows.find(function(a){return a.getElement()===t});return n||!1}}else{if(typeof t>"u"||t===null)return!1;var s=o.rows.find(function(a){return a.data[o.table.options.index]==t});return s||!1}return!1};C.prototype.getRowFromDataObject=function(t){var o=this.rows.find(function(n){return n.data===t});return o||!1};C.prototype.getRowFromPosition=function(t,o){return o?this.activeRows[t]:this.rows[t]};C.prototype.scrollToRow=function(t,o,n){var s=this,a=this.getDisplayRows().indexOf(t),r=t.getElement(),l,u=0;return new Promise(function(d,c){if(a>-1){if(typeof o>"u"&&(o=s.table.options.scrollToRowPosition),typeof n>"u"&&(n=s.table.options.scrollToRowIfVisible),o==="nearest")switch(s.renderMode){case"classic":l=p.prototype.helpers.elOffset(r).top,o=Math.abs(s.element.scrollTop-l)>Math.abs(s.element.scrollTop+s.element.clientHeight-l)?"bottom":"top";break;case"virtual":o=Math.abs(s.vDomTop-a)>Math.abs(s.vDomBottom-a)?"bottom":"top";break}if(!n&&p.prototype.helpers.elVisible(r)&&(u=p.prototype.helpers.elOffset(r).top-p.prototype.helpers.elOffset(s.element).top,u>0&&u"u"?"undefined":E(s))==="object"){var r=new T(s,n);n.rows.push(r)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",s)}),n.refreshActiveData(!1,!1,o),n.table.options.dataLoaded.call(this.table,t)):console.error(`Data Loading Error - Unable to process data due to invalid data type +Expecting: array +Received: `,typeof t>"u"?"undefined":E(t),` +Data: `,t)};C.prototype._wipeElements=function(){this.rows.forEach(function(t){t.wipe()}),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.wipe(),this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()};C.prototype.deleteRow=function(t,o){var n=this.rows.indexOf(t),s=this.activeRows.indexOf(t);s>-1&&this.activeRows.splice(s,1),n>-1&&this.rows.splice(n,1),this.setActiveRows(this.activeRows),this.displayRowIterator(function(a){var r=a.indexOf(t);r>-1&&a.splice(r,1)}),o||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")};C.prototype.addRow=function(t,o,n,s){var a=this.addRowActual(t,o,n,s);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",a,{data:t,pos:o,index:n}),a};C.prototype.addRows=function(t,o,n){var s=this,a=this,r=[];return new Promise(function(l,u){o=s.findAddRowPos(o),Array.isArray(t)||(t=[t]),t.length-1,(typeof n>"u"&&o||typeof n<"u"&&!o)&&t.reverse(),t.forEach(function(d,c){var h=a.addRow(d,o,n,!0);r.push(h)}),s.table.options.groupBy&&s.table.modExists("groupRows")?s.table.modules.groupRows.updateGroupRows(!0):s.table.options.pagination&&s.table.modExists("page")?s.refreshActiveData(!1,!1,!0):s.reRenderInPosition(),s.table.modExists("columnCalcs")&&s.table.modules.columnCalcs.recalc(s.table.rowManager.activeRows),s.regenerateRowNumbers(),l(r)})};C.prototype.findAddRowPos=function(t){return typeof t>"u"&&(t=this.table.options.addRowPos),t==="pos"&&(t=!0),t==="bottom"&&(t=!1),t};C.prototype.addRowActual=function(t,o,n,s){var a=t instanceof T?t:new T(t||{},this),r=this.findAddRowPos(o),l=-1,u,d;if(!n&&this.table.options.pagination&&this.table.options.paginationAddRow=="page"&&(d=this.getDisplayRows(),r?d.length?n=d[0]:this.activeRows.length&&(n=this.activeRows[this.activeRows.length-1],r=!1):d.length&&(n=d[d.length-1],r=!(d.length1&&(!n||n&&c.indexOf(n)==-1?r?c[0]!==a&&(n=c[0],this._moveRowInArray(a.getGroup().rows,a,n,!r)):c[c.length-1]!==a&&(n=c[c.length-1],this._moveRowInArray(a.getGroup().rows,a,n,!r)):this._moveRowInArray(a.getGroup().rows,a,n,!r))}return n&&(l=this.rows.indexOf(n)),n&&l>-1?(u=this.activeRows.indexOf(n),this.displayRowIterator(function(h){var m=h.indexOf(n);m>-1&&h.splice(r?m:m+1,0,a)}),u>-1&&this.activeRows.splice(r?u:u+1,0,a),this.rows.splice(r?l:l+1,0,a)):r?(this.displayRowIterator(function(h){h.unshift(a)}),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator(function(h){h.push(a)}),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),s||this.reRenderInPosition(),a};C.prototype.moveRow=function(t,o,n){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(o),to:o,after:n}),this.moveRowActual(t,o,n),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())};C.prototype.moveRowActual=function(t,o,n){var s=this;if(this._moveRowInArray(this.rows,t,o,n),this._moveRowInArray(this.activeRows,t,o,n),this.displayRowIterator(function(l){s._moveRowInArray(l,t,o,n)}),this.table.options.groupBy&&this.table.modExists("groupRows")){!n&&o instanceof S&&(o=this.table.rowManager.prevDisplayRow(t)||o);var a=o.getGroup(),r=t.getGroup();a===r?this._moveRowInArray(a.rows,t,o,n):(r&&r.removeRow(t),a.insertRow(t,o,n))}};C.prototype._moveRowInArray=function(t,o,n,s){var a,r,l,u;if(o!==n&&(a=t.indexOf(o),a>-1&&(t.splice(a,1),r=t.indexOf(n),r>-1?s?t.splice(r+1,0,o):t.splice(r,0,o):t.splice(a,0,o)),t===this.getDisplayRows())){l=aa?r:a+1;for(var d=l;d<=u;d++)t[d]&&this.styleRow(t[d],d)}};C.prototype.clearData=function(){this.setData([])};C.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)};C.prototype.getDisplayRowIndex=function(t){var o=this.getDisplayRows().indexOf(t);return o>-1?o:!1};C.prototype.nextDisplayRow=function(t,o){var n=this.getDisplayRowIndex(t),s=!1;return n!==!1&&n-1)?n:!1};C.prototype.getData=function(t,o){var n=[],s=this.getRows(t);return s.forEach(function(a){a.type=="row"&&n.push(a.getData(o||"data"))}),n};C.prototype.getComponents=function(t){var o=[],n=this.getRows(t);return n.forEach(function(s){o.push(s.getComponent())}),o};C.prototype.getDataCount=function(t){var o=this.getRows(t);return o.length};C.prototype._genRemoteRequest=function(){var t=this,o=this.table,n=o.options,s={};if(o.modExists("page")){if(n.ajaxSorting){var a=this.table.modules.sort.getSort();a.forEach(function(l){delete l.column}),s[this.table.modules.page.paginationDataSentNames.sorters]=a}if(n.ajaxFiltering){var r=this.table.modules.filter.getFilters(!0,!0);s[this.table.modules.page.paginationDataSentNames.filters]=r}this.table.modules.ajax.setParams(s,!0)}o.modules.ajax.sendRequest().then(function(l){t._setDataActual(l,!0)}).catch(function(l){})};C.prototype.filterRefresh=function(){var t=this.table,o=t.options,n=this.scrollLeft;o.ajaxFiltering?o.pagination=="remote"&&t.modExists("page")?(t.modules.page.reset(!0),t.modules.page.setPage(1).then(function(){}).catch(function(){})):o.ajaxProgressiveLoad?t.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData("filter"),this.scrollHorizontal(n)};C.prototype.sorterRefresh=function(t){var o=this.table,n=this.table.options,s=this.scrollLeft;n.ajaxSorting?(n.pagination=="remote"||n.progressiveLoad)&&o.modExists("page")?(o.modules.page.reset(!0),o.modules.page.setPage(1).then(function(){}).catch(function(){})):n.ajaxProgressiveLoad?o.modules.ajax.loadData().then(function(){}).catch(function(){}):this._genRemoteRequest():this.refreshActiveData(t?"filter":"sort"),this.scrollHorizontal(s)};C.prototype.scrollHorizontal=function(t){this.scrollLeft=t,this.element.scrollLeft=t,this.table.options.groupBy&&this.table.modules.groupRows.scrollHeaders(t),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.scrollHorizontal(t)};C.prototype.refreshActiveData=function(t,o,n){var s=this,a=this.table,r=["all","filter","sort","display","freeze","group","tree","page"],l;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||r.indexOf(t)"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]};C.prototype.getVisibleRows=function(t){var o=this.element.scrollTop,n=this.element.clientHeight+o,s=!1,a=0,r=0,l=this.getDisplayRows();if(t){this.getDisplayRows();for(var u=this.vDomTop;u<=this.vDomBottom;u++)if(l[u])if(s)if(n-l[u].getElement().offsetTop>=0)r=u;else break;else if(o-l[u].getElement().offsetTop>=0)a=u;else if(s=!0,n-l[u].getElement().offsetTop>=0)r=u;else break}else a=this.vDomTop,r=this.vDomBottom;return l.slice(a,r+1)};C.prototype.displayRowIterator=function(t){this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length};C.prototype.getRows=function(t){var o;switch(t){case"active":o=this.activeRows;break;case"display":o=this.table.rowManager.getDisplayRows();break;case"visible":o=this.getVisibleRows(!0);break;case"selected":o=this.table.modules.selectRow.selectedRows;break;default:o=this.rows}return o};C.prototype.reRenderInPosition=function(t){if(this.getRenderMode()=="virtual")if(this.redrawBlock)t?t():this.redrawBlockRederInPosition=!0;else{for(var o=this.element.scrollTop,n=!1,s=!1,a=this.scrollLeft,r=this.getDisplayRows(),l=this.vDomTop;l<=this.vDomBottom;l++)if(r[l]){var u=o-r[l].getElement().offsetTop;if(s===!1||Math.abs(u)this.vDomWindowBuffer&&(this.vDomWindowBuffer=b*2),w.type!=="group"&&(h=!1),s.vDomBottom++,c++}t?(s.vDomTopPad=o?s.vDomRowHeight*this.vDomTop+n:s.scrollTop-d,s.vDomBottomPad=s.vDomBottom==s.displayRowsCount-1?0:Math.max(s.vDomScrollHeight-s.vDomTopPad-u-d,0)):(this.vDomTopPad=0,s.vDomRowHeight=Math.floor((u+d)/c),s.vDomBottomPad=s.vDomRowHeight*(s.displayRowsCount-s.vDomBottom-1),s.vDomScrollHeight=d+u+s.vDomBottomPad-s.height),a.style.paddingTop=s.vDomTopPad+"px",a.style.paddingBottom=s.vDomBottomPad+"px",o&&(this.scrollTop=s.vDomTopPad+d+n-(this.element.scrollWidth>this.element.clientWidth?this.element.offsetHeight-this.element.clientHeight:0)),this.scrollTop=Math.min(this.scrollTop,this.element.scrollHeight-this.height),this.element.scrollWidth>this.element.offsetWidth&&o&&(this.scrollTop+=this.element.offsetHeight-this.element.clientHeight),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,r.scrollTop=this.scrollTop,a.style.minWidth=h?s.table.columnManager.getWidth()+"px":"",s.table.options.groupBy&&s.table.modules.layout.getMode()!="fitDataFill"&&s.displayRowsCount==s.table.modules.groupRows.countGroups()&&(s.tableElement.style.minWidth=s.table.columnManager.getWidth())}else this.renderEmptyScroll();this.fixedHeight||this.adjustTableSize()};C.prototype.scrollVertical=function(t){var o=this.scrollTop-this.vDomScrollPosTop,n=this.scrollTop-this.vDomScrollPosBottom,s=this.vDomWindowBuffer*2;if(-o>s||n>s){var a=this.scrollLeft;this._virtualRenderFill(Math.floor(this.element.scrollTop/this.element.scrollHeight*this.displayRowsCount)),this.scrollHorizontal(a)}else t?(o<0&&this._addTopRow(-o),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(-n):this.vDomScrollPosBottom=this.scrollTop)):(o>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o):this.vDomScrollPosTop=this.scrollTop),n>=0&&this._addBottomRow(n))};C.prototype._addTopRow=function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.tableElement,s=this.getDisplayRows();if(this.vDomTop){var a=this.vDomTop-1,r=s[a],l=r.getHeight()||this.vDomRowHeight;t>=l&&(this.styleRow(r,a),n.insertBefore(r.getElement(),n.firstChild),(!r.initialized||!r.heightInitialized)&&(this.vDomTopNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomTopPad-=l,this.vDomTopPad<0&&(this.vDomTopPad=a*this.vDomRowHeight),a||(this.vDomTopPad=0),n.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=l,this.vDomTop--),t=-(this.scrollTop-this.vDomScrollPosTop),r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=r.getHeight()*2),o=(s[this.vDomTop-1].getHeight()||this.vDomRowHeight)?this._addTopRow(t,o+1):this._quickNormalizeRowHeight(this.vDomTopNewRows)}};C.prototype._removeTopRow=function(t){var o=this.tableElement,n=this.getDisplayRows()[this.vDomTop],s=n.getHeight()||this.vDomRowHeight;if(t>=s){var a=n.getElement();a.parentNode.removeChild(a),this.vDomTopPad+=s,o.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer,this.vDomTop++,t=this.scrollTop-this.vDomScrollPosTop,this._removeTopRow(t)}};C.prototype._addBottomRow=function(t){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.tableElement,s=this.getDisplayRows();if(this.vDomBottom=l&&(this.styleRow(r,a),n.appendChild(r.getElement()),(!r.initialized||!r.heightInitialized)&&(this.vDomBottomNewRows.push(r),r.heightInitialized||r.clearCellHeight()),r.initialize(),this.vDomBottomPad-=l,(this.vDomBottomPad<0||a==this.displayRowsCount-1)&&(this.vDomBottomPad=0),n.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=l,this.vDomBottom++),t=this.scrollTop-this.vDomScrollPosBottom,r.getHeight()>this.vDomWindowBuffer&&(this.vDomWindowBuffer=r.getHeight()*2),o=(s[this.vDomBottom+1].getHeight()||this.vDomRowHeight)?this._addBottomRow(t,o+1):this._quickNormalizeRowHeight(this.vDomBottomNewRows)}};C.prototype._removeBottomRow=function(t){var o=this.tableElement,n=this.getDisplayRows()[this.vDomBottom],s=n.getHeight()||this.vDomRowHeight;if(t>=s){var a=n.getElement();a.parentNode&&a.parentNode.removeChild(a),this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),o.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s,this.vDomBottom--,t=-(this.scrollTop-this.vDomScrollPosBottom),this._removeBottomRow(t)}};C.prototype._quickNormalizeRowHeight=function(t){t.forEach(function(o){o.calcHeight()}),t.forEach(function(o){o.setCellHeight()}),t.length=0};C.prototype.normalizeHeight=function(){this.activeRows.forEach(function(t){t.normalizeHeight()})};C.prototype.adjustTableSize=function(){var t=this.element.clientHeight,o;if(this.renderMode==="virtual"){var n=Math.floor(this.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(this.element.style.minHeight="calc(100% - "+n+"px)",this.element.style.height="calc(100% - "+n+"px)",this.element.style.maxHeight="calc(100% - "+n+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-n+"px",this.element.scrollTop=this.scrollTop),this.height=this.element.clientHeight,this.vDomWindowBuffer=this.table.options.virtualDomBuffer||this.height,!this.fixedHeight&&t!=this.element.clientHeight&&(o=this.table.modExists("resizeTable"),(o&&!this.table.modules.resizeTable.autoResize||!o)&&this.redraw())}};C.prototype.reinitialize=function(){this.rows.forEach(function(t){t.reinitialize(!0)})};C.prototype.blockRedraw=function(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1};C.prototype.restoreRedraw=function(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.stage,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRederInPosition&&this.reRenderInPosition(),this.redrawBlockRederInPosition=!1};C.prototype.redraw=function(t){var o=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():(this.renderMode=="classic"?this.table.options.groupBy?this.refreshActiveData("group",!1,!1):this._simpleRender():(this.reRenderInPosition(),this.scrollHorizontal(o)),this.displayRowsCount||this.table.options.placeholder&&this.getElement().appendChild(this.table.options.placeholder))};C.prototype.resetScroll=function(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))};var ee=function(o){this.table=o,this.element=this.table.rowManager.tableElement,this.holderEl=this.table.rowManager.element,this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.window=200,this.initialized=!1,this.columns=[],this.compatabilityCheck()&&this.initialize()};ee.prototype.compatabilityCheck=function(){var t=this.table.options,o=!1,n=!0;return t.layout=="fitDataTable"&&(console.warn("Horizontal Vitrual DOM is not compatible with fitDataTable layout mode"),n=!1),t.responsiveLayout&&(console.warn("Horizontal Vitrual DOM is not compatible with responsive columns"),n=!1),this.table.rtl&&(console.warn("Horizontal Vitrual DOM is not currently compatible with RTL text direction"),n=!1),t.columns&&(o=t.columns.find(function(s){return s.frozen}),o&&(console.warn("Horizontal Vitrual DOM is not compatible with frozen columns"),n=!1)),n||(t.virtualDomHoz=!1),n};ee.prototype.initialize=function(){var t=this;this.holderEl.addEventListener("scroll",function(){var o=t.holderEl.scrollLeft;t.scrollLeft!=o&&(t.scrollLeft=o,t.scroll(o-(t.vDomScrollPosLeft+t.window)))})};ee.prototype.deinitialize=function(){this.initialized=!1};ee.prototype.clear=function(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0};ee.prototype.dataChange=function(){var t=!1,o=0,n=0,s,a,r;if(this.table.options.layout==="fitData"){if(this.table.columnManager.columnsByIndex.forEach(function(u){!u.definition.width&&u.visible&&(t=!0)}),t&&t&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.holderEl.clientWidth+this.window,this.table.options.groupBy?(s=this.table.modules.groupRows.getGroups(!1)[0],a=s.getRows(!1)[0]):a=this.table.rowManager.getDisplayRows()[0],a)){r=a.getElement(),a.generateCells(),this.element.appendChild(r);for(var n=0;nthis.vDomScrollPosRight)break}for(r.parentNode.removeChild(r),this.fitDataColAvg=Math.floor(o/(n+1)),n;nn.vDomScrollPosLeft&&athis.holderEl.clientWidth*.8?this.reinitialize():t>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())};ee.prototype.colPositionAdjust=function(t,o,n){for(var s=t;s=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=t.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.addColRight())};ee.prototype.addColLeft=function(){var t=this.columns[this.leftCol-1],o;if(t&&t.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){var o=this.table.rowManager.getVisibleRows();o.forEach(function(s){if(s.type!=="group"){var a=s.getCell(t);s.getElement().prepend(a.getElement()),a.cellRendered()}}),this.leftCol?this.vDomPadLeft-=t.getWidth():this.vDomPadLeft=0,this.element.style.paddingLeft=this.vDomPadLeft+"px",this.leftCol--,this.addColLeft()}};ee.prototype.removeColRight=function(o){var o=this.columns[this.rightCol],n;o&&o.modules.vdomHoz.leftPos>this.vDomScrollPosRight&&(n=this.table.rowManager.getVisibleRows(),o.modules.vdomHoz.visible=!1,n.forEach(function(s){if(s.type!=="group"){var a=s.getCell(o);s.getElement().removeChild(a.getElement())}}),this.vDomPadRight+=o.getWidth(),this.element.style.paddingRight=this.vDomPadRight+"px",this.rightCol--,this.removeColRight())};ee.prototype.removeColLeft=function(){var t=this.columns[this.leftCol],o;t&&t.modules.vdomHoz.rightPos-1}return!1};F.prototype.treeCollapse=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.collapseRow(this._row)};F.prototype.treeExpand=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.expandRow(this._row)};F.prototype.treeToggle=function(){this._row.table.modExists("dataTree",!0)&&this._row.table.modules.dataTree.toggleRow(this._row)};F.prototype.getTreeParent=function(){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.getTreeParent(this._row):!1};F.prototype.getTreeChildren=function(){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.getTreeChildren(this._row,!0):!1};F.prototype.addTreeChild=function(t,o,n){return this._row.table.modExists("dataTree",!0)?this._row.table.modules.dataTree.addTreeChildRow(this._row,t,o,n):!1};F.prototype.reformat=function(){return this._row.reinitialize()};F.prototype.getGroup=function(){return this._row.getGroup().getComponent()};F.prototype.getTable=function(){return this._row.table};F.prototype.getNextRow=function(){var t=this._row.nextRow();return t&&t.getComponent()};F.prototype.getPrevRow=function(){var t=this._row.prevRow();return t&&t.getComponent()};var T=function(o,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"row";this.table=n.table,this.parent=n,this.data={},this.type=s,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.component=null,this.created=!1,this.setData(o)};T.prototype.create=function(){this.created||(this.created=!0,this.generateElement())};T.prototype.createElement=function(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t};T.prototype.getElement=function(){return this.create(),this.element};T.prototype.detachElement=function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)};T.prototype.generateElement=function(){var t=this,o,n,s;this.createElement(),t.table.options.selectable!==!1&&t.table.modExists("selectRow")&&t.table.modules.selectRow.initializeRow(this),t.table.options.movableRows!==!1&&t.table.modExists("moveRow")&&t.table.modules.moveRow.initializeRow(this),t.table.options.dataTree!==!1&&t.table.modExists("dataTree")&&t.table.modules.dataTree.initializeRow(this),t.table.options.responsiveLayout==="collapse"&&t.table.modExists("responsiveLayout")&&t.table.modules.responsiveLayout.initializeRow(this),(t.table.options.rowContextMenu||t.table.options.rowClickMenu)&&this.table.modExists("menu")&&t.table.modules.menu.initializeRow(this),t.table.options.rowClick&&t.element.addEventListener("click",function(a){t.table.options.rowClick(a,t.getComponent())}),t.table.options.rowDblClick&&t.element.addEventListener("dblclick",function(a){t.table.options.rowDblClick(a,t.getComponent())}),t.table.options.rowContext&&t.element.addEventListener("contextmenu",function(a){t.table.options.rowContext(a,t.getComponent())}),t.table.options.rowMouseEnter&&t.element.addEventListener("mouseenter",function(a){t.table.options.rowMouseEnter(a,t.getComponent())}),t.table.options.rowMouseLeave&&t.element.addEventListener("mouseleave",function(a){t.table.options.rowMouseLeave(a,t.getComponent())}),t.table.options.rowMouseOver&&t.element.addEventListener("mouseover",function(a){t.table.options.rowMouseOver(a,t.getComponent())}),t.table.options.rowMouseOut&&t.element.addEventListener("mouseout",function(a){t.table.options.rowMouseOut(a,t.getComponent())}),t.table.options.rowMouseMove&&t.element.addEventListener("mousemove",function(a){t.table.options.rowMouseMove(a,t.getComponent())}),t.table.options.rowTap&&(s=!1,t.element.addEventListener("touchstart",function(a){s=!0},{passive:!0}),t.element.addEventListener("touchend",function(a){s&&t.table.options.rowTap(a,t.getComponent()),s=!1})),t.table.options.rowDblTap&&(o=null,t.element.addEventListener("touchend",function(a){o?(clearTimeout(o),o=null,t.table.options.rowDblTap(a,t.getComponent())):o=setTimeout(function(){clearTimeout(o),o=null},300)})),t.table.options.rowTapHold&&(n=null,t.element.addEventListener("touchstart",function(a){clearTimeout(n),n=setTimeout(function(){clearTimeout(n),n=null,s=!1,t.table.options.rowTapHold(a,t.getComponent())},1e3)},{passive:!0}),t.element.addEventListener("touchend",function(a){clearTimeout(n),n=null}))};T.prototype.generateCells=function(){this.cells=this.table.columnManager.generateCells(this)};T.prototype.initialize=function(t){var o=this;if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutRow(this),this.generateCells(),this.table.options.virtualDomHoz&&this.table.vdomHoz.initialized?this.table.vdomHoz.initializeRow(this):this.cells.forEach(function(n){o.element.appendChild(n.getElement()),n.cellRendered()}),t&&this.normalizeHeight(),this.table.options.dataTree&&this.table.modExists("dataTree")&&this.table.modules.dataTree.layoutRow(this),this.table.options.responsiveLayout==="collapse"&&this.table.modExists("responsiveLayout")&&this.table.modules.responsiveLayout.layoutRow(this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.table.options.resizableRows&&this.table.modExists("resizeRows")&&this.table.modules.resizeRows.initializeRow(this),this.initialized=!0}else this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitializeRow(this)};T.prototype.reinitializeHeight=function(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)};T.prototype.reinitialize=function(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.getTreeChildren(this,!1,!0).forEach(function(o){o.reinitialize(!0)})};T.prototype.calcHeight=function(t){var o=0,n=this.table.options.resizableRows?this.element.clientHeight:0;this.cells.forEach(function(s){var a=s.getHeight();a>o&&(o=a)}),t?this.height=Math.max(o,n):this.height=this.manualHeight?this.height:Math.max(o,n),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight};T.prototype.setCellHeight=function(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0};T.prototype.clearCellHeight=function(){this.cells.forEach(function(t){t.clearHeight()})};T.prototype.normalizeHeight=function(t){t&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()};T.prototype.setHeight=function(t,o){(this.height!=t||o)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)};T.prototype.getHeight=function(){return this.outerHeight};T.prototype.getWidth=function(){return this.element.offsetWidth};T.prototype.deleteCell=function(t){var o=this.cells.indexOf(t);o>-1&&this.cells.splice(o,1)};T.prototype.setData=function(t){this.table.modExists("mutator")&&(t=this.table.modules.mutator.transformRow(t,"data")),this.data=t,this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchRow(this)};T.prototype.updateData=function(t){var o=this,n=this.element&&p.prototype.helpers.elVisible(this.element),s={},a;return new Promise(function(r,l){typeof t=="string"&&(t=JSON.parse(t)),o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.block(),o.table.modExists("mutator")?(s=Object.assign(s,o.data),s=Object.assign(s,t),a=o.table.modules.mutator.transformRow(s,"data",t)):a=t;for(var u in a)o.data[u]=a[u];o.table.options.reactiveData&&o.table.modExists("reactiveData",!0)&&o.table.modules.reactiveData.unblock();for(var u in t){var d=o.table.columnManager.getColumnsByFieldRoot(u);d.forEach(function(h){var m=o.getCell(h.getField());if(m){var f=h.getFieldValue(a);m.getValue()!=f&&(m.setValueProcessData(f),n&&m.cellRendered())}})}o.table.options.groupUpdateOnCellEdit&&o.table.options.groupBy&&o.table.modExists("groupRows")&&o.table.modules.groupRows.reassignRowToGroup(o.row),n?(o.normalizeHeight(!0),o.table.options.rowFormatter&&o.table.options.rowFormatter(o.getComponent())):(o.initialized=!1,o.height=0,o.heightStyled=""),o.table.options.dataTree!==!1&&o.table.modExists("dataTree")&&o.table.modules.dataTree.redrawNeeded(t)&&(o.table.modules.dataTree.initializeRow(o),n&&(o.table.modules.dataTree.layoutRow(o),o.table.rowManager.refreshActiveData("tree",!1,!0))),o.table.options.rowUpdated.call(o.table,o.getComponent()),o.table.options.dataChanged&&o.table.options.dataChanged.call(o.table,o.table.rowManager.getData()),r()})};T.prototype.getData=function(t){return t&&this.table.modExists("accessor")?this.table.modules.accessor.transformRow(this,t):this.data};T.prototype.getCell=function(t){var o=!1;return t=this.table.columnManager.findColumn(t),o=this.cells.find(function(n){return n.column===t}),o};T.prototype.getCellIndex=function(t){return this.cells.findIndex(function(o){return o===t})};T.prototype.findNextEditableCell=function(t){var o=!1;if(t0)for(var n=t-1;n>=0;n--){var s=this.cells[n],a=!0;if(s.column.modules.edit&&p.prototype.helpers.elVisible(s.getElement())&&(typeof s.column.modules.edit.check=="function"&&(a=s.column.modules.edit.check(s.getComponent())),a)){o=s;break}}return o};T.prototype.getCells=function(){return this.cells};T.prototype.nextRow=function(){var t=this.table.rowManager.nextDisplayRow(this,!0);return t||!1};T.prototype.prevRow=function(){var t=this.table.rowManager.prevDisplayRow(this,!0);return t||!1};T.prototype.moveToRow=function(t,o){var n=this.table.rowManager.findRow(t);n?(this.table.rowManager.moveRowActual(this,n,!o),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)};T.prototype.validate=function(){var t=[];return this.cells.forEach(function(o){o.validate()||t.push(o.getComponent())}),t.length?t:!0};T.prototype.delete=function(){var t=this;return new Promise(function(o,n){var s,a;t.table.options.history&&t.table.modExists("history")&&(t.table.options.groupBy&&t.table.modExists("groupRows")?(a=t.getGroup().rows,s=a.indexOf(t),s&&(s=a[s-1])):(s=t.table.rowManager.getRowIndex(t),s&&(s=t.table.rowManager.rows[s-1])),t.table.modules.history.action("rowDelete",t,{data:t.getData(),pos:!s,index:s})),t.deleteActual(),o()})};T.prototype.deleteActual=function(t){this.table.rowManager.getRowIndex(this),this.detatchModules(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0),this.modules.group&&this.modules.group.removeRow(this),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.modules.dataTree.rowDelete(this),this.table.modExists("columnCalcs")&&(this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.columnCalcs.recalcRowGroup(this):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows))};T.prototype.detatchModules=function(){this.table.modExists("selectRow")&&this.table.modules.selectRow._deselectRow(this,!0),this.table.modExists("edit")&&this.table.modules.edit.currentCell.row===this&&this.table.modules.edit.cancelEdit(),this.table.modExists("frozenRows")&&this.table.modules.frozenRows.detachRow(this)};T.prototype.deleteCells=function(){for(var t=this.cells.length,o=0;o"u"&&(o=!0),this._cell.setValue(t,o)};U.prototype.restoreOldValue=function(){this._cell.setValueActual(this._cell.getOldValue())};U.prototype.restoreInitialValue=function(){this._cell.setValueActual(this._cell.initialValue)};U.prototype.edit=function(t){return this._cell.edit(t)};U.prototype.cancelEdit=function(){this._cell.cancelEdit()};U.prototype.isEdited=function(){return!!this._cell.modules.edit&&this._cell.modules.edit.edited};U.prototype.clearEdited=function(){self.table.modExists("edit",!0)&&this._cell.table.modules.edit.clearEdited(this._cell)};U.prototype.isValid=function(){return this._cell.modules.validate?!this._cell.modules.validate.invalid:!0};U.prototype.validate=function(){return this._cell.validate()};U.prototype.clearValidation=function(){this._cell.table.modExists("validate",!0)&&this._cell.table.modules.validate.clearValidation(this._cell)};U.prototype.nav=function(){return this._cell.nav()};U.prototype.checkHeight=function(){this._cell.checkHeight()};U.prototype.getTable=function(){return this._cell.table};U.prototype._getSelf=function(){return this._cell};var A=function(o,n){this.table=o.table,this.column=o,this.row=n,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()};A.prototype.build=function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value};A.prototype.generateElement=function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.element=this.element};A.prototype._configureCell=function(){var t=this,o=t.column.cellEvents,n=t.element,s=this.column.getField(),a={top:"flex-start",bottom:"flex-end",middle:"center"},r={left:"flex-start",right:"flex-end",center:"center"};if(n.style.textAlign=t.column.hozAlign,t.column.vertAlign&&(n.style.display="inline-flex",n.style.alignItems=a[t.column.vertAlign]||"",t.column.hozAlign&&(n.style.justifyContent=r[t.column.hozAlign]||"")),s&&n.setAttribute("tabulator-field",s),t.column.definition.cssClass){var l=t.column.definition.cssClass.split(" ");l.forEach(function(u){n.classList.add(u)})}this.table.options.tooltipGenerationMode==="hover"&&n.addEventListener("mouseenter",function(u){t._generateTooltip()}),t._bindClickEvents(o),t._bindTouchEvents(o),t._bindMouseEvents(o),t.column.modules.edit&&t.table.modules.edit.bindEditor(t),t.column.definition.rowHandle&&t.table.options.movableRows!==!1&&t.table.modExists("moveRow")&&t.table.modules.moveRow.initializeCell(t),t.column.visible||t.hide()};A.prototype._bindClickEvents=function(t){var o=this,n=o.element;(t.cellClick||o.table.options.cellClick)&&n.addEventListener("click",function(s){var a=o.getComponent();t.cellClick&&t.cellClick.call(o.table,s,a),o.table.options.cellClick&&o.table.options.cellClick.call(o.table,s,a)}),t.cellDblClick||this.table.options.cellDblClick?n.addEventListener("dblclick",function(s){var a=o.getComponent();t.cellDblClick&&t.cellDblClick.call(o.table,s,a),o.table.options.cellDblClick&&o.table.options.cellDblClick.call(o.table,s,a)}):n.addEventListener("dblclick",function(s){if(!(o.table.modExists("edit")&&o.table.modules.edit.currentCell===o)){s.preventDefault();try{if(document.selection){var a=document.body.createTextRange();a.moveToElementText(o.element),a.select()}else if(window.getSelection){var a=document.createRange();a.selectNode(o.element),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}}catch{}}}),(t.cellContext||this.table.options.cellContext)&&n.addEventListener("contextmenu",function(s){var a=o.getComponent();t.cellContext&&t.cellContext.call(o.table,s,a),o.table.options.cellContext&&o.table.options.cellContext.call(o.table,s,a)})};A.prototype._bindMouseEvents=function(t){var o=this,n=o.element;(t.cellMouseEnter||o.table.options.cellMouseEnter)&&n.addEventListener("mouseenter",function(s){var a=o.getComponent();t.cellMouseEnter&&t.cellMouseEnter.call(o.table,s,a),o.table.options.cellMouseEnter&&o.table.options.cellMouseEnter.call(o.table,s,a)}),(t.cellMouseLeave||o.table.options.cellMouseLeave)&&n.addEventListener("mouseleave",function(s){var a=o.getComponent();t.cellMouseLeave&&t.cellMouseLeave.call(o.table,s,a),o.table.options.cellMouseLeave&&o.table.options.cellMouseLeave.call(o.table,s,a)}),(t.cellMouseOver||o.table.options.cellMouseOver)&&n.addEventListener("mouseover",function(s){var a=o.getComponent();t.cellMouseOver&&t.cellMouseOver.call(o.table,s,a),o.table.options.cellMouseOver&&o.table.options.cellMouseOver.call(o.table,s,a)}),(t.cellMouseOut||o.table.options.cellMouseOut)&&n.addEventListener("mouseout",function(s){var a=o.getComponent();t.cellMouseOut&&t.cellMouseOut.call(o.table,s,a),o.table.options.cellMouseOut&&o.table.options.cellMouseOut.call(o.table,s,a)}),(t.cellMouseMove||o.table.options.cellMouseMove)&&n.addEventListener("mousemove",function(s){var a=o.getComponent();t.cellMouseMove&&t.cellMouseMove.call(o.table,s,a),o.table.options.cellMouseMove&&o.table.options.cellMouseMove.call(o.table,s,a)})};A.prototype._bindTouchEvents=function(t){var o=this,n=o.element,s,a,r;(t.cellTap||this.table.options.cellTap)&&(r=!1,n.addEventListener("touchstart",function(l){r=!0},{passive:!0}),n.addEventListener("touchend",function(l){if(r){var u=o.getComponent();t.cellTap&&t.cellTap.call(o.table,l,u),o.table.options.cellTap&&o.table.options.cellTap.call(o.table,l,u)}r=!1})),(t.cellDblTap||this.table.options.cellDblTap)&&(s=null,n.addEventListener("touchend",function(l){if(s){clearTimeout(s),s=null;var u=o.getComponent();t.cellDblTap&&t.cellDblTap.call(o.table,l,u),o.table.options.cellDblTap&&o.table.options.cellDblTap.call(o.table,l,u)}else s=setTimeout(function(){clearTimeout(s),s=null},300)})),(t.cellTapHold||this.table.options.cellTapHold)&&(a=null,n.addEventListener("touchstart",function(l){clearTimeout(a),a=setTimeout(function(){clearTimeout(a),a=null,r=!1;var u=o.getComponent();t.cellTapHold&&t.cellTapHold.call(o.table,l,u),o.table.options.cellTapHold&&o.table.options.cellTapHold.call(o.table,l,u)},1e3)},{passive:!0}),n.addEventListener("touchend",function(l){clearTimeout(a),a=null}))};A.prototype._generateContents=function(){var t;switch(this.table.modExists("format")?t=this.table.modules.format.formatValue(this):t=this.element.innerHTML=this.value,typeof t>"u"?"undefined":E(t)){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",t!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":case"null":this.element.innerHTML="";break;default:this.element.innerHTML=t}};A.prototype.cellRendered=function(){this.table.modExists("format")&&this.table.modules.format.cellRendered&&this.table.modules.format.cellRendered(this)};A.prototype._generateTooltip=function(){var t=this.column.tooltip;t?(t===!0?t=this.value:typeof t=="function"&&(t=t(this.getComponent()),t===!1&&(t="")),typeof t>"u"&&(t=""),this.element.setAttribute("title",t)):this.element.setAttribute("title","")};A.prototype.getElement=function(t){return this.loaded||(this.loaded=!0,t||this.layoutElement()),this.element};A.prototype.getValue=function(){return this.value};A.prototype.getOldValue=function(){return this.oldValue};A.prototype.setValue=function(t,o){var n=this.setValueProcessData(t,o),s;n&&(this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("cellEdit",this,{oldValue:this.oldValue,newValue:this.value}),s=this.getComponent(),this.column.cellEvents.cellEdited&&this.column.cellEvents.cellEdited.call(this.table,s),this.table.options.groupUpdateOnCellEdit&&this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.reassignRowToGroup(this.row),this.cellRendered(),this.table.options.cellEdited.call(this.table,s),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.table.rowManager.getData()))};A.prototype.setValueProcessData=function(t,o){var n=!1;return this.value!=t&&(n=!0,o&&this.column.modules.mutate&&(t=this.table.modules.mutator.transformCell(this,t))),this.setValueActual(t),n&&this.table.modExists("columnCalcs")&&(this.column.definition.topCalc||this.column.definition.bottomCalc)&&(this.table.options.groupBy&&this.table.modExists("groupRows")?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),this.table.options.columnCalcs!="table"&&this.table.modules.columnCalcs.recalcRowGroup(this.row)):this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows)),n};A.prototype.setValueActual=function(t){this.oldValue=this.value,this.value=t,this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.block(),this.column.setFieldValue(this.row.data,t),this.table.options.reactiveData&&this.table.modExists("reactiveData")&&this.table.modules.reactiveData.unblock(),this.loaded&&this.layoutElement()};A.prototype.layoutElement=function(){this._generateContents(),this._generateTooltip(),this.table.options.resizableColumns&&this.table.modExists("resizeColumns")&&this.row.type==="row"&&this.table.modules.resizeColumns.initializeColumn("cell",this.column,this.element),(this.column.definition.contextMenu||this.column.definition.clickMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeCell(this),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layoutElement(this.element,this.column)};A.prototype.setWidth=function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled};A.prototype.clearWidth=function(){this.width="",this.element.style.width=""};A.prototype.getWidth=function(){return this.width||this.element.offsetWidth};A.prototype.setMinWidth=function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled};A.prototype.setMaxWidth=function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled};A.prototype.checkHeight=function(){this.row.reinitializeHeight()};A.prototype.clearHeight=function(){this.element.style.height="",this.height=null};A.prototype.setHeight=function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled};A.prototype.getHeight=function(){return this.height||this.element.offsetHeight};A.prototype.show=function(){this.element.style.display=this.column.vertAlign?"inline-flex":""};A.prototype.hide=function(){this.element.style.display="none"};A.prototype.edit=function(t){if(this.table.modExists("edit",!0))return this.table.modules.edit.editCell(this,t)};A.prototype.cancelEdit=function(){if(this.table.modExists("edit",!0)){var t=this.table.modules.edit.getCurrentCell();t&&t._getSelf()===this?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}};A.prototype.validate=function(){if(this.column.modules.validate&&this.table.modExists("validate",!0)){var t=this.table.modules.validate.validate(this.column.modules.validate,this,this.getValue());return t===!0}else return!0};A.prototype.delete=function(){!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.modules.validate&&this.modules.validate.invalid&&this.table.modules.validate.clearValidation(this),this.modules.edit&&this.modules.edit.edited&&this.table.modules.edit.clearEdited(this),this.table.options.history&&this.table.modules.history.clearComponentHistory(this),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}};A.prototype.nav=function(){var t=this,o=!1,n=this.row.getCellIndex(this);return{next:function(){var a=this.right(),r;return a?!0:(r=t.table.rowManager.nextDisplayRow(t.row,!0),r&&(a=r.findNextEditableCell(-1),a)?(a.edit(),!0):!1)},prev:function(){var a=this.left(),r;return a?!0:(r=t.table.rowManager.prevDisplayRow(t.row,!0),r&&(a=r.findPrevEditableCell(r.cells.length),a)?(a.edit(),!0):!1)},left:function(){return o=t.row.findPrevEditableCell(n),o?(o.edit(),!0):!1},right:function(){return o=t.row.findNextEditableCell(n),o?(o.edit(),!0):!1},up:function(){var a=t.table.rowManager.prevDisplayRow(t.row,!0);a&&a.cells[n].edit()},down:function(){var a=t.table.rowManager.nextDisplayRow(t.row,!0);a&&a.cells[n].edit()}}};A.prototype.getIndex=function(){this.row.getCellIndex(this)};A.prototype.getComponent=function(){return this.component||(this.component=new U(this)),this.component};var Ee=function(o){this.table=o,this.active=!1,this.element=this.createElement(),this.external=!1,this.links=[],this._initialize()};Ee.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-footer"),t};Ee.prototype._initialize=function(t){if(this.table.options.footerElement)switch(E(this.table.options.footerElement)){case"string":this.table.options.footerElement[0]==="<"?this.element.innerHTML=this.table.options.footerElement:(this.external=!0,this.element=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}};Ee.prototype.getElement=function(){return this.element};Ee.prototype.append=function(t,o){this.activate(o),this.element.appendChild(t),this.table.rowManager.adjustTableSize()};Ee.prototype.prepend=function(t,o){this.activate(o),this.element.insertBefore(t,this.element.firstChild),this.table.rowManager.adjustTableSize()};Ee.prototype.remove=function(t){t.parentNode.removeChild(t),this.deactivate()};Ee.prototype.deactivate=function(t){(!this.element.firstChild||t)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)};Ee.prototype.activate=function(t){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display="")),t&&this.links.push(t)};Ee.prototype.redraw=function(){this.links.forEach(function(t){t.footerRedraw()})};var p=function t(o,n){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.vdomHoz=null,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.modules={},this.initializeElement(o)&&(this.initializeOptions(n||{}),this._create()),t.prototype.comms.register(this)};p.prototype.defaultOptions={height:!1,minHeight:!1,maxHeight:!1,layout:"fitData",layoutColumnsOnNewData:!1,columnMinWidth:40,columnMaxWidth:!1,columnHeaderVertAlign:"top",columnVertAlign:!1,resizableColumns:!0,resizableRows:!1,autoResize:!0,columns:[],cellHozAlign:"",cellVertAlign:"",headerHozAlign:"",data:[],autoColumns:!1,autoColumnsDefinitions:!1,reactiveData:!1,nestedFieldSeparator:".",tooltips:!1,tooltipsHeader:!1,tooltipGenerationMode:"load",initialSort:!1,initialFilter:!1,initialHeaderFilter:!1,columnHeaderSortMulti:!0,sortOrderReverse:!1,headerSort:!0,headerSortTristate:!1,headerSortElement:"
",footerElement:!1,index:"id",textDirection:"auto",keybindings:[],tabEndNewRow:!1,invalidOptionWarnings:!0,clipboard:!1,clipboardCopyStyled:!0,clipboardCopyConfig:!1,clipboardCopyFormatter:!1,clipboardCopyRowRange:"active",clipboardPasteParser:"table",clipboardPasteAction:"insert",clipboardCopied:function(){},clipboardPasted:function(){},clipboardPasteError:function(){},downloadDataFormatter:!1,downloadReady:function(o,n){return n},downloadComplete:!1,downloadConfig:{},downloadRowRange:"active",dataTree:!1,dataTreeFilter:!0,dataTreeSort:!0,dataTreeElementColumn:!1,dataTreeBranchElement:!0,dataTreeChildIndent:9,dataTreeChildField:"_children",dataTreeCollapseElement:!1,dataTreeExpandElement:!1,dataTreeStartExpanded:!1,dataTreeRowExpanded:function(){},dataTreeRowCollapsed:function(){},dataTreeChildColumnCalcs:!1,dataTreeSelectPropagate:!1,printAsHtml:!1,printFormatter:!1,printHeader:!1,printFooter:!1,printCopyStyle:!0,printStyled:!0,printVisibleRows:!0,printRowRange:"visible",printConfig:{},addRowPos:"bottom",selectable:"highlight",selectableRangeMode:"drag",selectableRollingSelection:!0,selectablePersistence:!0,selectableCheck:function(o,n){return!0},headerFilterLiveFilterDelay:300,headerFilterPlaceholder:!1,headerVisible:!0,history:!1,locale:!1,langs:{},virtualDom:!0,virtualDomBuffer:0,virtualDomHoz:!1,persistentLayout:!1,persistentSort:!1,persistentFilter:!1,persistenceID:"",persistenceMode:!0,persistenceReaderFunc:!1,persistenceWriterFunc:!1,persistence:!1,responsiveLayout:!1,responsiveLayoutCollapseStartOpen:!0,responsiveLayoutCollapseUseFormatters:!0,responsiveLayoutCollapseFormatter:!1,pagination:!1,paginationSize:!1,paginationInitialPage:1,paginationButtonCount:5,paginationSizeSelector:!1,paginationElement:!1,paginationDataSent:{},paginationDataReceived:{},paginationAddRow:"page",ajaxURL:!1,ajaxURLGenerator:!1,ajaxParams:{},ajaxConfig:"get",ajaxContentType:"form",ajaxRequestFunc:!1,ajaxLoader:!0,ajaxLoaderLoading:!1,ajaxLoaderError:!1,ajaxFiltering:!1,ajaxSorting:!1,ajaxProgressiveLoad:!1,ajaxProgressiveLoadDelay:0,ajaxProgressiveLoadScrollMargin:0,groupBy:!1,groupStartOpen:!0,groupValues:!1,groupUpdateOnCellEdit:!1,groupHeader:!1,groupHeaderPrint:null,groupHeaderClipboard:null,groupHeaderHtmlOutput:null,groupHeaderDownload:null,htmlOutputConfig:!1,movableColumns:!1,movableRows:!1,movableRowsConnectedTables:!1,movableRowsConnectedElements:!1,movableRowsSender:!1,movableRowsReceiver:"insert",movableRowsSendingStart:function(){},movableRowsSent:function(){},movableRowsSentFailed:function(){},movableRowsSendingStop:function(){},movableRowsReceivingStart:function(){},movableRowsReceived:function(){},movableRowsReceivedFailed:function(){},movableRowsReceivingStop:function(){},movableRowsElementDrop:function(){},scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,placeholder:!1,tableBuilding:function(){},tableBuilt:function(){},renderStarted:function(){},renderComplete:function(){},rowClick:!1,rowDblClick:!1,rowContext:!1,rowTap:!1,rowDblTap:!1,rowTapHold:!1,rowMouseEnter:!1,rowMouseLeave:!1,rowMouseOver:!1,rowMouseOut:!1,rowMouseMove:!1,rowContextMenu:!1,rowClickMenu:!1,rowAdded:function(){},rowDeleted:function(){},rowMoved:function(){},rowUpdated:function(){},rowSelectionChanged:function(){},rowSelected:function(){},rowDeselected:function(){},rowResized:function(){},cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1,cellEditing:function(){},cellEdited:function(){},cellEditCancelled:function(){},columnMoved:!1,columnResized:function(){},columnTitleChanged:function(){},columnVisibilityChanged:function(){},htmlImporting:function(){},htmlImported:function(){},dataLoading:function(){},dataLoaded:function(){},dataEdited:!1,dataChanged:!1,ajaxRequesting:function(){},ajaxResponse:!1,ajaxError:function(){},dataFiltering:!1,dataFiltered:!1,dataSorting:function(){},dataSorted:function(){},groupToggleElement:"arrow",groupClosedShowCalcs:!1,dataGrouping:function(){},dataGrouped:!1,groupVisibilityChanged:function(){},groupClick:!1,groupDblClick:!1,groupContext:!1,groupContextMenu:!1,groupClickMenu:!1,groupTap:!1,groupDblTap:!1,groupTapHold:!1,columnCalcs:!0,pageLoaded:function(){},localized:function(){},validationMode:"blocking",validationFailed:function(){},historyUndo:function(){},historyRedo:function(){},scrollHorizontal:function(){},scrollVertical:function(){}};p.prototype.initializeOptions=function(t){if(t.invalidOptionWarnings!==!1)for(var o in t)typeof this.defaultOptions[o]>"u"&&console.warn("Invalid table constructor option:",o);for(var o in this.defaultOptions)o in t?this.options[o]=t[o]:Array.isArray(this.defaultOptions[o])?this.options[o]=Object.assign([],this.defaultOptions[o]):E(this.defaultOptions[o])==="object"&&this.defaultOptions[o]!==null?this.options[o]=Object.assign({},this.defaultOptions[o]):this.options[o]=this.defaultOptions[o]};p.prototype.initializeElement=function(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement?(this.element=t,!0):typeof t=="string"?(this.element=document.querySelector(t),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)};p.prototype.rtlCheck=function(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(t.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}};p.prototype._mapDepricatedFunctionality=function(){(this.options.persistentLayout||this.options.persistentSort||this.options.persistentFilter)&&(this.options.persistence||(this.options.persistence={})),this.options.dataEdited&&(console.warn("DEPRECATION WARNING - dataEdited option has been deprecated, please use the dataChanged option instead"),this.options.dataChanged=this.options.dataEdited),this.options.downloadDataFormatter&&console.warn("DEPRECATION WARNING - downloadDataFormatter option has been deprecated"),typeof this.options.clipboardCopyHeader<"u"&&(this.options.columnHeaders=this.options.clipboardCopyHeader,console.warn("DEPRECATION WARNING - clipboardCopyHeader option has been deprecated, please use the columnHeaders property on the clipboardCopyConfig option")),this.options.printVisibleRows!==!0&&(console.warn("printVisibleRows option is deprecated, you should now use the printRowRange option"),this.options.persistence.printRowRange="active"),this.options.printCopyStyle!==!0&&(console.warn("printCopyStyle option is deprecated, you should now use the printStyled option"),this.options.persistence.printStyled=this.options.printCopyStyle),this.options.persistentLayout&&(console.warn("persistentLayout option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.columns>"u"&&(this.options.persistence.columns=!0)),this.options.persistentSort&&(console.warn("persistentSort option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.sort>"u"&&(this.options.persistence.sort=!0)),this.options.persistentFilter&&(console.warn("persistentFilter option is deprecated, you should now use the persistence option"),this.options.persistence!==!0&&typeof this.options.persistence.filter>"u"&&(this.options.persistence.filter=!0)),this.options.columnVertAlign&&(console.warn("columnVertAlign option is deprecated, you should now use the columnHeaderVertAlign option"),this.options.columnHeaderVertAlign=this.options.columnVertAlign)};p.prototype._clearSelection=function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")};p.prototype._create=function(){this._clearObjectPointers(),this._mapDepricatedFunctionality(),this.bindModules(),this.rtlCheck(),this.element.tagName==="TABLE"&&this.modExists("htmlTableImport",!0)&&this.modules.htmlTableImport.parseTable(),this.columnManager=new H(this),this.rowManager=new C(this),this.footerManager=new Ee(this),this.columnManager.setRowManager(this.rowManager),this.rowManager.setColumnManager(this.columnManager),this.options.virtualDomHoz&&(this.vdomHoz=new ee(this)),this._buildElement(),this._loadInitialData()};p.prototype._clearObjectPointers=function(){this.options.columns=this.options.columns.slice(0),this.options.reactiveData||(this.options.data=this.options.data.slice(0))};p.prototype._buildElement=function(){var t=this,o=this.element,n=this.modules,s=this.options;for(s.tableBuilding.call(this),o.classList.add("tabulator"),o.setAttribute("role","grid");o.firstChild;)o.removeChild(o.firstChild);s.height&&(s.height=isNaN(s.height)?s.height:s.height+"px",o.style.height=s.height),s.minHeight!==!1&&(s.minHeight=isNaN(s.minHeight)?s.minHeight:s.minHeight+"px",o.style.minHeight=s.minHeight),s.maxHeight!==!1&&(s.maxHeight=isNaN(s.maxHeight)?s.maxHeight:s.maxHeight+"px",o.style.maxHeight=s.maxHeight),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modExists("layout",!0)&&n.layout.initialize(s.layout),n.localize.initialize(),s.headerFilterPlaceholder!==!1&&n.localize.setHeaderFilterPlaceholder(s.headerFilterPlaceholder);for(var a in s.langs)n.localize.installLang(a,s.langs[a]);if(n.localize.setLocale(s.locale),typeof s.placeholder=="string"){var r=document.createElement("div");r.classList.add("tabulator-placeholder");var l=document.createElement("span");l.innerHTML=s.placeholder,r.appendChild(l),s.placeholder=r}if(o.appendChild(this.columnManager.getElement()),o.appendChild(this.rowManager.getElement()),s.footerElement&&this.footerManager.activate(),s.persistence&&this.modExists("persistence",!0)&&n.persistence.initialize(),s.movableRows&&this.modExists("moveRow")&&n.moveRow.initialize(),s.autoColumns&&this.options.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modExists("columnCalcs")&&n.columnCalcs.initialize(),this.columnManager.setColumns(s.columns),s.dataTree&&this.modExists("dataTree",!0)&&n.dataTree.initialize(),this.modExists("frozenRows")&&this.modules.frozenRows.initialize(),(s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.sort||s.initialSort)&&this.modExists("sort",!0)){var u=[];s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.sort?(u=n.persistence.load("sort"),u===!1&&s.initialSort&&(u=s.initialSort)):s.initialSort&&(u=s.initialSort),n.sort.setSort(u)}if((s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.filter||s.initialFilter)&&this.modExists("filter",!0)){var d=[];s.persistence&&this.modExists("persistence",!0)&&n.persistence.config.filter?(d=n.persistence.load("filter"),d===!1&&s.initialFilter&&(d=s.initialFilter)):s.initialFilter&&(d=s.initialFilter),n.filter.setFilter(d)}s.initialHeaderFilter&&this.modExists("filter",!0)&&s.initialHeaderFilter.forEach(function(c){var h=t.columnManager.findColumn(c.field);if(h)n.filter.setHeaderFilterValue(h,c.value);else return console.warn("Column Filter Error - No matching column found:",c.field),!1}),this.modExists("ajax")&&n.ajax.initialize(),s.pagination&&this.modExists("page",!0)&&n.page.initialize(),s.groupBy&&this.modExists("groupRows",!0)&&n.groupRows.initialize(),this.modExists("keybindings")&&n.keybindings.initialize(),this.modExists("selectRow")&&n.selectRow.clearSelectionData(!0),s.autoResize&&this.modExists("resizeTable")&&n.resizeTable.initialize(),this.modExists("clipboard")&&n.clipboard.initialize(),s.printAsHtml&&this.modExists("print")&&n.print.initialize(),s.tableBuilt.call(this)};p.prototype._loadInitialData=function(){var t=this;if(t.options.pagination&&t.modExists("page"))if(t.modules.page.reset(!0,!0),t.options.pagination=="local"){if(t.options.data.length)t.rowManager.setData(t.options.data,!1,!0);else if((t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax")){t.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)});return}else t.rowManager.setData(t.options.data,!1,!0);t.options.paginationInitialPage&&t.modules.page.setPage(t.options.paginationInitialPage)}else t.options.ajaxURL?t.modules.page.setPage(t.options.paginationInitialPage).then(function(){}).catch(function(){}):t.rowManager.setData([],!1,!0);else t.options.data.length?t.rowManager.setData(t.options.data):(t.options.ajaxURL||t.options.ajaxURLGenerator)&&t.modExists("ajax")?t.modules.ajax.loadData(!1,!0).then(function(){}).catch(function(){}):t.rowManager.setData(t.options.data,!1,!0)};p.prototype.destroy=function(){var t=this.element;for(p.prototype.comms.deregister(this),this.options.reactiveData&&this.modExists("reactiveData",!0)&&this.modules.reactiveData.unwatchData(),this.rowManager.rows.forEach(function(o){o.wipe()}),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[],this.options.autoResize&&this.modExists("resizeTable")&&this.modules.resizeTable.clearBindings(),this.modExists("keybindings")&&this.modules.keybindings.clearBindings();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator")};p.prototype._detectBrowser=function(){var t=navigator.userAgent||navigator.vendor||window.opera;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):t.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))};p.prototype.blockRedraw=function(){return this.rowManager.blockRedraw()};p.prototype.restoreRedraw=function(){return this.rowManager.restoreRedraw()};p.prototype.setDataFromLocalFile=function(t){var o=this;return new Promise(function(n,s){var a=document.createElement("input");a.type="file",a.accept=t||".json,application/json",a.addEventListener("change",function(r){var l=a.files[0],u=new FileReader,d;u.readAsText(l),u.onload=function(c){try{d=JSON.parse(u.result)}catch(h){console.warn("File Load Error - File contents is invalid JSON",h),s(h);return}o.setData(d).then(function(h){n(h)}).catch(function(h){n(h)})},u.onerror=function(c){console.warn("File Load Error - Unable to read file"),s()}}),a.click()})};p.prototype.setData=function(t,o,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,o,n,!1,!0)};p.prototype._setData=function(t,o,n,s,a){var r=this;if(typeof t=="string"){if(t.indexOf("{")==0||t.indexOf("[")==0)return r.rowManager.setData(JSON.parse(t),s,a);if(r.modExists("ajax",!0))return o&&r.modules.ajax.setParams(o),n&&r.modules.ajax.setConfig(n),r.modules.ajax.setUrl(t),r.options.pagination=="remote"&&r.modExists("page",!0)?(r.modules.page.reset(!0,!0),r.modules.page.setPage(1)):r.modules.ajax.loadData(s,a)}else return t?r.rowManager.setData(t,s,a):r.modExists("ajax")&&(r.modules.ajax.getUrl||r.options.ajaxURLGenerator)?r.options.pagination=="remote"&&r.modExists("page",!0)?(r.modules.page.reset(!0,!0),r.modules.page.setPage(1)):r.modules.ajax.loadData(s,a):r.rowManager.setData([],s,a)};p.prototype.clearData=function(){this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this.rowManager.clearData()};p.prototype.getData=function(t){return t===!0&&(console.warn("passing a boolean to the getData function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getData(t)};p.prototype.getDataCount=function(t){return t===!0&&(console.warn("passing a boolean to the getDataCount function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getDataCount(t)};p.prototype.searchRows=function(t,o,n){if(this.modExists("filter",!0))return this.modules.filter.search("rows",t,o,n)};p.prototype.searchData=function(t,o,n){if(this.modExists("filter",!0))return this.modules.filter.search("data",t,o,n)};p.prototype.getHtml=function(t,o,n){if(this.modExists("export",!0))return this.modules.export.getHtml(t,o,n)};p.prototype.print=function(t,o,n){if(this.modExists("print",!0))return this.modules.print.printFullscreen(t,o,n)};p.prototype.getAjaxUrl=function(){if(this.modExists("ajax",!0))return this.modules.ajax.getUrl()};p.prototype.replaceData=function(t,o,n){return this.modExists("ajax")&&this.modules.ajax.blockActiveRequest(),this._setData(t,o,n,!0)};p.prototype.updateData=function(t){var o=this,n=this,s=0;return new Promise(function(a,r){o.modExists("ajax")&&o.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?t.forEach(function(l){var u=n.rowManager.findRow(l[n.options.index]);u&&(s++,u.updateData(l).then(function(){s--,s||a()}))}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})};p.prototype.addData=function(t,o,n){var s=this;return new Promise(function(a,r){s.modExists("ajax")&&s.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?s.rowManager.addRows(t,o,n).then(function(l){var u=[];l.forEach(function(d){u.push(d.getComponent())}),a(u)}):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))})};p.prototype.updateOrAddData=function(t){var o=this,n=this,s=[],a=0;return new Promise(function(r,l){o.modExists("ajax")&&o.modules.ajax.blockActiveRequest(),typeof t=="string"&&(t=JSON.parse(t)),t?t.forEach(function(u){var d=n.rowManager.findRow(u[n.options.index]);a++,d?d.updateData(u).then(function(){a--,s.push(d.getComponent()),a||r(s)}):n.rowManager.addRows(u).then(function(c){a--,s.push(c[0].getComponent()),a||r(s)})}):(console.warn("Update Error - No data provided"),l("Update Error - No data provided"))})};p.prototype.getRow=function(t){var o=this.rowManager.findRow(t);return o?o.getComponent():(console.warn("Find Error - No matching row found:",t),!1)};p.prototype.getRowFromPosition=function(t,o){var n=this.rowManager.getRowFromPosition(t,o);return n?n.getComponent():(console.warn("Find Error - No matching row found:",t),!1)};p.prototype.deleteRow=function(t){var o=this;return new Promise(function(n,s){var a=o,r=0,l=0,u=[];function d(){r++,r==t.length&&l&&(a.rowManager.reRenderInPosition(),n())}Array.isArray(t)||(t=[t]),t.forEach(function(c){var h=o.rowManager.findRow(c,!0);h?u.push(h):(console.warn("Delete Error - No matching row found:",c),s("Delete Error - No matching row found"),d())}),u.sort(function(c,h){return o.rowManager.rows.indexOf(c)>o.rowManager.rows.indexOf(h)?1:-1}),u.forEach(function(c){c.delete().then(function(){l++,d()}).catch(function(h){d(),s(h)})})})};p.prototype.addRow=function(t,o,n){var s=this;return new Promise(function(a,r){typeof t=="string"&&(t=JSON.parse(t)),s.rowManager.addRows(t,o,n).then(function(l){s.modExists("columnCalcs")&&s.modules.columnCalcs.recalc(s.rowManager.activeRows),a(l[0].getComponent())})})};p.prototype.updateOrAddRow=function(t,o){var n=this;return new Promise(function(s,a){var r=n.rowManager.findRow(t);typeof o=="string"&&(o=JSON.parse(o)),r?r.updateData(o).then(function(){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),s(r.getComponent())}).catch(function(l){a(l)}):r=n.rowManager.addRows(o).then(function(l){n.modExists("columnCalcs")&&n.modules.columnCalcs.recalc(n.rowManager.activeRows),s(l[0].getComponent())}).catch(function(l){a(l)})})};p.prototype.updateRow=function(t,o){var n=this;return new Promise(function(s,a){var r=n.rowManager.findRow(t);typeof o=="string"&&(o=JSON.parse(o)),r?r.updateData(o).then(function(){s(r.getComponent())}).catch(function(l){a(l)}):(console.warn("Update Error - No matching row found:",t),a("Update Error - No matching row found"))})};p.prototype.scrollToRow=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.rowManager.findRow(t);l?s.rowManager.scrollToRow(l,o,n).then(function(){a()}).catch(function(u){r(u)}):(console.warn("Scroll Error - No matching row found:",t),r("Scroll Error - No matching row found"))})};p.prototype.moveRow=function(t,o,n){var s=this.rowManager.findRow(t);s?s.moveToRow(o,n):console.warn("Move Error - No matching row found:",t)};p.prototype.getRows=function(t){return t===!0&&(console.warn("passing a boolean to the getRows function is deprecated, you should now pass the string 'active'"),t="active"),this.rowManager.getComponents(t)};p.prototype.getRowPosition=function(t,o){var n=this.rowManager.findRow(t);return n?this.rowManager.getRowPosition(n,o):(console.warn("Position Error - No matching row found:",t),!1)};p.prototype.copyToClipboard=function(t){this.modExists("clipboard",!0)&&this.modules.clipboard.copy(t)};p.prototype.setColumns=function(t){this.columnManager.setColumns(t)};p.prototype.getColumns=function(t){return this.columnManager.getComponents(t)};p.prototype.getColumn=function(t){var o=this.columnManager.findColumn(t);return o?o.getComponent():(console.warn("Find Error - No matching column found:",t),!1)};p.prototype.getColumnDefinitions=function(){return this.columnManager.getDefinitionTree()};p.prototype.getColumnLayout=function(){if(this.modExists("persistence",!0))return this.modules.persistence.parseColumns(this.columnManager.getColumns())};p.prototype.setColumnLayout=function(t){return this.modExists("persistence",!0)?(this.columnManager.setColumns(this.modules.persistence.mergeDefinition(this.options.columns,t)),!0):!1};p.prototype.showColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.show(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update();else return console.warn("Column Show Error - No matching column found:",t),!1};p.prototype.hideColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.hide(),this.options.responsiveLayout&&this.modExists("responsiveLayout",!0)&&this.modules.responsiveLayout.update();else return console.warn("Column Hide Error - No matching column found:",t),!1};p.prototype.toggleColumn=function(t){var o=this.columnManager.findColumn(t);if(o)o.visible?o.hide():o.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1};p.prototype.addColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.columnManager.findColumn(n);s.columnManager.addColumn(t,o,l).then(function(u){a(u.getComponent())}).catch(function(u){r(u)})})};p.prototype.deleteColumn=function(t){var o=this;return new Promise(function(n,s){var a=o.columnManager.findColumn(t);a?a.delete().then(function(){n()}).catch(function(r){s(r)}):(console.warn("Column Delete Error - No matching column found:",t),s())})};p.prototype.updateColumnDefinition=function(t,o){var n=this;return new Promise(function(s,a){var r=n.columnManager.findColumn(t);r?r.updateDefinition(o).then(function(l){s(l)}).catch(function(l){a(l)}):(console.warn("Column Update Error - No matching column found:",t),a())})};p.prototype.moveColumn=function(t,o,n){var s=this.columnManager.findColumn(t),a=this.columnManager.findColumn(o);s?a?this.columnManager.moveColumn(s,a,n):console.warn("Move Error - No matching column found:",a):console.warn("Move Error - No matching column found:",t)};p.prototype.scrollToColumn=function(t,o,n){var s=this;return new Promise(function(a,r){var l=s.columnManager.findColumn(t);l?s.columnManager.scrollToColumn(l,o,n).then(function(){a()}).catch(function(u){r(u)}):(console.warn("Scroll Error - No matching column found:",t),r("Scroll Error - No matching column found"))})};p.prototype.setLocale=function(t){this.modules.localize.setLocale(t)};p.prototype.getLocale=function(){return this.modules.localize.getLocale()};p.prototype.getLang=function(t){return this.modules.localize.getLang(t)};p.prototype.redraw=function(t){this.columnManager.redraw(t),this.rowManager.redraw(t)};p.prototype.setHeight=function(t){this.rowManager.renderMode!=="classic"?(this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.setRenderMode(),this.rowManager.redraw()):console.warn("setHeight function is not available in classic render mode")};p.prototype.setSort=function(t,o){this.modExists("sort",!0)&&(this.modules.sort.setSort(t,o),this.rowManager.sorterRefresh())};p.prototype.getSorters=function(){if(this.modExists("sort",!0))return this.modules.sort.getSort()};p.prototype.clearSort=function(){this.modExists("sort",!0)&&(this.modules.sort.clear(),this.rowManager.sorterRefresh())};p.prototype.setFilter=function(t,o,n,s){this.modExists("filter",!0)&&(this.modules.filter.setFilter(t,o,n,s),this.rowManager.filterRefresh())};p.prototype.refreshFilter=function(){this.modExists("filter",!0)&&this.rowManager.filterRefresh()};p.prototype.addFilter=function(t,o,n,s){this.modExists("filter",!0)&&(this.modules.filter.addFilter(t,o,n,s),this.rowManager.filterRefresh())};p.prototype.getFilters=function(t){if(this.modExists("filter",!0))return this.modules.filter.getFilters(t)};p.prototype.setHeaderFilterFocus=function(t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(o)this.modules.filter.setHeaderFilterFocus(o);else return console.warn("Column Filter Focus Error - No matching column found:",t),!1}};p.prototype.getHeaderFilterValue=function(t){if(this.modExists("filter",!0)){var o=this.columnManager.findColumn(t);if(o)return this.modules.filter.getHeaderFilterValue(o);console.warn("Column Filter Error - No matching column found:",t)}};p.prototype.setHeaderFilterValue=function(t,o){if(this.modExists("filter",!0)){var n=this.columnManager.findColumn(t);if(n)this.modules.filter.setHeaderFilterValue(n,o);else return console.warn("Column Filter Error - No matching column found:",t),!1}};p.prototype.getHeaderFilters=function(){if(this.modExists("filter",!0))return this.modules.filter.getHeaderFilters()};p.prototype.removeFilter=function(t,o,n){this.modExists("filter",!0)&&(this.modules.filter.removeFilter(t,o,n),this.rowManager.filterRefresh())};p.prototype.clearFilter=function(t){this.modExists("filter",!0)&&(this.modules.filter.clearFilter(t),this.rowManager.filterRefresh())};p.prototype.clearHeaderFilter=function(){this.modExists("filter",!0)&&(this.modules.filter.clearHeaderFilter(),this.rowManager.filterRefresh())};p.prototype.selectRow=function(t){this.modExists("selectRow",!0)&&(t===!0&&(console.warn("passing a boolean to the selectRowselectRow function is deprecated, you should now pass the string 'active'"),t="active"),this.modules.selectRow.selectRows(t))};p.prototype.deselectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.deselectRows(t)};p.prototype.toggleSelectRow=function(t){this.modExists("selectRow",!0)&&this.modules.selectRow.toggleRow(t)};p.prototype.getSelectedRows=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedRows()};p.prototype.getSelectedData=function(){if(this.modExists("selectRow",!0))return this.modules.selectRow.getSelectedData()};p.prototype.getInvalidCells=function(){if(this.modExists("validate",!0))return this.modules.validate.getInvalidCells()};p.prototype.clearCellValidation=function(t){var o=this;this.modExists("validate",!0)&&(t||(t=this.modules.validate.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(function(n){o.modules.validate.clearValidation(n._getSelf())}))};p.prototype.validate=function(t){var o=[];return this.rowManager.rows.forEach(function(n){var s=n.validate();s!==!0&&(o=o.concat(s))}),o.length?o:!0};p.prototype.setMaxPage=function(t){if(this.options.pagination&&this.modExists("page"))this.modules.page.setMaxPage(t);else return!1};p.prototype.setPage=function(t){return this.options.pagination&&this.modExists("page")?this.modules.page.setPage(t):new Promise(function(o,n){n()})};p.prototype.setPageToRow=function(t){var o=this;return new Promise(function(n,s){o.options.pagination&&o.modExists("page")?(t=o.rowManager.findRow(t),t?o.modules.page.setPageToRow(t).then(function(){n()}).catch(function(){s()}):s()):s()})};p.prototype.setPageSize=function(t){if(this.options.pagination&&this.modExists("page"))this.modules.page.setPageSize(t),this.modules.page.setPage(1).then(function(){}).catch(function(){});else return!1};p.prototype.getPageSize=function(){if(this.options.pagination&&this.modExists("page",!0))return this.modules.page.getPageSize()};p.prototype.previousPage=function(){if(this.options.pagination&&this.modExists("page"))this.modules.page.previousPage();else return!1};p.prototype.nextPage=function(){if(this.options.pagination&&this.modExists("page"))this.modules.page.nextPage();else return!1};p.prototype.getPage=function(){return this.options.pagination&&this.modExists("page")?this.modules.page.getPage():!1};p.prototype.getPageMax=function(){return this.options.pagination&&this.modExists("page")?this.modules.page.getPageMax():!1};p.prototype.setGroupBy=function(t){if(this.modExists("groupRows",!0))this.options.groupBy=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group");else return!1};p.prototype.setGroupValues=function(t){if(this.modExists("groupRows",!0))this.options.groupValues=t,this.modules.groupRows.initialize(),this.rowManager.refreshActiveData("display"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group");else return!1};p.prototype.setGroupStartOpen=function(t){if(this.modExists("groupRows",!0))this.options.groupStartOpen=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set");else return!1};p.prototype.setGroupHeader=function(t){if(this.modExists("groupRows",!0))this.options.groupHeader=t,this.modules.groupRows.initialize(),this.options.groupBy?(this.rowManager.refreshActiveData("group"),this.options.persistence&&this.modExists("persistence",!0)&&this.modules.persistence.config.group&&this.modules.persistence.save("group")):console.warn("Grouping Update - cant refresh view, no groups have been set");else return!1};p.prototype.getGroups=function(t){return this.modExists("groupRows",!0)?this.modules.groupRows.getGroups(!0):!1};p.prototype.getGroupedData=function(){if(this.modExists("groupRows",!0))return this.options.groupBy?this.modules.groupRows.getGroupedData():this.getData()};p.prototype.getEditedCells=function(){if(this.modExists("edit",!0))return this.modules.edit.getEditedCells()};p.prototype.clearCellEdited=function(t){var o=this;this.modExists("edit",!0)&&(t||(t=this.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(function(n){o.modules.edit.clearEdited(n._getSelf())}))};p.prototype.getCalcResults=function(){return this.modExists("columnCalcs",!0)?this.modules.columnCalcs.getResults():!1};p.prototype.recalc=function(){this.modExists("columnCalcs",!0)&&this.modules.columnCalcs.recalcAll(this.rowManager.activeRows)};p.prototype.navigatePrev=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?t.nav().prev():!1};p.prototype.navigateNext=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?t.nav().next():!1};p.prototype.navigateLeft=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().left()):!1};p.prototype.navigateRight=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().right()):!1};p.prototype.navigateUp=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().up()):!1};p.prototype.navigateDown=function(){var t=!1;return this.modExists("edit",!0)&&(t=this.modules.edit.currentCell,t)?(e.preventDefault(),t.nav().down()):!1};p.prototype.undo=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.undo():!1};p.prototype.redo=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.redo():!1};p.prototype.getHistoryUndoSize=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.getHistoryUndoSize():!1};p.prototype.getHistoryRedoSize=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.getHistoryRedoSize():!1};p.prototype.clearHistory=function(){return this.options.history&&this.modExists("history",!0)?this.modules.history.clear():!1};p.prototype.download=function(t,o,n,s){this.modExists("download",!0)&&this.modules.download.download(t,o,n,s)};p.prototype.downloadToTab=function(t,o,n,s){this.modExists("download",!0)&&this.modules.download.download(t,o,n,s,!0)};p.prototype.tableComms=function(t,o,n,s){this.modules.comms.receive(t,o,n,s)};p.prototype.moduleBindings={};p.prototype.extendModule=function(t,o,n){if(p.prototype.moduleBindings[t]){var s=p.prototype.moduleBindings[t].prototype[o];if(s)if((typeof n>"u"?"undefined":E(n))=="object")for(var a in n)s[a]=n[a];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",o)}else console.warn("Module Error - module does not exist:",t)};p.prototype.registerModule=function(t,o){p.prototype.moduleBindings[t]=o};p.prototype.bindModules=function(){this.modules={};for(var t in p.prototype.moduleBindings)this.modules[t]=new p.prototype.moduleBindings[t](this)};p.prototype.modExists=function(t,o){return this.modules[t]?!0:(o&&console.error("Tabulator Module Not Installed: "+t),!1)};p.prototype.helpers={elVisible:function(o){return!(o.offsetWidth<=0&&o.offsetHeight<=0)},elOffset:function(o){var n=o.getBoundingClientRect();return{top:n.top+window.pageYOffset-document.documentElement.clientTop,left:n.left+window.pageXOffset-document.documentElement.clientLeft}},deepClone:function(o){var n=Object.assign(Array.isArray(o)?[]:{},o);for(var s in o)o[s]!=null&&E(o[s])==="object"&&(o[s]instanceof Date?n[s]=new Date(o[s]):n[s]=this.deepClone(o[s]));return n}};p.prototype.comms={tables:[],register:function(o){p.prototype.comms.tables.push(o)},deregister:function(o){var n=p.prototype.comms.tables.indexOf(o);n>-1&&p.prototype.comms.tables.splice(n,1)},lookupTable:function(o,n){var s=[],a,r;if(typeof o=="string"){if(a=document.querySelectorAll(o),a.length)for(var l=0;l0?l.setWidth(r):l.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(o){var n=this,s=n.table.element.clientWidth,a=0,r=0,l=0,u=0,d=[],c=[],h=0,m=0,w=0;function f(b){var y;return typeof b=="string"?b.indexOf("%")>-1?y=s/100*parseInt(b):y=parseInt(b):y=b,y}function g(b,y,x,M){var _=[],Y=0,Z=0,Q=0,ye=l,me=0,de=0,ge=[];function be(k){return x*(k.column.definition.widthGrow||1)}function De(k){return f(k.width)-x*(k.column.definition.widthShrink||0)}return b.forEach(function(k,Fe){var we=M?De(k):be(k);k.column.minWidth>=we?_.push(k):k.column.maxWidth&&k.column.maxWidththis.table.rowManager.element.clientHeight&&(s-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),o.forEach(function(b){var y,x,M;b.visible&&(y=b.definition.width,x=parseInt(b.minWidth),y?(M=f(y),a+=M>x?M:x,b.definition.widthShrink&&(c.push({column:b,width:M>x?M:x}),h+=b.definition.widthShrink)):(d.push({column:b,width:0}),l+=b.definition.widthGrow||1))}),r=s-a,u=Math.floor(r/l);var w=g(d,r,u,!1);d.length&&w>0&&(d[d.length-1].width+=+w),d.forEach(function(b){r-=b.width}),m=Math.abs(w)+r,m>0&&h&&(w=g(c,m,Math.floor(m/h),!0)),c.length&&(c[c.length-1].width-=w),d.forEach(function(b){b.column.setWidth(b.width)}),c.forEach(function(b){b.column.setWidth(b.width)})}};p.prototype.registerModule("layout",Ne);var ae=function(o){this.table=o,this.locale="default",this.lang=!1,this.bindings={},this.langList={}};ae.prototype.initialize=function(){this.langList=p.prototype.helpers.deepClone(this.langs)};ae.prototype.setHeaderFilterPlaceholder=function(t){this.langList.default.headerFilters.default=t};ae.prototype.setHeaderFilterColumnPlaceholder=function(t,o){this.langList.default.headerFilters.columns[t]=o,this.lang&&!this.lang.headerFilters.columns[t]&&(this.lang.headerFilters.columns[t]=o)};ae.prototype.installLang=function(t,o){this.langList[t]?this._setLangProp(this.langList[t],o):this.langList[t]=o};ae.prototype._setLangProp=function(t,o){for(var n in o)t[n]&&E(t[n])=="object"?this._setLangProp(t[n],o[n]):t[n]=o[n]};ae.prototype.setLocale=function(t){var o=this;t=t||"default";function n(a,r){for(var l in a)E(a[l])=="object"?(r[l]||(r[l]={}),n(a[l],r[l])):r[l]=a[l]}if(t===!0&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!o.langList[t]){var s=t.split("-")[0];o.langList[s]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,s),t=s):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}o.locale=t,o.lang=p.prototype.helpers.deepClone(o.langList.default||{}),t!="default"&&n(o.langList[t],o.lang),o.table.options.localized.call(o.table,o.locale,o.lang),o._executeBindings()};ae.prototype.getLocale=function(t){return self.locale};ae.prototype.getLang=function(t){return t?this.langList[t]:this.lang};ae.prototype.getText=function(n,o){var n=o?n+"|"+o:n,s=n.split("|"),a=this._getLangElement(s,this.locale);return a||""};ae.prototype._getLangElement=function(t,o){var n=this,s=n.lang;return t.forEach(function(a){var r;s&&(r=s[a],typeof r<"u"?s=r:s=!1)}),s};ae.prototype.bind=function(t,o){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(o),o(this.getText(t),this.lang)};ae.prototype._executeBindings=function(){var t=this,o=function(a){t.bindings[a].forEach(function(r){r(t.getText(a),t.lang)})};for(var n in t.bindings)o(n)};ae.prototype.langs={default:{groups:{item:"item",items:"items"},columns:{},ajax:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All"},headerFilters:{default:"filter column...",columns:{}}}};p.prototype.registerModule("localize",ae);var Ve=function(o){this.table=o};Ve.prototype.getConnections=function(t){var o=this,n=[],s;return s=p.prototype.comms.lookupTable(t),s.forEach(function(a){o.table!==a&&n.push(a)}),n};Ve.prototype.send=function(t,o,n,s){var a=this,r=this.getConnections(t);r.forEach(function(l){l.tableComms(a.table.element,o,n,s)}),!r.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)};Ve.prototype.receive=function(t,o,n,s){if(this.table.modExists(o))return this.table.modules[o].commsReceived(t,n,s);console.warn("Inter-table Comms Error - no such module:",o)};p.prototype.registerModule("comms",Ve);var Pe=function(o){this.table=o,this.allowedTypes=["","data","download","clipboard","print","htmlOutput"]};Pe.prototype.initializeColumn=function(t){var o=this,n=!1,s={};this.allowedTypes.forEach(function(a){var r="accessor"+(a.charAt(0).toUpperCase()+a.slice(1)),l;t.definition[r]&&(l=o.lookupAccessor(t.definition[r]),l&&(n=!0,s[r]={accessor:l,params:t.definition[r+"Params"]||{}}))}),n&&(t.modules.accessor=s)};Pe.prototype.lookupAccessor=function(t){var o=!1;switch(typeof t>"u"?"undefined":E(t)){case"string":this.accessors[t]?o=this.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":o=t;break}return o};Pe.prototype.transformRow=function(t,o){var n="accessor"+(o.charAt(0).toUpperCase()+o.slice(1)),s=t.getComponent(),a=p.prototype.helpers.deepClone(t.data||{});return this.table.columnManager.traverse(function(r){var l,u,d,c;r.modules.accessor&&(u=r.modules.accessor[n]||r.modules.accessor.accessor||!1,u&&(l=r.getFieldValue(a),l!="undefined"&&(c=r.getComponent(),d=typeof u.params=="function"?u.params(l,a,o,c,s):u.params,r.setFieldValue(a,u.accessor(l,a,o,d,c,s)))))}),a},Pe.prototype.accessors={};p.prototype.registerModule("accessor",Pe);var W=function(o){this.table=o,this.config=!1,this.url="",this.urlGenerator=!1,this.params=!1,this.loaderElement=this.createLoaderElement(),this.msgElement=this.createMsgElement(),this.loadingElement=!1,this.errorElement=!1,this.loaderPromise=!1,this.progressiveLoad=!1,this.loading=!1,this.requestOrder=0};W.prototype.initialize=function(){var t;this.loaderElement.appendChild(this.msgElement),this.table.options.ajaxLoaderLoading&&(typeof this.table.options.ajaxLoaderLoading=="string"?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderLoading.trim(),this.loadingElement=t.content.firstChild):this.loadingElement=this.table.options.ajaxLoaderLoading),this.loaderPromise=this.table.options.ajaxRequestFunc||this.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||this.defaultURLGenerator,this.table.options.ajaxLoaderError&&(typeof this.table.options.ajaxLoaderError=="string"?(t=document.createElement("template"),t.innerHTML=this.table.options.ajaxLoaderError.trim(),this.errorElement=t.content.firstChild):this.errorElement=this.table.options.ajaxLoaderError),this.table.options.ajaxParams&&this.setParams(this.table.options.ajaxParams),this.table.options.ajaxConfig&&this.setConfig(this.table.options.ajaxConfig),this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.table.options.ajaxProgressiveLoad&&(this.table.options.pagination?(this.progressiveLoad=!1,console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")):this.table.modExists("page")?(this.progressiveLoad=this.table.options.ajaxProgressiveLoad,this.table.modules.page.initializeProgressive(this.progressiveLoad)):console.error("Pagination plugin is required for progressive ajax loading"))};W.prototype.createLoaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader"),t};W.prototype.createMsgElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-loader-msg"),t.setAttribute("role","alert"),t};W.prototype.setParams=function(t,o){if(o){this.params=this.params||{};for(var n in t)this.params[n]=t[n]}else this.params=t};W.prototype.getParams=function(){return this.params||{}};W.prototype.setConfig=function(t){if(this._loadDefaultConfig(),typeof t=="string")this.config.method=t;else for(var o in t)this.config[o]=t[o]};W.prototype._loadDefaultConfig=function(t){var o=this;if(!o.config||t){o.config={};for(var n in o.defaultConfig)o.config[n]=o.defaultConfig[n]}};W.prototype.setUrl=function(t){this.url=t};W.prototype.getUrl=function(){return this.url};W.prototype.loadData=function(t,o){return this.progressiveLoad?this._loadDataProgressive():this._loadDataStandard(t,o)};W.prototype.nextPage=function(t){var o;this.loading||(o=this.table.options.ajaxProgressiveLoadScrollMargin||this.table.rowManager.getElement().clientHeight*2,t"u"?"undefined":E(t))==="object")for(var a in t)s=s.concat(n.generateParamsList(t[a],o?o+"["+a+"]":a));else s.push({key:o,value:t});return s};W.prototype.serializeParams=function(t){var o=this.generateParamsList(t),n=[];return o.forEach(function(s){n.push(encodeURIComponent(s.key)+"="+encodeURIComponent(s.value))}),n.join("&")};W.prototype.sendRequest=function(t){var o=this,n=this,s=n.url,a;return n.requestOrder++,a=n.requestOrder,n._loadDefaultConfig(),new Promise(function(r,l){n.table.options.ajaxRequesting.call(o.table,n.url,n.params)!==!1?(n.loading=!0,t||n.showLoader(),o.loaderPromise(s,n.config,n.params).then(function(u){a===n.requestOrder?(n.table.options.ajaxResponse&&(u=n.table.options.ajaxResponse.call(n.table,n.url,n.params,u)),r(u),n.hideLoader(),n.loading=!1):console.warn("Ajax Response Blocked - An active ajax request was blocked by an attempt to change table data while the request was being made")}).catch(function(u){console.error("Ajax Load Error: ",u),n.table.options.ajaxError.call(n.table,u),n.showError(),setTimeout(function(){n.hideLoader()},3e3),n.loading=!1,l(u)})):l()})};W.prototype.showLoader=function(){var t=typeof this.table.options.ajaxLoader=="function"?this.table.options.ajaxLoader():this.table.options.ajaxLoader;if(t){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-error"),this.msgElement.classList.add("tabulator-loading"),this.loadingElement?this.msgElement.appendChild(this.loadingElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|loading"),this.table.element.appendChild(this.loaderElement)}};W.prototype.showError=function(){for(this.hideLoader();this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.remove("tabulator-loading"),this.msgElement.classList.add("tabulator-error"),this.errorElement?this.msgElement.appendChild(this.errorElement):this.msgElement.innerHTML=this.table.modules.localize.getText("ajax|error"),this.table.element.appendChild(this.loaderElement)};W.prototype.hideLoader=function(){this.loaderElement.parentNode&&this.loaderElement.parentNode.removeChild(this.loaderElement)};W.prototype.defaultConfig={method:"GET"};W.prototype.defaultURLGenerator=function(t,o,n){return t&&n&&Object.keys(n).length&&(!o.method||o.method.toLowerCase()=="get")&&(o.method="get",t+=(t.includes("?")?"&":"?")+this.modules.ajax.serializeParams(n)),t};W.prototype.defaultLoaderPromise=function(t,o,n){var s=this,a;return new Promise(function(r,l){if(t=s.urlGenerator.call(s.table,t,o,n),o.method.toUpperCase()!="GET")if(a=E(s.table.options.ajaxContentType)==="object"?s.table.options.ajaxContentType:s.contentTypeFormatters[s.table.options.ajaxContentType],a){for(var u in a.headers)o.headers||(o.headers={}),typeof o.headers[u]>"u"&&(o.headers[u]=a.headers[u]);o.body=a.body.call(s,t,o,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",s.table.options.ajaxContentType);t?(typeof o.headers>"u"&&(o.headers={}),typeof o.headers.Accept>"u"&&(o.headers.Accept="application/json"),typeof o.headers["X-Requested-With"]>"u"&&(o.headers["X-Requested-With"]="XMLHttpRequest"),typeof o.mode>"u"&&(o.mode="cors"),o.mode=="cors"?(typeof o.headers["Access-Control-Allow-Origin"]>"u"&&(o.headers["Access-Control-Allow-Origin"]=window.location.origin),typeof o.credentials>"u"&&(o.credentials="same-origin")):typeof o.credentials>"u"&&(o.credentials="include"),fetch(t,o).then(function(d){d.ok?d.json().then(function(c){r(c)}).catch(function(c){l(c),console.warn("Ajax Load Error - Invalid JSON returned",c)}):(console.error("Ajax Load Error - Connection Error: "+d.status,d.statusText),l(d))}).catch(function(d){console.error("Ajax Load Error - Connection Error: ",d),l(d)})):(console.warn("Ajax Load Error - No URL Set"),r([]))})};W.prototype.contentTypeFormatters={json:{headers:{"Content-Type":"application/json"},body:function(o,n,s){return JSON.stringify(s)}},form:{headers:{},body:function(o,n,s){var a=this.generateParamsList(s),r=new FormData;return a.forEach(function(l){r.append(l.key,l.value)}),r}}};p.prototype.registerModule("ajax",W);var He=function(o){this._row=o};He.prototype.getData=function(t){return this._row.getData(t)};He.prototype.getElement=function(){return this._row.getElement()};He.prototype.getTable=function(){return this._row.table};He.prototype.getCells=function(){var t=[];return this._row.getCells().forEach(function(o){t.push(o.getComponent())}),t};He.prototype.getCell=function(t){var o=this._row.getCell(t);return o?o.getComponent():!1};He.prototype._getSelf=function(){return this._row};var X=function(o){this.table=o,this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.initialize()};X.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t};X.prototype.initialize=function(){this.genColumn=new R({field:"value"},this)};X.prototype.registerColumnField=function(){};X.prototype.initializeColumn=function(t){var o=t.definition,n={topCalcParams:o.topCalcParams||{},botCalcParams:o.bottomCalcParams||{}};if(o.topCalc){switch(E(o.topCalc)){case"string":this.calculations[o.topCalc]?n.topCalc=this.calculations[o.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.topCalc);break;case"function":n.topCalc=o.topCalc;break}n.topCalc&&(t.modules.columnCalcs=n,this.topCalcs.push(t),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(o.bottomCalc){switch(E(o.bottomCalc)){case"string":this.calculations[o.bottomCalc]?n.botCalc=this.calculations[o.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",o.bottomCalc);break;case"function":n.botCalc=o.bottomCalc;break}n.botCalc&&(t.modules.columnCalcs=n,this.botCalcs.push(t),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}};X.prototype.removeCalcs=function(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.table.footerManager.remove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()};X.prototype.initializeTopRow=function(){this.topInitialized||(this.table.columnManager.getElement().insertBefore(this.topElement,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)};X.prototype.initializeBottomRow=function(){this.botInitialized||(this.table.footerManager.prepend(this.botElement),this.botInitialized=!0)};X.prototype.scrollHorizontal=function(t){this.botInitialized&&this.botRow&&(this.botRow.getElement().style.marginLeft=-t+"px")};X.prototype.recalc=function(t){var o;if(this.topInitialized||this.botInitialized){if(this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),o=this.generateRow("top",this.rowsToData(t)),this.topRow=o;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(o.getElement()),o.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),o=this.generateRow("bottom",this.rowsToData(t)),this.botRow=o;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(o.getElement()),o.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}};X.prototype.recalcRowGroup=function(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))};X.prototype.recalcAll=function(){var t=this;if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalc(this.table.rowManager.activeRows),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var o=table.modules.groupRows.getChildGroups();o.forEach(function(n){t.recalcGroup(n)})}};X.prototype.recalcGroup=function(t){var o,n;t&&t.calcs&&(t.calcs.bottom&&(o=this.rowsToData(t.rows),n=this.generateRowData("bottom",o),t.calcs.bottom.updateData(n),t.calcs.bottom.reinitialize()),t.calcs.top&&(o=this.rowsToData(t.rows),n=this.generateRowData("top",o),t.calcs.top.updateData(n),t.calcs.top.reinitialize()))};X.prototype.generateTopRow=function(t){return this.generateRow("top",this.rowsToData(t))};X.prototype.generateBottomRow=function(t){return this.generateRow("bottom",this.rowsToData(t))};X.prototype.rowsToData=function(t){var o=this,n=[];return t.forEach(function(s){if(n.push(s.getData()),o.table.options.dataTree&&o.table.options.dataTreeChildColumnCalcs&&s.modules.dataTree.open){var a=o.rowsToData(o.table.modules.dataTree.getFilteredTreeChildren(s));n=n.concat(a)}}),n};X.prototype.generateRow=function(t,o){var n=this,s=this.generateRowData(t,o),a;return n.table.modExists("mutator")&&n.table.modules.mutator.disable(),a=new T(s,this,"calc"),n.table.modExists("mutator")&&n.table.modules.mutator.enable(),a.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),a.component=!1,a.getComponent=function(){return this.component||(this.component=new He(this)),this.component},a.generateCells=function(){var r=[];n.table.columnManager.columnsByIndex.forEach(function(l){n.genColumn.setField(l.getField()),n.genColumn.hozAlign=l.hozAlign,l.definition[t+"CalcFormatter"]&&n.table.modExists("format")?n.genColumn.modules.format={formatter:n.table.modules.format.getFormatter(l.definition[t+"CalcFormatter"]),params:l.definition[t+"CalcFormatterParams"]||{}}:n.genColumn.modules.format={formatter:n.table.modules.format.getFormatter("plaintext"),params:{}},n.genColumn.definition.cssClass=l.definition.cssClass;var u=new A(n.genColumn,a);u.getElement(),u.column=l,u.setWidth(),l.cells.push(u),r.push(u),l.visible||u.hide()}),this.cells=r},a};X.prototype.generateRowData=function(t,o){var n={},s=t=="top"?this.topCalcs:this.botCalcs,a=t=="top"?"topCalc":"botCalc",r,l;return s.forEach(function(u){var d=[];u.modules.columnCalcs&&u.modules.columnCalcs[a]&&(o.forEach(function(c){d.push(u.getFieldValue(c))}),l=a+"Params",r=typeof u.modules.columnCalcs[l]=="function"?u.modules.columnCalcs[l](d,o):u.modules.columnCalcs[l],u.setFieldValue(n,u.modules.columnCalcs[a](d,o,r)))}),n};X.prototype.hasTopCalcs=function(){return!!this.topCalcs.length};X.prototype.hasBottomCalcs=function(){return!!this.botCalcs.length};X.prototype.redraw=function(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)};X.prototype.getResults=function(){var t=this,o={},n;return this.table.options.groupBy&&this.table.modExists("groupRows")?(n=this.table.modules.groupRows.getGroups(!0),n.forEach(function(s){o[s.getKey()]=t.getGroupResults(s)})):o={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},o};X.prototype.getGroupResults=function(t){var o=this,n=t._getSelf(),s=t.getSubGroups(),a={},r={};return s.forEach(function(l){a[l.getKey()]=o.getGroupResults(l)}),r={top:n.calcs.top?n.calcs.top.getData():{},bottom:n.calcs.bottom?n.calcs.bottom.getData():{},groups:a},r};X.prototype.calculations={avg:function(o,n,s){var a=0,r=typeof s.precision<"u"?s.precision:2;return o.length&&(a=o.reduce(function(l,u){return Number(l)+Number(u)}),a=a/o.length,a=r!==!1?a.toFixed(r):a),parseFloat(a).toString()},max:function(o,n,s){var a=null,r=typeof s.precision<"u"?s.precision:!1;return o.forEach(function(l){l=Number(l),(l>a||a===null)&&(a=l)}),a!==null?r!==!1?a.toFixed(r):a:""},min:function(o,n,s){var a=null,r=typeof s.precision<"u"?s.precision:!1;return o.forEach(function(l){l=Number(l),(l"u"?"undefined":E(t)){case"string":this.pasteAction=this.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t;break}};ce.prototype.setPasteParser=function(t){switch(typeof t>"u"?"undefined":E(t)){case"string":this.pasteParser=this.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t;break}};ce.prototype.paste=function(t){var o,n,s;this.checkPaseOrigin(t)&&(o=this.getPasteData(t),n=this.pasteParser.call(this,o),n?(t.preventDefault(),this.table.modExists("mutator")&&(n=this.mutateData(n)),s=this.pasteAction.call(this,n),this.table.options.clipboardPasted.call(this.table,o,n,s)):this.table.options.clipboardPasteError.call(this.table,o))};ce.prototype.mutateData=function(t){var o=this,n=[];return Array.isArray(t)?t.forEach(function(s){n.push(o.table.modules.mutator.transformRow(s,"clipboard"))}):n=t,n};ce.prototype.checkPaseOrigin=function(t){var o=!0;return(t.target.tagName!="DIV"||this.table.modules.edit.currentCell)&&(o=!1),o};ce.prototype.getPasteData=function(t){var o;return window.clipboardData&&window.clipboardData.getData?o=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?o=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(o=t.originalEvent.clipboardData.getData("text/plain")),o};ce.prototype.pasteParsers={table:function(o){var n=[],s=!0,a=this.table.columnManager.columns,r=[],l=[];return o=o.split(` +`),o.forEach(function(u){n.push(u.split(" "))}),n.length&&!(n.length===1&&n[0].length<2)?(n[0].forEach(function(u){var d=a.find(function(c){return u&&c.definition.title&&u.trim()&&c.definition.title.trim()===u.trim()});d?r.push(d):s=!1}),s||(s=!0,r=[],n[0].forEach(function(u){var d=a.find(function(c){return u&&c.field&&u.trim()&&c.field.trim()===u.trim()});d?r.push(d):s=!1}),s||(r=this.table.columnManager.columnsByIndex)),s&&n.shift(),n.forEach(function(u){var d={};u.forEach(function(c,h){r[h]&&(d[r[h].field]=c)}),l.push(d)}),l):!1}};ce.prototype.pasteActions={replace:function(o){return this.table.setData(o)},update:function(o){return this.table.updateOrAddData(o)},insert:function(o){return this.table.addData(o)}};p.prototype.registerModule("clipboard",ce);var K=function(o){this.table=o,this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.displayIndex=0};K.prototype.initialize=function(){var t=null,o=this.table.columnManager.getFirstVisibileColumn(),n=this.table.options;switch(this.field=n.dataTreeChildField,this.indent=n.dataTreeChildIndent,this.elementField=n.dataTreeElementColumn||(o?o.field:!1),n.dataTreeBranchElement&&(n.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof n.dataTreeBranchElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=n.dataTreeBranchElement),n.dataTreeCollapseElement?typeof n.dataTreeCollapseElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=n.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),n.dataTreeExpandElement?typeof n.dataTreeExpandElement=="string"?(t=document.createElement("div"),t.innerHTML=n.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=n.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),E(n.dataTreeStartExpanded)){case"boolean":this.startOpen=function(s,a){return n.dataTreeStartExpanded};break;case"function":this.startOpen=n.dataTreeStartExpanded;break;default:this.startOpen=function(s,a){return n.dataTreeStartExpanded[a]};break}};K.prototype.initializeRow=function(t){var o=t.getData()[this.field],n=Array.isArray(o),s=n||!n&&(typeof o>"u"?"undefined":E(o))==="object"&&o!==null;!s&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!s&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:s?t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0):!1,controlEl:t.modules.dataTree&&s?t.modules.dataTree.controlEl:!1,branchEl:t.modules.dataTree&&s?t.modules.dataTree.branchEl:!1,parent:t.modules.dataTree?t.modules.dataTree.parent:!1,children:s}};K.prototype.layoutRow=function(t){var o=this.elementField?t.getCell(this.elementField):t.getCells()[0],n=o.getElement(),s=t.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(t,n),t.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),n.insertBefore(s.branchEl,n.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?n.style.paddingRight=parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":n.style.paddingLeft=parseInt(window.getComputedStyle(n,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")};K.prototype.generateControlElement=function(t,a){var n=this,s=t.modules.dataTree,a=a||t.getCells()[0].getElement(),r=s.controlEl;s.children!==!1&&(s.open?(s.controlEl=this.collapseEl.cloneNode(!0),s.controlEl.addEventListener("click",function(l){l.stopPropagation(),n.collapseRow(t)})):(s.controlEl=this.expandEl.cloneNode(!0),s.controlEl.addEventListener("click",function(l){l.stopPropagation(),n.expandRow(t)})),s.controlEl.addEventListener("mousedown",function(l){l.stopPropagation()}),r&&r.parentNode===a?r.parentNode.replaceChild(s.controlEl,r):a.insertBefore(s.controlEl,a.firstChild))};K.prototype.setDisplayIndex=function(t){this.displayIndex=t};K.prototype.getDisplayIndex=function(){return this.displayIndex};K.prototype.getRows=function(t){var o=this,n=[];return t.forEach(function(s,a){var r,l;n.push(s),s instanceof T&&(s.create(),r=s.modules.dataTree.children,!r.index&&r.children!==!1&&(l=o.getChildren(s),l.forEach(function(u){u.create(),n.push(u)})))}),n};K.prototype.getChildren=function(t,o){var n=this,s=t.modules.dataTree,a=[],r=[];return s.children!==!1&&(s.open||o)&&(Array.isArray(s.children)||(s.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?a=this.table.modules.filter.filter(s.children):a=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(a),a.forEach(function(l){r.push(l);var u=n.getChildren(l);u.forEach(function(d){r.push(d)})})),r};K.prototype.generateChildren=function(t){var o=this,n=[],s=t.getData()[this.field];return Array.isArray(s)||(s=[s]),s.forEach(function(a){var r=new T(a||{},o.table.rowManager);r.create(),r.modules.dataTree.index=t.modules.dataTree.index+1,r.modules.dataTree.parent=t,r.modules.dataTree.children&&(r.modules.dataTree.open=o.startOpen(r.getComponent(),r.modules.dataTree.index)),n.push(r)}),n};K.prototype.expandRow=function(t,o){var n=t.modules.dataTree;n.children!==!1&&(n.open=!0,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowExpanded(t.getComponent(),t.modules.dataTree.index))};K.prototype.collapseRow=function(t){var o=t.modules.dataTree;o.children!==!1&&(o.open=!1,t.reinitialize(),this.table.rowManager.refreshActiveData("tree",!1,!0),this.table.options.dataTreeRowCollapsed(t.getComponent(),t.modules.dataTree.index))};K.prototype.toggleRow=function(t){var o=t.modules.dataTree;o.children!==!1&&(o.open?this.collapseRow(t):this.expandRow(t))};K.prototype.getTreeParent=function(t){return t.modules.dataTree.parent?t.modules.dataTree.parent.getComponent():!1};K.prototype.getFilteredTreeChildren=function(t){var o=t.modules.dataTree,n=[],s;return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(t)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(o.children):s=o.children,s.forEach(function(a){a instanceof T&&n.push(a)})),n};K.prototype.rowDelete=function(t){var o=t.modules.dataTree.parent,n;o&&(n=this.findChildIndex(t,o),n!==!1&&o.data[this.field].splice(n,1),o.data[this.field].length||delete o.data[this.field],this.initializeRow(o),this.layoutRow(o)),this.table.rowManager.refreshActiveData("tree",!1,!0)};K.prototype.addTreeChildRow=function(t,o,n,s){var a=!1;typeof o=="string"&&(o=JSON.parse(o)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),typeof s<"u"&&(a=this.findChildIndex(s,t),a!==!1&&t.data[this.field].splice(n?a:a+1,0,o)),a===!1&&(n?t.data[this.field].unshift(o):t.data[this.field].push(o)),this.initializeRow(t),this.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)};K.prototype.findChildIndex=function(t,o){var n=this,s=!1;return(typeof t>"u"?"undefined":E(t))=="object"?t instanceof T?s=t.data:t instanceof F?s=t._getSelf().data:typeof HTMLElement<"u"&&t instanceof HTMLElement&&o.modules.dataTree&&(s=o.modules.dataTree.children.find(function(a){return a instanceof T?a.element===t:!1}),s&&(s=s.data)):typeof t>"u"||t===null?s=!1:s=o.data[this.field].find(function(a){return a.data[n.table.options.index]==t}),s&&(Array.isArray(o.data[this.field])&&(s=o.data[this.field].indexOf(s)),s==-1&&(s=!1)),s};K.prototype.getTreeChildren=function(t,o,n){var s=this,a=t.modules.dataTree,r=[];return a.children&&(Array.isArray(a.children)||(a.children=this.generateChildren(t)),a.children.forEach(function(l){l instanceof T&&(r.push(o?l.getComponent():l),n&&(r=r.concat(s.getTreeChildren(l,o,n))))})),r};K.prototype.checkForRestyle=function(t){t.row.cells.indexOf(t)||t.row.reinitialize()};K.prototype.getChildField=function(){return this.field};K.prototype.redrawNeeded=function(t){return(this.field?typeof t[this.field]<"u":!1)||(this.elementField?typeof t[this.elementField]<"u":!1)};p.prototype.registerModule("dataTree",K);var _e=function(o){this.table=o};_e.prototype.download=function(t,o,n,s,a){var r=this,l=!1;function u(c,h){a?a===!0?r.triggerDownload(c,h,t,o,!0):a(c):r.triggerDownload(c,h,t,o)}if(typeof t=="function"?l=t:r.downloaders[t]?l=r.downloaders[t]:console.warn("Download Error - No such download type found: ",t),l){var d=this.generateExportList(s);l.call(this.table,d,n||{},u)}};_e.prototype.generateExportList=function(t){var o=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),n=this.table.options.groupHeaderDownload;return n&&!Array.isArray(n)&&(n=[n]),o.forEach(function(s){var a;s.type==="group"&&(a=s.columns[0],n&&n[s.indent]&&(a.value=n[s.indent](a.value,s.component._group.getRowCount(),s.component._group.getData(),s.component)))}),o};_e.prototype.triggerDownload=function(t,o,n,u,a){var r=document.createElement("a"),l=new Blob([t],{type:o}),u=u||"Tabulator."+(typeof n=="function"?"txt":n);l=this.table.options.downloadReady.call(this.table,t,l),l&&(a?window.open(window.URL.createObjectURL(l)):navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(l,u):(r.setAttribute("href",window.URL.createObjectURL(l)),r.setAttribute("download",u),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)),this.table.options.downloadComplete&&this.table.options.downloadComplete())};_e.prototype.commsReceived=function(t,o,n){switch(o){case"intercept":this.download(n.type,"",n.options,n.active,n.intercept);break}};_e.prototype.downloaders={csv:function(o,n,s){var a=n&&n.delimiter?n.delimiter:",",r=[],l=[];o.forEach(function(u){var d=[];switch(u.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":u.columns.forEach(function(c,h){c&&c.depth===1&&(l[h]=typeof c.value>"u"||c.value===null?"":'"'+String(c.value).split('"').join('""')+'"')});break;case"row":u.columns.forEach(function(c){if(c){switch(E(c.value)){case"object":c.value=JSON.stringify(c.value);break;case"undefined":case"null":c.value="";break}d.push('"'+String(c.value).split('"').join('""')+'"')}}),r.push(d.join(a));break}}),l.length&&r.unshift(l.join(a)),r=r.join(` +`),n.bom&&(r="\uFEFF"+r),s(r,"text/csv")},json:function(o,n,s){var a=[];o.forEach(function(r){var l={};switch(r.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":r.columns.forEach(function(u){u&&(l[u.component.getField()]=u.value)}),a.push(l);break}}),a=JSON.stringify(a,null," "),s(a,"application/json")},pdf:function(o,n,s){var a=[],r=[],l={},u=n.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},d=n.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},c=n.jsPDF||{},h=n&&n.title?n.title:"";c.orientation||(c.orientation=n.orientation||"landscape"),c.unit||(c.unit="pt"),o.forEach(function(g){switch(g.type){case"header":a.push(m(g));break;case"group":r.push(m(g,u));break;case"calc":r.push(m(g,d));break;case"row":r.push(m(g));break}});function m(g,w){var b=[];return g.columns.forEach(function(y){var x;if(y){switch(E(y.value)){case"object":y.value=JSON.stringify(y.value);break;case"undefined":case"null":y.value="";break}x={content:y.value,colSpan:y.width,rowSpan:y.height},w&&(x.styles=w),b.push(x)}else b.push("")}),b}var f=new jsPDF(c);n&&n.autoTable&&(typeof n.autoTable=="function"?l=n.autoTable(f)||{}:l=n.autoTable),h&&(l.addPageContent=function(g){f.text(h,40,30)}),l.head=a,l.body=r,f.autoTable(l),n&&n.documentProcessing&&n.documentProcessing(f),s(f.output("arraybuffer"),"application/pdf")},xlsx:function(o,n,s){var a=this,r=n.sheetName||"Sheet1",l=XLSX.utils.book_new(),u;l.SheetNames=[],l.Sheets={};function d(){var m=[],f=[],g={},w={s:{c:0,r:0},e:{c:o[0]?o[0].columns.reduce(function(b,y){return b+(y&&y.width?y.width:1)},0):0,r:o.length}};return o.forEach(function(b,y){var x=[];b.columns.forEach(function(M,_){M?(x.push(!(M.value instanceof Date)&&E(M.value)==="object"?JSON.stringify(M.value):M.value),(M.width>1||M.height>-1)&&f.push({s:{r:y,c:_},e:{r:y+M.height-1,c:_+M.width-1}})):x.push("")}),m.push(x)}),XLSX.utils.sheet_add_aoa(g,m),g["!ref"]=XLSX.utils.encode_range(w),f.length&&(g["!merges"]=f),g}if(n.sheetOnly){s(d());return}if(n.sheets)for(var c in n.sheets)n.sheets[c]===!0?(l.SheetNames.push(c),l.Sheets[c]=d()):(l.SheetNames.push(c),this.modules.comms.send(n.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:a.active,intercept:function(f){l.Sheets[c]=f}}));else l.SheetNames.push(r),l.Sheets[r]=d();n.documentProcessing&&(l=n.documentProcessing(l));function h(m){for(var f=new ArrayBuffer(m.length),g=new Uint8Array(f),w=0;w!=m.length;++w)g[w]=m.charCodeAt(w)&255;return f}u=XLSX.write(l,{bookType:"xlsx",bookSST:!0,type:"binary"}),s(h(u),"application/octet-stream")},html:function(o,n,s){this.modExists("export",!0)&&s(this.modules.export.genereateHTMLTable(o),"text/html")}};p.prototype.registerModule("download",_e);var re=function(o){this.table=o,this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[]};re.prototype.initializeColumn=function(t){var o=this,n={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(E(t.definition.editor)){case"string":t.definition.editor==="tick"&&(t.definition.editor="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),o.editors[t.definition.editor]?n.editor=o.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":n.editor=t.definition.editor;break;case"boolean":t.definition.editor===!0&&(typeof t.definition.formatter!="function"?(t.definition.formatter==="tick"&&(t.definition.formatter="tickCross",console.warn("DEPRECATION WARNING - the tick editor has been deprecated, please use the tickCross editor")),o.editors[t.definition.formatter]?n.editor=o.editors[t.definition.formatter]:n.editor=o.editors.input):console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter));break}n.editor&&(t.modules.edit=n)};re.prototype.getCurrentCell=function(){return this.currentCell?this.currentCell.getComponent():!1};re.prototype.clearEditor=function(t){var o=this.currentCell,n;if(this.invalidEdit=!1,o){for(this.currentCell=!1,n=o.getElement(),t?o.validate():n.classList.remove("tabulator-validation-fail"),n.classList.remove("tabulator-editing");n.firstChild;)n.removeChild(n.firstChild);o.row.getElement().classList.remove("tabulator-row-editing")}};re.prototype.cancelEdit=function(){if(this.currentCell){var t=this.currentCell,o=this.currentCell.getComponent();this.clearEditor(!0),t.setValueActual(t.getValue()),t.cellRendered(),(t.column.definition.editor=="textarea"||t.column.definition.variableHeight)&&t.row.normalizeHeight(!0),t.column.cellEvents.cellEditCancelled&&t.column.cellEvents.cellEditCancelled.call(this.table,o),this.table.options.cellEditCancelled.call(this.table,o)}};re.prototype.bindEditor=function(t){var o=this,n=t.getElement(!0);n.setAttribute("tabindex",0),n.addEventListener("click",function(s){n.classList.contains("tabulator-editing")||n.focus({preventScroll:!0})}),n.addEventListener("mousedown",function(s){s.button===2?s.preventDefault():o.mouseClick=!0}),n.addEventListener("focus",function(s){o.recursionBlock||o.edit(t,s,!1)})};re.prototype.focusCellNoEvent=function(t,o){this.recursionBlock=!0,o&&this.table.browser==="ie"||t.getElement().focus({preventScroll:!0}),this.recursionBlock=!1};re.prototype.editCell=function(t,o){this.focusCellNoEvent(t),this.edit(t,!1,o)};re.prototype.focusScrollAdjust=function(t){if(this.table.rowManager.getRenderMode()=="virtual"){var o=this.table.rowManager.element.scrollTop,n=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=t.row.getElement();s.offsetTop,s.offsetTopn&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-n);var a=this.table.rowManager.element.scrollLeft,r=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,l=t.getElement();l.offsetLeft,this.table.modExists("frozenColumns")&&(a+=parseInt(this.table.modules.frozenColumns.leftMargin),r-=parseInt(this.table.modules.frozenColumns.rightMargin)),this.table.options.virtualDomHoz&&(a-=parseInt(this.table.vdomHoz.vDomPadLeft),r-=parseInt(this.table.vdomHoz.vDomPadLeft)),l.offsetLeftr&&(this.table.rowManager.element.scrollLeft+=l.offsetLeft+l.offsetWidth-r)}};re.prototype.edit=function(t,o,n){var s=this,a=!0,r=function(){},l=t.getElement(),u,d,c;if(this.currentCell){this.invalidEdit||this.cancelEdit();return}function h(b){if(s.currentCell===t){var y=!0;return t.column.modules.validate&&s.table.modExists("validate")&&s.table.options.validationMode!="manual"&&(y=s.table.modules.validate.validate(t.column.modules.validate,t,b)),y===!0||s.table.options.validationMode==="highlight"?(s.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,s.editedCells.indexOf(t)==-1&&s.editedCells.push(t),t.setValue(b,!0),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t),y!==!0?(l.classList.add("tabulator-validation-fail"),s.table.options.validationFailed.call(s.table,t.getComponent(),b,y),!1):!0):(s.invalidEdit=!0,l.classList.add("tabulator-validation-fail"),s.focusCellNoEvent(t,!0),r(),s.table.options.validationFailed.call(s.table,t.getComponent(),b,y),!1)}}function m(){s.currentCell===t&&(s.cancelEdit(),s.table.options.dataTree&&s.table.modExists("dataTree")&&s.table.modules.dataTree.checkForRestyle(t))}function f(b){r=b}if(t.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;switch(o&&o.stopPropagation(),E(t.column.modules.edit.check)){case"function":a=t.column.modules.edit.check(t.getComponent());break;case"boolean":a=t.column.modules.edit.check;break}if(a||n){if(s.cancelEdit(),s.currentCell=t,this.focusScrollAdjust(t),d=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.cellEvents.cellClick&&t.column.cellEvents.cellClick.call(this.table,o,d)),t.column.cellEvents.cellEditing&&t.column.cellEvents.cellEditing.call(this.table,d),s.table.options.cellEditing.call(this.table,d),c=typeof t.column.modules.edit.params=="function"?t.column.modules.edit.params(d):t.column.modules.edit.params,u=t.column.modules.edit.editor.call(s,d,f,h,m,c),u!==!1)if(u instanceof Node){for(l.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-row-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(u),r();for(var g=l.children,w=0;w46){if(d>=n.length)return u.preventDefault(),u.stopPropagation(),!1;switch(n[d]){case s:if(c.toUpperCase()==c.toLowerCase())return u.preventDefault(),u.stopPropagation(),!1;break;case a:if(isNaN(c))return u.preventDefault(),u.stopPropagation(),!1;break;case r:break;default:if(c!==n[d])return u.preventDefault(),u.stopPropagation(),!1}}}),t.addEventListener("keyup",function(u){u.keyCode>46&&o.maskAutoFill&&l(t.value.length)}),t.placeholder||(t.placeholder=n),o.maskAutoFill&&l(t.value.length)};re.prototype.getEditedCells=function(){var t=[];return this.editedCells.forEach(function(o){t.push(o.getComponent())}),t};re.prototype.clearEdited=function(t){var o;t.modules.edit&&t.modules.edit.edited&&(t.modules.edit.edited=!1,t.modules.validate&&(t.modules.validate.invalid=!1)),o=this.editedCells.indexOf(t),o>-1&&this.editedCells.splice(o,1)};re.prototype.editors={input:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input");if(u.setAttribute("type",r.search?"search":"text"),u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var d in r.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+r.elementAttributes["+"+d])):u.setAttribute(d,r.elementAttributes[d]);u.value=typeof l<"u"?l:"",n(function(){u.focus({preventScroll:!0}),u.style.height="100%"});function c(h){(l===null||typeof l>"u")&&u.value!==""||u.value!==l?s(u.value)&&(l=u.value):a()}return u.addEventListener("change",c),u.addEventListener("blur",c),u.addEventListener("keydown",function(h){switch(h.keyCode){case 13:c();break;case 27:a();break;case 35:case 36:h.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(u,r),u},textarea:function(o,n,s,a,r){var l=o.getValue(),u=r.verticalNavigation||"hybrid",d=String(l!==null&&typeof l<"u"?l:"");(d.match(/(?:\r\n|\r|\n)/g)||[]).length+1;var c=document.createElement("textarea"),h=0;if(c.style.display="block",c.style.padding="2px",c.style.height="100%",c.style.width="100%",c.style.boxSizing="border-box",c.style.whiteSpace="pre-wrap",c.style.resize="none",r.elementAttributes&&E(r.elementAttributes)=="object")for(var m in r.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),c.setAttribute(m,c.getAttribute(m)+r.elementAttributes["+"+m])):c.setAttribute(m,r.elementAttributes[m]);c.value=d,n(function(){c.focus({preventScroll:!0}),c.style.height="100%",c.scrollHeight,c.style.height=c.scrollHeight+"px",o.getRow().normalizeHeight()});function f(g){(l===null||typeof l>"u")&&c.value!==""||c.value!==l?(s(c.value)&&(l=c.value),setTimeout(function(){o.getRow().normalizeHeight()},300)):a()}return c.addEventListener("change",f),c.addEventListener("blur",f),c.addEventListener("keyup",function(){c.style.height="";var g=c.scrollHeight;c.style.height=g+"px",g!=h&&(h=g,o.getRow().normalizeHeight())}),c.addEventListener("keydown",function(g){switch(g.keyCode){case 27:a();break;case 38:(u=="editor"||u=="hybrid"&&c.selectionStart)&&(g.stopImmediatePropagation(),g.stopPropagation());break;case 40:(u=="editor"||u=="hybrid"&&c.selectionStart!==c.value.length)&&(g.stopImmediatePropagation(),g.stopPropagation());break;case 35:case 36:g.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(c,r),c},number:function(o,n,s,a,r){var l=o.getValue(),u=r.verticalNavigation||"editor",d=document.createElement("input");if(d.setAttribute("type","number"),typeof r.max<"u"&&d.setAttribute("max",r.max),typeof r.min<"u"&&d.setAttribute("min",r.min),typeof r.step<"u"&&d.setAttribute("step",r.step),d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var c in r.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+r.elementAttributes["+"+c])):d.setAttribute(c,r.elementAttributes[c]);d.value=l;var h=function(g){m()};n(function(){d.removeEventListener("blur",h),d.focus({preventScroll:!0}),d.style.height="100%",d.addEventListener("blur",h)});function m(){var f=d.value;!isNaN(f)&&f!==""&&(f=Number(f)),f!==l?s(f)&&(l=f):a()}return d.addEventListener("keydown",function(f){switch(f.keyCode){case 13:m();break;case 27:a();break;case 38:case 40:u=="editor"&&(f.stopImmediatePropagation(),f.stopPropagation());break;case 35:case 36:f.stopPropagation();break}}),r.mask&&this.table.modules.edit.maskInput(d,r),d},range:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input");if(u.setAttribute("type","range"),typeof r.max<"u"&&u.setAttribute("max",r.max),typeof r.min<"u"&&u.setAttribute("min",r.min),typeof r.step<"u"&&u.setAttribute("step",r.step),u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var d in r.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),u.setAttribute(d,u.getAttribute(d)+r.elementAttributes["+"+d])):u.setAttribute(d,r.elementAttributes[d]);u.value=l,n(function(){u.focus({preventScroll:!0}),u.style.height="100%"});function c(){var h=u.value;!isNaN(h)&&h!==""&&(h=Number(h)),h!=l?s(h)&&(l=h):a()}return u.addEventListener("blur",function(h){c()}),u.addEventListener("keydown",function(h){switch(h.keyCode){case 13:c();break;case 27:a();break}}),u},select:function(o,n,s,a,r){var l=this,u=this,d=o.getElement(),c=o.getValue(),h=r.verticalNavigation||"editor",m=typeof c<"u"||c===null?Array.isArray(c)?c:[c]:typeof r.defaultValue<"u"?r.defaultValue:[],f=document.createElement("input"),g=document.createElement("div"),w=r.multiselect,b=[],y={},x=[],M=[],_=!0,Y=!1,Z="",Q=null;(Array.isArray(r)||!Array.isArray(r)&&(typeof r>"u"?"undefined":E(r))==="object"&&!r.values)&&(console.warn("DEPRECATION WARNING - values for the select editor must now be passed into the values property of the editorParams object, not as the editorParams object"),r={values:r});function ye(v){var D={},q=u.table.getData(),oe;return v?oe=u.table.columnManager.getColumnByField(v):oe=o.getColumn()._getSelf(),oe?q.forEach(function(Oe){var ke=oe.getFieldValue(Oe);ke!==null&&typeof ke<"u"&&ke!==""&&(D[ke]=!0)}):console.warn("unable to find matching column to create select lookup list:",v),Object.keys(D)}function me(v,D){var q=[],oe=[];function Oe(G){var G={label:G.label,value:G.value,itemParams:G.itemParams,elementAttributes:G.elementAttributes,element:!1};return D.indexOf(G.value)>-1&&be(G),q.push(G),oe.push(G),G}if(typeof v=="function"&&(v=v(o)),Array.isArray(v))v.forEach(function(ie){var G;(typeof ie>"u"?"undefined":E(ie))==="object"?ie.options?(G={label:ie.label,group:!0,itemParams:ie.itemParams,elementAttributes:ie.elementAttributes,element:!1},oe.push(G),ie.options.forEach(function(qe){Oe(qe)})):Oe(ie):(G={label:ie,value:ie,element:!1},D.indexOf(G.value)>-1&&be(G),q.push(G),oe.push(G))});else for(var ke in v){var We={label:v[ke],value:ke,element:!1};D.indexOf(We.value)>-1&&be(We),q.push(We),oe.push(We)}r.sortValuesList&&(q.sort(function(ie,G){return ie.labelG.label?1:0}),oe.sort(function(ie,G){return ie.labelG.label?1:0}),r.sortValuesList!=="asc"&&(q.reverse(),oe.reverse())),b=q,x=oe,de()}function de(){for(;g.firstChild;)g.removeChild(g.firstChild);x.forEach(function(v){var D=v.element;if(!D){if(D=document.createElement("div"),v.label=r.listItemFormatter?r.listItemFormatter(v.value,v.label,o,D,v.itemParams):v.label,v.group?(D.classList.add("tabulator-edit-select-list-group"),D.tabIndex=0,D.innerHTML=v.label===""?" ":v.label):(D.classList.add("tabulator-edit-select-list-item"),D.tabIndex=0,D.innerHTML=v.label===""?" ":v.label,D.addEventListener("click",function(){Y=!0,setTimeout(function(){Y=!1},10),w?(k(v),f.focus()):Fe(v)}),M.indexOf(v)>-1&&D.classList.add("active")),v.elementAttributes&&E(v.elementAttributes)=="object")for(var q in v.elementAttributes)q.charAt(0)=="+"?(q=q.slice(1),D.setAttribute(q,f.getAttribute(q)+v.elementAttributes["+"+q])):D.setAttribute(q,v.elementAttributes[q]);D.addEventListener("mousedown",function(){_=!1,setTimeout(function(){_=!0},10)}),v.element=D}g.appendChild(D)})}function ge(v,D){!w&&y&&y.element&&y.element.classList.remove("active"),y&&y.element&&y.element.classList.remove("focused"),y=v,v.element&&(v.element.classList.add("focused"),D&&v.element.classList.add("active")),v&&v.element&&v.element.scrollIntoView&&v.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function be(v){var D=M.indexOf(v);D==-1&&(M.push(v),ge(v,!0)),Be()}function De(v){var D=M[v];v>-1&&(M.splice(v,1),D.element&&D.element.classList.remove("active"))}function k(v){v||(v=y);var D=M.indexOf(v);D>-1?De(D):(w!==!0&&M.length>=w&&De(0),be(v)),Be()}function Fe(v){O(),v||(v=y),v&&(f.value=v.label,s(v.value)),m=[v.value]}function we(v){v||O();var D=[];M.forEach(function(q){D.push(q.value)}),m=D,s(D)}function Be(){var v=[];M.forEach(function(D){v.push(D.label)}),f.value=v.join(", "),u.currentCell===!1&&we(!0)}function L(){for(var v=M.length,D=0;D0&&ge(b[D-1],!w));break;case 40:D=b.indexOf(y),(h=="editor"||h=="hybrid"&&D=38&&v.keyCode<=90&&j(v.keyCode)}}),f.addEventListener("blur",function(v){_&&(w?we():z())}),f.addEventListener("focus",function(v){Y||$()}),g=document.createElement("div"),g.classList.add("tabulator-edit-select-list"),n(function(){f.style.height="100%",f.focus({preventScroll:!0})}),setTimeout(function(){l.table.rowManager.element.addEventListener("scroll",z)},10),f},autocomplete:function(o,n,s,a,r){var l=this,u=this,d=o.getElement(),c=o.getValue(),h=r.verticalNavigation||"editor",m=typeof c<"u"||c===null?c:typeof r.defaultValue<"u"?r.defaultValue:"",f=document.createElement("input"),g=document.createElement("div"),w=[],b=!1,y=!0,x=!1;if(f.setAttribute("type","search"),f.style.padding="4px",f.style.width="100%",f.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var M in r.elementAttributes)M.charAt(0)=="+"?(M=M.slice(1),f.setAttribute(M,f.getAttribute(M)+r.elementAttributes["+"+M])):f.setAttribute(M,r.elementAttributes[M]);g.classList.add("tabulator-edit-select-list"),g.addEventListener("mousedown",function(L){y=!1,setTimeout(function(){y=!0},10)});function _(){r.values===!0?x=Y():typeof r.values=="string"&&(x=Y(r.values))}function Y(L){var z={},$=u.table.getData(),O;return L?O=u.table.columnManager.getColumnByField(L):O=o.getColumn()._getSelf(),O?($.forEach(function(P){var j=O.getFieldValue(P);j!==null&&typeof j<"u"&&j!==""&&(z[j]=!0)}),r.sortValuesList?r.sortValuesList=="asc"?z=Object.keys(z).sort():z=Object.keys(z).sort().reverse():z=Object.keys(z)):console.warn("unable to find matching column to create autocomplete lookup list:",L),z}function Z(L,z){var $=[],O,P;x?O=x:O=r.values||[],r.searchFunc?($=r.searchFunc(L,O),$ instanceof Promise?(Q(typeof r.searchingPlaceholder<"u"?r.searchingPlaceholder:"Searching..."),$.then(function(j){de(ye(j),z)}).catch(function(j){console.err("error in autocomplete search promise:",j)})):de(ye($),z)):(P=ye(O),L===""?r.showListOnEmpty&&($=P):P.forEach(function(j){(j.value!==null||typeof j.value<"u")&&(String(j.value).toLowerCase().indexOf(String(L).toLowerCase())>-1||String(j.title).toLowerCase().indexOf(String(L).toLowerCase())>-1)&&$.push(j)}),de($,z))}function Q(L){var z=document.createElement("div");me(),L!==!1&&(z.classList.add("tabulator-edit-select-list-notice"),z.tabIndex=0,L instanceof Node?z.appendChild(L):z.innerHTML=L,g.appendChild(z))}function ye(L){var z=[];if(Array.isArray(L))L.forEach(function(P){var j={};(typeof P>"u"?"undefined":E(P))==="object"?(j.title=r.listItemFormatter?r.listItemFormatter(P.value,P.label):P.label,j.value=P.value):(j.title=r.listItemFormatter?r.listItemFormatter(P,P):P,j.value=P),z.push(j)});else for(var $ in L){var O={title:r.listItemFormatter?r.listItemFormatter($,L[$]):L[$],value:$};z.push(O)}return z}function me(){for(;g.firstChild;)g.removeChild(g.firstChild)}function de(L,z){L.length?ge(L,z):r.emptyPlaceholder&&Q(r.emptyPlaceholder)}function ge(L,z){var $=!1;me(),w=L,w.forEach(function(O){var P=O.element;P||(P=document.createElement("div"),P.classList.add("tabulator-edit-select-list-item"),P.tabIndex=0,P.innerHTML=O.title,P.addEventListener("click",function(j){k(O),be()}),P.addEventListener("mousedown",function(j){y=!1,setTimeout(function(){y=!0},10)}),O.element=P,z&&O.value==c&&(f.value=O.title,O.element.classList.add("active"),$=!0),O===b&&(O.element.classList.add("active"),$=!0)),g.appendChild(P)}),$||k(!1)}function be(){Fe(),b?c!==b.value?(c=b.value,f.value=b.title,s(b.value)):a():r.freetext||r.allowEmpty&&f.value===""?(c=f.value,s(f.value)):a()}function De(){if(!g.parentNode){for(console.log("show",m);g.firstChild;)g.removeChild(g.firstChild);var L=p.prototype.helpers.elOffset(d);g.style.minWidth=d.offsetWidth+"px",g.style.top=L.top+d.offsetHeight+"px",g.style.left=L.left+"px",document.body.appendChild(g)}}function k(L,z){b&&b.element&&b.element.classList.remove("active"),b=L,L&&L.element&&L.element.classList.add("active"),L&&L.element&&L.element.scrollIntoView&&L.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}function Fe(){g.parentNode&&g.parentNode.removeChild(g),Be()}function we(){Fe(),a()}function Be(){u.table.rowManager.element.removeEventListener("scroll",we)}return f.addEventListener("keydown",function(L){var z;switch(L.keyCode){case 38:z=w.indexOf(b),(h=="editor"||h=="hybrid"&&z)&&(L.stopImmediatePropagation(),L.stopPropagation(),L.preventDefault(),z>0?k(w[z-1]):k(!1));break;case 40:z=w.indexOf(b),(h=="editor"||h=="hybrid"&&z'):(l.table.browser=="ie"?Y.setAttribute("class","tabulator-star-inactive"):Y.classList.replace("tabulator-star-active","tabulator-star-inactive"),Y.innerHTML='')})}function b(_){var Y=document.createElement("span"),Z=g.cloneNode(!0);m.push(Z),Y.addEventListener("mouseenter",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation(),w(_)}),Y.addEventListener("mousemove",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation()}),Y.addEventListener("click",function(Q){Q.stopPropagation(),Q.stopImmediatePropagation(),s(_),u.blur()}),Y.appendChild(Z),f.appendChild(Y)}function y(_){d=_,w(_)}if(u.style.whiteSpace="nowrap",u.style.overflow="hidden",u.style.textOverflow="ellipsis",f.style.verticalAlign="middle",f.style.display="inline-block",f.style.padding="4px",g.setAttribute("width",h),g.setAttribute("height",h),g.setAttribute("viewBox","0 0 512 512"),g.setAttribute("xml:space","preserve"),g.style.padding="0 1px",r.elementAttributes&&E(r.elementAttributes)=="object")for(var x in r.elementAttributes)x.charAt(0)=="+"?(x=x.slice(1),f.setAttribute(x,f.getAttribute(x)+r.elementAttributes["+"+x])):f.setAttribute(x,r.elementAttributes[x]);for(var M=1;M<=c;M++)b(M);return d=Math.min(parseInt(d),c),w(d),f.addEventListener("mousemove",function(_){w(0)}),f.addEventListener("click",function(_){s(0)}),u.addEventListener("blur",function(_){a()}),u.addEventListener("keydown",function(_){switch(_.keyCode){case 39:y(d+1);break;case 37:y(d-1);break;case 13:s(d);break;case 27:a();break}}),f},progress:function(o,n,s,a,r){var l=o.getElement(),u=typeof r.max>"u"?l.getElementsByTagName("div")[0].getAttribute("max")||100:r.max,d=typeof r.min>"u"?l.getElementsByTagName("div")[0].getAttribute("min")||0:r.min,c=(u-d)/100,h=o.getValue()||0,m=document.createElement("div"),f=document.createElement("div"),g,w;function b(){var x=window.getComputedStyle(l,null),M=c*Math.round(f.offsetWidth/((l.clientWidth-parseInt(x.getPropertyValue("padding-left"))-parseInt(x.getPropertyValue("padding-right")))/100))+d;s(M),l.setAttribute("aria-valuenow",M),l.setAttribute("aria-label",h)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),f.style.display="inline-block",f.style.position="relative",f.style.height="100%",f.style.backgroundColor="#488CE9",f.style.maxWidth="100%",f.style.minWidth="0%",r.elementAttributes&&E(r.elementAttributes)=="object")for(var y in r.elementAttributes)y.charAt(0)=="+"?(y=y.slice(1),f.setAttribute(y,f.getAttribute(y)+r.elementAttributes["+"+y])):f.setAttribute(y,r.elementAttributes[y]);return l.style.padding="4px 4px",h=Math.min(parseFloat(h),u),h=Math.max(parseFloat(h),d),h=Math.round((h-d)/c),f.style.width=h+"%",l.setAttribute("aria-valuemin",d),l.setAttribute("aria-valuemax",u),f.appendChild(m),m.addEventListener("mousedown",function(x){g=x.screenX,w=f.offsetWidth}),m.addEventListener("mouseover",function(){m.style.cursor="ew-resize"}),l.addEventListener("mousemove",function(x){g&&(f.style.width=w+x.screenX-g+"px")}),l.addEventListener("mouseup",function(x){g&&(x.stopPropagation(),x.stopImmediatePropagation(),g=!1,w=!1,b())}),l.addEventListener("keydown",function(x){switch(x.keyCode){case 39:x.preventDefault(),f.style.width=f.clientWidth+l.clientWidth/100+"px";break;case 37:x.preventDefault(),f.style.width=f.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:b();break;case 27:a();break}}),l.addEventListener("blur",function(){a()}),f},tickCross:function(o,n,s,a,r){var l=o.getValue(),u=document.createElement("input"),d=r.tristate,c=typeof r.indeterminateValue>"u"?null:r.indeterminateValue,h=!1;if(u.setAttribute("type","checkbox"),u.style.marginTop="5px",u.style.boxSizing="border-box",r.elementAttributes&&E(r.elementAttributes)=="object")for(var m in r.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),u.setAttribute(m,u.getAttribute(m)+r.elementAttributes["+"+m])):u.setAttribute(m,r.elementAttributes[m]);u.value=l,d&&(typeof l>"u"||l===c||l==="")&&(h=!0,u.indeterminate=!0),this.table.browser!="firefox"&&n(function(){u.focus({preventScroll:!0})}),u.checked=l===!0||l==="true"||l==="True"||l===1,n(function(){u.focus()});function f(g){return d?g?h?c:u.checked:u.checked&&!h?(u.checked=!1,u.indeterminate=!0,h=!0,c):(h=!1,u.checked):u.checked}return u.addEventListener("change",function(g){s(f())}),u.addEventListener("blur",function(g){s(f(!0))}),u.addEventListener("keydown",function(g){g.keyCode==13&&s(f()),g.keyCode==27&&a()}),u}};p.prototype.registerModule("edit",re);var Ye=function(o,n,s,a){this.type=o,this.columns=n,this.component=s||!1,this.indent=a||0},Ge=function(o,n,s,a,r){this.value=o,this.component=n||!1,this.width=s,this.height=a,this.depth=r},te=function(o){this.table=o,this.config={},this.cloneTableStyle=!0,this.colVisProp=""};te.prototype.generateExportList=function(t,o,n,s){this.cloneTableStyle=o,this.config=t||{},this.colVisProp=s;var a=this.config.columnHeaders!==!1?this.headersToExportRows(this.generateColumnGroupHeaders()):[],r=this.bodyToExportRows(this.rowLookup(n));return a.concat(r)};te.prototype.genereateTable=function(t,o,n,s){var a=this.generateExportList(t,o,n,s);return this.genereateTableElement(a)};te.prototype.rowLookup=function(t){var o=this,n=[];if(typeof t=="function")t.call(this.table).forEach(function(s){s=o.table.rowManager.findRow(s),s&&n.push(s)});else switch(t){case!0:case"visible":n=this.table.rowManager.getVisibleRows(!0);break;case"all":n=this.table.rowManager.rows;break;case"selected":n=this.table.modules.selectRow.selectedRows;break;case"active":default:this.table.options.pagination?n=this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):n=this.table.rowManager.getDisplayRows()}return Object.assign([],n)};te.prototype.generateColumnGroupHeaders=function(){var t=this,o=[],n=this.config.columnGroups!==!1?this.table.columnManager.columns:this.table.columnManager.columnsByIndex;return n.forEach(function(s){var a=t.processColumnGroup(s);a&&o.push(a)}),o};te.prototype.processColumnGroup=function(t){var o=this,n=t.columns,s=0,a=t.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||t.definition.title,r={title:a,column:t,depth:1};if(n.length){if(r.subGroups=[],r.width=0,n.forEach(function(l){var u=o.processColumnGroup(l);u&&(r.width+=u.width,r.subGroups.push(u),u.depth>s&&(s=u.depth))}),r.depth+=s,!r.width)return!1}else if(this.columnVisCheck(t))r.width=1;else return!1;return r};te.prototype.columnVisCheck=function(t){return t.definition[this.colVisProp]!==!1&&(t.visible||!t.visible&&t.definition[this.colVisProp])};te.prototype.headersToExportRows=function(t){var o=[],n=0,s=[];function a(r,l){var u=n-l;if(typeof o[l]>"u"&&(o[l]=[]),r.height=r.subGroups?1:u-r.depth+1,o[l].push(r),r.height>1)for(var d=1;d"u"&&(o[l+d]=[]),o[l+d].push(!1);if(r.width>1)for(var c=1;cn&&(n=r.depth)}),t.forEach(function(r){a(r,0)}),o.forEach(function(r){var l=[];r.forEach(function(u){u?l.push(new Ge(u.title,u.column.getComponent(),u.width,u.height,u.depth)):l.push(null)}),s.push(new Ye("header",l))}),s};te.prototype.bodyToExportRows=function(t){var o=this,n=[],s=[];return this.table.columnManager.columnsByIndex.forEach(function(a){o.columnVisCheck(a)&&n.push(a.getComponent())}),this.config.columnCalcs!==!1&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),t=t.filter(function(a){switch(a.type){case"group":return o.config.rowGroups!==!1;case"calc":return o.config.columnCalcs!==!1;case"row":return!(o.table.options.dataTree&&o.config.dataTree===!1&&a.modules.dataTree.parent)}return!0}),t.forEach(function(a,r){var l=a.getData(o.colVisProp),u=[],d=0;switch(a.type){case"group":d=a.level,u.push(new Ge(a.key,a.getComponent(),n.length,1));break;case"calc":case"row":n.forEach(function(c){u.push(new Ge(c._column.getFieldValue(l),c,1,1))}),o.table.options.dataTree&&o.config.dataTree!==!1&&(d=a.modules.dataTree.index);break}s.push(new Ye(a.type,u,a.getComponent(),d))}),s};te.prototype.genereateTableElement=function(t){var o=this,n=document.createElement("table"),s=document.createElement("thead"),a=document.createElement("tbody"),r=this.lookupTableStyles(),l=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u={};return u.rowFormatter=l!==null?l:this.table.options.rowFormatter,this.table.options.dataTree&&this.config.dataTree!==!1&&this.table.modExists("columnCalcs")&&(u.treeElementField=this.table.modules.dataTree.elementField),u.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],u.groupHeader&&!Array.isArray(u.groupHeader)&&(u.groupHeader=[u.groupHeader]),n.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),s,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach(function(d,c){switch(d.type){case"header":s.appendChild(o.genereateHeaderElement(d,u,r));break;case"group":a.appendChild(o.genereateGroupElement(d,u,r));break;case"calc":a.appendChild(o.genereateCalcElement(d,u,r));break;case"row":var h=o.genereateRowElement(d,u,r);o.mapElementStyles(c%2&&r.evenRow?r.evenRow:r.oddRow,h,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),a.appendChild(h);break}}),s.innerHTML&&n.appendChild(s),n.appendChild(a),this.mapElementStyles(this.table.element,n,["border-top","border-left","border-right","border-bottom"]),n};te.prototype.lookupTableStyles=function(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t};te.prototype.genereateHeaderElement=function(t,o,n){var s=this,a=document.createElement("tr");return t.columns.forEach(function(r){if(r){var l=document.createElement("th"),u=r.component._column.definition.cssClass?r.component._column.definition.cssClass.split(" "):[];l.colSpan=r.width,l.rowSpan=r.height,l.innerHTML=r.value,s.cloneTableStyle&&(l.style.boxSizing="border-box"),u.forEach(function(d){l.classList.add(d)}),s.mapElementStyles(r.component.getElement(),l,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),s.mapElementStyles(r.component._column.contentElement,l,["padding-top","padding-left","padding-right","padding-bottom"]),r.component._column.visible?s.mapElementStyles(r.component.getElement(),l,["width"]):r.component._column.definition.width&&(l.style.width=r.component._column.definition.width+"px"),r.component._column.parent&&s.mapElementStyles(r.component._column.parent.groupElement,l,["border-top"]),a.appendChild(l)}}),a};te.prototype.genereateGroupElement=function(t,o,n){var s=document.createElement("tr"),a=document.createElement("td"),r=t.columns[0];return s.classList.add("tabulator-print-table-row"),o.groupHeader&&o.groupHeader[t.indent]?r.value=o.groupHeader[t.indent](r.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):o.groupHeader===!1?r.value=r.value:r.value=t.component._group.generator(r.value,t.component._group.getRowCount(),t.component._group.getData(),t.component),a.colSpan=r.width,a.innerHTML=r.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+t.indent),r.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(n.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(n.firstGroup,a,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(a),s};te.prototype.genereateCalcElement=function(t,o,n){var s=this.genereateRowElement(t,o,n);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(n.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s};te.prototype.genereateRowElement=function(t,o,n){var s=this,a=document.createElement("tr");return a.classList.add("tabulator-print-table-row"),t.columns.forEach(function(r){if(r){var l=document.createElement("td"),u=r.component._column,d=r.value,c={modules:{},getValue:function(){return d},getField:function(){return u.definition.field},getElement:function(){return l},getColumn:function(){return u.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return c},column:u},h=u.definition.cssClass?u.definition.cssClass.split(" "):[];if(h.forEach(function(m){l.classList.add(m)}),s.table.modExists("format")&&s.config.formatCells!==!1)d=s.table.modules.format.formatExportValue(c,s.colVisProp);else switch(typeof d>"u"?"undefined":E(d)){case"object":d=JSON.stringify(d);break;case"undefined":case"null":d="";break;default:d=d}d instanceof Node?l.appendChild(d):l.innerHTML=d,n.firstCell&&(s.mapElementStyles(n.firstCell,l,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size"]),u.definition.align&&(l.style.textAlign=u.definition.align)),s.table.options.dataTree&&s.config.dataTree!==!1&&(o.treeElementField&&o.treeElementField==u.field||!o.treeElementField&&i==0)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),a.appendChild(l),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback(),o.rowFormatter&&s.config.formatCells!==!1&&o.rowFormatter(t.component)}}),a};te.prototype.genereateHTMLTable=function(t){var o=document.createElement("div");return o.appendChild(this.genereateTableElement(t)),o.innerHTML};te.prototype.getHtml=function(t,o,n,s){var a=this.generateExportList(n||this.table.options.htmlOutputConfig,o,t,s||"htmlOutput");return this.genereateHTMLTable(a)};te.prototype.mapElementStyles=function(t,o,n){if(this.cloneTableStyle&&t&&o){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var a=window.getComputedStyle(t);n.forEach(function(r){o.style[s[r]]=a.getPropertyValue(r)})}}};p.prototype.registerModule("export",te);var V=function(o){this.table=o,this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1};V.prototype.initializeColumn=function(t,o){var n=this,s=t.getField();function a(r){var l=t.modules.filter.tagType=="input"&&t.modules.filter.attrType=="text"||t.modules.filter.tagType=="textarea"?"partial":"match",u="",d="",c;if(typeof t.modules.filter.prevSuccess>"u"||t.modules.filter.prevSuccess!==r){if(t.modules.filter.prevSuccess=r,t.modules.filter.emptyFunc(r))delete n.headerFilters[s];else{switch(t.modules.filter.value=r,E(t.definition.headerFilterFunc)){case"string":n.filters[t.definition.headerFilterFunc]?(u=t.definition.headerFilterFunc,c=function(m){var f=t.definition.headerFilterFuncParams||{},g=t.getFieldValue(m);return f=typeof f=="function"?f(r,g,m):f,n.filters[t.definition.headerFilterFunc](r,g,m,f)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":c=function(m){var f=t.definition.headerFilterFuncParams||{},g=t.getFieldValue(m);return f=typeof f=="function"?f(r,g,m):f,t.definition.headerFilterFunc(r,g,m,f)},u=c;break}if(!c)switch(l){case"partial":c=function(m){var f=t.getFieldValue(m);return typeof f<"u"&&f!==null?String(f).toLowerCase().indexOf(String(r).toLowerCase())>-1:!1},u="like";break;default:c=function(m){return t.getFieldValue(m)==r},u="="}n.headerFilters[s]={value:r,func:c,type:u,params:{}}}d=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==d&&(n.prevHeaderFilterChangeCheck=d,n.changed=!0,n.table.rowManager.filterRefresh())}return!0}t.modules.filter={success:a,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)};V.prototype.generateHeaderFilterElement=function(t,o,n){var s=this,a=this,r=t.modules.filter.success,l=t.getField(),u,d,c,h,m,f,g;function w(){}if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),l){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(b){return!b&&b!=="0"&&b!==0},u=document.createElement("div"),u.classList.add("tabulator-header-filter"),E(t.definition.headerFilter)){case"string":a.table.modules.edit.editors[t.definition.headerFilter]?(d=a.table.modules.edit.editors[t.definition.headerFilter],(t.definition.headerFilter==="tick"||t.definition.headerFilter==="tickCross")&&!t.definition.headerFilterEmptyCheck&&(t.modules.filter.emptyFunc=function(b){return b!==!0&&b!==!1})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":d=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?d=t.modules.edit.editor:t.definition.formatter&&a.table.modules.edit.editors[t.definition.formatter]?(d=a.table.modules.edit.editors[t.definition.formatter],(t.definition.formatter==="tick"||t.definition.formatter==="tickCross")&&!t.definition.headerFilterEmptyCheck&&(t.modules.filter.emptyFunc=function(b){return b!==!0&&b!==!1})):d=a.table.modules.edit.editors.input;break}if(d){if(h={getValue:function(){return typeof o<"u"?o:""},getField:function(){return t.definition.field},getElement:function(){return u},getColumn:function(){return t.getComponent()},getRow:function(){return{normalizeHeight:function(){}}}},g=t.definition.headerFilterParams||{},g=typeof g=="function"?g.call(a.table):g,c=d.call(this.table.modules.edit,h,function(){},r,w,g),!c){console.warn("Filter Error - Cannot add filter to "+l+" column, editor returned a value of false");return}if(!(c instanceof Node)){console.warn("Filter Error - Cannot add filter to "+l+" column, editor should return an instance of Node, the editor returned:",c);return}l?a.table.modules.localize.bind("headerFilters|columns|"+t.definition.field,function(b){c.setAttribute("placeholder",typeof b<"u"&&b?b:a.table.modules.localize.getText("headerFilters|default"))}):a.table.modules.localize.bind("headerFilters|default",function(b){c.setAttribute("placeholder",typeof a.column.definition.headerFilterPlaceholder<"u"&&a.column.definition.headerFilterPlaceholder?a.column.definition.headerFilterPlaceholder:b)}),c.addEventListener("click",function(b){b.stopPropagation(),c.focus()}),c.addEventListener("focus",function(b){var y=s.table.columnManager.element.scrollLeft;y!==s.table.rowManager.element.scrollLeft&&(s.table.rowManager.scrollHorizontal(y),s.table.columnManager.scrollHorizontal(y))}),m=!1,f=function(y){m&&clearTimeout(m),m=setTimeout(function(){r(c.value)},a.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=c,t.modules.filter.attrType=c.hasAttribute("type")?c.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=c.tagName.toLowerCase(),t.definition.headerFilterLiveFilter!==!1&&(t.definition.headerFilter==="autocomplete"||t.definition.headerFilter==="tickCross"||(t.definition.editor==="autocomplete"||t.definition.editor==="tickCross")&&t.definition.headerFilter===!0||(c.addEventListener("keyup",f),c.addEventListener("search",f),t.modules.filter.attrType=="number"&&c.addEventListener("change",function(b){r(c.value)}),t.modules.filter.attrType=="text"&&this.table.browser!=="ie"&&c.setAttribute("type","search")),(t.modules.filter.tagType=="input"||t.modules.filter.tagType=="select"||t.modules.filter.tagType=="textarea")&&c.addEventListener("mousedown",function(b){b.stopPropagation()})),u.appendChild(c),t.contentElement.appendChild(u),n||a.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)};V.prototype.hideHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="none")})};V.prototype.showHeaderFilterElements=function(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="")})};V.prototype.setHeaderFilterFocus=function(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())};V.prototype.getHeaderFilterValue=function(t){if(t.modules.filter&&t.modules.filter.headerElement)return t.modules.filter.headerElement.value;console.warn("Column Filter Error - No header filter set on column:",t.getField())};V.prototype.setHeaderFilterValue=function(t,o){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,o,!0),t.modules.filter.success(o)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))};V.prototype.reloadHeaderFilter=function(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",t.getField()))};V.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t};V.prototype.setFilter=function(t,o,n,s){var a=this;a.filterList=[],Array.isArray(t)||(t=[{field:t,type:o,value:n,params:s}]),a.addFilter(t)};V.prototype.addFilter=function(t,o,n,s){var a=this;Array.isArray(t)||(t=[{field:t,type:o,value:n,params:s}]),t.forEach(function(r){r=a.findFilter(r),r&&(a.filterList.push(r),a.changed=!0)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.findFilter=function(t){var o=this,n;if(Array.isArray(t))return this.findSubFilters(t);var s=!1;return typeof t.field=="function"?s=function(r){return t.field(r,t.type||{})}:o.filters[t.type]?(n=o.table.columnManager.getColumnByField(t.field),n?s=function(r){return o.filters[t.type](t.value,n.getFieldValue(r),r,t.params||{})}:s=function(r){return o.filters[t.type](t.value,r[t.field],r,t.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=s,t.func?t:!1};V.prototype.findSubFilters=function(t){var o=this,n=[];return t.forEach(function(s){s=o.findFilter(s),s&&n.push(s)}),n.length?n:!1};V.prototype.getFilters=function(t,o){var n=[];return t&&(n=this.getHeaderFilters()),o&&n.forEach(function(s){typeof s.type=="function"&&(s.type="function")}),n=n.concat(this.filtersToArray(this.filterList,o)),n};V.prototype.filtersToArray=function(t,o){var n=this,s=[];return t.forEach(function(a){var r;Array.isArray(a)?s.push(n.filtersToArray(a,o)):(r={field:a.field,type:a.type,value:a.value},o&&typeof r.type=="function"&&(r.type="function"),s.push(r))}),s};V.prototype.getHeaderFilters=function(){var t=[];for(var o in this.headerFilters)t.push({field:o,type:this.headerFilters[o].type,value:this.headerFilters[o].value});return t};V.prototype.removeFilter=function(t,o,n){var s=this;Array.isArray(t)||(t=[{field:t,type:o,value:n}]),t.forEach(function(a){var r=-1;E(a.field)=="object"?r=s.filterList.findIndex(function(l){return a===l}):r=s.filterList.findIndex(function(l){return a.field===l.field&&a.type===l.type&&a.value===l.value}),r>-1?(s.filterList.splice(r,1),s.changed=!0):console.warn("Filter Error - No matching filter type found, ignoring: ",a.type)}),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.clearFilter=function(t){this.filterList=[],t&&this.clearHeaderFilter(),this.changed=!0,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.filter&&this.table.modules.persistence.save("filter")};V.prototype.clearHeaderFilter=function(){var t=this;this.headerFilters={},t.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(function(o){typeof o.modules.filter.value<"u"&&delete o.modules.filter.value,o.modules.filter.prevSuccess=void 0,t.reloadHeaderFilter(o)}),this.changed=!0};V.prototype.search=function(t,o,n,s){var a=this,r=[],l=[];return Array.isArray(o)||(o=[{field:o,type:n,value:s}]),o.forEach(function(u){u=a.findFilter(u),u&&l.push(u)}),this.table.rowManager.rows.forEach(function(u){var d=!0;l.forEach(function(c){a.filterRecurse(c,u.getData())||(d=!1)}),d&&r.push(t==="data"?u.getData("data"):u.getComponent())}),r};V.prototype.filter=function(t,o){var n=this,s=[],a=[];return n.table.options.dataFiltering&&n.table.options.dataFiltering.call(n.table,n.getFilters()),!n.table.options.ajaxFiltering&&(n.filterList.length||Object.keys(n.headerFilters).length)?t.forEach(function(r){n.filterRow(r)&&s.push(r)}):s=t.slice(0),n.table.options.dataFiltered&&(s.forEach(function(r){a.push(r.getComponent())}),n.table.options.dataFiltered.call(n.table,n.getFilters(),a)),s};V.prototype.filterRow=function(t,o){var n=this,s=!0,a=t.getData();n.filterList.forEach(function(l){n.filterRecurse(l,a)||(s=!1)});for(var r in n.headerFilters)n.headerFilters[r].func(a)||(s=!1);return s};V.prototype.filterRecurse=function(t,o){var n=this,s=!1;return Array.isArray(t)?t.forEach(function(a){n.filterRecurse(a,o)&&(s=!0)}):s=t.func(o),s};V.prototype.filters={"=":function(o,n,s,a){return n==o},"<":function(o,n,s,a){return n":function(o,n,s,a){return n>o},">=":function(o,n,s,a){return n>=o},"!=":function(o,n,s,a){return n!=o},regex:function(o,n,s,a){return typeof o=="string"&&(o=new RegExp(o)),o.test(n)},like:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().indexOf(o.toLowerCase())>-1:!1},keywords:function(o,n,s,a){var r=o.toLowerCase().split(typeof a.separator>"u"?" ":a.separator),l=String(n===null||typeof n>"u"?"":n).toLowerCase(),u=[];return r.forEach(function(d){l.includes(d)&&u.push(!0)}),a.matchAll?u.length===r.length:!!u.length},starts:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().startsWith(o.toLowerCase()):!1},ends:function(o,n,s,a){return o===null||typeof o>"u"?n===o:typeof n<"u"&&n!==null?String(n).toLowerCase().endsWith(o.toLowerCase()):!1},in:function(o,n,s,a){return Array.isArray(o)?o.length?o.indexOf(n)>-1:!0:(console.warn("Filter Error - filter value is not an array:",o),!1)}};p.prototype.registerModule("filter",V);var Ce=function(o){this.table=o};Ce.prototype.initializeColumn=function(t){t.modules.format=this.lookupFormatter(t,""),typeof t.definition.formatterPrint<"u"&&(t.modules.format.print=this.lookupFormatter(t,"Print")),typeof t.definition.formatterClipboard<"u"&&(t.modules.format.clipboard=this.lookupFormatter(t,"Clipboard")),typeof t.definition.formatterHtmlOutput<"u"&&(t.modules.format.htmlOutput=this.lookupFormatter(t,"HtmlOutput"))};Ce.prototype.lookupFormatter=function(t,o){var n={params:t.definition["formatter"+o+"Params"]||{}},s=t.definition["formatter"+o];switch(typeof s>"u"?"undefined":E(s)){case"string":s==="tick"&&(s="tickCross",typeof n.params.crossElement>"u"&&(n.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[s]?n.formatter=this.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),n.formatter=this.formatters.plaintext);break;case"function":n.formatter=s;break;default:n.formatter=this.formatters.plaintext;break}return n};Ce.prototype.cellRendered=function(t){t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered&&(t.modules.format.renderedCallback(),t.modules.format.rendered=!0)};Ce.prototype.formatValue=function(t){var o=t.getComponent(),n=typeof t.column.modules.format.params=="function"?t.column.modules.format.params(o):t.column.modules.format.params;function s(a){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=a,t.modules.format.rendered=!1}return t.column.modules.format.formatter.call(this,o,n,s)};Ce.prototype.formatExportValue=function(t,o){var n=t.column.modules.format[o],s;if(n){var a=function(l){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=l,t.modules.format.rendered=!1};return s=typeof n.params=="function"?n.params(component):n.params,n.formatter.call(this,t.getComponent(),s,a)}else return this.formatValue(t)};Ce.prototype.sanitizeHTML=function(t){if(t){var o={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(n){return o[n]})}else return t};Ce.prototype.emptyToSpace=function(t){return t===null||typeof t>"u"||t===""?" ":t};Ce.prototype.getFormatter=function(o){var o;switch(typeof o>"u"?"undefined":E(o)){case"string":this.formatters[o]?o=this.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),o=this.formatters.plaintext);break;case"function":o=o;break;default:o=this.formatters.plaintext;break}return o};Ce.prototype.formatters={plaintext:function(o,n,s){return this.emptyToSpace(this.sanitizeHTML(o.getValue()))},html:function(o,n,s){return o.getValue()},textarea:function(o,n,s){return o.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(o.getValue()))},money:function(o,n,s){var a=parseFloat(o.getValue()),r,l,u,d,c=n.decimal||".",h=n.thousand||",",m=n.symbol||"",f=!!n.symbolAfter,g=typeof n.precision<"u"?n.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(o.getValue()));for(r=g!==!1?a.toFixed(g):a,r=String(r).split("."),l=r[0],u=r.length>1?c+r[1]:"",d=/(\d+)(\d{3})/;d.test(l);)l=l.replace(d,"$1"+h+"$2");return f?l+u+m:m+l+u},link:function(o,n,s){var a=o.getValue(),r=n.urlPrefix||"",l=n.download,u=a,d=document.createElement("a"),c;if(n.labelField&&(c=o.getData(),u=c[n.labelField]),n.label)switch(E(n.label)){case"string":u=n.label;break;case"function":u=n.label(o);break}if(u){if(n.urlField&&(c=o.getData(),a=c[n.urlField]),n.url)switch(E(n.url)){case"string":a=n.url;break;case"function":a=n.url(o);break}return d.setAttribute("href",r+a),n.target&&d.setAttribute("target",n.target),n.download&&(typeof l=="function"?l=l(o):l=l===!0?"":l,d.setAttribute("download",l)),d.innerHTML=this.emptyToSpace(this.sanitizeHTML(u)),d}else return" "},image:function(o,n,s){var a=document.createElement("img"),r=o.getValue();switch(n.urlPrefix&&(r=n.urlPrefix+o.getValue()),n.urlSuffix&&(r=r+n.urlSuffix),a.setAttribute("src",r),E(n.height)){case"number":a.style.height=n.height+"px";break;case"string":a.style.height=n.height;break}switch(E(n.width)){case"number":a.style.width=n.width+"px";break;case"string":a.style.width=n.width;break}return a.addEventListener("load",function(){o.getRow().normalizeHeight()}),a},tickCross:function(o,n,s){var a=o.getValue(),r=o.getElement(),l=n.allowEmpty,u=n.allowTruthy,d=typeof n.tickElement<"u"?n.tickElement:'',c=typeof n.crossElement<"u"?n.crossElement:'';return u&&a||a===!0||a==="true"||a==="True"||a===1||a==="1"?(r.setAttribute("aria-checked",!0),d||""):l&&(a==="null"||a===""||a===null||typeof a>"u")?(r.setAttribute("aria-checked","mixed"),""):(r.setAttribute("aria-checked",!1),c||"")},datetime:function(o,n,s){var a=n.inputFormat||"YYYY-MM-DD hh:mm:ss",r=n.outputFormat||"DD/MM/YYYY hh:mm:ss",l=typeof n.invalidPlaceholder<"u"?n.invalidPlaceholder:"",u=o.getValue(),d=moment(u,a);return d.isValid()?n.timezone?d.tz(n.timezone).format(r):d.format(r):l===!0?u:typeof l=="function"?l(u):l},datetimediff:function(o,n,s){var a=n.inputFormat||"YYYY-MM-DD hh:mm:ss",r=typeof n.invalidPlaceholder<"u"?n.invalidPlaceholder:"",l=typeof n.suffix<"u"?n.suffix:!1,u=typeof n.unit<"u"?n.unit:void 0,d=typeof n.humanize<"u"?n.humanize:!1,c=typeof n.date<"u"?n.date:moment(),h=o.getValue(),m=moment(h,a);return m.isValid()?d?moment.duration(m.diff(c)).humanize(l):m.diff(c,u)+(l?" "+l:""):r===!0?h:typeof r=="function"?r(h):r},lookup:function(o,n,s){var a=o.getValue();return typeof n[a]>"u"?(console.warn("Missing display value for "+a),a):n[a]},star:function(o,n,s){var a=o.getValue(),r=o.getElement(),l=n&&n.stars?n.stars:5,u=document.createElement("span"),d=document.createElementNS("http://www.w3.org/2000/svg","svg"),c='',h='';u.style.verticalAlign="middle",d.setAttribute("width","14"),d.setAttribute("height","14"),d.setAttribute("viewBox","0 0 512 512"),d.setAttribute("xml:space","preserve"),d.style.padding="0 1px",a=a&&!isNaN(a)?parseInt(a):0,a=Math.max(0,Math.min(a,l));for(var m=1;m<=l;m++){var f=d.cloneNode(!0);f.innerHTML=m<=a?c:h,u.appendChild(f)}return r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",r.setAttribute("aria-label",a),u},traffic:function(o,n,s){var a=this.sanitizeHTML(o.getValue())||0,r=document.createElement("span"),l=n&&n.max?n.max:100,u=n&&n.min?n.min:0,d=n&&typeof n.color<"u"?n.color:["red","orange","green"],c="#666666",h,m;if(!(isNaN(a)||typeof o.getValue()>"u")){switch(r.classList.add("tabulator-traffic-light"),m=parseFloat(a)<=l?parseFloat(a):l,m=parseFloat(m)>=u?parseFloat(m):u,h=(l-u)/100,m=Math.round((m-u)/h),typeof d>"u"?"undefined":E(d)){case"string":c=d;break;case"function":c=d(a);break;case"object":if(Array.isArray(d)){var f=100/d.length,g=Math.floor(m/f);g=Math.min(g,d.length-1),g=Math.max(g,0),c=d[g];break}}return r.style.backgroundColor=c,r}},progress:function(o,n,s){var a=this.sanitizeHTML(o.getValue())||0,r=o.getElement(),l=n&&n.max?n.max:100,u=n&&n.min?n.min:0,d=n&&n.legendAlign?n.legendAlign:"center",c,h,m,f,g;switch(h=parseFloat(a)<=l?parseFloat(a):l,h=parseFloat(h)>=u?parseFloat(h):u,c=(l-u)/100,h=Math.round((h-u)/c),E(n.color)){case"string":m=n.color;break;case"function":m=n.color(a);break;case"object":if(Array.isArray(n.color)){var w=100/n.color.length,b=Math.floor(h/w);b=Math.min(b,n.color.length-1),b=Math.max(b,0),m=n.color[b];break}default:m="#2DC214"}switch(E(n.legend)){case"string":f=n.legend;break;case"function":f=n.legend(a);break;case"boolean":f=a;break;default:f=!1}switch(E(n.legendColor)){case"string":g=n.legendColor;break;case"function":g=n.legendColor(a);break;case"object":if(Array.isArray(n.legendColor)){var w=100/n.legendColor.length,b=Math.floor(h/w);b=Math.min(b,n.legendColor.length-1),b=Math.max(b,0),g=n.legendColor[b]}break;default:g="#000"}r.style.minWidth="30px",r.style.position="relative",r.setAttribute("aria-label",h);var y=document.createElement("div");if(y.style.display="inline-block",y.style.position="relative",y.style.width=h+"%",y.style.backgroundColor=m,y.style.height="100%",y.setAttribute("data-max",l),y.setAttribute("data-min",u),f){var x=document.createElement("div");x.style.position="absolute",x.style.top="4px",x.style.left=0,x.style.textAlign=d,x.style.width="100%",x.style.color=g,x.innerHTML=f}return s(function(){if(!(o instanceof U)){var M=document.createElement("div");M.style.position="absolute",M.style.top="4px",M.style.bottom="4px",M.style.left="4px",M.style.right="4px",r.appendChild(M),r=M}r.appendChild(y),f&&r.appendChild(x)}),""},color:function(o,n,s){return o.getElement().style.backgroundColor=this.sanitizeHTML(o.getValue()),""},buttonTick:function(o,n,s){return''},buttonCross:function(o,n,s){return''},rownum:function(o,n,s){return this.table.rowManager.activeRows.indexOf(o.getRow()._getSelf())+1},handle:function(o,n,s){return o.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(o,n,s){var a=document.createElement("div"),r=o.getRow()._row.modules.responsiveLayout;a.classList.add("tabulator-responsive-collapse-toggle"),a.innerHTML="+-",o.getElement().classList.add("tabulator-row-handle");function l(u){var d=r.element;r.open=u,d&&(r.open?(a.classList.add("open"),d.style.display=""):(a.classList.remove("open"),d.style.display="none"))}return a.addEventListener("click",function(u){u.stopImmediatePropagation(),l(!r.open)}),l(r.open),a},rowSelection:function(o,n,s){var a=this,r=document.createElement("input");if(r.type="checkbox",this.table.modExists("selectRow",!0))if(r.addEventListener("click",function(u){u.stopPropagation()}),typeof o.getRow=="function"){var l=o.getRow();l instanceof F?(r.addEventListener("change",function(u){l.toggleSelect()}),r.checked=l.isSelected&&l.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(l,r)):r=""}else r.addEventListener("change",function(u){a.table.modules.selectRow.selectedRows.length?a.table.deselectRow():a.table.selectRow(n.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(r);return r}};p.prototype.registerModule("format",Ce);var he=function(o){this.table=o,this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.scrollEndTimer=!1};he.prototype.reset=function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0};he.prototype.initializeColumn=function(t){var o={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(o.position=this.initializationMode,this.initializationMode=="left"?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=o):this.initializationMode="right")};he.prototype.frozenCheck=function(t){return t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup?this.frozenCheck(t.parent):t.definition.frozen};he.prototype.scrollHorizontal=function(){var t=this,o;this.active&&(clearTimeout(this.scrollEndTimer),this.scrollEndTimer=setTimeout(function(){t.layout()},100),o=this.table.rowManager.getVisibleRows(),this.calcMargins(),this.layoutColumnPosition(),this.layoutCalcRows(),o.forEach(function(n){n.type==="row"&&t.layoutRow(n)}),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)};he.prototype.calcMargins=function(){this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.columnManager.element.style.paddingRight=this.rightMargin,this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft};he.prototype.layoutCalcRows=function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow))};he.prototype.layoutColumnPosition=function(t){var o=this,n=[];this.leftColumns.forEach(function(s,a){if(s.modules.frozen.margin=o._calcSpace(o.leftColumns,a)+o.table.columnManager.scrollLeft+"px",a==o.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var r=o.getColGroupParentElement(s);n.includes(r)||(o.layoutElement(r,s),n.push(r)),s.modules.frozen.edge&&r.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else o.layoutElement(s.getElement(),s);t&&s.cells.forEach(function(l){o.layoutElement(l.getElement(!0),s)})}),this.rightColumns.forEach(function(s,a){s.modules.frozen.margin=o.rightPadding-o._calcSpace(o.rightColumns,a+1)+"px",a==o.rightColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup?o.layoutElement(o.getColGroupParentElement(s),s):o.layoutElement(s.getElement(),s),t&&s.cells.forEach(function(r){o.layoutElement(r.getElement(!0),s)})})};he.prototype.getColGroupParentElement=function(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()};he.prototype.layout=function(){var t=this;t.active&&(this.calcMargins(),t.table.rowManager.getDisplayRows().forEach(function(o){o.type==="row"&&t.layoutRow(o)}),this.layoutCalcRows(),this.layoutColumnPosition(!0),this.table.rowManager.tableElement.style.marginRight=this.rightMargin)};he.prototype.layoutRow=function(t){var o=this,n=t.getElement();n.style.paddingLeft=this.leftMargin,this.leftColumns.forEach(function(s){var a=t.getCell(s);a&&o.layoutElement(a.getElement(!0),s)}),this.rightColumns.forEach(function(s){var a=t.getCell(s);a&&o.layoutElement(a.getElement(!0),s)})};he.prototype.layoutElement=function(t,o){o.modules.frozen&&(t.style.position="absolute",t.style.left=o.modules.frozen.margin,t.classList.add("tabulator-frozen"),o.modules.frozen.edge&&t.classList.add("tabulator-frozen-"+o.modules.frozen.position))};he.prototype._calcSpace=function(t,o){for(var n=0,s=0;s-1&&o.splice(s,1)}),o};Re.prototype.freezeRow=function(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(t),this.table.rowManager.refreshActiveData("display"),this.styleRows())};Re.prototype.unfreezeRow=function(t){this.rows.indexOf(t),t.modules.frozen?(t.modules.frozen=!1,this.detachRow(t),this.table.rowManager.adjustTableSize(),this.table.rowManager.refreshActiveData("display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")};Re.prototype.detachRow=function(t){var o=this.rows.indexOf(t);if(o>-1){var n=t.getElement();n.parentNode.removeChild(n),this.rows.splice(o,1)}};Re.prototype.styleRows=function(t){var o=this;this.rows.forEach(function(n,s){o.table.rowManager.styleRow(n,s)})};p.prototype.registerModule("frozenRows",Re);var le=function(o){this._group=o,this.type="GroupComponent"};le.prototype.getKey=function(){return this._group.key};le.prototype.getField=function(){return this._group.field};le.prototype.getElement=function(){return this._group.element};le.prototype.getRows=function(){return this._group.getRows(!0)};le.prototype.getSubGroups=function(){return this._group.getSubGroups(!0)};le.prototype.getParentGroup=function(){return this._group.parent?this._group.parent.getComponent():!1};le.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._group.visible};le.prototype.isVisible=function(){return this._group.visible};le.prototype.show=function(){this._group.show()};le.prototype.hide=function(){this._group.hide()};le.prototype.toggle=function(){this._group.toggleVisibility()};le.prototype._getSelf=function(){return this._group};le.prototype.getTable=function(){return this._group.groupManager.table};var S=function(o,n,s,a,r,l,u){this.groupManager=o,this.parent=n,this.key=a,this.level=s,this.field=r,this.hasSubGroups=s-1?n?this.rows.splice(a+1,0,t):this.rows.splice(a,0,t):n?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)};S.prototype.scrollHeader=function(t){this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(o){o.scrollHeader(t)})};S.prototype.getRowIndex=function(t){};S.prototype.conformRowData=function(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t};S.prototype.removeRow=function(t){var o=this.rows.indexOf(t),n=t.getElement();o>-1&&this.rows.splice(o,1),!this.groupManager.table.options.groupValues&&!this.rows.length?(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0)):(n.parentNode&&n.parentNode.removeChild(n),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))};S.prototype.removeGroup=function(t){var o=t.level+"_"+t.key,n;this.groups[o]&&(delete this.groups[o],n=this.groupList.indexOf(t),n>-1&&this.groupList.splice(n,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))};S.prototype.getHeadersAndRows=function(t){var o=[];return o.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach(function(n){o=o.concat(n.getHeadersAndRows(t))}):(!t&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top)),o=o.concat(this.rows),!t&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom))):!this.groupList.length&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&(!t&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),o.push(this.calcs.top))),!t&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),o.push(this.calcs.bottom)))),o};S.prototype.getData=function(t,o){var n=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(function(s){n.push(s.getData(o||"data"))}),n};S.prototype.getRowCount=function(){var t=0;return this.groupList.length?this.groupList.forEach(function(o){t+=o.getRowCount()}):t=this.rows.length,t};S.prototype.toggleVisibility=function(){this.visible?this.hide():this.show()};S.prototype.hide=function(){this.visible=!1,this.groupManager.table.rowManager.getRenderMode()=="classic"&&!this.groupManager.table.options.pagination?(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(function(t){var o=t.getHeadersAndRows();o.forEach(function(n){n.detachElement()})}):this.rows.forEach(function(t){var o=t.getElement();o.parentNode.removeChild(o)}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()):this.groupManager.updateGroupRows(!0),this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!1)};S.prototype.show=function(){var t=this;if(t.visible=!0,this.groupManager.table.rowManager.getRenderMode()=="classic"&&!this.groupManager.table.options.pagination){this.element.classList.add("tabulator-group-visible");var o=t.getElement();this.groupList.length?this.groupList.forEach(function(n){var s=n.getHeadersAndRows();s.forEach(function(a){var r=a.getElement();o.parentNode.insertBefore(r,o.nextSibling),a.initialize(),o=r})}):t.rows.forEach(function(n){var s=n.getElement();o.parentNode.insertBefore(s,o.nextSibling),n.initialize(),o=s}),this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}else this.groupManager.updateGroupRows(!0);this.groupManager.table.options.groupVisibilityChanged.call(this.table,this.getComponent(),!0)};S.prototype._visSet=function(){var t=[];typeof this.visible=="function"&&(this.rows.forEach(function(o){t.push(o.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))};S.prototype.getRowGroup=function(t){var o=!1;return this.groupList.length?this.groupList.forEach(function(n){var s=n.getRowGroup(t);s&&(o=s)}):this.rows.find(function(n){return n===t})&&(o=this),o};S.prototype.getSubGroups=function(t){var o=[];return this.groupList.forEach(function(n){o.push(t?n.getComponent():n)}),o};S.prototype.getRows=function(t){var o=[];return this.rows.forEach(function(n){o.push(t?n.getComponent():n)}),o};S.prototype.generateGroupHeaderContents=function(){var t=[];for(this.rows.forEach(function(o){t.push(o.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);typeof this.elementContents=="string"?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)};S.prototype.getPath=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.unshift(this.key),this.parent&&this.parent.getPath(t),t};S.prototype.getElement=function(){this.addBindingsd=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;ts.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),t.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],t.table.modules.localize.bind("groups|item",function(r,l){t.headerGenerator[0]=function(u,d,c){return(typeof u>"u"?"":u)+"("+d+" "+(d===1?r:l.groups.items)+")"}}),this.groupIDLookups=[],Array.isArray(o)||o)this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="table"&&this.table.options.columnCalcs!="both"&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="group"){var a=this.table.columnManager.getRealColumns();a.forEach(function(r){r.definition.topCalc&&t.table.modules.columnCalcs.initializeTopRow(),r.definition.bottomCalc&&t.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(o)||(o=[o]),o.forEach(function(r,l){var u,d;typeof r=="function"?u=r:(d=t.table.columnManager.getColumnByField(r),d?u=function(h){return d.getFieldValue(h)}:u=function(h){return h[r]}),t.groupIDLookups.push({field:typeof r=="function"?!1:r,func:u,values:t.allowedValues?t.allowedValues[l]:!1})}),n&&(Array.isArray(n)||(n=[n]),n.forEach(function(r){}),t.startOpen=n),s&&(t.headerGenerator=Array.isArray(s)?s:[s]),this.initialized=!0};J.prototype.setDisplayIndex=function(t){this.displayIndex=t};J.prototype.getDisplayIndex=function(){return this.displayIndex};J.prototype.getRows=function(t){return this.groupIDLookups.length?(this.table.options.dataGrouping.call(this.table),this.generateGroups(t),this.table.options.dataGrouped&&this.table.options.dataGrouped.call(this.table,this.getGroups(!0)),this.updateGroupRows()):t.slice(0)};J.prototype.getGroups=function(t){var o=[];return this.groupList.forEach(function(n){o.push(t?n.getComponent():n)}),o};J.prototype.getChildGroups=function(t){var o=this,n=[];return t||(t=this),t.groupList.forEach(function(s){s.groupList.length?n=n.concat(o.getChildGroups(s)):n.push(s)}),n};J.prototype.wipe=function(){this.groupList.forEach(function(t){t.wipe()})};J.prototype.pullGroupListData=function(t){var o=this,n=[];return t.forEach(function(s){var a={};a.level=0,a.rowCount=0,a.headerContent="";var r=[];s.hasSubGroups?(r=o.pullGroupListData(s.groupList),a.level=s.level,a.rowCount=r.length-s.groupList.length,a.headerContent=s.generator(s.key,a.rowCount,s.rows,s),n.push(a),n=n.concat(r)):(a.level=s.level,a.headerContent=s.generator(s.key,s.rows.length,s.rows,s),a.rowCount=s.getRows().length,n.push(a),s.getRows().forEach(function(l){n.push(l.getData("data"))}))}),n};J.prototype.getGroupedData=function(){return this.pullGroupListData(this.groupList)};J.prototype.getRowGroup=function(t){var o=!1;return this.groupList.forEach(function(n){var s=n.getRowGroup(t);s&&(o=s)}),o};J.prototype.countGroups=function(){return this.groupList.length};J.prototype.generateGroups=function(t){var o=this,n=o.groups;o.groups={},o.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(function(s){o.createGroup(s,0,n)}),t.forEach(function(s){o.assignRowToExistingGroup(s,n)})):t.forEach(function(s){o.assignRowToGroup(s,n)})};J.prototype.createGroup=function(t,o,n){var s=o+"_"+t,a;n=n||[],a=new S(this,!1,o,t,this.groupIDLookups[0].field,this.headerGenerator[0],n[s]),this.groups[s]=a,this.groupList.push(a)};J.prototype.assignRowToExistingGroup=function(t,o){var n=this.groupIDLookups[0].func(t.getData()),s="0_"+n;this.groups[s]&&this.groups[s].addRow(t)};J.prototype.assignRowToGroup=function(t,o){var n=this.groupIDLookups[0].func(t.getData()),s=!this.groups["0_"+n];return s&&this.createGroup(n,0,o),this.groups["0_"+n].addRow(t),!s};J.prototype.reassignRowToGroup=function(t){var o=t.getGroup(),n=o.getPath(),s=this.getExpectedPath(t),a=!0,a=n.length==s.length&&n.every(function(r,l){return r===s[l]});a||(o.removeRow(t),this.assignRowToGroup(t,self.groups),this.table.rowManager.refreshActiveData("group",!1,!0))};J.prototype.getExpectedPath=function(t){var o=[],n=t.getData();return this.groupIDLookups.forEach(function(s){o.push(s.func(n))}),o};J.prototype.updateGroupRows=function(t){var o=this,n=[];if(o.groupList.forEach(function(a){n=n.concat(a.getHeadersAndRows())}),t){var s=o.table.rowManager.setDisplayRows(n,this.getDisplayIndex());s!==!0&&this.setDisplayIndex(s),o.table.rowManager.refreshActiveData("group",!0,!0)}return n};J.prototype.scrollHeaders=function(t){this.table.options.virtualDomHoz&&(t-=this.table.vdomHoz.vDomPadLeft),t=t+"px",this.groupList.forEach(function(o){o.scrollHeader(t)})};J.prototype.removeGroup=function(t){var o=t.level+"_"+t.key,n;this.groups[o]&&(delete this.groups[o],n=this.groupList.indexOf(t),n>-1&&this.groupList.splice(n,1))};p.prototype.registerModule("groupRows",J);var ve=function(o){this.table=o,this.history=[],this.index=-1};ve.prototype.clear=function(){this.history=[],this.index=-1};ve.prototype.action=function(t,o,n){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:o,data:n}),this.index++};ve.prototype.getHistoryUndoSize=function(){return this.index+1};ve.prototype.getHistoryRedoSize=function(){return this.history.length-(this.index+1)};ve.prototype.clearComponentHistory=function(t){var o=this.history.findIndex(function(n){return n.component===t});o>-1&&(this.history.splice(o,1),o<=this.index&&this.index--,this.clearComponentHistory(t))};ve.prototype.undo=function(){if(this.index>-1){var t=this.history[this.index];return this.undoers[t.type].call(this,t),this.index--,this.table.options.historyUndo.call(this.table,t.type,t.component.getComponent(),t.data),!0}else return console.warn("History Undo Error - No more history to undo"),!1};ve.prototype.redo=function(){if(this.history.length-1>this.index){this.index++;var t=this.history[this.index];return this.redoers[t.type].call(this,t),this.table.options.historyRedo.call(this.table,t.type,t.component.getComponent(),t.data),!0}else return console.warn("History Redo Error - No more history to redo"),!1};ve.prototype.undoers={cellEdit:function(o){o.component.setValueProcessData(o.data.oldValue)},rowAdd:function(o){o.component.deleteActual()},rowDelete:function(o){var n=this.table.rowManager.addRowActual(o.data.data,o.data.pos,o.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(o.component,n)},rowMove:function(o){this.table.rowManager.moveRowActual(o.component,this.table.rowManager.rows[o.data.posFrom],!o.data.after),this.table.rowManager.redraw()}};ve.prototype.redoers={cellEdit:function(o){o.component.setValueProcessData(o.data.newValue)},rowAdd:function(o){var n=this.table.rowManager.addRowActual(o.data.data,o.data.pos,o.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(o.component,n)},rowDelete:function(o){o.component.deleteActual()},rowMove:function(o){this.table.rowManager.moveRowActual(o.component,this.table.rowManager.rows[o.data.posTo],o.data.after),this.table.rowManager.redraw()}};ve.prototype._rebindRow=function(t,o){this.history.forEach(function(n){if(n.component instanceof T)n.component===t&&(n.component=o);else if(n.component instanceof A&&n.component.row===t){var s=n.component.column.getField();s&&(n.component=o.getCell(s))}})};p.prototype.registerModule("history",ve);var Ae=function(o){this.table=o,this.fieldIndex=[],this.hasIndex=!1};Ae.prototype.parseTable=function(){var t=this,o=t.table.element,n=t.table.options;n.columns;var s=o.getElementsByTagName("th"),a=o.getElementsByTagName("tbody")[0],r=[];t.hasIndex=!1,t.table.options.htmlImporting.call(this.table),a=a?a.getElementsByTagName("tr"):[],t._extractOptions(o,n),s.length?t._extractHeaders(s,a):t._generateBlankHeaders(s,a);for(var l=0;l"u"?"undefined":E(u))=="object"&&u.name&&u.name.indexOf("tabulator-")===0&&(d=u.name.replace("tabulator-",""),typeof r[d]<"u"&&(o[r[d]]=this._attribValue(u.value)))}};Ae.prototype._attribValue=function(t){return t==="true"?!0:t==="false"?!1:t};Ae.prototype._findCol=function(t){var o=this.table.options.columns.find(function(n){return n.title===t});return o||!1};Ae.prototype._extractHeaders=function(t,o){for(var n=0;n-1&&t.pressedKeys.splice(a,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)};Me.prototype.clearBindings=function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)};Me.prototype.checkBinding=function(t,o){var n=this,s=!0;return t.ctrlKey==o.ctrl&&t.shiftKey==o.shift&&t.metaKey==o.meta?(o.keys.forEach(function(a){var r=n.pressedKeys.indexOf(a);r==-1&&(s=!1)}),s&&o.action.call(n,t),!0):!1};Me.prototype.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:"ctrl + 90",redo:"ctrl + 89",copyToClipboard:"ctrl + 67"};Me.prototype.actions={keyBlock:function(o){o.stopPropagation(),o.preventDefault()},scrollPageUp:function(o){var n=this.table.rowManager,s=n.scrollTop-n.height;n.element.scrollHeight,o.preventDefault(),n.displayRowsCount&&(s>=0?n.element.scrollTop=s:n.scrollToRow(n.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(o){var n=this.table.rowManager,s=n.scrollTop+n.height,a=n.element.scrollHeight;o.preventDefault(),n.displayRowsCount&&(s<=a?n.element.scrollTop=s:n.scrollToRow(n.getDisplayRows()[n.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(o){var n=this.table.rowManager;o.preventDefault(),n.displayRowsCount&&n.scrollToRow(n.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(o){var n=this.table.rowManager;o.preventDefault(),n.displayRowsCount&&n.scrollToRow(n.getDisplayRows()[n.displayRowsCount-1]),this.table.element.focus()},navPrev:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().prev()))},navNext:function(o){var n=!1,s=this.table.options.tabEndNewRow,a;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),a=n.nav(),a.next()||s&&(n.getElement().firstChild.blur(),s===!0?s=this.table.addRow({}):typeof s=="function"?s=this.table.addRow(s(n.row.getComponent())):s=this.table.addRow(Object.assign({},s)),s.then(function(){setTimeout(function(){a.next()})}))))},navLeft:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().left()))},navRight:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().right()))},navUp:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().up()))},navDown:function(o){var n=!1;this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n&&(o.preventDefault(),n.nav().down()))},undo:function(o){var n=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n||(o.preventDefault(),this.table.modules.history.undo()))},redo:function(o){var n=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(n=this.table.modules.edit.currentCell,n||(o.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(o){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};p.prototype.registerModule("keybindings",Me);var ue=function(o){this.table=o,this.menuElements=[],this.blurEvent=this.hideMenu.bind(this),this.escEvent=this.escMenu.bind(this),this.nestedMenuBlock=!1,this.positionReversedX=!1};ue.prototype.initializeColumnHeader=function(t){var o=this,n;t.definition.headerContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.definition.headerContextMenu)),this.tapHold(t,t.definition.headerContextMenu)),t.definition.headerMenu&&(n=document.createElement("span"),n.classList.add("tabulator-header-menu-button"),n.innerHTML="⋮",n.addEventListener("click",function(s){s.stopPropagation(),s.preventDefault(),o.LoadMenuEvent(t,t.definition.headerMenu,s)}),t.titleElement.insertBefore(n,t.titleElement.firstChild))};ue.prototype.LoadMenuEvent=function(t,o,n){o=typeof o=="function"?o.call(this.table,t.getComponent(),n):o,this.loadMenu(n,t,o)};ue.prototype.tapHold=function(t,o){var n=this,s=t.getElement(),a=null,r=!1;s.addEventListener("touchstart",function(l){clearTimeout(a),r=!1,a=setTimeout(function(){clearTimeout(a),a=null,r=!0,n.LoadMenuEvent(t,o,l)},1e3)},{passive:!0}),s.addEventListener("touchend",function(l){clearTimeout(a),a=null,r&&l.preventDefault()})};ue.prototype.initializeCell=function(t){t.column.definition.contextMenu&&(t.getElement(!0).addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,t.column.definition.contextMenu)),this.tapHold(t,t.column.definition.contextMenu)),t.column.definition.clickMenu&&t.getElement(!0).addEventListener("click",this.LoadMenuEvent.bind(this,t,t.column.definition.clickMenu))};ue.prototype.initializeRow=function(t){this.table.options.rowContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.rowContextMenu)),this.tapHold(t,this.table.options.rowContextMenu)),this.table.options.rowClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.rowClickMenu))};ue.prototype.initializeGroup=function(t){this.table.options.groupContextMenu&&(t.getElement().addEventListener("contextmenu",this.LoadMenuEvent.bind(this,t,this.table.options.groupContextMenu)),this.tapHold(t,this.table.options.groupContextMenu)),this.table.options.groupClickMenu&&t.getElement().addEventListener("click",this.LoadMenuEvent.bind(this,t,this.table.options.groupClickMenu))};ue.prototype.loadMenu=function(t,o,n,s){var a=this,r=!(t instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),r||t.preventDefault(),!(!n||!n.length)){if(!s){if(this.nestedMenuBlock){if(this.isOpen())return}else this.nestedMenuBlock=setTimeout(function(){a.nestedMenuBlock=!1},100);this.hideMenu(),this.menuElements=[]}n.forEach(function(u){var d=document.createElement("div"),c=u.label,h=u.disabled;u.separator?d.classList.add("tabulator-menu-separator"):(d.classList.add("tabulator-menu-item"),typeof c=="function"&&(c=c.call(a.table,o.getComponent())),c instanceof Node?d.appendChild(c):d.innerHTML=c,typeof h=="function"&&(h=h.call(a.table,o.getComponent())),h?(d.classList.add("tabulator-menu-item-disabled"),d.addEventListener("click",function(m){m.stopPropagation()})):u.menu&&u.menu.length?d.addEventListener("click",function(m){m.stopPropagation(),a.hideOldSubMenus(l),a.loadMenu(m,o,u.menu,d)}):u.action&&d.addEventListener("click",function(m){u.action(m,o.getComponent())}),u.menu&&u.menu.length&&d.classList.add("tabulator-menu-item-submenu")),l.appendChild(d)}),l.addEventListener("click",function(u){a.hideMenu()}),this.menuElements.push(l),this.positionMenu(l,s,r,t)}};ue.prototype.hideOldSubMenus=function(t){var o=this.menuElements.indexOf(t);if(o>-1)for(var n=this.menuElements.length-1;n>o;n--){var s=this.menuElements[n];s.parentNode&&s.parentNode.removeChild(s),this.menuElements.pop()}};ue.prototype.positionMenu=function(t,o,n,s){var a=this,r=Math.max(document.body.offsetHeight,window.innerHeight),l,u,d;o?(d=p.prototype.helpers.elOffset(o),l=d.left+o.offsetWidth,u=d.top-1):(l=n?s.touches[0].pageX:s.pageX,u=n?s.touches[0].pageY:s.pageY,this.positionReversedX=!1),t.style.top=u+"px",t.style.left=l+"px",setTimeout(function(){a.table.rowManager.element.addEventListener("scroll",a.blurEvent),document.body.addEventListener("click",a.blurEvent),document.body.addEventListener("contextmenu",a.blurEvent),window.addEventListener("resize",a.blurEvent),document.body.addEventListener("keydown",a.escEvent)},100),document.body.appendChild(t),u+t.offsetHeight>=r&&(t.style.top="",o?t.style.bottom=r-d.top-o.offsetHeight-1+"px":t.style.bottom=r-u+"px"),(l+t.offsetWidth>=document.body.offsetWidth||this.positionReversedX)&&(t.style.left="",o?t.style.right=document.documentElement.offsetWidth-d.left+"px":t.style.right=document.documentElement.offsetWidth-l+"px",this.positionReversedX=!0)};ue.prototype.isOpen=function(){return!!this.menuElements.length};ue.prototype.escMenu=function(t){t.keyCode==27&&this.hideMenu()};ue.prototype.hideMenu=function(){this.menuElements.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)}),document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent)};ue.prototype.menus={};p.prototype.registerModule("menu",ue);var xe=function(o){this.table=o,this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this)};xe.prototype.createPlaceholderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t};xe.prototype.initializeColumn=function(t){var o=this,n={},s;t.modules.frozen||(s=t.getElement(),n.mousemove=(function(a){t.parent===o.moving.parent&&((o.touchMove?a.touches[0].pageX:a.pageX)-p.prototype.helpers.elOffset(s).left+o.table.columnManager.element.scrollLeft>t.getWidth()/2?(o.toCol!==t||!o.toColAfter)&&(s.parentNode.insertBefore(o.placeholderElement,s.nextSibling),o.moveColumn(t,!0)):(o.toCol!==t||o.toColAfter)&&(s.parentNode.insertBefore(o.placeholderElement,s),o.moveColumn(t,!1)))}).bind(o),s.addEventListener("mousedown",function(a){o.touchMove=!1,a.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(a,t)},o.checkPeriod))}),s.addEventListener("mouseup",function(a){a.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),o.bindTouchEvents(t)),t.modules.moveColumn=n};xe.prototype.bindTouchEvents=function(t){var o=this,n=t.getElement(),s=!1,a,r,l,u,d,c;n.addEventListener("touchstart",function(h){o.checkTimeout=setTimeout(function(){o.touchMove=!0,a=t.nextColumn(),l=a?a.getWidth()/2:0,r=t.prevColumn(),u=r?r.getWidth()/2:0,d=0,c=0,s=!1,o.startMove(h,t)},o.checkPeriod)},{passive:!0}),n.addEventListener("touchmove",function(h){var m,f;o.moving&&(o.moveHover(h),s||(s=h.touches[0].pageX),m=h.touches[0].pageX-s,m>0?a&&m-d>l&&(f=a,f!==t&&(s=h.touches[0].pageX,f.getElement().parentNode.insertBefore(o.placeholderElement,f.getElement().nextSibling),o.moveColumn(f,!0))):r&&-m-c>u&&(f=r,f!==t&&(s=h.touches[0].pageX,f.getElement().parentNode.insertBefore(o.placeholderElement,f.getElement()),o.moveColumn(f,!1))),f&&(a=f.nextColumn(),d=l,l=a?a.getWidth()/2:0,r=f.prevColumn(),c=u,u=r?r.getWidth()/2:0))},{passive:!0}),n.addEventListener("touchend",function(h){o.checkTimeout&&clearTimeout(o.checkTimeout),o.moving&&o.endMove(h)})};xe.prototype.startMove=function(t,o){var n=o.getElement();this.moving=o,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-p.prototype.helpers.elOffset(n).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=o.getWidth()+"px",this.placeholderElement.style.height=o.getHeight()+"px",n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom="0",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)};xe.prototype._bindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})};xe.prototype._unbindMouseMove=function(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})};xe.prototype.moveColumn=function(t,o){var n=this.moving.getCells();this.toCol=t,this.toColAfter=o,o?t.getCells().forEach(function(s,a){var r=s.getElement(!0);r.parentNode.insertBefore(n[a].getElement(),r.nextSibling)}):t.getCells().forEach(function(s,a){var r=s.getElement(!0);r.parentNode.insertBefore(n[a].getElement(),r)})};xe.prototype.endMove=function(t){(t.which===1||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))};xe.prototype.moveHover=function(t){var o=this,n=o.table.columnManager.getElement(),s=n.scrollLeft,a=(o.touchMove?t.touches[0].pageX:t.pageX)-p.prototype.helpers.elOffset(n).left+s,r;o.hoverElement.style.left=a-o.startX+"px",a-st.getHeight()/2){if(o.toRow!==t||!o.toRowAfter){var a=t.getElement();a.parentNode.insertBefore(o.placeholderElement,a.nextSibling),o.moveRow(t,!0)}}else if(o.toRow!==t||o.toRowAfter){var a=t.getElement();a.previousSibling&&(a.parentNode.insertBefore(o.placeholderElement,a),o.moveRow(t,!1))}}).bind(o),t.modules.moveRow=n};B.prototype.initializeRow=function(t){var o=this,n={},s;n.mouseup=(function(a){o.tableRowDrop(a,t)}).bind(o),n.mousemove=(function(a){var r=t.getElement();a.pageY-p.prototype.helpers.elOffset(r).top+o.table.rowManager.element.scrollTop>t.getHeight()/2?(o.toRow!==t||!o.toRowAfter)&&(r.parentNode.insertBefore(o.placeholderElement,r.nextSibling),o.moveRow(t,!0)):(o.toRow!==t||o.toRowAfter)&&(r.parentNode.insertBefore(o.placeholderElement,r),o.moveRow(t,!1))}).bind(o),this.hasHandle||(s=t.getElement(),s.addEventListener("mousedown",function(a){a.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(a,t)},o.checkPeriod))}),s.addEventListener("mouseup",function(a){a.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=n};B.prototype.initializeCell=function(t){var o=this,n=t.getElement(!0);n.addEventListener("mousedown",function(s){s.which===1&&(o.checkTimeout=setTimeout(function(){o.startMove(s,t.row)},o.checkPeriod))}),n.addEventListener("mouseup",function(s){s.which===1&&o.checkTimeout&&clearTimeout(o.checkTimeout)}),this.bindTouchEvents(t.row,n)};B.prototype.bindTouchEvents=function(t,o){var n=this,s=!1,a,r,l,u,d,c;o.addEventListener("touchstart",function(h){n.checkTimeout=setTimeout(function(){n.touchMove=!0,a=t.nextRow(),l=a?a.getHeight()/2:0,r=t.prevRow(),u=r?r.getHeight()/2:0,d=0,c=0,s=!1,n.startMove(h,t)},n.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,o.addEventListener("touchmove",function(h){var m,f;n.moving&&(h.preventDefault(),n.moveHover(h),s||(s=h.touches[0].pageY),m=h.touches[0].pageY-s,m>0?a&&m-d>l&&(f=a,f!==t&&(s=h.touches[0].pageY,f.getElement().parentNode.insertBefore(n.placeholderElement,f.getElement().nextSibling),n.moveRow(f,!0))):r&&-m-c>u&&(f=r,f!==t&&(s=h.touches[0].pageY,f.getElement().parentNode.insertBefore(n.placeholderElement,f.getElement()),n.moveRow(f,!1))),f&&(a=f.nextRow(),d=l,l=a?a.getHeight()/2:0,r=f.prevRow(),c=u,u=r?r.getHeight()/2:0))}),o.addEventListener("touchend",function(h){n.checkTimeout&&clearTimeout(n.checkTimeout),n.moving&&(n.endMove(h),n.touchMove=!1)})};B.prototype._bindMouseMove=function(){var t=this;t.table.rowManager.getDisplayRows().forEach(function(o){(o.type==="row"||o.type==="group")&&o.modules.moveRow.mousemove&&o.getElement().addEventListener("mousemove",o.modules.moveRow.mousemove)})};B.prototype._unbindMouseMove=function(){var t=this;t.table.rowManager.getDisplayRows().forEach(function(o){(o.type==="row"||o.type==="group")&&o.modules.moveRow.mousemove&&o.getElement().removeEventListener("mousemove",o.modules.moveRow.mousemove)})};B.prototype.startMove=function(t,o){var n=o.getElement();this.setStartPosition(t,o),this.moving=o,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=o.getWidth()+"px",this.placeholderElement.style.height=o.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(o)):(n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n)),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.moveHover(t)};B.prototype.setStartPosition=function(t,o){var n=this.touchMove?t.touches[0].pageX:t.pageX,s=this.touchMove?t.touches[0].pageY:t.pageY,a,r;a=o.getElement(),this.connection?(r=a.getBoundingClientRect(),this.startX=r.left-n+window.pageXOffset,this.startY=r.top-s+window.pageYOffset):this.startY=s-a.getBoundingClientRect().top};B.prototype.endMove=function(t){(!t||t.which===1||this.touchMove)&&(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow&&this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))};B.prototype.moveRow=function(t,o){this.toRow=t,this.toRowAfter=o};B.prototype.moveHover=function(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)};B.prototype.moveHoverTable=function(t){var o=this.table.rowManager.getElement(),n=o.scrollTop,s=(this.touchMove?t.touches[0].pageY:t.pageY)-o.getBoundingClientRect().top+n;this.hoverElement.style.top=s-this.startY+"px"};B.prototype.moveHoverConnections=function(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"};B.prototype.elementRowDrop=function(t,o,n){this.table.options.movableRowsElementDrop&&this.table.options.movableRowsElementDrop(t,o,n?n.getComponent():!1)};B.prototype.connectToTables=function(t){var o=this,n;this.connectionSelectorsTables&&(n=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStart.call(this.table,n),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","connect",{row:t})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(function(s){typeof s=="string"?o.connectionElements=o.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(s))):o.connectionElements.push(s)}),this.connectionElements.forEach(function(s){var a=function(l){o.elementRowDrop(l,s,o.moving)};s.addEventListener("mouseup",a),s.tabulatorElementDropEvent=a,s.classList.add("tabulator-movingrow-receiving")}))};B.prototype.disconnectFromTables=function(){var t;this.connectionSelectorsTables&&(t=this.table.modules.comms.getConnections(this.connectionSelectorsTables),this.table.options.movableRowsSendingStop.call(this.table,t),this.table.modules.comms.send(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(function(o){o.classList.remove("tabulator-movingrow-receiving"),o.removeEventListener("mouseup",o.tabulatorElementDropEvent),delete o.tabulatorElementDropEvent})};B.prototype.connect=function(t,o){var n=this;return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=o,this.table.element.classList.add("tabulator-movingrow-receiving"),n.table.rowManager.getDisplayRows().forEach(function(s){s.type==="row"&&s.modules.moveRow&&s.modules.moveRow.mouseup&&s.getElement().addEventListener("mouseup",s.modules.moveRow.mouseup)}),n.tableRowDropEvent=n.tableRowDrop.bind(n),n.table.element.addEventListener("mouseup",n.tableRowDropEvent),this.table.options.movableRowsReceivingStart.call(this.table,o,t),!0)};B.prototype.disconnect=function(t){var o=this;t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),o.table.rowManager.getDisplayRows().forEach(function(n){n.type==="row"&&n.modules.moveRow&&n.modules.moveRow.mouseup&&n.getElement().removeEventListener("mouseup",n.modules.moveRow.mouseup)}),o.table.element.removeEventListener("mouseup",o.tableRowDropEvent),this.table.options.movableRowsReceivingStop.call(this.table,t)):console.warn("Move Row Error - trying to disconnect from non connected table")};B.prototype.dropComplete=function(t,o,n){var s=!1;if(n){switch(E(this.table.options.movableRowsSender)){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender;break}s?s.call(this,this.moving.getComponent(),o?o.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.table.options.movableRowsSent.call(this.table,this.moving.getComponent(),o?o.getComponent():void 0,t)}else this.table.options.movableRowsSentFailed.call(this.table,this.moving.getComponent(),o?o.getComponent():void 0,t);this.endMove()};B.prototype.tableRowDrop=function(t,o){var n=!1,s=!1;switch(t.stopImmediatePropagation(),E(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver;break}n?s=n.call(this,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.table.options.movableRowsReceived.call(this.table,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable):this.table.options.movableRowsReceivedFailed.call(this.table,this.connectedRow.getComponent(),o?o.getComponent():void 0,this.connectedTable),this.table.modules.comms.send(this.connectedTable,"moveRow","dropcomplete",{row:o,success:s})};B.prototype.receivers={insert:function(o,n,s){return this.table.addRow(o.getData(),void 0,n),!0},add:function(o,n,s){return this.table.addRow(o.getData()),!0},update:function(o,n,s){return n?(n.update(o.getData()),!0):!1},replace:function(o,n,s){return n?(this.table.addRow(o.getData(),void 0,n),n.delete(),!0):!1}};B.prototype.senders={delete:function(o,n,s){o.delete()}};B.prototype.commsReceived=function(t,o,n){switch(o){case"connect":return this.connect(t,n.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,n.row,n.success)}};p.prototype.registerModule("moveRow",B);var ze=function(o){this.table=o,this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0};ze.prototype.initializeColumn=function(t){var o=this,n=!1,s={};this.allowedTypes.forEach(function(a){var r="mutator"+(a.charAt(0).toUpperCase()+a.slice(1)),l;t.definition[r]&&(l=o.lookupMutator(t.definition[r]),l&&(n=!0,s[r]={mutator:l,params:t.definition[r+"Params"]||{}}))}),n&&(t.modules.mutate=s)};ze.prototype.lookupMutator=function(t){var o=!1;switch(typeof t>"u"?"undefined":E(t)){case"string":this.mutators[t]?o=this.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":o=t;break}return o};ze.prototype.transformRow=function(t,o,n){var s=this,a="mutator"+(o.charAt(0).toUpperCase()+o.slice(1)),r;return this.enabled&&s.table.columnManager.traverse(function(l){var u,d,c;l.modules.mutate&&(u=l.modules.mutate[a]||l.modules.mutate.mutator||!1,u&&(r=l.getFieldValue(typeof n<"u"?n:t),(o=="data"||typeof r<"u")&&(c=l.getComponent(),d=typeof u.params=="function"?u.params(r,t,o,c):u.params,l.setFieldValue(t,u.mutator(r,t,o,d,c)))))}),t};ze.prototype.transformCell=function(t,o){var n=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,s={};return n?(s=Object.assign(s,t.row.getData()),t.column.setFieldValue(s,o),n.mutator(o,s,"edit",n.params,t.getComponent())):o};ze.prototype.enable=function(){this.enabled=!0};ze.prototype.disable=function(){this.enabled=!1};ze.prototype.mutators={};p.prototype.registerModule("mutator",ze);var I=function(o){this.table=o,this.mode="local",this.progressiveLoad=!1,this.size=0,this.page=1,this.count=5,this.max=1,this.displayIndex=0,this.initialLoad=!0,this.pageSizes=[],this.dataReceivedNames={},this.dataSentNames={},this.createElements()};I.prototype.createElements=function(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),t=document.createElement("button"),t.classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))};I.prototype.generatePageSizeSelectList=function(){var t=this,o=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))o=this.table.options.paginationSizeSelector,this.pageSizes=o,this.pageSizes.indexOf(this.size)==-1&&o.unshift(this.size);else if(this.pageSizes.indexOf(this.size)==-1){o=[];for(var n=1;n<5;n++)o.push(this.size*n);this.pageSizes=o}else o=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);o.forEach(function(s){var a=document.createElement("option");a.value=s,s===!0?t.table.modules.localize.bind("pagination|all",function(r){a.innerHTML=r}):a.innerHTML=s,t.pageSizeSelect.appendChild(a)}),this.pageSizeSelect.value=this.size}};I.prototype.initialize=function(t){var o=this,n,s,a;this.dataSentNames=Object.assign({},this.paginationDataSentNames),this.dataSentNames=Object.assign(this.dataSentNames,this.table.options.paginationDataSent),this.dataReceivedNames=Object.assign({},this.paginationDataReceivedNames),this.dataReceivedNames=Object.assign(this.dataReceivedNames,this.table.options.paginationDataReceived),o.table.modules.localize.bind("pagination|first",function(r){o.firstBut.innerHTML=r}),o.table.modules.localize.bind("pagination|first_title",function(r){o.firstBut.setAttribute("aria-label",r),o.firstBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|prev",function(r){o.prevBut.innerHTML=r}),o.table.modules.localize.bind("pagination|prev_title",function(r){o.prevBut.setAttribute("aria-label",r),o.prevBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|next",function(r){o.nextBut.innerHTML=r}),o.table.modules.localize.bind("pagination|next_title",function(r){o.nextBut.setAttribute("aria-label",r),o.nextBut.setAttribute("title",r)}),o.table.modules.localize.bind("pagination|last",function(r){o.lastBut.innerHTML=r}),o.table.modules.localize.bind("pagination|last_title",function(r){o.lastBut.setAttribute("aria-label",r),o.lastBut.setAttribute("title",r)}),o.firstBut.addEventListener("click",function(){o.setPage(1).then(function(){}).catch(function(){})}),o.prevBut.addEventListener("click",function(){o.previousPage().then(function(){}).catch(function(){})}),o.nextBut.addEventListener("click",function(){o.nextPage().then(function(){}).catch(function(){})}),o.lastBut.addEventListener("click",function(){o.setPage(o.max).then(function(){}).catch(function(){})}),o.table.options.paginationElement&&(o.element=o.table.options.paginationElement),this.pageSizeSelect&&(n=document.createElement("label"),o.table.modules.localize.bind("pagination|page_size",function(r){o.pageSizeSelect.setAttribute("aria-label",r),o.pageSizeSelect.setAttribute("title",r),n.innerHTML=r}),o.element.appendChild(n),o.element.appendChild(o.pageSizeSelect),o.pageSizeSelect.addEventListener("change",function(r){o.setPageSize(o.pageSizeSelect.value=="true"?!0:o.pageSizeSelect.value),o.setPage(1).then(function(){}).catch(function(){})})),o.element.appendChild(o.firstBut),o.element.appendChild(o.prevBut),o.element.appendChild(o.pagesElement),o.element.appendChild(o.nextBut),o.element.appendChild(o.lastBut),!o.table.options.paginationElement&&!t&&o.table.footerManager.append(o.element,o),o.mode=o.table.options.pagination,o.table.options.paginationSize?o.size=o.table.options.paginationSize:(s=document.createElement("div"),s.classList.add("tabulator-row"),s.style.visibility=t,a=document.createElement("div"),a.classList.add("tabulator-cell"),a.innerHTML="Page Row Test",s.appendChild(a),o.table.rowManager.getTableElement().appendChild(s),o.size=Math.floor(o.table.rowManager.getElement().clientHeight/s.offsetHeight),o.table.rowManager.getTableElement().removeChild(s)),o.count=o.table.options.paginationButtonCount,o.generatePageSizeSelectList()};I.prototype.initializeProgressive=function(t){this.initialize(!0),this.mode="progressive_"+t,this.progressiveLoad=!0};I.prototype.setDisplayIndex=function(t){this.displayIndex=t};I.prototype.getDisplayIndex=function(){return this.displayIndex};I.prototype.setMaxRows=function(t){t?this.max=this.size===!0?1:Math.ceil(t/this.size):this.max=1,this.page>this.max&&(this.page=this.max)};I.prototype.reset=function(t,o){return(this.mode=="local"||t)&&(this.page=1),o&&(this.initialLoad=!0),!0};I.prototype.setMaxPage=function(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())};I.prototype.setPage=function(t){var o=this,n=this;switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return new Promise(function(s,a){t=parseInt(t),t>0&&t<=o.max||o.mode!=="local"?(o.page=t,o.trigger().then(function(){s()}).catch(function(){a()}),n.table.options.persistence&&n.table.modExists("persistence",!0)&&n.table.modules.persistence.config.page&&n.table.modules.persistence.save("page")):(console.warn("Pagination Error - Requested page is out of range of 1 - "+o.max+":",t),a())})};I.prototype.setPageToRow=function(t){var o=this;return new Promise(function(n,s){var a=o.table.rowManager.getDisplayRows(o.displayIndex-1),r=a.indexOf(t);if(r>-1){var l=o.size===!0?1:Math.ceil((r+1)/o.size);o.setPage(l).then(function(){n()}).catch(function(){s()})}else console.warn("Pagination Error - Requested row is not visible"),s()})};I.prototype.setPageSize=function(t){t!==!0&&(t=parseInt(t)),t>0&&(this.size=t),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.page&&this.table.modules.persistence.save("page")};I.prototype._setPageButtons=function(){for(var t=this,o=Math.floor((this.count-1)/2),n=Math.ceil((this.count-1)/2),s=this.max-this.page+o+10&&r<=t.max&&t.pagesElement.appendChild(t._generatePageButton(r));this.footerRedraw()};I.prototype._generatePageButton=function(t){var o=this,n=document.createElement("button");return n.classList.add("tabulator-page"),t==o.page&&n.classList.add("active"),n.setAttribute("type","button"),n.setAttribute("role","button"),o.table.modules.localize.bind("pagination|page_title",function(s){n.setAttribute("aria-label",s+" "+t),n.setAttribute("title",s+" "+t)}),n.setAttribute("data-page",t),n.textContent=t,n.addEventListener("click",function(s){o.setPage(t).then(function(){}).catch(function(){})}),n};I.prototype.previousPage=function(){var t=this;return new Promise(function(o,n){t.page>1?(t.page--,t.trigger().then(function(){o()}).catch(function(){n()}),t.table.options.persistence&&t.table.modExists("persistence",!0)&&t.table.modules.persistence.config.page&&t.table.modules.persistence.save("page")):(console.warn("Pagination Error - Previous page would be less than page 1:",0),n())})};I.prototype.nextPage=function(){var t=this;return new Promise(function(o,n){t.page"u"&&console.warn("Remote Pagination Error - Server response missing '"+this.dataReceivedNames.last_page+"' property"),s[this.dataReceivedNames.data]){if(this.max=parseInt(s[this.dataReceivedNames.last_page])||1,this.progressiveLoad)switch(this.mode){case"progressive_load":this.page==1?this.table.rowManager.setData(s[this.dataReceivedNames.data],!1,this.initialLoad&&this.page==1):this.table.rowManager.addRows(s[this.dataReceivedNames.data]),this.pager?s.splice(r,0,a):s.push(a))}),s};ne.prototype._findColumn=function(t,o){var n=o.columns?"group":o.field?"field":"object";return t.find(function(s){switch(n){case"group":return s.title===o.title&&s.columns.length===o.columns.length;case"field":return s.field===o.field;case"object":return s===o}})};ne.prototype.save=function(t){var o={};switch(t){case"columns":o=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":o=this.table.modules.filter.getFilters();break;case"sort":o=this.validateSorters(this.table.modules.sort.getSort());break;case"group":o=this.getGroupConfig();break;case"page":o=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,t,o)};ne.prototype.validateSorters=function(t){return t.forEach(function(o){o.column=o.field,delete o.field}),t};ne.prototype.getGroupConfig=function(){var t={};return this.config.group&&((this.config.group===!0||this.config.group.groupBy)&&(t.groupBy=this.table.options.groupBy),(this.config.group===!0||this.config.group.groupStartOpen)&&(t.groupStartOpen=this.table.options.groupStartOpen),(this.config.group===!0||this.config.group.groupHeader)&&(t.groupHeader=this.table.options.groupHeader)),t};ne.prototype.getPageConfig=function(){var t={};return this.config.page&&((this.config.page===!0||this.config.page.size)&&(t.paginationSize=this.table.modules.page.getPageSize()),(this.config.page===!0||this.config.page.page)&&(t.paginationInitialPage=this.table.modules.page.getPage())),t};ne.prototype.parseColumns=function(t){var o=this,n=[],s=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach(function(a){var r={},l=a.getDefinition(),u;a.isGroup?(r.title=l.title,r.columns=o.parseColumns(a.getColumns())):(r.field=a.getField(),o.config.columns===!0||o.config.columns==null?(u=Object.keys(l),u.push("width")):u=o.config.columns,u.forEach(function(d){switch(d){case"width":r.width=a.getWidth();break;case"visible":r.visible=a.visible;break;default:typeof l[d]!="function"&&s.indexOf(d)===-1&&(r[d]=l[d])}})),n.push(r)}),n};ne.prototype.readers={local:function(o,n){var s=localStorage.getItem(o+"-"+n);return s?JSON.parse(s):!1},cookie:function(o,n){var s=document.cookie,a=o+"-"+n,r=s.indexOf(a+"="),l,u;return r>-1&&(s=s.substr(r),l=s.indexOf(";"),l>-1&&(s=s.substr(0,l)),u=s.replace(a+"=","")),u?JSON.parse(u):!1}};ne.prototype.writers={local:function(o,n,s){localStorage.setItem(o+"-"+n,JSON.stringify(s))},cookie:function(o,n,s){var a=new Date;a.setDate(a.getDate()+1e4),document.cookie=o+"-"+n+"="+JSON.stringify(s)+"; expires="+a.toUTCString()}};p.prototype.registerModule("persistence",ne);var Ie=function(o){this.table=o,this.element=!1,this.manualBlock=!1};Ie.prototype.initialize=function(){window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))};Ie.prototype.replaceTable=function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.genereateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))};Ie.prototype.cleanup=function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")};Ie.prototype.printFullscreen=function(t,o,n){var s=window.scrollX,a=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.genereateTable(typeof n<"u"?n:this.table.options.printConfig,typeof o<"u"?o:this.table.options.printStyled,t,"print"),d,c;this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),d=typeof this.table.options.printHeader=="function"?this.table.options.printHeader.call(this.table):this.table.options.printHeader,typeof d=="string"?r.innerHTML=d:r.appendChild(d),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),c=typeof this.table.options.printFooter=="function"?this.table.options.printFooter.call(this.table):this.table.options.printFooter,typeof c=="string"?l.innerHTML=c:l.appendChild(c),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(s,a),this.manualBlock=!1};p.prototype.registerModule("print",Ie);var Le=function(o){this.table=o,this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0};Le.prototype.watchData=function(t){var o=this,n;this.currentVersion++,n=this.currentVersion,o.unwatchData(),o.data=t,o.origFuncs.push=t.push,Object.defineProperty(o.data,"push",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments);return!o.blocked&&n===o.currentVersion&&a.forEach(function(r){o.table.rowManager.addRowActual(r,!1)}),o.origFuncs.push.apply(t,arguments)}}),o.origFuncs.unshift=t.unshift,Object.defineProperty(o.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments);return!o.blocked&&n===o.currentVersion&&a.forEach(function(r){o.table.rowManager.addRowActual(r,!0)}),o.origFuncs.unshift.apply(t,arguments)}}),o.origFuncs.shift=t.shift,Object.defineProperty(o.data,"shift",{enumerable:!1,configurable:!0,value:function(){var a;return!o.blocked&&n===o.currentVersion&&o.data.length&&(a=o.table.rowManager.getRowFromDataObject(o.data[0]),a&&a.deleteActual()),o.origFuncs.shift.call(t)}}),o.origFuncs.pop=t.pop,Object.defineProperty(o.data,"pop",{enumerable:!1,configurable:!0,value:function(){var a;return!o.blocked&&n===o.currentVersion&&o.data.length&&(a=o.table.rowManager.getRowFromDataObject(o.data[o.data.length-1]),a&&a.deleteActual()),o.origFuncs.pop.call(t)}}),o.origFuncs.splice=t.splice,Object.defineProperty(o.data,"splice",{enumerable:!1,configurable:!0,value:function(){var a=Array.from(arguments),r=a[0]<0?t.length+a[0]:a[0],l=a[1],u=a[2]?a.slice(2):!1,d;if(!o.blocked&&n===o.currentVersion){if(u&&(d=t[r]?o.table.rowManager.getRowFromDataObject(t[r]):!1,d?u.forEach(function(h){o.table.rowManager.addRowActual(h,!0,d,!0)}):(u=u.slice().reverse(),u.forEach(function(h){o.table.rowManager.addRowActual(h,!0,!1,!0)}))),l!==0){var c=t.slice(r,typeof a[1]>"u"?a[1]:r+l);c.forEach(function(h,m){var f=o.table.rowManager.getRowFromDataObject(h);f&&f.deleteActual(m!==c.length-1)})}(u||l!==0)&&o.table.rowManager.reRenderInPosition()}return o.origFuncs.splice.apply(t,arguments)}})};Le.prototype.unwatchData=function(){if(this.data!==!1)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})};Le.prototype.watchRow=function(t){var o=t.getData();this.blocked=!0;for(var n in o)this.watchKey(t,o,n);this.table.options.dataTree&&this.watchTreeChildren(t),this.blocked=!1};Le.prototype.watchTreeChildren=function(t){var o=this,n=t.getData()[this.table.options.dataTreeChildField],s={};function a(){o.table.modules.dataTree.initializeRow(t),o.table.modules.dataTree.layoutRow(t),o.table.rowManager.refreshActiveData("tree",!1,!0)}n&&(s.push=n.push,Object.defineProperty(n,"push",{enumerable:!1,configurable:!0,value:function(){var l=s.push.apply(n,arguments);return a(),l}}),s.unshift=n.unshift,Object.defineProperty(n,"unshift",{enumerable:!1,configurable:!0,value:function(){var l=s.unshift.apply(n,arguments);return a(),l}}),s.shift=n.shift,Object.defineProperty(n,"shift",{enumerable:!1,configurable:!0,value:function(){var l=s.shift.call(n);return a(),l}}),s.pop=n.pop,Object.defineProperty(n,"pop",{enumerable:!1,configurable:!0,value:function(){var l=s.pop.call(n);return a(),l}}),s.splice=n.splice,Object.defineProperty(n,"splice",{enumerable:!1,configurable:!0,value:function(){var l=s.splice.apply(n,arguments);return a(),l}}))};Le.prototype.watchKey=function(t,o,n){var s=this,a=Object.getOwnPropertyDescriptor(o,n),r=o[n],l=this.currentVersion;Object.defineProperty(o,n,{set:function(d){if(r=d,!s.blocked&&l===s.currentVersion){var c={};c[n]=d,t.updateData(c)}a.set&&a.set(d)},get:function(){return a.get&&a.get(),r}})};Le.prototype.unwatchRow=function(t){var o=t.getData();for(var n in o)Object.defineProperty(o,n,{value:o[n]})};Le.prototype.block=function(){this.blocked=!0};Le.prototype.unblock=function(){this.blocked=!1};p.prototype.registerModule("reactiveData",Le);var je=function(o){this.table=o,this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.handle=null,this.prevHandle=null};je.prototype.initializeColumn=function(t,o,n){var s=this,a=!1,r=this.table.options.resizableColumns;if(t==="header"&&(a=o.definition.formatter=="textarea"||o.definition.variableHeight,o.modules.resize={variableHeight:a}),r===!0||r==t){var l=document.createElement("div");l.className="tabulator-col-resize-handle";var u=document.createElement("div");u.className="tabulator-col-resize-handle prev",l.addEventListener("click",function(h){h.stopPropagation()});var d=function(m){var f=o.getLastColumn();f&&s._checkResizability(f)&&(s.startColumn=o,s._mouseDown(m,f,l))};l.addEventListener("mousedown",d),l.addEventListener("touchstart",d,{passive:!0}),l.addEventListener("dblclick",function(h){var m=o.getLastColumn();m&&s._checkResizability(m)&&(h.stopPropagation(),m.reinitializeWidth(!0))}),u.addEventListener("click",function(h){h.stopPropagation()});var c=function(m){var f,g,w;f=o.getFirstColumn(),f&&(g=s.table.columnManager.findColumnIndex(f),w=g>0?s.table.columnManager.getColumnByIndex(g-1):!1,w&&s._checkResizability(w)&&(s.startColumn=o,s._mouseDown(m,w,u)))};u.addEventListener("mousedown",c),u.addEventListener("touchstart",c,{passive:!0}),u.addEventListener("dblclick",function(h){var m,f,g;m=o.getFirstColumn(),m&&(f=s.table.columnManager.findColumnIndex(m),g=f>0?s.table.columnManager.getColumnByIndex(f-1):!1,g&&s._checkResizability(g)&&(h.stopPropagation(),g.reinitializeWidth(!0)))}),n.appendChild(l),n.appendChild(u)}};je.prototype._checkResizability=function(t){return typeof t.definition.resizable<"u"?t.definition.resizable:this.table.options.resizableColumns};je.prototype._mouseDown=function(t,o,n){var s=this;s.table.element.classList.add("tabulator-block-select");function a(l){s.table.rtl?o.setWidth(s.startWidth-((typeof l.screenX>"u"?l.touches[0].screenX:l.screenX)-s.startX)):o.setWidth(s.startWidth+((typeof l.screenX>"u"?l.touches[0].screenX:l.screenX)-s.startX)),s.table.options.virtualDomHoz&&s.table.vdomHoz.reinitialize(!0),!s.table.browserSlow&&o.modules.resize&&o.modules.resize.variableHeight&&o.checkCellHeights()}function r(l){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&o.modules.resize&&o.modules.resize.variableHeight&&o.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",a),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.table.options.persistence&&s.table.modExists("persistence",!0)&&s.table.modules.persistence.config.columns&&s.table.modules.persistence.save("columns"),s.table.options.columnResized.call(s.table,o.getComponent())}t.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=typeof t.screenX>"u"?t.touches[0].screenX:t.screenX,s.startWidth=o.getWidth(),document.body.addEventListener("mousemove",a),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",a,{passive:!0}),n.addEventListener("touchend",r)};p.prototype.registerModule("resizeColumns",je);var Ue=function(o){this.table=o,this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null};Ue.prototype.initializeRow=function(t){var o=this,n=t.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var a=document.createElement("div");a.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(u){u.stopPropagation()});var r=function(d){o.startRow=t,o._mouseDown(d,t,s)};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r,{passive:!0}),a.addEventListener("click",function(u){u.stopPropagation()});var l=function(d){var c=o.table.rowManager.prevDisplayRow(t);c&&(o.startRow=c,o._mouseDown(d,c,a))};a.addEventListener("mousedown",l),a.addEventListener("touchstart",l,{passive:!0}),n.appendChild(s),n.appendChild(a)};Ue.prototype._mouseDown=function(t,o,n){var s=this;s.table.element.classList.add("tabulator-block-select");function a(l){o.setHeight(s.startHeight+((typeof l.screenY>"u"?l.touches[0].screenY:l.screenY)-s.startY))}function r(l){document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",a),n.removeEventListener("touchmove",a),n.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.table.options.rowResized.call(this.table,o.getComponent())}t.stopPropagation(),s.startY=typeof t.screenY>"u"?t.touches[0].screenY:t.screenY,s.startHeight=o.getHeight(),document.body.addEventListener("mousemove",a),document.body.addEventListener("mouseup",r),n.addEventListener("touchmove",a,{passive:!0}),n.addEventListener("touchend",r)};p.prototype.registerModule("resizeRows",Ue);var Xe=function(o){this.table=o,this.binding=!1,this.observer=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1};Xe.prototype.initialize=function(t){var o=this,n=this.table,s;this.tableHeight=n.element.clientHeight,this.tableWidth=n.element.clientWidth,n.element.parentNode&&(this.containerHeight=n.element.parentNode.clientHeight,this.containerWidth=n.element.parentNode.clientWidth),typeof ResizeObserver<"u"&&n.rowManager.getRenderMode()==="virtual"?(this.autoResize=!0,this.observer=new ResizeObserver(function(a){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var r=Math.floor(a[0].contentRect.height),l=Math.floor(a[0].contentRect.width);(o.tableHeight!=r||o.tableWidth!=l)&&(o.tableHeight=r,o.tableWidth=l,n.element.parentNode&&(o.containerHeight=n.element.parentNode.clientHeight,o.containerWidth=n.element.parentNode.clientWidth),n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw())}}),this.observer.observe(n.element),s=window.getComputedStyle(n.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(s.getPropertyValue("max-height")||s.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(function(a){if(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell){var r=Math.floor(a[0].contentRect.height),l=Math.floor(a[0].contentRect.width);(o.containerHeight!=r||o.containerWidth!=l)&&(o.containerHeight=r,o.containerWidth=l,o.tableHeight=n.element.clientHeight,o.tableWidth=n.element.clientWidth),n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw()}}),this.containerObserver.observe(this.table.element.parentNode))):(this.binding=function(){(!n.browserMobile||n.browserMobile&&!n.modules.edit.currentCell)&&(n.options.virtualDomHoz&&n.vdomHoz.reinitialize(!0),n.redraw())},window.addEventListener("resize",this.binding))};Xe.prototype.clearBindings=function(t){this.binding&&window.removeEventListener("resize",this.binding),this.observer&&this.observer.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)};p.prototype.registerModule("resizeTable",Xe);var fe=function(o){this.table=o,this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1};fe.prototype.initialize=function(){var t=this,o=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(function(u,d){u.modules.responsive&&u.modules.responsive.order&&u.modules.responsive.visible&&(u.modules.responsive.index=d,o.push(u),!u.visible&&t.mode==="collapse"&&t.hiddenColumns.push(u))}),o=o.reverse(),o=o.sort(function(u,d){var c=d.modules.responsive.order-u.modules.responsive.order;return c||d.modules.responsive.index-u.modules.responsive.index}),this.columns=o,this.mode==="collapse"&&this.generateCollapsedContent();for(var a=this.table.columnManager.columnsByIndex,n=Array.isArray(a),s=0,a=n?a:a[Symbol.iterator]();;){var r;if(n){if(s>=a.length)break;r=a[s++]}else{if(s=a.next(),s.done)break;r=s.value}var l=r;if(l.definition.formatter=="responsiveCollapse"){this.collapseHandleColumn=l;break}}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())};fe.prototype.initializeColumn=function(t){var o=t.getDefinition();t.modules.responsive={order:typeof o.responsive>"u"?1:o.responsive,visible:o.visible!==!1}};fe.prototype.initializeRow=function(t){var o;t.type!=="calc"&&(o=document.createElement("div"),o.classList.add("tabulator-responsive-collapse"),t.modules.responsiveLayout={element:o,open:this.collapseStartOpen},this.collapseStartOpen||(o.style.display="none"))};fe.prototype.layoutRow=function(t){var o=t.getElement();t.modules.responsiveLayout&&(o.appendChild(t.modules.responsiveLayout.element),this.generateCollapsedRowContent(t))};fe.prototype.updateColumnVisibility=function(t,o){t.modules.responsive&&(t.modules.responsive.visible=o,this.initialize())};fe.prototype.hideColumn=function(t){var o=this.hiddenColumns.length;t.hide(!1,!0),this.mode==="collapse"&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent(),this.collapseHandleColumn&&!o&&this.collapseHandleColumn.show())};fe.prototype.showColumn=function(t){var o;t.show(!1,!0),t.setWidth(t.getWidth()),this.mode==="collapse"&&(o=this.hiddenColumns.indexOf(t),o>-1&&this.hiddenColumns.splice(o,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())};fe.prototype.update=function(){for(var t=this,o=!0;o;){var n=t.table.modules.layout.getMode()=="fitColumns"?t.table.columnManager.getFlexBaseWidth():t.table.columnManager.getWidth(),s=(t.table.options.headerVisible?t.table.columnManager.element.clientWidth:t.table.element.clientWidth)-n;if(s<0){var a=t.columns[t.index];a?(t.hideColumn(a),t.index++):o=!1}else{var r=t.columns[t.index-1];r&&s>0&&s>=r.getWidth()?(t.showColumn(r),t.index--):o=!1}t.table.rowManager.activeRowsCount||t.table.rowManager.renderEmptyScroll()}};fe.prototype.generateCollapsedContent=function(){var t=this,o=this.table.rowManager.getDisplayRows();o.forEach(function(n){t.generateCollapsedRowContent(n)})};fe.prototype.generateCollapsedRowContent=function(t){var o,n;if(t.modules.responsiveLayout){for(o=t.modules.responsiveLayout.element;o.firstChild;)o.removeChild(o.firstChild);n=this.collapseFormatter(this.generateCollapsedRowData(t)),n&&o.appendChild(n)}};fe.prototype.generateCollapsedRowData=function(t){var o=this,n=t.getData(),s=[],a;return this.hiddenColumns.forEach(function(r){var l=r.getFieldValue(n);r.definition.title&&r.field&&(r.modules.format&&o.table.options.responsiveLayoutCollapseUseFormatters?(a={value:!1,data:{},getValue:function(){return l},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return r.getComponent()}},s.push({field:r.field,title:r.definition.title,value:r.modules.format.formatter.call(o.table.modules.format,a,r.modules.format.params)})):s.push({field:r.field,title:r.definition.title,value:l}))}),s};fe.prototype.formatCollapsedData=function(t){var o=document.createElement("table");return t.forEach(function(n){var s=document.createElement("tr"),a=document.createElement("td"),r=document.createElement("td"),l,u=document.createElement("strong");a.appendChild(u),this.table.modules.localize.bind("columns|"+n.field,function(d){u.innerText=d||n.title}),n.value instanceof Node?(l=document.createElement("div"),l.appendChild(n.value),r.appendChild(l)):r.innerHTML=n.value,s.appendChild(a),s.appendChild(r),o.appendChild(s)},this),Object.keys(t).length?o:""};p.prototype.registerModule("responsiveLayout",fe);var se=function(o){this.table=o,this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null};se.prototype.clearSelectionData=function(t){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t||this._rowSelectionChanged()};se.prototype.initializeRow=function(t){var o=this,n=t.getElement(),s=function a(){setTimeout(function(){o.selecting=!1},50),document.body.removeEventListener("mouseup",a)};t.modules.select={selected:!1},o.table.options.selectableCheck.call(this.table,t.getComponent())?(n.classList.add("tabulator-selectable"),n.classList.remove("tabulator-unselectable"),o.table.options.selectable&&o.table.options.selectable!="highlight"&&(o.table.options.selectableRangeMode==="click"?n.addEventListener("click",function(a){if(a.shiftKey){o.table._clearSelection(),o.lastClickedRow=o.lastClickedRow||t;var r=o.table.rowManager.getDisplayRowIndex(o.lastClickedRow),l=o.table.rowManager.getDisplayRowIndex(t),u=r<=l?r:l,d=r>=l?r:l,c=o.table.rowManager.getDisplayRows().slice(0),h=c.splice(u,d-u+1);a.ctrlKey||a.metaKey?(h.forEach(function(m){m!==o.lastClickedRow&&(o.table.options.selectable!==!0&&!o.isRowSelected(t)?o.selectedRows.lengtho.table.options.selectable&&(h=h.slice(0,o.table.options.selectable)),o.selectRows(h)),o.table._clearSelection()}else a.ctrlKey||a.metaKey?(o.toggleRow(t),o.lastClickedRow=t):(o.deselectRows(void 0,!0),o.selectRows(t),o.lastClickedRow=t)}):(n.addEventListener("click",function(a){(!o.table.modExists("edit")||!o.table.modules.edit.getCurrentCell())&&o.table._clearSelection(),o.selecting||o.toggleRow(t)}),n.addEventListener("mousedown",function(a){if(a.shiftKey)return o.table._clearSelection(),o.selecting=!0,o.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),o.toggleRow(t),!1}),n.addEventListener("mouseenter",function(a){o.selecting&&(o.table._clearSelection(),o.toggleRow(t),o.selectPrev[1]==t&&o.toggleRow(o.selectPrev[0]))}),n.addEventListener("mouseout",function(a){o.selecting&&(o.table._clearSelection(),o.selectPrev.unshift(t))})))):(n.classList.add("tabulator-unselectable"),n.classList.remove("tabulator-selectable"))};se.prototype.toggleRow=function(t){this.table.options.selectableCheck.call(this.table,t.getComponent())&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))};se.prototype.selectRows=function(t){var o=this,n;switch(typeof t>"u"?"undefined":E(t)){case"undefined":this.table.rowManager.rows.forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged();break;case"string":n=this.table.rowManager.findRow(t),n?this._selectRow(n,!0,!0):this.table.rowManager.getRows(t).forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged();break;default:Array.isArray(t)?(t.forEach(function(s){o._selectRow(s,!0,!0)}),this._rowSelectionChanged()):this._selectRow(t,!1,!0);break}};se.prototype._selectRow=function(t,o,n){if(!isNaN(this.table.options.selectable)&&this.table.options.selectable!==!0&&!n&&this.selectedRows.length>=this.table.options.selectable)if(this.table.options.selectableRollingSelection)this._deselectRow(this.selectedRows[0]);else return!1;var s=this.table.rowManager.findRow(t);s?this.selectedRows.indexOf(s)==-1&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),o||this.table.options.rowSelected.call(this.table,s.getComponent()),this._rowSelectionChanged(o)):o||console.warn("Selection Error - No such row found, ignoring selection:"+t)};se.prototype.isRowSelected=function(t){return this.selectedRows.indexOf(t)!==-1};se.prototype.deselectRows=function(t,o){var n=this,s;if(typeof t>"u"){s=n.selectedRows.length;for(var a=0;a-1&&(s.getElement().classList.remove("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(a,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),o||n.table.options.rowDeselected.call(this.table,s.getComponent()),n._rowSelectionChanged(o))):o||console.warn("Deselection Error - No such row found, ignoring selection:"+t)};se.prototype.getSelectedData=function(){var t=[];return this.selectedRows.forEach(function(o){t.push(o.getData())}),t};se.prototype.getSelectedRows=function(){var t=[];return this.selectedRows.forEach(function(o){t.push(o.getComponent())}),t};se.prototype._rowSelectionChanged=function(t){this.headerCheckboxElement&&(this.selectedRows.length===0?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),t||this.table.options.rowSelectionChanged.call(this.table,this.getSelectedData(),this.getSelectedRows())};se.prototype.registerRowSelectCheckbox=function(t,o){t._row.modules.select||(t._row.modules.select={}),t._row.modules.select.checkboxEl=o};se.prototype.registerHeaderSelectCheckbox=function(t){this.headerCheckboxElement=t};se.prototype.childRowSelection=function(t,o){var n=this.table.modules.dataTree.getChildren(t,!0);if(o)for(var r=n,s=Array.isArray(r),a=0,r=s?r:r[Symbol.iterator]();;){var l;if(s){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var u=l;this._selectRow(u,!0)}else for(var h=n,d=Array.isArray(h),c=0,h=d?h:h[Symbol.iterator]();;){var m;if(d){if(c>=h.length)break;m=h[c++]}else{if(c=h.next(),c.done)break;m=c.value}var f=m;this._deselectRow(f,!0)}};p.prototype.registerModule("selectRow",se);var pe=function(o){this.table=o,this.sortList=[],this.changed=!1};pe.prototype.initializeColumn=function(t,o){var n=this,s=!1,a,r;switch(E(t.definition.sorter)){case"string":n.sorters[t.definition.sorter]?s=n.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":s=t.definition.sorter;break}t.modules.sort={sorter:s,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:typeof t.definition.headerSortTristate<"u"?t.definition.headerSortTristate:this.table.options.headerSortTristate},(typeof t.definition.headerSort>"u"?this.table.options.headerSort!==!1:t.definition.headerSort!==!1)&&(a=t.getElement(),a.classList.add("tabulator-sortable"),r=document.createElement("div"),r.classList.add("tabulator-col-sorter"),E(this.table.options.headerSortElement)=="object"?r.appendChild(this.table.options.headerSortElement):r.innerHTML=this.table.options.headerSortElement,o.appendChild(r),t.modules.sort.element=r,a.addEventListener("click",function(l){var u="",d=[],c=!1;if(t.modules.sort){if(t.modules.sort.tristate)t.modules.sort.dir=="none"?u=t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?u=t.modules.sort.dir=="asc"?"desc":"asc":u="none";else switch(t.modules.sort.dir){case"asc":u="desc";break;case"desc":u="asc";break;default:u=t.modules.sort.startingDir}n.table.options.columnHeaderSortMulti&&(l.shiftKey||l.ctrlKey)?(d=n.getSort(),c=d.findIndex(function(h){return h.field===t.getField()}),c>-1?(d[c].dir=u,c!=d.length-1&&(c=d.splice(c,1)[0],u!="none"&&d.push(c))):u!="none"&&d.push({column:t,dir:u}),n.setSort(d)):u=="none"?n.clear():n.setSort(t,u),n.table.rowManager.sorterRefresh(!n.sortList.length)}}))};pe.prototype.hasChanged=function(){var t=this.changed;return this.changed=!1,t};pe.prototype.getSort=function(){var t=this,o=[];return t.sortList.forEach(function(n){n.column&&o.push({column:n.column.getComponent(),field:n.column.getField(),dir:n.dir})}),o};pe.prototype.setSort=function(t,o){var n=this,s=[];Array.isArray(t)||(t=[{column:t,dir:o}]),t.forEach(function(a){var r;r=n.table.columnManager.findColumn(a.column),r?(a.column=r,s.push(a),n.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",a.column)}),n.sortList=s,this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.sort&&this.table.modules.persistence.save("sort")};pe.prototype.clear=function(){this.setSort([])};pe.prototype.findSorter=function(t){var o=this.table.rowManager.activeRows[0],n="string",s,a;if(o&&(o=o.getData(),s=t.getField(),s))switch(a=t.getFieldValue(o),typeof a>"u"?"undefined":E(a)){case"undefined":n="string";break;case"boolean":n="boolean";break;default:!isNaN(a)&&a!==""?n="number":a.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(n="alphanum");break}return this.sorters[n]};pe.prototype.sort=function(t){var o=this,n=this.table.options.sortOrderReverse?o.sortList.slice().reverse():o.sortList,s=[],a=[];o.table.options.dataSorting&&o.table.options.dataSorting.call(o.table,o.getSort()),o.clearColumnHeaders(),o.table.options.ajaxSorting?n.forEach(function(r,l){o.setColumnHeader(r.column,r.dir)}):(n.forEach(function(r,l){var u=r.column.modules.sort;r.column&&u&&(u.sorter||(u.sorter=o.findSorter(r.column)),r.params=typeof u.params=="function"?u.params(r.column.getComponent(),r.dir):u.params,s.push(r)),o.setColumnHeader(r.column,r.dir)}),s.length&&o._sortItems(t,s)),o.table.options.dataSorted&&(t.forEach(function(r){a.push(r.getComponent())}),o.table.options.dataSorted.call(o.table,o.getSort(),a))};pe.prototype.clearColumnHeaders=function(){this.table.columnManager.getRealColumns().forEach(function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"))})};pe.prototype.setColumnHeader=function(t,o){t.modules.sort.dir=o,t.getElement().setAttribute("aria-sort",o)};pe.prototype._sortItems=function(t,o){var n=this,s=o.length-1;t.sort(function(a,r){for(var l,u=s;u>=0;u--){var d=o[u];if(l=n._sortRow(a,r,d.column,d.dir,d.params),l!==0)break}return l})};pe.prototype._sortRow=function(t,o,n,s,a){var r,l,u=s=="asc"?t:o,d=s=="asc"?o:t;return t=n.getFieldValue(u.getData()),o=n.getFieldValue(d.getData()),t=typeof t<"u"?t:"",o=typeof o<"u"?o:"",r=u.getComponent(),l=d.getComponent(),n.modules.sort.sorter.call(this,t,o,r,l,n.getComponent(),s,a)};pe.prototype.sorters={number:function(o,n,s,a,r,l,u){var d=u.alignEmptyValues,c=u.decimalSeparator,h=u.thousandSeparator,m=0;if(o=String(o),n=String(n),h&&(o=o.split(h).join(""),n=n.split(h).join("")),c&&(o=o.split(c).join("."),n=n.split(c).join(".")),o=parseFloat(o),n=parseFloat(n),isNaN(o))m=isNaN(n)?0:-1;else if(isNaN(n))m=1;else return o-n;return(d==="top"&&l==="desc"||d==="bottom"&&l==="asc")&&(m*=-1),m},string:function(o,n,s,a,r,l,u){var d=u.alignEmptyValues,c=0,h;if(!o)c=n?-1:0;else if(!n)c=1;else{switch(E(u.locale)){case"boolean":u.locale&&(h=this.table.modules.localize.getLocale());break;case"string":h=u.locale;break}return String(o).toLowerCase().localeCompare(String(n).toLowerCase(),h)}return(d==="top"&&l==="desc"||d==="bottom"&&l==="asc")&&(c*=-1),c},date:function(o,n,s,a,r,l,u){return u.format||(u.format="DD/MM/YYYY"),this.sorters.datetime.call(this,o,n,s,a,r,l,u)},time:function(o,n,s,a,r,l,u){return u.format||(u.format="HH:mm"),this.sorters.datetime.call(this,o,n,s,a,r,l,u)},datetime:function(o,n,s,a,r,l,u){var d=u.format||"DD/MM/YYYY HH:mm:ss",c=u.alignEmptyValues,h=0;if(typeof moment<"u"){if(o=moment(o,d),n=moment(n,d),!o.isValid())h=n.isValid()?-1:0;else if(!n.isValid())h=1;else return o-n;return(c==="top"&&l==="desc"||c==="bottom"&&l==="asc")&&(h*=-1),h}else console.error("Sort Error - 'datetime' sorter is dependant on moment.js")},boolean:function(o,n,s,a,r,l,u){var d=o===!0||o==="true"||o==="True"||o===1?1:0,c=n===!0||n==="true"||n==="True"||n===1?1:0;return d-c},array:function(o,n,s,a,r,l,u){var d=0,c=0,h=u.type||"length",m=u.alignEmptyValues,f=0;function g(w){switch(h){case"length":return w.length;case"sum":return w.reduce(function(b,y){return b+y});case"max":return Math.max.apply(null,w);case"min":return Math.min.apply(null,w);case"avg":return w.reduce(function(b,y){return b+y})/w.length}}if(!Array.isArray(o))m=Array.isArray(n)?-1:0;else if(!Array.isArray(n))m=1;else return d=o?g(o):0,c=n?g(n):0,d-c;return(m==="top"&&l==="desc"||m==="bottom"&&l==="asc")&&(f*=-1),f},exists:function(o,n,s,a,r,l,u){var d=typeof o>"u"?0:1,c=typeof n>"u"?0:1;return d-c},alphanum:function(o,n,s,a,r,l,u){var d,c,h,m,f=0,g,w=/(\d+)|(\D+)/g,b=/\d/,y=u.alignEmptyValues,x=0;if(!o&&o!==0)x=!n&&n!==0?0:-1;else if(!n&&n!==0)x=1;else{if(isFinite(o)&&isFinite(n))return o-n;if(d=String(o).toLowerCase(),c=String(n).toLowerCase(),d===c)return 0;if(!(b.test(d)&&b.test(c)))return d>c?1:-1;for(d=d.match(w),c=c.match(w),g=d.length>c.length?c.length:d.length;fm?1:-1;return d.length>c.length}return(y==="top"&&l==="desc"||y==="bottom"&&l==="asc")&&(x*=-1),x}};p.prototype.registerModule("sort",pe);var Se=function(o){this.table=o,this.invalidCells=[]};Se.prototype.initializeColumn=function(t){var o=this,n=[],s;t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(function(a){s=o._extractValidator(a),s&&n.push(s)}):(s=this._extractValidator(t.definition.validator),s&&n.push(s)),t.modules.validate=n.length?n:!1)};Se.prototype._extractValidator=function(t){var o,n,s;switch(typeof t>"u"?"undefined":E(t)){case"string":return s=t.indexOf(":"),s>-1?(o=t.substring(0,s),n=t.substring(s+1)):o=t,this._buildValidator(o,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}};Se.prototype._buildValidator=function(t,o){var n=typeof t=="function"?t:this.validators[t];return n?{type:typeof t=="function"?"function":t,func:n,params:o}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)};Se.prototype.validate=function(t,o,n){var s=this,a=[],r=this.invalidCells.indexOf(o);return t&&t.forEach(function(l){l.func.call(s,o.getComponent(),n,l.params)||a.push({type:l.type,parameters:l.params})}),a=a.length?a:!0,o.modules.validate||(o.modules.validate={}),a===!0?(o.modules.validate.invalid=!1,o.getElement().classList.remove("tabulator-validation-fail"),r>-1&&this.invalidCells.splice(r,1)):(o.modules.validate.invalid=!0,this.table.options.validationMode!=="manual"&&o.getElement().classList.add("tabulator-validation-fail"),r==-1&&this.invalidCells.push(o)),a};Se.prototype.getInvalidCells=function(){var t=[];return this.invalidCells.forEach(function(o){t.push(o.getComponent())}),t};Se.prototype.clearValidation=function(t){var o;t.modules.validate&&t.modules.validate.invalid&&(t.getElement().classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,o=this.invalidCells.indexOf(t),o>-1&&this.invalidCells.splice(o,1))};Se.prototype.validators={integer:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(n=Number(n),typeof n=="number"&&isFinite(n)&&Math.floor(n)===n)},float:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(n=Number(n),typeof n=="number"&&isFinite(n)&&n%1!==0)},numeric:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:!isNaN(n)},string:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:isNaN(n)},max:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:parseFloat(n)<=s},min:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:parseFloat(n)>=s},starts:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).toLowerCase().startsWith(String(s).toLowerCase())},ends:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).toLowerCase().endsWith(String(s).toLowerCase())},minLength:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).length>=s},maxLength:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:String(n).length<=s},in:function(o,n,s){return n===""||n===null||typeof n>"u"?!0:(typeof s=="string"&&(s=s.split("|")),n===""||s.indexOf(n)>-1)},regex:function(o,n,s){if(n===""||n===null||typeof n>"u")return!0;var a=new RegExp(s);return a.test(n)},unique:function(o,n,s){if(n===""||n===null||typeof n>"u")return!0;var a=!0,r=o.getData(),l=o.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(u){var d=u.getData();d!==r&&n==l.getFieldValue(d)&&(a=!1)}),a},required:function(o,n,s){return n!==""&&n!==null&&typeof n<"u"}};p.prototype.registerModule("validate",Se);export{p as default}; diff --git a/nereid/nereid/static/frontend/dist/assets/vendor-QiQdsv75.js b/nereid/nereid/static/frontend/dist/assets/vendor-QiQdsv75.js new file mode 100644 index 00000000..b4e45203 --- /dev/null +++ b/nereid/nereid/static/frontend/dist/assets/vendor-QiQdsv75.js @@ -0,0 +1,5 @@ +class je extends Map{constructor(t,e=xc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Ro(this,t))}has(t){return super.has(Ro(this,t))}set(t,e){return super.set(wc(this,t),e)}delete(t){return super.delete(_c(this,t))}}class Rt extends Set{constructor(t,e=xc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(Ro(this,t))}add(t){return super.add(wc(this,t))}delete(t){return super.delete(_c(this,t))}}function Ro({_intern:n,_key:t},e){const r=t(e);return n.has(r)?n.get(r):e}function wc({_intern:n,_key:t},e){const r=t(e);return n.has(r)?n.get(r):(n.set(r,e),e)}function _c({_intern:n,_key:t},e){const r=t(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}function xc(n){return n!==null&&typeof n=="object"?n.valueOf():n}function rn(n,t){return n==null||t==null?NaN:nt?1:n>=t?0:NaN}function Mc(n,t){return n==null||t==null?NaN:tn?1:t>=n?0:NaN}function ki(n){let t,e,r;n.length!==2?(t=rn,e=(f,c)=>rn(n(f),c),r=(f,c)=>n(f)-c):(t=n===rn||n===Mc?n:J0,e=n,r=n);function i(f,c,u=0,l=f.length){if(u>>1;e(f[s],c)<0?u=s+1:l=s}while(u>>1;e(f[s],c)<=0?u=s+1:l=s}while(uu&&r(f[s-1],c)>-r(f[s],c)?s-1:s}return{left:i,center:a,right:o}}function J0(){return 0}function Wr(n){return n===null?NaN:+n}function*nh(n,t){if(t===void 0)for(let e of n)e!=null&&(e=+e)>=e&&(yield e);else{let e=-1;for(let r of n)(r=t(r,++e,n))!=null&&(r=+r)>=r&&(yield r)}}const Sc=ki(rn),_t=Sc.right,th=Sc.left,eh=ki(Wr).center;function rh(n,t){if(!((t=+t)>=0))throw new RangeError("invalid r");let e=n.length;if(!((e=Math.floor(e))>=0))throw new RangeError("invalid length");if(!e||!t)return n;const r=Ma(t),i=n.slice();return r(n,i,0,e,1),r(i,n,0,e,1),r(n,i,0,e,1),n}const ih=Tc(Ma),oh=Tc(ah);function Tc(n){return function(t,e,r=e){if(!((e=+e)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=t;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(a!==void 0?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!e&&!r)return t;const f=e&&n(e),c=r&&n(r),u=i.slice();return f&&c?(Vt(f,u,i,o,a),Vt(f,i,u,o,a),Vt(f,u,i,o,a),jt(c,i,u,o,a),jt(c,u,i,o,a),jt(c,i,u,o,a)):f?(Vt(f,i,u,o,a),Vt(f,u,i,o,a),Vt(f,i,u,o,a)):c&&(jt(c,i,u,o,a),jt(c,u,i,o,a),jt(c,i,u,o,a)),t}}function Vt(n,t,e,r,i){for(let o=0,a=r*i;o{i<<=2,o<<=2,a<<=2,t(e,r,i+0,o+0,a),t(e,r,i+1,o+1,a),t(e,r,i+2,o+2,a),t(e,r,i+3,o+3,a)}}function Ma(n){const t=Math.floor(n);if(t===n)return fh(n);const e=n-t,r=2*n+1;return(i,o,a,f,c)=>{if(!((f-=c)>=a))return;let u=t*o[a];const l=c*t,s=l+c;for(let h=a,d=a+l;h{if(!((o-=a)>=i))return;let f=n*r[i];const c=a*n;for(let u=i,l=i+c;u=r&&++e;else{let r=-1;for(let i of n)(i=t(i,++r,n))!=null&&(i=+i)>=i&&++e}return e}function uh(n){return n.length|0}function ch(n){return!(n>0)}function lh(n){return typeof n!="object"||"length"in n?n:Array.from(n)}function sh(n){return t=>n(...t)}function hh(...n){const t=typeof n[n.length-1]=="function"&&sh(n.pop());n=n.map(lh);const e=n.map(uh),r=n.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(ch))return o;for(;;){o.push(i.map((f,c)=>n[c][f]));let a=r;for(;++i[a]===e[a];){if(a===0)return t?o.map(t):o;i[a--]=0}}}function dh(n,t){var e=0,r=0;return Float64Array.from(n,t===void 0?i=>e+=+i||0:i=>e+=+t(i,r++,n)||0)}function Ac(n,t){let e=0,r,i=0,o=0;if(t===void 0)for(let a of n)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++e,o+=r*(a-i));else{let a=-1;for(let f of n)(f=t(f,++a,n))!=null&&(f=+f)>=f&&(r=f-i,i+=r/++e,o+=r*(f-i))}if(e>1)return o/(e-1)}function Ec(n,t){const e=Ac(n,t);return e&&Math.sqrt(e)}function Ur(n,t){let e,r;if(t===void 0)for(const i of n)i!=null&&(e===void 0?i>=i&&(e=r=i):(e>i&&(e=i),r=o&&(e=r=o):(e>o&&(e=o),r0){for(a=t[--e];e>0&&(r=a,i=t[--e],a=r+i,o=i-(a-r),!o););e>0&&(o<0&&t[e-1]<0||o>0&&t[e-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}function gh(n,t){const e=new sn;if(t===void 0)for(let r of n)(r=+r)&&e.add(r);else{let r=-1;for(let i of n)(i=+t(i,++r,n))&&e.add(i)}return+e}function ph(n,t){const e=new sn;let r=-1;return Float64Array.from(n,t===void 0?i=>e.add(+i||0):i=>e.add(+t(i,++r,n)||0))}function ae(n){return n}function $c(n,...t){return we(n,ae,ae,t)}function Nc(n,...t){return we(n,Array.from,ae,t)}function Cc(n,t){for(let e=1,r=t.length;ei.pop().map(([o,a])=>[...i,o,a]));return n}function mh(n,...t){return Cc(Nc(n,...t),t)}function bh(n,t,...e){return Cc(kc(n,t,...e),e)}function Pc(n,t,...e){return we(n,ae,t,e)}function kc(n,t,...e){return we(n,Array.from,t,e)}function yh(n,...t){return we(n,ae,Rc,t)}function vh(n,...t){return we(n,Array.from,Rc,t)}function Rc(n){if(n.length!==1)throw new Error("duplicate key");return n[0]}function we(n,t,e,r){return function i(o,a){if(a>=r.length)return e(o);const f=new je,c=r[a++];let u=-1;for(const l of o){const s=c(l,++u,o),h=f.get(s);h?h.push(l):f.set(s,[l])}for(const[l,s]of f)f.set(l,i(s,a));return t(f)}(n,0)}function Ic(n,t){return Array.from(t,e=>n[e])}function Io(n,...t){if(typeof n[Symbol.iterator]!="function")throw new TypeError("values is not iterable");n=Array.from(n);let[e]=t;if(e&&e.length!==2||t.length>1){const r=Uint32Array.from(n,(i,o)=>o);return t.length>1?(t=t.map(i=>n.map(i)),r.sort((i,o)=>{for(const a of t){const f=fe(a[i],a[o]);if(f)return f}})):(e=n.map(e),r.sort((i,o)=>fe(e[i],e[o]))),Ic(n,r)}return n.sort(Sa(e))}function Sa(n=rn){if(n===rn)return fe;if(typeof n!="function")throw new TypeError("compare is not a function");return(t,e)=>{const r=n(t,e);return r||r===0?r:(n(e,e)===0)-(n(t,t)===0)}}function fe(n,t){return(n==null||!(n>=n))-(t==null||!(t>=t))||(nt?1:0)}function wh(n,t,e){return(t.length!==2?Io(Pc(n,t,e),([r,i],[o,a])=>rn(i,a)||rn(r,o)):Io($c(n,e),([r,i],[o,a])=>t(i,a)||rn(r,o))).map(([r])=>r)}var _h=Array.prototype,xh=_h.slice;function uo(n){return()=>n}const Mh=Math.sqrt(50),Sh=Math.sqrt(10),Th=Math.sqrt(2);function Vr(n,t,e){const r=(t-n)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Mh?10:o>=Sh?5:o>=Th?2:1;let f,c,u;return i<0?(u=Math.pow(10,-i)/a,f=Math.round(n*u),c=Math.round(t*u),f/ut&&--c,u=-u):(u=Math.pow(10,i)*a,f=Math.round(n/u),c=Math.round(t/u),f*ut&&--c),c0))return[];if(n===t)return[n];const r=t=i))return[];const f=o-i+1,c=new Array(f);if(r)if(a<0)for(let u=0;u0?(n=Math.floor(n/i)*i,t=Math.ceil(t/i)*i):i<0&&(n=Math.ceil(n*i)/i,t=Math.floor(t*i)/i),r=i}}function Dc(n){return Math.max(1,Math.ceil(Math.log(Ri(n))/Math.LN2)+1)}function Nf(){var n=ae,t=Ur,e=Dc;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,f,c,u=new Array(a);for(o=0;o=h)if(v>=h&&t===Ur){const M=It(s,h,y);isFinite(M)&&(M>0?h=(Math.floor(h/M)+1)*M:M<0&&(h=(Math.ceil(h*-M)+1)/-M))}else d.pop()}for(var g=d.length,p=0,b=g;d[p]<=s;)++p;for(;d[b-1]>h;)--b;(p||b0?d[o-1]:s,w.x1=o0)for(o=0;o=r)&&(e=r);else{let r=-1;for(let i of n)(i=t(i,++r,n))!=null&&(e=i)&&(e=i)}return e}function Ta(n,t){let e,r=-1,i=-1;if(t===void 0)for(const o of n)++i,o!=null&&(e=o)&&(e=o,r=i);else for(let o of n)(o=t(o,++i,n))!=null&&(e=o)&&(e=o,r=i);return r}function Zr(n,t){let e;if(t===void 0)for(const r of n)r!=null&&(e>r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of n)(i=t(i,++r,n))!=null&&(e>i||e===void 0&&i>=i)&&(e=i)}return e}function Aa(n,t){let e,r=-1,i=-1;if(t===void 0)for(const o of n)++i,o!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);else for(let o of n)(o=t(o,++i,n))!=null&&(e>o||e===void 0&&o>=o)&&(e=o,r=i);return r}function Ii(n,t,e=0,r=1/0,i){if(t=Math.floor(t),e=Math.floor(Math.max(0,e)),r=Math.floor(Math.min(n.length-1,r)),!(e<=t&&t<=r))return n;for(i=i===void 0?fe:Sa(i);r>e;){if(r-e>600){const c=r-e+1,u=t-e+1,l=Math.log(c),s=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*s*(c-s)/c)*(u-c/2<0?-1:1),d=Math.max(e,Math.floor(t-u*s/c+h)),g=Math.min(r,Math.floor(t+(c-u)*s/c+h));Ii(n,t,d,g,i)}const o=n[t];let a=e,f=r;for(Te(n,e,t),i(n[r],o)>0&&Te(n,e,r);a0;)--f}i(n[e],o)===0?Te(n,e,f):(++f,Te(n,f,r)),f<=t&&(e=f+1),t<=f&&(r=f-1)}return n}function Te(n,t,e){const r=n[t];n[t]=n[e],n[e]=r}function zc(n,t=rn){let e,r=!1;if(t.length===1){let i;for(const o of n){const a=t(o);(r?rn(a,i)>0:rn(a,a)===0)&&(e=o,i=a,r=!0)}}else for(const i of n)(r?t(i,e)>0:t(i,i)===0)&&(e=i,r=!0);return e}function Qe(n,t,e){if(n=Float64Array.from(nh(n,e)),!(!(r=n.length)||isNaN(t=+t))){if(t<=0||r<2)return Zr(n);if(t>=1)return Oo(n);var r,i=(r-1)*t,o=Math.floor(i),a=Oo(Ii(n,o).subarray(0,o+1)),f=Zr(n.subarray(o+1));return a+(f-a)*(i-o)}}function Fc(n,t,e=Wr){if(!(!(r=n.length)||isNaN(t=+t))){if(t<=0||r<2)return+e(n[0],0,n);if(t>=1)return+e(n[r-1],r-1,n);var r,i=(r-1)*t,o=Math.floor(i),a=+e(n[o],o,n),f=+e(n[o+1],o+1,n);return a+(f-a)*(i-o)}}function Uc(n,t,e=Wr){if(!isNaN(t=+t)){if(r=Float64Array.from(n,(f,c)=>Wr(e(n[c],c,n))),t<=0)return Aa(r);if(t>=1)return Ta(r);var r,i=Uint32Array.from(n,(f,c)=>c),o=r.length-1,a=Math.floor(o*t);return Ii(i,a,0,o,(f,c)=>fe(r[f],r[c])),a=zc(i.subarray(0,a+1),f=>r[f]),a>=0?a:-1}}function Ah(n,t,e){const r=Ri(n),i=Qe(n,.75)-Qe(n,.25);return r&&i?Math.ceil((e-t)/(2*i*Math.pow(r,-1/3))):1}function Eh(n,t,e){const r=Ri(n),i=Ec(n);return r&&i?Math.ceil((e-t)*Math.cbrt(r)/(3.49*i)):1}function $h(n,t){let e=0,r=0;if(t===void 0)for(let i of n)i!=null&&(i=+i)>=i&&(++e,r+=i);else{let i=-1;for(let o of n)(o=t(o,++i,n))!=null&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e}function Nh(n,t){return Qe(n,.5,t)}function Ch(n,t){return Uc(n,.5,t)}function*Ph(n){for(const t of n)yield*t}function Ea(n){return Array.from(Ph(n))}function kh(n,t){const e=new je;if(t===void 0)for(let o of n)o!=null&&o>=o&&e.set(o,(e.get(o)||0)+1);else{let o=-1;for(let a of n)(a=t(a,++o,n))!=null&&a>=a&&e.set(a,(e.get(a)||0)+1)}let r,i=0;for(const[o,a]of e)a>i&&(i=a,r=o);return r}function Rh(n,t=Ih){const e=[];let r,i=!1;for(const o of n)i&&e.push(t(r,o)),r=o,i=!0;return e}function Ih(n,t){return[n,t]}function vt(n,t,e){n=+n,t=+t,e=(i=arguments.length)<2?(t=n,n=0,1):i<3?1:+e;for(var r=-1,i=Math.max(0,Math.ceil((t-n)/e))|0,o=new Array(i);++rt(e[f],e[c]);let o,a;return n=Uint32Array.from(e,(f,c)=>c),n.sort(t===rn?(f,c)=>fe(e[f],e[c]):Sa(i)),n.forEach((f,c)=>{const u=i(f,o===void 0?f:o);u>=0?((o===void 0||u>0)&&(o=f,a=c),r[f]=a):r[f]=NaN}),r}function Dh(n,t=rn){let e,r=!1;if(t.length===1){let i;for(const o of n){const a=t(o);(r?rn(a,i)<0:rn(a,a)===0)&&(e=o,i=a,r=!0)}}else for(const i of n)(r?t(i,e)<0:t(i,i)===0)&&(e=i,r=!0);return e}function Lc(n,t=rn){if(t.length===1)return Aa(n,t);let e,r=-1,i=-1;for(const o of n)++i,(r<0?t(o,o)===0:t(o,e)<0)&&(e=o,r=i);return r}function zh(n,t=rn){if(t.length===1)return Ta(n,t);let e,r=-1,i=-1;for(const o of n)++i,(r<0?t(o,o)===0:t(o,e)>0)&&(e=o,r=i);return r}function Fh(n,t){const e=Lc(n,t);return e<0?void 0:e}const Uh=Yc(Math.random);function Yc(n){return function(e,r=0,i=e.length){let o=i-(r=+r);for(;o;){const a=n()*o--|0,f=e[o+r];e[o+r]=e[a+r],e[a+r]=f}return e}}function Lh(n,t){let e=0;if(t===void 0)for(let r of n)(r=+r)&&(e+=r);else{let r=-1;for(let i of n)(i=+t(i,++r,n))&&(e+=i)}return e}function qc(n){if(!(o=n.length))return[];for(var t=-1,e=Zr(n,Yh),r=new Array(e);++tt(e,r,n))}function Wh(n,t,e){if(typeof t!="function")throw new TypeError("reducer is not a function");const r=n[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if({done:i,value:e}=r.next(),i)return;++a}for(;{done:i,value:o}=r.next(),!i;)e=t(e,o,++a,n);return e}function Vh(n){if(typeof n[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(n).reverse()}function jh(n,...t){n=new Rt(n);for(const e of t)for(const r of e)n.delete(r);return n}function Zh(n,t){const e=t[Symbol.iterator](),r=new Rt;for(const i of n){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=e.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function Qh(n,...t){n=new Rt(n),t=t.map(Kh);n:for(const e of n)for(const r of t)if(!r.has(e)){n.delete(e);continue n}return n}function Kh(n){return n instanceof Rt?n:new Rt(n)}function Bc(n,t){const e=n[Symbol.iterator](),r=new Set;for(const i of t){const o=Cf(i);if(r.has(o))continue;let a,f;for(;{value:a,done:f}=e.next();){if(f)return!1;const c=Cf(a);if(r.add(c),Object.is(o,c))break}}return!0}function Cf(n){return n!==null&&typeof n=="object"?n.valueOf():n}function Jh(n,t){return Bc(t,n)}function n1(...n){const t=new Rt;for(const e of n)for(const r of e)t.add(r);return t}const iv=Object.freeze(Object.defineProperty({__proto__:null,Adder:sn,InternMap:je,InternSet:Rt,ascending:rn,bin:Nf,bisect:_t,bisectCenter:eh,bisectLeft:th,bisectRight:_t,bisector:ki,blur:rh,blur2:ih,blurImage:oh,count:Ri,cross:hh,cumsum:dh,descending:Mc,deviation:Ec,difference:jh,disjoint:Zh,every:Bh,extent:Ur,fcumsum:ph,filter:Gh,flatGroup:mh,flatRollup:bh,fsum:gh,greatest:zc,greatestIndex:zh,group:$c,groupSort:wh,groups:Nc,histogram:Nf,index:yh,indexes:vh,intersection:Qh,least:Dh,leastIndex:Lc,map:Xh,max:Oo,maxIndex:Ta,mean:$h,median:Nh,medianIndex:Ch,merge:Ea,min:Zr,minIndex:Aa,mode:kh,nice:Oc,pairs:Rh,permute:Ic,quantile:Qe,quantileIndex:Uc,quantileSorted:Fc,quickselect:Ii,range:vt,rank:Oh,reduce:Wh,reverse:Vh,rollup:Pc,rollups:kc,scan:Fh,shuffle:Uh,shuffler:Yc,some:Hh,sort:Io,subset:Jh,sum:Lh,superset:Bc,thresholdFreedmanDiaconis:Ah,thresholdScott:Eh,thresholdSturges:Dc,tickIncrement:It,tickStep:jr,ticks:Ze,transpose:qc,union:n1,variance:Ac,zip:qh},Symbol.toStringTag,{value:"Module"}));function _e(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function hr(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function St(){}var Ot=.7,ue=1/Ot,ee="\\s*([+-]?\\d+)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",t1=/^#([0-9a-f]{3,8})$/,e1=new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`),r1=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),i1=new RegExp(`^rgba\\(${ee},${ee},${ee},${Ke}\\)$`),o1=new RegExp(`^rgba\\(${tt},${tt},${tt},${Ke}\\)$`),a1=new RegExp(`^hsl\\(${Ke},${tt},${tt}\\)$`),f1=new RegExp(`^hsla\\(${Ke},${tt},${tt},${Ke}\\)$`),Pf={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};_e(St,xt,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:kf,formatHex:kf,formatHex8:u1,formatHsl:c1,formatRgb:Rf,toString:Rf});function kf(){return this.rgb().formatHex()}function u1(){return this.rgb().formatHex8()}function c1(){return Hc(this).formatHsl()}function Rf(){return this.rgb().formatRgb()}function xt(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=t1.exec(n))?(e=t[1].length,t=parseInt(t[1],16),e===6?If(t):e===3?new hn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?xr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?xr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=e1.exec(n))?new hn(t[1],t[2],t[3],1):(t=r1.exec(n))?new hn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=i1.exec(n))?xr(t[1],t[2],t[3],t[4]):(t=o1.exec(n))?xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a1.exec(n))?zf(t[1],t[2]/100,t[3]/100,1):(t=f1.exec(n))?zf(t[1],t[2]/100,t[3]/100,t[4]):Pf.hasOwnProperty(n)?If(Pf[n]):n==="transparent"?new hn(NaN,NaN,NaN,0):null}function If(n){return new hn(n>>16&255,n>>8&255,n&255,1)}function xr(n,t,e,r){return r<=0&&(n=t=e=NaN),new hn(n,t,e,r)}function $a(n){return n instanceof St||(n=xt(n)),n?(n=n.rgb(),new hn(n.r,n.g,n.b,n.opacity)):new hn}function ce(n,t,e,r){return arguments.length===1?$a(n):new hn(n,t,e,r??1)}function hn(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}_e(hn,ce,hr(St,{brighter(n){return n=n==null?ue:Math.pow(ue,n),new hn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Ot:Math.pow(Ot,n),new hn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new hn(Pt(this.r),Pt(this.g),Pt(this.b),Qr(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:Of,formatHex:Of,formatHex8:l1,formatRgb:Df,toString:Df}));function Of(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}`}function l1(){return`#${Nt(this.r)}${Nt(this.g)}${Nt(this.b)}${Nt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Df(){const n=Qr(this.opacity);return`${n===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${n===1?")":`, ${n})`}`}function Qr(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Pt(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Nt(n){return n=Pt(n),(n<16?"0":"")+n.toString(16)}function zf(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new Hn(n,t,e,r)}function Hc(n){if(n instanceof Hn)return new Hn(n.h,n.s,n.l,n.opacity);if(n instanceof St||(n=xt(n)),!n)return new Hn;if(n instanceof Hn)return n;n=n.rgb();var t=n.r/255,e=n.g/255,r=n.b/255,i=Math.min(t,e,r),o=Math.max(t,e,r),a=NaN,f=o-i,c=(o+i)/2;return f?(t===o?a=(e-r)/f+(e0&&c<1?0:a,new Hn(a,f,c,n.opacity)}function Kr(n,t,e,r){return arguments.length===1?Hc(n):new Hn(n,t,e,r??1)}function Hn(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}_e(Hn,Kr,hr(St,{brighter(n){return n=n==null?ue:Math.pow(ue,n),new Hn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Ot:Math.pow(Ot,n),new Hn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,i=2*e-r;return new hn(co(n>=240?n-240:n+120,i,r),co(n,i,r),co(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Hn(Ff(this.h),Mr(this.s),Mr(this.l),Qr(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 n=Qr(this.opacity);return`${n===1?"hsl(":"hsla("}${Ff(this.h)}, ${Mr(this.s)*100}%, ${Mr(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Ff(n){return n=(n||0)%360,n<0?n+360:n}function Mr(n){return Math.max(0,Math.min(1,n||0))}function co(n,t,e){return(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)*255}const Gc=Math.PI/180,Xc=180/Math.PI,Jr=18,Wc=.96422,Vc=1,jc=.82521,Zc=4/29,re=6/29,Qc=3*re*re,s1=re*re*re;function Kc(n){if(n instanceof Vn)return new Vn(n.l,n.a,n.b,n.opacity);if(n instanceof Jn)return nl(n);n instanceof hn||(n=$a(n));var t=go(n.r),e=go(n.g),r=go(n.b),i=lo((.2225045*t+.7168786*e+.0606169*r)/Vc),o,a;return t===e&&e===r?o=a=i:(o=lo((.4360747*t+.3850649*e+.1430804*r)/Wc),a=lo((.0139322*t+.0971045*e+.7141733*r)/jc)),new Vn(116*i-16,500*(o-i),200*(i-a),n.opacity)}function h1(n,t){return new Vn(n,0,0,t??1)}function ni(n,t,e,r){return arguments.length===1?Kc(n):new Vn(n,t,e,r??1)}function Vn(n,t,e,r){this.l=+n,this.a=+t,this.b=+e,this.opacity=+r}_e(Vn,ni,hr(St,{brighter(n){return new Vn(this.l+Jr*(n??1),this.a,this.b,this.opacity)},darker(n){return new Vn(this.l-Jr*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,t=isNaN(this.a)?n:n+this.a/500,e=isNaN(this.b)?n:n-this.b/200;return t=Wc*so(t),n=Vc*so(n),e=jc*so(e),new hn(ho(3.1338561*t-1.6168667*n-.4906146*e),ho(-.9787684*t+1.9161415*n+.033454*e),ho(.0719453*t-.2289914*n+1.4052427*e),this.opacity)}}));function lo(n){return n>s1?Math.pow(n,1/3):n/Qc+Zc}function so(n){return n>re?n*n*n:Qc*(n-Zc)}function ho(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function go(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Jc(n){if(n instanceof Jn)return new Jn(n.h,n.c,n.l,n.opacity);if(n instanceof Vn||(n=Kc(n)),n.a===0&&n.b===0)return new Jn(NaN,0{}};function xe(){for(var n=0,t=arguments.length,e={},r;n=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Lr.prototype=xe.prototype={constructor:Lr,on:function(n,t){var e=this._,r=m1(n+"",e),i,o=-1,a=r.length;if(arguments.length<2){for(;++o0)for(var e=new Array(i),r=0,i,o;r=0&&(t=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),zo.hasOwnProperty(t)?{space:zo[t],local:n}:n}function y1(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===Do&&t.documentElement.namespaceURI===Do?t.createElement(n):t.createElementNS(e,n)}}function v1(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Di(n){var t=dr(n);return(t.local?v1:y1)(t)}function w1(){}function zi(n){return n==null?w1:function(){return this.querySelector(n)}}function _1(n){typeof n!="function"&&(n=zi(n));for(var t=this._groups,e=t.length,r=new Array(e),i=0;i=v&&(v=w+1);!(M=b[v])&&++v=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function G1(n){n||(n=X1);function t(s,h){return s&&h?n(s.__data__,h.__data__):!s-!h}for(var e=this._groups,r=e.length,i=new Array(r),o=0;ot?1:n>=t?0:NaN}function W1(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function V1(){return Array.from(this)}function j1(){for(var n=this._groups,t=0,e=n.length;t1?this.each((t==null?ad:typeof t=="function"?ud:fd)(n,t,e??"")):Dt(this.node(),n)}function Dt(n,t){return n.style.getPropertyValue(t)||Ra(n).getComputedStyle(n,null).getPropertyValue(t)}function ld(n){return function(){delete this[n]}}function sd(n,t){return function(){this[n]=t}}function hd(n,t){return function(){var e=t.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function dd(n,t){return arguments.length>1?this.each((t==null?ld:typeof t=="function"?hd:sd)(n,t)):this.node()[n]}function ol(n){return n.trim().split(/^|\s+/)}function Ia(n){return n.classList||new al(n)}function al(n){this._node=n,this._names=ol(n.getAttribute("class")||"")}al.prototype={add:function(n){var t=this._names.indexOf(n);t<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function fl(n,t){for(var e=Ia(n),r=-1,i=t.length;++r=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}})}function Yd(n){return function(){var t=this.__on;if(t){for(var e=0,r=-1,i=t.length,o;eBn(e,t))}function Kd(n){return typeof n=="string"?new Mn([document.querySelectorAll(n)],[document.documentElement]):new Mn([el(n)],Oa)}const fv=Object.freeze(Object.defineProperty({__proto__:null,create:jd,creator:Di,local:ll,matcher:ka,namespace:dr,namespaces:zo,pointer:Bn,pointers:Qd,select:Gn,selectAll:Kd,selection:qt,selector:zi,selectorAll:Pa,style:Dt,window:Ra},Symbol.toStringTag,{value:"Module"})),Jd={passive:!1},nr={capture:!0,passive:!1};function po(n){n.stopImmediatePropagation()}function ie(n){n.preventDefault(),n.stopImmediatePropagation()}function Da(n){var t=n.document.documentElement,e=Gn(n).on("dragstart.drag",ie,nr);"onselectstart"in t?e.on("selectstart.drag",ie,nr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function za(n,t){var e=n.document.documentElement,r=Gn(n).on("dragstart.drag",null);t&&(r.on("click.drag",ie,nr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}const Sr=n=>()=>n;function Uo(n,{sourceEvent:t,subject:e,target:r,identifier:i,active:o,x:a,y:f,dx:c,dy:u,dispatch:l}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:l}})}Uo.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function ng(n){return!n.ctrlKey&&!n.button}function tg(){return this.parentNode}function eg(n,t){return t??{x:n.x,y:n.y}}function rg(){return navigator.maxTouchPoints||"ontouchstart"in this}function ig(){var n=ng,t=tg,e=eg,r=rg,i={},o=xe("start","drag","end"),a=0,f,c,u,l,s=0;function h(y){y.on("mousedown.drag",d).filter(r).on("touchstart.drag",b).on("touchmove.drag",m,Jd).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(y,M){if(!(l||!n.call(this,y,M))){var x=v(this,t.call(this,y,M),y,M,"mouse");x&&(Gn(y.view).on("mousemove.drag",g,nr).on("mouseup.drag",p,nr),Da(y.view),po(y),u=!1,f=y.clientX,c=y.clientY,x("start",y))}}function g(y){if(ie(y),!u){var M=y.clientX-f,x=y.clientY-c;u=M*M+x*x>s}i.mouse("drag",y)}function p(y){Gn(y.view).on("mousemove.drag mouseup.drag",null),za(y.view,u),ie(y),i.mouse("end",y)}function b(y,M){if(n.call(this,y,M)){var x=y.changedTouches,$=t.call(this,y,M),N=x.length,E,P;for(E=0;E9999?"+"+Nn(n,6):Nn(n,4)}function fg(n){var t=n.getUTCHours(),e=n.getUTCMinutes(),r=n.getUTCSeconds(),i=n.getUTCMilliseconds();return isNaN(n)?"Invalid Date":ag(n.getUTCFullYear())+"-"+Nn(n.getUTCMonth()+1,2)+"-"+Nn(n.getUTCDate(),2)+(i?"T"+Nn(t,2)+":"+Nn(e,2)+":"+Nn(r,2)+"."+Nn(i,3)+"Z":r?"T"+Nn(t,2)+":"+Nn(e,2)+":"+Nn(r,2)+"Z":e||t?"T"+Nn(t,2)+":"+Nn(e,2)+"Z":"")}function Fa(n){var t=new RegExp('["'+n+` +\r]`),e=n.charCodeAt(0);function r(s,h){var d,g,p=i(s,function(b,m){if(d)return d(b,m-1);g=b,d=h?og(b,h):hl(b)});return p.columns=g||[],p}function i(s,h){var d=[],g=s.length,p=0,b=0,m,w=g<=0,v=!1;s.charCodeAt(g-1)===Ae&&--g,s.charCodeAt(g-1)===yo&&--g;function y(){if(w)return mo;if(v)return v=!1,Bf;var x,$=p,N;if(s.charCodeAt($)===bo){for(;p++=g?w=!0:(N=s.charCodeAt(p++))===Ae?v=!0:N===yo&&(v=!0,s.charCodeAt(p)===Ae&&++p),s.slice($+1,x-1).replace(/""/g,'"')}for(;p=(s=(f+u)/2))?f=s:u=s,(b=e>=(h=(c+l)/2))?c=h:l=h,i=o,!(o=o[m=b<<1|p]))return i[m]=a,n;if(d=+n._x.call(null,o.data),g=+n._y.call(null,o.data),t===d&&e===g)return a.next=o,i?i[m]=a:n._root=a,n;do i=i?i[m]=new Array(4):n._root=new Array(4),(p=t>=(s=(f+u)/2))?f=s:u=s,(b=e>=(h=(c+l)/2))?c=h:l=h;while((m=b<<1|p)===(w=(g>=h)<<1|d>=s));return i[w]=o,i[m]=a,n}function Ag(n){var t,e,r=n.length,i,o,a=new Array(r),f=new Array(r),c=1/0,u=1/0,l=-1/0,s=-1/0;for(e=0;el&&(l=i),os&&(s=o));if(c>l||u>s)return this;for(this.cover(c,u).cover(l,s),e=0;en||n>=i||r>t||t>=o;)switch(u=(tl||(f=g.y0)>s||(c=g.x1)=m)<<1|n>=b)&&(g=h[h.length-1],h[h.length-1]=h[h.length-1-p],h[h.length-1-p]=g)}else{var w=n-+this._x.call(null,d.data),v=t-+this._y.call(null,d.data),y=w*w+v*v;if(y=(h=(a+c)/2))?a=h:c=h,(p=s>=(d=(f+u)/2))?f=d:u=d,t=e,!(e=e[b=p<<1|g]))return this;if(!e.length)break;(t[b+1&3]||t[b+2&3]||t[b+3&3])&&(r=t,m=b)}for(;e.data!==n;)if(i=e,!(e=e.next))return this;return(o=e.next)&&delete e.next,i?(o?i.next=o:delete i.next,this):t?(o?t[b]=o:delete t[b],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(r?r[m]=e:this._root=e),this):(this._root=o,this)}function kg(n){for(var t=0,e=n.length;th.index){var A=d-N.x-N.vx,D=g-N.y-N.vy,O=A*A+D*D;Od+P||xg+P||$u.r&&(u.r=u[l].r)}function c(){if(t){var u,l=t.length,s;for(e=new Array(l),u=0;u[t(M,x,a),M])),y;for(b=0,f=new Array(m);b=0&&n._call.call(void 0,t),n=n._next;--le}function Wf(){zt=(ii=tr.now())+Ui,le=Ie=0;try{ml()}finally{le=0,Vg(),zt=0}}function Wg(){var n=tr.now(),t=n-ii;t>gl&&(Ui-=t,ii=n)}function Vg(){for(var n,t=ri,e,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:ri=e);Oe=n,Lo(r)}function Lo(n){if(!le){Ie&&(Ie=clearTimeout(Ie));var t=n-zt;t>24?(n<1/0&&(Ie=setTimeout(Wf,n-tr.now()-Ui)),Ee&&(Ee=clearInterval(Ee))):(Ee||(ii=tr.now(),Ee=setInterval(Wg,gl)),le=1,pl(Wf))}}function Yo(n,t,e){var r=new er;return t=t==null?0:+t,r.restart(i=>{r.stop(),n(i+t)},t,e),r}function jg(n,t,e){var r=new er,i=t;return t==null?(r.restart(n,t,e),r):(r._restart=r.restart,r.restart=function(o,a,f){a=+a,f=f==null?gr():+f,r._restart(function c(u){u+=i,r._restart(c,i+=a,f),o(u)},a,f)},r.restart(n,t,e),r)}const sv=Object.freeze(Object.defineProperty({__proto__:null,interval:jg,now:gr,timeout:Yo,timer:Li,timerFlush:ml},Symbol.toStringTag,{value:"Module"})),Zg=1664525,Qg=1013904223,Vf=4294967296;function Kg(){let n=1;return()=>(n=(Zg*n+Qg)%Vf)/Vf}function Jg(n){return n.x}function n2(n){return n.y}var t2=10,e2=Math.PI*(3-Math.sqrt(5));function r2(n){var t,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,f=new Map,c=Li(s),u=xe("tick","end"),l=Kg();n==null&&(n=[]);function s(){h(),u.call("tick",t),e1?(b==null?f.delete(p):f.set(p,g(b)),t):f.get(p)},find:function(p,b,m){var w=0,v=n.length,y,M,x,$,N;for(m==null?m=1/0:m*=m,w=0;w1?(u.on(p,b),t):u.on(p)}}}function i2(){var n,t,e,r,i=ln(-30),o,a=1,f=1/0,c=.81;function u(d){var g,p=n.length,b=Fi(n,Jg,n2).visitAfter(s);for(r=d,g=0;g=f)return;(d.data!==t||d.next)&&(m===0&&(m=wt(e),y+=m*m),w===0&&(w=wt(e),y+=w*w),y=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function oi(n,t){if((e=(n=t?n.toExponential(t-1):n.toExponential()).indexOf("e"))<0)return null;var e,r=n.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+n.slice(e+1)]}function se(n){return n=oi(Math.abs(n)),n?n[1]:NaN}function c2(n,t){return function(e,r){for(var i=e.length,o=[],a=0,f=n[0],c=0;i>0&&f>0&&(c+f+1>r&&(f=Math.max(1,r-c)),o.push(e.substring(i-=f,i+f)),!((c+=f+1)>r));)f=n[a=(a+1)%n.length];return o.reverse().join(t)}}function l2(n){return function(t){return t.replace(/[0-9]/g,function(e){return n[+e]})}}var s2=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function he(n){if(!(t=s2.exec(n)))throw new Error("invalid format: "+n);var t;return new Yi({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}he.prototype=Yi.prototype;function Yi(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}Yi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function h2(n){n:for(var t=n.length,e=1,r=-1,i;e0&&(r=0);break}return r>0?n.slice(0,r)+n.slice(i+1):n}var bl;function d2(n,t){var e=oi(n,t);if(!e)return n+"";var r=e[0],i=e[1],o=i-(bl=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+oi(n,Math.max(0,t+o-1))[0]}function jf(n,t){var e=oi(n,t);if(!e)return n+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Zf={"%":(n,t)=>(n*100).toFixed(t),b:n=>Math.round(n).toString(2),c:n=>n+"",d:u2,e:(n,t)=>n.toExponential(t),f:(n,t)=>n.toFixed(t),g:(n,t)=>n.toPrecision(t),o:n=>Math.round(n).toString(8),p:(n,t)=>jf(n*100,t),r:jf,s:d2,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function Qf(n){return n}var Kf=Array.prototype.map,Jf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yl(n){var t=n.grouping===void 0||n.thousands===void 0?Qf:c2(Kf.call(n.grouping,Number),n.thousands+""),e=n.currency===void 0?"":n.currency[0]+"",r=n.currency===void 0?"":n.currency[1]+"",i=n.decimal===void 0?".":n.decimal+"",o=n.numerals===void 0?Qf:l2(Kf.call(n.numerals,String)),a=n.percent===void 0?"%":n.percent+"",f=n.minus===void 0?"−":n.minus+"",c=n.nan===void 0?"NaN":n.nan+"";function u(s){s=he(s);var h=s.fill,d=s.align,g=s.sign,p=s.symbol,b=s.zero,m=s.width,w=s.comma,v=s.precision,y=s.trim,M=s.type;M==="n"?(w=!0,M="g"):Zf[M]||(v===void 0&&(v=12),y=!0,M="g"),(b||h==="0"&&d==="=")&&(b=!0,h="0",d="=");var x=p==="$"?e:p==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",$=p==="$"?r:/[%p]/.test(M)?a:"",N=Zf[M],E=/[defgprs%]/.test(M);v=v===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(A){var D=x,O=$,_,S,T;if(M==="c")O=N(A)+O,A="";else{A=+A;var C=A<0||1/A<0;if(A=isNaN(A)?c:N(Math.abs(A),v),y&&(A=h2(A)),C&&+A==0&&g!=="+"&&(C=!1),D=(C?g==="("?g:f:g==="-"||g==="("?"":g)+D,O=(M==="s"?Jf[8+bl/3]:"")+O+(C&&g==="("?")":""),E){for(_=-1,S=A.length;++_T||T>57){O=(T===46?i+A.slice(_+1):A.slice(_))+O,A=A.slice(0,_);break}}}w&&!b&&(A=t(A,1/0));var I=D.length+A.length+O.length,R=I>1)+D+A+O+R.slice(I);break;default:A=R+D+A+O;break}return o(A)}return P.toString=function(){return s+""},P}function l(s,h){var d=u((s=he(s),s.type="f",s)),g=Math.max(-8,Math.min(8,Math.floor(se(h)/3)))*3,p=Math.pow(10,-g),b=Jf[8+g/3];return function(m){return d(p*m)+b}}return{format:u,formatPrefix:l}}var Tr,qi,La;vl({thousands:",",grouping:[3],currency:["$",""]});function vl(n){return Tr=yl(n),qi=Tr.format,La=Tr.formatPrefix,Tr}function wl(n){return Math.max(0,-se(Math.abs(n)))}function _l(n,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(se(t)/3)))*3-se(Math.abs(n)))}function xl(n,t){return n=Math.abs(n),t=Math.abs(t)-n,Math.max(0,se(t)-se(n))+1}const dv=Object.freeze(Object.defineProperty({__proto__:null,FormatSpecifier:Yi,get format(){return qi},formatDefaultLocale:vl,formatLocale:yl,get formatPrefix(){return La},formatSpecifier:he,precisionFixed:wl,precisionPrefix:_l,precisionRound:xl},Symbol.toStringTag,{value:"Module"}));function Ml(n,t,e,r,i){var o=n*n,a=o*n;return((1-3*n+3*o-a)*t+(4-6*o+3*a)*e+(1+3*n+3*o-3*a)*r+a*i)/6}function Sl(n){var t=n.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,t-1):Math.floor(e*t),i=n[r],o=n[r+1],a=r>0?n[r-1]:2*i-o,f=r()=>n;function Al(n,t){return function(e){return n+e*t}}function g2(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(r){return Math.pow(n+r*t,e)}}function Hi(n,t){var e=t-n;return e?Al(n,e>180||e<-180?e-360*Math.round(e/360):e):Bi(isNaN(n)?t:n)}function p2(n){return(n=+n)==1?dn:function(t,e){return e-t?g2(t,e,n):Bi(isNaN(t)?e:t)}}function dn(n,t){var e=t-n;return e?Al(n,e):Bi(isNaN(n)?t:n)}const rr=function n(t){var e=p2(t);function r(i,o){var a=e((i=ce(i)).r,(o=ce(o)).r),f=e(i.g,o.g),c=e(i.b,o.b),u=dn(i.opacity,o.opacity);return function(l){return i.r=a(l),i.g=f(l),i.b=c(l),i.opacity=u(l),i+""}}return r.gamma=n,r}(1);function El(n){return function(t){var e=t.length,r=new Array(e),i=new Array(e),o=new Array(e),a,f;for(a=0;ae&&(o=t.slice(e,o),f[a]?f[a]+=o:f[++a]=o),(r=r[0])===(i=i[0])?f[a]?f[a]+=i:f[++a]=i:(f[++a]=null,c.push({i:a,x:Dn(r,i)})),e=vo.lastIndex;return e180?l+=360:l-u>180&&(u+=360),h.push({i:s.push(i(s)+"rotate(",null,r)-2,x:Dn(u,l)})):l&&s.push(i(s)+"rotate("+l+r)}function f(u,l,s,h){u!==l?h.push({i:s.push(i(s)+"skewX(",null,r)-2,x:Dn(u,l)}):l&&s.push(i(s)+"skewX("+l+r)}function c(u,l,s,h,d,g){if(u!==s||l!==h){var p=d.push(i(d)+"scale(",null,",",null,")");g.push({i:p-4,x:Dn(u,s)},{i:p-2,x:Dn(l,h)})}else(s!==1||h!==1)&&d.push(i(d)+"scale("+s+","+h+")")}return function(u,l){var s=[],h=[];return u=n(u),l=n(l),o(u.translateX,u.translateY,l.translateX,l.translateY,s,h),a(u.rotate,l.rotate,s,h),f(u.skewX,l.skewX,s,h),c(u.scaleX,u.scaleY,l.scaleX,l.scaleY,s,h),u=l=null,function(d){for(var g=-1,p=h.length,b;++gt&&(e=n,n=t,t=e),function(r){return Math.max(n,Math.min(t,r))}}function z2(n,t,e){var r=n[0],i=n[1],o=t[0],a=t[1];return i2?F2:z2,c=u=null,s}function s(h){return h==null||isNaN(h=+h)?o:(c||(c=f(n.map(r),t,e)))(r(a(h)))}return s.invert=function(h){return a(i((u||(u=f(t,n.map(r),Dn)))(h)))},s.domain=function(h){return arguments.length?(n=Array.from(h,ai),l()):n.slice()},s.range=function(h){return arguments.length?(t=Array.from(h),l()):t.slice()},s.rangeRound=function(h){return t=Array.from(h),e=Gi,l()},s.clamp=function(h){return arguments.length?(a=h?!0:xn,l()):a!==xn},s.interpolate=function(h){return arguments.length?(e=h,l()):e},s.unknown=function(h){return arguments.length?(o=h,s):o},function(h,d){return r=h,i=d,l()}}function Ga(){return Wi()(xn,xn)}function Bl(n,t,e,r){var i=jr(n,t,e),o;switch(r=he(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(t));return r.precision==null&&!isNaN(o=_l(i,a))&&(r.precision=o),La(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=xl(i,Math.max(Math.abs(n),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=wl(i))&&(r.precision=o-(r.type==="%")*2);break}}return qi(r)}function Tt(n){var t=n.domain;return n.ticks=function(e){var r=t();return Ze(r[0],r[r.length-1],e??10)},n.tickFormat=function(e,r){var i=t();return Bl(i[0],i[i.length-1],e??10,r)},n.nice=function(e){e==null&&(e=10);var r=t(),i=0,o=r.length-1,a=r[i],f=r[o],c,u,l=10;for(f0;){if(u=It(a,f,e),u===c)return r[i]=a,r[o]=f,t(r);if(u>0)a=Math.floor(a/u)*u,f=Math.ceil(f/u)*u;else if(u<0)a=Math.ceil(a*u)/u,f=Math.floor(f*u)/u;else break;c=u}return n},n}function Hl(){var n=Ga();return n.copy=function(){return pr(n,Hl())},Ln.apply(n,arguments),Tt(n)}function Gl(n){var t;function e(r){return r==null||isNaN(r=+r)?t:r}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(n=Array.from(r,ai),e):n.slice()},e.unknown=function(r){return arguments.length?(t=r,e):t},e.copy=function(){return Gl(n).unknown(t)},n=arguments.length?Array.from(n,ai):[0,1],Tt(e)}function Xl(n,t){n=n.slice();var e=0,r=n.length-1,i=n[e],o=n[r],a;return oMath.pow(n,t)}function B2(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),t=>Math.log(t)/n)}function ou(n){return(t,e)=>-n(-t,e)}function Xa(n){const t=n(ru,iu),e=t.domain;let r=10,i,o;function a(){return i=B2(r),o=q2(r),e()[0]<0?(i=ou(i),o=ou(o),n(U2,L2)):n(ru,iu),t}return t.base=function(f){return arguments.length?(r=+f,a()):r},t.domain=function(f){return arguments.length?(e(f),a()):e()},t.ticks=f=>{const c=e();let u=c[0],l=c[c.length-1];const s=l0){for(;h<=d;++h)for(g=1;gl)break;m.push(p)}}else for(;h<=d;++h)for(g=r-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(pl)break;m.push(p)}m.length*2{if(f==null&&(f=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=he(c)).precision==null&&(c.trim=!0),c=qi(c)),f===1/0)return c;const u=Math.max(1,r*f/t.ticks().length);return l=>{let s=l/o(Math.round(i(l)));return s*re(Xl(e(),{floor:f=>o(Math.floor(i(f))),ceil:f=>o(Math.ceil(i(f)))})),t}function Wl(){const n=Xa(Wi()).domain([1,10]);return n.copy=()=>pr(n,Wl()).base(n.base()),Ln.apply(n,arguments),n}function au(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function fu(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function Wa(n){var t=1,e=n(au(t),fu(t));return e.constant=function(r){return arguments.length?n(au(t=+r),fu(t)):t},Tt(e)}function Vl(){var n=Wa(Wi());return n.copy=function(){return pr(n,Vl()).constant(n.constant())},Ln.apply(n,arguments)}function uu(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function H2(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function G2(n){return n<0?-n*n:n*n}function Va(n){var t=n(xn,xn),e=1;function r(){return e===1?n(xn,xn):e===.5?n(H2,G2):n(uu(e),uu(1/e))}return t.exponent=function(i){return arguments.length?(e=+i,r()):e},Tt(t)}function ja(){var n=Va(Wi());return n.copy=function(){return pr(n,ja()).exponent(n.exponent())},Ln.apply(n,arguments),n}function X2(){return ja.apply(null,arguments).exponent(.5)}function cu(n){return Math.sign(n)*n*n}function W2(n){return Math.sign(n)*Math.sqrt(Math.abs(n))}function jl(){var n=Ga(),t=[0,1],e=!1,r;function i(o){var a=W2(n(o));return isNaN(a)?r:e?Math.round(a):a}return i.invert=function(o){return n.invert(cu(o))},i.domain=function(o){return arguments.length?(n.domain(o),i):n.domain()},i.range=function(o){return arguments.length?(n.range((t=Array.from(o,ai)).map(cu)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(e=!!o,i):e},i.clamp=function(o){return arguments.length?(n.clamp(o),i):n.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return jl(n.domain(),t).round(e).clamp(n.clamp()).unknown(r)},Ln.apply(i,arguments),Tt(i)}function Zl(){var n=[],t=[],e=[],r;function i(){var a=0,f=Math.max(1,t.length);for(e=new Array(f-1);++a0?e[f-1]:n[0],f=e?[r[e-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ql().domain([n,t]).range(i).unknown(o)},Ln.apply(Tt(a),arguments)}function Kl(){var n=[.5],t=[0,1],e,r=1;function i(o){return o!=null&&o<=o?t[_t(n,o,0,r)]:e}return i.domain=function(o){return arguments.length?(n=Array.from(o),r=Math.min(n.length,t.length-1),i):n.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(n.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[n[a-1],n[a]]},i.unknown=function(o){return arguments.length?(e=o,i):e},i.copy=function(){return Kl().domain(n).range(t).unknown(e)},Ln.apply(i,arguments)}const wo=new Date,_o=new Date;function cn(n,t,e,r){function i(o){return n(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(n(o=new Date(+o)),o),i.ceil=o=>(n(o=new Date(o-1)),t(o,1),n(o),o),i.round=o=>{const a=i(o),f=i.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,f)=>{const c=[];if(o=i.ceil(o),f=f==null?1:Math.floor(f),!(o0))return c;let u;do c.push(u=new Date(+o)),t(o,f),n(o);while(ucn(a=>{if(a>=a)for(;n(a),!o(a);)a.setTime(a-1)},(a,f)=>{if(a>=a)if(f<0)for(;++f<=0;)for(;t(a,-1),!o(a););else for(;--f>=0;)for(;t(a,1),!o(a););}),e&&(i.count=(o,a)=>(wo.setTime(+o),_o.setTime(+a),n(wo),n(_o),Math.floor(e(wo,_o))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const de=cn(()=>{},(n,t)=>{n.setTime(+n+t)},(n,t)=>t-n);de.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?cn(t=>{t.setTime(Math.floor(t/n)*n)},(t,e)=>{t.setTime(+t+e*n)},(t,e)=>(e-t)/n):de);const lu=de.range,st=1e3,Fn=st*60,ht=Fn*60,pt=ht*24,Za=pt*7,su=pt*30,xo=pt*365,dt=cn(n=>{n.setTime(n-n.getMilliseconds())},(n,t)=>{n.setTime(+n+t*st)},(n,t)=>(t-n)/st,n=>n.getUTCSeconds()),hu=dt.range,Vi=cn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*st)},(n,t)=>{n.setTime(+n+t*Fn)},(n,t)=>(t-n)/Fn,n=>n.getMinutes()),V2=Vi.range,ji=cn(n=>{n.setUTCSeconds(0,0)},(n,t)=>{n.setTime(+n+t*Fn)},(n,t)=>(t-n)/Fn,n=>n.getUTCMinutes()),j2=ji.range,Zi=cn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*st-n.getMinutes()*Fn)},(n,t)=>{n.setTime(+n+t*ht)},(n,t)=>(t-n)/ht,n=>n.getHours()),Z2=Zi.range,Qi=cn(n=>{n.setUTCMinutes(0,0,0)},(n,t)=>{n.setTime(+n+t*ht)},(n,t)=>(t-n)/ht,n=>n.getUTCHours()),Q2=Qi.range,Me=cn(n=>n.setHours(0,0,0,0),(n,t)=>n.setDate(n.getDate()+t),(n,t)=>(t-n-(t.getTimezoneOffset()-n.getTimezoneOffset())*Fn)/pt,n=>n.getDate()-1),K2=Me.range,mr=cn(n=>{n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t)},(n,t)=>(t-n)/pt,n=>n.getUTCDate()-1),J2=mr.range,Qa=cn(n=>{n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCDate(n.getUTCDate()+t)},(n,t)=>(t-n)/pt,n=>Math.floor(n/pt)),np=Qa.range;function Xt(n){return cn(t=>{t.setDate(t.getDate()-(t.getDay()+7-n)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Fn)/Za)}const ge=Xt(0),ir=Xt(1),Jl=Xt(2),ns=Xt(3),Ft=Xt(4),ts=Xt(5),es=Xt(6),du=ge.range,tp=ir.range,ep=Jl.range,rp=ns.range,ip=Ft.range,op=ts.range,ap=es.range;function Wt(n){return cn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-n)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/Za)}const pe=Wt(0),or=Wt(1),rs=Wt(2),is=Wt(3),Ut=Wt(4),os=Wt(5),as=Wt(6),gu=pe.range,fp=or.range,up=rs.range,cp=is.range,lp=Ut.range,sp=os.range,hp=as.range,Ki=cn(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,t)=>{n.setMonth(n.getMonth()+t)},(n,t)=>t.getMonth()-n.getMonth()+(t.getFullYear()-n.getFullYear())*12,n=>n.getMonth()),dp=Ki.range,Ji=cn(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCMonth(n.getUTCMonth()+t)},(n,t)=>t.getUTCMonth()-n.getUTCMonth()+(t.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth()),gp=Ji.range,et=cn(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,t)=>{n.setFullYear(n.getFullYear()+t)},(n,t)=>t.getFullYear()-n.getFullYear(),n=>n.getFullYear());et.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:cn(t=>{t.setFullYear(Math.floor(t.getFullYear()/n)*n),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*n)});const pp=et.range,rt=cn(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,t)=>{n.setUTCFullYear(n.getUTCFullYear()+t)},(n,t)=>t.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());rt.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:cn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/n)*n),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*n)});const mp=rt.range;function fs(n,t,e,r,i,o){const a=[[dt,1,st],[dt,5,5*st],[dt,15,15*st],[dt,30,30*st],[o,1,Fn],[o,5,5*Fn],[o,15,15*Fn],[o,30,30*Fn],[i,1,ht],[i,3,3*ht],[i,6,6*ht],[i,12,12*ht],[r,1,pt],[r,2,2*pt],[e,1,Za],[t,1,su],[t,3,3*su],[n,1,xo]];function f(u,l,s){const h=lb).right(a,h);if(d===a.length)return n.every(jr(u/xo,l/xo,s));if(d===0)return de.every(Math.max(jr(u,l,s),1));const[g,p]=a[h/a[d-1][2]53)return null;"w"in k||(k.w=1),"Z"in k?(J=So($e(k.y,0,1)),kn=J.getUTCDay(),J=kn>4||kn===0?or.ceil(J):or(J),J=mr.offset(J,(k.V-1)*7),k.y=J.getUTCFullYear(),k.m=J.getUTCMonth(),k.d=J.getUTCDate()+(k.w+6)%7):(J=Mo($e(k.y,0,1)),kn=J.getDay(),J=kn>4||kn===0?ir.ceil(J):ir(J),J=Me.offset(J,(k.V-1)*7),k.y=J.getFullYear(),k.m=J.getMonth(),k.d=J.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),kn="Z"in k?So($e(k.y,0,1)).getUTCDay():Mo($e(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(kn+5)%7:k.w+k.U*7-(kn+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,So(k)):Mo(k)}}function N(F,X,V,k){for(var $n=0,J=X.length,kn=V.length,Rn,Et;$n=kn)return-1;if(Rn=X.charCodeAt($n++),Rn===37){if(Rn=X.charAt($n++),Et=M[Rn in pu?X.charAt($n++):Rn],!Et||(k=Et(F,V,k))<0)return-1}else if(Rn!=V.charCodeAt(k++))return-1}return k}function E(F,X,V){var k=u.exec(X.slice(V));return k?(F.p=l.get(k[0].toLowerCase()),V+k[0].length):-1}function P(F,X,V){var k=d.exec(X.slice(V));return k?(F.w=g.get(k[0].toLowerCase()),V+k[0].length):-1}function A(F,X,V){var k=s.exec(X.slice(V));return k?(F.w=h.get(k[0].toLowerCase()),V+k[0].length):-1}function D(F,X,V){var k=m.exec(X.slice(V));return k?(F.m=w.get(k[0].toLowerCase()),V+k[0].length):-1}function O(F,X,V){var k=p.exec(X.slice(V));return k?(F.m=b.get(k[0].toLowerCase()),V+k[0].length):-1}function _(F,X,V){return N(F,t,X,V)}function S(F,X,V){return N(F,e,X,V)}function T(F,X,V){return N(F,r,X,V)}function C(F){return a[F.getDay()]}function I(F){return o[F.getDay()]}function R(F){return c[F.getMonth()]}function L(F){return f[F.getMonth()]}function H(F){return i[+(F.getHours()>=12)]}function Z(F){return 1+~~(F.getMonth()/3)}function on(F){return a[F.getUTCDay()]}function nn(F){return o[F.getUTCDay()]}function un(F){return c[F.getUTCMonth()]}function Yn(F){return f[F.getUTCMonth()]}function Pn(F){return i[+(F.getUTCHours()>=12)]}function qn(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var X=x(F+="",v);return X.toString=function(){return F},X},parse:function(F){var X=$(F+="",!1);return X.toString=function(){return F},X},utcFormat:function(F){var X=x(F+="",y);return X.toString=function(){return F},X},utcParse:function(F){var X=$(F+="",!0);return X.toString=function(){return F},X}}}var pu={"-":"",_:" ",0:"0"},pn=/^\s*\d+/,bp=/^%/,yp=/[\\^$*+?|[\]().{}]/g;function j(n,t,e){var r=n<0?"-":"",i=(r?-n:n)+"",o=i.length;return r+(o[t.toLowerCase(),e]))}function wp(n,t,e){var r=pn.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function _p(n,t,e){var r=pn.exec(t.slice(e,e+1));return r?(n.u=+r[0],e+r[0].length):-1}function xp(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.U=+r[0],e+r[0].length):-1}function Mp(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.V=+r[0],e+r[0].length):-1}function Sp(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.W=+r[0],e+r[0].length):-1}function mu(n,t,e){var r=pn.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function bu(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Tp(n,t,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return r?(n.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Ap(n,t,e){var r=pn.exec(t.slice(e,e+1));return r?(n.q=r[0]*3-3,e+r[0].length):-1}function Ep(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function yu(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function $p(n,t,e){var r=pn.exec(t.slice(e,e+3));return r?(n.m=0,n.d=+r[0],e+r[0].length):-1}function vu(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Np(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function Cp(n,t,e){var r=pn.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function Pp(n,t,e){var r=pn.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function kp(n,t,e){var r=pn.exec(t.slice(e,e+6));return r?(n.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Rp(n,t,e){var r=bp.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function Ip(n,t,e){var r=pn.exec(t.slice(e));return r?(n.Q=+r[0],e+r[0].length):-1}function Op(n,t,e){var r=pn.exec(t.slice(e));return r?(n.s=+r[0],e+r[0].length):-1}function wu(n,t){return j(n.getDate(),t,2)}function Dp(n,t){return j(n.getHours(),t,2)}function zp(n,t){return j(n.getHours()%12||12,t,2)}function Fp(n,t){return j(1+Me.count(et(n),n),t,3)}function ds(n,t){return j(n.getMilliseconds(),t,3)}function Up(n,t){return ds(n,t)+"000"}function Lp(n,t){return j(n.getMonth()+1,t,2)}function Yp(n,t){return j(n.getMinutes(),t,2)}function qp(n,t){return j(n.getSeconds(),t,2)}function Bp(n){var t=n.getDay();return t===0?7:t}function Hp(n,t){return j(ge.count(et(n)-1,n),t,2)}function gs(n){var t=n.getDay();return t>=4||t===0?Ft(n):Ft.ceil(n)}function Gp(n,t){return n=gs(n),j(Ft.count(et(n),n)+(et(n).getDay()===4),t,2)}function Xp(n){return n.getDay()}function Wp(n,t){return j(ir.count(et(n)-1,n),t,2)}function Vp(n,t){return j(n.getFullYear()%100,t,2)}function jp(n,t){return n=gs(n),j(n.getFullYear()%100,t,2)}function Zp(n,t){return j(n.getFullYear()%1e4,t,4)}function Qp(n,t){var e=n.getDay();return n=e>=4||e===0?Ft(n):Ft.ceil(n),j(n.getFullYear()%1e4,t,4)}function Kp(n){var t=n.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+j(t/60|0,"0",2)+j(t%60,"0",2)}function _u(n,t){return j(n.getUTCDate(),t,2)}function Jp(n,t){return j(n.getUTCHours(),t,2)}function nm(n,t){return j(n.getUTCHours()%12||12,t,2)}function tm(n,t){return j(1+mr.count(rt(n),n),t,3)}function ps(n,t){return j(n.getUTCMilliseconds(),t,3)}function em(n,t){return ps(n,t)+"000"}function rm(n,t){return j(n.getUTCMonth()+1,t,2)}function im(n,t){return j(n.getUTCMinutes(),t,2)}function om(n,t){return j(n.getUTCSeconds(),t,2)}function am(n){var t=n.getUTCDay();return t===0?7:t}function fm(n,t){return j(pe.count(rt(n)-1,n),t,2)}function ms(n){var t=n.getUTCDay();return t>=4||t===0?Ut(n):Ut.ceil(n)}function um(n,t){return n=ms(n),j(Ut.count(rt(n),n)+(rt(n).getUTCDay()===4),t,2)}function cm(n){return n.getUTCDay()}function lm(n,t){return j(or.count(rt(n)-1,n),t,2)}function sm(n,t){return j(n.getUTCFullYear()%100,t,2)}function hm(n,t){return n=ms(n),j(n.getUTCFullYear()%100,t,2)}function dm(n,t){return j(n.getUTCFullYear()%1e4,t,4)}function gm(n,t){var e=n.getUTCDay();return n=e>=4||e===0?Ut(n):Ut.ceil(n),j(n.getUTCFullYear()%1e4,t,4)}function pm(){return"+0000"}function xu(){return"%"}function Mu(n){return+n}function Su(n){return Math.floor(+n/1e3)}var Zt,Ka,bs,no,Ja;ys({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"]});function ys(n){return Zt=hs(n),Ka=Zt.format,bs=Zt.parse,no=Zt.utcFormat,Ja=Zt.utcParse,Zt}var vs="%Y-%m-%dT%H:%M:%S.%LZ";function mm(n){return n.toISOString()}var bm=Date.prototype.toISOString?mm:no(vs);const ym=bm;function vm(n){var t=new Date(n);return isNaN(t)?null:t}var wm=+new Date("2000-01-01T00:00:00.000Z")?vm:Ja(vs);const _m=wm,mv=Object.freeze(Object.defineProperty({__proto__:null,isoFormat:ym,isoParse:_m,get timeFormat(){return Ka},timeFormatDefaultLocale:ys,timeFormatLocale:hs,get timeParse(){return bs},get utcFormat(){return no},get utcParse(){return Ja}},Symbol.toStringTag,{value:"Module"}));function xm(n){return new Date(n)}function Mm(n){return n instanceof Date?+n:+new Date(+n)}function nf(n,t,e,r,i,o,a,f,c,u){var l=Ga(),s=l.invert,h=l.domain,d=u(".%L"),g=u(":%S"),p=u("%I:%M"),b=u("%I %p"),m=u("%a %d"),w=u("%b %d"),v=u("%B"),y=u("%Y");function M(x){return(c(x)t(i/(n.length-1)))},e.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Qe(n,o/r))},e.copy=function(){return Ms(t).domain(n)},bt.apply(e,arguments)}function eo(){var n=0,t=.5,e=1,r=1,i,o,a,f,c,u=xn,l,s=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+l(p))-o)*(r*p$l(n[n.length-1]);var Es=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(B);const Fm=K(Es);var $s=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(B);const Um=K($s);var Ns=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(B);const Lm=K(Ns);var Cs=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(B);const Ym=K(Cs);var Ps=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(B);const qm=K(Ps);var ks=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(B);const Bm=K(ks);var Rs=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(B);const Hm=K(Rs);var Is=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(B);const Gm=K(Is);var Os=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(B);const Xm=K(Os);var Ds=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(B);const Wm=K(Ds);var zs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(B);const Vm=K(zs);var Fs=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(B);const jm=K(Fs);var Us=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(B);const Zm=K(Us);var Ls=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(B);const Qm=K(Ls);var Ys=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(B);const Km=K(Ys);var qs=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(B);const Jm=K(qs);var Bs=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(B);const nb=K(Bs);var Hs=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(B);const tb=K(Hs);var Gs=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(B);const eb=K(Gs);var Xs=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(B);const rb=K(Xs);var Ws=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(B);const ib=K(Ws);var Vs=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(B);const ob=K(Vs);var js=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(B);const ab=K(js);var Zs=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(B);const fb=K(Zs);var Qs=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(B);const ub=K(Qs);var Ks=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(B);const cb=K(Ks);var Js=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(B);const lb=K(Js);function sb(n){return n=Math.max(0,Math.min(1,n)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-n*(35.34-n*(2381.73-n*(6402.7-n*(7024.72-n*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+n*(170.73+n*(52.82-n*(131.46-n*(176.58-n*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+n*(442.36-n*(2482.43-n*(6167.24-n*(6614.94-n*2475.67)))))))+")"}const hb=Xi(jn(300,.5,0),jn(-240,.5,1));var db=Xi(jn(-100,.75,.35),jn(80,1.5,.8)),gb=Xi(jn(260,.75,.35),jn(80,1.5,.8)),Er=jn();function pb(n){(n<0||n>1)&&(n-=Math.floor(n));var t=Math.abs(n-.5);return Er.h=360*n-100,Er.s=1.5-1.5*t,Er.l=.8-.9*t,Er+""}var $r=ce(),mb=Math.PI/3,bb=Math.PI*2/3;function yb(n){var t;return n=(.5-n)*Math.PI,$r.r=255*(t=Math.sin(n))*t,$r.g=255*(t=Math.sin(n+mb))*t,$r.b=255*(t=Math.sin(n+bb))*t,$r+""}function vb(n){return n=Math.max(0,Math.min(1,n)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+n*(1172.33-n*(10793.56-n*(33300.12-n*(38394.49-n*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+n*(557.33+n*(1225.33-n*(3574.96-n*(1073.77+n*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+n*(3211.1-n*(15327.97-n*(27814-n*(22569.18-n*6838.66)))))))+")"}function ro(n){var t=n.length;return function(e){return n[Math.max(0,Math.min(t-1,Math.floor(e*t)))]}}const wb=ro(B("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var _b=ro(B("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),xb=ro(B("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Mb=ro(B("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));const yv=Object.freeze(Object.defineProperty({__proto__:null,interpolateBlues:ob,interpolateBrBG:Fm,interpolateBuGn:Wm,interpolateBuPu:Vm,interpolateCividis:sb,interpolateCool:gb,interpolateCubehelixDefault:hb,interpolateGnBu:jm,interpolateGreens:ab,interpolateGreys:fb,interpolateInferno:xb,interpolateMagma:_b,interpolateOrRd:Zm,interpolateOranges:lb,interpolatePRGn:Um,interpolatePiYG:Lm,interpolatePlasma:Mb,interpolatePuBu:Km,interpolatePuBuGn:Qm,interpolatePuOr:Ym,interpolatePuRd:Jm,interpolatePurples:ub,interpolateRainbow:pb,interpolateRdBu:qm,interpolateRdGy:Bm,interpolateRdPu:nb,interpolateRdYlBu:Hm,interpolateRdYlGn:Gm,interpolateReds:cb,interpolateSinebow:yb,interpolateSpectral:Xm,interpolateTurbo:vb,interpolateViridis:wb,interpolateWarm:db,interpolateYlGn:eb,interpolateYlGnBu:tb,interpolateYlOrBr:rb,interpolateYlOrRd:ib,schemeAccent:Nm,schemeBlues:Vs,schemeBrBG:Es,schemeBuGn:Ds,schemeBuPu:zs,schemeCategory10:$m,schemeDark2:Cm,schemeGnBu:Fs,schemeGreens:js,schemeGreys:Zs,schemeOrRd:Us,schemeOranges:Js,schemePRGn:$s,schemePaired:Pm,schemePastel1:km,schemePastel2:Rm,schemePiYG:Ns,schemePuBu:Ys,schemePuBuGn:Ls,schemePuOr:Cs,schemePuRd:qs,schemePurples:Qs,schemeRdBu:Ps,schemeRdGy:ks,schemeRdPu:Bs,schemeRdYlBu:Rs,schemeRdYlGn:Is,schemeReds:Ks,schemeSet1:Im,schemeSet2:Om,schemeSet3:Dm,schemeSpectral:Os,schemeTableau10:zm,schemeYlGn:Gs,schemeYlGnBu:Hs,schemeYlOrBr:Xs,schemeYlOrRd:Ws},Symbol.toStringTag,{value:"Module"}));var Sb=xe("start","end","cancel","interrupt"),Tb=[],n0=0,Xo=1,Wo=2,Yr=3,Tu=4,Vo=5,qr=6;function io(n,t,e,r,i,o){var a=n.__transition;if(!a)n.__transition={};else if(e in a)return;Ab(n,e,{name:t,index:r,group:i,on:Sb,tween:Tb,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:n0})}function rf(n,t){var e=Zn(n,t);if(e.state>n0)throw new Error("too late; already scheduled");return e}function at(n,t){var e=Zn(n,t);if(e.state>Yr)throw new Error("too late; already running");return e}function Zn(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Ab(n,t,e){var r=n.__transition,i;r[t]=e,e.timer=Li(o,0,e.time);function o(u){e.state=Xo,e.timer.restart(a,e.delay,e.time),e.delay<=u&&a(u-e.delay)}function a(u){var l,s,h,d;if(e.state!==Xo)return c();for(l in r)if(d=r[l],d.name===e.name){if(d.state===Yr)return Yo(a);d.state===Tu?(d.state=qr,d.timer.stop(),d.on.call("interrupt",n,n.__data__,d.index,d.group),delete r[l]):+lWo&&r.state=0&&(t=t.slice(0,e)),!t||t==="start"})}function ey(n,t,e){var r,i,o=ty(t)?rf:at;return function(){var a=o(this,n),f=a.on;f!==r&&(i=(r=f).copy()).on(t,e),a.on=i}}function ry(n,t){var e=this._id;return arguments.length<2?Zn(this.node(),e).on.on(n):this.each(ey(e,n,t))}function iy(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}function oy(){return this.on("end.remove",iy(this._id))}function ay(n){var t=this._name,e=this._id;typeof n!="function"&&(n=zi(n));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a+n;function $y(n){return n*n}function Ny(n){return n*(2-n)}function Au(n){return((n*=2)<=1?n*n:--n*(2-n)+1)/2}function Cy(n){return n*n*n}function Py(n){return--n*n*n+1}function jo(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var af=3,ky=function n(t){t=+t;function e(r){return Math.pow(r,t)}return e.exponent=n,e}(af),Ry=function n(t){t=+t;function e(r){return 1-Math.pow(1-r,t)}return e.exponent=n,e}(af),Eu=function n(t){t=+t;function e(r){return((r*=2)<=1?Math.pow(r,t):2-Math.pow(2-r,t))/2}return e.exponent=n,e}(af),o0=Math.PI,a0=o0/2;function Iy(n){return+n==1?1:1-Math.cos(n*a0)}function Oy(n){return Math.sin(n*a0)}function $u(n){return(1-Math.cos(o0*n))/2}function Mt(n){return(Math.pow(2,-10*n)-.0009765625)*1.0009775171065494}function Dy(n){return Mt(1-+n)}function zy(n){return 1-Mt(n)}function Nu(n){return((n*=2)<=1?Mt(1-n):2-Mt(n-1))/2}function Fy(n){return 1-Math.sqrt(1-n*n)}function Uy(n){return Math.sqrt(1- --n*n)}function Cu(n){return((n*=2)<=1?1-Math.sqrt(1-n*n):Math.sqrt(1-(n-=2)*n)+1)/2}var Zo=4/11,Ly=6/11,Yy=8/11,qy=3/4,By=9/11,Hy=10/11,Gy=15/16,Xy=21/22,Wy=63/64,Nr=1/Zo/Zo;function Vy(n){return 1-ar(1-n)}function ar(n){return(n=+n)Xo&&r.name===t)return new it([[n]],r6,t,+i)}return null}const wv=Object.freeze(Object.defineProperty({__proto__:null,active:i6,interrupt:Be,transition:r0},Symbol.toStringTag,{value:"Module"}));function o6(n){if(!n.ok)throw new Error(n.status+" "+n.statusText);if(!(n.status===204||n.status===205))return n.json()}function _v(n,t){return fetch(n,t).then(o6)}const gt=11102230246251565e-32,mn=134217729,a6=(3+8*gt)*gt;function To(n,t,e,r,i){let o,a,f,c,u=t[0],l=r[0],s=0,h=0;l>u==l>-u?(o=u,u=t[++s]):(o=l,l=r[++h]);let d=0;if(su==l>-u?(a=u+o,f=o-(a-u),u=t[++s]):(a=l+o,f=o-(a-l),l=r[++h]),o=a,f!==0&&(i[d++]=f);su==l>-u?(a=o+u,c=a-o,f=o-(a-c)+(u-c),u=t[++s]):(a=o+l,c=a-o,f=o-(a-c)+(l-c),l=r[++h]),o=a,f!==0&&(i[d++]=f);for(;s=_||-O>=_||(s=n-E,f=n-(E+s)+(s-i),s=e-P,u=e-(P+s)+(s-i),s=t-A,c=t-(A+s)+(s-o),s=r-D,l=r-(D+s)+(s-o),f===0&&c===0&&u===0&&l===0)||(_=l6*a+a6*Math.abs(O),O+=E*l+D*f-(A*u+P*c),O>=_||-O>=_))return O;y=f*D,h=mn*f,d=h-(h-f),g=f-d,h=mn*D,p=h-(h-D),b=D-p,M=g*b-(y-d*p-g*p-d*b),x=c*P,h=mn*c,d=h-(h-c),g=c-d,h=mn*P,p=h-(h-P),b=P-p,$=g*b-(x-d*p-g*p-d*b),m=M-$,s=M-m,bn[0]=M-(m+s)+(s-$),w=y+m,s=w-y,v=y-(w-s)+(m-s),m=v-x,s=v-m,bn[1]=v-(m+s)+(s-x),N=w+m,s=N-w,bn[2]=w-(N-s)+(m-s),bn[3]=N;const S=To(4,Qt,4,bn,Ru);y=E*l,h=mn*E,d=h-(h-E),g=E-d,h=mn*l,p=h-(h-l),b=l-p,M=g*b-(y-d*p-g*p-d*b),x=A*u,h=mn*A,d=h-(h-A),g=A-d,h=mn*u,p=h-(h-u),b=u-p,$=g*b-(x-d*p-g*p-d*b),m=M-$,s=M-m,bn[0]=M-(m+s)+(s-$),w=y+m,s=w-y,v=y-(w-s)+(m-s),m=v-x,s=v-m,bn[1]=v-(m+s)+(s-x),N=w+m,s=N-w,bn[2]=w-(N-s)+(m-s),bn[3]=N;const T=To(S,Ru,4,bn,Iu);y=f*l,h=mn*f,d=h-(h-f),g=f-d,h=mn*l,p=h-(h-l),b=l-p,M=g*b-(y-d*p-g*p-d*b),x=c*u,h=mn*c,d=h-(h-c),g=c-d,h=mn*u,p=h-(h-u),b=u-p,$=g*b-(x-d*p-g*p-d*b),m=M-$,s=M-m,bn[0]=M-(m+s)+(s-$),w=y+m,s=w-y,v=y-(w-s)+(m-s),m=v-x,s=v-m,bn[1]=v-(m+s)+(s-x),N=w+m,s=N-w,bn[2]=w-(N-s)+(m-s),bn[3]=N;const C=To(T,Iu,4,bn,Ou);return Ou[C-1]}function Cr(n,t,e,r,i,o){const a=(t-o)*(e-i),f=(n-i)*(r-o),c=a-f,u=Math.abs(a+f);return Math.abs(c)>=u6*u?c:-s6(n,t,e,r,i,o,u)}const Du=Math.pow(2,-52),Pr=new Uint32Array(512);class fi{static from(t,e=m6,r=b6){const i=t.length,o=new Float64Array(i*2);for(let a=0;a>1;if(e>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*e-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:r,_hullTri:i,_hullHash:o}=this,a=t.length>>1;let f=1/0,c=1/0,u=-1/0,l=-1/0;for(let E=0;Eu&&(u=P),A>l&&(l=A),this._ids[E]=E}const s=(f+u)/2,h=(c+l)/2;let d,g,p;for(let E=0,P=1/0;E0&&(g=E,P=A)}let w=t[2*g],v=t[2*g+1],y=1/0;for(let E=0;ED&&(E[P++]=O,D=_)}this.hull=E.subarray(0,P),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Cr(b,m,w,v,M,x)<0){const E=g,P=w,A=v;g=p,w=M,v=x,p=E,M=P,x=A}const $=p6(b,m,w,v,M,x);this._cx=$.x,this._cy=$.y;for(let E=0;E0&&Math.abs(O-P)<=Du&&Math.abs(_-A)<=Du||(P=O,A=_,D===d||D===g||D===p))continue;let S=0;for(let L=0,H=this._hashKey(O,_);L=0;)if(T=C,T===S){T=-1;break}if(T===-1)continue;let I=this._addTriangle(T,D,r[T],-1,-1,i[T]);i[D]=this._legalize(I+2),i[T]=I,N++;let R=r[T];for(;C=r[R],Cr(O,_,t[2*R],t[2*R+1],t[2*C],t[2*C+1])<0;)I=this._addTriangle(R,D,C,i[D],-1,i[R]),i[D]=this._legalize(I+2),r[R]=R,N--,R=C;if(T===S)for(;C=e[T],Cr(O,_,t[2*C],t[2*C+1],t[2*T],t[2*T+1])<0;)I=this._addTriangle(C,D,T,-1,i[T],i[C]),this._legalize(I+2),i[C]=I,r[T]=T,N--,T=C;this._hullStart=e[D]=T,r[T]=e[R]=D,r[D]=R,o[this._hashKey(O,_)]=D,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(N);for(let E=0,P=this._hullStart;E0?3-e:1+e)/4}function Ao(n,t,e,r){const i=n-e,o=t-r;return i*i+o*o}function d6(n,t,e,r,i,o,a,f){const c=n-a,u=t-f,l=e-a,s=r-f,h=i-a,d=o-f,g=c*c+u*u,p=l*l+s*s,b=h*h+d*d;return c*(s*b-p*d)-u*(l*b-p*h)+g*(l*d-s*h)<0}function g6(n,t,e,r,i,o){const a=e-n,f=r-t,c=i-n,u=o-t,l=a*a+f*f,s=c*c+u*u,h=.5/(a*u-f*c),d=(u*l-f*s)*h,g=(a*s-c*l)*h;return d*d+g*g}function p6(n,t,e,r,i,o){const a=e-n,f=r-t,c=i-n,u=o-t,l=a*a+f*f,s=c*c+u*u,h=.5/(a*u-f*c),d=n+(u*l-f*s)*h,g=t+(a*s-c*l)*h;return{x:d,y:g}}function ne(n,t,e,r){if(r-e<=20)for(let i=e+1;i<=r;i++){const o=n[i],a=t[o];let f=i-1;for(;f>=e&&t[n[f]]>a;)n[f+1]=n[f--];n[f+1]=o}else{const i=e+r>>1;let o=e+1,a=r;Pe(n,i,o),t[n[e]]>t[n[r]]&&Pe(n,e,r),t[n[o]]>t[n[r]]&&Pe(n,o,r),t[n[e]]>t[n[o]]&&Pe(n,e,o);const f=n[o],c=t[f];for(;;){do o++;while(t[n[o]]c);if(a=a-e?(ne(n,t,o,r),ne(n,t,e,a-1)):(ne(n,t,e,a-1),ne(n,t,o,r))}}function Pe(n,t,e){const r=n[t];n[t]=n[e],n[e]=r}function m6(n){return n[0]}function b6(n){return n[1]}const zu=1e-6;class Ct{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,r){t=+t,e=+e,r=+r;const i=t+r,o=e;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>zu||Math.abs(this._y1-o)>zu)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${e}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,e,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Qo{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class y6{constructor(t,[e,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(e=+e))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=e,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:r},vectors:i}=this;let o,a;const f=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let p=0,b=0,m=r.length,w,v;p1;)o-=2;for(let a=2;a0){if(e>=this.ymax)return null;(a=(this.ymax-e)/i)0){if(t>=this.xmax)return null;(a=(this.xmax-t)/r)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e1e-10)return!1}return!0}function M6(n,t,e){return[n+Math.sin(n+t)*e,t+Math.cos(n-t)*e]}class f0{static from(t,e=w6,r=_6,i){return new f0("length"in t?S6(t,e,r,i):Float64Array.from(T6(t,e,r,i)))}constructor(t){this._delaunator=new fi(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&x6(t)){this.collinear=Int32Array.from({length:e.length/2},(h,d)=>d).sort((h,d)=>e[2*h]-e[2*d]||e[2*h+1]-e[2*d+1]);const c=this.collinear[0],u=this.collinear[this.collinear.length-1],l=[e[2*c],e[2*c+1],e[2*u],e[2*u+1]],s=1e-8*Math.hypot(l[3]-l[1],l[2]-l[0]);for(let h=0,d=e.length/2;h0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],a[i[0]]=1,i.length===2&&(a[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new y6(this,t)}*neighbors(t){const{inedges:e,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:f}=this;if(f){const s=f.indexOf(t);s>0&&(yield f[s-1]),s=0&&o!==r&&o!==i;)r=o;return o}_step(t,e,r){const{inedges:i,hull:o,_hullIndex:a,halfedges:f,triangles:c,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let l=t,s=Kt(e-u[t*2],2)+Kt(r-u[t*2+1],2);const h=i[t];let d=h;do{let g=c[d];const p=Kt(e-u[g*2],2)+Kt(r-u[g*2+1],2);if(p0?1:n<0?-1:0},gn=Math.sqrt,lf=Math.tan;function c0(n){return n>1?0:n<-1?G:Math.acos(n)}function An(n){return n>1?fn:n<-1?-fn:Math.asin(n)}function Fu(n){return(n=z(n/2))*n}function en(){}function li(n,t){n&&Lu.hasOwnProperty(n.type)&&Lu[n.type](n,t)}var Uu={Feature:function(n,t){li(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=U(t),a=z(t),f=ea*a,c=ta*o+f*U(i),u=f*r*z(i);si.add(Tn(u,c)),na=n,ta=o,ea=a}function N6(n){return hi=new sn,Xn(n,ot),hi*2}function di(n){return[Tn(n[1],n[0]),An(n[2])]}function Lt(n){var t=n[0],e=n[1],r=U(e);return[r*U(t),r*z(t),z(e)]}function Rr(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function be(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function $o(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Ir(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function gi(n){var t=gn(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}var tn,Cn,an,On,$t,d0,g0,oe,He,yt,mt,ct={point:ra,lineStart:qu,lineEnd:Bu,polygonStart:function(){ct.point=m0,ct.lineStart=C6,ct.lineEnd=P6,He=new sn,ot.polygonStart()},polygonEnd:function(){ot.polygonEnd(),ct.point=ra,ct.lineStart=qu,ct.lineEnd=Bu,si<0?(tn=-(an=180),Cn=-(On=90)):He>Y?On=90:He<-Y&&(Cn=-90),mt[0]=tn,mt[1]=an},sphere:function(){tn=-(an=180),Cn=-(On=90)}};function ra(n,t){yt.push(mt=[tn=n,an=n]),tOn&&(On=t)}function p0(n,t){var e=Lt([n*q,t*q]);if(oe){var r=be(oe,e),i=[r[1],-r[0],0],o=be(i,r);gi(o),o=di(o);var a=n-$t,f=a>0?1:-1,c=o[0]*Q*f,u,l=W(a)>180;l^(f*$tOn&&(On=u)):(c=(c+360)%360-180,l^(f*$tOn&&(On=t))),l?n<$t?In(tn,n)>In(tn,an)&&(an=n):In(n,an)>In(tn,an)&&(tn=n):an>=tn?(nan&&(an=n)):n>$t?In(tn,n)>In(tn,an)&&(an=n):In(n,an)>In(tn,an)&&(tn=n)}else yt.push(mt=[tn=n,an=n]);tOn&&(On=t),oe=e,$t=n}function qu(){ct.point=p0}function Bu(){mt[0]=tn,mt[1]=an,ct.point=ra,oe=null}function m0(n,t){if(oe){var e=n-$t;He.add(W(e)>180?e+(e>0?360:-360):e)}else d0=n,g0=t;ot.point(n,t),p0(n,t)}function C6(){ot.lineStart()}function P6(){m0(d0,g0),ot.lineEnd(),W(He)>Y&&(tn=-(an=180)),mt[0]=tn,mt[1]=an,oe=null}function In(n,t){return(t-=n)<0?t+360:t}function k6(n,t){return n[0]-t[0]}function Hu(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:tIn(r[0],r[1])&&(r[1]=i[1]),In(i[0],r[1])>In(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=o.length-1,t=0,r=o[e];t<=e;r=i,++t)i=o[t],(f=In(r[1],i[0]))>a&&(a=f,tn=i[0],an=r[1])}return yt=mt=null,tn===1/0||Cn===1/0?[[NaN,NaN],[NaN,NaN]]:[[tn,Cn],[an,On]]}var De,pi,mi,bi,yi,vi,wi,_i,ia,oa,aa,b0,y0,yn,vn,wn,Wn={sphere:en,point:sf,lineStart:Gu,lineEnd:Xu,polygonStart:function(){Wn.lineStart=D6,Wn.lineEnd=z6},polygonEnd:function(){Wn.lineStart=Gu,Wn.lineEnd=Xu}};function sf(n,t){n*=q,t*=q;var e=U(t);yr(e*U(n),e*z(n),z(t))}function yr(n,t,e){++De,mi+=(n-mi)/De,bi+=(t-bi)/De,yi+=(e-yi)/De}function Gu(){Wn.point=I6}function I6(n,t){n*=q,t*=q;var e=U(t);yn=e*U(n),vn=e*z(n),wn=z(t),Wn.point=O6,yr(yn,vn,wn)}function O6(n,t){n*=q,t*=q;var e=U(t),r=e*U(n),i=e*z(n),o=z(t),a=Tn(gn((a=vn*o-wn*i)*a+(a=wn*r-yn*o)*a+(a=yn*i-vn*r)*a),yn*r+vn*i+wn*o);pi+=a,vi+=a*(yn+(yn=r)),wi+=a*(vn+(vn=i)),_i+=a*(wn+(wn=o)),yr(yn,vn,wn)}function Xu(){Wn.point=sf}function D6(){Wn.point=F6}function z6(){v0(b0,y0),Wn.point=sf}function F6(n,t){b0=n,y0=t,n*=q,t*=q,Wn.point=v0;var e=U(t);yn=e*U(n),vn=e*z(n),wn=z(t),yr(yn,vn,wn)}function v0(n,t){n*=q,t*=q;var e=U(t),r=e*U(n),i=e*z(n),o=z(t),a=vn*o-wn*i,f=wn*r-yn*o,c=yn*i-vn*r,u=Ko(a,f,c),l=An(u),s=u&&-l/u;ia.add(s*a),oa.add(s*f),aa.add(s*c),pi+=l,vi+=l*(yn+(yn=r)),wi+=l*(vn+(vn=i)),_i+=l*(wn+(wn=o)),yr(yn,vn,wn)}function U6(n){De=pi=mi=bi=yi=vi=wi=_i=0,ia=new sn,oa=new sn,aa=new sn,Xn(n,Wn);var t=+ia,e=+oa,r=+aa,i=Ko(t,e,r);return iG&&(n-=Math.round(n/Sn)*Sn),[n,t]}ua.invert=ua;function hf(n,t,e){return(n%=Sn)?t||e?fa(Vu(n),ju(t,e)):Vu(n):t||e?ju(t,e):ua}function Wu(n){return function(t,e){return t+=n,W(t)>G&&(t-=Math.round(t/Sn)*Sn),[t,e]}}function Vu(n){var t=Wu(n);return t.invert=Wu(-n),t}function ju(n,t){var e=U(n),r=z(n),i=U(t),o=z(t);function a(f,c){var u=U(c),l=U(f)*u,s=z(f)*u,h=z(c),d=h*e+l*r;return[Tn(s*i-d*o,l*e-h*r),An(d*i+s*o)]}return a.invert=function(f,c){var u=U(c),l=U(f)*u,s=z(f)*u,h=z(c),d=h*i-s*o;return[Tn(s*i+h*o,l*e+d*r),An(d*e-l*r)]},a}function w0(n){n=hf(n[0]*q,n[1]*q,n.length>2?n[2]*q:0);function t(e){return e=n(e[0]*q,e[1]*q),e[0]*=Q,e[1]*=Q,e}return t.invert=function(e){return e=n.invert(e[0]*q,e[1]*q),e[0]*=Q,e[1]*=Q,e},t}function _0(n,t,e,r,i,o){if(e){var a=U(t),f=z(t),c=r*e;i==null?(i=t+r*Sn,o=t-c/2):(i=Zu(a,i),o=Zu(a,o),(r>0?io)&&(i+=r*Sn));for(var u,l=i;r>0?l>o:l1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Br(n,t){return W(n[0]-t[0])=0;--f)i.point((s=l[f])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,l=h.z,d=!d}while(!h.v);i.lineEnd()}}}function Qu(n){if(t=n.length){for(var t,e=0,r=n[0],i;++e=0?1:-1,P=E*N,A=P>G,D=b*x;if(c.add(Tn(D*E*z(P),m*$+D*U(P))),a+=A?N+E*Sn:N,A^g>=e^y>=e){var O=be(Lt(d),Lt(v));gi(O);var _=be(o,O);gi(_);var S=(A^N>=0?-1:1)*An(_[2]);(r>S||r===S&&(O[0]||O[1]))&&(f+=A^N>=0?1:-1)}}return(a<-Y||a0){for(c||(i.polygonStart(),c=!0),i.lineStart(),x=0;x1&&y&2&&M.push(M.pop().concat(M.shift())),l.push(M.filter(Y6))}}return h}}function Y6(n){return n.length>1}function q6(n,t){return((n=n.x)[0]<0?n[1]-fn-Y:fn-n[1])-((t=t.x)[0]<0?t[1]-fn-Y:fn-t[1])}const ca=T0(function(){return!0},B6,G6,[-G,-fn]);function B6(n){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){n.lineStart(),i=1},point:function(o,a){var f=o>0?G:-G,c=W(o-t);W(c-G)0?fn:-fn),n.point(r,e),n.lineEnd(),n.lineStart(),n.point(f,e),n.point(o,e),i=0):r!==f&&c>=G&&(W(t-r)Y?Se((z(t)*(o=U(r))*z(e)-z(r)*(i=U(t))*z(n))/(i*o*a)):(t+r)/2}function G6(n,t,e,r){var i;if(n==null)i=e*fn,r.point(-G,i),r.point(0,i),r.point(G,i),r.point(G,0),r.point(G,-i),r.point(0,-i),r.point(-G,-i),r.point(-G,0),r.point(-G,i);else if(W(n[0]-t[0])>Y){var o=n[0]0,i=W(t)>Y;function o(l,s,h,d){_0(d,n,e,h,l,s)}function a(l,s){return U(l)*U(s)>t}function f(l){var s,h,d,g,p;return{lineStart:function(){g=d=!1,p=1},point:function(b,m){var w=[b,m],v,y=a(b,m),M=r?y?0:u(b,m):y?u(b+(b<0?G:-G),m):0;if(!s&&(g=d=y)&&l.lineStart(),y!==d&&(v=c(s,w),(!v||Br(s,v)||Br(w,v))&&(w[2]=1)),y!==d)p=0,y?(l.lineStart(),v=c(w,s),l.point(v[0],v[1])):(v=c(s,w),l.point(v[0],v[1],2),l.lineEnd()),s=v;else if(i&&s&&r^y){var x;!(M&h)&&(x=c(w,s,!0))&&(p=0,r?(l.lineStart(),l.point(x[0][0],x[0][1]),l.point(x[1][0],x[1][1]),l.lineEnd()):(l.point(x[1][0],x[1][1]),l.lineEnd(),l.lineStart(),l.point(x[0][0],x[0][1],3)))}y&&(!s||!Br(s,w))&&l.point(w[0],w[1]),s=w,d=y,h=M},lineEnd:function(){d&&l.lineEnd(),s=null},clean:function(){return p|(g&&d)<<1}}}function c(l,s,h){var d=Lt(l),g=Lt(s),p=[1,0,0],b=be(d,g),m=Rr(b,b),w=b[0],v=m-w*w;if(!v)return!h&&l;var y=t*m/v,M=-t*w/v,x=be(p,b),$=Ir(p,y),N=Ir(b,M);$o($,N);var E=x,P=Rr($,E),A=Rr(E,E),D=P*P-A*(Rr($,$)-1);if(!(D<0)){var O=gn(D),_=Ir(E,(-P-O)/A);if($o(_,$),_=di(_),!h)return _;var S=l[0],T=s[0],C=l[1],I=s[1],R;T0^_[1]<(W(_[0]-S)G^(S<=_[0]&&_[0]<=T)){var on=Ir(E,(-P+O)/A);return $o(on,$),[_,di(on)]}}}function u(l,s){var h=r?n:G-n,d=0;return l<-h?d|=1:l>h&&(d|=2),s<-h?d|=4:s>h&&(d|=8),d}return T0(a,f,o,r?[0,-n]:[-G,n-G])}function X6(n,t,e,r,i,o){var a=n[0],f=n[1],c=t[0],u=t[1],l=0,s=1,h=c-a,d=u-f,g;if(g=e-a,!(!h&&g>0)){if(g/=h,h<0){if(g0){if(g>s)return;g>l&&(l=g)}if(g=i-a,!(!h&&g<0)){if(g/=h,h<0){if(g>s)return;g>l&&(l=g)}else if(h>0){if(g0)){if(g/=d,d<0){if(g0){if(g>s)return;g>l&&(l=g)}if(g=o-f,!(!d&&g<0)){if(g/=d,d<0){if(g>s)return;g>l&&(l=g)}else if(d>0){if(g0&&(n[0]=a+l*h,n[1]=f+l*d),s<1&&(t[0]=a+s*h,t[1]=f+s*d),!0}}}}}var ze=1e9,Dr=-ze;function oo(n,t,e,r){function i(u,l){return n<=u&&u<=e&&t<=l&&l<=r}function o(u,l,s,h){var d=0,g=0;if(u==null||(d=a(u,s))!==(g=a(l,s))||c(u,l)<0^s>0)do h.point(d===0||d===3?n:e,d>1?r:t);while((d=(d+s+4)%4)!==g);else h.point(l[0],l[1])}function a(u,l){return W(u[0]-n)0?0:3:W(u[0]-e)0?2:1:W(u[1]-t)0?1:0:l>0?3:2}function f(u,l){return c(u.x,l.x)}function c(u,l){var s=a(u,1),h=a(l,1);return s!==h?s-h:s===0?l[1]-u[1]:s===1?u[0]-l[0]:s===2?u[1]-l[1]:l[0]-u[0]}return function(u){var l=u,s=x0(),h,d,g,p,b,m,w,v,y,M,x,$={point:N,lineStart:D,lineEnd:O,polygonStart:P,polygonEnd:A};function N(S,T){i(S,T)&&l.point(S,T)}function E(){for(var S=0,T=0,C=d.length;Tr&&(nn-Z)*(r-on)>(un-on)*(n-Z)&&++S:un<=r&&(nn-Z)*(r-on)<(un-on)*(n-Z)&&--S;return S}function P(){l=s,h=[],d=[],x=!0}function A(){var S=E(),T=x&&S,C=(h=Ea(h)).length;(T||C)&&(u.polygonStart(),T&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),C&&M0(h,f,S,o,u),u.polygonEnd()),l=u,h=d=g=null}function D(){$.point=_,d&&d.push(g=[]),M=!0,y=!1,w=v=NaN}function O(){h&&(_(p,b),m&&y&&s.rejoin(),h.push(s.result())),$.point=N,y&&l.lineEnd()}function _(S,T){var C=i(S,T);if(d&&g.push([S,T]),M)p=S,b=T,m=C,M=!1,C&&(l.lineStart(),l.point(S,T));else if(C&&y)l.point(S,T);else{var I=[w=Math.max(Dr,Math.min(ze,w)),v=Math.max(Dr,Math.min(ze,v))],R=[S=Math.max(Dr,Math.min(ze,S)),T=Math.max(Dr,Math.min(ze,T))];X6(I,R,n,t,e,r)?(y||(l.lineStart(),l.point(I[0],I[1])),l.point(R[0],R[1]),C||l.lineEnd(),x=!1):C&&(l.lineStart(),l.point(S,T),x=!1)}w=S,v=T,y=C}return $}}function W6(){var n=0,t=0,e=960,r=500,i,o,a;return a={stream:function(f){return i&&o===f?i:i=oo(n,t,e,r)(o=f)},extent:function(f){return arguments.length?(n=+f[0][0],t=+f[0][1],e=+f[1][0],r=+f[1][1],i=o=null,a):[[n,t],[e,r]]}}}var la,sa,Hr,Gr,ye={sphere:en,point:en,lineStart:V6,lineEnd:en,polygonStart:en,polygonEnd:en};function V6(){ye.point=Z6,ye.lineEnd=j6}function j6(){ye.point=ye.lineEnd=en}function Z6(n,t){n*=q,t*=q,sa=n,Hr=z(t),Gr=U(t),ye.point=Q6}function Q6(n,t){n*=q,t*=q;var e=z(t),r=U(t),i=W(n-sa),o=U(i),a=z(i),f=r*a,c=Gr*e-Hr*r*o,u=Hr*e+Gr*r*o;la.add(Tn(gn(f*f+c*c),u)),sa=n,Hr=e,Gr=r}function E0(n){return la=new sn,Xn(n,ye),+la}var ha=[null,null],K6={type:"LineString",coordinates:ha};function xi(n,t){return ha[0]=n,ha[1]=t,E0(K6)}var Ku={Feature:function(n,t){return Mi(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r0&&(i=xi(n[o],n[o-1]),i>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))Y}).map(h)).concat(vt(kr(o/u)*u,i,u).filter(function(v){return W(v%s)>Y}).map(d))}return m.lines=function(){return w().map(function(v){return{type:"LineString",coordinates:v}})},m.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(p(a).slice(1),g(e).reverse().slice(1),p(f).reverse().slice(1))]}},m.extent=function(v){return arguments.length?m.extentMajor(v).extentMinor(v):m.extentMinor()},m.extentMajor=function(v){return arguments.length?(r=+v[0][0],e=+v[1][0],f=+v[0][1],a=+v[1][1],r>e&&(v=r,r=e,e=v),f>a&&(v=f,f=a,a=v),m.precision(b)):[[r,f],[e,a]]},m.extentMinor=function(v){return arguments.length?(t=+v[0][0],n=+v[1][0],o=+v[0][1],i=+v[1][1],t>n&&(v=t,t=n,n=v),o>i&&(v=o,o=i,i=v),m.precision(b)):[[t,o],[n,i]]},m.step=function(v){return arguments.length?m.stepMajor(v).stepMinor(v):m.stepMinor()},m.stepMajor=function(v){return arguments.length?(l=+v[0],s=+v[1],m):[l,s]},m.stepMinor=function(v){return arguments.length?(c=+v[0],u=+v[1],m):[c,u]},m.precision=function(v){return arguments.length?(b=+v,h=rc(o,i,90),d=ic(t,n,b),g=rc(f,a,90),p=ic(r,e,b),m):b},m.extentMajor([[-180,-90+Y],[180,90-Y]]).extentMinor([[-180,-80-Y],[180,80+Y]])}function t8(){return N0()()}function e8(n,t){var e=n[0]*q,r=n[1]*q,i=t[0]*q,o=t[1]*q,a=U(r),f=z(r),c=U(o),u=z(o),l=a*U(e),s=a*z(e),h=c*U(i),d=c*z(i),g=2*An(gn(Fu(o-r)+a*c*Fu(i-e))),p=z(g),b=g?function(m){var w=z(m*=g)/p,v=z(g-m)/p,y=v*l+w*h,M=v*s+w*d,x=v*f+w*u;return[Tn(M,y)*Q,Tn(x,gn(y*y+M*M))*Q]}:function(){return[e*Q,r*Q]};return b.distance=g,b}const ur=n=>n;var Co=new sn,da=new sn,C0,P0,ga,pa,lt={point:en,lineStart:en,lineEnd:en,polygonStart:function(){lt.lineStart=r8,lt.lineEnd=o8},polygonEnd:function(){lt.lineStart=lt.lineEnd=lt.point=en,Co.add(W(da)),da=new sn},result:function(){var n=Co/2;return Co=new sn,n}};function r8(){lt.point=i8}function i8(n,t){lt.point=k0,C0=ga=n,P0=pa=t}function k0(n,t){da.add(pa*n-ga*t),ga=n,pa=t}function o8(){k0(C0,P0)}var ve=1/0,Si=ve,cr=-ve,Ti=cr,Ai={point:a8,lineStart:en,lineEnd:en,polygonStart:en,polygonEnd:en,result:function(){var n=[[ve,Si],[cr,Ti]];return cr=Ti=-(Si=ve=1/0),n}};function a8(n,t){ncr&&(cr=n),tTi&&(Ti=t)}var ma=0,ba=0,Fe=0,Ei=0,$i=0,te=0,ya=0,va=0,Ue=0,R0,I0,Qn,Kn,zn={point:Yt,lineStart:oc,lineEnd:ac,polygonStart:function(){zn.lineStart=c8,zn.lineEnd=l8},polygonEnd:function(){zn.point=Yt,zn.lineStart=oc,zn.lineEnd=ac},result:function(){var n=Ue?[ya/Ue,va/Ue]:te?[Ei/te,$i/te]:Fe?[ma/Fe,ba/Fe]:[NaN,NaN];return ma=ba=Fe=Ei=$i=te=ya=va=Ue=0,n}};function Yt(n,t){ma+=n,ba+=t,++Fe}function oc(){zn.point=f8}function f8(n,t){zn.point=u8,Yt(Qn=n,Kn=t)}function u8(n,t){var e=n-Qn,r=t-Kn,i=gn(e*e+r*r);Ei+=i*(Qn+n)/2,$i+=i*(Kn+t)/2,te+=i,Yt(Qn=n,Kn=t)}function ac(){zn.point=Yt}function c8(){zn.point=s8}function l8(){O0(R0,I0)}function s8(n,t){zn.point=O0,Yt(R0=Qn=n,I0=Kn=t)}function O0(n,t){var e=n-Qn,r=t-Kn,i=gn(e*e+r*r);Ei+=i*(Qn+n)/2,$i+=i*(Kn+t)/2,te+=i,i=Kn*n-Qn*t,ya+=i*(Qn+n),va+=i*(Kn+t),Ue+=i*3,Yt(Qn=n,Kn=t)}function D0(n){this._context=n}D0.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:{this._context.moveTo(n,t),this._point=1;break}case 1:{this._context.lineTo(n,t);break}default:{this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Sn);break}}},result:en};var wa=new sn,Po,z0,F0,Le,Ye,lr={point:en,lineStart:function(){lr.point=h8},lineEnd:function(){Po&&U0(z0,F0),lr.point=en},polygonStart:function(){Po=!0},polygonEnd:function(){Po=null},result:function(){var n=+wa;return wa=new sn,n}};function h8(n,t){lr.point=U0,z0=Le=n,F0=Ye=t}function U0(n,t){Le-=n,Ye-=t,wa.add(gn(Le*Le+Ye*Ye)),Le=n,Ye=t}let fc,Ni,uc,cc;class lc{constructor(t){this._append=t==null?L0:d8(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(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:{this._append`M${t},${e}`,this._point=1;break}case 1:{this._append`L${t},${e}`;break}default:{if(this._append`M${t},${e}`,this._radius!==uc||this._append!==Ni){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,uc=r,Ni=this._append,cc=this._,this._=i}this._+=cc;break}}}result(){const t=this._;return this._="",t.length?t:null}}function L0(n){let t=1;this._+=n[0];for(const e=n.length;t=0))throw new RangeError(`invalid digits: ${n}`);if(t>15)return L0;if(t!==fc){const e=10**t;fc=t,Ni=function(i){let o=1;this._+=i[0];for(const a=i.length;o=0))throw new RangeError(`invalid digits: ${f}`);e=c}return t===null&&(o=new lc(e)),a},a.projection(n).digits(e).context(t)}function p8(n){return{stream:vr(n)}}function vr(n){return function(t){var e=new _a;for(var r in n)e[r]=n[r];return e.stream=t,e}}function _a(){}_a.prototype={constructor:_a,point:function(n,t){this.stream.point(n,t)},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()}};function df(n,t,e){var r=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),r!=null&&n.clipExtent(null),Xn(e,n.stream(Ai)),t(Ai.result()),r!=null&&n.clipExtent(r),n}function ao(n,t,e){return df(n,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),f=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(o-a*(r[1][1]+r[0][1]))/2;n.scale(150*a).translate([f,c])},e)}function gf(n,t,e){return ao(n,[[0,0],t],e)}function pf(n,t,e){return df(n,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,f=-o*r[0][1];n.scale(150*o).translate([a,f])},e)}function mf(n,t,e){return df(n,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],f=(i-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([a,f])},e)}var sc=16,m8=U(30*q);function hc(n,t){return+t?y8(n,t):b8(n)}function b8(n){return vr({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}})}function y8(n,t){function e(r,i,o,a,f,c,u,l,s,h,d,g,p,b){var m=u-r,w=l-i,v=m*m+w*w;if(v>4*t&&p--){var y=a+h,M=f+d,x=c+g,$=gn(y*y+M*M+x*x),N=An(x/=$),E=W(W(x)-1)t||W((m*O+w*_)/v-.5)>.3||a*h+f*d+c*g2?S[2]%360*q:0,O()):[f*Q,c*Q,u*Q]},A.angle=function(S){return arguments.length?(s=S%360*q,O()):s*Q},A.reflectX=function(S){return arguments.length?(h=S?-1:1,O()):h<0},A.reflectY=function(S){return arguments.length?(d=S?-1:1,O()):d<0},A.precision=function(S){return arguments.length?(x=hc($,M=S*S),_()):gn(M)},A.fitExtent=function(S,T){return ao(A,S,T)},A.fitSize=function(S,T){return gf(A,S,T)},A.fitWidth=function(S,T){return pf(A,S,T)},A.fitHeight=function(S,T){return mf(A,S,T)};function O(){var S=dc(e,0,0,h,d,s).apply(null,t(o,a)),T=dc(e,r-S[0],i-S[1],h,d,s);return l=hf(f,c,u),$=fa(t,T),N=fa(l,$),x=hc($,M),_()}function _(){return E=P=null,A}return function(){return t=n.apply(this,arguments),A.invert=t.invert&&D,O()}}function yf(n){var t=0,e=G/3,r=bf(n),i=r(t,e);return i.parallels=function(o){return arguments.length?r(t=o[0]*q,e=o[1]*q):[t*Q,e*Q]},i}function x8(n){var t=U(n);function e(r,i){return[r*t,z(i)/t]}return e.invert=function(r,i){return[r/t,An(i*t)]},e}function Y0(n,t){var e=z(n),r=(e+z(t))/2;if(W(r)=.12&&b<.234&&p>=-.425&&p<-.214?i:b>=.166&&b<.234&&p>=-.214&&p<-.115?a:e).invert(h)},l.stream=function(h){return n&&t===h?n:n=M8([e.stream(t=h),i.stream(h),a.stream(h)])},l.precision=function(h){return arguments.length?(e.precision(h),i.precision(h),a.precision(h),s()):e.precision()},l.scale=function(h){return arguments.length?(e.scale(h),i.scale(h*.35),a.scale(h),l.translate(e.translate())):e.scale()},l.translate=function(h){if(!arguments.length)return e.translate();var d=e.scale(),g=+h[0],p=+h[1];return r=e.translate(h).clipExtent([[g-.455*d,p-.238*d],[g+.455*d,p+.238*d]]).stream(u),o=i.translate([g-.307*d,p+.201*d]).clipExtent([[g-.425*d+Y,p+.12*d+Y],[g-.214*d-Y,p+.234*d-Y]]).stream(u),f=a.translate([g-.205*d,p+.212*d]).clipExtent([[g-.214*d+Y,p+.166*d+Y],[g-.115*d-Y,p+.234*d-Y]]).stream(u),s()},l.fitExtent=function(h,d){return ao(l,h,d)},l.fitSize=function(h,d){return gf(l,h,d)},l.fitWidth=function(h,d){return pf(l,h,d)},l.fitHeight=function(h,d){return mf(l,h,d)};function s(){return n=t=null,l}return l.scale(1070)}function B0(n){return function(t,e){var r=U(t),i=U(e),o=n(r*i);return o===1/0?[2,0]:[o*i*z(t),o*z(e)]}}function wr(n){return function(t,e){var r=gn(t*t+e*e),i=n(r),o=z(i),a=U(i);return[Tn(t*o,r*a),An(r&&e*o/r)]}}var vf=B0(function(n){return gn(2/(1+n))});vf.invert=wr(function(n){return 2*An(n/2)});function T8(){return ft(vf).scale(124.75).clipAngle(180-.001)}var wf=B0(function(n){return(n=c0(n))&&n/z(n)});wf.invert=wr(function(n){return n});function A8(){return ft(wf).scale(79.4188).clipAngle(180-.001)}function _r(n,t){return[n,ci(lf((fn+t)/2))]}_r.invert=function(n,t){return[n,2*Se(u0(t))-fn]};function E8(){return H0(_r).scale(961/Sn)}function H0(n){var t=ft(n),e=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,f,c,u;t.scale=function(s){return arguments.length?(r(s),l()):r()},t.translate=function(s){return arguments.length?(i(s),l()):i()},t.center=function(s){return arguments.length?(e(s),l()):e()},t.clipExtent=function(s){return arguments.length?(s==null?a=f=c=u=null:(a=+s[0][0],f=+s[0][1],c=+s[1][0],u=+s[1][1]),l()):a==null?null:[[a,f],[c,u]]};function l(){var s=G*r(),h=t(w0(t.rotate()).invert([0,0]));return o(a==null?[[h[0]-s,h[1]-s],[h[0]+s,h[1]+s]]:n===_r?[[Math.max(h[0]-s,a),f],[Math.min(h[0]+s,c),u]]:[[a,Math.max(h[1]-s,f)],[c,Math.min(h[1]+s,u)]])}return l()}function zr(n){return lf((fn+n)/2)}function G0(n,t){var e=U(n),r=n===t?z(n):ci(e/U(t))/ci(zr(t)/zr(n)),i=e*Eo(zr(n),r)/r;if(!r)return _r;function o(a,f){i>0?f<-fn+Y&&(f=-fn+Y):f>fn-Y&&(f=fn-Y);var c=i/Eo(zr(f),r);return[c*z(r*a),i-c*U(r*a)]}return o.invert=function(a,f){var c=i-f,u=Un(r)*gn(a*a+c*c),l=Tn(a,W(c))*Un(c);return c*r<0&&(l-=G*Un(a)*Un(c)),[l/r,2*Se(Eo(i/u,1/r))-fn]},o}function $8(){return yf(G0).scale(109.5).parallels([30,30])}function sr(n,t){return[n,t]}sr.invert=sr;function N8(){return ft(sr).scale(152.63)}function X0(n,t){var e=U(n),r=n===t?z(n):(e-U(t))/(t-n),i=e/r+n;if(W(r)Y&&--r>0);return[n/(.8707+(o=e*e)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),e]};function O8(){return ft(Mf).scale(175.295)}function Sf(n,t){return[U(t)*z(n),z(t)]}Sf.invert=wr(An);function D8(){return ft(Sf).scale(249.5).clipAngle(90+Y)}function Tf(n,t){var e=U(t),r=1+U(n)*e;return[e*z(n)/r,z(t)/r]}Tf.invert=wr(function(n){return 2*Se(n)});function z8(){return ft(Tf).scale(250).clipAngle(142)}function Af(n,t){return[ci(lf((fn+t)/2)),-n]}Af.invert=function(n,t){return[-t,2*Se(u0(n))-fn]};function F8(){var n=H0(Af),t=n.center,e=n.rotate;return n.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},n.rotate=function(r){return arguments.length?e([r[0],r[1],r.length>2?r[2]+90:90]):(r=e(),[r[0],r[1],r[2]-90])},e([0,0,90]).scale(159.155)}const xv=Object.freeze(Object.defineProperty({__proto__:null,geoAlbers:q0,geoAlbersUsa:S8,geoArea:N6,geoAzimuthalEqualArea:T8,geoAzimuthalEqualAreaRaw:vf,geoAzimuthalEquidistant:A8,geoAzimuthalEquidistantRaw:wf,geoBounds:R6,geoCentroid:U6,geoCircle:L6,geoClipAntimeridian:ca,geoClipCircle:A0,geoClipExtent:W6,geoClipRectangle:oo,geoConicConformal:$8,geoConicConformalRaw:G0,geoConicEqualArea:Ci,geoConicEqualAreaRaw:Y0,geoConicEquidistant:C8,geoConicEquidistantRaw:X0,geoContains:n8,geoDistance:xi,geoEqualEarth:k8,geoEqualEarthRaw:_f,geoEquirectangular:N8,geoEquirectangularRaw:sr,geoGnomonic:R8,geoGnomonicRaw:xf,geoGraticule:N0,geoGraticule10:t8,geoIdentity:I8,geoInterpolate:e8,geoLength:E0,geoMercator:E8,geoMercatorRaw:_r,geoNaturalEarth1:O8,geoNaturalEarth1Raw:Mf,geoOrthographic:D8,geoOrthographicRaw:Sf,geoPath:g8,geoProjection:ft,geoProjectionMutator:bf,geoRotation:w0,geoStereographic:z8,geoStereographicRaw:Tf,geoStream:Xn,geoTransform:p8,geoTransverseMercator:F8,geoTransverseMercatorRaw:Af},Symbol.toStringTag,{value:"Module"})),Fr=n=>()=>n;function U8(n,{sourceEvent:t,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function nt(n,t,e){this.k=n,this.x=t,this.y=e}nt.prototype={constructor:nt,scale:function(n){return n===1?this:new nt(this.k*n,this.x,this.y)},translate:function(n,t){return n===0&t===0?this:new nt(this.k,this.x+this.k*n,this.y+this.k*t)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var fo=new nt(1,0,0);W0.prototype=nt.prototype;function W0(n){for(;!n.__zoom;)if(!(n=n.parentNode))return fo;return n.__zoom}function ko(n){n.stopImmediatePropagation()}function ke(n){n.preventDefault(),n.stopImmediatePropagation()}function L8(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Y8(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function gc(){return this.__zoom||fo}function q8(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function B8(){return navigator.maxTouchPoints||"ontouchstart"in this}function H8(n,t,e){var r=n.invertX(t[0][0])-e[0][0],i=n.invertX(t[1][0])-e[1][0],o=n.invertY(t[0][1])-e[0][1],a=n.invertY(t[1][1])-e[1][1];return n.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function G8(){var n=L8,t=Y8,e=H8,r=q8,i=B8,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],f=250,c=zl,u=xe("start","zoom","end"),l,s,h,d=500,g=150,p=0,b=10;function m(_){_.property("__zoom",gc).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",P).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(_,S,T,C){var I=_.selection?_.selection():_;I.property("__zoom",gc),_!==I?M(_,S,T,C):I.interrupt().each(function(){x(this,arguments).event(C).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},m.scaleBy=function(_,S,T,C){m.scaleTo(_,function(){var I=this.__zoom.k,R=typeof S=="function"?S.apply(this,arguments):S;return I*R},T,C)},m.scaleTo=function(_,S,T,C){m.transform(_,function(){var I=t.apply(this,arguments),R=this.__zoom,L=T==null?y(I):typeof T=="function"?T.apply(this,arguments):T,H=R.invert(L),Z=typeof S=="function"?S.apply(this,arguments):S;return e(v(w(R,Z),L,H),I,a)},T,C)},m.translateBy=function(_,S,T,C){m.transform(_,function(){return e(this.__zoom.translate(typeof S=="function"?S.apply(this,arguments):S,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),a)},null,C)},m.translateTo=function(_,S,T,C,I){m.transform(_,function(){var R=t.apply(this,arguments),L=this.__zoom,H=C==null?y(R):typeof C=="function"?C.apply(this,arguments):C;return e(fo.translate(H[0],H[1]).scale(L.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof T=="function"?-T.apply(this,arguments):-T),R,a)},C,I)};function w(_,S){return S=Math.max(o[0],Math.min(o[1],S)),S===_.k?_:new nt(S,_.x,_.y)}function v(_,S,T){var C=S[0]-T[0]*_.k,I=S[1]-T[1]*_.k;return C===_.x&&I===_.y?_:new nt(_.k,C,I)}function y(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function M(_,S,T,C){_.on("start.zoom",function(){x(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(C).end()}).tween("zoom",function(){var I=this,R=arguments,L=x(I,R).event(C),H=t.apply(I,R),Z=T==null?y(H):typeof T=="function"?T.apply(I,R):T,on=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),nn=I.__zoom,un=typeof S=="function"?S.apply(I,R):S,Yn=c(nn.invert(Z).concat(on/nn.k),un.invert(Z).concat(on/un.k));return function(Pn){if(Pn===1)Pn=un;else{var qn=Yn(Pn),F=on/qn[2];Pn=new nt(F,Z[0]-qn[0]*F,Z[1]-qn[1]*F)}L.zoom(null,Pn)}})}function x(_,S,T){return!T&&_.__zooming||new $(_,S)}function $(_,S){this.that=_,this.args=S,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,S),this.taps=0}$.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,S){return this.mouse&&_!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var S=Gn(this.that).datum();u.call(_,this.that,new U8(_,{sourceEvent:this.sourceEvent,target:m,type:_,transform:this.that.__zoom,dispatch:u}),S)}};function N(_,...S){if(!n.apply(this,arguments))return;var T=x(this,S).event(_),C=this.__zoom,I=Math.max(o[0],Math.min(o[1],C.k*Math.pow(2,r.apply(this,arguments)))),R=Bn(_);if(T.wheel)(T.mouse[0][0]!==R[0]||T.mouse[0][1]!==R[1])&&(T.mouse[1]=C.invert(T.mouse[0]=R)),clearTimeout(T.wheel);else{if(C.k===I)return;T.mouse=[R,C.invert(R)],Be(this),T.start()}ke(_),T.wheel=setTimeout(L,g),T.zoom("mouse",e(v(w(C,I),T.mouse[0],T.mouse[1]),T.extent,a));function L(){T.wheel=null,T.end()}}function E(_,...S){if(h||!n.apply(this,arguments))return;var T=_.currentTarget,C=x(this,S,!0).event(_),I=Gn(_.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",on,!0),R=Bn(_,T),L=_.clientX,H=_.clientY;Da(_.view),ko(_),C.mouse=[R,this.__zoom.invert(R)],Be(this),C.start();function Z(nn){if(ke(nn),!C.moved){var un=nn.clientX-L,Yn=nn.clientY-H;C.moved=un*un+Yn*Yn>p}C.event(nn).zoom("mouse",e(v(C.that.__zoom,C.mouse[0]=Bn(nn,T),C.mouse[1]),C.extent,a))}function on(nn){I.on("mousemove.zoom mouseup.zoom",null),za(nn.view,C.moved),ke(nn),C.event(nn).end()}}function P(_,...S){if(n.apply(this,arguments)){var T=this.__zoom,C=Bn(_.changedTouches?_.changedTouches[0]:_,this),I=T.invert(C),R=T.k*(_.shiftKey?.5:2),L=e(v(w(T,R),C,I),t.apply(this,S),a);ke(_),f>0?Gn(this).transition().duration(f).call(M,L,C,_):Gn(this).call(m.transform,L,C,_)}}function A(_,...S){if(n.apply(this,arguments)){var T=_.touches,C=T.length,I=x(this,S,_.changedTouches.length===C).event(_),R,L,H,Z;for(ko(_),L=0;L0}function bc(n,t){if(n.type==="Feature")t(n,0);else if(n.type==="FeatureCollection")for(var e=0;e is required");if(typeof e!="boolean")throw new Error(" must be a boolean");if(typeof r!="boolean")throw new Error(" must be a boolean");r===!1&&(n=nv(n));var i=[];switch(n.type){case"GeometryCollection":return Q0(n,function(o){Xr(o,e)}),n;case"FeatureCollection":return bc(n,function(o){bc(Xr(o,e),function(a){i.push(a)})}),ev(i)}return Xr(n,e)}function Xr(n,t){var e=n.type==="Feature"?n.geometry.type:n.type;switch(e){case"GeometryCollection":return Q0(n,function(r){Xr(r,t)}),n;case"LineString":return yc(qe(n),t),n;case"Polygon":return vc(qe(n),t),n;case"MultiLineString":return qe(n).forEach(function(r){yc(r,t)}),n;case"MultiPolygon":return qe(n).forEach(function(r){vc(r,t)}),n;case"Point":case"MultiPoint":return n}}function yc(n,t){xa(n)===t&&n.reverse()}function vc(n,t){xa(n[0])!==t&&n[0].reverse();for(var e=1;e"u"?l={autoBom:!1}:typeof l!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,l,s){var h=new XMLHttpRequest;h.open("GET",u),h.responseType="blob",h.onload=function(){c(h.response,l,s)},h.onerror=function(){console.error("could not download file")},h.send()}function i(u){var l=new XMLHttpRequest;l.open("HEAD",u,!1);try{l.send()}catch{}return 200<=l.status&&299>=l.status}function o(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var l=document.createEvent("MouseEvents");l.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(l)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Re=="object"&&Re.global===Re?Re:void 0,f=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(u,l,s){var h=a.URL||a.webkitURL,d=document.createElement("a");l=l||u.name||"download",d.download=l,d.rel="noopener",typeof u=="string"?(d.href=u,d.origin===location.origin?o(d):i(d.href)?r(u,l,s):o(d,d.target="_blank")):(d.href=h.createObjectURL(u),setTimeout(function(){h.revokeObjectURL(d.href)},4e4),setTimeout(function(){o(d)},0))}:"msSaveOrOpenBlob"in navigator?function(u,l,s){if(l=l||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(e(u,s),l);else if(i(u))r(u,l,s);else{var h=document.createElement("a");h.href=u,h.target="_blank",setTimeout(function(){o(h)})}}:function(u,l,s,h){if(h=h||open("","_blank"),h&&(h.document.title=h.document.body.innerText="downloading..."),typeof u=="string")return r(u,l,s);var d=u.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||d&&g||f)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var v=b.result;v=p?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=v:location=v,h=null},b.readAsDataURL(u)}else{var m=a.URL||a.webkitURL,w=m.createObjectURL(u);h?h.location=w:location.href=w,h=null,setTimeout(function(){m.revokeObjectURL(w)},4e4)}});a.saveAs=c.saveAs=c,n.exports=c})})(K0);var Ev=K0.exports;export{f0 as D,Ev as F,bv as a,yv as b,ov as c,av as d,vv as e,hv as f,xv as g,uv as h,cv as i,_v as j,iv as k,gv as l,pv as m,sv as n,dv as o,mv as p,lv as q,wv as r,fv as s,Sv as t,Tv as u,Av as v,Mv as z}; diff --git a/nereid/nereid/static/frontend/dist/index.html b/nereid/nereid/static/frontend/dist/index.html new file mode 100644 index 00000000..7cfb6646 --- /dev/null +++ b/nereid/nereid/static/frontend/dist/index.html @@ -0,0 +1,22 @@ + + + + + + + + + + Nereid UI + + + + + + diff --git a/nereid/nereid/static/frontend/package-lock.json b/nereid/nereid/static/frontend/package-lock.json new file mode 100644 index 00000000..5843d64a --- /dev/null +++ b/nereid/nereid/static/frontend/package-lock.json @@ -0,0 +1,4196 @@ +{ + "name": "nereid", + "version": "0.11.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "nereid", + "version": "0.11.0", + "license": "ISC", + "dependencies": { + "@turf/rewind": "^6.5.0", + "d3": "^7.8.5", + "d3-tile": "^1.0.0", + "file-saver": "^2.0.5", + "tabulator-tables": "^4.9.3", + "topojson-client": "^3.1.0" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.10", + "@types/node": "^20.11.8", + "autoprefixer": "^10.4.17", + "knip": "^4.2.1", + "postcss": "^8.4.33", + "rollup-plugin-analyzer": "^4.0.0", + "tailwindcss": "^3.4.1", + "typescript": "^5.3.3", + "vite": "^5.0.12" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@ericcornelissen/bash-parser": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@ericcornelissen/bash-parser/-/bash-parser-0.5.2.tgz", + "integrity": "sha512-4pIMTa1nEFfMXitv7oaNEWOdM+zpOZavesa5GaiWTgda6Zk32CFGxjUp/iIaN0PwgUW1yTq/fztSjbpE8SLGZQ==", + "dev": true, + "dependencies": { + "array-last": "^1.1.1", + "babylon": "^6.9.1", + "compose-function": "^3.0.3", + "deep-freeze": "0.0.1", + "filter-iterator": "0.0.1", + "filter-obj": "^1.1.0", + "has-own-property": "^0.1.0", + "identity-function": "^1.0.0", + "is-iterable": "^1.1.0", + "iterable-lookahead": "^1.0.0", + "lodash.curry": "^4.1.1", + "magic-string": "^0.16.0", + "map-obj": "^2.0.0", + "object-pairs": "^0.1.0", + "object-values": "^1.0.0", + "reverse-arguments": "^1.0.0", + "shell-quote-word": "^1.0.1", + "to-pascal-case": "^1.0.0", + "unescape-js": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", + "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/git": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.4.tgz", + "integrity": "sha512-nr6/WezNzuYUppzXRaYu/W4aT5rLxdXqEFupbh6e/ovlYFQ8hpu1UUPV3Ir/YTl+74iXl2ZOMlGzudh9ZPUchQ==", + "dev": true, + "dependencies": { + "@npmcli/promise-spawn": "^7.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^3.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/git/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/git/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/map-workspaces": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz", + "integrity": "sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==", + "dev": true, + "dependencies": { + "@npmcli/name-from-folder": "^2.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0", + "read-package-json-fast": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/name-from-folder": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", + "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/package-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.0.tgz", + "integrity": "sha512-OI2zdYBLhQ7kpNPaJxiflofYIpkNLi+lnGdzqUOfRmCF3r2l1nadcjtCYMJKv/Utm/ZtlffaUuTiAktPHbc17g==", + "dev": true, + "dependencies": { + "@npmcli/git": "^5.0.0", + "glob": "^10.2.2", + "hosted-git-info": "^7.0.0", + "json-parse-even-better-errors": "^3.0.0", + "normalize-package-data": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.1.tgz", + "integrity": "sha512-P4KkF9jX3y+7yFUxgcUdDtLy+t4OlDGuEBLNs57AZsfSfg+uV6MLndqGpnl4831ggaEdXwR50XFoZP4VFtHolg==", + "dev": true, + "dependencies": { + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/@npmcli/promise-spawn/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pnpm/constants": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@pnpm/constants/-/constants-7.1.1.tgz", + "integrity": "sha512-31pZqMtjwV+Vaq7MaPrT1EoDFSYwye3dp6BiHIGRJmVThCQwySRKM7hCvqqI94epNkqFAAYoWrNynWoRYosGdw==", + "dev": true, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/core-loggers": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@pnpm/core-loggers/-/core-loggers-9.0.6.tgz", + "integrity": "sha512-iK67SGbp+06bA/elpg51wygPFjNA7JKHtKkpLxqXXHw+AjFFBC3f2OznJsCIuDK6HdGi5UhHLYqo5QxJ2gMqJQ==", + "dev": true, + "dependencies": { + "@pnpm/types": "9.4.2" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + }, + "peerDependencies": { + "@pnpm/logger": "^5.0.0" + } + }, + "node_modules/@pnpm/error": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@pnpm/error/-/error-5.0.2.tgz", + "integrity": "sha512-0TEm+tWNYm+9uh6DSKyRbv8pv/6b4NL0PastLvMxIoqZbBZ5Zj1cYi332R9xsSUi31ZOsu2wpgn/bC7DA9hrjg==", + "dev": true, + "dependencies": { + "@pnpm/constants": "7.1.1" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/fetching-types": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pnpm/fetching-types/-/fetching-types-5.0.0.tgz", + "integrity": "sha512-o9gdO1v8Uc5P2fBBuW6GSpfTqIivQmQlqjQJdFiQX0m+tgxlrMRneIg392jZuc6fk7kFqjLheInlslgJfwY+4Q==", + "dev": true, + "dependencies": { + "@zkochan/retry": "^0.2.0", + "node-fetch": "3.0.0-beta.9" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/graceful-fs": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@pnpm/graceful-fs/-/graceful-fs-3.2.0.tgz", + "integrity": "sha512-vRoXJxscDpHak7YE9SqCkzfrayn+Lw+YueOeHIPEqkgokrHeYgYeONoc2kGh0ObHaRtNSsonozVfJ456kxLNvA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.11" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/logger": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pnpm/logger/-/logger-5.0.0.tgz", + "integrity": "sha512-YfcB2QrX+Wx1o6LD1G2Y2fhDhOix/bAY/oAnMpHoNLsKkWIRbt1oKLkIFvxBMzLwAEPqnYWguJrYC+J6i4ywbw==", + "dev": true, + "dependencies": { + "bole": "^5.0.0", + "ndjson": "^2.0.0" + }, + "engines": { + "node": ">=12.17" + } + }, + "node_modules/@pnpm/npm-package-arg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-package-arg/-/npm-package-arg-1.0.0.tgz", + "integrity": "sha512-oQYP08exi6mOPdAZZWcNIGS+KKPsnNwUBzSuAEGWuCcqwMAt3k/WVCqVIXzBxhO5sP2b43og69VHmPj6IroKqw==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.5", + "validate-npm-package-name": "^4.0.0" + }, + "engines": { + "node": ">=14.6" + } + }, + "node_modules/@pnpm/npm-package-arg/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@pnpm/npm-package-arg/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@pnpm/npm-resolver": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/npm-resolver/-/npm-resolver-18.1.0.tgz", + "integrity": "sha512-fUYKX/iHiHldL0VRVvkQI35YK2jWhZEkPO6rrGke8309+LKAo12v833nBttMDpQrtHefmqhB4mhCzQq6L2Xqmg==", + "dev": true, + "dependencies": { + "@pnpm/core-loggers": "9.0.6", + "@pnpm/error": "5.0.2", + "@pnpm/fetching-types": "5.0.0", + "@pnpm/graceful-fs": "3.2.0", + "@pnpm/resolve-workspace-range": "5.0.1", + "@pnpm/resolver-base": "11.1.0", + "@pnpm/types": "9.4.2", + "@zkochan/retry": "^0.2.0", + "encode-registry": "^3.0.1", + "load-json-file": "^6.2.0", + "lru-cache": "^10.0.2", + "normalize-path": "^3.0.0", + "p-limit": "^3.1.0", + "p-memoize": "4.0.1", + "parse-npm-tarball-url": "^3.0.0", + "path-temp": "^2.1.0", + "ramda": "npm:@pnpm/ramda@0.28.1", + "rename-overwrite": "^5.0.0", + "semver": "^7.5.4", + "ssri": "10.0.5", + "version-selector-type": "^3.0.0" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + }, + "peerDependencies": { + "@pnpm/logger": "^5.0.0" + } + }, + "node_modules/@pnpm/resolve-workspace-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@pnpm/resolve-workspace-range/-/resolve-workspace-range-5.0.1.tgz", + "integrity": "sha512-yQ0pMthlw8rTgS/C9hrjne+NEnnSNevCjtdodd7i15I59jMBYciHifZ/vjg0NY+Jl+USTc3dBE+0h/4tdYjMKg==", + "dev": true, + "dependencies": { + "semver": "^7.4.0" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/resolver-base": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@pnpm/resolver-base/-/resolver-base-11.1.0.tgz", + "integrity": "sha512-y2qKaj18pwe1VWc3YXEitdYFo+WqOOt60aqTUuOVkJAirUzz0DzuYh3Ifct4znYWPdgUXHaN5DMphNF5iL85rA==", + "dev": true, + "dependencies": { + "@pnpm/types": "9.4.2" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/types": { + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/@pnpm/types/-/types-9.4.2.tgz", + "integrity": "sha512-g1hcF8Nv4gd76POilz9gD4LITAPXOe5nX4ijgr8ixCbLQZfcpYiMfJ+C1RlMNRUDo8vhlNB4O3bUlxmT6EAQXA==", + "dev": true, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@pnpm/workspace.pkgs-graph": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@pnpm/workspace.pkgs-graph/-/workspace.pkgs-graph-2.0.14.tgz", + "integrity": "sha512-SBXXyWDkPEoaLTjLRyQzRHoBYH+P0NLcIjX1yPUxuJiMTvGOMzjpLWTuxYNVe/P0V0VQMrjpJFaJPjlViNLhzg==", + "dev": true, + "dependencies": { + "@pnpm/npm-package-arg": "^1.0.0", + "@pnpm/npm-resolver": "18.1.0", + "@pnpm/resolve-workspace-range": "5.0.1", + "ramda": "npm:@pnpm/ramda@0.28.1" + }, + "engines": { + "node": ">=16.14" + }, + "funding": { + "url": "https://opencollective.com/pnpm" + } + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.6", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.9.6", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@snyk/github-codeowners": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz", + "integrity": "sha512-lGFf08pbkEac0NYgVf4hdANpAgApRjNByLXB+WBip3qj1iendOIyAwP2GKkKbQMNVy2r1xxDf0ssfWscoiC+Vw==", + "dev": true, + "dependencies": { + "commander": "^4.1.1", + "ignore": "^5.1.8", + "p-map": "^4.0.0" + }, + "bin": { + "github-codeowners": "dist/cli.js" + }, + "engines": { + "node": ">=8.10" + } + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.10.tgz", + "integrity": "sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==", + "dev": true, + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, + "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@turf/boolean-clockwise": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/boolean-clockwise/-/boolean-clockwise-6.5.0.tgz", + "integrity": "sha512-45+C7LC5RMbRWrxh3Z0Eihsc8db1VGBO5d9BLTOAwU4jR6SgsunTfRWR16X7JUwIDYlCVEmnjcXJNi/kIU3VIw==", + "dependencies": { + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/clone": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/clone/-/clone-6.5.0.tgz", + "integrity": "sha512-mzVtTFj/QycXOn6ig+annKrM6ZlimreKYz6f/GSERytOpgzodbQyOgkfwru100O1KQhhjSudKK4DsQ0oyi9cTw==", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/helpers": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", + "integrity": "sha512-VbI1dV5bLFzohYYdgqwikdMVpe7pJ9X3E+dlr425wa2/sMJqYDhTO++ec38/pcPvPE6oD9WEEeU3Xu3gza+VPw==", + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/invariant": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-6.5.0.tgz", + "integrity": "sha512-Wv8PRNCtPD31UVbdJE/KVAWKe7l6US+lJItRR/HOEW3eh+U/JwRCSUl/KZ7bmjM/C+zLNoreM2TU6OoLACs4eg==", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/meta": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", + "integrity": "sha512-RrArvtsV0vdsCBegoBtOalgdSOfkBrTJ07VkpiCnq/491W67hnMWmDu7e6Ztw0C3WldRYTXkg3SumfdzZxLBHA==", + "dependencies": { + "@turf/helpers": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/rewind": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@turf/rewind/-/rewind-6.5.0.tgz", + "integrity": "sha512-IoUAMcHWotBWYwSYuYypw/LlqZmO+wcBpn8ysrBNbazkFNkLf3btSDZMkKJO/bvOzl55imr/Xj4fi3DdsLsbzQ==", + "dependencies": { + "@turf/boolean-clockwise": "^6.5.0", + "@turf/clone": "^6.5.0", + "@turf/helpers": "^6.5.0", + "@turf/invariant": "^6.5.0", + "@turf/meta": "^6.5.0" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@types/node": { + "version": "20.11.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.8.tgz", + "integrity": "sha512-i7omyekpPTNdv4Jb/Rgqg0RU8YqLcNsI12quKSDkRXNfx7Wxdm6HhK1awT3xTgEkgxPn3bvnSpiEAc7a7Lpyow==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/picomatch": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/picomatch/-/picomatch-2.3.3.tgz", + "integrity": "sha512-Yll76ZHikRFCyz/pffKGjrCwe/le2CDwOP5F210KQo27kpRE46U2rDnzikNlVn6/ezH3Mhn46bJMTfeVTtcYMg==", + "dev": true + }, + "node_modules/@zkochan/retry": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@zkochan/retry/-/retry-0.2.0.tgz", + "integrity": "sha512-WhB+2B/ZPlW2Xy/kMJBrMbqecWXcbDDgn0K0wKBAgO2OlBTz1iLJrRWduo+DGGn0Akvz1Lu4Xvls7dJojximWw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/@zkochan/rimraf": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@zkochan/rimraf/-/rimraf-2.1.3.tgz", + "integrity": "sha512-mCfR3gylCzPC+iqdxEA6z5SxJeOgzgbwmyxanKriIne5qZLswDe/M43aD3p5MNzwzXRhbZg/OX+MpES6Zk1a6A==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=12.10" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/arity-n": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz", + "integrity": "sha512-fExL2kFDC1Q2DUOx3whE/9KoN66IzkY4b4zUHUBFM1ojEYjZZYDcUW3bek/ufGionX9giIKDC5redH2IlGqcQQ==", + "dev": true + }, + "node_modules/array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "dependencies": { + "is-number": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-last/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/autoprefixer": { + "version": "10.4.17", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz", + "integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "browserslist": "^4.22.2", + "caniuse-lite": "^1.0.30001578", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true, + "bin": { + "babylon": "bin/babylon.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bole": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/bole/-/bole-5.0.10.tgz", + "integrity": "sha512-5IiUWQ8QRQ8yHf46VPQ7GH3nj0Jy7P4heaENBVmsGfHP1Gtd0wqkvK6C3iHLUMdG3SMFx2DD8FqoIQcnMpdIdQ==", + "dev": true, + "dependencies": { + "fast-safe-stringify": "^2.0.7", + "individual": "^3.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001580", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001580.tgz", + "integrity": "sha512-mtj5ur2FFPZcCEpXFy8ADXbDACuNFXg6mxVDqp7tqooX6l3zwm+d8EPoeOSIFRDvHs8qu7/SLFOGniULkcH2iA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/compose-function": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", + "integrity": "sha512-xzhzTJ5eC+gmIzvZq+C3kCJHsp9os6tJkrigDRZclyGtOKINbZtE8n1Tzmeh32jW+BUDPbvZpibwvJHBLGMVwg==", + "dev": true, + "dependencies": { + "arity-n": "^1.0.4" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/d3": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.8.5.tgz", + "integrity": "sha512-JgoahDG51ncUfJu6wX/1vWQEqOflgXyl4MaHqlcSruTez7yhaRKR9i8VjjcQGeS2en/jnFivXuaIMnseMMt0XA==", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.0.tgz", + "integrity": "sha512-JEo5HxXDdDYXCaWdwLRt79y7giK8SbhZJbFWXqbRTolCHFI5jRqteLzCsq51NKbUoX0PjBVSohxrx+NoOUujYA==", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz", + "integrity": "sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-tile": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d3-tile/-/d3-tile-1.0.0.tgz", + "integrity": "sha512-79fnTKpPMPDS5xQ0xuS9ir0165NEwwkFpe/DSOmc2Gl9ldYzKKRDWogmTTE8wAJ8NA7PMapNfEcyKhI9Lxdu5Q==" + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/deep-freeze": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz", + "integrity": "sha512-Z+z8HiAvsGwmjqlphnHW5oz6yWlOwu6EQfFTjmeTWlDeda3FS2yv3jhq35TX/ewmsnqB+RX2IdsIOyjJCQN5tg==", + "dev": true + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "optional": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delaunator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.1.tgz", + "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/easy-table": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", + "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "optionalDependencies": { + "wcwidth": "^1.0.1" + } + }, + "node_modules/easy-table/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.646", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.646.tgz", + "integrity": "sha512-vThkQ0JuF45qT/20KbRgM56lV7IuGt7SjhawQ719PDHzhP84KAO1WJoaxgCoAffKHK47FmVKP1Fqizx7CwK1SA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/encode-registry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/encode-registry/-/encode-registry-3.0.1.tgz", + "integrity": "sha512-6qOwkl1g0fv0DN3Y3ggr2EaZXN71aoAqPp3p/pVaWSBSIo+YjLOWN61Fva43oVyQNPf7kgm8lkudzlzojwE2jw==", + "dev": true, + "dependencies": { + "mem": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fetch-blob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-2.1.2.tgz", + "integrity": "sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow==", + "dev": true, + "engines": { + "node": "^10.17.0 || >=12.3.0" + }, + "peerDependenciesMeta": { + "domexception": { + "optional": true + } + } + }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/filter-iterator": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/filter-iterator/-/filter-iterator-0.0.1.tgz", + "integrity": "sha512-v4lhL7Qa8XpbW3LN46CEnmhGk3eHZwxfNl5at20aEkreesht4YKb/Ba3BUIbnPhAC/r3dmu7ABaGk6MAvh2alA==", + "dev": true + }, + "node_modules/filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-own-property": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-own-property/-/has-own-property-0.1.0.tgz", + "integrity": "sha512-14qdBKoonU99XDhWcFKZTShK+QV47qU97u8zzoVo9cL5TZ3BmBHXogItSt9qJjR0KUMFRhcCW8uGIGl8nkl7Aw==", + "dev": true + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.1.tgz", + "integrity": "sha512-+K84LB1DYwMHoHSgaOY/Jfhw3ucPmSET5v98Ke/HdNSw4a0UktWzyW1mjhjpuxxTqOOsfWT/7iVshHmVZ4IpOA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/identity-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/identity-function/-/identity-function-1.0.0.tgz", + "integrity": "sha512-kNrgUK0qI+9qLTBidsH85HjDLpZfrrS0ElquKKe/fJFdB3D7VeKdXXEvOPDUHSHOzdZKCAAaQIWWyp0l2yq6pw==", + "dev": true + }, + "node_modules/ignore": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/individual": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz", + "integrity": "sha512-rUY5vtT748NMRbEMrTNiFfy29BgGZwGXUi2NFUVMWQrogSLzlJvQV9eeMWi+g1aVaQ53tpyLAQtd5x/JH0Nh1g==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-iterable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-iterable/-/is-iterable-1.1.1.tgz", + "integrity": "sha512-EdOZCr0NsGE00Pot+x1ZFx9MJK3C6wy91geZpXwvwexDLJvA4nzYyZf7r+EIwSeVsOLDdBz7ATg9NqKTzuNYuQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/iterable-lookahead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/iterable-lookahead/-/iterable-lookahead-1.0.0.tgz", + "integrity": "sha512-hJnEP2Xk4+44DDwJqUQGdXal5VbyeWLaPyDl2AQc242Zr7iqz4DgpQOrEzglWVMGHMDCkguLHEKxd1+rOsmgSQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "dev": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz", + "integrity": "sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/knip": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/knip/-/knip-4.2.1.tgz", + "integrity": "sha512-KG++YCus11YyQQeiBxhXxv6NCJzol4AYER9q1kwZGFw+gwDzG/0Q6MN87McYFN74nGRX4O2xM5CA3TTPcbpn5A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/webpro" + } + ], + "dependencies": { + "@ericcornelissen/bash-parser": "0.5.2", + "@nodelib/fs.walk": "2.0.0", + "@npmcli/map-workspaces": "3.0.4", + "@npmcli/package-json": "5.0.0", + "@pkgjs/parseargs": "0.11.0", + "@pnpm/logger": "5.0.0", + "@pnpm/workspace.pkgs-graph": "^2.0.13", + "@snyk/github-codeowners": "1.1.0", + "@types/picomatch": "2.3.3", + "easy-table": "1.2.0", + "fast-glob": "3.3.2", + "jiti": "1.21.0", + "js-yaml": "4.1.0", + "micromatch": "4.0.5", + "minimist": "1.2.8", + "picocolors": "1.0.0", + "picomatch": "3.0.1", + "pretty-ms": "8.0.0", + "smol-toml": "1.1.3", + "strip-json-comments": "5.0.1", + "summary": "2.1.0", + "zod": "3.22.4", + "zod-validation-error": "3.0.0" + }, + "bin": { + "knip": "bin/knip.js" + }, + "engines": { + "node": ">=18.6.0" + }, + "peerDependencies": { + "@types/node": ">=18", + "typescript": ">=5.0.4" + } + }, + "node_modules/knip/node_modules/@nodelib/fs.scandir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-3.0.0.tgz", + "integrity": "sha512-ktI9+PxfHYtKjF3cLTUAh2N+b8MijCRPNwKJNqTVdL0gB0QxLU2rIRaZ1t71oEa3YBDE6bukH1sR0+CDnpp/Mg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "3.0.0", + "run-parallel": "^1.2.0" + }, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/knip/node_modules/@nodelib/fs.stat": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-3.0.0.tgz", + "integrity": "sha512-2tQOI38s19P9i7X/Drt0v8iMA+KMsgdhB/dyPER+e+2Y8L1Z7QvnuRdW/uLuf5YRFUYmnj4bMA6qCuZHFI1GDQ==", + "dev": true, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/knip/node_modules/@nodelib/fs.walk": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-2.0.0.tgz", + "integrity": "sha512-54voNDBobGdMl3BUXSu7UaDh1P85PGHWlJ5e0XhPugo1JulOyCtp2I+5ri4wplGDJ8QGwPEQW7/x3yTLU7yF1A==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "3.0.0", + "fastq": "^1.15.0" + }, + "engines": { + "node": ">=16.14.0" + } + }, + "node_modules/knip/node_modules/picomatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz", + "integrity": "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/load-json-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz", + "integrity": "sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "parse-json": "^5.0.0", + "strip-bom": "^4.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "dev": true + }, + "node_modules/lodash.curry": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz", + "integrity": "sha512-/u14pXGviLaweY5JI0IUzgzF2J6Ne8INyzAZjImcryjgkZ+ebruBxy2/JaOOkTqScddcYtakjhSaeemV8lR0tA==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/magic-string": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.16.0.tgz", + "integrity": "sha512-c4BEos3y6G2qO0B9X7K0FVLOPT9uGrjYwYRLFmDqyl5YMboUviyecnXWp94fJTSMwPw2/sf+CEYt5AGpmklkkQ==", + "dev": true, + "dependencies": { + "vlq": "^0.2.1" + } + }, + "node_modules/map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "dependencies": { + "p-defer": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha512-TzQSV2DiMYgoF5RycneKVUzIa9bQsj/B3tTgsE3dOGqlzHnGIDaC7XBE7grnA+8kZPnfqSGFe95VHc2oc0VFUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/mem": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", + "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", + "dev": true, + "dependencies": { + "map-age-cleaner": "^0.1.3", + "mimic-fn": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/mem?sponsor=1" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/ndjson": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz", + "integrity": "sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==", + "dev": true, + "dependencies": { + "json-stringify-safe": "^5.0.1", + "minimist": "^1.2.5", + "readable-stream": "^3.6.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "ndjson": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-fetch": { + "version": "3.0.0-beta.9", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0-beta.9.tgz", + "integrity": "sha512-RdbZCEynH2tH46+tj0ua9caUHVWrd/RHnRfvly2EVdqGmI3ndS1Vn/xjm5KuGejDt2RNDQsVRLPNd2QPwcewVg==", + "dev": true, + "dependencies": { + "data-uri-to-buffer": "^3.0.1", + "fetch-blob": "^2.1.1" + }, + "engines": { + "node": "^10.17 || >=12.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/node-releases": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-6.0.0.tgz", + "integrity": "sha512-UL7ELRVxYBHBgYEtZCXjxuD5vPxnmvMGq0jp/dGPKKrN7tfsBh2IY7TlJ15WWwdjRWD3RJbnsygUurTK3xkPkg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-install-checks": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.3.0.tgz", + "integrity": "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==", + "dev": true, + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", + "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.1.tgz", + "integrity": "sha512-M7s1BD4NxdAvBKUPqqRW957Xwcl/4Zvo8Aj+ANrzvIPzGJZElrH7Z//rSaec2ORcND6FHHLnZeY8qgTpXDMFQQ==", + "dev": true, + "dependencies": { + "hosted-git-info": "^7.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", + "dev": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/npm-pick-manifest": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-9.0.0.tgz", + "integrity": "sha512-VfvRSs/b6n9ol4Qb+bDwNGUXutpy76x6MARw/XssevE0TnctIKcmklJZM5Z7nqs5z5aW+0S63pgCNbpkUNNXBg==", + "dev": true, + "dependencies": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^11.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-pairs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-pairs/-/object-pairs-0.1.0.tgz", + "integrity": "sha512-3ECr6K831I4xX/Mduxr9UC+HPOz/d6WKKYj9p4cmC8Lg8p7g8gitzsxNX5IWlSIgFWN/a4JgrJaoAMKn20oKwA==", + "dev": true + }, + "node_modules/object-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object-values/-/object-values-1.0.0.tgz", + "integrity": "sha512-+8hwcz/JnQ9EpLIXzN0Rs7DLsBpJNT/xYehtB/jU93tHYr5BFEO8E+JGQNOSqE7opVzz5cGksKFHt7uUJVLSjQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-memoize": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/p-memoize/-/p-memoize-4.0.1.tgz", + "integrity": "sha512-km0sP12uE0dOZ5qP+s7kGVf07QngxyG0gS8sYFvFWhqlgzOsSy+m71aUejf/0akxj5W7gE//2G74qTv6b4iMog==", + "dev": true, + "dependencies": { + "mem": "^6.0.1", + "mimic-fn": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/p-memoize?sponsor=1" + } + }, + "node_modules/p-memoize/node_modules/mem": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/mem/-/mem-6.1.1.tgz", + "integrity": "sha512-Ci6bIfq/UgcxPTYa8dQQ5FY3BzKkT894bwXWXxC/zqs0XgMO2cT20CGkOqda7gZNkmK5VP4x89IGZ6K7hfbn3Q==", + "dev": true, + "dependencies": { + "map-age-cleaner": "^0.1.3", + "mimic-fn": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sindresorhus/mem?sponsor=1" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-json/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/parse-ms": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", + "integrity": "sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-npm-tarball-url": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parse-npm-tarball-url/-/parse-npm-tarball-url-3.0.0.tgz", + "integrity": "sha512-InpdgIdNe5xWMEUcrVQUniQKwnggBtJ7+SCwh7zQAZwbbIYZV9XdgJyhtmDSSvykFyQXoe4BINnzKTfCwWLs5g==", + "dev": true, + "dependencies": { + "semver": "^6.1.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/parse-npm-tarball-url/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-temp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-temp/-/path-temp-2.1.0.tgz", + "integrity": "sha512-cMMJTAZlion/RWRRC48UbrDymEIt+/YSD/l8NqjneyDw2rDOBQcP5yRkMB4CYGn47KMhZvbblBP7Z79OsMw72w==", + "dev": true, + "dependencies": { + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dev": true, + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-load-config/node_modules/lilconfig": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/postcss-nested": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.11" + }, + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.15", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.15.tgz", + "integrity": "sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/pretty-ms": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-8.0.0.tgz", + "integrity": "sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==", + "dev": true, + "dependencies": { + "parse-ms": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/proc-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", + "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ramda": { + "name": "@pnpm/ramda", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@pnpm/ramda/-/ramda-0.28.1.tgz", + "integrity": "sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ramda" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/read-package-json-fast": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", + "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", + "dev": true, + "dependencies": { + "json-parse-even-better-errors": "^3.0.0", + "npm-normalize-package-bin": "^3.0.0" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rename-overwrite": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rename-overwrite/-/rename-overwrite-5.0.0.tgz", + "integrity": "sha512-vSxE5Ww7Jnyotvaxi3Dj0vOMoojH8KMkBfs9xYeW/qNfJiLTcC1fmwTjrbGUq3mQSOCxkG0DbdcvwTUrpvBN4w==", + "dev": true, + "dependencies": { + "@zkochan/rimraf": "^2.1.2", + "fs-extra": "10.1.0" + }, + "engines": { + "node": ">=12.10" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/reverse-arguments": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/reverse-arguments/-/reverse-arguments-1.0.0.tgz", + "integrity": "sha512-/x8uIPdTafBqakK0TmPNJzgkLP+3H+yxpUJhCQHsLBg1rYEVNR2D8BRYNWQhVBjyOd7oo1dZRVzIkwMY2oqfYQ==", + "dev": true + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" + }, + "node_modules/rollup-plugin-analyzer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-analyzer/-/rollup-plugin-analyzer-4.0.0.tgz", + "integrity": "sha512-LL9GEt3bkXp6Wa19SNR5MWcvHNMvuTFYg+eYBZN2OIFhSWN+pEJUQXEKu5BsOeABob3x9PDaLKW7w5iOJnsESQ==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote-word": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/shell-quote-word/-/shell-quote-word-1.0.1.tgz", + "integrity": "sha512-lT297f1WLAdq0A4O+AknIFRP6kkiI3s8C913eJ0XqBxJbZPGWUNkRQk2u8zk4bEAjUJ5i+fSLwB6z1HzeT+DEg==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smol-toml": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.1.3.tgz", + "integrity": "sha512-qTyy6Owjho1ISBmxj4HdrFWB2kMQ5RczU6J04OqslSfdSH656OIHuomHS4ZDvhwm37nig/uXyiTMJxlC9zIVfw==", + "dev": true, + "engines": { + "node": ">= 18", + "pnpm": ">= 8" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz", + "integrity": "sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", + "dev": true + }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/ssri": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", + "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", + "dev": true, + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.fromcodepoint": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string.fromcodepoint/-/string.fromcodepoint-0.2.1.tgz", + "integrity": "sha512-n69H31OnxSGSZyZbgBlvYIXlrMhJQ0dQAX1js1QDhpaUH6zmU3QYlj07bCwCNlPOu3oRXIubGPl2gDGnHsiCqg==", + "dev": true + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.1.tgz", + "integrity": "sha512-0fk9zBqO67Nq5M/m45qHCJxylV/DhBlIOVExqgOMiCCrzrhU6tCibRXNqE3jwJLftzE9SNuZtYbpzcO+i9FiKw==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/summary": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/summary/-/summary-2.1.0.tgz", + "integrity": "sha512-nMIjMrd5Z2nuB2RZCKJfFMjgS3fygbeyGk9PxPPaJR1RIcyN9yn4A63Isovzm3ZtQuEkLBVgMdPup8UeLH7aQw==", + "dev": true + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tabulator-tables": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/tabulator-tables/-/tabulator-tables-4.9.3.tgz", + "integrity": "sha512-iwwQqAEGGxlgrBpcmJJvMJrfjGLcCXOB3AOb/DGkXqBy1YKoYA36hIl7qXGp6Jo8dSkzFAlDT6pKLZgyhs9OnQ==" + }, + "node_modules/tailwindcss": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", + "integrity": "sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA==", + "dev": true, + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.19.1", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/to-no-case": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", + "integrity": "sha512-Z3g735FxuZY8rodxV4gH7LxClE4H0hTIyHNIHdk+vpQxjLm0cwnKXq/OFVZ76SOQmto7txVcwSCwkU5kqp+FKg==", + "dev": true + }, + "node_modules/to-pascal-case": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-pascal-case/-/to-pascal-case-1.0.0.tgz", + "integrity": "sha512-QGMWHqM6xPrcQW57S23c5/3BbYb0Tbe9p+ur98ckRnGDwD4wbbtDiYI38CfmMKNB5Iv0REjs5SNDntTwvDxzZA==", + "dev": true, + "dependencies": { + "to-space-case": "^1.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/to-space-case": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", + "integrity": "sha512-rLdvwXZ39VOn1IxGL3V6ZstoTbwLRckQmn/U8ZDLuWwIXNpuZDhQ3AiRUlhTbOXFVE9C+dR51wM0CBDhk31VcA==", + "dev": true, + "dependencies": { + "to-no-case": "^1.0.0" + } + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "dependencies": { + "commander": "2" + }, + "bin": { + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" + } + }, + "node_modules/topojson-client/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, + "node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "dev": true, + "license": "MIT" + }, + "node_modules/unescape-js": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/unescape-js/-/unescape-js-1.1.4.tgz", + "integrity": "sha512-42SD8NOQEhdYntEiUQdYq/1V/YHwr1HLwlHuTJB5InVVdOSbgI6xu8jK5q65yIzuFCfczzyDF/7hbGzVbyCw0g==", + "dev": true, + "dependencies": { + "string.fromcodepoint": "^0.2.1" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/version-selector-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/version-selector-type/-/version-selector-type-3.0.0.tgz", + "integrity": "sha512-PSvMIZS7C1MuVNBXl/CDG2pZq8EXy/NW2dHIdm3bVP5N0PC8utDK8ttXLXj44Gn3J0lQE3U7Mpm1estAOd+eiA==", + "dev": true, + "dependencies": { + "semver": "^7.3.2" + }, + "engines": { + "node": ">=10.13" + } + }, + "node_modules/vite": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@types/estree": { + "version": "1.0.5", + "dev": true, + "license": "MIT" + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.19.12", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/vite/node_modules/rollup": { + "version": "4.9.6", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.9.6", + "@rollup/rollup-android-arm64": "4.9.6", + "@rollup/rollup-darwin-arm64": "4.9.6", + "@rollup/rollup-darwin-x64": "4.9.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.6", + "@rollup/rollup-linux-arm64-gnu": "4.9.6", + "@rollup/rollup-linux-arm64-musl": "4.9.6", + "@rollup/rollup-linux-riscv64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-gnu": "4.9.6", + "@rollup/rollup-linux-x64-musl": "4.9.6", + "@rollup/rollup-win32-arm64-msvc": "4.9.6", + "@rollup/rollup-win32-ia32-msvc": "4.9.6", + "@rollup/rollup-win32-x64-msvc": "4.9.6", + "fsevents": "~2.3.2" + } + }, + "node_modules/vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "optional": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-3.0.0.tgz", + "integrity": "sha512-x+agsJJG9rvC7axF0xqTEdZhJkLHyIZkdOAWDJSmwGPzxNHMHwtU6w2yDOAAP6yuSfTAUhAMJRBfhVGY64ySEQ==", + "dev": true, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.18.0" + } + } + } +} diff --git a/nereid/nereid/static/frontend/package.json b/nereid/nereid/static/frontend/package.json new file mode 100644 index 00000000..6928da10 --- /dev/null +++ b/nereid/nereid/static/frontend/package.json @@ -0,0 +1,60 @@ +{ + "name": "nereid", + "version": "0.11.0", + "type": "module", + "description": "", + "scripts": { + "dev": "vite", + "watch": "vite build --watch --minify=false", + "build": "vite build", + "knip": "knip --workspace 'src/js'" + }, + "author": "aorr@geosyntec.com", + "license": "ISC", + "//": { + "devDependencies": { + "@snowpack/plugin-postcss": "^1.4.1", + "@tailwindcss/typography": "^0.5.1", + "autoprefixer": "^10.4.2", + "cross-env": "^7.0.3", + "postcss": "^8.4.6", + "postcss-cli": "^8.3.1", + "snowpack": "^3.8.6", + "tailwindcss": "^3.0.22" + }, + "dependencies": { + "d3": "^7.0.1", + "d3-require": "^1.2.4", + "d3-tile": "^1.0.0", + "dotenv": "^10.0.0", + "file-saver": "^2.0.5", + "tabulator-tables": "^4.9.3", + "topojson-client": "^3.1.0" + } + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.10", + "@types/node": "^20.11.8", + "autoprefixer": "^10.4.17", + "knip": "^4.2.1", + "postcss": "^8.4.33", + "rollup-plugin-analyzer": "^4.0.0", + "tailwindcss": "^3.4.1", + "typescript": "^5.3.3", + "vite": "^5.0.12" + }, + "dependencies": { + "@turf/rewind": "^6.5.0", + "d3": "^7.8.5", + "d3-tile": "^1.0.0", + "file-saver": "^2.0.5", + "tabulator-tables": "^4.9.3", + "topojson-client": "^3.1.0" + }, + "postcss": { + "plugins": { + "tailwindcss": {}, + "autoprefixer": {} + } + } +} diff --git a/nereid/nereid/static/frontend/src/css/index.css b/nereid/nereid/static/frontend/src/css/index.css new file mode 100644 index 00000000..1b7d0207 --- /dev/null +++ b/nereid/nereid/static/frontend/src/css/index.css @@ -0,0 +1,2 @@ +@import "./tw.css"; +@import "./styles.css"; diff --git a/nereid/nereid/static/frontend/src/css/styles.css b/nereid/nereid/static/frontend/src/css/styles.css new file mode 100644 index 00000000..aab7a70d --- /dev/null +++ b/nereid/nereid/static/frontend/src/css/styles.css @@ -0,0 +1,66 @@ +.graph-editor path.link { + fill: none; + stroke: #222; + stroke-width: 5px; + cursor: pointer; +} + +.graph-editor text { + /* font: 12px sans-serif; */ + pointer-events: none; +} + +.graph-editor text.id { + text-anchor: middle; + /* font-weight: bold; */ +} + +.graph-editor path.link.selected { + stroke-dasharray: 10, 2; +} + +.graph-editor path.link.dragline { + pointer-events: none; +} + +.graph-editor circle.node { + stroke-width: 1.5px; + cursor: pointer; +} + +.no-select { + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +pre { + white-space: pre-wrap; /* Since CSS 2.1 */ + white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + word-wrap: break-word; /* Internet Explorer 5.5+ */ +} + +/* -- tailwind 2.2 does not style form inputs -- */ +#type-form input:checked + label { + border-color: black; + box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), + 0 4px 6px -2px rgba(0, 0, 0, 0.05); + color: white; + opacity: 1; +} + +input:checked ~ .dot { + transform: translateX(100%); + background-color: #48bb78; +} + +.form-group.required .control-label:before { + content: "*"; + color: red; + font-weight: bold; +} diff --git a/nereid/nereid/static/frontend/src/css/tw.css b/nereid/nereid/static/frontend/src/css/tw.css new file mode 100644 index 00000000..d24f4d41 --- /dev/null +++ b/nereid/nereid/static/frontend/src/css/tw.css @@ -0,0 +1,87 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer components { + .btn { + @apply font-bold py-1 px-2 rounded; + } + .btn-blue { + @apply bg-blue-500 text-white; + } + .btn-blue:hover { + @apply bg-blue-700; + } + .btn-gray { + @apply bg-gray-500 text-white; + } + .btn-gray:hover { + @apply bg-gray-700; + } + + /* .tooltip { + @apply absolute; + } */ + /* .has-tooltip:hover .tooltip { + @apply visible z-50; + } */ + .tab { + @apply flex-1 + text-center + font-medium + pb-3 + cursor-pointer + hover:text-blue-400; + } + .tab.active { + @apply flex-1 + text-center + font-medium + pb-3 + cursor-pointer + hover:text-blue-400 + text-blue-400; + } + .tab-slider { + @apply + block + absolute + bottom-0 + left-0 + h-1 + bg-blue-400 + transition-transform + duration-300 + ease-out + w-full; + } + .button-radio-label { + @apply flex flex-col p-2 h-full border-2 border-gray-800 cursor-pointer rounded-lg opacity-50 text-center font-bold text-xs; + } + + .markdown ol { + @apply list-decimal list-outside md:list-inside; + } + + .markdown ul { + @apply list-disc list-outside md:list-inside; + } + + .markdown h1 { + @apply font-bold text-2xl pt-8; + } + + .markdown h2 { + @apply font-semibold text-xl pt-4; + } + + .markdown h3 { + @apply font-semibold text-lg italic pt-2; + } + /* .markdown .image { + @apply overflow-auto; + } + .markdown .image img { + @apply object-none; + } */ +} diff --git a/nereid/nereid/static/frontend/src/index.html b/nereid/nereid/static/frontend/src/index.html new file mode 100644 index 00000000..18e8c35f --- /dev/null +++ b/nereid/nereid/static/frontend/src/index.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + Nereid UI + + + diff --git a/nereid/nereid/static/frontend/src/js/components/base/component.js b/nereid/nereid/static/frontend/src/js/components/base/component.js new file mode 100644 index 00000000..19f8a6ce --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/base/component.js @@ -0,0 +1,62 @@ +import d3 from "../../lib/d3.js"; +import Store from "../../lib/store.js"; + +export default class Component { + constructor(props = {}) { + let self = this; + this.element; + this.element_string; + this.id; + + // We're setting a render function as the one set by whatever inherits this base + // class or setting it to an empty by default. This is so nothing breaks if someone + // forgets to set it. + this._render = this._render || props._render || function () {}; + + // If there's a store passed in, subscribe to the state change + if (props.store instanceof Store) { + self.store = props.store; + // props.store.events.subscribe("stateChange", () => self.render()); + } + + if (props.hasOwnProperty("events") && props.store instanceof Store) { + props.events.forEach((event) => + props.store.events.subscribe(event, () => self.render()) + ); + } + + // Store the HTML element to attach the render to if set + if (props.hasOwnProperty("element")) { + self.element = props.element; + } + + if (props.hasOwnProperty("element_string")) { + self.element_string = props.element_string; + self.element = d3.select(element); + } + + if (props.hasOwnProperty("id")) { + self.id = props.id; + self.element_string = `#${self.id}`; + self.element = d3.select(self.element_string); + } + + if (props.hasOwnProperty("children")) { + self.children = props.children; + } + } + + render() { + let self = this; + this._render(); + if (this?.children) { + this.children.forEach((child) => { + if (!child?.parent_id) { + child.parent_id = self.id; + } + + child.render(); + }); + } + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/base/drawer.js b/nereid/nereid/static/frontend/src/js/components/base/drawer.js new file mode 100644 index 00000000..a799462d --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/base/drawer.js @@ -0,0 +1,247 @@ +import Component from "./component.js"; +import d3 from "../../lib/d3.js"; +import store from "../../lib/state.js"; + +export class DrawerBase extends Component { + constructor(options) { + super({ store, id: options.id, children: options.children }); + let self = this; + self.title = options.title; + self.options = options; + } + + enter() { + let self = this; + let ele = self.element; + self.transition_direction = "entering"; + + // self.element.select(`#${this.id}-content`).classed("hidden", false); + let current; + current = ele.select(".drawer-overlay").node(); + current.className = current.className.replace(/\bopacity-.+?\b/g, ""); + current.classList["add"]("opacity-40"); + + current = ele.select(".drawer-panel").node(); + current.className = current.className.replace(/\btranslate-x-.+?\b/g, ""); + current.classList["add"]("translate-x-0"); + current.className = current.className.replace(/\bopacity-.+?\b/g, ""); + current.classList["add"]("opacity-100"); + // current.ontransitionend = () => { + // self.element.select(`#${this.id}-content`).classed("hidden", false); + + // }; + if (self?.options?.enter_callback) { + self.options.enter_callback(); + } + } + + exit() { + let self = this; + let ele = document.querySelector(`#${this.id}`); + + let current; + self.transition_direction = "exiting"; + + current = ele.querySelector(".drawer-overlay"); + current.className = current.className.replace(/\bopacity-.+?\b/g, ""); + current.classList["add"]("opacity-0"); + + current = ele.querySelector(".drawer-panel"); + current.className = current.className.replace(/\btranslate-x-.+?\b/g, ""); + current.classList["add"]("translate-x-full"); + // current.ontransitionend = () => { + // let hidden = false; + // if (self.transition_direction === "exiting") { + // hidden = true; + // } + // self.element.select(`#${this.id}-content`).classed("hidden", hidden); + // }; + + if (self?.options?.exit_callback) { + self.options.exit_callback(); + } + } + + _template() { + return ` +
+ + +
+ `; + } + + _render() { + let self = this; + + self.element = d3 + .select(`#${this.id}`) + .append("div") + .classed("drawer-container", true); + self.element.html(this._template()); + + self.element + .select(`#${this.id}-close-button`) + .on("click", this.exit.bind(this)); + + if (this?.children?.length > 0) { + self.element.select(`#${this.id}-content`).html(""); + } + + let current = self.element + .select(".drawer-container") + .classed("hidden", true); + self.exit(); + current.classed("hidden", false); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/base/load-blob.js b/nereid/nereid/static/frontend/src/js/components/base/load-blob.js new file mode 100644 index 00000000..6d52c4be --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/base/load-blob.js @@ -0,0 +1,246 @@ +import Component from "./component.js"; +import d3 from "../../lib/d3.js"; +import * as util from "../../lib/util.js"; +import store from "../../lib/state.js"; + +export default class LoadFileUIBase extends Component { + constructor(options) { + super({ store }); + let self = this; + self.id = options.id; + self.title = options.title; + self.data = [{}]; + + self.data_callback = + options.data_callback || + function (data) { + console.log("loaded data: ", data); + }; + + self.primary_callback = + options.primary_callback || + function () { + console.log(`clicked primary button load files UI ${self.id}`); + }; + self.primary_button_label = options.primary_button_label || "Apply"; + + self.secondary_callback = options.secondary_callback || null; + self.secondary_button_label = options.secondary_button_label || "Update"; + } + + _template_primary_button() { + if (this.primary_callback == null) return ""; + return ``; + } + + _template_secondary_button() { + if (this.secondary_callback == null) return ""; + return ``; + } + + _template() { + return ` +
+
${this.title}
+ +
+
+
+ + +
+ ${this._template_secondary_button()} + ${this._template_primary_button()} +
+
+
`; + return ` +
+
${this.title}
+ +
+
+
+ +
+
+
+ + +
+ +
+
+
+
+
+ + + `; + + return ` +
+

${this.title}

+
+
+
+
+
+
+
Drag files here or Browse files +
+
+
+
Accepted file type:.doc only
+
+
+
+
+
+
+
+`; + } + + loadFileAsJson(evt, fxn) { + let file = evt.target.files[0]; // FileList object + // console.log(file); + // Only process csv or json files. + if (!file.type.match("csv|excel|json")) { + alert("csv or json please"); + return; + } + + let self = this; + // let _fxn = fxn.bind(self); + let reader = new FileReader(); + + // Closure to capture the file information. + reader.onload = (function (theFile) { + return function (e) { + let data; + if (true) { + if (theFile.type.match("csv|excel")) { + data = d3.csvParse(e.target.result); + } else if (theFile.type.match("json")) { + data = JSON.parse(e.target.result); + } + + data = Array.isArray(data) + ? data.map((d) => util.cleanObject(d)) + : data; + // console.log("data:", data); + // _fxn(data); + self.data = data; + // console.log(evt.target.value); + // console.log(evt.target); + evt.target.value = ""; + } + }; + })(file); + + reader.readAsText(file); + } + + _render() { + let self = this; + self.element = d3.select(`#${self.parent_id}-content`).append("div"); + self.element.html(self._template()); + + self.primary_button = self.element.select(`#${this.id}-primary-button`); + self.primary_button.on("click", () => { + self.data_callback.bind(self)(self.data); + self.primary_callback.bind(self)(); + let label = self.element.select(`#${this.id} label`); + }); + + self.secondary_button = self.element.select(`#${this.id}-secondary-button`); + self.secondary_button.on("click", () => { + self.data_callback.bind(self)(self.data); + self.secondary_callback.bind(self)(); + let label = self.element.select(`#${this.id} label`); + }); + + self.input = self.element.select(`#${this.id} input`); + self.input.on("change", (e) => { + self.loadFileAsJson.bind(self)(e); //, ; + let label = self.element.select(`#${this.id} label`); + label.text(e.target.files[0].name); + label.classed("font-bold", true); + let label_node = label.node(); + label_node.className = label_node.className.replace( + /\btext-gray-.+?\b/g, + "" + ); + label_node.classList["add"]("text-gray-700"); + }); + + return; + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/base/toggle.js b/nereid/nereid/static/frontend/src/js/components/base/toggle.js new file mode 100644 index 00000000..c3051952 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/base/toggle.js @@ -0,0 +1,60 @@ +import Component from "./component.js"; +import d3 from "../../lib/d3.js"; +import store from "../../lib/state.js"; + +export class ToggleBase extends Component { + constructor(options) { + super({ store, id: options.id }); + this.parent_id = options.parent_id; + this.text = options.text; + this.callback = options.callback; + this.isActive = options.isActive; + this.scale = options.scale || "scale-100"; + this.button; + this._class = options.class_string || ""; + } + + get class() { + return this._class; + } + + _render() { + let self = this; + self.toggle = d3.select(`#${self.parent_id}`).append("div"); + self.toggle.html(` + +
+ +
+ `); + + self.toggle + .select("input[type=checkbox]") + .property("checked", self.isActive); + self.toggle.select("input").on("change", self.callback.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/base/vector-layer.js b/nereid/nereid/static/frontend/src/js/components/base/vector-layer.js new file mode 100644 index 00000000..085297af --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/base/vector-layer.js @@ -0,0 +1,66 @@ +import * as topojson from "topojson-client"; +import rewind from "@turf/rewind"; + +import * as api from "../../lib/nereid-api"; +import store from "../../lib/state.js"; +import * as util from "../../lib/util.js"; + +import Component from "./component.js"; + +export default class VectorLayer extends Component { + constructor({ vector }) { + super({ store }); + let self = this; + self.group = vector.append("g"); + self.stroke_width = 0; + self.domain = [0, 1]; + self.projection = util.get(self, "store.state.projection"); + self.renderer = d3.geoPath(self.projection).digits(15); + } + + get transform() { + return util.get(this, "store.state.transform"); + } + + async _load_data(info) { + let self = this; + + if (!info) return; + + let geojson, rsp; + + try { + if (info?.filepath) { + rsp = await api.getReferenceData(info.filepath); + } else if (info?.url) { + rsp = await util.getJsonResponse(info.url); + } else { + return; + } + } catch (error) { + console.error(error); + return; + } + + try { + if (rsp?.type === "Topology") { + let topology = rsp; + geojson = topojson.feature(topology, topology.objects[info.name]); + } else if (rsp?.type === "FeatureCollection") { + geojson = rsp; + geojson.features = geojson.features.map((d) => + rewind(d, { reverse: true }) + ); + } + } catch (error) { + console.error(error); + return; + } + if (geojson) { + geojson._field = info.field; + let domain_arr = geojson.features.map((d) => d.properties[info.field]); + self.domain = [Math.min(...domain_arr), Math.max(...domain_arr)]; + self.geojson = geojson; + } + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/editor.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/editor.js new file mode 100644 index 00000000..03468b66 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/editor.js @@ -0,0 +1,43 @@ +import d3 from "../../lib/d3"; +import store from "../../lib/state"; +import Component from "../base/component"; + +import Map from "./map"; +import StateVectors from "./vectors-states_clickable"; +import DesignStormVectors from "./vectors-design_storm"; +import RefDataVectors from "./vectors-ref_data_key"; +import GraphEditor from "./graph-editor"; + +export default class Editor extends Component { + constructor() { + super({ store }); + } + + _render() { + let self = this; + self.svg = d3 + .select(`#map`) + .append("svg") + .attr("viewBox", [ + 0, + 0, + d3.select(`#map`).node().getBoundingClientRect().width, + d3.select(`#map`).node().getBoundingClientRect().height, + ]); + + self.map = new Map({ id: "map", svg: self.svg }); + const vector = self.map.vector; + + self.states = new StateVectors({ vector }); + self.designStorm = new DesignStormVectors({ vector }); + self.refData = new RefDataVectors({ vector }); + + self.graphEditor = new GraphEditor({ svg: self.svg }); + + self.map.render(); + self.states.render(); + self.designStorm.render(); + self.refData.render(); + self.graphEditor.render(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/graph-editor.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/graph-editor.js new file mode 100644 index 00000000..cab51501 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/graph-editor.js @@ -0,0 +1,796 @@ +import Component from "../base/component.js"; +import store from "../../lib/state.js"; +import * as util from "../../lib/util.js"; +import d3 from "../../lib/d3.js"; + +// import { +// // pointerToLongLat, +// distance, +// } from "./util.js"; + +// import { Graph } from "./graph.js"; + +export default class GraphEditor extends Component { + constructor(options) { + super({ store, id: options.id }); + let self = this; + + // self.store.events.subscribe("isConstNodeArea", () => + // self.toggleConstNodeArea() + // ); + // self.store.events.subscribe("isAddNodeMode", () => + // self.toggleAddOrMoveNode() + // ); + + self.svg = options.svg; + self.options = options || {}; + + self.default_nodesize = self.options.default_nodesize || 12; + + self.charge = self.options.charge || -300; + self.edge_distance = self.options.edge_distance || 80; + self.node_types = self.options.node_types || {}; + self.onNodeSelected = + typeof self.options.onNodeSelected !== "undefined" + ? self.options.onNodeSelected + : function () {}; + + self.onNodeUnSelected = + typeof self.options.onNodeUnSelected !== "undefined" + ? self.options.onNodeUnSelected + : function () {}; + + //status saves + self._selected_node_id = null; + // self._selected_edge = null; + self._mousedown_edge = null; + self._mousedown_node = null; + self._mouseup_node = null; + self._lastKeyDown = -1; + + self.container = self.svg + .append("svg:g") + .classed("graph-editor", true) + .style("pointer-events", "all"); + + // define arrow markers for graph links + self.container + .append("svg:defs") + .append("svg:marker") + .attr("id", "end-arrow") + .attr("viewBox", "0 -5 10 10") + .attr("refX", 5) + .attr("markerWidth", 3) + .attr("markerHeight", 3) + .attr("orient", "auto") + .style("fill", d3.gray(20)) + .append("svg:path") + .attr("d", "M0,-5L10,0L0,5"); + // .attr("fill", "#000"); + + self.dragLine = self.container + .append("svg:path") + .attr("class", "link dragline hidden") + .attr("d", "M0,0L0,0"); + + self.path = self.container.append("svg:g").selectAll("path"); + self.circle = self.container.append("svg:g").selectAll("g"); + + self.drag = d3 + .drag() + // Mac Firefox doesn't distinguish between left/right click when Ctrl is held... + .filter((event) => event.button === 0 || event.button === 2) + .on("drag", (event, d) => { + d.longlat = self.pointToLongLat([event.x, event.y]); + self.update(); + }) + .on("end", () => self.store.dispatch("stateChange")); + + // events & subscriptions + + d3.select(window) + .on("mousemove.graph-editor", self.mousemove.bind(self)) + .on("keydown.graph-editor", self.keydown.bind(self)) + .on("keyup.graph-editor", self.keyup.bind(self)); + + self.svg + .on("click.graph-editor", self.mousedown_addNode.bind(self)) + .on("mouseup.graph-editor", self.mouseup.bind(self)) + .on("mouseenter", self.mouseenter.bind(self)) + .on("mouseleave", self.mouseleave.bind(self)); + } + subscribe() { + let self = this; + self.store.events.subscribe("isConstNodeArea", () => + self.toggleConstNodeArea() + ); + self.store.events.subscribe("changedTransform", () => self.update()); + self.store.events.subscribe("editorUpdate", () => { + self.update(); + }); + self.store.events.subscribe("newGraph", () => { + self.update(); + }); + self.store.events.subscribe("setRefDataQuery", () => { + self.update(); + }); + self.store.events.subscribe("setDesignStormQuery", () => { + self.update(); + }); + } + get bbox() { + return this.svg.node().getBoundingClientRect(); + } + get width() { + return this.bbox.width; + } + get height() { + return this.bbox.height; + } + get transform() { + return util.get(this, "store.state.transform"); + } + get projection() { + return util.get(this, "store.state.projection"); + } + get editing_mode() { + return util.get(this, "store.state.graph_edit_mode"); + } + get graph() { + return util.get(this, "store.state.graph"); + } + + get_node_by_id(id) { + return this.graph.nodes.find((n) => n.id === id); + } + + fixedScale = () => false; + getScale = () => { + let self = this; + return self.fixedScale() + ? util.get(self, "store.state.transform.k") / + util.get(self, "store.state.initialScale") + : 1; + }; + pointToLongLat(point) { + let self = this; + const longlat = self.projection.invert(self.transform.invert(point)); + + return longlat; + } + longLatToPoint(longlat) { + let self = this; + const point = self.transform.apply(self.projection(longlat)); + return point; + } + // reprojectLongLat(longlat) { + // let self = this; + // return self.transform.apply(self.projection(longlat)); + // } + getLoc = (d) => { + let self = this; + return self.longLatToPoint(d.longlat); + // return window.asPoint ? d.point : self.reprojectLongLat(d.longlat); + }; + + recalculateNodeSize(d) { + let self = this; + return ( + Math.max(3, d.size * self.getScale()) * + (d.id === self._selected_node_id ? 1.3 : 1) + ); + + // let s = self.const_node_area + // ? d.size * + // (Math.pow(2, self.map.getZoom()) / Math.pow(2, self.map.getMaxZoom())) + // : d.size; + // return s; + } + getColor(d) { + let self = this; + if (d?.color) return d3.rgb(d.color); + let node_info = util.get(self.store.state.node_types, d.node_type); + return d3.rgb(node_info?.color || "lightgrey"); + } + + tick() { + //update edge position + let self = this; + + self.path.attr("d", (d) => { + const deltaX = d.target.x - d.source.x; + const deltaY = d.target.y - d.source.y; + const dist = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + const normX = deltaX / dist; + const normY = deltaY / dist; + const sourcePadding = self.recalculateNodeSize(d.source); + const targetPadding = 5 + self.recalculateNodeSize(d.target); + // const sourcePadding = d.source.size; + // const targetPadding = 5 + d.target.size; + const sourceX = d.source.x + sourcePadding * normX; + const sourceY = d.source.y + sourcePadding * normY; + const targetX = d.target.x - targetPadding * normX; + const targetY = d.target.y - targetPadding * normY; + + if ( + deltaX * (targetX - sourceX) < 0 || + deltaY * (targetY - sourceY) < 0 + ) { + return `M${d.source.x},${d.source.y}L${d.target.x},${d.target.y}`; + } + + return `M${sourceX},${sourceY}L${targetX},${targetY}`; + }); + + self.circle + .selectAll(".node") + // .attr("r", (d) => Math.max(3, d.size * self.getScale())); + .attr("r", (d) => self.recalculateNodeSize(d) * 0.95); + + self.circle.attr("transform", (d) => `translate(${d.x},${d.y})`); + // console.log("ran tick"); + + // self.redrawMapMarkers(); + } + + getState(coords) { + let self = this; + let state_query = util.get(self, "store.state.state_query"); + let state = "undefined"; + let obj; + if (state_query != null) { + obj = state_query.features.find((d) => d3.geoContains(d, coords)); + return obj?.properties?.name || "undefined"; + } + + return state; + } + + getDesignStormDepth(coords) { + let self = this; + let state_query = util.get(self, "store.state.design_storm_geojson"); + let state = "undefined"; + let obj; + if (state_query != null) { + obj = state_query.features.find((d) => d3.geoContains(d, coords)); + return obj?.properties?.[state_query._field]; + } + + return; + } + + getRefDataKey(coords) { + let self = this; + let state_query = util.get(self, "store.state.ref_data_key_geojson"); + let state = "undefined"; + let obj; + if (state_query != null) { + obj = state_query.features.find((d) => d3.geoContains(d, coords)); + return obj?.properties?.[state_query._field]; + } + + return; + } + + setNodeDefaults(nodes) { + let self = this; + nodes.map((d) => + d?.size ? d : Object.assign(d, { size: self.default_nodesize }) + ); + + nodes.map((d) => + d?.longlat + ? d + : Object.assign(d, { longlat: self.pointToLongLat([d.x, d.y]) }) + ); + + nodes.map((n) => { + let [x, y] = self.longLatToPoint(n.longlat); + n.x = x; + n.y = y; + return n; + }); + + nodes.map((n) => { + n.state = self.getState(n.longlat); + return n; + }); + + nodes.map((n) => { + if (!n?.node_type?.includes("land_surface")) { + let design_storm_depth = self.getDesignStormDepth(n.longlat); + if (design_storm_depth == null) { + return n; + } + n.design_storm_depth_inches = + +parseFloat(design_storm_depth).toFixed(2); + if (n?.data) { + n.data.design_storm_depth_inches = n.design_storm_depth_inches; + } + } + return n; + }); + + nodes.map((n) => { + if (!n?.node_type?.includes("land_surface")) { + let ref_data_key = self.getRefDataKey(n.longlat); + if (ref_data_key == null) { + return n; + } + n.ref_data_key = ref_data_key; + if (n?.data) { + n.data.ref_data_key = n.ref_data_key; + } + } + return n; + }); + } + + update() { + let self = this, + nodes; + + nodes = self.graph.nodes; + + self.setNodeDefaults(nodes); + + // console.log({ nodes, edges: self.graph.edges }); + + self.path = self.path.data(self.graph.edges); + + // update existing links + self.path + .classed("selected", (d) => d === self._selected_edge) + .style("marker-end", "url(#end-arrow)"); + + // remove old links + self.path.exit().remove(); + + // add new links + self.path = self.path + .enter() + .append("svg:path") + .classed("link", true) + .classed("selected", (d) => d === self._selected_edge) + .style("marker-end", "url(#end-arrow)") + // .style("stroke", (d) => d3.gray(51)) + + .on("mousedown", (event, d) => { + if (event.ctrlKey) return; + + // select link + self._mousedown_edge = d; + self._selected_edge = + self._mousedown_edge === self._selected_edge + ? null + : self._mousedown_edge; + + self._selected_node_id = null; + self.update(); + }) + .merge(self.path); + + // circle (node) group + // the function arg is crucial here! nodes are known by id, not by index! + self.circle = self.circle.data(nodes, (d) => JSON.stringify(d)); + + // update existing nodes (selected visual states) + self.circle + .selectAll(".node") + // .transition() + // .attr("class", (d) => "node " + (d.node_type || "")) + + .attr( + "r", + (d) => self.recalculateNodeSize(d) //- 15 + // d.size * + // (Math.pow(2, self.map.getZoom()) / Math.pow(2, self.map.getMaxZoom())) + ) + .style("fill", (d) => { + let c = self.getColor(d); + return d.id === self._selected_node_id ? c.brighter(3) : c; + }) + .style("stroke", (d) => self.getColor(d).darker().toString()); + + // update text + self.circle.selectAll("text").text((d) => d.id); + + // remove old nodes + self.circle.exit().remove(); + + // add new nodes + // https://stackoverflow.com/questions/20708442/d3-js-chart-not-updated-with-new-data + const g = self.circle.enter().append("svg:g"); + + g.append("circle") + .classed("node has-tooltip", true) + .attr( + "r", + (d) => self.recalculateNodeSize(d) //- 15 + // d.size * + // (Math.pow(2, self.map.getZoom()) / Math.pow(2, self.map.getMaxZoom())) + ) + .style("fill", (d) => { + let c = self.getColor(d); + return d.id === self._selected_node_id ? c.brighter(3) : c; + }) + .style("stroke", (d) => self.getColor(d).darker().toString()) + + // .attr("class", (d) => "node " + (d.node_type || "")) + // .attr( + // "r", + // (d) => self.recalculateNodeSize(d) - 15 + // // d.size * + // // (Math.pow(2, self.map.getZoom()) / Math.pow(2, self.map.getMaxZoom())) + // ) + // // .attr("r", (d) => d.size || self.default_nodesize) + // .style("fill", (d) => { + // let c = self.getColor(d); + // return d === self._selected_node ? c.brighter() : c; + // }) + // .style("stroke", (d) => self.getColor(d).darker().toString()) + + .on("mouseover", function (event, d) { + self._hovered_node = d; + self.store.dispatch("isNodeHovered", { node_hovered: d.id }); + + if ( + !self._selected_node_id && + !(util.get(self, "store.state.current_node_data.id") === d.id) + ) { + // only change with hover if there's no node currently selected. + // self.tooltip_show(d); + // self.store.dispatch("currentNodeData", { current_node_data: d }); + // self.tooltip_move(d); + } + + if (!self._mousedown_node || d.id === self._mousedown_node.id) return; + // enlarge target node + d3.select(event.target).attr("transform", "scale(1.25)"); + }) + .on("mouseout", (event, d) => { + self._hovered_node = undefined; + self.store.dispatch("isNodeHovered", { node_hovered: undefined }); + // self.tooltip_hide(); + if (!self._mousedown_node || d.id === self._mousedown_node.id) return; + // unenlarge target node + d3.select(event.target).attr("transform", ""); + }) + .on("mousedown", (event, d) => { + // console.log("fired circle mousedown"); + if (event.shiftKey || event.ctrlKey) return; + self.store.dispatch("drag_lock", { drag_lock: true }); + // self.map.dragging.disable(); + + // select node + self._mousedown_node = d; + + if (self._mousedown_node.id === self._selected_node_id) { + self._selected_node_id = null; + self.onNodeUnSelected(d); + // store.dispatch("currentNodeData", { current_node_data: undefined }); + self.store.dispatch("changedSelectedNode", { + selected_node_id: null, + }); + } else { + self._selected_node_id = self._mousedown_node.id; + // self.tooltip_show(d); + // store.dispatch("currentNodeData", { current_node_data: d }); + + store.dispatch("changedSelectedNode", { + selected_node_id: d.id, + }); // weird resize observer error here on changed selected node event, maybe due to config panel + + // self.tooltip_move(d); + self.onNodeSelected(d); + } + self._selected_edge = null; + + // reposition drag line + + // self.dragLine + // .style("marker-end", "url(#end-arrow)") + // .classed("hidden", false) + // .attr( + // "d", + // `M${self._mousedown_node.x},${self._mousedown_node.y}L${self._mousedown_node.x},${self._mousedown_node.y}` + // ); + + self.update(); + }) + // .on("wheel", (event, d) => { + // d3.event.preventDefault(); + // console.log("scrolling", d.id); + // }) + .on("mouseup", (event, d) => { + // needed by FF + self.dragLine.classed("hidden", true).style("marker-end", ""); + // release drag lock. + self.store.dispatch("drag_lock", { drag_lock: false }); + // self.map.dragging.enable(); + if (!self._mousedown_node || !self.editing_mode) return; + + // check for drag-to-self + self._mouseup_node = d; + + if (self._mouseup_node.id === self._mousedown_node.id) { + self.resetMouseVars(); + return; + } + + // unenlarge target node + d3.select(event.target).attr("transform", ""); + + // add link to graph (update if exists) + const source = self._mousedown_node.id; + const target = self._mouseup_node.id; + + const link = self.graph.edges.find( + (l) => l.source === source && l.target === target + ); + if (link) { + // link[isRight ? "right" : "left"] = true; + } else { + let s = self.graph.nodes.find((n) => n.id === source); + let t = self.graph.nodes.find((n) => n.id === target); + // self.graph.edges.push({ source, target }); + self.graph.edges.push({ source: s, target: t }); + } + + // select new link + self._selected_edge = link; + self._selected_node_id = null; + self.update(); + }); + + // show node IDs + g.append("text") + .attr("x", 0) + .attr("y", "0.3rem") + .attr( + "class", + "id no-select align-middle text-center font-bold text-base pointer-events-none" + ) + .text((d) => d.id); + + self.circle = g.merge(self.circle); + + self.tick(); + // console.log("ran update"); + } + + zoom_to_group(iters) { + // console.log("z to g"); + let self = this; + const bb = self.container.node().getBBox(); + // console.log(bb); + const [[x0, y0], [x1, y1]] = [ + [bb.x, bb.y], + [bb.x + bb.width, bb.y + bb.height], + ]; + + if (iters == null) { + iters = 1; + } + + let scale = self.transform.k; + + while (iters > 0) { + iters -= 1; + scale = Math.min( + 1 << 28, + scale * + (0.9 / Math.max((x1 - x0) / self.width, (y1 - y0) / self.height)) + ); + } + + const new_center = [x0 + bb.width / 2, y0 + bb.height / 2]; + + let zoom_transform = util.get(self, "store.state.zoomTransform"); + + self.svg + .interrupt() + .transition() + .duration(800) + .call( + zoom_transform, + d3.zoomIdentity + .translate(self.width / 2, self.height / 2) + .scale(-scale) + .translate(...self.transform.invert(new_center)) + .scale(-1) + ); + } + + // window keyboard events + + mouseenter() { + this.svg.classed("listening-to-keys", true); + } + + mouseleave() { + this.svg.classed("listening-to-keys", false); + } + + keydown(event) { + let self = this; + + // presses are related to editor pane + if (!self.svg.classed("listening-to-keys")) return; + + if (event.keyCode === 90) { + // z + // self.reset(); + } + + if (event.keyCode === 71) { + // g + self.zoom_to_group(); + } + + // presses are related to editor mode + if (!self.editing_mode) return; + + // dragging support + if (event.keyCode === 17) { + self.circle.call(self.drag); + self.svg.classed("ctrl", true); + return; + } + + // presses are related to the selected editor item + if (!this._selected_node_id && !this._selected_edge) return; + + switch (event.keyCode) { + case 8: // backspace + case 46: // delete + if (this._selected_node_id) { + this.graph.nodes.splice( + this.graph.nodes.map((n) => n.id).indexOf(this._selected_node_id), + 1 + ); + this.graph.spliceLinksForNode(this._selected_node_id); + } else if (this._selected_edge) { + this.graph.edges.splice( + this.graph.edges.indexOf(this._selected_edge), + 1 + ); + } + this._selected_edge = null; + this._selected_node_id = null; + self.store.dispatch("changedSelectedNode", { + selected_node_id: null, + }); + this.resetMouseVars(); + + this.update(); + break; + } + } + + keyup(event) { + let self = this; + // this._lastKeyDown = -1; + // d3.select(`#${this.id}`).style("pointer-events", "none"); + + // ctrl + if (event.keyCode === 17) { + self.circle.on(".drag", null); + self.svg.classed("ctrl", false); + // _current_point = undefined; + } + } + + // window mouse events + + mousedown_addNode(event) { + // console.log("fire add node"); + let self = this; + // because :active only works in WebKit? + this.svg.classed("active", true); + + // console.log(self._mousedown_node, self._mousedown_edge); + + if ( + event.shiftKey || + event.ctrlKey || + !self.editing_mode || + self._mousedown_node || + self._mousedown_edge || + self._hovered_node + ) { + // console.log("add node cancelled"); + self.resetMouseVars(); + return; + } + + // console.log("add node"); + + // insert new node at point + const point = d3.pointer(event); //this.container.node()); + let [x, y] = point; + let coords = self.pointToLongLat([x, y]); + + // console.log("clicked point", point); + const node = { + id: util.randomString(5), + // reflexive: false, + x: x, + y: y, + size: self.default_nodesize, + longlat: coords, + }; + + node.design_storm_depth_inches = +parseFloat( + self.getDesignStormDepth(node.longlat) + ).toFixed(2); + + node.ref_data_key = self.getRefDataKey(node.longlat); + + this.graph.nodes.push( + node + // Object.assign(node, self.map.containerPointToLatLng(node)) + // Object.assign(node, self.map.layerPointToLatLng(node)) + ); + + self.store.dispatch("changedSelectedNode", { + selected_node_id: node.id, + }); + self._selected_node_id = this.graph.nodes.find((n) => n.id === node.id)?.id; + self.update(); + // self.force.restart(); + // console.log("added", node); + // this.onNodeSelected(node); + self.mouseup(); + } + + mouseup() { + // because :active only works in WebKit? + this.svg.classed("active", false); + + if (this._mousedown_node) { + // hide drag line + this.dragLine.classed("hidden", true).style("marker-end", ""); + return; + } + + // clear mouse event vars + this.resetMouseVars(); + } + + mousemove(event) { + let self = this; + if (!this._mousedown_node || !this.editing_mode) return; + + let { x, y } = util + .get(this, "store.state.graph.nodes") + .find((n) => n.id === this._mousedown_node.id); + + // update drag line + self.dragLine + .style("marker-end", "url(#end-arrow)") + .classed("hidden", false) + .attr( + "d", + `M${self._mousedown_node.x},${self._mousedown_node.y}L${self._mousedown_node.x},${self._mousedown_node.y}` + ); + const point = d3.pointer(event, this.container.node()); + this.dragLine.attr("d", `M${x},${y}L${point[0]},${point[1]}`); + } + + resetMouseVars() { + // console.log("resetting mouse vars"); + this._mousedown_node = null; + this._mouseup_node = null; + this._mousedown_edge = null; + } + + // Rendering + + _render() { + let self = this; + self.subscribe(); + self.update(); + self.zoom_to_group(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/graph.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/graph.js new file mode 100644 index 00000000..bae30b5b --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/graph.js @@ -0,0 +1,83 @@ +import store from "../../lib/state.js"; +import * as util from "../../lib/util.js"; + +// https://github.com/ChristophKuper/d3-graph-editor/blob/master/src/GraphEditor.js +export class Graph { + constructor(nodes, edges, options) { + this.nodes = nodes || []; + this.edges = edges || []; + this.options = options || {}; + this.resolve_links(); + + store.dispatch("newGraph", { graph: this }); + } + + resolve_links() { + let self = this; + self.nodes = self.nodes.filter((n) => n.id != null); + this.edges.forEach(function (d) { + let src = d.source; + let tgt = d.target; + + d.source = self.nodes.find((n) => n.id === src); + d.target = self.nodes.find((n) => n.id === tgt); + }); + + let xloc = this.options.width || 600; + let yloc = this.options.height || 400; + + this.nodes.forEach(function (d) { + if (!d.x) { + d.x = xloc / 2 + (xloc / 3) * (Math.random() - 1); + } + + if (!d.y) { + d.y = yloc / 2 + (yloc / 3) * (Math.random() - 1); + } + }); + } + + spliceLinksForNode(node_id) { + const toSplice = this.edges.filter( + (l) => l.source.id === node_id || l.target.id === node_id + ); + for (const l of toSplice) { + this.edges.splice(this.edges.indexOf(l), 1); + } + } +} + +export function applyEdges() { + let { nodes, edges, scenario_name } = util.deepCopy( + util.get(store, "state.staged_changes") + ); + + let _ = new Graph(nodes, edges); + store.dispatch("clearStagedChanges", { staged_changes: {} }); + + if (scenario_name) store.dispatch("updateScenarioName", { scenario_name }); +} + +export function updateEdges() { + let new_nodes = util.deepCopy(util.get(store, "state.staged_changes.nodes")), + new_edges = util.deepCopy(util.get(store, "state.staged_changes.edges")), + old_nodes = util.deepCopy(util.get(store, "state.graph.nodes")), + old_edges = util.deepCopy(util.get(store, "state.graph.edges")), + edges = [...old_edges, ...new_edges].map((d) => { + return { + source: d.source?.id || d.source, + target: d.target?.id || d.target, + }; + }); + + let nodes = new_nodes; + for (let n of old_nodes) { + if (!new_nodes.map((n) => n.id).includes(n.id)) { + nodes.push(n); + } + } + + let _ = new Graph(nodes, edges); + + store.dispatch("clearStagedChanges", { staged_changes: {} }); +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/index.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/index.js new file mode 100644 index 00000000..537ea5af --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/index.js @@ -0,0 +1,5 @@ +import Editor from "./editor"; +import { restoreSession } from "../session"; + +restoreSession(); +export const editor = new Editor(); diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/map.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/map.js new file mode 100644 index 00000000..89881877 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/map.js @@ -0,0 +1,171 @@ +import d3 from "../../lib/d3.js"; +import store from "../../lib/state.js"; +import { get } from "../../lib/util.js"; + +import Component from "../base/component.js"; + +export default class Map extends Component { + constructor(options) { + super({ store, id: options.id }); + let self = this; + + self.store.events.subscribe("isMapMode", () => self.toggleMapMode()); + self.store.events.subscribe("changedTransform", (d) => self.zoomed(d)); + + self.svg = options.svg; + + self.initialScale = get(self, "store.state.initialScale"); //1 << 18; + self._k = {}; + self.initialCenter = + get(self, "store.state.config.project_spatial_data.app.centroid") || + get(self, "store.state.initialCenter"); //[-117.16107, 32.711518]; + self.tilesize = 256; //256 + // height = 600, + // width = 800, + + self._current_point; + self._zoomed = false; + // _transform = {}, + self.url = (x, y, z) => + // `https://stamen-tiles-${ + // "abc"[Math.abs(x + y) % 3] + // }.a.ssl.fastly.net/terrain/${z}/${x}/${y}${ + // devicePixelRatio > 1 ? "@2x" : "" + // }.png`; + `https://${ + "abc"[Math.abs(x + y) % 3] + }.basemaps.cartocdn.com/rastertiles/voyager/${z}/${x}/${y}${ + devicePixelRatio > 1 ? "@2x" : "" + }.png`; + // `https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}`; + + self.projection = d3 + .geoMercator() + .scale(1 / (2 * Math.PI)) + .translate([0, 0]); + + self.store.dispatch("setProjection", { projection: self.projection }); + + self.transform = d3.zoomIdentity + .translate(self.projection([0, 0])[0], self.projection([0, 0])[1]) + .scale(self.projection.scale() * 2 * Math.PI); + self.store.dispatch("setTransform", { transform: self.transform }); + + self.renderer = d3.geoPath(self.projection); + + self.tile = d3 + .tile() + .extent([ + [0, 0], + [self.width(), self.height()], + ]) + .tileSize(self.tilesize); + + self.image_bg = self.svg + .append("svg:g") + .classed("bg basemap", true) + .attr("pointer-events", "none") + .style("overflow", "hidden") + .attr("pointer-events", "none") + .classed("hidden", !self.store.state.map_mode) + .selectAll("image"); + + self.image_fg = self.svg + .append("svg:g") + .classed("fg basemap", true) + .attr("pointer-events", "none") + .style("overflow", "hidden") + // .attr("id", "images") + .classed("hidden", !self.store.state.map_mode) + .selectAll("image"); + + self.image_group = self.svg.selectAll(".basemap"); + + self.vector = self.svg + .append("svg:g") + .attr("id", "vectors") + .attr("pointer-events", "none"); + + self.zoom = d3 + .zoom() + .scaleExtent([1 << 6, 1 << 30]) + .extent([ + [0, 0], + [self.width(), self.height()], + ]) + // .clickDistance(0) + .filter( + () => !self.drag_lock //true //!_current_point + // !d3.select("svg").classed("no-zoom") && !d3.select("svg").classed("ctrl") + ) + .on("start", (e) => {}) + .on("zoom", (e) => { + self.store.dispatch("changedTransform", { transform: e.transform }); + }) + .on("end", (e) => { + self.store.dispatch("changedZoomTransform", { + zoomTransform: self.zoom.transform, + }); + }); + } + + width = () => d3.select(`#${this.id}`).node().getBoundingClientRect().width; + height = () => d3.select(`#${this.id}`).node().getBoundingClientRect().height; + // getScale = () => (fixedScale() ? this._k / this.initialScale : 1); + + get drag_lock() { + return get(this, "store.state.drag_lock"); + } + + toggleMapMode() { + let self = this; + self.image_group.classed("hidden", !self.store.state.map_mode); + console.log("map mode toggled!"); + } + + zoomed({ transform }) { + let self = this; + + self.transform = transform; + self._k = transform.k; + // console.log(_k); + const tiles = self.tile(transform); + // image_group.classed("hidden", !showMap()); + // if (showMap()) { + + self.image_bg = self.image_bg + .data(tiles, (d) => d) + .join("image") + .attr("xlink:href", (d) => self.url(...d)) + .attr("x", ([x]) => (x + tiles.translate[0]) * tiles.scale - 0.5) + .attr("y", ([, y]) => (y + tiles.translate[1]) * tiles.scale - 0.5) + .attr("width", tiles.scale + 1) + .attr("height", tiles.scale + 1); + + self.image_fg = self.image_fg + .data(tiles, (d) => d) + .join("image") + .attr("xlink:href", (d) => self.url(...d)) + .attr("x", ([x]) => (x + tiles.translate[0]) * tiles.scale) + .attr("y", ([, y]) => (y + tiles.translate[1]) * tiles.scale) + .attr("width", tiles.scale) + .attr("height", tiles.scale); + + self.vector.attr("transform", transform); + } + + _render() { + // console.log(this.width(), this.height(), this.store); + let self = this; + + self.svg.call(self.zoom).call( + self.zoom.transform, + // transform + d3.zoomIdentity + .translate(self.width() / 2, self.height() / 2) + .scale(-self.initialScale) + .translate(...self.projection(self.initialCenter)) + .scale(-1) + ); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/points.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/points.js new file mode 100644 index 00000000..feaba744 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/points.js @@ -0,0 +1,343 @@ +import d3 from "../../lib/d3.js"; +import * as topojson from "topojson-client"; +import store from "../../lib/state.js"; +import { get } from "../../lib/util.js"; + +import Component from "../base/component.js"; +import { pointerToLongLat, distance } from "./util.js"; + +export default class Points extends Component { + constructor(options) { + return; + super({ store, id: options.id }); + let self = this; + self.svg = options.svg; + + self.store.events.subscribe("changedTransform", (d) => self.update_cir()); + + self.data = [ + { + id: 0, + longlat: get(self, "store.state.initialCenter"), + size: 50, // pi * radius ** 2 + point: [self.width() / 2, self.height() / 2], + }, + ]; + self.delaunay = self.updateDelaunay(); + self.delauneySearchRadius = 5; + + self.circle_group = self.svg + .append("svg:g") + .attr("id", "circles") + .classed("points", true); + + self.cir = self.circle_group.selectAll("circle"); + self._current_point; + + self.pointDragHandler = d3 + .drag() + // Mac Firefox doesn't distinguish between left/right click when Ctrl is held... + .filter((event) => event.button === 0 || event.button === 2) + .on("start", (event, d) => null) + .on("drag", (event, d) => { + // console.log("dragging"); + + // this drag handler is for moving points, so we use the local event rather than the + d.longlat = pointerToLongLat(self.projection, self.transform, [ + event.x, + event.y, + ]); + self.update_cir(); + self.circle_group.style("opacity", 0.3); + }) + .on("end", (event, d) => { + // console.log("drag end"); + + self.delaunay = self.updateDelaunay(); + self._current_point = undefined; + // console.log(d.id, d.longlat); + self.circle_group.style("opacity", 1); + }); + + // self.svg + // .on("click", (e) => { + // const longlat = pointerToLongLat( + // self.projection, + // self.transform, + // d3.pointer(e) + // ); + // console.log(longlat); + // this.addPoint(longlat); + // this._current_point = undefined; + // }) + // .on("mousemove", (event) => self.mousemoved(event)); + + d3.select(window) + .on("keydown.points", self.keydown.bind(self)) + .on("keyup.points", self.keyup.bind(self)) + .on("mousemove.points", () => {}) + .on("mouseup.points", (event) => { + self._current_point = undefined; + }); + } + get transform() { + return get(this, "store.state.transform"); + } + + get projection() { + return get(this, "store.state.projection"); + } + + // width = () => d3.select(`#${this.id}`).node().getBoundingClientRect().width; + width = () => this.svg.node().getBoundingClientRect().width; + // height = () => d3.select(`#${this.id}`).node().getBoundingClientRect().height; + height = () => this.svg.node().getBoundingClientRect().height; + + fixedScale = () => false; + reprojectLongLat(longlat) { + let self = this; + return self.transform.apply(self.projection(longlat)); + } + getLoc = (d) => { + let self = this; + return window.asPoint ? d.point : self.reprojectLongLat(d.longlat); + }; + updateDelaunay = () => { + let self = this; + return d3.Delaunay.from( + self.data, + (d) => d.longlat[0], + (d) => d.longlat[1] + // (d) => getLoc(d)[0], + // (d) => getLoc(d)[1] + ); + }; + + // let radius = 5; + + find = (mx, my) => { + let self = this; + // console.log(self.delaunay); + const idx = self.delaunay.find(mx, my); + if (isNaN(idx) || idx == null) return null; + // console.log(idx); + + const datum = self.data[idx], + // [_mx, _my] = projection([mx, my]), + // [px, py] = projection(datum.longlat); + + [_mx, _my] = self.reprojectLongLat([mx, my]), + [px, py] = self.reprojectLongLat(datum.longlat); + // [px, py] = getLoc(datum); + + const d = distance(px, py, _mx, _my); + // console.log(d); + return d < self.delauneySearchRadius + datum.size * self.getScale() + ? datum + : null; + }; + + // let found = null; + + addPoint = (longlat) => { + console.log("enter add point"); + + let self = this; + if (!get(self, "store.state.add_node_mode")) { + return; + } + + let data = self.data; + if ( + self.svg.classed("no-zoom") || + self._current_point + // || + // event.defaultPrevented + // false + ) + return; + // event.preventDefault(); + console.log("adding Point"); + + let id = data.length > 0 ? data[data.length - 1].id + 1 : 0; + let point = [self.width() / 2 + id * 40, self.height() / 2 + id * 40]; + + data.push({ + id, + size: 20, + longlat, + point, + }); + + self.delaunay = self.updateDelaunay(); + + self.update_cir(); + }; + + getScale = () => { + let self = this; + return self.fixedScale() + ? get(self, "store.state.transform.k") / + get(self, "store.state.initialScale") + : 1; + }; + + update_cir() { + let self = this; + self.cir = self.circle_group + .selectAll("circle") + .data(self.data) + // .join("circle") + .join( + (enter) => + enter + .append("circle") + .classed("points", true) + .attr("r", (d) => Math.max(3, d.size * self.getScale())) + // .attr("r", (d) => s(d)) + // .attr("r", (d) => 50) + + // .attr("cy", (d) => projection(d.longlat)[1]) + // .attr("cx", (d) => projection(d.longlat)[0]); + // .attr("cy", (d) => reprojectLongLat(d.longlat)[1]) + // .attr("cx", (d) => reprojectLongLat(d.longlat)[0]); + + .attr("cy", (d) => self.getLoc(d)[1]) + .attr("cx", (d) => self.getLoc(d)[0]), + (update) => + update.call((update) => { + // let t = circle_group + // .transition() + // .duration(pointTransitionDuration()); + update + // .interrupt() + // .transition(t) + .attr("r", (d) => Math.max(3, d.size * self.getScale())) + // .attr("r", (d) => 50) + // .attr("r", (d) => s(d)) + .attr("cy", (d) => self.getLoc(d)[1]) + .attr("cx", (d) => self.getLoc(d)[0]); + }) + ) + + // .on("mouseenter", (e, d) => (_current_point = d)) + .on("mousedown", (e, d) => { + self._current_point = d; + // svg.classed("no-zoom", true); + // console.log(_current_point); + // e.preventDefault(); + }); + // .on("mouseup", () => (_current_point = undefined)) + + // .on("mouseleave", () => svg.classed("no-zoom", false)) + } + + reset() { + let self = this; + let scale = get(self, "store.state.initialScale"); + let center = get(self, "store.state.initialCenter"); + console.log("reset"); + let zoom_transform = get(self, "store.state.zoomTransform"); + + self.svg + .interrupt() + .transition() + .duration(2100) + .call( + // zoom.transform, + zoom_transform, + d3.zoomIdentity + .translate(self.width() / 2, self.height() / 2) + .scale(-scale) + .translate(...self.projection(center)) + .scale(-1) + ); + } + + zoom_to_group() { + console.log("z to g"); + let self = this; + const bb = self.circle_group.node().getBBox(); + const [[x0, y0], [x1, y1]] = [ + [bb.x, bb.y], + [bb.x + bb.width, bb.y + bb.height], + ]; + + const scale = Math.min( + 1 << 28, + self.transform.k * + (0.9 / Math.max((x1 - x0) / self.width(), (y1 - y0) / self.height())) + ); + + const new_center = [x0 + bb.width / 2, y0 + bb.height / 2]; + + let zoom_transform = get(self, "store.state.zoomTransform"); + + self.svg + .interrupt() + .transition() + .duration(750) + .call( + // zoom.transform, + zoom_transform, + d3.zoomIdentity + .translate(self.width() / 2, self.height() / 2) + .scale(-scale) + .translate(...self.transform.invert(new_center)) + .scale(-1) + ); + } + + keydown(event) { + let self = this; + // console.log(event.keyCode); + // ctrl + if (event.keyCode === 17) { + self.cir.call(self.pointDragHandler); + self.svg.classed("ctrl", true); + return; + } + + if (event.keyCode === 90) { + // z + self.reset(); + } + + if (event.keyCode === 71) { + // g + self.zoom_to_group(); + } + } + + keyup(event) { + let self = this; + // this._lastKeyDown = -1; + // d3.select(`#${this.id}`).style("pointer-events", "none"); + + // ctrl + if (event.keyCode === 17) { + self.cir.on(".drag", null); + self.svg.classed("ctrl", false); + // _current_point = undefined; + } + } + + mousemoved(event) { + let self = this; + const [mx, my] = pointerToLongLat( + self.projection, + self.transform, + d3.pointer(event) + ); + let found = self.find(mx, my); + + self.cir.classed( + "fill-current text-green-600 opacity-80", + (d) => found && d.id === found.id + ); + } + + _render() { + this.update_cir(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/util.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/util.js new file mode 100644 index 00000000..fdd04df8 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/util.js @@ -0,0 +1,12 @@ +export const pointerToLongLat = (projection, transform, point) => { + const longlat = projection.invert(transform.invert(point)); + + return longlat; +}; + +export const distance = (px, py, mx, my) => { + const a = px - mx; + const b = py - my; + + return Math.sqrt(a * a + b * b); +}; diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-design_storm.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-design_storm.js new file mode 100644 index 00000000..c88ce2db --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-design_storm.js @@ -0,0 +1,79 @@ +import d3 from "../../lib/d3.js"; +import * as util from "../../lib/util.js"; +import VectorLayer from "../base/vector-layer.js"; + +export default class DesignStormVectors extends VectorLayer { + constructor({ vector }) { + super({ vector }); + let self = this; + + self.store.events.subscribe("changedTransform", () => { + self.group + .selectAll("path") + .style("stroke-width", self.stroke_width / self.transform.k); + }); + + self.store.events.subscribe("isShowDesignStorm", async () => { + let geojson = util.get(self, "store.state.design_storm_geojson"); + if (!geojson) { + await self.load_data(); + return; + } + self._draw(geojson); + }); + self.store.events.subscribe( + "setDesignStormQuery", + ({ design_storm_geojson }) => self._draw(design_storm_geojson) + ); + } + + get hidden() { + return !util.get(this, "store.state.show_design_storm"); + } + + async load_data() { + let self = this; + let cfg = util.get(self.store, "state.config"); + let info = util.deepCopy(cfg?.project_spatial_data?.design_storm); + + await self._load_data(info); + + if (self.geojson) { + self.store.dispatch("setDesignStormQuery", { + design_storm_geojson: self.geojson, + }); + } + } + + _draw(geojson) { + if (!geojson) return; + let self = this; + self.group.selectAll("path").remove(); + if (self.hidden) return; + + self.colorScale = d3 + .scaleLinear() + .domain(self.domain) + .range(["white", "blue"]); + + self.group + .selectAll("path") + .data(geojson.features) + .enter() + .append("path") + .attr("d", self.renderer) + .attr("pointer-events", "all") + .attr("fill", (d) => { + return self.colorScale(d.properties[geojson._field]); + }) + .attr("stroke", d3.gray(0.2)) + .attr("stroke-linecap", "round") + .attr("stroke-linejoin", "round") + .style("stroke-width", self.stroke_width / self.transform.k); + } + + async _render() { + let self = this; + self.store.events.subscribe("updateConfig", self.load_data.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-ref_data_key.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-ref_data_key.js new file mode 100644 index 00000000..4c611fdf --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-ref_data_key.js @@ -0,0 +1,80 @@ +import d3 from "../../lib/d3.js"; +// import * as topojson from "topojson-client"; +// import * as api from "../../lib/nereid-api"; +import * as util from "../../lib/util.js"; +import VectorLayer from "../base/vector-layer.js"; + +export default class RefDataVectors extends VectorLayer { + constructor({ vector }) { + super({ vector }); + let self = this; + self.stroke_width = 1; + self.store.events.subscribe("changedTransform", () => { + self.group + .selectAll("path") + .style("stroke-width", self.stroke_width / self.transform.k); + }); + + self.store.events.subscribe("isShowRainZones", async () => { + let geojson = util.get(self, "store.state.ref_data_key_geojson"); + if (!geojson) { + await self.load_data(); + return; + } + self._draw(geojson); + }); + self.store.events.subscribe("setRefDataQuery", ({ ref_data_key_geojson }) => + self._draw(ref_data_key_geojson) + ); + } + + get hidden() { + return !util.get(this, "store.state.show_rain_zone"); + } + + async load_data() { + let self = this; + let cfg = util.get(self.store, "state.config"); + let info = util.deepCopy(cfg?.project_spatial_data?.ref_data_key); + + await self._load_data(info); + + if (self.geojson) { + self.store.dispatch("setRefDataQuery", { + ref_data_key_geojson: self.geojson, + }); + } + } + + _draw(geojson) { + if (!geojson) return; + let self = this; + self.group.selectAll("path").remove(); + if (self.hidden) return; + + self.colorScale = d3 + .scaleOrdinal() + .domain(self.domain) + .range(d3.schemeSet3); + + self.group + .selectAll("path") + .data(geojson.features) + .enter() + .append("path") + .attr("d", self.renderer) + .attr("pointer-events", "all") + .attr("fill", (d) => { + return self.colorScale(d.properties[geojson._field]); + }) + .attr("stroke", d3.gray(0.2)) + .attr("stroke-linecap", "round") + .attr("stroke-linejoin", "round") + .style("stroke-width", self.stroke_width / self.transform.k); + } + + async _render() { + let self = this; + self.store.events.subscribe("updateConfig", self.load_data.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states.js new file mode 100644 index 00000000..310cce19 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states.js @@ -0,0 +1,51 @@ +import d3 from "../../lib/d3.js"; +import * as topojson from "topojson-client"; +import store from "../../lib/state.js"; +import { get } from "../../lib/util.js"; + +import Component from "../base/component.js"; + +export default class StateVectors extends Component { + constructor(options) { + super({ store }); + let self = this; + self.stroke_width = 1; + self.store.events.subscribe("changedTransform", () => { + self.path.style("stroke-width", self.stroke_width / self.transform.k); + }); + self.store.events.subscribe("isShowStatesMode", () => { + self.path.classed("hidden", self.hidden); + }); + + self.renderer = d3.geoPath(get(self, "store.state.projection")); + self.url = "https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json"; + + self.vector = options.vector; + self.path = self.vector + .append("path") + .attr("pointer-events", "none") + .attr("fill", "none") + .attr("stroke", "green") + .attr("stroke-linecap", "round") + .attr("stroke-linejoin", "round") + .classed("hidden", self.hidden) + .style("stroke-width", self.stroke_width / self.transform.k); + } + + get hidden() { + return !get(this, "store.state.show_states"); + } + + get transform() { + return get(this, "store.state.transform"); + } + + async _render() { + let self = this; + let topology = await d3.json(self.url); + self.path.attr( + "d", + self.renderer(topojson.feature(topology, topology.objects.states)) + ); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states_clickable.js b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states_clickable.js new file mode 100644 index 00000000..644fe8b8 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/graph-interface/vectors-states_clickable.js @@ -0,0 +1,67 @@ +import d3 from "../../lib/d3.js"; +import * as topojson from "topojson-client"; +import store from "../../lib/state.js"; +import * as util from "../../lib/util.js"; + +import Component from "../base/component.js"; + +export default class StateVectors extends Component { + constructor(options) { + super({ store }); + let self = this; + self.stroke_width = 1; + self.store.events.subscribe("changedTransform", () => { + self.path.style("stroke-width", self.stroke_width / self.transform.k); + }); + self.store.events.subscribe("isShowStatesMode", () => { + self.path.classed("hidden", self.hidden); + }); + self.projection = util.get(self, "store.state.projection"); + self.renderer = d3.geoPath(self.projection).digits(15); + self.url = "https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json"; + + self.vector = options.vector; + self.path = self.vector + .append("path") + .attr("pointer-events", "all") + .attr("fill", "none") + .attr("stroke", "green") + .attr("stroke-linecap", "round") + .attr("stroke-linejoin", "round") + .classed("hidden", self.hidden) + .style("stroke-width", self.stroke_width / self.transform.k); + } + + get hidden() { + return !util.get(this, "store.state.show_states"); + } + + get transform() { + return util.get(this, "store.state.transform"); + } + + async _render() { + let self = this; + let topology = await d3.json(self.url); + let geojson = topojson.feature(topology, topology.objects.states); + self.geojson = geojson; + self.store.dispatch("setStateQuery", { state_query: geojson }); + self.path.attr("d", self.renderer(geojson)); + + // d3.select("#map svg").on("click.states", (e, d) => { + // let [x, y] = d3.pointer(e, d3.select("#map svg").node()); + // let coords = self.projection.invert([x, y]); + // let obj = self.geojson.features.find((d) => d3.geoContains(d, coords)); + + // console.log(x, y, coords, obj, obj?.properties?.name); + // }); + + // self.vector.on("click.states", (e, d) => { + // let [x, y] = d3.pointer(e, self.vector.node()); + // let coords = self.projection.invert([x, y]); + // let obj = self.geojson.features.find((d) => d3.geoContains(d, coords)); + + // console.log(x, y, coords, obj, obj?.properties?.name); + // }); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/index.js b/nereid/nereid/static/frontend/src/js/components/index.js new file mode 100644 index 00000000..ce885169 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/index.js @@ -0,0 +1,43 @@ +import "./session"; +import { spinner } from "./loading_spinner"; +import { modal } from "./modal"; +import { tabs } from "./tabs"; +import { editor } from "./graph-interface"; +import * as util from "../lib/util"; +import * as nereidUtil from "../lib/nereid-api"; + +async function init() { + await util.getConfigFromUrlQueryParams(); + spinner.render(); + tabs.render(); + modal.render(); + + // to window + window.nereid = { + tabs, + editor, + util, + nereidUtil, + state: editor.store.state, + }; + editor.store.dispatch("updateConfig", {}); +} + +init(); +// util.getConfigFromUrlQueryParams().then(() => { +// spinner.render(); +// tabs.render(); +// modal.render(); + +// // to window +// import("./graph-interface").then(({ editor }) => { +// window.nereid = { +// tabs, +// editor, +// util, +// nereidUtil, +// state: editor.store.state, +// }; +// editor.store.dispatch("updateConfig", {}); +// }); +// }); diff --git a/nereid/nereid/static/frontend/src/js/components/loading_spinner.js b/nereid/nereid/static/frontend/src/js/components/loading_spinner.js new file mode 100644 index 00000000..f0223a17 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/loading_spinner.js @@ -0,0 +1,93 @@ +import Component from "./base/component.js"; +import store from "../lib/state.js"; + +class LoadingSpinner extends Component { + constructor(options) { + super({ store, id: options.id }); + } + enter() { + let self = this; + self.element.classed("pointer-events-none", false); + + let current; + current = self.element.select(".background-overlay").node(); + current.classList.remove("opacity-0"); + current.classList.add("duration-300", "opacity-40"); + + current = self.element.select(".modal-main").node(); + current.classList.remove("opacity-0", "translate-y-4"); + current.classList.add("opacity-100", "translate-y-0"); + } + exit() { + let self = this; + let ele = self.element; + self.element.classed("pointer-events-none", true); + + let current; + + current = ele.select(".background-overlay").node(); + current.classList.remove("opacity-40", "duration-300"); + current.classList.add("opacity-0"); + + current = ele.select(".modal-main").node(); + current.classList.remove("opacity-100", "translate-y-0"); + current.classList.add("opacity-0", "translate-y-4"); + } + _base_template() { + return ` + + `; + } + _render() { + let self = this; + self.element = d3.select("body").append("div").attr("id", self.id); + self.element.html(self._base_template()); + + self.store.events.subscribe("Waiting", ({ waiting }) => { + if (waiting > 0) self.enter(); + }); + self.store.events.subscribe("Waiting", ({ waiting }) => { + if (waiting === 0) self.exit(); + }); + + d3.select("body"); + } +} + +export const spinner = new LoadingSpinner({ id: "spinner-popup" }); diff --git a/nereid/nereid/static/frontend/src/js/components/modal.js b/nereid/nereid/static/frontend/src/js/components/modal.js new file mode 100644 index 00000000..6fe461ec --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/modal.js @@ -0,0 +1,168 @@ +import Component from "./base/component.js"; +import store from "../lib/state.js"; + +export class Modal extends Component { + constructor(options) { + super({ store, id: options.id }); + } + enter(modal_content) { + let self = this; + + self.element.classed("pointer-events-none", false); + let ele = self.element.select(`#modal-content`); + ele.html(self._content_template(modal_content)); + ele.selectAll(`button`).on("click", this.exit.bind(self)); + + let current; + current = self.element.select(".background-overlay").node(); + current.classList.remove("opacity-0"); + current.classList.add("duration-300", "opacity-40"); + + current = self.element.select(".modal-main").node(); + current.classList.remove("opacity-0", "translate-y-4"); + current.classList.add("opacity-100", "translate-y-0"); + } + exit() { + let self = this; + let ele = self.element; + self.element.classed("pointer-events-none", true); + + let current; + current = ele.select(".background-overlay").node(); + current.classList.remove("opacity-40", "duration-300"); + current.classList.add("opacity-0"); + + current = ele.select(".modal-main").node(); + current.classList.remove("opacity-100", "translate-y-0"); + current.classList.add("opacity-0", "translate-y-4"); + } + + _content_template(opts) { + if (!opts) { + opts = {}; + } + let fmt = { + icon: ` + + + `, + }; + switch (opts.alert_type) { + case "error": + fmt.bgcolor = "bg-red-300"; + fmt.button_style = "bg-red-600 hover:bg-red-700 focus:ring-red-500"; + fmt.icon_color = "text-red-600"; + fmt.icon_bgcolor = "bg-red-100"; + + break; + case "success": + fmt.bgcolor = "bg-green-300"; + fmt.button_style = + "bg-green-600 hover:bg-green-700 focus:ring-green-500"; + fmt.icon_color = "text-green-600"; + fmt.icon_bgcolor = "bg-green-100"; + fmt.icon = ` + + + + + `; + + break; + default: + fmt.bgcolor = "bg-yellow-300"; + fmt.button_style = + "bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"; + fmt.icon_color = "text-yellow-600"; + fmt.icon_bgcolor = "bg-yellow-100"; + } + + return ` +
+
+ +
+
+
+ ${fmt.icon} +
+
+
+ +
+

+ ${opts?.msg || ""} +

+
+
+
+
+
+ +
+ `; + } + + _base_template() { + return ` + + `; + } + _render() { + let self = this; + + self.element = d3 + .select("body") + .append("div") + .attr("id", self.id) + .classed("pointer-events-none", true); + self.element.html(self._base_template()); + self.store.events.subscribe("raiseModal", ({ modal_content }) => + self.enter(modal_content) + ); + self.exit(); + } +} + +export const modal = new Modal({ id: "modal-popup" }); diff --git a/nereid/nereid/static/frontend/src/js/components/session.js b/nereid/nereid/static/frontend/src/js/components/session.js new file mode 100644 index 00000000..5c148f7a --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/session.js @@ -0,0 +1,49 @@ +import * as util from "../lib/util"; +import store from "../lib/state"; +import { Graph } from "./graph-interface/graph"; + +const saveSession = () => { + let { graph, scenario_name } = util.get(store, "state"); + + sessionStorage.setItem( + "autosave_graph", + JSON.stringify({ graph, scenario_name }) + ); +}; + +export const restoreSession = () => { + let autosave_data = sessionStorage.getItem("autosave_graph"); + let default_graph = util.deepCopy(util.get(store, "state.default_graph")); + if (autosave_data) { + // Restore the contents of the graph + const { graph, scenario_name } = JSON.parse(autosave_data); + + sessionStorage.removeItem("autosave_graph"); + + if (graph?.nodes?.length > 0) { + let _ = new Graph( + graph.nodes, + graph.edges.map((e) => { + return { source: e.source.id, target: e.target.id }; + }) + ); + } else { + let _ = new Graph(default_graph.nodes, default_graph.edges); + } + + if (scenario_name) { + store.dispatch("restoreScenarioName", { scenario_name }); + } + } else { + let _ = new Graph(default_graph.nodes, default_graph.edges); + } +}; + +window.addEventListener("beforeunload", saveSession); +window.addEventListener("load", (e) => { + const urlParams = new URLSearchParams(window.location.search); + const tab = urlParams.get("tab"); + if (tab) { + store.dispatch("changedTab", { current_tab: tab }); + } +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/connection-tab.js b/nereid/nereid/static/frontend/src/js/components/tabs/connection-tab.js new file mode 100644 index 00000000..500795d2 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/connection-tab.js @@ -0,0 +1,79 @@ +import Component from "../base/component.js"; +import { getConfig } from "../../lib/nereid-api.js"; +import store from "../../lib/state.js"; +import * as util from "../../lib/util.js"; +import d3 from "../../lib/d3.js"; + +// export class ConnTab extends Component { +// constructor(options) { +// super({ store, id: options.id }); +// } +// async _update(value) { +// let self = this; +// const cfg = await getConfig(value); +// self.store.dispatch("updateConfig", cfg); +// } +// _template() { +// return ` +//
+//
+//
+// +// + +// +// +// +// +//
+//
+// +//
+//
+//
+// `; +// } +// _render() { +// let self = this; +// let element = d3.select(`#${self.id}`).append("div").html(self._template()); +// let form = element +// .select("form") +// .attr("method", "get") +// .on("submit", function (event) { +// event.preventDefault(); +// const data = new FormData(event.target); +// const value = util.cleanObject(Object.fromEntries(data.entries())); +// // self.store.dispatch("updateConfig", value); +// self._update(value); + +// // console.log("form submit", value); +// return false; +// }); + +// let button = form.select("button"); +// button.node().click(); +// } +// } diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-menu.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-menu.js new file mode 100644 index 00000000..d7f1565e --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-menu.js @@ -0,0 +1,37 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state.js"; + +export default class EditorMenu extends Component { + constructor(options) { + super({ store, id: options.id, children: options.children }); + } + + _template() { + return ` +
+
+ +
+
+ `; + } + + _render() { + this.element = d3.select(`#${this.id}`); + this.element.html(this._template()); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-option.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-option.js new file mode 100644 index 00000000..8a4adf7e --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/editor-option.js @@ -0,0 +1,49 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state.js"; + +export default class EditorMenuOption extends Component { + constructor(options) { + super({ store }); + let self = this; + self.id = options.id; + self.title = options.title; + self.icon = options.icon; + self.callback = options.callback; + } + + _template() { + return ` + `; + } + + _render() { + let self = this; + let parent_container = d3 + .select(`#${this.parent_id}-button-container`) + .append("div") + .classed("flex", true); + // this.button = parent_container.append("div"); + // this.button.html(this._template()); + let html = parent_container.html(); + html += this._template(); + parent_container.html(html); + + this.button = parent_container.select(`button#${this.id}-button`); + + this.button.on(`click`, self.callback.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/index.js new file mode 100644 index 00000000..0eb7a647 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/index.js @@ -0,0 +1,23 @@ +import { + findNodeOption, + nodeConfigOption, + loadTableOption, + saveFilesOption, + clearScenarioOption, + checkScenarioOption, + runScenarioOption, +} from "./options"; +import EditorMenu from "./editor-menu"; + +export const editor_menu = new EditorMenu({ + id: "editor-menu", + children: [ + findNodeOption, + nodeConfigOption, + loadTableOption, + saveFilesOption, + clearScenarioOption, + checkScenarioOption, + runScenarioOption, + ], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/options.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/options.js new file mode 100644 index 00000000..c253f55a --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawer-controller/options.js @@ -0,0 +1,183 @@ +import * as api from "../../../../../lib/nereid-api"; +import * as util from "../../../../../lib/util"; +import EditorMenuOption from "./editor-option"; +import { Graph } from "../../../../graph-interface/graph.js"; + +export const nodeConfigOption = new EditorMenuOption({ + id: "node_editor", + title: "Configuration", + icon: ` + + + + `, + callback: function () { + this.store.dispatch("changedPanel", { active_panel: "node-editor-panel" }); + }, +}); + +export const loadTableOption = new EditorMenuOption({ + id: "load_table", + title: "Load from File", + icon: ` + + + + `, + callback: function () { + this.store.dispatch("changedPanel", { active_panel: "load-table-panel" }); + }, +}); + +export const saveFilesOption = new EditorMenuOption({ + id: "save_files", + title: "Save Files", + icon: ` + + + + +`, + callback: function () { + this.store.dispatch("changedPanel", { + active_panel: "save-files-panel", + }); + }, +}); + +export const clearScenarioOption = new EditorMenuOption({ + id: "clear_scenario", + title: "Clear Scenario", + icon: ` +
+ + + + + +
+`, + callback: function () { + if (confirm("Are you sure you want to clear all data?")) { + let _ = new Graph([], []); + } + }, +}); + +export const checkScenarioOption = new EditorMenuOption({ + id: "check_scenario", + title: "Verify Inputs", + icon: ` +
+ + + + + +
+`, + callback: async function () { + Promise.all([api.validateTreatmentFacilities(), api.validateNetwork()]) + .then((results) => { + let len_all = results.length; + const errors = results.filter( + (e) => e.alert_type.toLowerCase() == "error" + ); + if (errors.length > 0) { + let opt = errors[0]; + opt.msg = `
${errors.map((e) => e.msg).join("
")}
`; + + this.store.dispatch("raiseModal", { modal_content: opt }); + return; + } + + const successes = results.filter( + (e) => e.alert_type.toLowerCase() == "success" + ); + if (successes.length === results.length) { + let opt = { + title: "Validation Successful", + msg: "", + alert_type: "success", + }; + + this.store.dispatch("raiseModal", { modal_content: opt }); + return; + } + }) + .catch((e) => { + let opt = { + title: "Validation Failed", + msg: `
${JSON.stringify(e, undefined, 2)}
`, + alert_type: "error", + }; + + this.store.dispatch("raiseModal", { modal_content: opt }); + }); + }, +}); + +export const runScenarioOption = new EditorMenuOption({ + id: "run_scenario", + title: "Run Scenario", + icon: ` +
+ + + + + + +
+`, + callback: async function () { + let rsp = await api.solveWatershed(); + if (rsp?.status?.toLowerCase() === "success") { + let results = util.get(rsp, "data.results") || []; + let leaf_results = util.get(rsp, "data.leaf_results") || []; + this.store.dispatch("newResults", { + results: results.concat(leaf_results), + }); + } + + // console.log(rsp); + }, +}); + +export const findNodeOption = new EditorMenuOption({ + id: "find_node", + title: "Find", + icon: ` + + + + +`, + callback: function () { + this.store.dispatch("changedPanel", { + active_panel: "find-node-panel", + }); + }, +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-load-files.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-load-files.js new file mode 100644 index 00000000..d33d5b95 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-load-files.js @@ -0,0 +1,204 @@ +import LoadFileUIBase from "../../../../base/load-blob.js"; +import * as util from "../../../../../lib/util.js"; +import { applyEdges, updateEdges } from "../../../../graph-interface/graph.js"; + +export const loadGraphFileUI = new LoadFileUIBase({ + id: "graph-file-loader", + title: "Load Graph (.csv)", + primary_callback: applyEdges, + secondary_callback: updateEdges, + data_callback: function stageEdges(edges) { + let node_ids = [ + ...new Set(edges.map((a) => a.source).concat(edges.map((a) => a.target))), + ]; + let old_nodes = util.deepCopy( + this.store.state.graph.nodes.filter((d) => node_ids.includes(d.id)) || [ + {}, + ] + ); + + // console.log("existing graph", util.get(this, "store.state.graph")); + + let existing_ids = old_nodes.map((d) => d.id); + + let nodes = []; + let xloc = 50; //this.graph_editor.width / 2; + let yloc = 50; //this.graph_editor.height / 2; + let n; + + for (let node_id of node_ids) { + if (existing_ids.includes(node_id)) { + n = old_nodes.find((d) => d.id === node_id); + } else { + let edge = edges.find((d) => d.source === node_id); + + n = { + id: node_id, + x: +edge?.x || xloc + 10 * Math.random(), + y: +edge?.y || yloc + 10 * Math.random(), + }; + if (edge?.x || edge?.y) { + n.fx = +edge?.x; + n.fy = +edge?.y; + } + } + nodes.push(n); + } + this.store.dispatch("setStagedChanges", { + staged_changes: { edges, nodes }, + }); + }, +}); + +export const loadLandSurfaceFileUI = new LoadFileUIBase({ + id: "land-surface-file-loader", + title: "Load Land Surfaces (.csv)", + primary_callback: applyEdges, + data_callback: function stageLandSurfaces(landsurfaces) { + let node_ids = [...new Set(landsurfaces.map((a) => a.node_id))]; + + let nodes = util.deepCopy(util.get(this, "store.state.graph.nodes"), [{}]); + let edges = util + .deepCopy(util.get(this, "store.state.graph.edges")) + .map((d) => { + return { source: d.source.id, target: d.target.id }; + }); + + let existing_ids = nodes.map((d) => d.id); + + let new_nodes = []; + + let gen_random = () => 400 * Math.random(); // points generated in 400x400 box in upper left of editor + + for (let node_id of node_ids) { + let data = landsurfaces.filter((d) => d.node_id === node_id); + let n; + let long = util.mean(data.filter((d) => d?.long)?.map((d) => +d.long)); + let lat = util.mean(data.filter((d) => d?.lat)?.map((d) => +d.lat)); + + let new_data = data.map( + ({ node_id, surface_key, area_acres, imp_area_acres }) => ({ + node_id, + surface_key, + area_acres, + imp_area_acres, + }) + ); + + if (existing_ids.includes(node_id)) { + // update existing graph node data + n = nodes.find((d) => d.id === node_id); + n.node_type = "land_surface"; + n.data = new_data; + + if (long && lat) { + n.longlat = [+long, +lat]; + } + } else { + // insert any missing nodes into the graph + n = { + id: node_id, + node_type: "land_surface", + x: gen_random(), + y: gen_random(), + data: new_data, + }; + + if (long && lat) { + n.longlat = [+long, +lat]; + } + + new_nodes.push(n); + } + } + nodes = nodes.concat(new_nodes); + + this.store.dispatch("setStagedChanges", { + staged_changes: { edges, nodes }, + }); + }, +}); + +export const loadTreatmentFacilitiesFileUI = new LoadFileUIBase({ + id: "treatment-facilities-file-loader", + title: "Load Treatment Facilities (.csv)", + primary_callback: applyEdges, + data_callback: function stageTmntFacilities(tmntfacilities) { + let node_ids = [...new Set(tmntfacilities.map((a) => a.node_id))]; + + let nodes = util.deepCopy( + util.get(this, "store.state.graph.nodes") || [{}] + ); + let edges = util + .deepCopy(util.get(this, "store.state.graph.edges") || [{}]) + .map((d) => { + return { source: d.source.id, target: d.target.id }; + }); + let existing_ids = nodes.map((d) => d.id); + + let new_nodes = []; + + let gen_random = () => 400 * Math.random(); // points generated in 400x400 box in upper left of editor + + for (let node_id of node_ids) { + // find returns the first matching element, filter returns a list of all matching elements + let data = tmntfacilities.find((d) => d.node_id === node_id); + let n; + + let { long, lat } = data; + + if (existing_ids.includes(node_id)) { + // update existing graph node data + n = nodes.find((d) => d.id === node_id); + n.data = data; + n.node_type = "treatment_facility"; + if (long && lat) { + n.longlat = [+long, +lat]; + } + } else { + // insert any missing nodes into the graph + n = { + id: node_id, + node_type: "treatment_facility", + x: gen_random(), + y: gen_random(), + data: data, + }; + if (long && lat) { + n.longlat = [+long, +lat]; + } + new_nodes.push(n); + } + } + nodes = nodes.concat(new_nodes); + + this.store.dispatch("setStagedChanges", { + staged_changes: { edges, nodes }, + }); + }, +}); + +export const loadScenarioFileUI = new LoadFileUIBase({ + id: "scenario-file-loader", + title: "Load Scenario (.json)", + primary_callback: applyEdges, + secondary_callback: updateEdges, + data_callback: function stageScenario(scenario) { + let graph = scenario.graph; + let scenario_name = scenario.name; + let nodes = util.deepCopy(graph.nodes || [{}]); + + for (let node of nodes) { + if (node.id == null) { + console.error("bad egg:", node); + } + } + let edges = graph.edges.map((d) => { + return { source: d.source.id, target: d.target.id }; + }); + + this.store.dispatch("setStagedChanges", { + staged_changes: { edges, nodes, scenario_name }, + }); + }, +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-inputs.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-inputs.js new file mode 100644 index 00000000..e982069f --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-inputs.js @@ -0,0 +1,131 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state.js"; +import * as util from "../../../../../lib/util.js"; + +export class SelectedNodeUI extends Component { + constructor(options) { + super({ store }); + let self = this; + } + + get selected_node_id() { + return util.get(this, "store.state.selected_node_id"); + } + + update() { + let text = this.selected_node_id + ? `Node: ${this.selected_node_id.toString()}` + : `
🡄 Select a Node in the Editor Map
`; + + this.element.html(text); + } + + _render() { + let self = this; + + // console.log("rendering selected node", self.parent_id); + self.element = d3 + .select(`#${self.parent_id}-content`) + .append("div") + .classed("text-lg font-bold pb-2", true); + self.update(); + self.store.events.subscribe("changedSelectedNode", () => self.update()); + } +} + +export class NodeInputUI extends Component { + constructor(options) { + super({ store }); + // console.log("init node input"); + let self = this; + self.store.events.subscribe("changedSelectedNode", () => self.update()); + // self.callback = options.callback; + } + + get nodes() { + return util.get(this, "store.state.graph.nodes"); + } + + get selected_node_id() { + return util.get(this, "store.state.selected_node_id"); + } + + toggleNodeType() { + let node_type = this.element.select("input:checked").property("value"); + + this.store.dispatch("nodeEditorType", { + node_editor_type: node_type || "none", + }); + } + + _template() { + return ` +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
`; + } + + update() { + let self = this; + + self.element.classed("hidden", self.selected_node_id == null); + + let selected_node = this.nodes.find((n) => n.id === this.selected_node_id); + + self.element + .select(`input[value=${selected_node?.node_type || "none"}]`) + .property("checked", true) + .dispatch("change"); + + self.toggleNodeType(); + } + + _render() { + let self = this; + + // console.log("rendering node input", self.parent_id); + self.element = d3 + .select(`#${self.parent_id}-content`) + .append("div") + .classed("hidden", true); + self.element.html(self._template()); + + self.element + .selectAll("input") + .on("change", this.toggleNodeType.bind(this)); + + self.update(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-land-surface.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-land-surface.js new file mode 100644 index 00000000..e0c3ef08 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-land-surface.js @@ -0,0 +1,239 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state.js"; +import * as util from "../../../../../lib/util.js"; +import { editableTable } from "../../../../../lib/editable-table.js"; + +export class LandSurfaceNodeEditorUI extends Component { + constructor(options) { + super({ store }); + let self = this; + } + + get node_editor_type() { + return util.get(this, "store.state.node_editor_type"); + } + + get selected_node() { + let id = util.get(this, "store.state.selected_node_id"); + let n = util.get(this, "store.state.graph.nodes").find((n) => n.id === id); + return n; + } + + landSurfaceTableOptions() { + let self = this; + + let data = [{}]; + if (self.selected_node?.data) { + data = util.deepCopy(self.selected_node.data); + } else { + data = [{ node_id: self.selected_node?.id }]; + } + + return { + data: data, + maxHeight: "500px", + rowContextMenu: [ + { + label: " Select Row", + action: function (e, row) { + row.select(); + }, + }, + { + label: " Add Row", + action: function (e, row) { + self.table.addRow({ node_id: self.selected_node?.id }); + }, + }, + { + label: " Delete Row", + action: function (e, row) { + row.delete(); + }, + }, + ], + initialSort: [ + //set the initial sort order of the data + { column: "surface_key", dir: "asc" }, + ], + columns: [ + { + title: "Node Id", + field: "node_id", + editor: "input", + editable: (c) => c.getRow().getPosition() < 1, // only first row is editable + }, + { title: "Surface Key", field: "surface_key", editor: "input" }, + { + title: "Area (acres)", + field: "area_acres", + hozAlign: "center", + editor: true, + width: 90, + }, + { + title: "Impervious Area (acres)", + field: "imp_area_acres", + hozAlign: "center", + editor: true, + width: 90, + }, + ], + }; + } + + setCurrentNodeDataToTableData() { + if (!this.selected_node) { + alert("no node selected"); + return false; + } + + let data = util.deepCopy(this.table.getData()); + let node = this.selected_node; + // console.log(node, data); + // let unique_node_ids = [...new Set(data.map((d) => d.node_id))]; + // if (unique_node_ids.length > 1) { + // alert("when renaming nodes, all node ids must be equal"); + // return false; + // } + let node_id = data[0]?.node_id; + + data.forEach((d) => (d.node_id = node_id)); + + node.node_type = this.node_editor_type; + // console.log(node, data); + + if (node.id !== node_id) { + node.id = node_id; + store.dispatch("changedSelectedNode", { selected_node_id: node_id }); + } + + // console.log(node, data); + + node["data"] = data; + + this.store.dispatch("newGraph"); + this.update(); + } + + async buildLandSurfaceTable({ id }) { + let self = this; + + // const id = "table-facility-capture"; + self.element.select(`#${id}`).remove(); + let ele = self.element + .append("div") + .attr("id", id) + .classed("grid grid-cols-1 grid-rows-auto pt-8", true); + + const table_id = id + "-landsurface-tabulator"; + + let undo_redo_buttons_container = ele + .append("div") + .classed("flex flex-row p-2 gap-2", true); + let undo_button = undo_redo_buttons_container + .append("button") + .classed("btn btn-gray flex flex-row", true).html(` + + + + + + undo + `); + let redo_button = undo_redo_buttons_container + .append("button") + .classed("btn btn-gray flex flex-row", true).html(` + redo + + + + + + + `); + + ele.append("div").attr("id", table_id); + let opt = self.landSurfaceTableOptions(); + self.table = await editableTable(`#${table_id}`, opt); + + undo_button.on("click", () => self.table.undo()); + redo_button.on("click", () => self.table.redo()); + + ele + .append("div") + .classed("flex flex-row justify-end py-4", true) + .append("button") + .classed("btn btn-blue", true) + .on("click", () => { + // console.log("ls form clicked apply"); + this.setCurrentNodeDataToTableData.bind(this)(); + }) + .text("Apply"); + } + + async update() { + let self = this; + + // self.element.select(`#${id}`).remove(); + // let ele = self.element + // .append("div") + // .attr("id", id) + // .classed("grid grid-cols-1 grid-rows-auto pt-8", true); + + if (!(self.node_editor_type === "land_surface")) { + self.element.classed("hidden", true); + return; + } + + self.element.classed("hidden", false); + + // let options = self.landSurfaceTableOptions(); + + let id = `${self.parent_id}-content-editor`; + + await self.buildLandSurfaceTable({ id }); + + // self.element + // .html("") + // .append("div") + + // .attr("id", `${self.parent_id}-content-tabulator`); + + // if (self.element.classed("hidden")) return; + + // self.element + // .append("div") + // .classed("flex flex-row justify-end py-4", true) + // .append("button") + // .classed("btn btn-blue", true) + // .on("click", () => { + // // console.log("ls form clicked apply"); + // this.setCurrentNodeDataToTableData.bind(this)(); + // }) + // .text("Apply"); + + // self.table = await editableTable( + // `#${self.parent_id}-content-tabulator`, + // options + // ); + } + + _render() { + let self = this; + + // console.log("rendering selected node", self.parent_id); + self.element = d3 + .select(`#${self.parent_id}-content`) + .append("div") + .classed("mt-4", true) + .classed("hidden", true); + + self.update(); + self.store.events.subscribe("nodeEditorType", () => self.update()); + self.store.events.subscribe("changedSelectedNode", () => self.update()); + self.store.events.subscribe("changedPanel", () => self.update()); + self.store.events.subscribe("newGraph", () => self.update()); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-treatment-facility.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-treatment-facility.js new file mode 100644 index 00000000..64aba1e7 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-node-treatment-facility.js @@ -0,0 +1,318 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state.js"; +import * as util from "../../../../../lib/util.js"; + +export class TreatmentFacilityNodeEditorUI extends Component { + constructor(options) { + super({ store }); + let self = this; + } + + get node_editor_type() { + return util.get(this, "store.state.node_editor_type"); + } + + get selected_node() { + let id = util.get(this, "store.state.selected_node_id"); + let n = util.get(this, "store.state.graph.nodes").find((n) => n.id === id); + return n; + } + + get config() { + let { + schema, + facility_types, + facility_type_map, + facility_alias_map, + facility_label_map, + } = util.get(this, "store.state"); + return { + schema, + facility_types, + facility_type_map, + facility_alias_map, + facility_label_map, + }; + } + + update() { + let self = this; + self.element.html("").classed("flex flex-col w-full", true); + self.element.classed( + "hidden", + !(self.node_editor_type === "treatment_facility") + ); + + let select = self.element + .append("select") + .classed("px-2 my-4 h-8 border rounded-md", true) + .attr("id", "facility-picker") + .on("change", function () { + let facility_type = self.element + .select("#facility-picker") + .property("value"); + if (!facility_type.length) { + return false; + } + // let facility_key = self.config.facility_alias_map[facility_type]; + + let facility_schema = self.config.facility_type_map[facility_type]; + + // console.log("facility type", facility_type); + // console.log("facility schema", facility_schema); + + let existing_data = util.deepCopy( + util.get(self, "selected_node.data") || {} + ); + + if (Array.isArray(existing_data)) { + existing_data = {}; + } + + let form_data = { + node_id: self.selected_node.id, + facility_type: facility_type, + + ref_data_key: + self.selected_node?.data?.ref_data_key || + self.selected_node?.ref_data_key, + + design_storm_depth_inches: + self.selected_node?.data?.design_storm_depth_inches || + self.selected_node?.design_storm_depth_inches, + }; + + form_data = Object.assign(existing_data, form_data); + + // console.log("data to form:", form_data); + + const onSubmit = (result) => { + // console.log("tmnt form result", result); + self.selected_node.node_type = self.node_editor_type; + self.selected_node.data = Object.assign( + { + facility_type: self.element + .select("#facility-picker") + .property("value"), + }, + util.deepCopy(result) + ); + self.selected_node.id = result.node_id; + + // TODO: if user sets ref_data_key in the form, it's overwritten upon submit. + self.store.dispatch("newGraph"); + // self.graph_editor.restart(); + // d3.select("#current_node_id").text(result.node_id); + }; + + let state = util.get(self, `store.state.nereid_state`); + let region = util.get(self, `store.state.nereid_region`); + + let treatment_facility_fields = + util.get( + self, + `store.state.treatment_facility_fields.${state}.${region}` + ) || + util.get(self, "store.state.treatment_facility_fields.state.region"); + + console.log("tmnt facility fields:", treatment_facility_fields); + + build_form( + "#facility-form", + self.config.schema[facility_schema], + form_data, + treatment_facility_fields.disabled, + treatment_facility_fields.ignored, + onSubmit.bind(self) + ); + }); + + let form_container = self.element.append("div").attr("id", "facility-form"); + + let data = util.deepCopy(self.config.facility_types || []); + data.unshift(""); + + let options = select + // .classed("selectpicker", true) + .selectAll("option") + .data(data) + .enter() + .append("option") + .attr("value", (d) => (d ? self.config.facility_label_map[d] : d)) + .text((d) => d); + + let facility_type = util.get(self, "selected_node.data.facility_type"); + if (facility_type) { + self.element.select("#facility-picker").property("value", facility_type); + select.on("change")(); + } + // $("#facility-picker").selectpicker("render"); + } + _render() { + let self = this; + self.element = d3.select(`#${self.parent_id}-content`).append("div"); + self.id = `${self.parent_id}-content-treatment-form`; + self.element.attr("id", self.id); + + self.update(); + // self.store.events.subscribe("nodeEditorType", () => self.update()); + // self.store.events.subscribe("changedSelectedNode", () => self.update()); + // self.store.events.subscribe("updateConfig", () => self.update()); + self.store.events.subscribe("stateChange", () => this.update()); + } +} + +function build_form(divid, schema, existing_data, disabled, ignored, onSubmit) { + let keys = [...schema.required]; + let optional_keys = Object.keys(schema.properties).filter( + (k) => !keys.includes(k) + ); + keys.push(...optional_keys); + let data = []; + for (const k of keys.filter((k) => !ignored.includes(k))) { + let prop = schema.properties[k]; + prop.name = k; + data.push(prop); + } + + let div = d3.select(divid); + div.html(""); + let form = div.append("form"); + + form + .attr("id", divid.replace("#", "") + "-form") + .attr("name", divid.replace("#", "") + "-form") + .attr("method", "get") + .on("submit", function (event) { + event.preventDefault(); + form.selectAll("input").property("disabled", false); + const data = new FormData(event.target); + const value = util.cleanObject(Object.fromEntries(data.entries())); + if (onSubmit) onSubmit(value); + // console.log(value, data.entries()); + return false; + }); + + form + .selectAll("div") + .data(data) + .enter() + .append("div") + .classed( + "form-group flex flex-row w-full gap-4 text-sm my-4 h-8 items-center", + true + ) + .classed("required", (d) => schema.required.includes(d.name)) + .each(function (d, i) { + let is_required = schema.required.includes(d.name); + let html_title = + (d.description || d.name) + + (is_required ? " (required)" : " (optional)"); + + let self = d3.select(this); + let label = self + .append("label") + .classed("control-label py-2 flex w-1/2 ", true) + .attr("title", html_title) + .text(d.title); + let input; + + switch (d.type) { + case "string": + input = self + .append("input") + .attr("name", d.name) + .attr("id", d.name) + .attr("title", html_title) + .property("required", schema.required.includes(d.name || "")) + .property("disabled", disabled.includes(d.name)) + .classed("border-2 rounded-md px-2 py-1", true); + + input + .attr("type", "text") + // ["pattern", "placeholder", "default"].forEach(function (key) { + // if (key in d) input.attr(key, d[key]); + // }); + .attr("pattern", d.pattern || ".*") + // .attr("defaultValue", d.default || "") // apparently d3 cannot set a mixed case attribute. + .attr("value", d.example || d.default || ""); + break; + case "number": + input = self + .append("input") + .attr("name", d.name) + .attr("id", d.name) + .attr("title", html_title) + .property("required", schema.required.includes(d.name || "")) + .property("disabled", disabled.includes(d.name)) + .classed("border-2 rounded-md px-2 py-1", true); + + input + .attr("type", "number") + .attr("step", "0.001") + .attr("value", d.example || d.default || ""); + // ["pattern", "placeholder", "default"].forEach(function (key) { + // if (key in d) input.attr(key, d[key]); + // }); + // .attr("placeholder", d.example || ""); + break; + case "boolean": + input = self.append("div").classed("flex flex-row", true); + for (let b of [true, false]) { + let bid = d.name + b.toString(); + let fg = input + .append("div") + .classed("flex flex-row items-center", true); + + fg.append("input") + .classed("form-check-input p-2", true) + .classed("p-2", true) + .attr("type", "radio") + .attr("name", d.name) + .attr("id", bid) + .attr("title", html_title) + .property("checked", d.default == b) + .property("disabled", disabled.includes(d.name)) + .attr("value", b); + + fg.append("label") + .classed("p-2", true) + .attr("for", bid) + .attr("title", html_title) + .text(b.toString()); + } + + // todo: add a true check and a false check otherwise false values are dropped. + // self.classed("form-check-inline", true); + // input + // .attr("class", "form-check-input") + // .attr("type", "checkbox") + // .property("checked", d.default !== undefined ? d.default : false) + // .attr("value", (d) => + // (d.default !== undefined ? d.default : false) ? false : true + // ); + break; + } + }); + + for (let [k, v] of Object.entries(existing_data)) { + if (["true", "false"].includes(v)) { + // then it's a boolean + for (let b of ["true", "false"]) { + d3.select("#" + k + b).property("checked", v == b); + } + } else { + d3.select("#" + k).property("value", v); + } + } + + let btn_gp = form.append("div").classed("flex justify-end", true); + + btn_gp.append("div"); + btn_gp + .append("button") + .classed("btn btn-blue", true) + .attr("type", "submit") + .text("Apply"); +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-scenario.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-scenario.js new file mode 100644 index 00000000..3edd3de1 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-scenario.js @@ -0,0 +1,95 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import * as util from "../../../../../lib/util.js"; +import store from "../../../../../lib/state.js"; +import { saveAs } from "file-saver"; + +export class SaveScenarioUI extends Component { + constructor(options) { + super({ store, id: options.id }); + } + + get scenario_name() { + return util.get(this.store, "state.scenario_name"); + } + + get scenario() { + return { + name: this.scenario_name, + graph: util.get(this, "store.state.graph"), + }; + } + + saveScenarioBlob() { + let json_file = { + filename: + (this.scenario.name.replaceAll(" ", "_") || "scenario") + ".json", + json: JSON.stringify(this.scenario, undefined, 2), + }; + + let blob = new Blob([json_file.json], { + type: "text/plain;charset=utf-8", + }); + saveAs(blob, json_file.filename); + } + + dumpScenario() { + let contents = `
${JSON.stringify(this.scenario, undefined, 2)}
`; + + this.element.select("#dump-scenario-text").html(contents); + } + + clearScenario() { + this.element.select("#dump-scenario-text").html(""); + } + + _template() { + return ` +
+
Save Scenario to File (json) + +
+
+ Print Scenario for Review (json) + + +
+
+
+ + `; + } + + _render() { + let self = this; + self.element = d3 + .select(`#${self.parent_id}-content`) + .append("div") + .attr("id", self.id); + self.element.html(self._template()); + + self.button = self.element.select("#save-scenario"); + self.button.on("click", self.saveScenarioBlob.bind(self)); + + self.button = self.element.select("#dump-scenario"); + self.button.on("click", self.dumpScenario.bind(self)); + + self.button = self.element.select("#clear-scenario"); + self.button.on("click", self.clearScenario.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-treatment-facility.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-treatment-facility.js new file mode 100644 index 00000000..bac8e6cb --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-content-save-treatment-facility.js @@ -0,0 +1,189 @@ +import Component from "../../../../base/component.js"; +import d3 from "../../../../../lib/d3.js"; +import * as util from "../../../../../lib/util.js"; +import store from "../../../../../lib/state.js"; +import { saveAs } from "file-saver"; + +export class SaveTmntFacilityUI extends Component { + constructor(options) { + super({ store, id: options.id }); + } + + get facility_types() { + return Object.keys(util.get(this, "store.state.facility_type_map")); + } + + get facility_type_map() { + return util.get(this, "store.state.facility_type_map"); + } + + get schema() { + return util.get(this, "store.state.schema"); + } + + get scenario_name() { + return util.get(this.store, "state.scenario_name"); + } + + get facility_properties() { + let properties = new Set(); + + for (let facility of this.facility_types) { + let schema_name = this.facility_type_map[facility]; + let schema = this.schema[schema_name]; + Object.keys(schema.properties).forEach(properties.add, properties); + } + + // add in the ones not in the nereid schemas + ["long", "lat"].forEach(properties.add, properties); + + return properties; + } + + get facility_data() { + let properties = this.facility_properties; + + let records = []; + + let treatment_facility_nodes = util + .deepCopy(util.get(this, "store.state.graph.nodes") || [{}]) + .filter((n) => n.node_type == "treatment_facility"); + + if (treatment_facility_nodes.length == 0) { + treatment_facility_nodes = [{}]; + } + + treatment_facility_nodes.forEach((n) => { + let record = {}; + for (let p of properties) { + record[p] = util.get(n.data, p) || ""; + } + + let longlat = n?.longlat || ["", ""]; + + record["long"] = longlat[0]; + record["lat"] = longlat[1]; + + records.push(record); + }); + + return records; + } + + facility_template() { + let self = this; + + let records = []; + + let state = util.get(self, `store.state.nereid_state`); + let region = util.get(self, `store.state.nereid_region`); + + let treatment_facility_fields = util.get( + self, + `store.state.treatment_facility_fields.${state}.${region}` + ); + + let properties = [...this.facility_properties].filter( + (p) => !treatment_facility_fields.ignored.includes(p) + ); + + for (let [name, type] of Object.entries(this.facility_type_map)) { + let schema = this.schema[type]; + let record = {}; + + for (let prop of properties) { + let text = util.get(schema.properties[prop], "type") || ""; + if (schema.required.includes(prop)) { + text += "-req"; + } + if (treatment_facility_fields.disabled.includes(prop)) { + text += "-uneditable"; + } + record[prop] = text; + } + record["long"] = "number"; + record["lat"] = "number"; + record.facility_type = name; + records.push(record); + } + + return records; + } + + saveTreatmentCSV() { + let csv_data = this.facility_data; + let scenario_name = this.scenario_name.replaceAll(" ", "-"); + + let proto_csv = { + filename: `${scenario_name}-treatment_facilities.csv`, + csv: util.convertArrayOfObjectsToCSV({ data: csv_data }), + }; + + let blob = new Blob([proto_csv.csv], { + type: "text/plain;charset=utf-8", + }); + saveAs(blob, proto_csv.filename); + } + + saveTreatmentTemplateCSV() { + let csv_data = this.facility_template(); + let state = util.get(this, "store.state.nereid_state"); + let region = util.get(this, "store.state.nereid_region"); + + let proto_csv = { + filename: `${state}-${region}-treatment_facilities-template.csv`, + csv: util.convertArrayOfObjectsToCSV({ data: csv_data }), + }; + + let blob = new Blob([proto_csv.csv], { + type: "text/plain;charset=utf-8", + }); + saveAs(blob, proto_csv.filename); + } + + _template() { + return ` +
+
Save Treatment Facility Info to File (csv) + +
+
+
Save Treatment Facility Template to File (csv) + +
+
{ + // console.log(self.facility_data); + }); + + self.element + .select("#save-tmnt") + .on("click", self.saveTreatmentCSV.bind(self)); + + self.element + .select("#save-tmnt-template") + .on("click", self.saveTreatmentTemplateCSV.bind(self)); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-editor.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-editor.js new file mode 100644 index 00000000..80e30a34 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-editor.js @@ -0,0 +1,20 @@ +import { NodeEditorDrawer } from "./drawers"; +import { NodeInputUI, SelectedNodeUI } from "./drawer-content-node-inputs.js"; +import { LandSurfaceNodeEditorUI } from "./drawer-content-node-land-surface"; +import { TreatmentFacilityNodeEditorUI } from "./drawer-content-node-treatment-facility"; + +const selectedNodeUI = new SelectedNodeUI(); +const nodeInputUI = new NodeInputUI(); +const landSurfaceEditorUI = new LandSurfaceNodeEditorUI(); +const treatmentFacilityNodeEditorUI = new TreatmentFacilityNodeEditorUI(); + +export const nodeEditorDrawer = new NodeEditorDrawer({ + id: "node-editor-drawer", + title: "Edit Nodes", + children: [ + selectedNodeUI, + nodeInputUI, + landSurfaceEditorUI, + treatmentFacilityNodeEditorUI, + ], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-find.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-find.js new file mode 100644 index 00000000..0ca34c97 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-find.js @@ -0,0 +1,137 @@ +import { FindNodeDrawer } from "./drawers"; +import Component from "../../../../base/component"; +import store from "../../../../../lib/state.js"; +import * as util from "../../../../../lib/util.js"; + +class SearchInput extends Component { + constructor(options) { + super({ store, id: options.id }); + let self = this; + self.primary_callback = (data) => { + identify_node(data.find_node); + }; + self.primary_button_label = options.primary_button_label || "Find"; + } + + _template_primary_button() { + if (this.primary_callback == null) return ""; + return ``; + } + + _template() { + return ` +
+ + +
+
+
+ + +
+ ${this._template_primary_button()} +
+
+
`; + } + _render() { + let self = this; + self.element = d3.select(`#${self.parent_id}-content`).append("div"); + self.element.html(self._template()); + + let form = self.element.select("form"); + + form // + .attr("method", "get") + .on("submit", function (event) { + event.preventDefault(); + + form.selectAll("input").property("disabled", false); + const data = new FormData(event.target); + const value = util.cleanObject(Object.fromEntries(data.entries())); + self.primary_callback.bind(self)(value); + + return false; + }); + } +} + +export const findNodeDrawer = new FindNodeDrawer({ + id: "find-node-drawer", + title: "Find Node", + children: [new SearchInput({ id: "find-node-ui" })], + exit_callback: () => { + let nodes = util.get(store, "state.graph.nodes"); + nodes.map((n) => restore_node(n)); + store.dispatch("foundNodeIds", {}); + store.dispatch("editorUpdate"); + }, +}); + +const highlight_node = (node) => { + node.color = "orange"; + node.size = 40; +}; + +const restore_node = (node) => { + node.color = undefined; + node.size = undefined; +}; + +const identify_node = (node_id) => { + let nodes = util.get(store, "state.graph.nodes"); + let node_candidates = nodes.filter((n) => n.id.includes(node_id)); + nodes.map((n) => restore_node(n)); + + let found = []; + + for (let node of node_candidates) { + if (node) { + found.push(node); + } + } + + if (found.length) { + for (let node of found) { + highlight_node(node); + } + store.dispatch("foundNodeIds", { found_node_ids: found.map((n) => n.id) }); + } + store.dispatch("editorUpdate"); +}; diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-load.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-load.js new file mode 100644 index 00000000..a3a54971 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-load.js @@ -0,0 +1,18 @@ +import { LoadTableDrawer } from "./drawers"; +import { + loadGraphFileUI, + loadLandSurfaceFileUI, + loadTreatmentFacilitiesFileUI, + loadScenarioFileUI, +} from "./drawer-content-load-files.js"; + +export const loadTableDrawer = new LoadTableDrawer({ + id: "load-table-drawer", + title: "Load from File", + children: [ + loadGraphFileUI, + loadLandSurfaceFileUI, + loadTreatmentFacilitiesFileUI, + loadScenarioFileUI, + ], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-save.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-save.js new file mode 100644 index 00000000..35d6c3ca --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawer-save.js @@ -0,0 +1,12 @@ +import { SaveFilesDrawer } from "./drawers"; +import { SaveScenarioUI } from "./drawer-content-save-scenario"; +import { SaveTmntFacilityUI } from "./drawer-content-save-treatment-facility"; + +const saveScenarioUI = new SaveScenarioUI({ id: "save-scenario" }); +const saveTmntFacilityUI = new SaveTmntFacilityUI({ id: "save-tmnt-facility" }); + +export const saveFilesDrawer = new SaveFilesDrawer({ + id: "save-files-drawer", + title: "Save to File", + children: [saveScenarioUI, saveTmntFacilityUI], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawers.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawers.js new file mode 100644 index 00000000..8c6943f8 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/drawers.js @@ -0,0 +1,65 @@ +import Component from "../../../../base/component"; +import { DrawerBase } from "../../../../base/drawer"; +import d3 from "../../../../../lib/d3.js"; +import store from "../../../../../lib/state"; + +export class FindNodeDrawer extends DrawerBase { + constructor(options) { + super(options); + let self = this; + + self.store.events.subscribe("changedPanel", ({ active_panel }) => + active_panel === "find-node-panel" ? self.enter() : null + ); + } +} + +export class NodeEditorDrawer extends DrawerBase { + constructor({ id, title, children }) { + super({ store, id, title, children }); + let self = this; + + self.store.events.subscribe("changedPanel", ({ active_panel }) => + active_panel === "node-editor-panel" ? self.enter() : null + ); + } +} + +export class LoadTableDrawer extends DrawerBase { + constructor({ id, title, children }) { + super({ store, id, title, children }); + let self = this; + + self.store.events.subscribe("changedPanel", ({ active_panel }) => + active_panel === "load-table-panel" ? self.enter() : null + ); + } +} + +export class SaveFilesDrawer extends DrawerBase { + constructor({ id, title, children }) { + super({ store, id, title, children }); + let self = this; + + self.store.events.subscribe("changedPanel", ({ active_panel }) => + active_panel === "save-files-panel" ? self.enter() : null + ); + } +} + +export class Drawers extends Component { + constructor({ children }) { + super({ store, children }); + } + _template() { + return ` +
+
+
+
+ `; + } + _render() { + d3.select("body").append("div").html(this._template()); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/index.js new file mode 100644 index 00000000..16f1fe2f --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/drawers/index.js @@ -0,0 +1,14 @@ +import { Drawers } from "./drawers"; +import { findNodeDrawer } from "./drawer-find"; +import { nodeEditorDrawer } from "./drawer-editor"; +import { loadTableDrawer } from "./drawer-load"; +import { saveFilesDrawer } from "./drawer-save"; + +export const drawers = new Drawers({ + children: [ + findNodeDrawer, + nodeEditorDrawer, + loadTableDrawer, + saveFilesDrawer, + ], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/index.js new file mode 100644 index 00000000..243beae7 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-menu/index.js @@ -0,0 +1,2 @@ +export { editor_menu } from "./drawer-controller"; +export { drawers } from "./drawers"; diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-node-info.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-node-info.js new file mode 100644 index 00000000..5b24c01f --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-node-info.js @@ -0,0 +1,141 @@ +import Component from "../../base/component.js"; +import { filter, get } from "../../../lib/util.js"; +import store from "../../../lib/state.js"; + +class NodeInfoTooltip extends Component { + constructor(options) { + super({ store }); + + let self = this; + self.parent_id = options.parent_id; + self.id = options.id || ""; + } + + get current_node_data() { + let id = + get(this, "store.state.selected_node_id") || + get(this, "store.state.node_hovered"); + if (!id) return; + return get(this, "store.state.graph.nodes").find((n) => n.id === id); + } + + get show_info_tooltip() { + return get(this, "store.state.show_info_tooltip"); + // && get(this, "store.state.node_hovered") + } + + tooltip_move(event) { + let tt_width = this.element.node().getBoundingClientRect().width; + let px = null; + let py = null; + if (event.type == "touchstart") { + px = event.touches[0].pageX; + py = event.touches[0].pageY; + } else { + px = event.pageX; + py = event.pageY; + } + + let anchorPt = Math.max( + 0, + window.innerWidth - px < tt_width ? px - tt_width : px + ); + + this.element.style("left", anchorPt + "px").style("top", py - 28 + "px"); + } + + hide() { + // console.log("hiding tt"); + let ele = this.element; + ele.classed("opacity-100 h-auto", false); + ele.classed("opacity-0 h-0", true); + } + + show() { + let ele = this.element; + ele.classed("opacity-100 h-auto", true); + ele.classed("opacity-0 h-0", false); + } + + update_contents() { + let self = this; + let d = self.current_node_data; + // if (!d) return; + let ele = self.element; + + // console.log("show tt: ", self.show_info_tooltip); + + if (!self.show_info_tooltip || !d) { + self.hide(); + return; + } + self.show(); + // console.log("update tt contents"); + + // ele.interrupt().transition().style("opacity", 1).style("height", "auto"); + + ele.select(".info-tooltip-header").html(`
Node ID: ${d.id}
`); + + let table_html = ` + + Node Type: + ${d.node_type || "No Data"} + + `; + + ele.select(".info-tooltip-content table").html(table_html); + + let private_keys = Object.keys(d).filter((key) => key.charAt(0) === "_"); + // console.log(private_keys); + let pp_obj = filter(d, [], private_keys); + + // let datastring = `
${JSON.stringify(d.data, undefined, 2)}
`; + let datastring = `
${JSON.stringify(pp_obj, undefined, 2)}
`; + ele.select(".info-tooltip-json").html(datastring); + } + + _render() { + let self = this; + + // console.log("rendering tooltip", self.parent_id); + + let parent = d3.select(`#${self.parent_id}`); //.classed("has-tooltip", true); + self.element = parent + .append("div") + .attr("id", self.id || "") + .classed( + "transition-opacity opacity-0 tooltip rounded shadow-lg p-1 bg-gray-50", + true + ); + + let tooltip = self.element.html(""); + + tooltip = tooltip.append("div").classed("info-tooltip p-2", true); + + tooltip + .append("div") + .classed("info-tooltip-header mt-2 uppercase text-lg font-bold", true); + + tooltip + .append("div") + .classed("info-tooltip-content text-sm", true) + .append("table"); + + tooltip + .select(".info-tooltip-content") + .append("div") + .classed("info-tooltip-json", true); + tooltip.append("div").classed("info-tooltip-footer", true); + + self.store.events.subscribe("stateChange", () => this.update_contents()); + + // parent.on("mousemove.node-info-tooltip", (event) => + // self.tooltip_move(event) + // ); + } +} + +export const node_info = new NodeInfoTooltip({ + parent_id: "editor-info", + id: "node-info-tooltip", +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js new file mode 100644 index 00000000..39a0d7ef --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tab.js @@ -0,0 +1,58 @@ +import Component from "../../base/component.js"; +import store from "../../../lib/state.js"; +import d3 from "../../../lib/d3.js"; +import * as util from "../../../lib/util.js"; + +export class EditorTab extends Component { + constructor(options) { + super({ store, id: options.id, children: options.children }); + this.store.events.subscribe( + "updateScenarioName", + this._update_scenario_name.bind(this) + ); + } + + get scenario_name() { + return util.get(this.store, "state.scenario_name"); + } + + _update_scenario_name() { + let self = this; + d3.select(`#${self.id}`).select("#scenario-name").text(self.scenario_name); + return; + } + + _template() { + return ` +
+ Scenario:  + + ${this.scenario_name} + +
+
+
+
+
+
+
+ +
+
+
+
+ `; + } + _render() { + let self = this; + let element = d3 + .select(`#${self.id}`) + .classed("flex flex-col justify-center max-w-[1000px]", true) + .html(self._template()); + + element.select("#scenario-name").on("input", () => { + let scenario_name = element.select("#scenario-name").text().trim(); + self.store.dispatch("changeScenarioName", { scenario_name }); + }); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tips.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tips.js new file mode 100644 index 00000000..b972da33 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-tips.js @@ -0,0 +1,123 @@ +import Component from "../../base/component.js"; +import { get } from "../../../lib/util.js"; +import store from "../../../lib/state.js"; + +class EditorTips extends Component { + constructor(options) { + super({ store }); + + let self = this; + self.parent_id = options.parent_id; + self.id = options.id || ""; + } + + // get current_node_data() { + // let id = + // get(this, "store.state.selected_node_id") || + // get(this, "store.state.node_hovered"); + // if (!id) return; + // return get(this, "store.state.graph.nodes").find((n) => n.id === id); + // } + + get show_tips() { + return get(this, "store.state.graph_edit_mode"); + } + + hide() { + // console.log("hiding tt"); + let ele = this.element; + ele.classed("opacity-100 h-auto", false); + ele.classed("opacity-0 h-0", true); + } + + show() { + let ele = this.element; + ele.classed("opacity-100 h-auto", true); + ele.classed("opacity-0 h-0", false); + } + + update_contents() { + let self = this; + if (!self.show_tips) { + self.hide(); + return; + } + self.show(); + } + + _template() { + return ` +
+ Edit Graph is Active +
+
+ Click in the open space to add a node. + +
+ Drag from one node to another to add an edge + +
+ Click a node or an edge to select it. + +
+ Press Ctrl & Drag a node to move the graph node layout. + Dragging will pin the node to the location. + +
+ Press Delete to remove the selected node or edge. + This is possible only when the mouse is within the map editor. + +
+ Press G to zoom the map to the graph extents. + +
+ `; + } + + _render() { + let self = this; + + // console.log("rendering tips", self.parent_id); + + let parent = d3.select(`#${self.parent_id}`); //.classed("has-tooltip", true); + self.element = parent + .append("div") + .attr("id", self.id || "") + .classed("transition-opacity opacity-0 p-2 h-auto text-justify", true) + .html(self._template()); + + // let tooltip = self.element.html(""); + + // tooltip = tooltip.append("div").classed("info-tooltip p-2", true); + + // tooltip + // .append("div") + // .classed("info-tooltip-header mt-2 uppercase text-lg font-bold", true); + + // tooltip + // .append("div") + // .classed("info-tooltip-content text-sm", true) + // .append("table"); + + // tooltip + // .select(".info-tooltip-content") + // .append("div") + // .classed("info-tooltip-json", true); + // tooltip.append("div").classed("info-tooltip-footer", true); + + this.update_contents(); + + self.store.events.subscribe("isGraphEditMode", () => + this.update_contents() + ); + + // parent.on("mousemove.node-info-tooltip", (event) => + // self.tooltip_move(event) + // ); + } +} + +export const editor_tips = new EditorTips({ + parent_id: "editor-info", + id: "editor-tips", +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-toggles.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-toggles.js new file mode 100644 index 00000000..90667001 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/editor-toggles.js @@ -0,0 +1,92 @@ +import { getTruthy } from "../../../lib/util.js"; +import { ToggleBase } from "../../base/toggle.js"; +import Component from "../../base/component.js"; +import store from "../../../lib/state.js"; + +const scale = "scale-75"; + +const toggleMapMode = new ToggleBase({ + id: "map-edit-toggle", + text: "Show BaseMap", + isActive: getTruthy(store, "state.map_mode"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.map_mode"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isMapMode", { map_mode: m }); + }, +}); + +const toggleAddNodeMode = new ToggleBase({ + id: "graph-edit-toggle", + text: "Edit Graph", + isActive: getTruthy(store, "state.graph_edit_mode"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.graph_edit_mode"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isGraphEditMode", { graph_edit_mode: m }); + }, +}); + +const toggleShowStates = new ToggleBase({ + id: "states-vector-toggle", + text: "Show States", + isActive: getTruthy(store, "state.show_states"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.show_states"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isShowStatesMode", { show_states: m }); + }, +}); + +const toggleShowDesignStorm = new ToggleBase({ + id: "design-storm-vector-toggle", + text: "Show Design Storm", + isActive: getTruthy(store, "state.show_design_storm"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.show_design_storm"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isShowDesignStorm", { show_design_storm: m }); + }, +}); + +const toggleShowRainZone = new ToggleBase({ + id: "rain-zone-vector-toggle", + text: "Show Rain Zones", + isActive: getTruthy(store, "state.show_rain_zone"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.show_rain_zone"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isShowRainZones", { show_rain_zone: m }); + }, +}); + +const toggleShowInfoTooltip = new ToggleBase({ + id: "into-tooltip-toggle", + text: "Show Node Info", + isActive: getTruthy(store, "state.show_info_tooltip"), + scale: scale, + callback: function () { + let m = !getTruthy(this, "store.state.show_info_tooltip"); + this.toggle.select("input[type=checkbox]").property("checked", !!m); + this.store.dispatch("isShowInfoTooltip", { show_info_tooltip: m }); + }, +}); + +export const toggles = new Component({ + id: "toggle-container", + children: [ + toggleMapMode, + toggleShowStates, + toggleShowDesignStorm, + toggleShowRainZone, + toggleAddNodeMode, + toggleShowInfoTooltip, + ], +}); + +// toggles.render(); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/index.js new file mode 100644 index 00000000..245e6f5c --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/editor-tab/index.js @@ -0,0 +1,11 @@ +import { EditorTab } from "./editor-tab"; +import { toggles } from "./editor-toggles"; +import { editor } from "../../graph-interface"; +import { node_info } from "./editor-node-info"; +import { editor_tips } from "./editor-tips"; +import { editor_menu, drawers } from "./editor-menu"; + +export const editTab = new EditorTab({ + id: "editor-tab", + children: [toggles, editor, node_info, editor_tips, editor_menu, drawers], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/howto-tab.js b/nereid/nereid/static/frontend/src/js/components/tabs/howto-tab.js new file mode 100644 index 00000000..164e2124 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/howto-tab.js @@ -0,0 +1,46 @@ +import Component from "../base/component.js"; +import store from "../../lib/state.js"; +import d3 from "../../lib/d3.js"; +import * as util from "../../lib/util.js"; + +export class HowTab extends Component { + constructor(options) { + super({ store, id: options.id }); + } + _template() { + return ` +
+
+
+ how to coming soon... +
+
+
+ `; + } + async fetch_page() { + let self = this; + let url = `${store.state.nereid_host}` + "/static/pages/how_to"; + console.log(url); + util.incr_waiting(); + fetch(url, { method: "GET" }) + .then((resp) => { + if (resp.status_code === 200) { + return resp.text().then(function (text) { + self.element.select(".markdown_content").html(text); + }); + } + }) + .finally(util.decr_waiting); + } + + _render() { + let self = this; + self.element = d3 + .select(`#${self.id}`) + .classed("relative flex flex-col justify-center", true) + .html(self._template()); + + self.fetch_page(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/index.js new file mode 100644 index 00000000..cbbb327c --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/index.js @@ -0,0 +1,18 @@ +import { Tabs } from "./tabs.js"; +import { editTab } from "./editor-tab"; +import { + treatmentFacilityResultsTab, + landSurfaceResultsTab, +} from "./results-tab"; +import { HowTab } from "./howto-tab.js"; + +const howTab = new HowTab({ id: "how-to-tab" }); + +export const tabs = new Tabs({ + children: [ + editTab, + treatmentFacilityResultsTab, + landSurfaceResultsTab, + howTab, + ], +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/index.js new file mode 100644 index 00000000..3cd191bf --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/index.js @@ -0,0 +1,34 @@ +import { ResultsTab } from "./results-tab"; +import * as results from "./result_summary"; + +const treatment_funcs = [ + // design summary + results.table_facility_design_summary, + + // volume capture + results.table_facility_capture, + results.table_facility_volume_reduction, + results.table_facility_total_volume_reduction, + results.table_facility_wet_weather_volume_reduction, + results.table_facility_dry_weather_volume_reduction, + + // load reduction + results.table_facility_load_reduction, + results.table_facility_total_load_reduction, + results.table_facility_wet_weather_load_reduction, + results.table_facility_dry_weather_load_reduction, +]; + +const ls_funcs = [ + results.table_land_surface_summary, + results.table_land_surface_load_summary, +]; + +export const treatmentFacilityResultsTab = new ResultsTab({ + id: "treatment-facility-results-tab", + table_builders: treatment_funcs, +}); +export const landSurfaceResultsTab = new ResultsTab({ + id: "land-surface-results-tab", + table_builders: ls_funcs, +}); diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/all_data.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/all_data.js new file mode 100644 index 00000000..f24bc2d9 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/all_data.js @@ -0,0 +1,17 @@ +import * as util from "../../../../lib/util.js"; + +export function table_all_data(data) { + let opts = { + data, + id: "table-all-data", + title: "Raw Results", + description: `Raw results do not include the calculated sub totals (e.g., wet + dry). + These data are the data source from which the calculated values are based.`, + filename_csv: "raw_results.csv", + prep_fnx: (dataset) => [ + dataset, + [...new Set(util.flatten(dataset.map((d) => Object.keys(d))))], + ], + }; + return opts; +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_final_summary.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_final_summary.js new file mode 100644 index 00000000..6fad1344 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_final_summary.js @@ -0,0 +1,29 @@ +export const table_facility_report_summary = (data) => { + let opts = { + data, + id: "table-facility-report-summary", + title: "Facility report Summary", + filename_csv: "facility_report_summary.csv", + prep_fnx: (dataset) => { + const data_keys = [ + "node_id", + "facility_type", + "valid_model", + "design_intensity_inhr", + "design_volume_cuft_cumul", + ]; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => data_keys.includes(k)) + ) + ); + + return [summary, data_keys]; + }, + }; + return opts; +}; diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_load_summary.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_load_summary.js new file mode 100644 index 00000000..65b06a83 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_load_summary.js @@ -0,0 +1,243 @@ +import * as util from "../../../../lib/util.js"; + +export function table_facility_load_reduction(data) { + let opts = { + data, + id: "table-facility-load-reduction", + title: "Facility Load Reduction Results", + description: `These results are separated in to wet weather results, + summer dry weather results, and winter dry weather results.`, + filename_csv: "load_reduction_results.csv", + prep_fnx: (dataset) => { + const base = [ + "node_id", + // "facility_type" + ]; + + const summary_keys_filter = function (k) { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + return base.includes(k) || is_load; + }; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const load_keys_base = all_keys.filter((k) => { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + let is_wet = !k.includes("dw"); + return is_load && is_wet; + }); + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter( + ([k, v]) => summary_keys_filter(k) + // k.includes("_pct") & !k.includes("dry") + ) + ) + ); + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of load_keys_base.sort()) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .sort((a, b) => { + if (a.includes("total")) return 1; + if (a.includes("winter")) return 1; + if (a.includes("summer")) return 1; + return -1; + }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_total_load_reduction(data) { + let opts = { + data, + id: "table-facility-total-load-reduction", + title: "Facility Total Load Reduction Results", + description: "(calculated as total of results for wet + summer + dry)", + filename_csv: "total_load_reduction_results.csv", + prep_fnx: (dataset) => { + let base = ["node_id"]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const load_keys_base = all_keys.filter((k) => { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + let is_wet = !k.includes("dw"); + return is_load && is_wet; + }); + + const summary_key_filter = function (k) { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + + return base.includes(k) || is_load; //|| is_vol; // && is_dry); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + for (let d of summary) { + for (let k of load_keys_base) { + let wet = d[k]; + let summer = d[`summer_dw${k}`]; + let winter = d[`winter_dw${k}`]; + d[`total_${k}`] = wet + summer + winter; + // console.log(k, wet, summer, winter); + } + } + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of load_keys_base.sort()) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .filter((d) => d.includes("total")) + .sort((a, b) => { + if (a.includes("total")) return 1; + if (a.includes("winter")) return 1; + if (a.includes("summer")) return 1; + return -1; + }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_wet_weather_load_reduction(data) { + let opts = { + data, + id: "table-facility-wet-weather-load-reduction", + title: "Facility Wet Weather Load Reduction Results", + filename_csv: "wet_weather_load_reduction_results.csv", + prep_fnx: (dataset) => { + const summary_keys = function (k) { + let base = [ + "node_id", + // "facility_type" + ].includes(k); + + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + let is_dry = k.includes("dw"); + + return base || (is_load && !is_dry); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_keys(k)) + ) + ); + const data_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_dry_weather_load_reduction(data) { + let opts = { + data, + id: "table-facility-dry-weather-load-reduction", + title: "Facility Dry Weather Load Reduction Results", + description: `Includes summer dry weather, winter dry weather, and total dry + weather results (calculated as summer + winter)`, + filename_csv: "dry_weather_load_reduction_results.csv", + prep_fnx: (dataset) => { + let base = [ + "node_id", + // "facility_type" + ]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const load_keys_base = all_keys.filter((k) => { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + let is_wet = !k.includes("dw"); + return is_load && is_wet; + }); + + const summary_key_filter = function (k) { + let is_load = k.endsWith("lbs_removed") || k.endsWith("mpn_removed"); + let is_dry = k.includes("dw"); + + return base.includes(k) || (is_load && is_dry); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + for (let d of summary) { + for (let k of load_keys_base) { + let summer = d[`summer_dw${k}`]; + let winter = d[`winter_dw${k}`]; + d[`total_dw${k}`] = summer + winter; + } + } + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + for (let k of load_keys_base.sort()) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .sort((a, b) => { + if (a.includes("total")) return 1; + if (a.includes("winter")) return 1; + if (a.includes("summer")) return 1; + return -1; + }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_volume_summary.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_volume_summary.js new file mode 100644 index 00000000..6ae05233 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/facility_volume_summary.js @@ -0,0 +1,355 @@ +import * as util from "../../../../lib/util.js"; + +export const table_facility_design_summary = (data) => { + let opts = { + data, + id: "table-facility-design-summary", + title: "Facility design Summary", + filename_csv: "facility_design_summary.csv", + prep_fnx: (dataset) => { + const data_keys = [ + "node_id", + "facility_type", + "valid_model", + "design_intensity_inhr", + "design_volume_cuft_cumul", + ]; + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => data_keys.includes(k)) + ) + ); + + return [summary, data_keys]; + }, + }; + return opts; +}; + +export const table_facility_capture = (data) => { + let opts = { + data, + id: "table-facility-wet-weather-capture", + title: "Facility Wet Weather Volume Capture Results", + filename_csv: "wet_weather_volume_capture_results.csv", + prep_fnx: (dataset) => { + const data_keys = [ + "node_id", + "facility_type", + "valid_model", + "captured_pct", + "treated_pct", + "retained_pct", + "bypassed_pct", + "peak_flow_mitigated_pct", + ]; + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => data_keys.includes(k)) + ) + ); + + return [summary, data_keys]; + }, + }; + return opts; +}; + +export function table_facility_volume_reduction(data) { + let opts = { + data, + id: "table-facility-volume-reduction", + title: "Facility Volume Reduction Results", + // description: "", + filename_csv: "volume_reduction_results.csv", + prep_fnx: (dataset) => { + let base = ["node_id"]; + + const flow_types = [ + "inflow", + "treated", + "retained", + "captured", + "bypassed", + ]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const volume_keys_base = all_keys.filter((k) => { + let is_dry_result = flow_types.some((t) => + k.endsWith(`dry_weather_flow_cuft_${t}`) + ); + let is_wet_result = flow_types.some((t) => + k.endsWith(`runoff_volume_cuft_${t}`) + ); + return is_dry_result || is_wet_result; + }); + + // console.log(volume_keys_base); + + const summary_key_filter = function (k) { + return base.includes(k) || volume_keys_base.includes(k); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of flow_types) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .sort((a, b) => { + // if (a.includes("total")) return 1; + if (a.includes("winter")) return 1; + if (a.includes("summer")) return 1; + return -1; + }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_wet_weather_volume_reduction(data) { + let opts = { + data, + id: "table-facility-wet-weather-volume-reduction", + title: "Facility Wet Weather Volume Reduction Results", + filename_csv: "wet_weather_volume_reduction_results.csv", + prep_fnx: (dataset) => { + let base = ["node_id"]; + + const flow_types = [ + "inflow", + "treated", + "retained", + "captured", + "bypassed", + ]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const volume_keys_base = all_keys.filter((k) => { + let is_dry_result = flow_types.some((t) => + k.endsWith(`dry_weather_flow_cuft_${t}`) + ); + let is_wet_result = flow_types.some((t) => + k.endsWith(`runoff_volume_cuft_${t}`) + ); + return is_wet_result; + }); + + const summary_key_filter = function (k) { + return base.includes(k) || volume_keys_base.includes(k); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of flow_types) { + let keys = summary_keys.filter((d) => d.includes(k)); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_dry_weather_volume_reduction(data) { + let opts = { + data, + id: "table-facility-dry-weather-volume-reduction", + title: "Facility Dry Weather Volume Reduction Results", + description: "(calculated as total of summer + winter)", + filename_csv: "dry_weather_volume_reduction_results.csv", + prep_fnx: (dataset) => { + let base = ["node_id"]; + + const flow_types = [ + "inflow", + "treated", + "retained", + "captured", + "bypassed", + ]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const volume_keys_base = all_keys.filter((k) => { + let is_dry_result = flow_types.some((t) => + k.endsWith(`dry_weather_flow_cuft_${t}`) + ); + let is_wet_result = flow_types.some((t) => + k.endsWith(`runoff_volume_cuft_${t}`) + ); + return is_dry_result; //|| is_wet_result; + }); + + // console.log(volume_keys_base); + + const summary_key_filter = function (k) { + return base.includes(k) || volume_keys_base.includes(k); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + for (let d of summary) { + for (let k of flow_types) { + // let wet = d[`runoff_volume_cuft_${k}`]; + let summer = d[`summer_dry_weather_flow_cuft_${k}`]; + let winter = d[`winter_dry_weather_flow_cuft_${k}`]; + d[`total_dry_weather_volume_cuft_${k}`] = summer + winter; + } + } + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of flow_types) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .sort((a, b) => { + if (a.includes("total")) return 1; + if (a.includes("winter")) return 1; + if (a.includes("summer")) return 1; + return -1; + }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} + +export function table_facility_total_volume_reduction(data) { + let opts = { + data, + id: "table-facility-total-volume-reduction", + title: "Facility Total Volume Reduction Results", + description: "(calculated as total of results for wet + summer + winter)", + filename_csv: "total_volume_reduction_results.csv", + prep_fnx: (dataset) => { + let base = ["node_id"]; + + const flow_types = [ + "inflow", + "treated", + "retained", + "captured", + "bypassed", + ]; + + const all_keys = [ + ...new Set(util.flatten(dataset.map((d) => Object.keys(d)))), + ]; + + const volume_keys_base = all_keys.filter((k) => { + let is_dry_result = flow_types.some((t) => + k.endsWith(`dry_weather_flow_cuft_${t}`) + ); + let is_wet_result = flow_types.some((t) => + k.endsWith(`runoff_volume_cuft_${t}`) + ); + return is_dry_result || is_wet_result; + }); + + // console.log(volume_keys_base); + + const summary_key_filter = function (k) { + return base.includes(k) || volume_keys_base.includes(k); + }; + + let summary = (dataset || []) + .filter((d) => d.node_type) + .filter((d) => d.node_type.includes("facility")) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + for (let d of summary) { + for (let k of flow_types) { + let wet = d[`runoff_volume_cuft_${k}`]; + let summer = d[`summer_dry_weather_flow_cuft_${k}`]; + let winter = d[`winter_dry_weather_flow_cuft_${k}`]; + d[`total_volume_cuft_${k}`] = wet + summer + winter; + } + } + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + const data_keys = base; + + for (let k of flow_types) { + let keys = summary_keys + .filter((d) => d.includes(k)) + .filter((d) => d.includes("total")); + // .sort((a, b) => { + // if (a.includes("total")) return 1; + // if (a.includes("winter")) return 1; + // if (a.includes("summer")) return 1; + // return -1; + // }); + data_keys.push(...keys); + } + + return [summary, data_keys]; + }, + }; + return opts; +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/index.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/index.js new file mode 100644 index 00000000..9c028655 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/index.js @@ -0,0 +1,9 @@ +// import * as facility_vol_summary from "./facility_volume_summary"; +// import * as facility_load_summary from "./facility_load_summary"; +// import * as all_data from "./all_data"; + +// export { facility_vol_summary, facility_load_summary, all_data }; +export * from "./facility_volume_summary"; +export * from "./facility_load_summary"; +export * from "./all_data"; +export * from "./land_surface_summary"; diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/land_surface_summary.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/land_surface_summary.js new file mode 100644 index 00000000..8c8d39a4 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/result_summary/land_surface_summary.js @@ -0,0 +1,52 @@ +import * as util from "../../../../lib/util.js"; + +export const table_land_surface_summary = (data) => { + let opts = { + data, + id: "table-land-surface-summary", + title: "Land Surface Summary", + filename_csv: "land_surface_summary.csv", + prep_fnx: (dataset) => { + let data_keys = ["node_id", "area_acres", "ro_coeff", "imp_pct"]; + let summary = (dataset || []) + .filter((d) => d?.land_surfaces_count > 0) + .map((d) => Object.fromEntries(Object.entries(d))); + + return [summary, data_keys]; + }, + }; + return opts; +}; + +export const table_land_surface_load_summary = (data) => { + let opts = { + data, + id: "table-land-surface-load-summary", + title: "Land Surface Loading Summary", + filename_csv: "land_surface_load_summary.csv", + prep_fnx: (dataset) => { + let data_keys = ["node_id"]; + const summary_key_filter = function (k) { + let is_load = k.endsWith("_load_lbs") || k.endsWith("_load_mpn"); + + return data_keys.includes(k) || is_load; + }; + let summary = (dataset || []) + .filter((d) => d?.land_surfaces_count > 0) + .map((d) => + Object.fromEntries( + Object.entries(d).filter(([k, v]) => summary_key_filter(k)) + ) + ); + + const summary_keys = [ + ...new Set(util.flatten(summary.map((d) => Object.keys(d)))), + ]; + + console.log("landsurface load summary:", summary); + + return [summary, summary_keys]; + }, + }; + return opts; +}; diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/results-tab.js b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/results-tab.js new file mode 100644 index 00000000..06044a2e --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/results-tab/results-tab.js @@ -0,0 +1,264 @@ +import Component from "../../base/component.js"; +import store from "../../../lib/state.js"; +import d3 from "../../../lib/d3.js"; +import * as util from "../../../lib/util.js"; +// import * as results from "./result_summary"; + +async function resultTable(divid, options) { + let default_options = { + data: [{}], //load row data from array + // clipboard: true, + // clipboardPasteAction: "update", + maxHeight: "500px", + minHeight: 80, + // height: 100, + // width: 800, + autoResize: false, // Resize observer errors abound if this is true!!! + layout: "fitData", //fit columns to width of table + responsiveLayout: false, //hide columns that dont fit on the table + history: false, //allow undo and redo actions on the table + tooltipsHeader: true, + footerElement: ``, //add a custom button to the footer element + columns: [], + initialSort: [{ column: "node_id", dir: "asc" }], + }; + + let merged_options = Object.assign(default_options, options); + + let { default: Tabulator } = await import("tabulator-tables"); + + Tabulator.prototype.extendModule("format", "formatters", { + gscwmp: function (cell, formatterParams) { + let { precision } = formatterParams; + return "before " + cell.getValue() + " after " + `${precision}`; + }, + }); + + return new Tabulator(divid, merged_options); +} + +export class ResultsTab extends Component { + constructor(options) { + super({ store, id: options.id }); + + let self = this; + + self.table_builders = options.table_builders || []; + self.tables = []; + } + + get scenario_name() { + return util.get(this.store, "state.scenario_name"); + } + + async buildResultsSummary({ + id, + data, + prep_fnx, + title, + description, + filename_csv, + }) { + let self = this; + + // const id = "table-facility-capture"; + self.element.select(`#${id}`).remove(); + let ele = self.element + .append("div") + .attr("id", id) + .classed("grid grid-cols-1 grid-rows-auto pt-8", true); + + let header = ele + .append("div") + .classed(" flex flex-row w-full justify-between items-center", true); + header.append("div").classed("font-bold", true).html(title); + + const [summary_data, data_keys] = prep_fnx(data); + + if (!summary_data.length) { + ele + .append("div") + .classed("flex justify-center", true) + .html("no results to show for this summary yet..."); + return; + } + + let button = header + .append("div") + .classed("py-2", true) + .append("button") + .text("Download Data (csv)") + .classed("btn btn-blue", true); + + if (description != null) ele.append("div").html(description); + + const table_id = id + "-results-tabulator"; + + ele.append("div").attr("id", table_id); + + let table = await resultTable(`#${table_id}`, { + data: summary_data, + columns: data_keys.map((d) => { + let obj = { + title: d.replaceAll("_", " "), + field: d, + titleDownload: d, + }; + let num_flags = [ + "_acres", + "_coeff", + "_load", + "_pct", + "_conc", + "_lbs", + "_cuft", + "_cfs", + "_mpn", + "_inhr", + ]; + if (num_flags.some((e) => d.includes(e))) { + obj.formatter = "money"; + obj.formatterParams = { + precision: 2, + }; + } + if (d.includes("_pct")) { + obj.formatterParams = { + precision: 2, + symbol: "%", + symbolAfter: "p", + }; + } + if (d.includes("_mpn")) { + obj.formatterParams = { + precision: 0, + }; + } + return obj; + }), + }); + + self.tables.push(table); + let scenario_name = self.scenario_name.replaceAll(" ", "-"); + + button.on("click", () => + table.download("csv", scenario_name + "-" + filename_csv) + ); + } + + async update(data) { + // console.log("running results update", data); + let self = this; + data = data || []; + self.element.html(""); + if (data?.length > 0) { + let download_all_button = self.element + .append("div") + .append("button") + .classed("btn btn-blue", true) + .text("Download All Data Summaries (xlsx)"); + download_all_button.on("click", async () => { + let sheets = {}; + self.element + .selectAll("[id$='-results-tabulator']") + .nodes() + .forEach((n) => { + let id = d3.select(n).attr("id"); + let sheet = id + .replace("-results-tabulator", "") + .replace("table-", "") + .replace("facility-", "bmp-") + .slice(0, 30); + if (!id.includes("table-all-data")) sheets[sheet] = "#" + id; + }); + + self.element.select(`#dummy_table`).remove(); + self.element + .append("div") + .attr("id", "dummy_table") + .classed("hidden", true); + + let table = await resultTable("#dummy_table"); + + table.download("xlsx", "AllData.xlsx", { sheets }); + }); + } + util.incr_waiting(); + try { + for (let func of self.table_builders) { + await self.buildResultsSummary(func(data)); + } + + // // land surface + // await self.buildResultsSummary(results.table_land_surface_summary(data)); + + // // design summary + // await self.buildResultsSummary( + // results.table_facility_design_summary(data) + // ); + // // volume capture + // await self.buildResultsSummary(results.table_facility_capture(data)); + // await self.buildResultsSummary( + // results.table_facility_volume_reduction(data) + // ); + // await self.buildResultsSummary( + // results.table_facility_total_volume_reduction(data) + // ); + + // await self.buildResultsSummary( + // results.table_facility_wet_weather_volume_reduction(data) + // ); + + // await self.buildResultsSummary( + // results.table_facility_dry_weather_volume_reduction(data) + // ); + + // // load reduction + // await self.buildResultsSummary( + // results.table_facility_load_reduction(data) + // ); + // await self.buildResultsSummary( + // results.table_facility_total_load_reduction(data) + // ); + // await self.buildResultsSummary( + // results.table_facility_wet_weather_load_reduction(data) + // ); + // await self.buildResultsSummary( + // results.table_facility_dry_weather_load_reduction(data) + // ); + + // All data - Raw + // await self.buildResultsSummary(results.table_all_data(data)); + } finally { + util.decr_waiting(); + } + } + + _template() { + return ` +
Click 'Run Scenario' in the Editor to calculate results.
+ `; + } + + _render() { + let self = this; + self.element = d3 + .select(`#${self.id}`) + .classed("relative flex justify-center", true) + .append("div") + .classed("flex flex-col relative max-w-screen-md py-10 ", true) + .html(self._template()); + + self.store.events.subscribe("newResults", ({ results }) => + self.update(results) + ); + self.store.events.subscribe("changedTab", ({ current_tab }) => { + // TODO make this not re-render the tables when changing tabs unless there's + // data to show or reload. + if (current_tab === self.id) { + let results = util.get(self, "store.state.results"); + self.update(results); + } + }); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/tab_system.js b/nereid/nereid/static/frontend/src/js/components/tabs/tab_system.js new file mode 100644 index 00000000..ec248443 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/tab_system.js @@ -0,0 +1,71 @@ +import store from "../../lib/state.js"; +import * as util from "../../lib/util"; + +export class TabSystem { + constructor(namespace) { + this.store = store; + this.namespace = namespace; + this.registry_underline = { + 0: "translate-x-0", + 1: "translate-x-full", + 2: "translate-x-double", + 3: "translate-x-triple", + 4: "translate-x-quad", + 5: "translate-x-pent", + 6: "translate-x-sext", + 7: "translate-x-sept", + 8: "translate-x-octa", + }; + + this.registry = {}; + } + + init() { + let self = this; + let namespace = this.namespace; + + document.querySelectorAll(`${namespace}`).forEach((tabMenu) => { + Array.from(tabMenu.children).forEach((child, ind) => { + self.registry[child.dataset.target] = self.registry_underline[ind]; + if (child.dataset.target) { + child.addEventListener(`click`, () => { + self.store.dispatch("changedTab", { + current_tab: child.dataset.target, + }); + self.toggle.bind(self)(child.dataset.target); + }); + if (child.className.includes("active")) { + self.toggle.bind(self)(child.dataset.target); + } + } + }); + }); + + self.store.events.subscribe("changedTab", ({ current_tab }) => { + self.toggle(current_tab); + }); + + let current_tab = util.get(self.store, "state.current_tab"); + if (current_tab) self.toggle(current_tab); + } + toggle(targetId) { + let self = this; + let namespace = this.namespace; + + let slider = document.querySelector(`${namespace} .tab-slider`); + slider.className = slider.className.replace(/\btranslate-x-.+?\b/g, ""); + slider.classList["add"](self.registry[targetId]); + + document + .querySelectorAll(`${namespace} .tab-content`) + .forEach((contentElement) => { + contentElement.classList[ + contentElement.id === targetId ? "remove" : "add" + ]("hidden"); + + document + .querySelector(`[data-target="${contentElement.id}"]`) + .classList.toggle("active", contentElement.id === targetId); + }); + } +} diff --git a/nereid/nereid/static/frontend/src/js/components/tabs/tabs.js b/nereid/nereid/static/frontend/src/js/components/tabs/tabs.js new file mode 100644 index 00000000..cf96eaa0 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/components/tabs/tabs.js @@ -0,0 +1,58 @@ +import Component from "../base/component.js"; +import store from "../../lib/state.js"; +import d3 from "../../lib/d3.js"; +import { TabSystem } from "./tab_system.js"; + +export class Tabs extends Component { + constructor({ children }) { + super({ store, children }); + this.classname = "main-tab-group-namespace"; + } + _template() { + return ` + +
+
+ Editor +
+
+
How To
+
Treatment Results
+
Land Surface Results
+ Logout +
+ + + + + +
+
+
+
+
+
+ + + `; + } + _render() { + let self = this; + let element = d3 + .select("body") + .append("div") + .classed("min-w-[700px]", true) + .html(self._template()); + const tabSystem = new TabSystem(`.${this.classname}`); + tabSystem.init(); + } +} diff --git a/nereid/nereid/static/frontend/src/js/index.js b/nereid/nereid/static/frontend/src/js/index.js new file mode 100644 index 00000000..7bba05c0 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/index.js @@ -0,0 +1 @@ +import "./components/index.js"; diff --git a/nereid/nereid/static/frontend/src/js/lib/d3.js b/nereid/nereid/static/frontend/src/js/lib/d3.js new file mode 100644 index 00000000..d8b67725 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/d3.js @@ -0,0 +1,54 @@ +import "internmap"; + +import * as array from "d3-array"; +import * as color from "d3-color"; +import * as dispatch from "d3-dispatch"; +import * as drag from "d3-drag"; +import * as dsv from "d3-dsv"; +import * as force from "d3-force"; +import * as format from "d3-format"; +import * as interpolate from "d3-interpolate"; +import * as quadtree from "d3-quadtree"; +import * as scale from "d3-scale"; +import * as scale_chromatic from "d3-scale-chromatic"; +import * as select from "d3-selection"; +import * as time from "d3-time"; +import * as time_format from "d3-time-format"; +import * as timer from "d3-timer"; +import * as transition from "d3-transition"; +import * as ease from "d3-ease"; + +import { json } from "d3-fetch"; +import { Delaunay } from "d3-delaunay"; +import * as geo from "d3-geo"; +import * as zoom from "d3-zoom"; +import * as tile from "d3-tile"; +import "delaunator"; +import "robust-predicates"; + +const d3 = Object.assign( + { json, Delaunay }, + select, + scale, + scale_chromatic, + ease, + force, + geo, + color, + dispatch, + drag, + dsv, + array, + quadtree, + interpolate, + tile, + time, + timer, + format, + time_format, + transition, + zoom +); + +export default d3; +window.d3 = d3; diff --git a/nereid/nereid/static/frontend/src/js/lib/editable-table.js b/nereid/nereid/static/frontend/src/js/lib/editable-table.js new file mode 100644 index 00000000..c7d09b2c --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/editable-table.js @@ -0,0 +1,21 @@ +export async function editableTable(divid, options) { + let default_options = { + data: [{}], //load row data from array + clipboard: true, + clipboardPasteAction: "update", + minHeight: 100, + autoResize: false, // Resize observer errors abound if this is true!!! + layout: "fitData", //fit columns to width of table + responsiveLayout: false, //hide columns that dont fit on the table + history: true, //allow undo and redo actions on the table + tooltipsHeader: true, + footerElement: ``, //add a custom button to the footer element + columns: [], + }; + + let merged_options = Object.assign(default_options, options); + + let { default: Tabulator } = await import("tabulator-tables"); + + return new Tabulator(divid, merged_options); +} diff --git a/nereid/nereid/static/frontend/src/js/lib/nereid-api.js b/nereid/nereid/static/frontend/src/js/lib/nereid-api.js new file mode 100644 index 00000000..8fed99e5 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/nereid-api.js @@ -0,0 +1,3322 @@ +import * as util from "./util.js"; +import store from "./state.js"; + +const land_surfaces = () => + util.flatten( + (util.get(store, "state.graph.nodes") || []) + .filter((d) => d?.node_type === "land_surface" && d?.data) + .map((d) => d?.data) + ); + +const treatment_facilities = () => + util.flatten( + (util.get(store, "state.graph.nodes") || []) + .filter((d) => d?.node_type === "treatment_facility" && d?.data) + .map((d) => d?.data) + ); + +const treatment_sites = () => + util.flatten( + (util.get(store, "state.graph.nodes") || []) + .filter((d) => d?.node_type === "treatment_site" && d?.data) + .map((d) => d?.data) + ); + +const graph = () => { + let edges = (util.get(store, "state.graph.edges") || []).map((d) => { + return { + source: d.source.id.toString(), + target: d.target.id.toString(), + }; + }); + + return { edges: edges, directed: true, multigraph: true }; +}; + +const watershed = () => { + return { + graph: graph(), + land_surfaces: land_surfaces() || [], + treatment_facilities: treatment_facilities() || [], + treatment_sites: treatment_sites() || [], + }; +}; + +const nereid = { + // getHost: async () => { + // let rsp; + // try { + // rsp = await util.getJsonResponse("/get_env"); + // if (rsp.status === 200) { + // let { nereid_host } = rsp; + // // console.log("host?", nereid_host); + // return nereid_host; + // } + // } catch (e) { + // console.error(e); + // } + // // console.log("default localhost:9999"); + // return "."; + // }, + + getOpenApi: async (host) => { + let rsp; + try { + rsp = await util.getJsonResponse(`${host}/openapi.json`); + return rsp; + } catch (err) { + console.error(err); // TypeError: failed to fetch + return __openapi; + } + }, + + getConfig: async (host, state, region) => { + let rsp; + try { + rsp = await util.getJsonResponse( + `${host}/config?state=${state}®ion=${region}` + ); + + if (rsp?.detail?.toLowerCase()?.includes("no config")) { + console.warn(`no config for ${state} ${region}`); + return __config; + } + return rsp; + } catch (err) { + console.error(err); // TypeError: failed to fetch + return __config; + } + }, + + getReferenceData: async (host, api, state, region, filename) => { + let rsp; + try { + rsp = await util.getJsonResponse( + `${host}${api}/reference_data_file?state=${state}®ion=${region}&filename=${filename}` + ); + + return rsp; + } catch (err) { + console.error(err); // TypeError: failed to fetch + } + }, + + postValidateNetwork: async (host, api, state, region, data) => { + let route = `${host}${api}/network/validate?state=${state}®ion=${region}`; + let rsp; + try { + rsp = await util.postJsonResponse(route, data); + if (rsp?.data?.isvalid) { + return { + title: "Validation Succeeded", + msg: "Success", + alert_type: "success", + }; + // return true; + } + return { + title: "Validation Errors", + msg: `
${JSON.stringify(rsp?.data, undefined, 2)}
`, + alert_type: "error", + }; + } catch (e) { + return { + title: "Validation Error", + msg: `
${JSON.stringify(e, undefined, 2)}
`, + alert_type: "error", + }; + + // store.dispatch("raiseModal", { modal_content: opt }); + } + + // store.dispatch("raiseModal", { modal_content: opt }); + // return false; + }, + + postValidateTreatmentFacilities: async (host, api, state, region, data) => { + let route = `${host}${api}/treatment_facility/validate?state=${state}®ion=${region}`; + let rsp; + try { + rsp = await util.postJsonResponse(route, data); + + let errors = []; + for (let bmp of rsp?.data?.treatment_facilities) { + bmp?.errors ? errors.push(bmp?.errors.replace(/\n/g, " ")) : null; + } + + for (let error of rsp?.data?.errors) { + if (error.toLowerCase().substring(0, 6).includes("error")) { + errors.push(error); + } + } + + if (errors.length == 0) { + return { + title: "Validation Succeeded", + msg: "", + alert_type: "success", + }; + // return true; + } + + return { + title: "Validation Errors", + msg: `
${JSON.stringify(errors, undefined, 2)}
`, + alert_type: "error", + }; + } catch (e) { + return { + title: "Validation Error", + msg: `
${JSON.stringify(e, undefined, 2)}
`, + alert_type: "error", + }; + + // store.dispatch("raiseModal", { modal_content: opt }); + } + + // store.dispatch("raiseModal", { modal_content: opt }); + // return false; + }, + + postSolveWatershed: async (host, api, state, region, data) => { + let route = `${host}${api}/watershed/solve?state=${state}®ion=${region}`; + let rsp; + try { + rsp = await util.postJsonResponse(route, data); + if (rsp?.data?.errors?.length == 0) { + return rsp; + } + } catch (e) { + console.error(e); + } + console.error(rsp, rsp?.data?.errors); + return rsp; + }, +}; + +export const getReferenceData = async (filename) => { + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.getReferenceData( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + filename + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const validateNetwork = async () => { + let data = graph(); + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postValidateNetwork( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const validateTreatmentFacilities = async () => { + let data = { treatment_facilities: treatment_facilities() }; + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postValidateTreatmentFacilities( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +export const solveWatershed = async () => { + let data = watershed(); + let { nereid_host, nereid_api_latest, nereid_state, nereid_region } = + util.get(store, "state"); + let rsp; + + try { + rsp = await nereid.postSolveWatershed( + nereid_host, + nereid_api_latest, + nereid_state, + nereid_region, + data + ); + } catch (err) { + console.error(err); + } + return rsp; +}; + +function replace_refs(obj, schema) { + for (let k in obj) { + if (typeof obj[k] == "object" && obj[k] !== null) { + replace_refs(obj[k], schema); + } else if (k == "$ref") { + let refname = obj[k].split("/").slice(-1).pop(); + if (refname) { + delete obj.$ref; + obj = Object.assign(obj, schema[refname]); + } + } + } +} + +export const getConfig = async ({ + nereid_host, + nereid_state, + nereid_region, +}) => { + // console.log(nereid_host, nereid_state, nereid_region); + if (!nereid_host) { + nereid_host = window.location.origin; //await nereid.getHost(); + } + + const openapi = await nereid.getOpenApi(nereid_host); + + const config = await nereid.getConfig( + nereid_host, + nereid_state, + nereid_region + ); + + const schema = util.deepCopy(openapi["components"]["schemas"]); + for (let c in schema) { + replace_refs(schema[c], schema); + } + + const facility_objs = + config["api_recognize"]["treatment_facility"]["facility_type"]; + + const facility_type_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + facility_type_map[k] = v["validator"]; + } + + const facility_alias_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + if (v?.alias) { + for (let a of v?.alias) { + facility_alias_map[a] = k; + } + } else { + facility_alias_map[k] = k; + } + } + + const facility_label_map = {}; + for (const [k, v] of Object.entries(facility_objs)) { + facility_label_map[v?.label || k] = k; + } + + const facility_types = Object.keys(facility_label_map); + + return { + nereid_host, + nereid_state, + nereid_region, + config, + openapi, + schema, + facility_types, + facility_type_map, + facility_alias_map, + facility_label_map, + }; +}; + +const __config = { + default_data_directory: "default_data", + project_data_directory: "project_data", + version: "0.4.3", + author: "Austin Orr", + contact: "aorr@geosyntec.com", + state: "state", + region: "region", + test: true, + pint_unit_registry: [ + "MPN = count = mpn", + "_100ml = 100 * milliliter = _100mL", + ], + api_recognize: { + land_surfaces: { + preprocess: [ + { + expand_fields: [ + { + field: "surface_key", + sep: "-", + new_column_names: ["subbasin", "land_use", "soil", "slope"], + }, + ], + }, + { + collapse_fields: [ + { + new_column_name: "fuzzy_key", + sep: "-", + fields: ["land_use"], + }, + ], + }, + { + joins: [ + { + other: "land_surface_table", + how: "left", + left_on: "surface_key", + right_on: "surface_id", + validate: "many_to_one", + indicator: true, + fuzzy_on: ["fuzzy_key"], + }, + { + other: "land_surface_emc_table", + how: "left", + left_on: "land_use", + right_on: "land_use", + validate: "many_to_one", + indicator: true, + }, + { + other: "dry_weather_land_surface_emc_table", + how: "left", + left_on: "land_use", + right_on: "land_use", + validate: "many_to_one", + indicator: true, + }, + { + other: "met_table", + how: "left", + left_on: "subbasin", + right_on: "subbasin", + validate: "many_to_one", + indicator: true, + }, + { + other: "dry_weather_flow_table", + how: "left", + left_on: "rain_gauge", + right_on: "rain_gauge", + validate: "many_to_one", + indicator: true, + }, + ], + }, + { + remaps: [ + { + left: "soil", + right: "imp_pct", + how: "addend", + mapping: { + water: 100, + }, + }, + { + left: "land_use", + right: "is_developed", + how: "left", + fillna: false, + mapping: { + COMM: true, + EDU: true, + IND: true, + UTIL: true, + RESSFH: true, + RESSFL: true, + RESMF: true, + TRFWY: true, + TRANS: true, + TROTH: true, + }, + }, + ], + }, + ], + }, + treatment_facility: { + preprocess: [ + { + joins: [ + { + other: "met_table", + how: "left", + left_on: "ref_data_key", + right_on: "subbasin", + validate: "many_to_one", + indicator: true, + }, + ], + }, + { + remaps: [ + { + left: "hsg", + right: "inf_rate_inhr", + how: "left", + fillna: 0.000001, + mapping: { + a: 2.5, + b: 0.8, + c: 0.24, + d: 0.024, + lined: 0.000001, + }, + }, + ], + }, + ], + facility_type: { + no_treatment: { + validator: "NTFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_extended_detention: { + validator: "RetAndTmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Detention Basin", + }, + infiltration: { + validator: "RetentionFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + bioretention: { + validator: "BioInfFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Biofiltration", + }, + biofiltration: { + validator: "TmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Biofiltration", + }, + wet_detention: { + validator: "PermPoolFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Wet Pond", + }, + sand_filter: { + validator: "TmntFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Sand Filter", + }, + swale: { + validator: "FlowAndRetFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Vegetated Swale", + }, + hydrodynamic_separator: { + validator: "FlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Hydrodynamic Separator", + }, + dry_well: { + validator: "DryWellFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + cistern: { + validator: "CisternFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_weather_diversion: { + validator: "DryWeatherDiversionLowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + dry_weather_treatment: { + validator: "DryWeatherTreatmentLowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "Sand Filter", + }, + low_flow_facility: { + validator: "LowFlowFacility", + validation_fallback: "NTFacility", + tmnt_performance_facility_type: "¯\\_(ツ)_/¯", + }, + }, + }, + }, + project_reference_data: { + dry_weather_flow_table: { + file: "dry_weather_flow.json", + seasons: { + winter: ["oct", "nov", "dec", "jan", "feb", "mar"], + summer: ["apr", "may", "jun", "jul", "aug", "sep"], + }, + }, + met_table: { + file: "met_data.json", + volume_nomo: { + x_col: "size_fraction", + t_col: "ddt_hr", + y_col: "capture_fraction", + }, + flow_nomo: { + x_col: "intensity_inhr", + t_col: "tc_minutes", + y_col: "performance_frac", + }, + preprocess: [ + { + remaps: [ + { + left: "rain_gauge", + right: "volume_nomograph", + how: "left", + mapping: { + "100_LAGUNABEACH": "nomographs/100_LAGUNABEACH_volume_nomo.csv", + "1130_LAGUNA_AUDUBON": + "nomographs/1130_LAGUNA_AUDUBON_volume_nomo.csv", + }, + }, + { + left: "rain_gauge", + right: "flow_nomograph", + how: "left", + mapping: { + "100_LAGUNABEACH": "nomographs/100_LAGUNABEACH_flow_nomo.csv", + "1130_LAGUNA_AUDUBON": + "nomographs/1130_LAGUNA_AUDUBON_flow_nomo.csv", + }, + }, + ], + }, + ], + }, + dry_weather_tmnt_performance_table: { + file: "dry_weather_bmp_params.json", + facility_column: "facility_type", + pollutant_column: "pollutant", + preprocess: [ + { + remaps: [ + { + left: "unit", + right: "--", + how: "replace", + mapping: { + "MPN/100mL": "MPN/_100ml", + "MPN/100 mL": "MPN/_100ml", + }, + }, + ], + }, + ], + }, + tmnt_performance_table: { + file: "bmp_params.json", + facility_column: "facility_type", + pollutant_column: "pollutant", + preprocess: [ + { + remaps: [ + { + left: "unit", + right: "--", + how: "replace", + mapping: { + "MPN/100mL": "MPN/_100ml", + "MPN/100 mL": "MPN/_100ml", + }, + }, + ], + }, + ], + }, + land_surface_table: { + file: "land_surface_data.json", + }, + land_surface_emc_table: { + file: "land_surface_emc.json", + parameters: [ + { + long_name: "Total Suspended Solids", + short_name: "TSS", + concentration_unit: "mg/L", + load_unit: "lbs", + }, + { + long_name: "Total Copper", + short_name: "TCu", + concentration_unit: "ug/L", + load_unit: "lbs", + }, + { + long_name: "Fecal Coliform", + short_name: "FC", + concentration_unit: "MPN/_100mL", + load_unit: "mpn", + }, + ], + }, + dry_weather_land_surface_emc_table: { + file: "dry_weather_land_surface_emc.json", + parameters: [ + { + long_name: "Dry Weather Total Suspended Solids", + short_name: "dwTSS", + concentration_unit: "mg/L", + load_unit: "lbs", + }, + { + long_name: "Dry Weather Total Copper", + short_name: "dwTCu", + concentration_unit: "ug/L", + load_unit: "lbs", + }, + { + long_name: "Dry Weather Fecal Coliform", + short_name: "dwFC", + concentration_unit: "MPN/_100mL", + load_unit: "mpn", + }, + ], + }, + }, + data_path: "nereid/data/default_data/state/region", +}; + +const __openapi = { + openapi: "3.0.2", + info: { title: "nereid", version: "0.4.3" }, + paths: { + "/api/v1/network/validate": { + post: { + tags: ["network", "validate"], + summary: "Validate Network", + operationId: "validate_network_api_v1_network_validate_post", + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Graph" }, + example: { + directed: true, + nodes: [{ id: "A" }, { id: "B" }], + edges: [{ source: "A", target: "B" }], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/NetworkValidationResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/validate/{task_id}": { + get: { + tags: ["network", "validate"], + summary: "Get Validate Network Result", + operationId: + "get_validate_network_result_api_v1_network_validate__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/NetworkValidationResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph": { + post: { + tags: ["network", "subgraph"], + summary: "Subgraph Network", + operationId: "subgraph_network_api_v1_network_subgraph_post", + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphRequest" }, + example: { + graph: { + directed: true, + edges: [ + { source: "3", target: "1" }, + { source: "5", target: "3" }, + { source: "7", target: "1" }, + { source: "9", target: "1" }, + { source: "11", target: "1" }, + { source: "13", target: "3" }, + { source: "15", target: "9" }, + { source: "17", target: "7" }, + { source: "19", target: "17" }, + { source: "21", target: "15" }, + { source: "23", target: "1" }, + { source: "25", target: "5" }, + { source: "27", target: "11" }, + { source: "29", target: "7" }, + { source: "31", target: "11" }, + { source: "33", target: "25" }, + { source: "35", target: "23" }, + { source: "4", target: "2" }, + { source: "6", target: "2" }, + { source: "8", target: "6" }, + { source: "10", target: "2" }, + { source: "12", target: "2" }, + { source: "14", target: "2" }, + { source: "16", target: "12" }, + { source: "18", target: "12" }, + { source: "20", target: "8" }, + { source: "22", target: "6" }, + { source: "24", target: "12" }, + ], + }, + nodes: [{ id: "3" }, { id: "29" }, { id: "18" }], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph/{task_id}": { + get: { + tags: ["network", "subgraph"], + summary: "Get Subgraph Network Result", + operationId: + "get_subgraph_network_result_api_v1_network_subgraph__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/subgraph/{task_id}/img": { + get: { + tags: ["network", "visualize"], + summary: "Get Subgraph Network As Img", + operationId: + "get_subgraph_network_as_img_api_v1_network_subgraph__task_id__img_get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + { + required: false, + schema: { title: "Media Type", type: "string", default: "svg" }, + name: "media_type", + in: "query", + }, + { + required: false, + schema: { title: "Npi", type: "number", default: 4.0 }, + name: "npi", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/SubgraphResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence": { + post: { + tags: ["network", "sequence"], + summary: "Network Solution Sequence", + operationId: + "network_solution_sequence_api_v1_network_solution_sequence_post", + parameters: [ + { + required: false, + schema: { title: "Min Branch Size", type: "integer", default: 4 }, + name: "min_branch_size", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Graph" }, + example: { + directed: true, + edges: [ + { source: "3", target: "1" }, + { source: "5", target: "3" }, + { source: "7", target: "1" }, + { source: "9", target: "1" }, + { source: "11", target: "1" }, + { source: "13", target: "3" }, + { source: "15", target: "9" }, + { source: "17", target: "7" }, + { source: "19", target: "17" }, + { source: "21", target: "15" }, + { source: "23", target: "1" }, + { source: "25", target: "5" }, + { source: "27", target: "11" }, + { source: "29", target: "7" }, + { source: "31", target: "11" }, + { source: "33", target: "25" }, + { source: "35", target: "23" }, + { source: "4", target: "2" }, + { source: "6", target: "2" }, + { source: "8", target: "6" }, + { source: "10", target: "2" }, + { source: "12", target: "2" }, + { source: "14", target: "2" }, + { source: "16", target: "12" }, + { source: "18", target: "12" }, + { source: "20", target: "8" }, + { source: "22", target: "6" }, + { source: "24", target: "12" }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence/{task_id}": { + get: { + tags: ["network", "sequence"], + summary: "Get Network Solution Sequence", + operationId: + "get_network_solution_sequence_api_v1_network_solution_sequence__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/network/solution_sequence/{task_id}/img": { + get: { + tags: ["network", "sequence", "visualize"], + summary: "Get Network Solution Sequence As Img", + operationId: + "get_network_solution_sequence_as_img_api_v1_network_solution_sequence__task_id__img_get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + { + required: false, + schema: { title: "Media Type", type: "string", default: "svg" }, + name: "media_type", + in: "query", + }, + { + required: false, + schema: { title: "Npi", type: "number", default: 4.0 }, + name: "npi", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/SolutionSequenceResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data": { + get: { + tags: ["reference_data"], + summary: "Get Reference Data Json", + operationId: "get_reference_data_json_api_v1_reference_data_get", + parameters: [ + { + required: false, + schema: { title: "Filename", type: "string", default: "" }, + name: "filename", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/ReferenceDataResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data/nomograph": { + get: { + tags: ["reference_data"], + summary: "Get Nomograph", + operationId: "get_nomograph_api_v1_reference_data_nomograph_get", + parameters: [ + { + required: false, + schema: { title: "Filename", type: "string", default: "" }, + name: "filename", + in: "query", + }, + { + required: false, + schema: { title: "Type", type: "string" }, + name: "type", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { "application/json": { schema: {} } }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/reference_data/{table}": { + get: { + tags: ["reference_data"], + summary: "Get Reference Data Table", + operationId: + "get_reference_data_table_api_v1_reference_data__table__get", + parameters: [ + { + required: true, + schema: { title: "Table", type: "string" }, + name: "table", + in: "path", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { "application/json": { schema: {} } }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/land_surface/loading": { + post: { + tags: ["land_surface", "loading"], + summary: "Calculate Loading", + operationId: "calculate_loading_api_v1_land_surface_loading_post", + parameters: [ + { + required: false, + schema: { title: "Details", type: "boolean", default: false }, + name: "details", + in: "query", + }, + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaces" }, + example: { + land_surfaces: [ + { + node_id: "1", + surface_key: "10101100-RESMF-A-5", + area_acres: 1.834347898661638, + imp_area_acres: 1.430224547955745, + }, + { + node_id: "0", + surface_key: "10101100-OSDEV-A-0", + area_acres: 4.458327528535912, + imp_area_acres: 0.4457209193544626, + }, + { + node_id: "0", + surface_key: "10101000-IND-A-10", + area_acres: 3.337086111390218, + imp_area_acres: 0.47675887386582366, + }, + { + node_id: "0", + surface_key: "10101100-COMM-C-0", + area_acres: 0.5641157902710026, + imp_area_acres: 0.40729090799199347, + }, + { + node_id: "1", + surface_key: "10101200-TRANS-C-5", + area_acres: 0.007787658410143283, + imp_area_acres: 0.007727004694355631, + }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaceResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/land_surface/loading/{task_id}": { + get: { + tags: ["land_surface", "loading"], + summary: "Get Land Surface Loading Result", + operationId: + "get_land_surface_loading_result_api_v1_land_surface_loading__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/LandSurfaceResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_facility/validate": { + post: { + tags: ["treatment_facility", "validate"], + summary: "Initialize Treatment Facility Parameters", + operationId: + "initialize_treatment_facility_parameters_api_v1_treatment_facility_validate_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { + title: "Treatment Facilities", + anyOf: [ + { $ref: "#/components/schemas/TreatmentFacilities" }, + { $ref: "#/components/schemas/TreatmentFacilitiesStrict" }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/TreatmentFacilitiesResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_facility/validate/{task_id}": { + get: { + tags: ["treatment_facility", "validate"], + summary: "Get Treatment Facility Parameters", + operationId: + "get_treatment_facility_parameters_api_v1_treatment_facility_validate__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { + $ref: "#/components/schemas/TreatmentFacilitiesResponse", + }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/treatment_site/validate": { + post: { + tags: ["treatment_site", "validate"], + summary: "Initialize Treatment Site", + operationId: + "initialize_treatment_site_api_v1_treatment_site_validate_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/TreatmentSites" }, + example: { + treatment_sites: [ + { + node_id: "WQMP-1a-tmnt", + facility_type: "bioretention", + area_pct: 75, + captured_pct: 80, + retained_pct: 10, + }, + { + node_id: "WQMP-1a-tmnt", + facility_type: "nt", + area_pct: 25, + captured_pct: 0, + retained_pct: 0, + }, + { + node_id: "WQMP-1b-tmnt", + facility_type: "bioretention", + area_pct: 75, + captured_pct: 50, + retained_pct: 10, + }, + { + node_id: "WQMP-1b-tmnt", + facility_type: "nt", + area_pct: 25, + captured_pct: 0, + retained_pct: 0, + }, + ], + }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/TreatmentSiteResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/watershed/solve": { + post: { + tags: ["watershed", "main"], + summary: "Post Solve Watershed", + operationId: "post_solve_watershed_api_v1_watershed_solve_post", + parameters: [ + { + required: false, + schema: { title: "State", type: "string", default: "state" }, + name: "state", + in: "query", + }, + { + required: false, + schema: { title: "Region", type: "string", default: "region" }, + name: "region", + in: "query", + }, + ], + requestBody: { + content: { + "application/json": { + schema: { $ref: "#/components/schemas/Watershed" }, + }, + }, + required: true, + }, + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/WatershedResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + "/api/v1/watershed/solve/{task_id}": { + get: { + tags: ["watershed", "main"], + summary: "Get Watershed Result", + operationId: + "get_watershed_result_api_v1_watershed_solve__task_id__get", + parameters: [ + { + required: true, + schema: { title: "Task Id", type: "string" }, + name: "task_id", + in: "path", + }, + ], + responses: { + 200: { + description: "Successful Response", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/WatershedResponse" }, + }, + }, + }, + 422: { + description: "Validation Error", + content: { + "application/json": { + schema: { $ref: "#/components/schemas/HTTPValidationError" }, + }, + }, + }, + }, + }, + }, + }, + components: { + schemas: { + BioInfFacility: { + title: "BioInfFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "retention_volume_cuft", + "area_sqft", + "media_filtration_rate_inhr", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + retention_volume_cuft: { + title: "Retention Volume Cuft", + type: "number", + }, + area_sqft: { title: "Area Sqft", type: "number" }, + media_filtration_rate_inhr: { + title: "Media Filtration Rate Inhr", + type: "number", + }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + CisternFacility: { + title: "CisternFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "winter_demand_cfs", + "summer_demand_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + winter_demand_cfs: { title: "Winter Demand Cfs", type: "number" }, + summer_demand_cfs: { title: "Summer Demand Cfs", type: "number" }, + }, + }, + DryWeatherDiversionLowFlowFacility: { + title: "DryWeatherDiversionLowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + DryWeatherTreatmentLowFlowFacility: { + title: "DryWeatherTreatmentLowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + DryWellFacility: { + title: "DryWellFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "treatment_rate_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + }, + }, + Edge: { + title: "Edge", + required: ["source", "target"], + type: "object", + properties: { + source: { title: "Source", type: "string" }, + target: { title: "Target", type: "string" }, + metadata: { title: "Metadata", type: "object", default: {} }, + }, + }, + FlowAndRetFacility: { + title: "FlowAndRetFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "treatment_rate_cfs", + "area_sqft", + "depth_ft", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + depth_ft: { title: "Depth Ft", type: "number" }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + FlowFacility: { + title: "FlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "treatment_rate_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + }, + }, + Graph: { + title: "Graph", + required: ["edges"], + type: "object", + properties: { + edges: { + title: "Edges", + type: "array", + items: { $ref: "#/components/schemas/Edge" }, + }, + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + directed: { title: "Directed", type: "boolean", default: true }, + multigraph: { title: "Multigraph", type: "boolean", default: true }, + type: { title: "Type", type: "string" }, + label: { title: "Label", type: "string" }, + metadata: { title: "Metadata", type: "object" }, + }, + }, + HTTPValidationError: { + title: "HTTPValidationError", + type: "object", + properties: { + detail: { + title: "Detail", + type: "array", + items: { $ref: "#/components/schemas/ValidationError" }, + }, + }, + }, + LandSurface: { + title: "LandSurface", + required: ["node_id", "surface_key", "area_acres", "imp_area_acres"], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + surface_key: { + title: "Surface Key", + type: "string", + example: "104506-RESSFH-B-5", + }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + }, + }, + LandSurfaceDetails: { + title: "LandSurfaceDetails", + required: [ + "node_id", + "surface_key", + "area_acres", + "imp_area_acres", + "surface_id", + "perv_ro_depth_inches", + "imp_ro_depth_inches", + "perv_ro_coeff", + "imp_ro_coeff", + "perv_area_acres", + "imp_area_sqft", + "perv_area_sqft", + "imp_ro_depth_feet", + "perv_ro_depth_feet", + "imp_ro_volume_cuft", + "perv_ro_volume_cuft", + "runoff_volume_cuft", + "imp_eff_area_acres", + "perv_eff_area_acres", + "eff_area_acres", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + surface_key: { title: "Surface Key", type: "string" }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + surface_id: { title: "Surface Id", type: "string" }, + perv_ro_depth_inches: { + title: "Perv Ro Depth Inches", + type: "number", + }, + imp_ro_depth_inches: { title: "Imp Ro Depth Inches", type: "number" }, + perv_ro_coeff: { title: "Perv Ro Coeff", type: "number" }, + imp_ro_coeff: { title: "Imp Ro Coeff", type: "number" }, + perv_area_acres: { title: "Perv Area Acres", type: "number" }, + imp_area_sqft: { title: "Imp Area Sqft", type: "number" }, + perv_area_sqft: { title: "Perv Area Sqft", type: "number" }, + imp_ro_depth_feet: { title: "Imp Ro Depth Feet", type: "number" }, + perv_ro_depth_feet: { title: "Perv Ro Depth Feet", type: "number" }, + imp_ro_volume_cuft: { title: "Imp Ro Volume Cuft", type: "number" }, + perv_ro_volume_cuft: { title: "Perv Ro Volume Cuft", type: "number" }, + runoff_volume_cuft: { title: "Runoff Volume Cuft", type: "number" }, + imp_eff_area_acres: { title: "Imp Eff Area Acres", type: "number" }, + perv_eff_area_acres: { title: "Perv Eff Area Acres", type: "number" }, + eff_area_acres: { title: "Eff Area Acres", type: "number" }, + }, + }, + LandSurfaceResponse: { + title: "LandSurfaceResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/LandSurfaceResults" }, + }, + }, + LandSurfaceResults: { + title: "LandSurfaceResults", + required: ["summary"], + type: "object", + properties: { + summary: { + title: "Summary", + type: "array", + items: { $ref: "#/components/schemas/LandSurfaceSummary" }, + }, + details: { + title: "Details", + type: "array", + items: { $ref: "#/components/schemas/LandSurfaceDetails" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + LandSurfaceSummary: { + title: "LandSurfaceSummary", + required: [ + "node_id", + "area_acres", + "imp_area_acres", + "perv_area_acres", + "imp_ro_volume_cuft", + "perv_ro_volume_cuft", + "runoff_volume_cuft", + "eff_area_acres", + "land_surfaces_count", + "imp_pct", + "ro_coeff", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + area_acres: { title: "Area Acres", type: "number" }, + imp_area_acres: { title: "Imp Area Acres", type: "number" }, + perv_area_acres: { title: "Perv Area Acres", type: "number" }, + imp_ro_volume_cuft: { title: "Imp Ro Volume Cuft", type: "number" }, + perv_ro_volume_cuft: { title: "Perv Ro Volume Cuft", type: "number" }, + runoff_volume_cuft: { title: "Runoff Volume Cuft", type: "number" }, + eff_area_acres: { title: "Eff Area Acres", type: "number" }, + land_surfaces_count: { title: "Land Surfaces Count", type: "number" }, + imp_pct: { title: "Imp Pct", type: "number" }, + ro_coeff: { title: "Ro Coeff", type: "number" }, + }, + }, + LandSurfaces: { + title: "LandSurfaces", + required: ["land_surfaces"], + type: "object", + properties: { + land_surfaces: { + title: "Land Surfaces", + type: "array", + items: { $ref: "#/components/schemas/LandSurface" }, + }, + }, + }, + LowFlowFacility: { + title: "LowFlowFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + treatment_rate_cfs: { title: "Treatment Rate Cfs", type: "number" }, + design_capacity_cfs: { title: "Design Capacity Cfs", type: "number" }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + months_operational: { + title: "Months Operational", + pattern: "summer$|winter$|both$", + type: "string", + default: "both", + }, + }, + }, + NTFacility: { + title: "NTFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + NetworkValidation: { + title: "NetworkValidation", + required: ["isvalid"], + type: "object", + properties: { + isvalid: { title: "Isvalid", type: "boolean" }, + node_cycles: { + title: "Node Cycles", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + edge_cycles: { + title: "Edge Cycles", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + multiple_out_edges: { + title: "Multiple Out Edges", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + duplicate_edges: { + title: "Duplicate Edges", + type: "array", + items: { type: "array", items: { type: "string" } }, + }, + }, + }, + NetworkValidationResponse: { + title: "NetworkValidationResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/NetworkValidation" }, + }, + }, + Node: { + title: "Node", + type: "object", + properties: { + id: { title: "Id", type: "string" }, + metadata: { title: "Metadata", type: "object", default: {} }, + }, + }, + Nodes: { + title: "Nodes", + required: ["nodes"], + type: "object", + properties: { + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + }, + }, + ParallelSeriesSequence: { + title: "ParallelSeriesSequence", + required: ["parallel"], + type: "object", + properties: { + parallel: { + title: "Parallel", + type: "array", + items: { $ref: "#/components/schemas/SeriesSequence" }, + }, + }, + }, + PermPoolFacility: { + title: "PermPoolFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "pool_volume_cuft", + "pool_drawdown_time_hr", + "treatment_volume_cuft", + "treatment_drawdown_time_hr", + "winter_demand_cfs", + "summer_demand_cfs", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + pool_volume_cuft: { title: "Pool Volume Cuft", type: "number" }, + pool_drawdown_time_hr: { + title: "Pool Drawdown Time Hr", + type: "number", + }, + treatment_volume_cuft: { + title: "Treatment Volume Cuft", + type: "number", + }, + treatment_drawdown_time_hr: { + title: "Treatment Drawdown Time Hr", + type: "number", + }, + winter_demand_cfs: { title: "Winter Demand Cfs", type: "number" }, + summer_demand_cfs: { title: "Summer Demand Cfs", type: "number" }, + }, + }, + PreviousResult: { + title: "PreviousResult", + required: ["node_id"], + type: "object", + properties: { node_id: { title: "Node Id", type: "string" } }, + }, + ReferenceData: { + title: "ReferenceData", + required: ["state", "region", "file"], + type: "object", + properties: { + state: { title: "State", type: "string" }, + region: { title: "Region", type: "string" }, + file: { title: "File", type: "string" }, + filedata: { title: "Filedata" }, + }, + }, + ReferenceDataResponse: { + title: "ReferenceDataResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/ReferenceData" }, + }, + }, + Result: { + title: "Result", + required: ["node_id"], + type: "object", + properties: { node_id: { title: "Node Id", type: "string" } }, + }, + RetAndTmntFacility: { + title: "RetAndTmntFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "retention_volume_cuft", + "area_sqft", + "treatment_drawdown_time_hr", + "hsg", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + retention_volume_cuft: { + title: "Retention Volume Cuft", + type: "number", + }, + area_sqft: { title: "Area Sqft", type: "number" }, + treatment_drawdown_time_hr: { + title: "Treatment Drawdown Time Hr", + type: "number", + }, + hsg: { title: "Hsg", type: "string" }, + }, + }, + RetentionFacility: { + title: "RetentionFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "area_sqft", + "inf_rate_inhr", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + inf_rate_inhr: { title: "Inf Rate Inhr", type: "number" }, + }, + }, + SeriesSequence: { + title: "SeriesSequence", + required: ["series"], + type: "object", + properties: { + series: { + title: "Series", + type: "array", + items: { $ref: "#/components/schemas/Nodes" }, + }, + }, + }, + SolutionSequence: { + title: "SolutionSequence", + required: ["solution_sequence"], + type: "object", + properties: { + solution_sequence: { + $ref: "#/components/schemas/ParallelSeriesSequence", + }, + }, + }, + SolutionSequenceResponse: { + title: "SolutionSequenceResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/SolutionSequence" }, + }, + }, + SubgraphNodes: { + title: "SubgraphNodes", + required: ["subgraph_nodes"], + type: "object", + properties: { + subgraph_nodes: { + title: "Subgraph Nodes", + type: "array", + items: { $ref: "#/components/schemas/Nodes" }, + }, + }, + }, + SubgraphRequest: { + title: "SubgraphRequest", + required: ["graph", "nodes"], + type: "object", + properties: { + graph: { $ref: "#/components/schemas/Graph" }, + nodes: { + title: "Nodes", + type: "array", + items: { $ref: "#/components/schemas/Node" }, + }, + }, + }, + SubgraphResponse: { + title: "SubgraphResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/SubgraphNodes" }, + }, + }, + TmntFacility: { + title: "TmntFacility", + required: [ + "node_id", + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + "total_volume_cuft", + "area_sqft", + "media_filtration_rate_inhr", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + ref_data_key: { title: "Ref Data Key", type: "string" }, + design_storm_depth_inches: { + title: "Design Storm Depth Inches", + exclusiveMinimum: 0.0, + type: "number", + }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + is_online: { title: "Is Online", type: "boolean", default: true }, + tributary_area_tc_min: { + title: "Tributary Area Tc Min", + maximum: 60.0, + type: "number", + default: 5.0, + }, + offline_diversion_rate_cfs: { + title: "Offline Diversion Rate Cfs", + type: "number", + }, + total_volume_cuft: { title: "Total Volume Cuft", type: "number" }, + area_sqft: { title: "Area Sqft", type: "number" }, + media_filtration_rate_inhr: { + title: "Media Filtration Rate Inhr", + type: "number", + }, + }, + }, + TreatmentFacilities: { + title: "TreatmentFacilities", + required: ["treatment_facilities"], + type: "object", + properties: { + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { type: "object" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + example: { + treatment_facilities: [ + { + node_id: "1", + facility_type: "no_treatment", + ref_data_key: "10101200", + design_storm_depth_inches: 1.45, + }, + { + node_id: "1", + facility_type: "dry_extended_detention", + ref_data_key: "10101200", + design_storm_depth_inches: 1.05, + is_online: true, + tributary_area_tc_min: 30, + total_volume_cuft: 5500, + retention_volume_cuft: 4400, + area_sqft: 1600, + treatment_drawdown_time_hr: 72, + hsg: "d", + offline_diversion_rate_cfs: 2.9, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "infiltration", + ref_data_key: "10101200", + design_storm_depth_inches: 0.88, + is_online: true, + tributary_area_tc_min: 25, + total_volume_cuft: 6200, + area_sqft: 2000, + inf_rate_inhr: 3.5, + offline_diversion_rate_cfs: 5, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "bioretention", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + is_online: true, + tributary_area_tc_min: 15, + total_volume_cuft: 5800, + retention_volume_cuft: 3500, + area_sqft: 1300, + media_filtration_rate_inhr: 12, + hsg: "a", + offline_diversion_rate_cfs: 6, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "biofiltration", + ref_data_key: "10101200", + design_storm_depth_inches: 0.95, + is_online: true, + tributary_area_tc_min: 40, + total_volume_cuft: 4400, + area_sqft: 1200, + media_filtration_rate_inhr: 15, + offline_diversion_rate_cfs: 6, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "wet_detention", + ref_data_key: "10101200", + design_storm_depth_inches: 0.78, + is_online: true, + tributary_area_tc_min: 45, + pool_volume_cuft: 5550, + pool_drawdown_time_hr: 720, + treatment_volume_cuft: 2500, + treatment_drawdown_time_hr: 12, + winter_demand_cfs: 0.05, + summer_demand_cfs: 0.88, + offline_diversion_rate_cfs: 4, + eliminate_all_dry_weather_flow_override: false, + }, + { + node_id: "1", + facility_type: "sand_filter", + ref_data_key: "10101200", + design_storm_depth_inches: 0.78, + total_volume_cuft: 5000, + area_sqft: 2700, + media_filtration_rate_inhr: 12, + is_online: true, + offline_diversion_rate_cfs: 2.1, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 20, + }, + { + node_id: "1", + facility_type: "swale", + ref_data_key: "10101200", + design_storm_depth_inches: 1.0, + treatment_rate_cfs: 0.55, + area_sqft: 15600, + depth_ft: 1.5, + hsg: "b", + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 25, + }, + { + node_id: "1", + facility_type: "hydrodynamic_separator", + ref_data_key: "10101200", + design_storm_depth_inches: 1.12, + treatment_rate_cfs: 0.2, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 50, + is_online: true, + }, + { + node_id: "1", + facility_type: "dry_well", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + total_volume_cuft: 800, + treatment_rate_cfs: 0.5, + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 5, + }, + { + node_id: "1", + facility_type: "cistern", + ref_data_key: "10101200", + design_storm_depth_inches: 1.3, + total_volume_cuft: 5500, + winter_demand_cfs: 0.05, + summer_demand_cfs: 0.25, + is_online: true, + offline_diversion_rate_cfs: 0.5, + eliminate_all_dry_weather_flow_override: false, + tributary_area_tc_min: 55, + }, + { + node_id: "1", + facility_type: "dry_weather_diversion", + ref_data_key: "10101200", + design_storm_depth_inches: 1.43, + design_capacity_cfs: 3.5, + months_operational: "summer", + tributary_area_tc_min: 30, + treatment_rate_cfs: 2.92, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + { + node_id: "1", + facility_type: "dry_weather_treatment", + ref_data_key: "10101200", + design_storm_depth_inches: 1.32, + design_capacity_cfs: 6.1, + months_operational: "summer", + tributary_area_tc_min: 10, + treatment_rate_cfs: 3.5, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + { + node_id: "1", + facility_type: "low_flow_facility", + ref_data_key: "10101200", + design_storm_depth_inches: 0.91, + design_capacity_cfs: 5.1, + months_operational: "summer", + tributary_area_tc_min: 20, + treatment_rate_cfs: 5.0, + eliminate_all_dry_weather_flow_override: false, + is_online: true, + }, + ], + }, + }, + TreatmentFacilitiesResponse: { + title: "TreatmentFacilitiesResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/TreatmentFacilities" }, + }, + }, + TreatmentFacilitiesStrict: { + title: "TreatmentFacilitiesStrict", + required: ["treatment_facilities"], + type: "object", + properties: { + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { + anyOf: [ + { $ref: "#/components/schemas/PermPoolFacility" }, + { $ref: "#/components/schemas/RetAndTmntFacility" }, + { $ref: "#/components/schemas/BioInfFacility" }, + { $ref: "#/components/schemas/FlowAndRetFacility" }, + { $ref: "#/components/schemas/RetentionFacility" }, + { $ref: "#/components/schemas/TmntFacility" }, + { $ref: "#/components/schemas/CisternFacility" }, + { $ref: "#/components/schemas/DryWellFacility" }, + { + $ref: "#/components/schemas/DryWeatherTreatmentLowFlowFacility", + }, + { + $ref: "#/components/schemas/DryWeatherDiversionLowFlowFacility", + }, + { $ref: "#/components/schemas/LowFlowFacility" }, + { $ref: "#/components/schemas/FlowFacility" }, + { $ref: "#/components/schemas/NTFacility" }, + ], + }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + TreatmentSite: { + title: "TreatmentSite", + required: [ + "node_id", + "facility_type", + "area_pct", + "captured_pct", + "retained_pct", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + area_pct: { title: "Area Pct", type: "number" }, + captured_pct: { title: "Captured Pct", type: "number" }, + retained_pct: { title: "Retained Pct", type: "number" }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + TreatmentSiteGroup: { + title: "TreatmentSiteGroup", + required: ["node_id", "node_type", "treatment_facilities"], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + node_type: { title: "Node Type", type: "string" }, + treatment_facilities: { + title: "Treatment Facilities", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSiteGroupBase" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + }, + }, + TreatmentSiteGroupBase: { + title: "TreatmentSiteGroupBase", + required: [ + "node_id", + "facility_type", + "area_pct", + "captured_pct", + "retained_pct", + ], + type: "object", + properties: { + node_id: { title: "Node Id", type: "string" }, + facility_type: { title: "Facility Type", type: "string" }, + area_pct: { title: "Area Pct", type: "number" }, + captured_pct: { title: "Captured Pct", type: "number" }, + retained_pct: { title: "Retained Pct", type: "number" }, + eliminate_all_dry_weather_flow_override: { + title: "Eliminate All Dry Weather Flow Override", + type: "boolean", + default: false, + }, + }, + }, + TreatmentSiteGroups: { + title: "TreatmentSiteGroups", + required: ["treatment_sites"], + type: "object", + properties: { + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSiteGroup" }, + }, + }, + }, + TreatmentSiteResponse: { + title: "TreatmentSiteResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/TreatmentSiteGroups" }, + }, + }, + TreatmentSites: { + title: "TreatmentSites", + required: ["treatment_sites"], + type: "object", + properties: { + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSite" }, + }, + }, + }, + ValidationError: { + title: "ValidationError", + required: ["loc", "msg", "type"], + type: "object", + properties: { + loc: { title: "Location", type: "array", items: { type: "string" } }, + msg: { title: "Message", type: "string" }, + type: { title: "Error Type", type: "string" }, + }, + }, + Watershed: { + title: "Watershed", + required: ["graph", "land_surfaces"], + type: "object", + properties: { + graph: { $ref: "#/components/schemas/Graph" }, + land_surfaces: { + title: "Land Surfaces", + type: "array", + items: { $ref: "#/components/schemas/LandSurface" }, + }, + treatment_facilities: { + title: "Treatment Facilities", + anyOf: [ + { type: "array", items: { type: "object" } }, + { + type: "array", + items: { + anyOf: [ + { $ref: "#/components/schemas/PermPoolFacility" }, + { $ref: "#/components/schemas/RetAndTmntFacility" }, + { $ref: "#/components/schemas/BioInfFacility" }, + { $ref: "#/components/schemas/FlowAndRetFacility" }, + { $ref: "#/components/schemas/RetentionFacility" }, + { $ref: "#/components/schemas/TmntFacility" }, + { $ref: "#/components/schemas/CisternFacility" }, + { $ref: "#/components/schemas/DryWellFacility" }, + { + $ref: "#/components/schemas/DryWeatherTreatmentLowFlowFacility", + }, + { + $ref: "#/components/schemas/DryWeatherDiversionLowFlowFacility", + }, + { $ref: "#/components/schemas/LowFlowFacility" }, + { $ref: "#/components/schemas/FlowFacility" }, + { $ref: "#/components/schemas/NTFacility" }, + ], + }, + }, + ], + }, + treatment_sites: { + title: "Treatment Sites", + type: "array", + items: { $ref: "#/components/schemas/TreatmentSite" }, + }, + previous_results: { + title: "Previous Results", + type: "array", + items: { $ref: "#/components/schemas/PreviousResult" }, + }, + }, + example: { + graph: { + directed: true, + multigraph: false, + graph: {}, + nodes: [ + { metadata: {}, id: "0" }, + { metadata: {}, id: "1" }, + { metadata: {}, id: "2" }, + { metadata: {}, id: "3" }, + { metadata: {}, id: "4" }, + { metadata: {}, id: "5" }, + { metadata: {}, id: "6" }, + ], + edges: [ + { metadata: {}, source: "1", target: "0" }, + { metadata: {}, source: "2", target: "1" }, + { metadata: {}, source: "3", target: "2" }, + { metadata: {}, source: "4", target: "2" }, + { metadata: {}, source: "5", target: "2" }, + { metadata: {}, source: "6", target: "1" }, + ], + }, + treatment_facilities: [ + { + node_id: "0", + facility_type: "sand_filter", + ref_data_key: "10101200", + design_storm_depth_inches: 0.85, + total_volume_cuft: 335, + area_sqft: 1532, + media_filtration_rate_inhr: 22.5, + constructor: "treatment_facility_constructor", + tributary_area_tc_min: 30, + is_online: true, + }, + { + node_id: "2", + facility_type: "bioretention", + ref_data_key: "10101000", + design_storm_depth_inches: 0.85, + total_volume_cuft: 382, + retention_volume_cuft: 333, + area_sqft: 2658, + media_filtration_rate_inhr: 14.6, + hsg: "a", + constructor: "bioinfiltration_facility_constructor", + tributary_area_tc_min: 55, + is_online: true, + }, + ], + treatment_sites: [ + { + facility_type: "wet_detention", + node_id: "1", + area_pct: 6, + captured_pct: 57, + retained_pct: 38, + }, + { + facility_type: "cistern", + node_id: "1", + area_pct: 80, + captured_pct: 74, + retained_pct: 49, + }, + { + facility_type: "swale", + node_id: "1", + area_pct: 0, + captured_pct: 61, + retained_pct: 44, + }, + { + facility_type: "dry_weather_diversion", + node_id: "1", + area_pct: 12, + captured_pct: 80, + retained_pct: 56, + }, + { + facility_type: "dry_extended_detention", + node_id: "1", + area_pct: 1, + captured_pct: 40, + retained_pct: 0, + }, + { + facility_type: "infiltration", + node_id: "1", + area_pct: 1, + captured_pct: 73, + retained_pct: 59, + }, + ], + land_surfaces: [ + { + node_id: "3", + surface_key: "10101000-RESSFH-rock-5", + area_acres: 0.3984569310124453, + imp_area_acres: 0.009673489252693119, + }, + { + node_id: "3", + surface_key: "10101100-RESSFH-D-0", + area_acres: 8.065001059380828, + imp_area_acres: 2.16741977121951, + }, + { + node_id: "3", + surface_key: "10101100-EDU-D-5", + area_acres: 2.5839358997133957, + imp_area_acres: 2.55343628659585, + }, + { + node_id: "3", + surface_key: "10101100-UTIL-A-5", + area_acres: 4.312089428850966, + imp_area_acres: 4.131205425493061, + }, + { + node_id: "3", + surface_key: "10101200-RESSFL-D-5", + area_acres: 3.9337442224446297, + imp_area_acres: 0.7661658366327859, + }, + { + node_id: "4", + surface_key: "10101200-COMM-A-0", + area_acres: 0.28767325522239817, + imp_area_acres: 0.08026707777353169, + }, + { + node_id: "4", + surface_key: "10101200-TRANS-rock-10", + area_acres: 6.9571538459344495, + imp_area_acres: 1.2273914932176564, + }, + { + node_id: "4", + surface_key: "10101200-OSLOW-rock-0", + area_acres: 2.403387703304852, + imp_area_acres: 0.9959985713261311, + }, + { + node_id: "4", + surface_key: "10101200-OSWET-D-5", + area_acres: 2.79314881649118, + imp_area_acres: 0.15499820430359323, + }, + { + node_id: "4", + surface_key: "10101100-OSFOR-D-5", + area_acres: 2.905930886150414, + imp_area_acres: 1.4925738336538064, + }, + { + node_id: "4", + surface_key: "10101000-TRANS-A-5", + area_acres: 9.350620373618705, + imp_area_acres: 5.232513213963891, + }, + { + node_id: "4", + surface_key: "10101200-COMM-C-0", + area_acres: 2.1979646924219196, + imp_area_acres: 0.2053466380605771, + }, + { + node_id: "4", + surface_key: "10101000-OSWET-D-0", + area_acres: 9.316054897695937, + imp_area_acres: 8.379096506045641, + }, + { + node_id: "4", + surface_key: "10101200-TRFWY-A-0", + area_acres: 1.4272661923917718, + imp_area_acres: 1.2613822514526472, + }, + { + node_id: "4", + surface_key: "10101200-OSDEV-C-10", + area_acres: 4.221871721446085, + imp_area_acres: 0.4549400198109034, + }, + { + node_id: "4", + surface_key: "10101100-RESSFH-C-0", + area_acres: 0.26360615441130775, + imp_area_acres: 0.13605449920172205, + }, + { + node_id: "4", + surface_key: "10101000-OSDEV-D-5", + area_acres: 7.289650539203478, + imp_area_acres: 6.077668638347337, + }, + { + node_id: "5", + surface_key: "10101000-IND-A-10", + area_acres: 4.930498275495615, + imp_area_acres: 4.450757471699112, + }, + { + node_id: "5", + surface_key: "10101200-OSLOW-rock-0", + area_acres: 7.814106399568224, + imp_area_acres: 1.078526163782842, + }, + { + node_id: "5", + surface_key: "10101200-RESSFL-D-5", + area_acres: 6.185417372804003, + imp_area_acres: 5.76250105686173, + }, + { + node_id: "5", + surface_key: "10101200-OSIRR-water-10", + area_acres: 0.36715726648133273, + imp_area_acres: 0.23531606583046188, + }, + { + node_id: "5", + surface_key: "10101200-RESMF-D-5", + area_acres: 5.3935429017017515, + imp_area_acres: 3.810512599072686, + }, + { + node_id: "5", + surface_key: "10101100-RESSFH-A-5", + area_acres: 2.3620796715469004, + imp_area_acres: 1.870944109794398, + }, + { + node_id: "5", + surface_key: "10101200-WATER-A-10", + area_acres: 5.506805596166197, + imp_area_acres: 2.0512411750860533, + }, + { + node_id: "5", + surface_key: "10101200-TRFWY-A-5", + area_acres: 2.2549267594382885, + imp_area_acres: 0.059337765905655114, + }, + { + node_id: "5", + surface_key: "10101200-EDU-A-5", + area_acres: 6.945443095820329, + imp_area_acres: 2.426366435613679, + }, + { + node_id: "5", + surface_key: "10101100-IND-D-0", + area_acres: 3.8291536983619254, + imp_area_acres: 2.4237194475207304, + }, + { + node_id: "5", + surface_key: "10101000-RESSFH-D-10", + area_acres: 4.720854566650611, + imp_area_acres: 1.9563886575871627, + }, + { + node_id: "5", + surface_key: "10101000-EDU-C-10", + area_acres: 1.7804423698966843, + imp_area_acres: 0.3371318723066817, + }, + { + node_id: "6", + surface_key: "10101200-TRANS-D-0", + area_acres: 2.2754330855140923, + imp_area_acres: 1.0211331313414405, + }, + { + node_id: "6", + surface_key: "10101100-OSLOW-D-5", + area_acres: 6.214500618686376, + imp_area_acres: 0.6340460489422389, + }, + { + node_id: "6", + surface_key: "10101100-UTIL-A-10", + area_acres: 2.555615240745477, + imp_area_acres: 2.131208949421928, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-A-5", + area_acres: 8.175748802007071, + imp_area_acres: 1.8980919101830314, + }, + { + node_id: "6", + surface_key: "10101200-RESSFH-A-0", + area_acres: 3.860268456910725, + imp_area_acres: 1.9184629017741963, + }, + { + node_id: "6", + surface_key: "10101200-OSDEV-C-5", + area_acres: 0.5748050245941472, + imp_area_acres: 0.1411875823737466, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-0", + area_acres: 7.945535238259879, + imp_area_acres: 0.6302494865328522, + }, + { + node_id: "6", + surface_key: "10101000-RESMF-D-0", + area_acres: 6.915337959629758, + imp_area_acres: 3.162694892687792, + }, + { + node_id: "6", + surface_key: "10101000-IND-A-5", + area_acres: 5.262089934922299, + imp_area_acres: 0.012019588367122497, + }, + { + node_id: "6", + surface_key: "10101200-EDU-D-10", + area_acres: 9.142141560695912, + imp_area_acres: 8.229015560695975, + }, + { + node_id: "6", + surface_key: "10101200-OSAGIR-A-10", + area_acres: 1.1171651349206269, + imp_area_acres: 0.5990037582520297, + }, + { + node_id: "6", + surface_key: "10101100-OSAGIR-C-0", + area_acres: 3.304545692925136, + imp_area_acres: 0.36222350149989435, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-0", + area_acres: 9.63416946726306, + imp_area_acres: 7.1542071673930625, + }, + { + node_id: "6", + surface_key: "10101100-OSLOW-D-0", + area_acres: 4.8579106327541695, + imp_area_acres: 0.25541389152635474, + }, + { + node_id: "6", + surface_key: "10101200-OSDEV-C-5", + area_acres: 6.798391444820259, + imp_area_acres: 2.2112485428708193, + }, + { + node_id: "6", + surface_key: "10101000-RESSFH-D-10", + area_acres: 3.4948300942486963, + imp_area_acres: 3.233078107164885, + }, + { + node_id: "6", + surface_key: "10101000-OSAGIR-A-10", + area_acres: 3.6289953644281625, + imp_area_acres: 0.38263683466075843, + }, + { + node_id: "6", + surface_key: "10101100-OSDEV-D-0", + area_acres: 5.376760581619445, + imp_area_acres: 4.5257872671756365, + }, + ], + }, + }, + WatershedResponse: { + title: "WatershedResponse", + type: "object", + properties: { + status: { title: "Status", type: "string", default: "SUCCESS" }, + task_id: { title: "Task Id", type: "string" }, + result_route: { title: "Result Route", type: "string" }, + data: { $ref: "#/components/schemas/WatershedResults" }, + }, + }, + WatershedResults: { + title: "WatershedResults", + type: "object", + properties: { + results: { + title: "Results", + type: "array", + items: { $ref: "#/components/schemas/Result" }, + }, + leaf_results: { + title: "Leaf Results", + type: "array", + items: { $ref: "#/components/schemas/Result" }, + }, + previous_results_keys: { + title: "Previous Results Keys", + type: "array", + items: { type: "string" }, + }, + errors: { title: "Errors", type: "array", items: { type: "string" } }, + warnings: { + title: "Warnings", + type: "array", + items: { type: "string" }, + }, + }, + }, + }, + }, +}; diff --git a/nereid/nereid/static/frontend/src/js/lib/pubsub.js b/nereid/nereid/static/frontend/src/js/lib/pubsub.js new file mode 100644 index 00000000..60b2140b --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/pubsub.js @@ -0,0 +1,56 @@ +import store from "./state.js"; + +export default class PubSub { + constructor() { + this.events = {}; + } + + /** + * Either create a new event instance for passed `event` name + * or push a new callback into the existing collection + * + * @param {string} event + * @param {function} callback + * @returns {boolean} + * @memberof PubSub + */ + subscribe(event, callback) { + let self = this; + + // If there's not already an event with this name set in our collection + // go ahead and create a new one and set it with an empty array, so we don't + // have to type check it later down-the-line + if (!self.events.hasOwnProperty(event)) { + self.events[event] = []; + } + + // We know we've got an array for this event, so push our callback in there with no fuss + self.events[event].push(callback); + return true; + } + + /** + * If the passed event has callbacks attached to it, loop through each one + * and call it + * + * @param {string} event + * @param {object} [data={}] + * @returns {boolean} + * @memberof PubSub + */ + publish(event, data = {}) { + let self = this; + if (store.state.DEBUG) console.log("published event: ", event); + + // There's no event to publish to, so bail out + if (!self.events.hasOwnProperty(event)) { + if (store.state.DEBUG) console.log(`no subscribers for event ${event}`); + self.events[event] = []; + return false; + } + + // Get each subscription and call its callback with the passed data + self.events[event].map((callback) => callback(data)); + return true; + } +} diff --git a/nereid/nereid/static/frontend/src/js/lib/state.js b/nereid/nereid/static/frontend/src/js/lib/state.js new file mode 100644 index 00000000..380a81ab --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/state.js @@ -0,0 +1,94 @@ +import Store from "./store.js"; + +const state = { + DEBUG: false, + config: {}, + scenario_name: "New Scenario", + nereid_host: "", + nereid_api_latest: "/api/v1", + nereid_state: "state", + nereid_region: "region", + facility_types: [], + facility_type_map: {}, + initialScale: 1 << 20, + initialCenter: [-116.9337, 32.74337], + staged_changes: {}, + default_nodesize: 20, + max_graph_size: 100, + map_mode: true, + show_states: true, + graph_edit_mode: true, + show_info_tooltip: true, + treatment_facility_fields: { + state: { + region: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: ["facility_type"], + }, + }, + ca: { + cosd: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: [ + "facility_type", + "ref_data_key", + "design_storm_depth_inches", + ], + }, + soc: { + ignored: [ + "is_online", + "offline_diversion_rate_cfs", + "eliminate_all_dry_weather_flow_override", + ], + disabled: ["facility_type"], + }, + }, + }, + node_types: { + land_surface: { + title: "Land Surface", + color: "limegreen", + }, + treatment_facility: { + title: "Treatment Facility", + color: "steelblue", + }, + treatment_site: { + title: "Treatment Site", + color: "orangered", + disabled: true, + }, + none: { + title: "None", + color: "dimgrey", + }, + }, + default_graph: { + nodes: [ + { + id: "0", + node_type: "treatment_facility", + }, + { + id: "1", + node_type: "land_surface", + }, + ], + edges: [{ source: "1", target: "0" }], + }, +}; + +export default new Store({ + // actions, + // mutations, + state, +}); diff --git a/nereid/nereid/static/frontend/src/js/lib/store.js b/nereid/nereid/static/frontend/src/js/lib/store.js new file mode 100644 index 00000000..c77d1c96 --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/store.js @@ -0,0 +1,138 @@ +import PubSub from "./pubsub.js"; +import store from "./state.js"; + +export default class Store { + constructor(params) { + let self = this; + + // Add some default objects to hold our actions, mutations and state + self.actions = {}; + self.mutations = {}; + self.state = {}; + + // A status enum to set during actions and mutations + self.status = "resting"; + + // Attach our PubSub module as an `events` element + self.events = new PubSub(); + + // Look in the passed params object for actions and mutations + // that might have been passed in + // if (params.hasOwnProperty("actions")) { + // self.actions = params.actions; + // } + + // if (params.hasOwnProperty("mutations")) { + // self.mutations = params.mutations; + // } + + // Set our state to be a Proxy. We are setting the default state by + // checking the params and defaulting to an empty object if no default + // state is passed in + self.state = new Proxy(params.state || {}, { + set: function (state, key, value) { + // console.log("status:", self.status); + // Set the value as we would normally + state[key] = value; + + // Trace out to the console. This will be grouped by the related action + if (store.state.DEBUG) console.log(`stateChange: ${key}`, value); + + // Give the user a little telling off if they set a value directly + if (self.status !== "mutation") { + if (store.state.DEBUG) + console.warn(`You should use a mutation to set ${key}`); + // Publish the change event for the components that are listening + self.events.publish("stateChange", self.state); + } + + // console.log(state); + + return true; + }, + }); + } + + /** + * A dispatcher for actions that looks in the actions + * collection and runs the action if it can find it + * + * @param {string} actionKey + * @param {mixed} payload + * @returns {boolean} + * @memberof Store + */ + dispatch(actionKey, payload) { + let self = this; + + // console.log("status:", self.status); + + // Run a quick check to see if the action actually exists + // before we try to run it + if (typeof self.actions[actionKey] !== "function") { + if (store.state.DEBUG) console.log(`Action "${actionKey} doesn't exist.`); + // return false; + self.actions[actionKey] = (context, payload) => { + context.commit(actionKey, payload); + }; + } + + // Create a console group which will contain the logs from our Proxy etc + if (store.state.DEBUG) console.groupCollapsed(`ACTION: ${actionKey}`); + + // Let anything that's watching the status know that we're dispatching an action + self.status = "action"; + + // Actually call the action and pass it the Store context and whatever payload was passed + self.actions[actionKey](self, payload); + + // Close our console group to keep things nice and neat + if (store.state.DEBUG) console.groupEnd(); + + return true; + } + + /** + * Look for a mutation and modify the state object + * if that mutation exists by calling it + * + * @param {string} mutationKey + * @param {mixed} payload + * @returns {boolean} + * @memberof Store + */ + commit(mutationKey, payload) { + let self = this; + // console.log("status:", self.status); + + // Run a quick check to see if this mutation actually exists + // before trying to run it + if (typeof self.mutations[mutationKey] !== "function") { + if (store.state.DEBUG) + console.log(`Mutation "${mutationKey}" doesn't exist`); + // return false; + + self.mutations[mutationKey] = (_, payload) => payload; + } + + // Let anything that's watching the status know that we're mutating state + self.status = "mutation"; + + // Get a new version of the state by running the mutation and storing the result of it + let newState = self.mutations[mutationKey](self.state, payload); + + // Merge the old and new together to create a new state and set it + self.state = Object.assign(self.state, newState); + + // Publish the change event for the components that are listening + self.events.publish("stateChange", self.state); + + // Publish the mutation event for the components that are listening + self.events.publish(mutationKey, self.state); + + // Reset the status ready for the next operation + self.status = "resting"; + + return true; + } +} diff --git a/nereid/nereid/static/frontend/src/js/lib/util.js b/nereid/nereid/static/frontend/src/js/lib/util.js new file mode 100644 index 00000000..cc5682fb --- /dev/null +++ b/nereid/nereid/static/frontend/src/js/lib/util.js @@ -0,0 +1,209 @@ +import store from "./state.js"; +import { getConfig } from "./nereid-api.js"; + +export const get = (object, path = "") => + path.split(".").reduce((o, x) => (o == undefined ? o : o[x]), object); + +export const getTruthy = (obj, path = "") => { + let m = get(obj, path); + return m === undefined ? false : m; +}; + +// https://stackoverflow.com/a/1349426/7486933 +export function randomString(length) { + let result = ""; + let characters = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + let charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; +} + +export const filter = (obj, includes = [], excludes = []) => { + const filtered = Object.keys(obj) + .filter((key) => (includes.length ? includes.includes(key) : true)) + .filter((key) => !excludes.includes(key)) + .reduce((newobj, key) => { + return { + ...newobj, + [key]: obj[key], + }; + }, {}); + return filtered; +}; + +export function cleanObject(obj) { + return Object.entries(obj) + .filter(([_, v]) => v != "" && v != null) + .reduce( + (acc, [k, v]) => ({ ...acc, [k]: v === Object(v) ? cleanObject(v) : v }), + {} + ); +} + +export function deepCopy(object) { + return JSON.parse(JSON.stringify(object)); +} + +export function mean(array) { + return array.length + ? array.reduce((a, b) => a + b) / array.length + : undefined; +} + +export function flatten(a) { + return Array.isArray(a) ? [].concat(...a.map(flatten)) : a; +} + +export const incr_waiting = () => { + let v = (get(store, "state.waiting") || 0) + 1; + store.dispatch("Waiting", { waiting: v }); +}; + +export const decr_waiting = () => { + let v = (get(store, "state.waiting") || 0) - 1; + if (v < 0) { + console.error("waiting counter is negative"); + v = 0; + } + store.dispatch("Waiting", { waiting: v }); +}; + +// fetch API wrappers for json retrieval + +export async function getJsonResponse(url) { + console.log("fetching with get", url); + incr_waiting(); + const response = await fetch(url, { method: "GET" }) + // .catch((error) => { + // alert(error); + // return {}; + // }) + .then((resp) => { + console.log("getJsonResponse response:", resp); + if (resp.status == 200) { + return resp.json(); + } else if (resp.status == 422) { + // unprocessable entity + // alert(`Unprocessable data from get ${resp.json()}`); + // console.warn(resp.json()); + return resp.json(); + } else { + throw new Error("got back " + resp.content); + } + }) + .then((data) => { + console.log("getJsonResponse data returned:", data); + return data; + }) + .finally(decr_waiting); + + return response; +} + +export async function postJsonResponse(url, data) { + console.log("fetching with post", url, data); + incr_waiting(); + + const response = await fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(data), + }) + .then((resp) => { + console.log("postJsonResponse response:", resp); + if (resp.status == 200) { + return resp.json(); + } else if (resp.status == 422) { + // alert(`Unprocessable data from post ${resp.json()}`); + return resp.json(); + } else { + throw new Error("got back " + resp); + } + }) + .then((data) => { + console.log("postJsonResponse data returned:", data); + return data; + }) + .finally(decr_waiting); + return response; +} + +export const poll = ({ fn, validate, interval, maxAttempts }) => { + console.log("Start poll..."); + let attempts = 0; + + const executePoll = async (resolve, reject) => { + console.log("- poll"); + const result = await fn(); + attempts++; + + if (validate(result)) { + return resolve(result); + } else if (maxAttempts && attempts === maxAttempts) { + return reject(new Error("Exceeded max attempts")); + } else { + setTimeout(executePoll, interval, resolve, reject); + } + }; + + return new Promise(executePoll); +}; + +export function convertArrayOfObjectsToCSV(args) { + var result, ctr, keys, columnDelimiter, lineDelimiter, data; + + data = args.data || null; + if (data == null || !data.length) { + return null; + } + + columnDelimiter = args.columnDelimiter || ","; + lineDelimiter = args.lineDelimiter || "\n"; + + keys = args.keys || Object.keys(data[0]); + + result = ""; + result += keys + .map((x) => (String(x).includes(",") ? `"${x}"` : `${x}`)) + .join(columnDelimiter); + result += lineDelimiter; + + data.forEach(function (item) { + ctr = 0; + keys.forEach(function (key) { + if (ctr > 0) result += columnDelimiter; + + const value = String(item[key]); + + if (value.includes(",")) { + result += `"${value}"`; + } else { + result += `${value}`; + } + ctr++; + }); + result += lineDelimiter; + }); + + return result; +} + +export const getConfigFromUrlQueryParams = async () => { + const params = new URLSearchParams(window.location.search); + + let { state, region } = Object.fromEntries(params.entries()); + + const cfg = await getConfig({ + nereid_state: state || store.state.nereid_state, + nereid_region: region || store.state.nereid_region, + }); + store.dispatch("updateConfig", cfg); + console.log(cfg); + + return false; +}; diff --git a/nereid/nereid/static/frontend/tailwind.config.js b/nereid/nereid/static/frontend/tailwind.config.js new file mode 100644 index 00000000..98094f98 --- /dev/null +++ b/nereid/nereid/static/frontend/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./src/**/*.html", "./src/**/*.js"], + theme: { + extend: { + translate: { + double: "200%", + triple: "300%", + quad: "400%", + pent: "500%", + sext: "600%", + sept: "700%", + octa: "800%", + }, + }, + }, + plugins: [require("@tailwindcss/typography")], +}; diff --git a/nereid/nereid/static/frontend/vite.config.js b/nereid/nereid/static/frontend/vite.config.js new file mode 100644 index 00000000..7dc4cf45 --- /dev/null +++ b/nereid/nereid/static/frontend/vite.config.js @@ -0,0 +1,22 @@ +import { defineConfig, splitVendorChunkPlugin } from "vite"; +// import nodePolyfills from "rollup-plugin-polyfill-node"; +import analyze from "rollup-plugin-analyzer"; + +export default defineConfig({ + // plugins: [react()], + root: "src", + base: "/app", // makes assets relative rather than absolute + plugins: [splitVendorChunkPlugin()], + build: { + outDir: "../dist", + emptyOutDir: true, + rollupOptions: { + plugins: [ + // Enable rollup polyfills plugin + // used during production bundling + // nodePolyfills({ include: null }), + // analyze({ limit: 20 }), + ], + }, + }, +});