diff --git a/DESCRIPTION b/DESCRIPTION index 14282da..41e7954 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,6 +7,7 @@ Authors@R: person(given = "Florian", family = "Rupprecht", email = "floruppr@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-1795-8624")), person(given = "Kun", family = "Ren", role = "ctb", email = "mail@renkun.me"), person("Jeroen", "Ooms", role = c("ctb"), email = "jeroen@berkeley.edu", comment = c(ORCID = "0000-0002-4035-0289")) + ,person(given = "Bill", family = "Evans", role = "ctb", email = "Bill@8PawExpress.com") ) Description: A graphics device for R that is accessible via network protocols. This package was created to make it easier to embed live R graphics in diff --git a/NAMESPACE b/NAMESPACE index d49d6b4..0b10e9e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -5,6 +5,7 @@ export(hgd_browse) export(hgd_close) export(hgd_details) export(hgd_generate_token) +export(hgd_title) export(hgd_url) export(hgd_view) export(hgd_watch) diff --git a/R/cpp11.R b/R/cpp11.R index db4fd58..895b143 100644 --- a/R/cpp11.R +++ b/R/cpp11.R @@ -1,13 +1,17 @@ # Generated by cpp11: do not edit by hand -httpgd_ <- function(devnum, host, port, cors, token, silent, wwwpath) { - .Call(`_httpgd_httpgd_`, devnum, host, port, cors, token, silent, wwwpath) +httpgd_ <- function(devnum, host, port, cors, token, silent, wwwpath, title) { + .Call(`_httpgd_httpgd_`, devnum, host, port, cors, token, silent, wwwpath, title) } httpgd_details_ <- function(devnum) { .Call(`_httpgd_httpgd_details_`, devnum) } +httpgd_title_ <- function(devnum, title) { + .Call(`_httpgd_httpgd_title_`, devnum, title) +} + httpgd_random_token_ <- function(len) { .Call(`_httpgd_httpgd_random_token_`, len) } diff --git a/R/httpgd.R b/R/httpgd.R index 3c39f40..b78cb88 100644 --- a/R/httpgd.R +++ b/R/httpgd.R @@ -44,6 +44,9 @@ #' @param reset_par If set to `TRUE`, global graphics parameters will be saved #' on device start and reset every time the plots are cleared (see #' [graphics::par()]). +#' @param title Document title shown in the browser tab of connected web +#' clients. Useful to tell multiple R processes apart. Can be changed later +#' with [hgd_title()]. #' #' @return No return value, called to initialize graphics device. #' @@ -75,7 +78,8 @@ hgd <- pointsize = getOption("httpgd.pointsize", 12), system_fonts = getOption("httpgd.system_fonts", list()), user_fonts = getOption("httpgd.user_fonts", list()), - reset_par = getOption("httpgd.reset_par", FALSE)) { + reset_par = getOption("httpgd.reset_par", FALSE), + title = getOption("httpgd.title", "httpgd")) { udev <- ugd( width / zoom, height / zoom, @@ -92,7 +96,8 @@ hgd <- port = port, cors = cors, token = token, - silent = silent + silent = silent, + title = title )) { dev.off(which = udev) stop("Failed to start server. (Port might be in use.)") @@ -104,7 +109,8 @@ hgd_attach <- function(which = dev.cur(), port = getOption("httpgd.port", 0), cors = getOption("httpgd.cors", FALSE), token = getOption("httpgd.token", TRUE), - silent = getOption("httpgd.silent", FALSE)) { + silent = getOption("httpgd.silent", FALSE), + title = getOption("httpgd.title", "httpgd")) { tok <- if (is.character(token)) { token } else if (is.numeric(token)) { @@ -122,7 +128,8 @@ hgd_attach <- function(which = dev.cur(), cors, tok, silent, - wwwpath = system.file("www", package = "httpgd") + wwwpath = system.file("www", package = "httpgd"), + title = title ) if (attached && !silent) { @@ -152,6 +159,7 @@ hgd_print_welcome <- function(which) { #' `$host`: Server hostname, #' `$port`: Server port, #' `$token`: Security token, +#' `$title`: Browser tab title (see [hgd_title()]), #' `$hsize`: Plot history size (how many plots are accessible), #' `$upid`: Update ID (changes when the device has received new information), #' `$active`: Is the device the currently activated device. @@ -174,6 +182,42 @@ hgd_details <- function(which = dev.cur()) { httpgd_details_(which) } +#' Get or set the browser tab title of a httpgd device. +#' +#' Sets the document title shown in the browser tab of web clients connected +#' to a httpgd graphics device. Connected clients are updated immediately, +#' without having to reload the page. The initial title can be set with the +#' `title` argument of [hgd()]. When called without a `title` argument, the +#' current title is returned. +#' This function will only work after starting a device with [hgd()]. +#' +#' @param title New title string. If missing, the current title is returned. +#' @param which Which device (ID). +#' +#' @return The current title (when `title` is missing), otherwise the new +#' `title`, invisibly. +#' +#' @importFrom grDevices dev.cur +#' @export +#' +#' @examples +#' \dontrun{ +#' +#' hgd(title = "Analysis A") +#' hgd_title("Analysis B") # connected clients update immediately +#' hgd_title() # returns "Analysis B" +#' +#' dev.off() +#' } +hgd_title <- function(title, which = dev.cur()) { + if (missing(title)) { + return(hgd_details(which)$title) + } + stopifnot(is.character(title), length(title) == 1, !is.na(title)) + httpgd_title_(which, title) + invisible(title) +} + build_http_query <- function(x) { a <- unlist(lapply(x, function(p) { diff --git a/client/src/App.svelte b/client/src/App.svelte index 0a7ffeb..06c40b1 100644 --- a/client/src/App.svelte +++ b/client/src/App.svelte @@ -23,6 +23,10 @@ let connection: Connection; let deviceInactiveTimer: ReturnType | undefined; + $effect(() => { + document.title = plotsStore.title; + }); + onMount(() => { const params = parseConnectionParams(); plotsStore.configure(params.host, params.token); @@ -64,6 +68,9 @@ onRenderersChanged(renderers) { connectionStore.setRenderers(renderers); }, + onTitleChanged(title) { + plotsStore.title = title; + }, }, ); diff --git a/client/src/lib/httpgd/connection.ts b/client/src/lib/httpgd/connection.ts index 0672ee6..406392c 100644 --- a/client/src/lib/httpgd/connection.ts +++ b/client/src/lib/httpgd/connection.ts @@ -20,6 +20,7 @@ export interface ConnectionCallbacks { onConnectionChanged: (connected: boolean) => void; onDeviceActiveChanged: (active: boolean) => void; onRenderersChanged: (renderers: RendererResponse[]) => void; + onTitleChanged: (title: string) => void; } export class Connection { @@ -159,6 +160,10 @@ export class Connection { this.callbacks.onDeviceActiveChanged(state.active); } + if (state.title !== undefined && (!old || old.title !== state.title)) { + this.callbacks.onTitleChanged(state.title); + } + if (!old || old.upid !== state.upid || old.hsize !== state.hsize) { this.updatePlots(); } diff --git a/client/src/lib/httpgd/types.ts b/client/src/lib/httpgd/types.ts index b02b821..32bc016 100644 --- a/client/src/lib/httpgd/types.ts +++ b/client/src/lib/httpgd/types.ts @@ -5,6 +5,7 @@ export interface StateResponse { upid: number; hsize: number; active: boolean; + title?: string; } export interface IdResponse { diff --git a/client/src/lib/stores/plots.svelte.ts b/client/src/lib/stores/plots.svelte.ts index ec6efb1..bf9128f 100644 --- a/client/src/lib/stores/plots.svelte.ts +++ b/client/src/lib/stores/plots.svelte.ts @@ -10,6 +10,7 @@ class PlotsStore { upid = $state("0"); page = $state(1); zoom = $state(SCALE_DEFAULT); + title = $state("httpgd"); host = ""; token?: string; @@ -40,6 +41,9 @@ class PlotsStore { this.plots = data.plots; this.upid = data.state.upid.toString(); this.page = data.plots.length; + if (data.state.title !== undefined) { + this.title = data.state.title; + } } getPlotImageUrl( diff --git a/inst/www/bundle.js b/inst/www/bundle.js index 81742e5..7fc9147 100644 --- a/inst/www/bundle.js +++ b/inst/www/bundle.js @@ -1,14 +1,14 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();const fi=!1;var Wi=Array.isArray,ld=Array.prototype.indexOf,Hr=Array.prototype.includes,No=Array.from,cd=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,ml=Object.getOwnPropertyDescriptors,ud=Object.prototype,dd=Array.prototype,Hi=Object.getPrototypeOf,fa=Object.isExtensible;function nn(e){return typeof e=="function"}const Q=()=>{};function fd(e){return e()}function hi(e){for(var t=0;t{e=n,t=o});return{promise:r,resolve:e,reject:t}}function hd(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const r=[];for(const n of e)if(r.push(n),r.length===t)break;return r}const Ht=2,An=4,kn=8,Ui=1<<24,je=16,be=32,cr=64,pi=128,ae=512,Lt=1024,Ut=2048,ge=4096,oe=8192,Fe=16384,Ar=32768,Be=65536,ha=1<<17,Ki=1<<18,ur=1<<19,yl=1<<20,Me=1<<25,kr=65536,gi=1<<21,ji=1<<22,er=1<<23,xe=Symbol("$state"),wl=Symbol("legacy props"),pd=Symbol(""),_r=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},_l=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function xl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function gd(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function vd(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function md(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bd(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function yd(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wd(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _d(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function xd(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Sd(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Pd(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Td(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Cd=1,Ad=2,Sl=4,kd=8,Ed=16,Od=1,Nd=2,Md=4,Id=8,Dd=16,Fd=1,Rd=2,Rt=Symbol(),Pl="http://www.w3.org/1999/xhtml",Tl="http://www.w3.org/2000/svg",Ld="http://www.w3.org/1998/Math/MathML",Cl="@attach";function zd(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Vd(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Al(e){return e===this.v}function kl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function El(e){return!kl(e,this.v)}let qr=!1,Bd=!1;function Wd(){qr=!0}let kt=null;function Ur(e){kt=e}function pa(e){return Mo().get(e)}function Hd(e,t){return Mo().set(e,t),t}function Ud(e){return Mo().has(e)}function Kd(){return Mo()}function D(e,t=!1,r){kt={p:kt,i:!1,c:null,e:null,s:e,x:null,l:qr&&!t?{s:null,u:null,$:[]}:null}}function F(e){var t=kt,r=t.e;if(r!==null){t.e=null;for(var n of r)ql(n)}return t.i=!0,kt=t.p,{}}function Zr(){return!qr||kt!==null&&kt.l===null}function Mo(e){return kt===null&&xl(),kt.c??=new Map(jd(kt)||void 0)}function jd(e){let t=e.p;for(;t!==null;){const r=t.c;if(r!==null)return r;t=t.p}return null}let xr=[];function Ol(){var e=xr;xr=[],hi(e)}function Se(e){if(xr.length===0&&!mn){var t=xr;queueMicrotask(()=>{t===xr&&Ol()})}xr.push(e)}function Gd(){for(;xr.length>0;)Ol()}function Nl(e){var t=bt;if(t===null)return mt.f|=er,e;if((t.f&Ar)===0&&(t.f&An)===0)throw e;Qe(e,t)}function Qe(e,t){for(;t!==null;){if((t.f&pi)!==0){if((t.f&Ar)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const Yd=-7169;function Mt(e,t){e.f=e.f&Yd|t}function Gi(e){(e.f&ae)!==0||e.deps===null?Mt(e,Lt):Mt(e,ge)}function Ml(e){if(e!==null)for(const t of e)(t.f&Ht)===0||(t.f&kr)===0||(t.f^=kr,Ml(t.deps))}function Il(e,t,r){(e.f&Ut)!==0?t.add(e):(e.f&ge)!==0&&r.add(e),Ml(e.deps),Mt(e,Lt)}const jn=new Set;let yt=null,io=null,de=null,Qt=[],Io=null,vi=!1,mn=!1;class Re{current=new Map;previous=new Map;#t=new Set;#e=new Set;#r=0;#n=0;#o=null;#i=new Set;#a=new Set;#s=new Map;is_fork=!1;#l=!1;#c(){return this.is_fork||this.#n>0}skip_effect(t){this.#s.has(t)||this.#s.set(t,{d:[],m:[]})}unskip_effect(t){var r=this.#s.get(t);if(r){this.#s.delete(t);for(var n of r.d)Mt(n,Ut),fe(n);for(n of r.m)Mt(n,ge),fe(n)}}process(t){Qt=[],this.apply();var r=[],n=[];for(const o of t)this.#u(o,r,n);if(this.#c()){this.#d(n),this.#d(r);for(const[o,i]of this.#s)Ll(o,i)}else{for(const o of this.#t)o();this.#t.clear(),this.#r===0&&this.#h(),io=this,yt=null,ga(n),ga(r),io=null,this.#o?.resolve()}de=null}#u(t,r,n){t.f^=Lt;for(var o=t.first;o!==null;){var i=o.f,s=(i&(be|cr))!==0,a=s&&(i&Lt)!==0,l=a||(i&oe)!==0||this.#s.has(o);if(!l&&o.fn!==null){s?o.f^=Lt:(i&An)!==0?r.push(o):In(o)&&((i&je)!==0&&this.#a.add(o),jr(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var d=o.next;if(d!==null){o=d;break}o=o.parent}}}#d(t){for(var r=0;r0){if(Dl(),yt!==null&&yt!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#h(){if(jn.size>1){this.previous.clear();var t=de,r=!0;for(const o of jn){if(o===this){r=!1;continue}const i=[];for(const[a,l]of this.current){if(o.current.has(a))if(r&&l!==o.current.get(a))o.current.set(a,l);else continue;i.push(a)}if(i.length===0)continue;const s=[...o.current.keys()].filter(a=>!this.current.has(a));if(s.length>0){var n=Qt;Qt=[];const a=new Set,l=new Map;for(const c of i)Fl(c,s,a,l);if(Qt.length>0){yt=o,o.apply();for(const c of Qt)o.#u(c,[],[]);o.deactivate()}Qt=n}}yt=null,de=t}jn.delete(this)}increment(t){this.#r+=1,t&&(this.#n+=1)}decrement(t){this.#r-=1,t&&(this.#n-=1),!this.#l&&(this.#l=!0,Se(()=>{this.#l=!1,this.#c()?Qt.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#i)this.#a.delete(t),Mt(t,Ut),fe(t);for(const t of this.#a)Mt(t,ge),fe(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#o??=bl()).promise}static ensure(){if(yt===null){const t=yt=new Re;jn.add(yt),mn||Se(()=>{yt===t&&t.flush()})}return yt}apply(){}}function Xd(e){var t=mn;mn=!0;try{for(var r;;){if(Gd(),Qt.length===0&&(yt?.flush(),Qt.length===0))return Io=null,r;Dl()}}finally{mn=t}}function Dl(){vi=!0;var e=null;try{for(var t=0;Qt.length>0;){var r=Re.ensure();if(t++>1e3){var n,o;qd()}r.process(Qt),rr.clear()}}finally{Qt=[],vi=!1,Io=null}}function qd(){try{wd()}catch(e){Qe(e,Io)}}let Oe=null;function ga(e){var t=e.length;if(t!==0){for(var r=0;r0)){rr.clear();for(const o of Oe){if((o.f&(Fe|oe))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)Oe.has(s)&&(Oe.delete(s),i.push(s)),s=s.parent;for(let a=i.length-1;a>=0;a--){const l=i[a];(l.f&(Fe|oe))===0&&jr(l)}}Oe.clear()}}Oe=null}}function Fl(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&Ht)!==0?Fl(o,t,r,n):(i&(ji|je))!==0&&(i&Ut)===0&&Rl(o,t,n)&&(Mt(o,Ut),fe(o))}}function Rl(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const o of e.deps){if(Hr.call(t,o))return!0;if((o.f&Ht)!==0&&Rl(o,t,r))return r.set(o,!0),!0}return r.set(e,!1),!1}function fe(e){var t=Io=e,r=t.b;if(r?.is_pending&&(e.f&(An|kn|Ui))!==0&&(e.f&Ar)===0){r.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var n=t.f;if(vi&&t===bt&&(n&je)!==0&&(n&Ki)===0&&(n&Ar)!==0)return;if((n&(cr|be))!==0){if((n&Lt)===0)return;t.f^=Lt}}Qt.push(t)}function Ll(e,t){if(!((e.f&be)!==0&&(e.f&Lt)!==0)){(e.f&Ut)!==0?t.d.push(e):(e.f&ge)!==0&&t.m.push(e),Mt(e,Lt);for(var r=e.first;r!==null;)Ll(r,t),r=r.next}}function Dr(e){let t=0,r=We(0),n;return()=>{Zi()&&(u(r),Ro(()=>(t===0&&(n=Bt(()=>e(()=>we(r)))),t+=1,()=>{Se(()=>{t-=1,t===0&&(n?.(),n=void 0,we(r))})})))}}var Zd=Be|ur;function Jd(e,t,r,n){new Qd(e,t,r,n)}class Qd{parent;is_pending=!1;transform_error;#t;#e=null;#r;#n;#o;#i=null;#a=null;#s=null;#l=null;#c=0;#u=0;#d=!1;#h=new Set;#p=new Set;#f=null;#g=Dr(()=>(this.#f=We(this.#c),()=>{this.#f=null}));constructor(t,r,n,o){this.#t=t,this.#r=r,this.#n=i=>{var s=bt;s.b=this,s.f|=pi,n(i)},this.parent=bt.b,this.transform_error=o??this.parent?.transform_error??(i=>i),this.#o=dr(()=>{this.#b()},Zd)}#v(){try{this.#i=te(()=>this.#n(this.#t))}catch(t){this.error(t)}}#m(t){const r=this.#r.failed;r&&(this.#s=te(()=>{r(this.#t,()=>t,()=>()=>{})}))}#_(){const t=this.#r.pending;t&&(this.is_pending=!0,this.#a=te(()=>t(this.#t)),Se(()=>{var r=this.#l=document.createDocumentFragment(),n=pe();r.append(n),this.#i=this.#w(()=>(Re.ensure(),te(()=>this.#n(n)))),this.#u===0&&(this.#t.before(r),this.#l=null,Cr(this.#a,()=>{this.#a=null}),this.#y())}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#i=te(()=>{this.#n(this.#t)}),this.#u>0){var t=this.#l=document.createDocumentFragment();rc(this.#i,t);const r=this.#r.pending;this.#a=te(()=>r(this.#t))}else this.#y()}catch(r){this.error(r)}}#y(){this.is_pending=!1;for(const t of this.#h)Mt(t,Ut),fe(t);for(const t of this.#p)Mt(t,ge),fe(t);this.#h.clear(),this.#p.clear()}defer_effect(t){Il(t,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#w(t){var r=bt,n=mt,o=kt;Te(this.#o),ce(this.#o),Ur(this.#o.ctx);try{return t()}catch(i){return Nl(i),null}finally{Te(r),ce(n),Ur(o)}}#x(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#x(t);return}this.#u+=t,this.#u===0&&(this.#y(),this.#a&&Cr(this.#a,()=>{this.#a=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(t){this.#x(t),this.#c+=t,!(!this.#f||this.#d)&&(this.#d=!0,Se(()=>{this.#d=!1,this.#f&&Kr(this.#f,this.#c)}))}get_effect_pending(){return this.#g(),u(this.#f)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(!r&&!n)throw t;this.#i&&(Vt(this.#i),this.#i=null),this.#a&&(Vt(this.#a),this.#a=null),this.#s&&(Vt(this.#s),this.#s=null);var o=!1,i=!1;const s=()=>{if(o){Vd();return}o=!0,i&&Td(),this.#s!==null&&Cr(this.#s,()=>{this.#s=null}),this.#w(()=>{Re.ensure(),this.#b()})},a=l=>{try{i=!0,r?.(l,s),i=!1}catch(c){Qe(c,this.#o&&this.#o.parent)}n&&(this.#s=this.#w(()=>{Re.ensure();try{return te(()=>{var c=bt;c.b=this,c.f|=pi,n(this.#t,()=>l,()=>s)})}catch(c){return Qe(c,this.#o.parent),null}}))};Se(()=>{var l;try{l=this.transform_error(t)}catch(c){Qe(c,this.#o&&this.#o.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>Qe(c,this.#o&&this.#o.parent)):a(l)})}}function zl(e,t,r,n){const o=Zr()?En:Yi;var i=e.filter(f=>!f.settled);if(r.length===0&&i.length===0){n(t.map(o));return}var s=bt,a=$d(),l=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(f=>f.promise)):null;function c(f){a();try{n(f)}catch(h){(s.f&Fe)===0&&Qe(h,s)}mi()}if(r.length===0){l.then(()=>c(t.map(o)));return}function d(){a(),Promise.all(r.map(f=>ef(f))).then(f=>c([...t.map(o),...f])).catch(f=>Qe(f,s))}l?l.then(d):d()}function $d(){var e=bt,t=mt,r=kt,n=yt;return function(i=!0){Te(e),ce(t),Ur(r),i&&n?.activate()}}function mi(e=!0){Te(null),ce(null),Ur(null),e&&yt?.deactivate()}function tf(){var e=bt.b,t=yt,r=e.is_rendered();return e.update_pending_count(1),t.increment(r),()=>{e.update_pending_count(-1),t.decrement(r)}}function En(e){var t=Ht|Ut,r=mt!==null&&(mt.f&Ht)!==0?mt:null;return bt!==null&&(bt.f|=ur),{ctx:kt,deps:null,effects:null,equals:Al,f:t,fn:e,reactions:null,rv:0,v:Rt,wv:0,parent:r??bt,ac:null}}function ef(e,t,r){bt===null&&gd();var o=void 0,i=We(Rt),s=!mt,a=new Map;return gf(()=>{var l=bl();o=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).finally(mi)}catch(h){l.reject(h),mi()}var c=yt;if(s){var d=tf();a.get(c)?.reject(_r),a.delete(c),a.set(c,l)}const f=(h,p=void 0)=>{if(c.activate(),p)p!==_r&&(i.f|=er,Kr(i,p));else{(i.f&er)!==0&&(i.f^=er),Kr(i,h);for(const[g,v]of a){if(a.delete(g),g===c)break;v.reject(_r)}}d&&d()};l.promise.then(f,h=>f(null,h||"unknown"))}),Fo(()=>{for(const l of a.values())l.reject(_r)}),new Promise(l=>{function c(d){function f(){d===o?l(i):c(o)}d.then(f,f)}c(o)})}function P(e){const t=En(e);return nc(t),t}function Yi(e){const t=En(e);return t.equals=El,t}function rf(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r0&&!Wl&&af()}return t}function af(){Wl=!1;for(const e of bi)(e.f&Lt)!==0&&Mt(e,ge),In(e)&&jr(e);bi.clear()}function we(e){_(e,e.v+1)}function Hl(e,t){var r=e.reactions;if(r!==null)for(var n=Zr(),o=r.length,i=0;i{if(ze===i)return a();var l=mt,c=ze;ce(null),wa(i);var d=a();return ce(l),wa(c),d};return n&&r.set("length",I(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&xd();var d=r.get(l);return d===void 0?s(()=>{var f=I(c.value);return r.set(l,f),f}):_(d,c.value,!0),!0},deleteProperty(a,l){var c=r.get(l);if(c===void 0){if(l in a){const d=s(()=>I(Rt));r.set(l,d),we(o)}}else _(c,Rt),we(o);return!0},get(a,l,c){if(l===xe)return e;var d=r.get(l),f=l in a;if(d===void 0&&(!f||tr(a,l)?.writable)&&(d=s(()=>{var p=It(f?a[l]:Rt),g=I(p);return g}),r.set(l,d)),d!==void 0){var h=u(d);return h===Rt?void 0:h}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var d=r.get(l);d&&(c.value=u(d))}else if(c===void 0){var f=r.get(l),h=f?.v;if(f!==void 0&&h!==Rt)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(a,l){if(l===xe)return!0;var c=r.get(l),d=c!==void 0&&c.v!==Rt||Reflect.has(a,l);if(c!==void 0||bt!==null&&(!d||tr(a,l)?.writable)){c===void 0&&(c=s(()=>{var h=d?It(a[l]):Rt,p=I(h);return p}),r.set(l,c));var f=u(c);if(f===Rt)return!1}return d},set(a,l,c,d){var f=r.get(l),h=l in a;if(n&&l==="length")for(var p=c;pI(Rt)),r.set(p+"",g))}if(f===void 0)(!h||tr(a,l)?.writable)&&(f=s(()=>I(void 0)),_(f,It(c)),r.set(l,f));else{h=f.v!==Rt;var v=s(()=>It(c));_(f,v)}var m=Reflect.getOwnPropertyDescriptor(a,l);if(m?.set&&m.set.call(d,c),!h){if(n&&typeof l=="string"){var b=r.get("length"),O=Number(l);Number.isInteger(O)&&O>=b.v&&_(b,O+1)}we(o)}return!0},ownKeys(a){u(o);var l=Reflect.ownKeys(a).filter(f=>{var h=r.get(f);return h===void 0||h.v!==Rt});for(var[c,d]of r)d.v!==Rt&&!(c in a)&&l.push(c);return l},setPrototypeOf(){Sd()}})}function va(e){try{if(e!==null&&typeof e=="object"&&xe in e)return e[xe]}catch{}return e}function lf(e,t){return Object.is(va(e),va(t))}var ma,Ul,Kl,jl;function cf(){if(ma===void 0){ma=window,Ul=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Kl=tr(t,"firstChild").get,jl=tr(t,"nextSibling").get,fa(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),fa(r)&&(r.__t=void 0)}}function pe(e=""){return document.createTextNode(e)}function Le(e){return Kl.call(e)}function On(e){return jl.call(e)}function et(e,t){return Le(e)}function A(e,t=!1){{var r=Le(e);return r instanceof Comment&&r.data===""?On(r):r}}function j(e,t=1,r=!1){let n=e;for(;t--;)n=On(n);return n}function uf(e){e.textContent=""}function Gl(){return!1}function qi(e,t,r){return document.createElementNS(t??Pl,e,void 0)}function df(e,t){if(t){const r=document.body;e.autofocus=!0,Se(()=>{document.activeElement===r&&e.focus()})}}let ba=!1;function ff(){ba||(ba=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Do(e){var t=mt,r=bt;ce(null),Te(null);try{return e()}finally{ce(t),Te(r)}}function Yl(e,t,r,n=r){e.addEventListener(t,()=>Do(r));const o=e.__on_r;o?e.__on_r=()=>{o(),n(!0)}:e.__on_r=()=>n(!0),ff()}function Xl(e){bt===null&&(mt===null&&yd(),bd()),or&&md()}function hf(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function ue(e,t,r){var n=bt;n!==null&&(n.f&oe)!==0&&(e|=oe);var o={ctx:kt,deps:null,nodes:null,f:e|Ut|ae,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{jr(o)}catch(a){throw Vt(o),a}else t!==null&&fe(o);var i=o;if(r&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&ur)===0&&(i=i.first,(e&je)!==0&&(e&Be)!==0&&i!==null&&(i.f|=Be)),i!==null&&(i.parent=n,n!==null&&hf(i,n),mt!==null&&(mt.f&Ht)!==0&&(e&cr)===0)){var s=mt;(s.effects??=[]).push(i)}return o}function Zi(){return mt!==null&&!he}function Fo(e){const t=ue(kn,null,!1);return Mt(t,Lt),t.teardown=e,t}function gt(e){Xl();var t=bt.f,r=!mt&&(t&be)!==0&&(t&Ar)===0;if(r){var n=kt;(n.e??=[]).push(e)}else return ql(e)}function ql(e){return ue(An|yl,e,!1)}function re(e){return Xl(),ue(kn|yl,e,!0)}function Nn(e){Re.ensure();const t=ue(cr|ur,e,!0);return()=>{Vt(t)}}function pf(e){Re.ensure();const t=ue(cr|ur,e,!0);return(r={})=>new Promise(n=>{r.outro?Cr(t,()=>{Vt(t),n(void 0)}):(Vt(t),n(void 0))})}function Mn(e){return ue(An,e,!1)}function gf(e){return ue(ji|ur,e,!0)}function Ro(e,t=0){return ue(kn|t,e,!0)}function zt(e,t=[],r=[],n=[]){zl(n,t,r,o=>{ue(kn,()=>e(...o.map(u)),!0)})}function dr(e,t=0){var r=ue(je|t,e,!0);return r}function Zl(e,t=0){var r=ue(Ui|t,e,!0);return r}function te(e){return ue(be|ur,e,!0)}function Jl(e){var t=e.teardown;if(t!==null){const r=or,n=mt;ya(!0),ce(null);try{t.call(null)}finally{ya(r),ce(n)}}}function Ji(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const o=r.ac;o!==null&&Do(()=>{o.abort(_r)});var n=r.next;(r.f&cr)!==0?r.parent=null:Vt(r,t),r=n}}function vf(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&be)===0&&Vt(t),t=r}}function Vt(e,t=!0){var r=!1;(t||(e.f&Ki)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ql(e.nodes.start,e.nodes.end),r=!0),Ji(e,t&&!r),xn(e,0),Mt(e,Fe);var n=e.nodes&&e.nodes.t;if(n!==null)for(const i of n)i.stop();Jl(e);var o=e.parent;o!==null&&o.first!==null&&$l(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Ql(e,t){for(;e!==null;){var r=e===t?null:On(e);e.remove(),e=r}}function $l(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Cr(e,t,r=!0){var n=[];tc(e,n,!0);var o=()=>{r&&Vt(e),t&&t()},i=n.length;if(i>0){var s=()=>--i||o();for(var a of n)a.out(s)}else o()}function tc(e,t,r){if((e.f&oe)===0){e.f^=oe;var n=e.nodes&&e.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&t.push(a);for(var o=e.first;o!==null;){var i=o.next,s=(o.f&Be)!==0||(o.f&be)!==0&&(e.f&je)!==0;tc(o,t,s?r:!1),o=i}}}function Qi(e){ec(e,!0)}function ec(e,t){if((e.f&oe)!==0){e.f^=oe,(e.f&Lt)===0&&(Mt(e,Ut),fe(e));for(var r=e.first;r!==null;){var n=r.next,o=(r.f&Be)!==0||(r.f&be)!==0;ec(r,o?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function rc(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var o=r===n?null:On(r);t.append(r),r=o}}let eo=!1,or=!1;function ya(e){or=e}let mt=null,he=!1;function ce(e){mt=e}let bt=null;function Te(e){bt=e}let le=null;function nc(e){mt!==null&&(le===null?le=[e]:le.push(e))}let $t=null,ee=0,se=null;function mf(e){se=e}let oc=1,Sr=0,ze=Sr;function wa(e){ze=e}function ic(){return++oc}function In(e){var t=e.f;if((t&Ut)!==0)return!0;if(t&Ht&&(e.f&=~kr),(t&ge)!==0){for(var r=e.deps,n=r.length,o=0;oe.wv)return!0}(t&ae)!==0&&de===null&&Mt(e,Lt)}return!1}function sc(e,t,r=!0){var n=e.reactions;if(n!==null&&!(le!==null&&Hr.call(le,e)))for(var o=0;o{e.ac.abort(_r)}),e.ac=null);try{e.f|=gi;var d=e.fn,f=d();e.f|=Ar;var h=e.deps,p=yt?.is_fork;if($t!==null){var g;if(p||xn(e,ee),h!==null&&ee>0)for(h.length=ee+$t.length,g=0;g<$t.length;g++)h[ee+g]=$t[g];else e.deps=h=$t;if(Zi()&&(e.f&ae)!==0)for(g=ee;gr?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Se(()=>{t.addEventListener(e,o,n)}):t.addEventListener(e,o,n),o}function dt(e,t,r,n={}){var o=$i(t,e,r,n);return()=>{e.removeEventListener(t,o,n)}}function _a(e,t,r,n,o){var i={capture:n,passive:o},s=$i(e,t,r,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Fo(()=>{t.removeEventListener(e,s,i)})}function Br(e,t,r){(t[hn]??={})[e]=r}function Lo(e){for(var t=0;t{throw m});throw h}}finally{e[hn]=t,delete e.currentTarget,ce(d),Te(f)}}}const Af=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function kf(e){return Af?.createHTML(e)??e}function hc(e){var t=qi("template");return t.innerHTML=kf(e.replaceAll("","")),t.content}function Er(e,t){var r=bt;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function z(e,t){var r=(t&Fd)!==0,n=(t&Rd)!==0,o,i=!e.startsWith("");return()=>{o===void 0&&(o=hc(i?e:""+e),r||(o=Le(o)));var s=n||Ul?document.importNode(o,!0):o.cloneNode(!0);if(r){var a=Le(s),l=s.lastChild;Er(a,l)}else Er(s,s);return s}}function Ef(e,t,r="svg"){var n=!e.startsWith(""),o=`<${r}>${n?e:""+e}`,i;return()=>{if(!i){var s=hc(o),a=Le(s);i=Le(a)}var l=i.cloneNode(!0);return Er(l,l),l}}function pc(e,t){return Ef(e,t,"svg")}function Xt(e=""){{var t=pe(e+"");return Er(t,t),t}}function N(){var e=document.createDocumentFragment(),t=document.createComment(""),r=pe();return e.append(t,r),Er(t,r),e}function y(e,t){e!==null&&e.before(t)}function Kt(){return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function ir(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function gc(e,t){return Of(e,t)}const Gn=new Map;function Of(e,{target:t,anchor:r,props:n={},events:o,context:i,intro:s=!0,transformError:a}){cf();var l=void 0,c=pf(()=>{var d=r??t.appendChild(pe());Jd(d,{pending:()=>{}},p=>{D({});var g=kt;i&&(g.c=i),o&&(n.$$events=o),l=e(p,n)||{},F()},a);var f=new Set,h=p=>{for(var g=0;g{for(var p of f)for(const m of[t,document]){var g=Gn.get(m),v=g.get(p);--v==0?(m.removeEventListener(p,_i),g.delete(p),g.size===0&&Gn.delete(m)):g.set(p,v)}wi.delete(h),d!==r&&d.parentNode?.removeChild(d)}});return xi.set(l,c),l}let xi=new WeakMap;function Nf(e,t){const r=xi.get(e);return r?(xi.delete(e),r(t)):Promise.resolve()}class Dn{anchor;#t=new Map;#e=new Map;#r=new Map;#n=new Set;#o=!0;constructor(t,r=!0){this.anchor=t,this.#o=r}#i=()=>{var t=yt;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#e.get(r);if(n)Qi(n),this.#n.delete(r);else{var o=this.#r.get(r);o&&(this.#e.set(r,o.effect),this.#r.delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(const[i,s]of this.#t){if(this.#t.delete(i),i===t)break;const a=this.#r.get(s);a&&(Vt(a.effect),this.#r.delete(s))}for(const[i,s]of this.#e){if(i===r||this.#n.has(i))continue;const a=()=>{if(Array.from(this.#t.values()).includes(i)){var c=document.createDocumentFragment();rc(s,c),c.append(pe()),this.#r.set(i,{effect:s,fragment:c})}else Vt(s);this.#n.delete(i),this.#e.delete(i)};this.#o||!n?(this.#n.add(i),Cr(s,a,!1)):a()}}};#a=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,o]of this.#r)r.includes(n)||(Vt(o.effect),this.#r.delete(n))};ensure(t,r){var n=yt,o=Gl();if(r&&!this.#e.has(t)&&!this.#r.has(t))if(o){var i=document.createDocumentFragment(),s=pe();i.append(s),this.#r.set(t,{effect:te(()=>r(s)),fragment:i})}else this.#e.set(t,te(()=>r(this.anchor)));if(this.#t.set(n,t),o){for(const[a,l]of this.#e)a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of this.#r)a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#i),n.ondiscard(this.#a)}else this.#i()}}function nt(e,t,r=!1){var n=new Dn(e),o=r?Be:0;function i(s,a){n.ensure(s,a)}dr(()=>{var s=!1;t((a,l=0)=>{s=!0,i(l,a)}),s||i(!1,null)},o)}const Mf=Symbol("NaN");function If(e,t,r){var n=new Dn(e),o=!Zr();dr(()=>{var i=t();i!==i&&(i=Mf),o&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,r)})}function Df(e,t){return t}function Ff(e,t,r){for(var n=[],o=t.length,i,s=t.length,a=0;a{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var h=e.outrogroups;Si(No(i.done)),h.delete(i),h.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&r!==null;if(l){var c=r,d=c.parentNode;uf(d),d.append(c),e.items.clear()}Si(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function Si(e,t=!0){for(var r=0;r{var b=r();return Wi(b)?b:b==null?[]:No(b)}),h,p=!0;function g(){m.fallback=d,Rf(m,h,s,t,n),d!==null&&(h.length===0?(d.f&Me)===0?Qi(d):(d.f^=Me,pn(d,null,s)):Cr(d,()=>{d=null}))}var v=dr(()=>{h=u(f);for(var b=h.length,O=new Set,C=yt,x=Gl(),T=0;Ti(s)):(d=te(()=>i(Sa??=pe())),d.f|=Me)),b>O.size&&vd(),!p)if(x){for(const[L,V]of a)O.has(L)||C.skip_effect(V.e);C.oncommit(g),C.ondiscard(()=>{})}else g();u(f)}),m={effect:v,items:a,outrogroups:null,fallback:d};p=!1}function on(e){for(;e!==null&&(e.f&be)===0;)e=e.next;return e}function Rf(e,t,r,n,o){var i=(n&kd)!==0,s=t.length,a=e.items,l=on(e.effect.first),c,d=null,f,h=[],p=[],g,v,m,b;if(i)for(b=0;b0){var L=(n&Sl)!==0&&s===0?r:null;if(i){for(b=0;b{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function Lf(e,t,r,n,o,i,s,a){var l=(s&Cd)!==0?(s&Ed)===0?sf(r,!1,!1):We(r):null,c=(s&Ad)!==0?We(o):null;return{v:l,i:c,e:te(()=>(i(t,l??r,c??o,a),()=>{e.delete(n)}))}}function pn(e,t,r){if(e.nodes)for(var n=e.nodes.start,o=e.nodes.end,i=t&&(t.f&Me)===0?t.nodes.start:r;n!==null;){var s=On(n);if(i.before(n),n===o)return;n=s}}function Ge(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function zf(e,t,r=!1,n=!1,o=!1){var i=e,s="";zt(()=>{var a=bt;if(s!==(s=t()??"")&&(a.nodes!==null&&(Ql(a.nodes.start,a.nodes.end),a.nodes=null),s!=="")){var l=r?Tl:n?Ld:void 0,c=qi(r?"svg":n?"math":"template",l);c.innerHTML=s;var d=r||n?c:c.content;if(Er(Le(d),d.lastChild),r||n)for(;Le(d);)i.before(Le(d));else i.before(d)}})}function B(e,t,...r){var n=new Dn(e);dr(()=>{const o=t()??null;n.ensure(o,o&&(i=>o(i,...r)))},Be)}function H(e,t,r){var n=new Dn(e);dr(()=>{var o=t()??null;n.ensure(o,o&&(i=>r(i,o)))},Be)}function Vf(e,t,r,n,o,i){var s=null,a=e,l=new Dn(a,!1);dr(()=>{const c=t()||null;var d=Tl;if(c===null){l.ensure(null,null);return}return l.ensure(c,f=>{if(c){if(s=qi(c,d),Er(s,s),n){var h=s.appendChild(pe());n(s,h)}bt.nodes.end=s,f.before(s)}}),()=>{}},Be),Fo(()=>{})}function Bf(e,t){var r;r=document.head.appendChild(pe()),dr(()=>t(r),Ki|ur)}function vc(e,t,r){Mn(()=>{var n=Bt(()=>t(e,r?.())||{});if(r&&n?.update){var o=!1,i={};Ro(()=>{var s=r();dc(s),o&&kl(i,s)&&(i=s,n.update(s))}),o=!0}if(n?.destroy)return()=>n.destroy()})}function Wf(e,t){var r=void 0,n;Zl(()=>{r!==(r=t())&&(n&&(Vt(n),n=null),r&&(n=te(()=>{Mn(()=>r(e))})))})}function mc(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t=0;){var a=s+i;(s===0||Pa.includes(n[s-1]))&&(a===n.length||Pa.includes(n[a]))?n=(s===0?"":n.substring(0,s))+n.substring(a+1):s=a}}return n===""?null:n}function Ta(e,t=!1){var r=t?" !important;":";",n="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(n+=" "+o+": "+i+r)}return n}function ti(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Kf(e,t){if(t){var r="",n,o;if(Array.isArray(t)?(n=t[0],o=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(ti)),o&&l.push(...Object.keys(o).map(ti));var c=0,d=-1;const v=e.length;for(var f=0;f{so(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Fo(()=>{t.disconnect()})}function Gf(e,t,r=t){var n=new WeakSet,o=!0;Yl(e,"change",i=>{var s=i?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(s),yn);else{var l=e.querySelector(s)??e.querySelector("option:not([disabled])");a=l&&yn(l)}r(a),yt!==null&&n.add(yt)}),Mn(()=>{var i=t();if(e===document.activeElement){var s=io??yt;if(n.has(s))return}if(so(e,i,o),o&&i===void 0){var a=e.querySelector(":checked");a!==null&&(i=yn(a),r(i))}e.__value=i,o=!1}),bc(e)}function yn(e){return"__value"in e?e.__value:e.value}const sn=Symbol("class"),an=Symbol("style"),yc=Symbol("is custom element"),wc=Symbol("is html"),Yf=_l?"option":"OPTION",Xf=_l?"select":"SELECT";function qf(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Wt(e,t,r,n){var o=_c(e);o[t]!==(o[t]=r)&&(t==="loading"&&(e[pd]=r),r==null?e.removeAttribute(t):typeof r!="string"&&xc(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Zf(e,t,r,n,o=!1,i=!1){var s=_c(e),a=s[yc],l=!s[wc],c=t||{},d=e.nodeName===Yf;for(var f in t)f in r||(r[f]=null);r.class?r.class=Hf(r.class):r[sn]&&(r.class=null),r[an]&&(r.style??=null);var h=xc(e);for(const x in r){let T=r[x];if(d&&x==="value"&&T==null){e.value=e.__value="",c[x]=T;continue}if(x==="class"){var p=e.namespaceURI==="http://www.w3.org/1999/xhtml";nr(e,p,T,n,t?.[sn],r[sn]),c[x]=T,c[sn]=r[sn];continue}if(x==="style"){jf(e,T,t?.[an],r[an]),c[x]=T,c[an]=r[an];continue}var g=c[x];if(!(T===g&&!(T===void 0&&e.hasAttribute(x)))){c[x]=T;var v=x[0]+x[1];if(v!=="$$")if(v==="on"){const k={},R="$$"+x;let S=x.slice(2);var m=xf(S);if(wf(S)&&(S=S.slice(0,-7),k.capture=!0),!m&&g){if(T!=null)continue;e.removeEventListener(S,c[R],k),c[R]=null}if(m)Br(S,e,T),Lo([S]);else if(T!=null){let L=function(V){c[x].call(this,V)};var C=L;c[R]=$i(S,e,L,k)}}else if(x==="style")Wt(e,x,T);else if(x==="autofocus")df(e,!!T);else if(!a&&(x==="__value"||x==="value"&&T!=null))e.value=e.__value=T;else if(x==="selected"&&d)qf(e,T);else{var b=x;l||(b=Pf(b));var O=b==="defaultValue"||b==="defaultChecked";if(T==null&&!a&&!O)if(s[x]=null,b==="value"||b==="checked"){let k=e;const R=t===void 0;if(b==="value"){let S=k.defaultValue;k.removeAttribute(b),k.defaultValue=S,k.value=k.__value=R?S:null}else{let S=k.defaultChecked;k.removeAttribute(b),k.defaultChecked=S,k.checked=R?S:!1}}else e.removeAttribute(x);else O||h.includes(b)&&(a||typeof T!="string")?(e[b]=T,b in s&&(s[b]=Rt)):typeof T!="function"&&Wt(e,b,T)}}}return c}function wt(e,t,r=[],n=[],o=[],i,s=!1,a=!1){zl(o,r,n,l=>{var c=void 0,d={},f=e.nodeName===Xf,h=!1;if(Zl(()=>{var g=t(...l.map(u)),v=Zf(e,c,g,i,s,a);h&&f&&"value"in g&&so(e,g.value);for(let b of Object.getOwnPropertySymbols(d))g[b]||Vt(d[b]);for(let b of Object.getOwnPropertySymbols(g)){var m=g[b];b.description===Cl&&(!c||m!==c[b])&&(d[b]&&Vt(d[b]),d[b]=te(()=>Wf(e,()=>m))),v[b]=m}c=v}),f){var p=e;Mn(()=>{so(p,c.value,!0),bc(p)})}h=!0})}function _c(e){return e.__attributes??={[yc]:e.nodeName.includes("-"),[wc]:e.namespaceURI===Pl}}var Ca=new Map;function xc(e){var t=e.getAttribute("is")||e.nodeName,r=Ca.get(t);if(r)return r;Ca.set(t,r=[]);for(var n,o=e,i=Element.prototype;i!==o;){n=ml(o);for(var s in n)n[s].set&&r.push(s);o=Hi(o)}return r}function ri(e,t,r=t){var n=new WeakSet;Yl(e,"input",async o=>{var i=o?e.defaultValue:e.value;if(i=ni(e)?oi(i):i,r(i),yt!==null&&n.add(yt),await lc(),i!==(i=t())){var s=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=i??"",a!==null){var c=e.value.length;s===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=s,e.selectionEnd=Math.min(a,c))}}}),Bt(t)==null&&e.value&&(r(ni(e)?oi(e.value):e.value),yt!==null&&n.add(yt)),Ro(()=>{var o=t();if(e===document.activeElement){var i=io??yt;if(n.has(i))return}ni(e)&&o===oi(e.value)||e.type==="date"&&!o&&!e.value||o!==e.value&&(e.value=o??"")})}function ni(e){var t=e.type;return t==="number"||t==="range"}function oi(e){return e===""?null:+e}function Aa(e,t){return e===t||e?.[xe]===t}function Or(e={},t,r,n){return Mn(()=>{var o,i;return Ro(()=>{o=i,i=[],Bt(()=>{e!==r(...i)&&(t(e,...i),o&&Aa(r(...o),e)&&t(null,...o))})}),()=>{Se(()=>{i&&Aa(r(...i),e)&&t(null,...i)})}}),e}function ts(e=!1){const t=kt,r=t.l.u;if(!r)return;let n=()=>dc(t.s);if(e){let o=0,i={};const s=En(()=>{let a=!1;const l=t.s;for(const c in l)l[c]!==i[c]&&(i[c]=l[c],a=!0);return a&&o++,o});n=()=>u(s)}r.b.length&&re(()=>{ka(t,n),hi(r.b)}),gt(()=>{const o=Bt(()=>r.m.map(fd));return()=>{for(const i of o)typeof i=="function"&&i()}}),r.a.length&>(()=>{ka(t,n),hi(r.a)})}function ka(e,t){if(e.l.s)for(const r of e.l.s)u(r);t()}function Jf(e){var t=We(0);return function(){return arguments.length===1?(_(t,u(t)+1),arguments[0]):(u(t),e())}}let Yn=!1;function Qf(e){var t=Yn;try{return Yn=!1,[e(),Yn]}finally{Yn=t}}const $f={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function K(e,t,r){return new Proxy({props:e,exclude:t},$f)}const th={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(nn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let o=e.props[n];nn(o)&&(o=o());const i=tr(o,t);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(nn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const o=tr(n,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===xe||t===wl)return!1;for(let r of e.props)if(nn(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(nn(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function U(...e){return new Proxy({props:e},th)}function w(e,t,r,n){var o=!qr||(r&Nd)!==0,i=(r&Id)!==0,s=(r&Dd)!==0,a=n,l=!0,c=()=>(l&&(l=!1,a=s?Bt(n):n),a),d;if(i){var f=xe in e||wl in e;d=tr(e,t)?.set??(f&&t in e?C=>e[t]=C:void 0)}var h,p=!1;i?[h,p]=Qf(()=>e[t]):h=e[t],h===void 0&&n!==void 0&&(h=c(),d&&(o&&_d(),d(h)));var g;if(o?g=()=>{var C=e[t];return C===void 0?c():(l=!0,C)}:g=()=>{var C=e[t];return C!==void 0&&(a=void 0),C===void 0?a:C},o&&(r&Md)===0)return g;if(d){var v=e.$$legacy;return(function(C,x){return arguments.length>0?((!o||!x||v||p)&&d(x?g():C),C):g()})}var m=!1,b=((r&Od)!==0?En:Yi)(()=>(m=!1,g()));i&&u(b);var O=bt;return(function(C,x){if(arguments.length>0){const T=x?u(b):o&&i?It(C):C;return _(b,T),m=!0,a!==void 0&&(a=T),C}return or&&m||(O.f&Fe)!==0?b.v:u(b)})}function es(e){kt===null&&xl(),qr&&kt.l!==null?eh(kt).m.push(e):gt(()=>{const t=Bt(e);if(typeof t=="function")return t})}function eh(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const rh="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(rh);Wd();class nh{#t=I(!0);get sidebarVisible(){return u(this.#t)}set sidebarVisible(t){_(this.#t,t,!0)}#e=I(!1);get exportDialogOpen(){return u(this.#e)}set exportDialogOpen(t){_(this.#e,t,!0)}#r=I(!1);get shortcutsDialogOpen(){return u(this.#r)}set shortcutsDialogOpen(t){_(this.#r,t,!0)}#n=I(null);get overlayText(){return u(this.#n)}set overlayText(t){_(this.#n,t,!0)}#o=I(null);get overlayAction(){return u(this.#o)}set overlayAction(t){_(this.#o,t,!0)}#i=I(null);get toast(){return u(this.#i)}set toast(t){_(this.#i,t,!0)}toastTimer;toggleSidebar(){this.sidebarVisible=!this.sidebarVisible}showOverlay(t,r){this.overlayText=t,this.overlayAction=r??null}hideOverlay(){this.overlayText=null,this.overlayAction=null}openExportDialog(){this.exportDialogOpen=!0}closeExportDialog(){this.exportDialogOpen=!1}showToast(t,r="success"){this.toastTimer&&clearTimeout(this.toastTimer),this.toast={message:t,type:r},this.toastTimer=setTimeout(()=>{this.toast=null},3e3)}dismissToast(){this.toastTimer&&clearTimeout(this.toastTimer),this.toast=null}}const vt=new nh;var oh=z('
');function ih(e,t){D(t,!1),ts();var r=N(),n=A(r);{var o=i=>{var s=oh(),a=et(s),l=et(a),c=j(a,2);zt(()=>{nr(s,1,`fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-md border px-4 py-3 text-sm shadow-lg ${vt.toast.type==="error"?"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100":"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100"}`),ir(l,vt.toast.message)}),Br("click",c,()=>vt.dismissToast()),y(i,s)};nt(n,i=>{vt.toast&&i(o)})}y(e,r),F()}Lo(["click"]);const Sc=typeof window<"u"?window:void 0;function sh(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class ah extends Map{#t=new Map;#e=I(0);#r=I(0);#n=ze||-1;constructor(t){if(super(),t){for(var[r,n]of t)super.set(r,n);this.#r.v=super.size}}#o(t){return ze===this.#n?I(t):We(t)}has(t){var r=this.#t,n=r.get(t);if(n===void 0){var o=super.get(t);if(o!==void 0)n=this.#o(0),r.set(t,n);else return u(this.#e),!1}return u(n),!0}forEach(t,r){this.#i(),super.forEach(t,r)}get(t){var r=this.#t,n=r.get(t);if(n===void 0){var o=super.get(t);if(o!==void 0)n=this.#o(0),r.set(t,n);else{u(this.#e);return}}return u(n),super.get(t)}set(t,r){var n=this.#t,o=n.get(t),i=super.get(t),s=super.set(t,r),a=this.#e;if(o===void 0)o=this.#o(0),n.set(t,o),_(this.#r,super.size),we(a);else if(i!==r){we(o);var l=a.reactions===null?null:new Set(a.reactions),c=l===null||!o.reactions?.every(d=>l.has(d));c&&we(a)}return s}delete(t){var r=this.#t,n=r.get(t),o=super.delete(t);return n!==void 0&&(r.delete(t),_(this.#r,super.size),_(n,-1),we(this.#e)),o}clear(){if(super.size!==0){super.clear();var t=this.#t;_(this.#r,0);for(var r of t.values())_(r,-1);we(this.#e),t.clear()}}#i(){u(this.#e);var t=this.#t;if(this.#r.v!==t.size){for(var r of super.keys())if(!t.has(r)){var n=this.#o(0);t.set(r,n)}}for([,n]of this.#t)u(n)}keys(){return u(this.#e),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(this.#r),super.size}}class lh{#t;#e;constructor(t,r){this.#t=t,this.#e=Dr(r)}get current(){return this.#e(),this.#t()}}const ch=/\(.+\)/,uh=new Set(["all","print","screen","and","or","not","only"]);class dh extends lh{constructor(t,r){let n=ch.test(t)||t.split(/[\s,]+/).some(i=>uh.has(i.trim()))?t:`(${t})`;const o=window.matchMedia(n);super(()=>o.matches,i=>dt(o,"change",i))}}let fh=class{#t;#e;constructor(t={}){const{window:r=Sc,document:n=r?.document}=t;r!==void 0&&(this.#t=n,this.#e=Dr(o=>{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?sh(this.#t):null}};new fh;function hh(e,t){switch(e){case"post":gt(t);break;case"pre":re(t);break}}function Pc(e,t,r,n={}){const{lazy:o=!1}=n;let i=!o,s=Array.isArray(e)?[]:void 0;hh(t,()=>{const a=Array.isArray(e)?e.map(c=>c()):e();if(!i){i=!0,s=a;return}const l=Bt(()=>r(a,s));return s=a,l})}function rs(e,t,r){Pc(e,"post",t,r)}function ph(e,t,r){Pc(e,"pre",t,r)}rs.pre=ph;function gh(e,t){switch(e){case"local":return t.localStorage;case"session":return t.sessionStorage}}class Tc{#t;#e;#r;#n;#o;#i=I(0);constructor(t,r,n={}){const{storage:o="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:a=Sc}=n;if(this.#t=r,this.#e=t,this.#r=i,a===void 0)return;const l=gh(o,a);this.#n=l;const c=l.getItem(t);c!==null?this.#t=this.#s(c):this.#l(r),s&&o==="local"&&(this.#o=Dr(()=>dt(a,"storage",this.#a)))}get current(){this.#o?.(),u(this.#i);const t=this.#s(this.#n?.getItem(this.#e))??this.#t,r=new WeakMap,n=o=>{if(o===null||o?.constructor.name==="Date"||typeof o!="object")return o;let i=r.get(o);return i||(i=new Proxy(o,{get:(s,a)=>(u(this.#i),n(Reflect.get(s,a))),set:(s,a,l)=>(_(this.#i,u(this.#i)+1),Reflect.set(s,a,l),this.#l(t),!0)}),r.set(o,i)),i};return n(t)}set current(t){this.#l(t),_(this.#i,u(this.#i)+1)}#a=t=>{t.key!==this.#e||t.newValue===null||(this.#t=this.#s(t.newValue),_(this.#i,u(this.#i)+1))};#s(t){try{return this.#r.deserialize(t)}catch(r){console.error(`Error when parsing "${t}" from persisted store "${this.#e}"`,r);return}}#l(t){try{t!=null&&this.#n?.setItem(this.#e,this.#r.serialize(t))}catch(r){console.error(`Error when writing value from persisted store "${this.#e}" to ${this.#n}`,r)}}}function Ea(e){return e.filter(t=>t.length>0)}const Cc={getItem:e=>null,setItem:(e,t)=>{}},Fn=typeof document<"u";function vh(e){return typeof e=="function"}function mh(e){return e!==null&&typeof e=="object"}const Pn=Symbol("box"),ns=Symbol("is-writable");function bh(e){return mh(e)&&Pn in e}function yh(e){return Dt.isBox(e)&&ns in e}function Dt(e){let t=I(It(e));return{[Pn]:!0,[ns]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}function wh(e,t){const r=P(e);return t?{[Pn]:!0,[ns]:!0,get current(){return u(r)},set current(n){t(n)}}:{[Pn]:!0,get current(){return e()}}}function _h(e){return Dt.isBox(e)?e:vh(e)?Dt.with(e):Dt(e)}function xh(e){return Object.entries(e).reduce((t,[r,n])=>Dt.isBox(n)?(Dt.isWritableBox(n)?Object.defineProperty(t,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(t,r,{get(){return n.current}}),t):Object.assign(t,{[r]:n}),{})}function Sh(e){return Dt.isWritableBox(e)?{[Pn]:!0,get current(){return e.current}}:e}Dt.from=_h;Dt.with=wh;Dt.flatten=xh;Dt.readonly=Sh;Dt.isBox=bh;Dt.isWritableBox=yh;var Oa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ph=/\n/g,Th=/^\s*/,Ch=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ah=/^:\s*/,kh=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Eh=/^[;\s]*/,Oh=/^\s+|\s+$/g,Nh=` +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();const fi=!1;var Wi=Array.isArray,ld=Array.prototype.indexOf,Hr=Array.prototype.includes,No=Array.from,cd=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,ml=Object.getOwnPropertyDescriptors,ud=Object.prototype,dd=Array.prototype,Hi=Object.getPrototypeOf,fa=Object.isExtensible;function nn(e){return typeof e=="function"}const Q=()=>{};function fd(e){return e()}function hi(e){for(var t=0;t{e=n,t=o});return{promise:r,resolve:e,reject:t}}function hd(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const r=[];for(const n of e)if(r.push(n),r.length===t)break;return r}const Ht=2,An=4,kn=8,Ui=1<<24,je=16,be=32,cr=64,pi=128,ae=512,Lt=1024,Ut=2048,ge=4096,oe=8192,Fe=16384,Ar=32768,Be=65536,ha=1<<17,Ki=1<<18,ur=1<<19,yl=1<<20,Me=1<<25,kr=65536,gi=1<<21,ji=1<<22,er=1<<23,xe=Symbol("$state"),wl=Symbol("legacy props"),pd=Symbol(""),_r=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},_l=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function xl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function gd(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function vd(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function md(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function bd(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function yd(e){throw new Error("https://svelte.dev/e/effect_orphan")}function wd(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function _d(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function xd(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Sd(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Pd(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Td(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Cd=1,Ad=2,Sl=4,kd=8,Ed=16,Od=1,Nd=2,Md=4,Id=8,Dd=16,Fd=1,Rd=2,Rt=Symbol(),Pl="http://www.w3.org/1999/xhtml",Tl="http://www.w3.org/2000/svg",Ld="http://www.w3.org/1998/Math/MathML",Cl="@attach";function zd(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Vd(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Al(e){return e===this.v}function kl(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function El(e){return!kl(e,this.v)}let qr=!1,Bd=!1;function Wd(){qr=!0}let kt=null;function Ur(e){kt=e}function pa(e){return Mo().get(e)}function Hd(e,t){return Mo().set(e,t),t}function Ud(e){return Mo().has(e)}function Kd(){return Mo()}function D(e,t=!1,r){kt={p:kt,i:!1,c:null,e:null,s:e,x:null,l:qr&&!t?{s:null,u:null,$:[]}:null}}function F(e){var t=kt,r=t.e;if(r!==null){t.e=null;for(var n of r)ql(n)}return t.i=!0,kt=t.p,{}}function Zr(){return!qr||kt!==null&&kt.l===null}function Mo(e){return kt===null&&xl(),kt.c??=new Map(jd(kt)||void 0)}function jd(e){let t=e.p;for(;t!==null;){const r=t.c;if(r!==null)return r;t=t.p}return null}let xr=[];function Ol(){var e=xr;xr=[],hi(e)}function Se(e){if(xr.length===0&&!mn){var t=xr;queueMicrotask(()=>{t===xr&&Ol()})}xr.push(e)}function Gd(){for(;xr.length>0;)Ol()}function Nl(e){var t=bt;if(t===null)return mt.f|=er,e;if((t.f&Ar)===0&&(t.f&An)===0)throw e;Qe(e,t)}function Qe(e,t){for(;t!==null;){if((t.f&pi)!==0){if((t.f&Ar)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const Yd=-7169;function Mt(e,t){e.f=e.f&Yd|t}function Gi(e){(e.f&ae)!==0||e.deps===null?Mt(e,Lt):Mt(e,ge)}function Ml(e){if(e!==null)for(const t of e)(t.f&Ht)===0||(t.f&kr)===0||(t.f^=kr,Ml(t.deps))}function Il(e,t,r){(e.f&Ut)!==0?t.add(e):(e.f&ge)!==0&&r.add(e),Ml(e.deps),Mt(e,Lt)}const jn=new Set;let yt=null,io=null,de=null,Qt=[],Io=null,vi=!1,mn=!1;class Re{current=new Map;previous=new Map;#t=new Set;#e=new Set;#r=0;#n=0;#o=null;#i=new Set;#a=new Set;#s=new Map;is_fork=!1;#l=!1;#c(){return this.is_fork||this.#n>0}skip_effect(t){this.#s.has(t)||this.#s.set(t,{d:[],m:[]})}unskip_effect(t){var r=this.#s.get(t);if(r){this.#s.delete(t);for(var n of r.d)Mt(n,Ut),fe(n);for(n of r.m)Mt(n,ge),fe(n)}}process(t){Qt=[],this.apply();var r=[],n=[];for(const o of t)this.#u(o,r,n);if(this.#c()){this.#d(n),this.#d(r);for(const[o,i]of this.#s)Ll(o,i)}else{for(const o of this.#t)o();this.#t.clear(),this.#r===0&&this.#h(),io=this,yt=null,ga(n),ga(r),io=null,this.#o?.resolve()}de=null}#u(t,r,n){t.f^=Lt;for(var o=t.first;o!==null;){var i=o.f,s=(i&(be|cr))!==0,a=s&&(i&Lt)!==0,l=a||(i&oe)!==0||this.#s.has(o);if(!l&&o.fn!==null){s?o.f^=Lt:(i&An)!==0?r.push(o):In(o)&&((i&je)!==0&&this.#a.add(o),jr(o));var c=o.first;if(c!==null){o=c;continue}}for(;o!==null;){var d=o.next;if(d!==null){o=d;break}o=o.parent}}}#d(t){for(var r=0;r0){if(Dl(),yt!==null&&yt!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#e)t(this);this.#e.clear()}#h(){if(jn.size>1){this.previous.clear();var t=de,r=!0;for(const o of jn){if(o===this){r=!1;continue}const i=[];for(const[a,l]of this.current){if(o.current.has(a))if(r&&l!==o.current.get(a))o.current.set(a,l);else continue;i.push(a)}if(i.length===0)continue;const s=[...o.current.keys()].filter(a=>!this.current.has(a));if(s.length>0){var n=Qt;Qt=[];const a=new Set,l=new Map;for(const c of i)Fl(c,s,a,l);if(Qt.length>0){yt=o,o.apply();for(const c of Qt)o.#u(c,[],[]);o.deactivate()}Qt=n}}yt=null,de=t}jn.delete(this)}increment(t){this.#r+=1,t&&(this.#n+=1)}decrement(t){this.#r-=1,t&&(this.#n-=1),!this.#l&&(this.#l=!0,Se(()=>{this.#l=!1,this.#c()?Qt.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#i)this.#a.delete(t),Mt(t,Ut),fe(t);for(const t of this.#a)Mt(t,ge),fe(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#e.add(t)}settled(){return(this.#o??=bl()).promise}static ensure(){if(yt===null){const t=yt=new Re;jn.add(yt),mn||Se(()=>{yt===t&&t.flush()})}return yt}apply(){}}function Xd(e){var t=mn;mn=!0;try{for(var r;;){if(Gd(),Qt.length===0&&(yt?.flush(),Qt.length===0))return Io=null,r;Dl()}}finally{mn=t}}function Dl(){vi=!0;var e=null;try{for(var t=0;Qt.length>0;){var r=Re.ensure();if(t++>1e3){var n,o;qd()}r.process(Qt),rr.clear()}}finally{Qt=[],vi=!1,Io=null}}function qd(){try{wd()}catch(e){Qe(e,Io)}}let Oe=null;function ga(e){var t=e.length;if(t!==0){for(var r=0;r0)){rr.clear();for(const o of Oe){if((o.f&(Fe|oe))!==0)continue;const i=[o];let s=o.parent;for(;s!==null;)Oe.has(s)&&(Oe.delete(s),i.push(s)),s=s.parent;for(let a=i.length-1;a>=0;a--){const l=i[a];(l.f&(Fe|oe))===0&&jr(l)}}Oe.clear()}}Oe=null}}function Fl(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const o of e.reactions){const i=o.f;(i&Ht)!==0?Fl(o,t,r,n):(i&(ji|je))!==0&&(i&Ut)===0&&Rl(o,t,n)&&(Mt(o,Ut),fe(o))}}function Rl(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const o of e.deps){if(Hr.call(t,o))return!0;if((o.f&Ht)!==0&&Rl(o,t,r))return r.set(o,!0),!0}return r.set(e,!1),!1}function fe(e){var t=Io=e,r=t.b;if(r?.is_pending&&(e.f&(An|kn|Ui))!==0&&(e.f&Ar)===0){r.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var n=t.f;if(vi&&t===bt&&(n&je)!==0&&(n&Ki)===0&&(n&Ar)!==0)return;if((n&(cr|be))!==0){if((n&Lt)===0)return;t.f^=Lt}}Qt.push(t)}function Ll(e,t){if(!((e.f&be)!==0&&(e.f&Lt)!==0)){(e.f&Ut)!==0?t.d.push(e):(e.f&ge)!==0&&t.m.push(e),Mt(e,Lt);for(var r=e.first;r!==null;)Ll(r,t),r=r.next}}function Dr(e){let t=0,r=We(0),n;return()=>{Zi()&&(u(r),Ro(()=>(t===0&&(n=Bt(()=>e(()=>we(r)))),t+=1,()=>{Se(()=>{t-=1,t===0&&(n?.(),n=void 0,we(r))})})))}}var Zd=Be|ur;function Jd(e,t,r,n){new Qd(e,t,r,n)}class Qd{parent;is_pending=!1;transform_error;#t;#e=null;#r;#n;#o;#i=null;#a=null;#s=null;#l=null;#c=0;#u=0;#d=!1;#h=new Set;#p=new Set;#f=null;#g=Dr(()=>(this.#f=We(this.#c),()=>{this.#f=null}));constructor(t,r,n,o){this.#t=t,this.#r=r,this.#n=i=>{var s=bt;s.b=this,s.f|=pi,n(i)},this.parent=bt.b,this.transform_error=o??this.parent?.transform_error??(i=>i),this.#o=dr(()=>{this.#b()},Zd)}#v(){try{this.#i=te(()=>this.#n(this.#t))}catch(t){this.error(t)}}#m(t){const r=this.#r.failed;r&&(this.#s=te(()=>{r(this.#t,()=>t,()=>()=>{})}))}#_(){const t=this.#r.pending;t&&(this.is_pending=!0,this.#a=te(()=>t(this.#t)),Se(()=>{var r=this.#l=document.createDocumentFragment(),n=pe();r.append(n),this.#i=this.#w(()=>(Re.ensure(),te(()=>this.#n(n)))),this.#u===0&&(this.#t.before(r),this.#l=null,Cr(this.#a,()=>{this.#a=null}),this.#y())}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#c=0,this.#i=te(()=>{this.#n(this.#t)}),this.#u>0){var t=this.#l=document.createDocumentFragment();rc(this.#i,t);const r=this.#r.pending;this.#a=te(()=>r(this.#t))}else this.#y()}catch(r){this.error(r)}}#y(){this.is_pending=!1;for(const t of this.#h)Mt(t,Ut),fe(t);for(const t of this.#p)Mt(t,ge),fe(t);this.#h.clear(),this.#p.clear()}defer_effect(t){Il(t,this.#h,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#w(t){var r=bt,n=mt,o=kt;Te(this.#o),ce(this.#o),Ur(this.#o.ctx);try{return t()}catch(i){return Nl(i),null}finally{Te(r),ce(n),Ur(o)}}#x(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#x(t);return}this.#u+=t,this.#u===0&&(this.#y(),this.#a&&Cr(this.#a,()=>{this.#a=null}),this.#l&&(this.#t.before(this.#l),this.#l=null))}update_pending_count(t){this.#x(t),this.#c+=t,!(!this.#f||this.#d)&&(this.#d=!0,Se(()=>{this.#d=!1,this.#f&&Kr(this.#f,this.#c)}))}get_effect_pending(){return this.#g(),u(this.#f)}error(t){var r=this.#r.onerror;let n=this.#r.failed;if(!r&&!n)throw t;this.#i&&(Vt(this.#i),this.#i=null),this.#a&&(Vt(this.#a),this.#a=null),this.#s&&(Vt(this.#s),this.#s=null);var o=!1,i=!1;const s=()=>{if(o){Vd();return}o=!0,i&&Td(),this.#s!==null&&Cr(this.#s,()=>{this.#s=null}),this.#w(()=>{Re.ensure(),this.#b()})},a=l=>{try{i=!0,r?.(l,s),i=!1}catch(c){Qe(c,this.#o&&this.#o.parent)}n&&(this.#s=this.#w(()=>{Re.ensure();try{return te(()=>{var c=bt;c.b=this,c.f|=pi,n(this.#t,()=>l,()=>s)})}catch(c){return Qe(c,this.#o.parent),null}}))};Se(()=>{var l;try{l=this.transform_error(t)}catch(c){Qe(c,this.#o&&this.#o.parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(a,c=>Qe(c,this.#o&&this.#o.parent)):a(l)})}}function zl(e,t,r,n){const o=Zr()?En:Yi;var i=e.filter(f=>!f.settled);if(r.length===0&&i.length===0){n(t.map(o));return}var s=bt,a=$d(),l=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(f=>f.promise)):null;function c(f){a();try{n(f)}catch(h){(s.f&Fe)===0&&Qe(h,s)}mi()}if(r.length===0){l.then(()=>c(t.map(o)));return}function d(){a(),Promise.all(r.map(f=>ef(f))).then(f=>c([...t.map(o),...f])).catch(f=>Qe(f,s))}l?l.then(d):d()}function $d(){var e=bt,t=mt,r=kt,n=yt;return function(i=!0){Te(e),ce(t),Ur(r),i&&n?.activate()}}function mi(e=!0){Te(null),ce(null),Ur(null),e&&yt?.deactivate()}function tf(){var e=bt.b,t=yt,r=e.is_rendered();return e.update_pending_count(1),t.increment(r),()=>{e.update_pending_count(-1),t.decrement(r)}}function En(e){var t=Ht|Ut,r=mt!==null&&(mt.f&Ht)!==0?mt:null;return bt!==null&&(bt.f|=ur),{ctx:kt,deps:null,effects:null,equals:Al,f:t,fn:e,reactions:null,rv:0,v:Rt,wv:0,parent:r??bt,ac:null}}function ef(e,t,r){bt===null&&gd();var o=void 0,i=We(Rt),s=!mt,a=new Map;return gf(()=>{var l=bl();o=l.promise;try{Promise.resolve(e()).then(l.resolve,l.reject).finally(mi)}catch(h){l.reject(h),mi()}var c=yt;if(s){var d=tf();a.get(c)?.reject(_r),a.delete(c),a.set(c,l)}const f=(h,p=void 0)=>{if(c.activate(),p)p!==_r&&(i.f|=er,Kr(i,p));else{(i.f&er)!==0&&(i.f^=er),Kr(i,h);for(const[g,v]of a){if(a.delete(g),g===c)break;v.reject(_r)}}d&&d()};l.promise.then(f,h=>f(null,h||"unknown"))}),Fo(()=>{for(const l of a.values())l.reject(_r)}),new Promise(l=>{function c(d){function f(){d===o?l(i):c(o)}d.then(f,f)}c(o)})}function P(e){const t=En(e);return nc(t),t}function Yi(e){const t=En(e);return t.equals=El,t}function rf(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r0&&!Wl&&af()}return t}function af(){Wl=!1;for(const e of bi)(e.f&Lt)!==0&&Mt(e,ge),In(e)&&jr(e);bi.clear()}function we(e){_(e,e.v+1)}function Hl(e,t){var r=e.reactions;if(r!==null)for(var n=Zr(),o=r.length,i=0;i{if(ze===i)return a();var l=mt,c=ze;ce(null),wa(i);var d=a();return ce(l),wa(c),d};return n&&r.set("length",M(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&xd();var d=r.get(l);return d===void 0?s(()=>{var f=M(c.value);return r.set(l,f),f}):_(d,c.value,!0),!0},deleteProperty(a,l){var c=r.get(l);if(c===void 0){if(l in a){const d=s(()=>M(Rt));r.set(l,d),we(o)}}else _(c,Rt),we(o);return!0},get(a,l,c){if(l===xe)return e;var d=r.get(l),f=l in a;if(d===void 0&&(!f||tr(a,l)?.writable)&&(d=s(()=>{var p=It(f?a[l]:Rt),g=M(p);return g}),r.set(l,d)),d!==void 0){var h=u(d);return h===Rt?void 0:h}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var d=r.get(l);d&&(c.value=u(d))}else if(c===void 0){var f=r.get(l),h=f?.v;if(f!==void 0&&h!==Rt)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(a,l){if(l===xe)return!0;var c=r.get(l),d=c!==void 0&&c.v!==Rt||Reflect.has(a,l);if(c!==void 0||bt!==null&&(!d||tr(a,l)?.writable)){c===void 0&&(c=s(()=>{var h=d?It(a[l]):Rt,p=M(h);return p}),r.set(l,c));var f=u(c);if(f===Rt)return!1}return d},set(a,l,c,d){var f=r.get(l),h=l in a;if(n&&l==="length")for(var p=c;pM(Rt)),r.set(p+"",g))}if(f===void 0)(!h||tr(a,l)?.writable)&&(f=s(()=>M(void 0)),_(f,It(c)),r.set(l,f));else{h=f.v!==Rt;var v=s(()=>It(c));_(f,v)}var m=Reflect.getOwnPropertyDescriptor(a,l);if(m?.set&&m.set.call(d,c),!h){if(n&&typeof l=="string"){var b=r.get("length"),O=Number(l);Number.isInteger(O)&&O>=b.v&&_(b,O+1)}we(o)}return!0},ownKeys(a){u(o);var l=Reflect.ownKeys(a).filter(f=>{var h=r.get(f);return h===void 0||h.v!==Rt});for(var[c,d]of r)d.v!==Rt&&!(c in a)&&l.push(c);return l},setPrototypeOf(){Sd()}})}function va(e){try{if(e!==null&&typeof e=="object"&&xe in e)return e[xe]}catch{}return e}function lf(e,t){return Object.is(va(e),va(t))}var ma,Ul,Kl,jl;function cf(){if(ma===void 0){ma=window,Ul=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Kl=tr(t,"firstChild").get,jl=tr(t,"nextSibling").get,fa(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),fa(r)&&(r.__t=void 0)}}function pe(e=""){return document.createTextNode(e)}function Le(e){return Kl.call(e)}function On(e){return jl.call(e)}function et(e,t){return Le(e)}function A(e,t=!1){{var r=Le(e);return r instanceof Comment&&r.data===""?On(r):r}}function j(e,t=1,r=!1){let n=e;for(;t--;)n=On(n);return n}function uf(e){e.textContent=""}function Gl(){return!1}function qi(e,t,r){return document.createElementNS(t??Pl,e,void 0)}function df(e,t){if(t){const r=document.body;e.autofocus=!0,Se(()=>{document.activeElement===r&&e.focus()})}}let ba=!1;function ff(){ba||(ba=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Do(e){var t=mt,r=bt;ce(null),Te(null);try{return e()}finally{ce(t),Te(r)}}function Yl(e,t,r,n=r){e.addEventListener(t,()=>Do(r));const o=e.__on_r;o?e.__on_r=()=>{o(),n(!0)}:e.__on_r=()=>n(!0),ff()}function Xl(e){bt===null&&(mt===null&&yd(),bd()),or&&md()}function hf(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function ue(e,t,r){var n=bt;n!==null&&(n.f&oe)!==0&&(e|=oe);var o={ctx:kt,deps:null,nodes:null,f:e|Ut|ae,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{jr(o)}catch(a){throw Vt(o),a}else t!==null&&fe(o);var i=o;if(r&&i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&ur)===0&&(i=i.first,(e&je)!==0&&(e&Be)!==0&&i!==null&&(i.f|=Be)),i!==null&&(i.parent=n,n!==null&&hf(i,n),mt!==null&&(mt.f&Ht)!==0&&(e&cr)===0)){var s=mt;(s.effects??=[]).push(i)}return o}function Zi(){return mt!==null&&!he}function Fo(e){const t=ue(kn,null,!1);return Mt(t,Lt),t.teardown=e,t}function gt(e){Xl();var t=bt.f,r=!mt&&(t&be)!==0&&(t&Ar)===0;if(r){var n=kt;(n.e??=[]).push(e)}else return ql(e)}function ql(e){return ue(An|yl,e,!1)}function re(e){return Xl(),ue(kn|yl,e,!0)}function Nn(e){Re.ensure();const t=ue(cr|ur,e,!0);return()=>{Vt(t)}}function pf(e){Re.ensure();const t=ue(cr|ur,e,!0);return(r={})=>new Promise(n=>{r.outro?Cr(t,()=>{Vt(t),n(void 0)}):(Vt(t),n(void 0))})}function Mn(e){return ue(An,e,!1)}function gf(e){return ue(ji|ur,e,!0)}function Ro(e,t=0){return ue(kn|t,e,!0)}function zt(e,t=[],r=[],n=[]){zl(n,t,r,o=>{ue(kn,()=>e(...o.map(u)),!0)})}function dr(e,t=0){var r=ue(je|t,e,!0);return r}function Zl(e,t=0){var r=ue(Ui|t,e,!0);return r}function te(e){return ue(be|ur,e,!0)}function Jl(e){var t=e.teardown;if(t!==null){const r=or,n=mt;ya(!0),ce(null);try{t.call(null)}finally{ya(r),ce(n)}}}function Ji(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const o=r.ac;o!==null&&Do(()=>{o.abort(_r)});var n=r.next;(r.f&cr)!==0?r.parent=null:Vt(r,t),r=n}}function vf(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&be)===0&&Vt(t),t=r}}function Vt(e,t=!0){var r=!1;(t||(e.f&Ki)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Ql(e.nodes.start,e.nodes.end),r=!0),Ji(e,t&&!r),xn(e,0),Mt(e,Fe);var n=e.nodes&&e.nodes.t;if(n!==null)for(const i of n)i.stop();Jl(e);var o=e.parent;o!==null&&o.first!==null&&$l(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function Ql(e,t){for(;e!==null;){var r=e===t?null:On(e);e.remove(),e=r}}function $l(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Cr(e,t,r=!0){var n=[];tc(e,n,!0);var o=()=>{r&&Vt(e),t&&t()},i=n.length;if(i>0){var s=()=>--i||o();for(var a of n)a.out(s)}else o()}function tc(e,t,r){if((e.f&oe)===0){e.f^=oe;var n=e.nodes&&e.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&t.push(a);for(var o=e.first;o!==null;){var i=o.next,s=(o.f&Be)!==0||(o.f&be)!==0&&(e.f&je)!==0;tc(o,t,s?r:!1),o=i}}}function Qi(e){ec(e,!0)}function ec(e,t){if((e.f&oe)!==0){e.f^=oe,(e.f&Lt)===0&&(Mt(e,Ut),fe(e));for(var r=e.first;r!==null;){var n=r.next,o=(r.f&Be)!==0||(r.f&be)!==0;ec(r,o?t:!1),r=n}var i=e.nodes&&e.nodes.t;if(i!==null)for(const s of i)(s.is_global||t)&&s.in()}}function rc(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var o=r===n?null:On(r);t.append(r),r=o}}let eo=!1,or=!1;function ya(e){or=e}let mt=null,he=!1;function ce(e){mt=e}let bt=null;function Te(e){bt=e}let le=null;function nc(e){mt!==null&&(le===null?le=[e]:le.push(e))}let $t=null,ee=0,se=null;function mf(e){se=e}let oc=1,Sr=0,ze=Sr;function wa(e){ze=e}function ic(){return++oc}function In(e){var t=e.f;if((t&Ut)!==0)return!0;if(t&Ht&&(e.f&=~kr),(t&ge)!==0){for(var r=e.deps,n=r.length,o=0;oe.wv)return!0}(t&ae)!==0&&de===null&&Mt(e,Lt)}return!1}function sc(e,t,r=!0){var n=e.reactions;if(n!==null&&!(le!==null&&Hr.call(le,e)))for(var o=0;o{e.ac.abort(_r)}),e.ac=null);try{e.f|=gi;var d=e.fn,f=d();e.f|=Ar;var h=e.deps,p=yt?.is_fork;if($t!==null){var g;if(p||xn(e,ee),h!==null&&ee>0)for(h.length=ee+$t.length,g=0;g<$t.length;g++)h[ee+g]=$t[g];else e.deps=h=$t;if(Zi()&&(e.f&ae)!==0)for(g=ee;gr?.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Se(()=>{t.addEventListener(e,o,n)}):t.addEventListener(e,o,n),o}function dt(e,t,r,n={}){var o=$i(t,e,r,n);return()=>{e.removeEventListener(t,o,n)}}function _a(e,t,r,n,o){var i={capture:n,passive:o},s=$i(e,t,r,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Fo(()=>{t.removeEventListener(e,s,i)})}function Br(e,t,r){(t[hn]??={})[e]=r}function Lo(e){for(var t=0;t{throw m});throw h}}finally{e[hn]=t,delete e.currentTarget,ce(d),Te(f)}}}const Af=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function kf(e){return Af?.createHTML(e)??e}function hc(e){var t=qi("template");return t.innerHTML=kf(e.replaceAll("","")),t.content}function Er(e,t){var r=bt;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function z(e,t){var r=(t&Fd)!==0,n=(t&Rd)!==0,o,i=!e.startsWith("");return()=>{o===void 0&&(o=hc(i?e:""+e),r||(o=Le(o)));var s=n||Ul?document.importNode(o,!0):o.cloneNode(!0);if(r){var a=Le(s),l=s.lastChild;Er(a,l)}else Er(s,s);return s}}function Ef(e,t,r="svg"){var n=!e.startsWith(""),o=`<${r}>${n?e:""+e}`,i;return()=>{if(!i){var s=hc(o),a=Le(s);i=Le(a)}var l=i.cloneNode(!0);return Er(l,l),l}}function pc(e,t){return Ef(e,t,"svg")}function Xt(e=""){{var t=pe(e+"");return Er(t,t),t}}function N(){var e=document.createDocumentFragment(),t=document.createComment(""),r=pe();return e.append(t,r),Er(t,r),e}function y(e,t){e!==null&&e.before(t)}function Kt(){return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function ir(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function gc(e,t){return Of(e,t)}const Gn=new Map;function Of(e,{target:t,anchor:r,props:n={},events:o,context:i,intro:s=!0,transformError:a}){cf();var l=void 0,c=pf(()=>{var d=r??t.appendChild(pe());Jd(d,{pending:()=>{}},p=>{D({});var g=kt;i&&(g.c=i),o&&(n.$$events=o),l=e(p,n)||{},F()},a);var f=new Set,h=p=>{for(var g=0;g{for(var p of f)for(const m of[t,document]){var g=Gn.get(m),v=g.get(p);--v==0?(m.removeEventListener(p,_i),g.delete(p),g.size===0&&Gn.delete(m)):g.set(p,v)}wi.delete(h),d!==r&&d.parentNode?.removeChild(d)}});return xi.set(l,c),l}let xi=new WeakMap;function Nf(e,t){const r=xi.get(e);return r?(xi.delete(e),r(t)):Promise.resolve()}class Dn{anchor;#t=new Map;#e=new Map;#r=new Map;#n=new Set;#o=!0;constructor(t,r=!0){this.anchor=t,this.#o=r}#i=()=>{var t=yt;if(this.#t.has(t)){var r=this.#t.get(t),n=this.#e.get(r);if(n)Qi(n),this.#n.delete(r);else{var o=this.#r.get(r);o&&(this.#e.set(r,o.effect),this.#r.delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(const[i,s]of this.#t){if(this.#t.delete(i),i===t)break;const a=this.#r.get(s);a&&(Vt(a.effect),this.#r.delete(s))}for(const[i,s]of this.#e){if(i===r||this.#n.has(i))continue;const a=()=>{if(Array.from(this.#t.values()).includes(i)){var c=document.createDocumentFragment();rc(s,c),c.append(pe()),this.#r.set(i,{effect:s,fragment:c})}else Vt(s);this.#n.delete(i),this.#e.delete(i)};this.#o||!n?(this.#n.add(i),Cr(s,a,!1)):a()}}};#a=t=>{this.#t.delete(t);const r=Array.from(this.#t.values());for(const[n,o]of this.#r)r.includes(n)||(Vt(o.effect),this.#r.delete(n))};ensure(t,r){var n=yt,o=Gl();if(r&&!this.#e.has(t)&&!this.#r.has(t))if(o){var i=document.createDocumentFragment(),s=pe();i.append(s),this.#r.set(t,{effect:te(()=>r(s)),fragment:i})}else this.#e.set(t,te(()=>r(this.anchor)));if(this.#t.set(n,t),o){for(const[a,l]of this.#e)a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of this.#r)a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#i),n.ondiscard(this.#a)}else this.#i()}}function nt(e,t,r=!1){var n=new Dn(e),o=r?Be:0;function i(s,a){n.ensure(s,a)}dr(()=>{var s=!1;t((a,l=0)=>{s=!0,i(l,a)}),s||i(!1,null)},o)}const Mf=Symbol("NaN");function If(e,t,r){var n=new Dn(e),o=!Zr();dr(()=>{var i=t();i!==i&&(i=Mf),o&&i!==null&&typeof i=="object"&&(i={}),n.ensure(i,r)})}function Df(e,t){return t}function Ff(e,t,r){for(var n=[],o=t.length,i,s=t.length,a=0;a{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var h=e.outrogroups;Si(No(i.done)),h.delete(i),h.size===0&&(e.outrogroups=null)}}else s-=1},!1)}if(s===0){var l=n.length===0&&r!==null;if(l){var c=r,d=c.parentNode;uf(d),d.append(c),e.items.clear()}Si(t,!l)}else i={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(i)}function Si(e,t=!0){for(var r=0;r{var b=r();return Wi(b)?b:b==null?[]:No(b)}),h,p=!0;function g(){m.fallback=d,Rf(m,h,s,t,n),d!==null&&(h.length===0?(d.f&Me)===0?Qi(d):(d.f^=Me,pn(d,null,s)):Cr(d,()=>{d=null}))}var v=dr(()=>{h=u(f);for(var b=h.length,O=new Set,C=yt,x=Gl(),T=0;Ti(s)):(d=te(()=>i(Sa??=pe())),d.f|=Me)),b>O.size&&vd(),!p)if(x){for(const[L,V]of a)O.has(L)||C.skip_effect(V.e);C.oncommit(g),C.ondiscard(()=>{})}else g();u(f)}),m={effect:v,items:a,outrogroups:null,fallback:d};p=!1}function on(e){for(;e!==null&&(e.f&be)===0;)e=e.next;return e}function Rf(e,t,r,n,o){var i=(n&kd)!==0,s=t.length,a=e.items,l=on(e.effect.first),c,d=null,f,h=[],p=[],g,v,m,b;if(i)for(b=0;b0){var L=(n&Sl)!==0&&s===0?r:null;if(i){for(b=0;b{if(f!==void 0)for(m of f)m.nodes?.a?.apply()})}function Lf(e,t,r,n,o,i,s,a){var l=(s&Cd)!==0?(s&Ed)===0?sf(r,!1,!1):We(r):null,c=(s&Ad)!==0?We(o):null;return{v:l,i:c,e:te(()=>(i(t,l??r,c??o,a),()=>{e.delete(n)}))}}function pn(e,t,r){if(e.nodes)for(var n=e.nodes.start,o=e.nodes.end,i=t&&(t.f&Me)===0?t.nodes.start:r;n!==null;){var s=On(n);if(i.before(n),n===o)return;n=s}}function Ge(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function zf(e,t,r=!1,n=!1,o=!1){var i=e,s="";zt(()=>{var a=bt;if(s!==(s=t()??"")&&(a.nodes!==null&&(Ql(a.nodes.start,a.nodes.end),a.nodes=null),s!=="")){var l=r?Tl:n?Ld:void 0,c=qi(r?"svg":n?"math":"template",l);c.innerHTML=s;var d=r||n?c:c.content;if(Er(Le(d),d.lastChild),r||n)for(;Le(d);)i.before(Le(d));else i.before(d)}})}function B(e,t,...r){var n=new Dn(e);dr(()=>{const o=t()??null;n.ensure(o,o&&(i=>o(i,...r)))},Be)}function H(e,t,r){var n=new Dn(e);dr(()=>{var o=t()??null;n.ensure(o,o&&(i=>r(i,o)))},Be)}function Vf(e,t,r,n,o,i){var s=null,a=e,l=new Dn(a,!1);dr(()=>{const c=t()||null;var d=Tl;if(c===null){l.ensure(null,null);return}return l.ensure(c,f=>{if(c){if(s=qi(c,d),Er(s,s),n){var h=s.appendChild(pe());n(s,h)}bt.nodes.end=s,f.before(s)}}),()=>{}},Be),Fo(()=>{})}function Bf(e,t){var r;r=document.head.appendChild(pe()),dr(()=>t(r),Ki|ur)}function vc(e,t,r){Mn(()=>{var n=Bt(()=>t(e,r?.())||{});if(r&&n?.update){var o=!1,i={};Ro(()=>{var s=r();dc(s),o&&kl(i,s)&&(i=s,n.update(s))}),o=!0}if(n?.destroy)return()=>n.destroy()})}function Wf(e,t){var r=void 0,n;Zl(()=>{r!==(r=t())&&(n&&(Vt(n),n=null),r&&(n=te(()=>{Mn(()=>r(e))})))})}function mc(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t=0;){var a=s+i;(s===0||Pa.includes(n[s-1]))&&(a===n.length||Pa.includes(n[a]))?n=(s===0?"":n.substring(0,s))+n.substring(a+1):s=a}}return n===""?null:n}function Ta(e,t=!1){var r=t?" !important;":";",n="";for(var o of Object.keys(e)){var i=e[o];i!=null&&i!==""&&(n+=" "+o+": "+i+r)}return n}function ti(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Kf(e,t){if(t){var r="",n,o;if(Array.isArray(t)?(n=t[0],o=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var i=!1,s=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(ti)),o&&l.push(...Object.keys(o).map(ti));var c=0,d=-1;const v=e.length;for(var f=0;f{so(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Fo(()=>{t.disconnect()})}function Gf(e,t,r=t){var n=new WeakSet,o=!0;Yl(e,"change",i=>{var s=i?"[selected]":":checked",a;if(e.multiple)a=[].map.call(e.querySelectorAll(s),yn);else{var l=e.querySelector(s)??e.querySelector("option:not([disabled])");a=l&&yn(l)}r(a),yt!==null&&n.add(yt)}),Mn(()=>{var i=t();if(e===document.activeElement){var s=io??yt;if(n.has(s))return}if(so(e,i,o),o&&i===void 0){var a=e.querySelector(":checked");a!==null&&(i=yn(a),r(i))}e.__value=i,o=!1}),bc(e)}function yn(e){return"__value"in e?e.__value:e.value}const sn=Symbol("class"),an=Symbol("style"),yc=Symbol("is custom element"),wc=Symbol("is html"),Yf=_l?"option":"OPTION",Xf=_l?"select":"SELECT";function qf(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Wt(e,t,r,n){var o=_c(e);o[t]!==(o[t]=r)&&(t==="loading"&&(e[pd]=r),r==null?e.removeAttribute(t):typeof r!="string"&&xc(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function Zf(e,t,r,n,o=!1,i=!1){var s=_c(e),a=s[yc],l=!s[wc],c=t||{},d=e.nodeName===Yf;for(var f in t)f in r||(r[f]=null);r.class?r.class=Hf(r.class):r[sn]&&(r.class=null),r[an]&&(r.style??=null);var h=xc(e);for(const x in r){let T=r[x];if(d&&x==="value"&&T==null){e.value=e.__value="",c[x]=T;continue}if(x==="class"){var p=e.namespaceURI==="http://www.w3.org/1999/xhtml";nr(e,p,T,n,t?.[sn],r[sn]),c[x]=T,c[sn]=r[sn];continue}if(x==="style"){jf(e,T,t?.[an],r[an]),c[x]=T,c[an]=r[an];continue}var g=c[x];if(!(T===g&&!(T===void 0&&e.hasAttribute(x)))){c[x]=T;var v=x[0]+x[1];if(v!=="$$")if(v==="on"){const k={},R="$$"+x;let S=x.slice(2);var m=xf(S);if(wf(S)&&(S=S.slice(0,-7),k.capture=!0),!m&&g){if(T!=null)continue;e.removeEventListener(S,c[R],k),c[R]=null}if(m)Br(S,e,T),Lo([S]);else if(T!=null){let L=function(V){c[x].call(this,V)};var C=L;c[R]=$i(S,e,L,k)}}else if(x==="style")Wt(e,x,T);else if(x==="autofocus")df(e,!!T);else if(!a&&(x==="__value"||x==="value"&&T!=null))e.value=e.__value=T;else if(x==="selected"&&d)qf(e,T);else{var b=x;l||(b=Pf(b));var O=b==="defaultValue"||b==="defaultChecked";if(T==null&&!a&&!O)if(s[x]=null,b==="value"||b==="checked"){let k=e;const R=t===void 0;if(b==="value"){let S=k.defaultValue;k.removeAttribute(b),k.defaultValue=S,k.value=k.__value=R?S:null}else{let S=k.defaultChecked;k.removeAttribute(b),k.defaultChecked=S,k.checked=R?S:!1}}else e.removeAttribute(x);else O||h.includes(b)&&(a||typeof T!="string")?(e[b]=T,b in s&&(s[b]=Rt)):typeof T!="function"&&Wt(e,b,T)}}}return c}function wt(e,t,r=[],n=[],o=[],i,s=!1,a=!1){zl(o,r,n,l=>{var c=void 0,d={},f=e.nodeName===Xf,h=!1;if(Zl(()=>{var g=t(...l.map(u)),v=Zf(e,c,g,i,s,a);h&&f&&"value"in g&&so(e,g.value);for(let b of Object.getOwnPropertySymbols(d))g[b]||Vt(d[b]);for(let b of Object.getOwnPropertySymbols(g)){var m=g[b];b.description===Cl&&(!c||m!==c[b])&&(d[b]&&Vt(d[b]),d[b]=te(()=>Wf(e,()=>m))),v[b]=m}c=v}),f){var p=e;Mn(()=>{so(p,c.value,!0),bc(p)})}h=!0})}function _c(e){return e.__attributes??={[yc]:e.nodeName.includes("-"),[wc]:e.namespaceURI===Pl}}var Ca=new Map;function xc(e){var t=e.getAttribute("is")||e.nodeName,r=Ca.get(t);if(r)return r;Ca.set(t,r=[]);for(var n,o=e,i=Element.prototype;i!==o;){n=ml(o);for(var s in n)n[s].set&&r.push(s);o=Hi(o)}return r}function ri(e,t,r=t){var n=new WeakSet;Yl(e,"input",async o=>{var i=o?e.defaultValue:e.value;if(i=ni(e)?oi(i):i,r(i),yt!==null&&n.add(yt),await lc(),i!==(i=t())){var s=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=i??"",a!==null){var c=e.value.length;s===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=s,e.selectionEnd=Math.min(a,c))}}}),Bt(t)==null&&e.value&&(r(ni(e)?oi(e.value):e.value),yt!==null&&n.add(yt)),Ro(()=>{var o=t();if(e===document.activeElement){var i=io??yt;if(n.has(i))return}ni(e)&&o===oi(e.value)||e.type==="date"&&!o&&!e.value||o!==e.value&&(e.value=o??"")})}function ni(e){var t=e.type;return t==="number"||t==="range"}function oi(e){return e===""?null:+e}function Aa(e,t){return e===t||e?.[xe]===t}function Or(e={},t,r,n){return Mn(()=>{var o,i;return Ro(()=>{o=i,i=[],Bt(()=>{e!==r(...i)&&(t(e,...i),o&&Aa(r(...o),e)&&t(null,...o))})}),()=>{Se(()=>{i&&Aa(r(...i),e)&&t(null,...i)})}}),e}function ts(e=!1){const t=kt,r=t.l.u;if(!r)return;let n=()=>dc(t.s);if(e){let o=0,i={};const s=En(()=>{let a=!1;const l=t.s;for(const c in l)l[c]!==i[c]&&(i[c]=l[c],a=!0);return a&&o++,o});n=()=>u(s)}r.b.length&&re(()=>{ka(t,n),hi(r.b)}),gt(()=>{const o=Bt(()=>r.m.map(fd));return()=>{for(const i of o)typeof i=="function"&&i()}}),r.a.length&>(()=>{ka(t,n),hi(r.a)})}function ka(e,t){if(e.l.s)for(const r of e.l.s)u(r);t()}function Jf(e){var t=We(0);return function(){return arguments.length===1?(_(t,u(t)+1),arguments[0]):(u(t),e())}}let Yn=!1;function Qf(e){var t=Yn;try{return Yn=!1,[e(),Yn]}finally{Yn=t}}const $f={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function K(e,t,r){return new Proxy({props:e,exclude:t},$f)}const th={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(nn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let o=e.props[n];nn(o)&&(o=o());const i=tr(o,t);if(i&&i.set)return i.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(nn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const o=tr(n,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===xe||t===wl)return!1;for(let r of e.props)if(nn(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(nn(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function U(...e){return new Proxy({props:e},th)}function w(e,t,r,n){var o=!qr||(r&Nd)!==0,i=(r&Id)!==0,s=(r&Dd)!==0,a=n,l=!0,c=()=>(l&&(l=!1,a=s?Bt(n):n),a),d;if(i){var f=xe in e||wl in e;d=tr(e,t)?.set??(f&&t in e?C=>e[t]=C:void 0)}var h,p=!1;i?[h,p]=Qf(()=>e[t]):h=e[t],h===void 0&&n!==void 0&&(h=c(),d&&(o&&_d(),d(h)));var g;if(o?g=()=>{var C=e[t];return C===void 0?c():(l=!0,C)}:g=()=>{var C=e[t];return C!==void 0&&(a=void 0),C===void 0?a:C},o&&(r&Md)===0)return g;if(d){var v=e.$$legacy;return(function(C,x){return arguments.length>0?((!o||!x||v||p)&&d(x?g():C),C):g()})}var m=!1,b=((r&Od)!==0?En:Yi)(()=>(m=!1,g()));i&&u(b);var O=bt;return(function(C,x){if(arguments.length>0){const T=x?u(b):o&&i?It(C):C;return _(b,T),m=!0,a!==void 0&&(a=T),C}return or&&m||(O.f&Fe)!==0?b.v:u(b)})}function es(e){kt===null&&xl(),qr&&kt.l!==null?eh(kt).m.push(e):gt(()=>{const t=Bt(e);if(typeof t=="function")return t})}function eh(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const rh="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(rh);Wd();class nh{#t=M(!0);get sidebarVisible(){return u(this.#t)}set sidebarVisible(t){_(this.#t,t,!0)}#e=M(!1);get exportDialogOpen(){return u(this.#e)}set exportDialogOpen(t){_(this.#e,t,!0)}#r=M(!1);get shortcutsDialogOpen(){return u(this.#r)}set shortcutsDialogOpen(t){_(this.#r,t,!0)}#n=M(null);get overlayText(){return u(this.#n)}set overlayText(t){_(this.#n,t,!0)}#o=M(null);get overlayAction(){return u(this.#o)}set overlayAction(t){_(this.#o,t,!0)}#i=M(null);get toast(){return u(this.#i)}set toast(t){_(this.#i,t,!0)}toastTimer;toggleSidebar(){this.sidebarVisible=!this.sidebarVisible}showOverlay(t,r){this.overlayText=t,this.overlayAction=r??null}hideOverlay(){this.overlayText=null,this.overlayAction=null}openExportDialog(){this.exportDialogOpen=!0}closeExportDialog(){this.exportDialogOpen=!1}showToast(t,r="success"){this.toastTimer&&clearTimeout(this.toastTimer),this.toast={message:t,type:r},this.toastTimer=setTimeout(()=>{this.toast=null},3e3)}dismissToast(){this.toastTimer&&clearTimeout(this.toastTimer),this.toast=null}}const vt=new nh;var oh=z('
');function ih(e,t){D(t,!1),ts();var r=N(),n=A(r);{var o=i=>{var s=oh(),a=et(s),l=et(a),c=j(a,2);zt(()=>{nr(s,1,`fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-md border px-4 py-3 text-sm shadow-lg ${vt.toast.type==="error"?"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100":"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100"}`),ir(l,vt.toast.message)}),Br("click",c,()=>vt.dismissToast()),y(i,s)};nt(n,i=>{vt.toast&&i(o)})}y(e,r),F()}Lo(["click"]);const Sc=typeof window<"u"?window:void 0;function sh(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class ah extends Map{#t=new Map;#e=M(0);#r=M(0);#n=ze||-1;constructor(t){if(super(),t){for(var[r,n]of t)super.set(r,n);this.#r.v=super.size}}#o(t){return ze===this.#n?M(t):We(t)}has(t){var r=this.#t,n=r.get(t);if(n===void 0){var o=super.get(t);if(o!==void 0)n=this.#o(0),r.set(t,n);else return u(this.#e),!1}return u(n),!0}forEach(t,r){this.#i(),super.forEach(t,r)}get(t){var r=this.#t,n=r.get(t);if(n===void 0){var o=super.get(t);if(o!==void 0)n=this.#o(0),r.set(t,n);else{u(this.#e);return}}return u(n),super.get(t)}set(t,r){var n=this.#t,o=n.get(t),i=super.get(t),s=super.set(t,r),a=this.#e;if(o===void 0)o=this.#o(0),n.set(t,o),_(this.#r,super.size),we(a);else if(i!==r){we(o);var l=a.reactions===null?null:new Set(a.reactions),c=l===null||!o.reactions?.every(d=>l.has(d));c&&we(a)}return s}delete(t){var r=this.#t,n=r.get(t),o=super.delete(t);return n!==void 0&&(r.delete(t),_(this.#r,super.size),_(n,-1),we(this.#e)),o}clear(){if(super.size!==0){super.clear();var t=this.#t;_(this.#r,0);for(var r of t.values())_(r,-1);we(this.#e),t.clear()}}#i(){u(this.#e);var t=this.#t;if(this.#r.v!==t.size){for(var r of super.keys())if(!t.has(r)){var n=this.#o(0);t.set(r,n)}}for([,n]of this.#t)u(n)}keys(){return u(this.#e),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(this.#r),super.size}}class lh{#t;#e;constructor(t,r){this.#t=t,this.#e=Dr(r)}get current(){return this.#e(),this.#t()}}const ch=/\(.+\)/,uh=new Set(["all","print","screen","and","or","not","only"]);class dh extends lh{constructor(t,r){let n=ch.test(t)||t.split(/[\s,]+/).some(i=>uh.has(i.trim()))?t:`(${t})`;const o=window.matchMedia(n);super(()=>o.matches,i=>dt(o,"change",i))}}let fh=class{#t;#e;constructor(t={}){const{window:r=Sc,document:n=r?.document}=t;r!==void 0&&(this.#t=n,this.#e=Dr(o=>{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?sh(this.#t):null}};new fh;function hh(e,t){switch(e){case"post":gt(t);break;case"pre":re(t);break}}function Pc(e,t,r,n={}){const{lazy:o=!1}=n;let i=!o,s=Array.isArray(e)?[]:void 0;hh(t,()=>{const a=Array.isArray(e)?e.map(c=>c()):e();if(!i){i=!0,s=a;return}const l=Bt(()=>r(a,s));return s=a,l})}function rs(e,t,r){Pc(e,"post",t,r)}function ph(e,t,r){Pc(e,"pre",t,r)}rs.pre=ph;function gh(e,t){switch(e){case"local":return t.localStorage;case"session":return t.sessionStorage}}class Tc{#t;#e;#r;#n;#o;#i=M(0);constructor(t,r,n={}){const{storage:o="local",serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:s=!0,window:a=Sc}=n;if(this.#t=r,this.#e=t,this.#r=i,a===void 0)return;const l=gh(o,a);this.#n=l;const c=l.getItem(t);c!==null?this.#t=this.#s(c):this.#l(r),s&&o==="local"&&(this.#o=Dr(()=>dt(a,"storage",this.#a)))}get current(){this.#o?.(),u(this.#i);const t=this.#s(this.#n?.getItem(this.#e))??this.#t,r=new WeakMap,n=o=>{if(o===null||o?.constructor.name==="Date"||typeof o!="object")return o;let i=r.get(o);return i||(i=new Proxy(o,{get:(s,a)=>(u(this.#i),n(Reflect.get(s,a))),set:(s,a,l)=>(_(this.#i,u(this.#i)+1),Reflect.set(s,a,l),this.#l(t),!0)}),r.set(o,i)),i};return n(t)}set current(t){this.#l(t),_(this.#i,u(this.#i)+1)}#a=t=>{t.key!==this.#e||t.newValue===null||(this.#t=this.#s(t.newValue),_(this.#i,u(this.#i)+1))};#s(t){try{return this.#r.deserialize(t)}catch(r){console.error(`Error when parsing "${t}" from persisted store "${this.#e}"`,r);return}}#l(t){try{t!=null&&this.#n?.setItem(this.#e,this.#r.serialize(t))}catch(r){console.error(`Error when writing value from persisted store "${this.#e}" to ${this.#n}`,r)}}}function Ea(e){return e.filter(t=>t.length>0)}const Cc={getItem:e=>null,setItem:(e,t)=>{}},Fn=typeof document<"u";function vh(e){return typeof e=="function"}function mh(e){return e!==null&&typeof e=="object"}const Pn=Symbol("box"),ns=Symbol("is-writable");function bh(e){return mh(e)&&Pn in e}function yh(e){return Dt.isBox(e)&&ns in e}function Dt(e){let t=M(It(e));return{[Pn]:!0,[ns]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}function wh(e,t){const r=P(e);return t?{[Pn]:!0,[ns]:!0,get current(){return u(r)},set current(n){t(n)}}:{[Pn]:!0,get current(){return e()}}}function _h(e){return Dt.isBox(e)?e:vh(e)?Dt.with(e):Dt(e)}function xh(e){return Object.entries(e).reduce((t,[r,n])=>Dt.isBox(n)?(Dt.isWritableBox(n)?Object.defineProperty(t,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(t,r,{get(){return n.current}}),t):Object.assign(t,{[r]:n}),{})}function Sh(e){return Dt.isWritableBox(e)?{[Pn]:!0,get current(){return e.current}}:e}Dt.from=_h;Dt.with=wh;Dt.flatten=xh;Dt.readonly=Sh;Dt.isBox=bh;Dt.isWritableBox=yh;var Oa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ph=/\n/g,Th=/^\s*/,Ch=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ah=/^:\s*/,kh=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Eh=/^[;\s]*/,Oh=/^\s+|\s+$/g,Nh=` `,Na="/",Ma="*",yr="",Mh="comment",Ih="declaration";function Dh(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function o(g){var v=g.match(Ph);v&&(r+=v.length);var m=g.lastIndexOf(Nh);n=~m?g.length-m:n+g.length}function i(){var g={line:r,column:n};return function(v){return v.position=new s(g),c(),v}}function s(g){this.start=g,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;function a(g){var v=new Error(t.source+":"+r+":"+n+": "+g);if(v.reason=g,v.filename=t.source,v.line=r,v.column=n,v.source=e,!t.silent)throw v}function l(g){var v=g.exec(e);if(v){var m=v[0];return o(m),e=e.slice(m.length),v}}function c(){l(Th)}function d(g){var v;for(g=g||[];v=f();)v!==!1&&g.push(v);return g}function f(){var g=i();if(!(Na!=e.charAt(0)||Ma!=e.charAt(1))){for(var v=2;yr!=e.charAt(v)&&(Ma!=e.charAt(v)||Na!=e.charAt(v+1));)++v;if(v+=2,yr===e.charAt(v-1))return a("End of comment missing");var m=e.slice(2,v-2);return n+=2,o(m),e=e.slice(v),n+=2,g({type:Mh,comment:m})}}function h(){var g=i(),v=l(Ch);if(v){if(f(),!l(Ah))return a("property missing ':'");var m=l(kh),b=g({type:Ih,property:Ia(v[0].replace(Oa,yr)),value:m?Ia(m[0].replace(Oa,yr)):yr});return l(Eh),b}}function p(){var g=[];d(g);for(var v;v=h();)v!==!1&&(g.push(v),d(g));return g}return c(),p()}function Ia(e){return e?e.replace(Oh,yr):yr}function Fh(e,t){let r=null;if(!e||typeof e!="string")return r;const n=Dh(e),o=typeof t=="function";return n.forEach(i=>{if(i.type!=="declaration")return;const{property:s,value:a}=i;o?t(s,a,i):a&&(r=r||{},r[s]=a)}),r}function Rh(e,t){const r=RegExp(e,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,t):n}}const Lh=Rh(/[A-Z]/,e=>`-${e.toLowerCase()}`);function zh(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Lh(t)}: ${e[t]};`).join(` `)}function Vh(e={}){return zh(e).replace(` -`," ")}const Bh={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Vh(Bh);const Wh=typeof window<"u"?window:void 0;function Hh(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}let Uh=class{#t;#e;constructor(t={}){const{window:r=Wh,document:n=r?.document}=t;r!==void 0&&(this.#t=n,this.#e=Dr(o=>{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?Hh(this.#t):null}};new Uh;const Pr=Dt("mode-watcher-mode"),Tr=Dt("mode-watcher-theme"),Kh=["dark","light","system"];function Pi(e){return typeof e!="string"?!1:Kh.includes(e)}class jh{#t="system";#e=Fn?localStorage:Cc;#r=this.#e.getItem(Pr.current);#n=Pi(this.#r)?this.#r:this.#t;#o=I(It(this.#i()));#i(t=this.#n){return new Tc(Pr.current,t,{serializer:{serialize:r=>r,deserialize:r=>Pi(r)?r:this.#t}})}constructor(){Nn(()=>rs.pre(()=>Pr.current,(t,r)=>{const n=u(this.#o).current;_(this.#o,this.#i(n),!0),r&&localStorage.removeItem(r)}))}get current(){return u(this.#o).current}set current(t){u(this.#o).current=t}}class Gh{#t=void 0;#e=!0;#r=I(It(this.#t));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new dh("prefers-color-scheme: light"):{current:!1};query(){Fn&&_(this.#r,this.#n.current?"light":"dark",!0)}tracking(t){this.#e=t}constructor(){Nn(()=>{re(()=>{this.#e&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return u(this.#r)}}const ao=new jh,Ti=new Gh;class Yh{#t=Fn?localStorage:Cc;#e=this.#t.getItem(Tr.current);#r=this.#e===null||this.#e===void 0?"":this.#e;#n=I(It(this.#o()));#o(t=this.#r){return new Tc(Tr.current,t,{serializer:{serialize:r=>typeof r!="string"?"":r,deserialize:r=>r}})}constructor(){Nn(()=>rs.pre(()=>Tr.current,(t,r)=>{const n=u(this.#n).current;_(this.#n,this.#o(n),!0),r&&localStorage.removeItem(r)}))}get current(){return u(this.#n).current}set current(t){u(this.#n).current=t}}const ro=new Yh;let Da,Fa,Ra=!1,ln=null;function Xh(){return ln||(ln=document.createElement("style"),ln.appendChild(document.createTextNode(`* { +`," ")}const Bh={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Vh(Bh);const Wh=typeof window<"u"?window:void 0;function Hh(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}let Uh=class{#t;#e;constructor(t={}){const{window:r=Wh,document:n=r?.document}=t;r!==void 0&&(this.#t=n,this.#e=Dr(o=>{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?Hh(this.#t):null}};new Uh;const Pr=Dt("mode-watcher-mode"),Tr=Dt("mode-watcher-theme"),Kh=["dark","light","system"];function Pi(e){return typeof e!="string"?!1:Kh.includes(e)}class jh{#t="system";#e=Fn?localStorage:Cc;#r=this.#e.getItem(Pr.current);#n=Pi(this.#r)?this.#r:this.#t;#o=M(It(this.#i()));#i(t=this.#n){return new Tc(Pr.current,t,{serializer:{serialize:r=>r,deserialize:r=>Pi(r)?r:this.#t}})}constructor(){Nn(()=>rs.pre(()=>Pr.current,(t,r)=>{const n=u(this.#o).current;_(this.#o,this.#i(n),!0),r&&localStorage.removeItem(r)}))}get current(){return u(this.#o).current}set current(t){u(this.#o).current=t}}class Gh{#t=void 0;#e=!0;#r=M(It(this.#t));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new dh("prefers-color-scheme: light"):{current:!1};query(){Fn&&_(this.#r,this.#n.current?"light":"dark",!0)}tracking(t){this.#e=t}constructor(){Nn(()=>{re(()=>{this.#e&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return u(this.#r)}}const ao=new jh,Ti=new Gh;class Yh{#t=Fn?localStorage:Cc;#e=this.#t.getItem(Tr.current);#r=this.#e===null||this.#e===void 0?"":this.#e;#n=M(It(this.#o()));#o(t=this.#r){return new Tc(Tr.current,t,{serializer:{serialize:r=>typeof r!="string"?"":r,deserialize:r=>r}})}constructor(){Nn(()=>rs.pre(()=>Tr.current,(t,r)=>{const n=u(this.#n).current;_(this.#n,this.#o(n),!0),r&&localStorage.removeItem(r)}))}get current(){return u(this.#n).current}set current(t){u(this.#n).current=t}}const ro=new Yh;let Da,Fa,Ra=!1,ln=null;function Xh(){return ln||(ln=document.createElement("style"),ln.appendChild(document.createTextNode(`* { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; - }`)),ln)}function Ac(e,t=!1){if(typeof document>"u")return;if(!Ra){Ra=!0,e();return}if(typeof window<"u"&&window.__vitest_worker__){e();return}clearTimeout(Da),clearTimeout(Fa);const n=Xh(),o=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){e(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){o(),t?s():window.requestAnimationFrame(()=>{s()});return}o(),Da=window.setTimeout(()=>{e(),Fa=window.setTimeout(i,16)},16)}const $e=Dt(void 0),lo=Dt(!0),co=Dt(!1),Ci=Dt([]),Ai=Dt([]);function qh(){const e=P(()=>{if(!Fn)return;const t=ao.current==="system"?Ti.current:ao.current,r=Ea(Ci.current),n=Ea(Ai.current);function o(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');t==="light"?(r.length&&i.classList.remove(...r),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&$e.current&&s.setAttribute("content",$e.current.light)):(n.length&&i.classList.remove(...n),r.length&&i.classList.add(...r),i.style.colorScheme="dark",s&&$e.current&&s.setAttribute("content",$e.current.dark))}return lo.current?Ac(o,co.current):o(),t});return{get current(){return u(e)}}}function Zh(){const e=P(()=>{if(ro.current,!Fn)return;function t(){document.documentElement.setAttribute("data-theme",ro.current)}return lo.current?Ac(t,Bt(()=>co.current)):t(),ro.current});return{get current(){return u(e)}}}const os=qh(),Jh=Zh();function kc(){ao.current=os.current==="dark"?"light":"dark"}function Qh(e){ao.current=e}function $h(e){ro.current=e}function tp({defaultMode:e="system",themeColors:t,darkClassNames:r=["dark"],lightClassNames:n=[],defaultTheme:o="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const a=document.documentElement,l=localStorage.getItem(i)??e,c=localStorage.getItem(s)??o,d=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(d?(r.length&&a.classList.remove(...r.filter(Boolean)),n.length&&a.classList.add(...n.filter(Boolean))):(n.length&&a.classList.remove(...n.filter(Boolean)),r.length&&a.classList.add(...r.filter(Boolean))),a.style.colorScheme=d?"light":"dark",t){const f=document.querySelector('meta[name="theme-color"]');f&&f.setAttribute("content",l==="light"?t.light:t.dark)}c&&(a.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var ep=z('');function rp(e,t){D(t,!0);var r=N(),n=A(r);{var o=i=>{var s=ep();zt(()=>Wt(s,"content",t.themeColors.dark)),y(i,s)};nt(n,i=>{t.themeColors&&i(o)})}y(e,r),F()}var np=z(''),op=z(" ",1);function ip(e,t){D(t,!0);let r=w(t,"trueNonce",3,"");Bf("1funsus",n=>{var o=op(),i=A(o);{var s=l=>{var c=np();zt(()=>Wt(c,"content",t.themeColors.dark)),y(l,c)};nt(i,l=>{t.themeColors&&l(s)})}var a=j(i,2);zf(a,()=>`(`+tp.toString()+")("+JSON.stringify(t.initConfig)+");<\/script>"),y(n,o)}),F()}function sp(e,t){D(t,!0);let r=w(t,"track",3,!0),n=w(t,"defaultMode",3,"system"),o=w(t,"disableTransitions",3,!0),i=w(t,"darkClassNames",19,()=>["dark"]),s=w(t,"lightClassNames",19,()=>[]),a=w(t,"defaultTheme",3,""),l=w(t,"nonce",3,""),c=w(t,"themeStorageKey",3,"mode-watcher-theme"),d=w(t,"modeStorageKey",3,"mode-watcher-mode"),f=w(t,"disableHeadScriptInjection",3,!1),h=w(t,"synchronousModeChanges",3,!1);Pr.current=d(),Tr.current=c(),Ci.current=i(),Ai.current=s(),lo.current=o(),$e.current=t.themeColors,co.current=h(),re(()=>{co.current=h()}),re(()=>{lo.current=o()}),re(()=>{$e.current=t.themeColors}),re(()=>{Ci.current=i()}),re(()=>{Ai.current=s()}),re(()=>{Pr.current=d()}),re(()=>{Tr.current=c()}),re(()=>{os.current,Pr.current,Tr.current,Jh.current}),es(()=>{Ti.tracking(r()),Ti.query();const C=localStorage.getItem(Pr.current);Qh(Pi(C)?C:n());const x=localStorage.getItem(Tr.current);$h(x||a())});const p={defaultMode:n(),themeColors:t.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:a(),modeStorageKey:d(),themeStorageKey:c()},g=P(()=>typeof window>"u"?l():"");var v=N(),m=A(v);{var b=C=>{rp(C,{get themeColors(){return $e.current}})},O=C=>{ip(C,{get trueNonce(){return u(g)},get initConfig(){return p},get themeColors(){return $e.current}})};nt(m,C=>{f()?C(b):C(O,!1)})}y(e,v),F()}function ap(e){return typeof e=="function"}function Rn(e){return e!==null&&typeof e=="object"}const lp=["string","number","bigint","boolean"];function ki(e){return e==null||lp.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>ki(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Gr=Symbol("box"),zo=Symbol("is-writable");function E(e,t){const r=P(e);return t?{[Gr]:!0,[zo]:!0,get current(){return u(r)},set current(n){t(n)}}:{[Gr]:!0,get current(){return e()}}}function Ln(e){return Rn(e)&&Gr in e}function is(e){return Ln(e)&&zo in e}function Ec(e){return Ln(e)?e:ap(e)?E(e):qt(e)}function cp(e){return Object.entries(e).reduce((t,[r,n])=>Ln(n)?(is(n)?Object.defineProperty(t,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(t,r,{get(){return n.current}}),t):Object.assign(t,{[r]:n}),{})}function up(e){return is(e)?{[Gr]:!0,get current(){return e.current}}:e}function qt(e){let t=I(It(e));return{[Gr]:!0,[zo]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}function Fr(e){let t=I(It(e));return{[Gr]:!0,[zo]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}Fr.from=Ec;Fr.with=E;Fr.flatten=cp;Fr.readonly=up;Fr.isBox=Ln;Fr.isWritableBox=is;function Oc(...e){return function(t){for(const r of e)if(r){if(t.defaultPrevented)return;typeof r=="function"?r.call(this,t):r.current?.call(this,t)}}}const dp=/\d/,fp=["-","_","/","."];function hp(e=""){if(!dp.test(e))return e!==e.toLowerCase()}function pp(e){const t=[];let r="",n,o;for(const i of e){const s=fp.includes(i);if(s===!0){t.push(r),r="",n=void 0;continue}const a=hp(i);if(o===!1){if(n===!1&&a===!0){t.push(r),r=i,n=a;continue}if(n===!0&&a===!1&&r.length>1){const l=r.at(-1);t.push(r.slice(0,Math.max(0,r.length-1))),r=l+i,n=a;continue}}r+=i,n=a,o=s}return t.push(r),t}function Nc(e){return e?pp(e).map(t=>vp(t)).join(""):""}function gp(e){return mp(Nc(e||""))}function vp(e){return e?e[0].toUpperCase()+e.slice(1):""}function mp(e){return e?e[0].toLowerCase()+e.slice(1):""}function gn(e){if(!e)return{};const t={};function r(n,o){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){t[Nc(n)]=o;return}if(n.startsWith("--")){t[n]=o;return}t[gp(n)]=o}return Fh(e,r),t}function Ve(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}function bp(e,t){const r=RegExp(e,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,t):n}}const yp=bp(/[A-Z]/,e=>`-${e.toLowerCase()}`);function wp(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${yp(t)}: ${e[t]};`).join(` + }`)),ln)}function Ac(e,t=!1){if(typeof document>"u")return;if(!Ra){Ra=!0,e();return}if(typeof window<"u"&&window.__vitest_worker__){e();return}clearTimeout(Da),clearTimeout(Fa);const n=Xh(),o=()=>document.head.appendChild(n),i=()=>{n.parentNode&&document.head.removeChild(n)};function s(){e(),window.requestAnimationFrame(i)}if(typeof window.requestAnimationFrame<"u"){o(),t?s():window.requestAnimationFrame(()=>{s()});return}o(),Da=window.setTimeout(()=>{e(),Fa=window.setTimeout(i,16)},16)}const $e=Dt(void 0),lo=Dt(!0),co=Dt(!1),Ci=Dt([]),Ai=Dt([]);function qh(){const e=P(()=>{if(!Fn)return;const t=ao.current==="system"?Ti.current:ao.current,r=Ea(Ci.current),n=Ea(Ai.current);function o(){const i=document.documentElement,s=document.querySelector('meta[name="theme-color"]');t==="light"?(r.length&&i.classList.remove(...r),n.length&&i.classList.add(...n),i.style.colorScheme="light",s&&$e.current&&s.setAttribute("content",$e.current.light)):(n.length&&i.classList.remove(...n),r.length&&i.classList.add(...r),i.style.colorScheme="dark",s&&$e.current&&s.setAttribute("content",$e.current.dark))}return lo.current?Ac(o,co.current):o(),t});return{get current(){return u(e)}}}function Zh(){const e=P(()=>{if(ro.current,!Fn)return;function t(){document.documentElement.setAttribute("data-theme",ro.current)}return lo.current?Ac(t,Bt(()=>co.current)):t(),ro.current});return{get current(){return u(e)}}}const os=qh(),Jh=Zh();function kc(){ao.current=os.current==="dark"?"light":"dark"}function Qh(e){ao.current=e}function $h(e){ro.current=e}function tp({defaultMode:e="system",themeColors:t,darkClassNames:r=["dark"],lightClassNames:n=[],defaultTheme:o="",modeStorageKey:i="mode-watcher-mode",themeStorageKey:s="mode-watcher-theme"}){const a=document.documentElement,l=localStorage.getItem(i)??e,c=localStorage.getItem(s)??o,d=l==="light"||l==="system"&&window.matchMedia("(prefers-color-scheme: light)").matches;if(d?(r.length&&a.classList.remove(...r.filter(Boolean)),n.length&&a.classList.add(...n.filter(Boolean))):(n.length&&a.classList.remove(...n.filter(Boolean)),r.length&&a.classList.add(...r.filter(Boolean))),a.style.colorScheme=d?"light":"dark",t){const f=document.querySelector('meta[name="theme-color"]');f&&f.setAttribute("content",l==="light"?t.light:t.dark)}c&&(a.setAttribute("data-theme",c),localStorage.setItem(s,c)),localStorage.setItem(i,l)}var ep=z('');function rp(e,t){D(t,!0);var r=N(),n=A(r);{var o=i=>{var s=ep();zt(()=>Wt(s,"content",t.themeColors.dark)),y(i,s)};nt(n,i=>{t.themeColors&&i(o)})}y(e,r),F()}var np=z(''),op=z(" ",1);function ip(e,t){D(t,!0);let r=w(t,"trueNonce",3,"");Bf("1funsus",n=>{var o=op(),i=A(o);{var s=l=>{var c=np();zt(()=>Wt(c,"content",t.themeColors.dark)),y(l,c)};nt(i,l=>{t.themeColors&&l(s)})}var a=j(i,2);zf(a,()=>`(`+tp.toString()+")("+JSON.stringify(t.initConfig)+");<\/script>"),y(n,o)}),F()}function sp(e,t){D(t,!0);let r=w(t,"track",3,!0),n=w(t,"defaultMode",3,"system"),o=w(t,"disableTransitions",3,!0),i=w(t,"darkClassNames",19,()=>["dark"]),s=w(t,"lightClassNames",19,()=>[]),a=w(t,"defaultTheme",3,""),l=w(t,"nonce",3,""),c=w(t,"themeStorageKey",3,"mode-watcher-theme"),d=w(t,"modeStorageKey",3,"mode-watcher-mode"),f=w(t,"disableHeadScriptInjection",3,!1),h=w(t,"synchronousModeChanges",3,!1);Pr.current=d(),Tr.current=c(),Ci.current=i(),Ai.current=s(),lo.current=o(),$e.current=t.themeColors,co.current=h(),re(()=>{co.current=h()}),re(()=>{lo.current=o()}),re(()=>{$e.current=t.themeColors}),re(()=>{Ci.current=i()}),re(()=>{Ai.current=s()}),re(()=>{Pr.current=d()}),re(()=>{Tr.current=c()}),re(()=>{os.current,Pr.current,Tr.current,Jh.current}),es(()=>{Ti.tracking(r()),Ti.query();const C=localStorage.getItem(Pr.current);Qh(Pi(C)?C:n());const x=localStorage.getItem(Tr.current);$h(x||a())});const p={defaultMode:n(),themeColors:t.themeColors,darkClassNames:i(),lightClassNames:s(),defaultTheme:a(),modeStorageKey:d(),themeStorageKey:c()},g=P(()=>typeof window>"u"?l():"");var v=N(),m=A(v);{var b=C=>{rp(C,{get themeColors(){return $e.current}})},O=C=>{ip(C,{get trueNonce(){return u(g)},get initConfig(){return p},get themeColors(){return $e.current}})};nt(m,C=>{f()?C(b):C(O,!1)})}y(e,v),F()}function ap(e){return typeof e=="function"}function Rn(e){return e!==null&&typeof e=="object"}const lp=["string","number","bigint","boolean"];function ki(e){return e==null||lp.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>ki(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Gr=Symbol("box"),zo=Symbol("is-writable");function E(e,t){const r=P(e);return t?{[Gr]:!0,[zo]:!0,get current(){return u(r)},set current(n){t(n)}}:{[Gr]:!0,get current(){return e()}}}function Ln(e){return Rn(e)&&Gr in e}function is(e){return Ln(e)&&zo in e}function Ec(e){return Ln(e)?e:ap(e)?E(e):qt(e)}function cp(e){return Object.entries(e).reduce((t,[r,n])=>Ln(n)?(is(n)?Object.defineProperty(t,r,{get(){return n.current},set(o){n.current=o}}):Object.defineProperty(t,r,{get(){return n.current}}),t):Object.assign(t,{[r]:n}),{})}function up(e){return is(e)?{[Gr]:!0,get current(){return e.current}}:e}function qt(e){let t=M(It(e));return{[Gr]:!0,[zo]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}function Fr(e){let t=M(It(e));return{[Gr]:!0,[zo]:!0,get current(){return u(t)},set current(r){_(t,r,!0)}}}Fr.from=Ec;Fr.with=E;Fr.flatten=cp;Fr.readonly=up;Fr.isBox=Ln;Fr.isWritableBox=is;function Oc(...e){return function(t){for(const r of e)if(r){if(t.defaultPrevented)return;typeof r=="function"?r.call(this,t):r.current?.call(this,t)}}}const dp=/\d/,fp=["-","_","/","."];function hp(e=""){if(!dp.test(e))return e!==e.toLowerCase()}function pp(e){const t=[];let r="",n,o;for(const i of e){const s=fp.includes(i);if(s===!0){t.push(r),r="",n=void 0;continue}const a=hp(i);if(o===!1){if(n===!1&&a===!0){t.push(r),r=i,n=a;continue}if(n===!0&&a===!1&&r.length>1){const l=r.at(-1);t.push(r.slice(0,Math.max(0,r.length-1))),r=l+i,n=a;continue}}r+=i,n=a,o=s}return t.push(r),t}function Nc(e){return e?pp(e).map(t=>vp(t)).join(""):""}function gp(e){return mp(Nc(e||""))}function vp(e){return e?e[0].toUpperCase()+e.slice(1):""}function mp(e){return e?e[0].toLowerCase()+e.slice(1):""}function gn(e){if(!e)return{};const t={};function r(n,o){if(n.startsWith("-moz-")||n.startsWith("-webkit-")||n.startsWith("-ms-")||n.startsWith("-o-")){t[Nc(n)]=o;return}if(n.startsWith("--")){t[n]=o;return}t[gp(n)]=o}return Fh(e,r),t}function Ve(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}function bp(e,t){const r=RegExp(e,"g");return n=>{if(typeof n!="string")throw new TypeError(`expected an argument of type string, but got ${typeof n}`);return n.match(r)?n.replace(r,t):n}}const yp=bp(/[A-Z]/,e=>`-${e.toLowerCase()}`);function wp(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${yp(t)}: ${e[t]};`).join(` `)}function Mc(e={}){return wp(e).replace(` `," ")}const _p=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],xp=new Set(_p);function Sp(e){return xp.has(e)}function ht(...e){const t={...e[0]};for(let r=1;r{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?Pp(this.#t):null}}new Tp;function Dc(e){return typeof e=="function"}function Cp(e,t){if(Dc(e)){const n=e();return n===void 0?t:n}return e===void 0?t:e}class Zt{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Ud(this.#e)}get(){const t=pa(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const r=pa(this.#e);return r===void 0?t:r}set(t){return Hd(this.#e,t)}}function Vo(e,t){let r=I(null);const n=P(()=>Cp(t,250));function o(...i){if(u(r))u(r).timeout&&clearTimeout(u(r).timeout);else{let s,a;const l=new Promise((c,d)=>{s=c,a=d});_(r,{timeout:null,runner:null,promise:l,resolve:s,reject:a},!0)}return u(r).runner=async()=>{if(!u(r))return;const s=u(r);_(r,null);try{s.resolve(await e.apply(this,i))}catch(a){s.reject(a)}},u(r).timeout=setTimeout(u(r).runner,u(n)),u(r).promise}return o.cancel=async()=>{(!u(r)||u(r).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!u(r)||u(r).timeout===null)||(clearTimeout(u(r).timeout),u(r).reject("Cancelled"),_(r,null))},o.runScheduledNow=async()=>{(!u(r)||!u(r).timeout)&&(await new Promise(i=>setTimeout(i,0)),!u(r)||!u(r).timeout)||(clearTimeout(u(r).timeout),u(r).timeout=null,await u(r).runner?.())},Object.defineProperty(o,"pending",{enumerable:!0,get(){return!!u(r)?.timeout}}),o}function Ap(e,t){switch(e){case"post":gt(t);break;case"pre":re(t);break}}function Fc(e,t,r,n={}){const{lazy:o=!1}=n;let i=!o,s=Array.isArray(e)?[]:void 0;Ap(t,()=>{const a=Array.isArray(e)?e.map(c=>c()):e();if(!i){i=!0,s=a;return}const l=Bt(()=>r(a,s));return s=a,l})}function Pt(e,t,r){Fc(e,"post",t,r)}function kp(e,t,r){Fc(e,"pre",t,r)}Pt.pre=kp;function La(e){return Dc(e)?e():e}class Ep{#t={width:0,height:0};#e=!1;#r;#n;#o;#i=P(()=>(u(this.#s)?.(),this.getSize().width));#a=P(()=>(u(this.#s)?.(),this.getSize().height));#s=P(()=>{const t=La(this.#n);if(t)return Dr(r=>{if(!this.#o)return;const n=new this.#o.ResizeObserver(o=>{this.#e=!0;for(const i of o){const s=this.#r.box==="content-box"?i.contentBoxSize:i.borderBoxSize,a=Array.isArray(s)?s:[s];this.#t.width=a.reduce((l,c)=>Math.max(l,c.inlineSize),0),this.#t.height=a.reduce((l,c)=>Math.max(l,c.blockSize),0)}r()});return n.observe(t),()=>{this.#e=!1,n.disconnect()}})});constructor(t,r={box:"border-box"}){this.#o=r.window??Ic,this.#r=r,this.#n=t,this.#t={width:0,height:0}}calculateSize(){const t=La(this.#n);if(!t||!this.#o)return;const r=t.offsetWidth,n=t.offsetHeight;if(this.#r.box==="border-box")return{width:r,height:n};const o=this.#o.getComputedStyle(t),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),a=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),l=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),c=r-i-a,d=n-s-l;return{width:c,height:d}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return u(this.#s)?.(),this.getSize()}get width(){return u(this.#i)}get height(){return u(this.#a)}}class ss{#t=I(!1);constructor(){gt(()=>(Bt(()=>_(this.#t,!0)),()=>{_(this.#t,!1)}))}get current(){return u(this.#t)}}class Op{#t=()=>{};#e=P(()=>this.#t());constructor(t,r){let n;r!==void 0&&(n=r),this.#t=()=>{try{return n}finally{n=t()}}}get current(){return u(this.#e)}}function Rr(e){gt(()=>()=>{e()})}function as(e){gt(()=>Bt(()=>e()))}function Np(e,t){return setTimeout(t,e)}function Ie(e){lc().then(e)}const Mp=1,Ip=9,Dp=11;function Ei(e){return Rn(e)&&e.nodeType===Mp&&typeof e.nodeName=="string"}function Rc(e){return Rn(e)&&e.nodeType===Ip}function Fp(e){return Rn(e)&&e.constructor?.name==="VisualViewport"}function Rp(e){return Rn(e)&&e.nodeType!==void 0}function Lc(e){return Rp(e)&&e.nodeType===Dp&&"host"in e}function Lp(e,t){if(!e||!t||!Ei(e)||!Ei(t))return!1;const r=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(r&&Lc(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Jr(e){return Rc(e)?e:Fp(e)?e.document:e?.ownerDocument??document}function Bo(e){return Lc(e)?Bo(e.host):Rc(e)?e.defaultView??window:Ei(e)?e.ownerDocument?.defaultView??window:window}function zp(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class zn{element;#t=P(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return u(this.#t)}set root(t){_(this.#t,t)}constructor(t){typeof t=="function"?this.element=E(t):this.element=t}getDocument=()=>Jr(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zp(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,r)=>this.getWindow().setTimeout(t,r);clearTimeout=t=>this.getWindow().clearTimeout(t)}function Ot(e,t){return{[yf()]:r=>Ln(e)?(e.current=r,Bt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||(e.current=null,t?.(null))}):(e(r),Bt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||(e(null),t?.(null))})}}function zc(e){return e?"true":"false"}function Vp(e){return e?"true":void 0}function sr(e){return e?"":void 0}function ls(e){return e?"open":"closed"}class Bp{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(r=>[r,this.getAttr(r)]))}getAttr(t,r){return r?`data-${r}-${t}`:`${this.#e}${t}`}selector(t,r){return`[${this.getAttr(t,r)}]`}}function Vn(e){const t=new Bp(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Tn="ArrowDown",cs="ArrowLeft",us="ArrowRight",uo="ArrowUp",Vc="End",ds="Enter",Wp="Escape",Bc="Home",Hp="PageDown",Up="PageUp",Wo=" ",Kp="Tab";function jp(e){return window.getComputedStyle(e).getPropertyValue("direction")}function Gp(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?cs:us,vertical:Tn}[t]}function Yp(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?us:cs,vertical:uo}[t]}function Xp(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Gp(e,t),prevKey:Yp(e,t)}}const Wc=typeof document<"u",za=qp();function qp(){return Wc&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function He(e){return e instanceof HTMLElement}function De(e){return e instanceof Element}function Hc(e){return e instanceof Element||e instanceof SVGElement}function Zp(e){return e.matches(":focus-visible")}function Jp(e){return e!==null}function Qp(e){return e instanceof HTMLInputElement&&"select"in e}class $p{#t;#e=Fr(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,r,n=!1){const o=this.#t.rootNode.current;if(!o||!t)return;const i=this.getCandidateNodes();if(!i.length)return;const s=i.indexOf(t),a=jp(o),{nextKey:l,prevKey:c}=Xp(a,this.#t.orientation.current),d=this.#t.loop.current,f={[l]:s+1,[c]:s-1,[Bc]:0,[Vc]:i.length-1};if(n){const g=l===Tn?us:Tn,v=c===uo?cs:uo;f[g]=s+1,f[v]=s-1}let h=f[r.key];if(h===void 0)return;r.preventDefault(),h<0&&d?h=i.length-1:h===i.length&&d&&(h=0);const p=i[h];if(p)return p.focus(),this.#e.current=p.id,this.#t.onCandidateFocus?.(p),p}getTabIndex(t){const r=this.getCandidateNodes(),n=this.#e.current!==null;return t&&!n&&r[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const r=this.#t.rootNode.current?.querySelector(`#${t}`);!r||!He(r)||r.focus()}}class tg{#t;#e=null;constructor(t){this.#t=t,Rr(()=>this.#r())}#r(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#r();const r=this.#t.ref.current;if(r){if(typeof r.getAnimations!="function"){this.#n(t);return}this.#e=window.requestAnimationFrame(()=>{const n=r.getAnimations();if(n.length===0){this.#n(t);return}Promise.allSettled(n.map(o=>o.finished)).then(()=>{this.#n(t)})})}}#n(t){const r=()=>{t()};this.#t.afterTick?Ie(r):r()}}class fo{#t;#e;#r;#n=I(!1);constructor(t){this.#t=t,_(this.#n,t.open.current,!0),this.#e=t.enabled??!0,this.#r=new tg({ref:this.#t.ref,afterTick:this.#t.open}),Pt(()=>this.#t.open.current,r=>{r&&_(this.#n,!0),this.#e&&this.#r.run(()=>{r===this.#t.open.current&&(this.#t.open.current||_(this.#n,!1),this.#t.onComplete?.())})})}get shouldRender(){return u(this.#n)}}function St(){}function jt(e,t){return`bits-${e}`}const eg=Vn({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Nr=new Zt("Dialog.Root | AlertDialog.Root");class fs{static create(t){const r=Nr.getOr(null);return Nr.set(new fs(t,r))}opts;#t=I(null);get triggerNode(){return u(this.#t)}set triggerNode(t){_(this.#t,t,!0)}#e=I(null);get contentNode(){return u(this.#e)}set contentNode(t){_(this.#e,t,!0)}#r=I(null);get overlayNode(){return u(this.#r)}set overlayNode(t){_(this.#r,t,!0)}#n=I(null);get descriptionNode(){return u(this.#n)}set descriptionNode(t){_(this.#n,t,!0)}#o=I(void 0);get contentId(){return u(this.#o)}set contentId(t){_(this.#o,t,!0)}#i=I(void 0);get titleId(){return u(this.#i)}set titleId(t){_(this.#i,t,!0)}#a=I(void 0);get triggerId(){return u(this.#a)}set triggerId(t){_(this.#a,t,!0)}#s=I(void 0);get descriptionId(){return u(this.#s)}set descriptionId(t){_(this.#s,t,!0)}#l=I(null);get cancelNode(){return u(this.#l)}set cancelNode(t){_(this.#l,t,!0)}#c=I(0);get nestedOpenCount(){return u(this.#c)}set nestedOpenCount(t){_(this.#c,t,!0)}depth;parent;contentPresence;overlayPresence;constructor(t,r){this.opts=t,this.parent=r,this.depth=r?r.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new fo({ref:E(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new fo({ref:E(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Pt(()=>this.opts.open.current,n=>{this.parent&&(n?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Rr(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=t=>eg.getAttr(t,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=P(()=>({"data-state":ls(this.opts.open.current)}));get sharedProps(){return u(this.#u)}set sharedProps(t){_(this.#u,t)}}class hs{static create(t){return new hs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Wo||t.key===ds)&&(t.preventDefault(),this.root.handleClose())}#t=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class ps{static create(t){return new ps(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.root.titleId=this.opts.id.current,this.attachment=Ot(this.opts.ref),Pt.pre(()=>this.opts.id.current,n=>{this.root.titleId=n})}#t=P(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class gs{static create(t){return new gs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.root.descriptionId=this.opts.id.current,this.attachment=Ot(this.opts.ref,n=>{this.root.descriptionNode=n}),Pt.pre(()=>this.opts.id.current,n=>{this.root.descriptionId=n})}#t=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class vs{static create(t){return new vs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>{this.root.contentNode=n,this.root.contentId=n?.id})}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":sr(this.root.nestedOpenCount>0),"data-nested":sr(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}get shouldRender(){return this.root.contentPresence.shouldRender}}class ms{static create(t){return new ms(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>this.root.overlayNode=n)}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":sr(this.root.nestedOpenCount>0),"data-nested":sr(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}get shouldRender(){return this.root.overlayPresence.shouldRender}}var rg=z("
");function ng(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"level",3,2),s=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const a=ps.create({id:E(()=>n()),level:E(()=>i()),ref:E(()=>o(),p=>o(p))}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=p=>{var g=N(),v=A(g);B(v,()=>t.child,()=>({props:u(l)})),y(p,g)},h=p=>{var g=rg();wt(g,()=>({...u(l)}));var v=et(g);B(v,()=>t.children??Q),y(p,g)};nt(d,p=>{t.child?p(f):p(h,!1)})}y(e,c),F()}function og(e,t){var r=N(),n=A(r);If(n,()=>t.children,o=>{var i=N(),s=A(i);B(s,()=>t.children??Q),y(o,i)}),y(e,r)}const ig=new Zt("BitsConfig");function sg(){const e=new ag(null,{});return ig.getOr(e).opts}class ag{opts;constructor(t,r){const n=lg(t,r);this.opts={defaultPortalTo:n(o=>o.defaultPortalTo),defaultLocale:n(o=>o.defaultLocale)}}}function lg(e,t){return r=>E(()=>{const o=r(t)?.current;if(o!==void 0)return o;if(e!==null)return r(e.opts)?.current})}function cg(e,t){return r=>{const n=sg();return E(()=>{const o=r();if(o!==void 0)return o;const i=e(n).current;return i!==void 0?i:t})}}const ug=cg(e=>e.defaultPortalTo,"body");function bs(e,t){D(t,!0);const r=ug(()=>t.to),n=Kd();let o=P(i);function i(){if(!Wc||t.disabled)return null;let f=null;return typeof r.current=="string"?f=document.querySelector(r.current):f=r.current,f}let s;function a(){s&&(Nf(s),s=null)}Pt([()=>u(o),()=>t.disabled],([f,h])=>{if(!f||h){a();return}return s=gc(og,{target:f,props:{children:t.children},context:n}),()=>{a()}});var l=N(),c=A(l);{var d=f=>{var h=N(),p=A(h);B(p,()=>t.children??Q),y(f,h)};nt(c,f=>{t.disabled&&f(d)})}y(e,l),F()}class dg{eventName;options;constructor(t,r={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=r}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,r){const n=this.createEvent(r);return t.dispatchEvent(n),n}listen(t,r,n){const o=i=>{r(i)};return dt(t,this.eventName,o,n)}}function Va(e,t=500){let r=null;const n=(...o)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.destroy=()=>{r!==null&&(clearTimeout(r),r=null)},n}function Uc(e,t){return e===t||e.contains(t)}function Kc(e){return e?.ownerDocument??document}function fg(e,t){const{clientX:r,clientY:n}=e,o=t.getBoundingClientRect();return ro.right||no.bottom}const hg=[ds,Wo],pg=[Tn,Up,Bc],jc=[uo,Hp,Vc],gg=[...pg,...jc];function Ba(e){return e.pointerType==="mouse"}function vg(e,{select:t=!1}={}){if(!e||!e.focus)return;const r=Jr(e);if(r.activeElement===e)return;const n=r.activeElement;e.focus({preventScroll:!0}),e!==n&&Qp(e)&&t&&e.select()}function mg(e,{select:t=!1}={},r){const n=r();for(const o of e)if(vg(o,{select:t}),r()!==n)return!0}let cn=I(!1);class Je{static _refs=0;static _cleanup;constructor(){gt(()=>(Je._refs===0&&(Je._cleanup=Nn(()=>{const t=[],r=o=>{_(cn,!1)},n=o=>{_(cn,!0)};return t.push(dt(document,"pointerdown",r,{capture:!0}),dt(document,"pointermove",r,{capture:!0}),dt(document,"keydown",n,{capture:!0})),Ve(...t)})),Je._refs++,()=>{Je._refs--,Je._refs===0&&(_(cn,!1),Je._cleanup?.())}))}get current(){return u(cn)}set current(t){_(cn,t,!0)}}var Gc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ho=Gc.join(","),Yc=typeof Element>"u",Mr=Yc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,po=!Yc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},go=function(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),i=o===""||o==="true",s=i||r&&t&&(typeof t.closest=="function"?t.closest("[inert]"):go(t.parentNode));return s},bg=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},Xc=function(t,r,n){if(go(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ho));return r&&Mr.call(t,ho)&&o.unshift(t),o=o.filter(n),o},vo=function(t,r,n){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!go(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=vo(l,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Mr.call(s,ho);d&&n.filter(s)&&(r||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),h=!go(f,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(f&&h){var p=vo(f===!0?s.children:f.children,!0,n);n.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},qc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Zc=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||bg(t))&&!qc(t)?0:t.tabIndex},yg=function(t,r){var n=Zc(t);return n<0&&r&&!qc(t)?0:n},wg=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},Jc=function(t){return t.tagName==="INPUT"},_g=function(t){return Jc(t)&&t.type==="hidden"},xg=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},Sg=function(t,r){for(var n=0;nsummary:first-of-type"),a=s?t.parentElement:t;if(Mr.call(a,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,d=po(t);if(c&&!c.shadowRoot&&o(c)===!0)return Wa(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=l}if(Ag(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Wa(t);return!1},Eg=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n=0)},Qc=function(t){var r=[],n=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=yg(a,s),c=s?Qc(o.candidates):a;l===0?s?r.push.apply(r,c):r.push(a):n.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),n.sort(wg).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},$c=function(t,r){r=r||{};var n;return r.getShadowRoot?n=vo([t],r.includeContainer,{filter:Oi.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:Og}):n=Xc(t,r.includeContainer,Oi.bind(null,r)),Qc(n)},tu=function(t,r){r=r||{};var n;return r.getShadowRoot?n=vo([t],r.includeContainer,{filter:mo.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=Xc(t,r.includeContainer,mo.bind(null,r)),n},ys=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Mr.call(t,ho)===!1?!1:Oi(r,t)},Ng=Gc.concat("iframe:not([inert]):not([inert] *)").join(","),eu=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Mr.call(t,Ng)===!1?!1:mo(r,t)};function wn(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Mg(e,t){if(!ys(e,wn()))return Ig(e,t);const r=Jr(e),n=$c(r.body,wn());t==="prev"&&n.reverse();const o=n.indexOf(e);return o===-1?r.body:n.slice(o+1)[0]}function Ig(e,t){const r=Jr(e);if(!eu(e,wn()))return r.body;const n=tu(r.body,wn());t==="prev"&&n.reverse();const o=n.indexOf(e);return o===-1?r.body:n.slice(o+1).find(s=>ys(s,wn()))??r.body}function ru(e,t,r){const n=t.toLowerCase();if(n.endsWith(" ")){const f=n.slice(0,-1);if(e.filter(v=>v.toLowerCase().startsWith(f)).length<=1)return ru(e,f,r);const p=r?.toLowerCase();if(p&&p.startsWith(f)&&p.charAt(f.length)===" "&&t.trim()===f)return r;const g=e.filter(v=>v.toLowerCase().startsWith(n));if(g.length>0){const v=r?e.indexOf(r):-1;return Ha(g,Math.max(v,0)).find(O=>O!==r)||r}}const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=i.toLowerCase(),a=r?e.indexOf(r):-1;let l=Ha(e,Math.max(a,0));i.length===1&&(l=l.filter(f=>f!==r));const d=l.find(f=>f?.toLowerCase().startsWith(s));return d!==r?d:void 0}function Ha(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const Dg={afterMs:1e4,onChange:St};function nu(e,t){const{afterMs:r,onChange:n,getWindow:o}={...Dg,...t};let i=null,s=I(It(e));function a(){return o().setTimeout(()=>{_(s,e,!0),n?.(e)},r)}return gt(()=>()=>{i&&o().clearTimeout(i)}),E(()=>u(s),l=>{_(s,l,!0),n?.(l),i&&o().clearTimeout(i),i=a()})}class Fg{#t;#e;#r=P(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#n=P(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=nu("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,r){if(!r.length)return;this.#e.current=this.#e.current+t;const n=u(this.#n)(),o=r.find(l=>l===n)?.textContent?.trim()??"",i=r.map(l=>l.textContent?.trim()??""),s=ru(i,this.#e.current,o),a=r.find(l=>l.textContent?.trim()===s);return a&&u(this.#r)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Rg{#t;#e;#r;#n=I(null);constructor(t){this.#t=t,this.#e=P(()=>this.#t.enabled()),this.#r=nu(!1,{afterMs:t.transitTimeout??300,onChange:r=>{u(this.#e)&&this.#t.setIsPointerInTransit?.(r)},getWindow:()=>Bo(this.#t.triggerNode())}),Pt([t.triggerNode,t.contentNode,t.enabled],([r,n,o])=>{if(!r||!n||!o)return;const i=a=>{this.#i(a,n)},s=a=>{this.#i(a,r)};return Ve(dt(r,"pointerleave",i),dt(n,"pointerleave",s))}),Pt(()=>u(this.#n),()=>{const r=o=>{if(!u(this.#n))return;const i=o.target;if(!De(i))return;const s={x:o.clientX,y:o.clientY},a=t.triggerNode()?.contains(i)||t.contentNode()?.contains(i),l=!Bg(s,u(this.#n));a?this.#o():l&&(this.#o(),t.onPointerExit())},n=Jr(t.triggerNode()??t.contentNode());if(n)return dt(n,"pointermove",r)})}#o(){_(this.#n,null),this.#r.current=!1}#i(t,r){const n=t.currentTarget;if(!He(n))return;const o={x:t.clientX,y:t.clientY},i=Lg(o,n.getBoundingClientRect()),s=zg(o,i),a=Vg(r.getBoundingClientRect()),l=Wg([...s,...a]);_(this.#n,l,!0),this.#r.current=!0}}function Lg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function zg(e,t,r=5){const n=r*1.5;switch(t){case"top":return[{x:e.x-r,y:e.y+r},{x:e.x,y:e.y-n},{x:e.x+r,y:e.y+r}];case"bottom":return[{x:e.x-r,y:e.y-r},{x:e.x,y:e.y+n},{x:e.x+r,y:e.y-r}];case"left":return[{x:e.x+r,y:e.y-r},{x:e.x-n,y:e.y},{x:e.x+r,y:e.y+r}];case"right":return[{x:e.x-r,y:e.y-r},{x:e.x+n,y:e.y},{x:e.x-r,y:e.y+r}]}}function Vg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Bg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;in!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Wg(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),Hg(t)}function Hg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}const Ug="data-context-menu-trigger",Kg="data-context-menu-content",ou=new Zt("Menu.Root"),ws=new Zt("Menu.Root | Menu.Sub"),iu=new Zt("Menu.Content"),jg=new dg("bitsmenuopen",{bubbles:!1,cancelable:!0}),Gg=Vn({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class _s{static create(t){const r=new _s(t);return ou.set(r)}opts;isUsingKeyboard=new Je;#t=I(!1);get ignoreCloseAutoFocus(){return u(this.#t)}set ignoreCloseAutoFocus(t){_(this.#t,t,!0)}#e=I(!1);get isPointerInTransit(){return u(this.#e)}set isPointerInTransit(t){_(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Gg.getAttr(t,this.opts.variant.current)}class xs{static create(t,r){return ws.set(new xs(t,r,null))}opts;root;parentMenu;contentId=E(()=>"");#t=I(null);get contentNode(){return u(this.#t)}set contentNode(t){_(this.#t,t,!0)}contentPresence;#e=I(null);get triggerNode(){return u(this.#e)}set triggerNode(t){_(this.#e,t,!0)}constructor(t,r,n){this.opts=t,this.root=r,this.parentMenu=n,this.contentPresence=new fo({ref:E(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),n&&Pt(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Ss{static create(t){return iu.set(new Ss(t,ws.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=I("");get search(){return u(this.#t)}set search(t){_(this.#t,t,!0)}#e=0;#r;#n=I(!1);get mounted(){return u(this.#n)}set mounted(t){_(this.#n,t,!0)}#o;constructor(t,r){this.opts=t,this.parentMenu=r,this.domContext=new zn(t.ref),this.attachment=Ot(this.opts.ref,n=>{this.parentMenu.contentNode!==n&&(this.parentMenu.contentNode=n)}),r.contentId=t.id,this.#o=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Rg({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:n=>{this.parentMenu.root.isPointerInTransit=n}}),this.#r=new Fg({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new $p({rootNode:E(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:E(()=>"vertical")}),Pt(()=>this.parentMenu.contentNode,n=>{if(!n)return;const o=()=>{Ie(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return jg.listen(n,o)}),gt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#i(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#o)&&this.parentMenu.triggerNode&&ys(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let r=this.parentMenu;for(;r.parentMenu!==null;)r=r.parentMenu;if(!r.triggerNode)return;t.preventDefault();const n=Mg(r.triggerNode,t.shiftKey?"prev":"next");n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,r.onClose(),Ie(()=>{n.focus(),Ie(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Kp){this.handleTabKeyDown(t);return}const r=t.target,n=t.currentTarget;if(!He(r)||!He(n))return;const o=r.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,i=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(r,t)||t.code==="Space")return;const l=this.#i();o&&!i&&s&&this.#r(t.key,l),t.target?.id===this.parentMenu.contentId.current&&gg.includes(t.key)&&(t.preventDefault(),jc.includes(t.key)&&l.reverse(),mg(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){De(t.currentTarget)&&De(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Ie(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Hc(t.target))return;const r=this.parentMenu.triggerNode?.id;if(t.target.id===r){t.preventDefault();return}t.target.closest(`#${r}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=P(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return u(this.#s)}set snippetProps(t){_(this.#s,t)}#l=P(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":ls(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return u(this.#l)}set props(t){_(this.#l,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Yg{opts;content;attachment;#t=I(!1);constructor(t,r){this.opts=t,this.content=r,this.attachment=Ot(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Ba(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const n=t.currentTarget;if(!He(n))return;n.focus()}}onpointerleave(t){t.defaultPrevented||Ba(t)&&this.content.onItemLeave(t)}onfocus(t){Ie(()=>{t.defaultPrevented||this.opts.disabled.current||_(this.#t,!0)})}onblur(t){Ie(()=>{t.defaultPrevented||_(this.#t,!1)})}#e=P(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":zc(this.opts.disabled.current),"data-disabled":sr(this.opts.disabled.current),"data-highlighted":u(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Ps{static create(t){const r=new Yg(t,iu.get());return new Ps(t,r)}opts;item;root;#t=!1;constructor(t,r){this.opts=t,this.item=r,this.root=r.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const r=this.item.content.search!=="";if(!(this.item.opts.disabled.current||r&&t.key===Wo)&&hg.includes(t.key)){if(!He(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!He(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#r=P(()=>ht(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Ts{static create(t){return new Ts(t,ou.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref)}#t=P(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class Cs{static create(t){return new Cs(t,ws.get())}opts;parentMenu;attachment;constructor(t,r){this.opts=t,this.parentMenu=r,this.attachment=Ot(this.opts.ref,n=>this.parentMenu.triggerNode=n)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===Wo||t.key===ds){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Tn&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=P(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=P(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":zc(this.parentMenu.opts.open.current),"aria-controls":u(this.#t),"data-disabled":sr(this.opts.disabled.current),"data-state":ls(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class As{static create(t){return new As(t)}opts;#t;#e;#r={pointerdown:!1};#n=!1;#o=!1;#i=void 0;#a;#s=St;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,gt(()=>{this.#i=Kc(this.opts.ref.current)});let r=St;const n=()=>{this.#v(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),r()};Pt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Np(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),r(),r=this.#c())}),n}),Rr(()=>{this.#v.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),r()})}#l=t=>{t.defaultPrevented||this.opts.ref.current&&Ie(()=>{!this.opts.ref.current||this.#g(t.target)||t.target&&!this.#o&&this.#a.current?.(t)})};#c(){return Ve(dt(this.#i,"pointerdown",Ve(this.#h,this.#f),{capture:!0}),dt(this.#i,"pointerdown",Ve(this.#p,this.#d)),dt(this.#i,"focusin",this.#l))}#u=t=>{let r=t;r.defaultPrevented&&(r=Ua(t)),this.#t.current(t)};#d=Va(t=>{if(!this.opts.ref.current){this.#s();return}const r=this.opts.isValidEvent.current(t,this.opts.ref.current)||Zg(t,this.opts.ref.current);if(!this.#n||this.#m()||!r){this.#s();return}let n=t;if(n.defaultPrevented&&(n=Ua(n)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=dt(this.#i,"click",this.#u,{once:!0})):this.#t.current(n)},10);#h=t=>{this.#r[t.type]=!0};#p=t=>{this.#r[t.type]=!1};#f=()=>{this.opts.ref.current&&(this.#n=qg(this.opts.ref.current))};#g=t=>this.opts.ref.current?Uc(this.opts.ref.current,t):!1;#v=Va(()=>{for(const t in this.#r)this.#r[t]=!1;this.#n=!1},20);#m(){return Object.values(this.#r).some(Boolean)}#_=()=>{this.#o=!0};#b=()=>{this.#o=!1};props={onfocuscapture:this.#_,onblurcapture:this.#b}}function Xg(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:r}])=>r==="close"||r==="ignore")}function qg(e){const t=[...globalThis.bitsDismissableLayers],r=Xg(t);if(r)return r[0].opts.ref.current===e;const[n]=t[0];return n.opts.ref.current===e}function Zg(e,t){const r=e.target;if(!Hc(r))return!1;const n=!!r.closest(`[${Ug}]`);if("button"in e&&e.button>0&&!n)return!1;if("button"in e&&e.button===0&&n)return!0;const o=!!t.closest(`[${Kg}]`);return n&&o?!1:Kc(r).documentElement.contains(r)&&!Uc(t,r)&&fg(e,t)}function Ua(e){const t=e.currentTarget,r=e.target;let n;e instanceof PointerEvent?n=new PointerEvent(e.type,e):n=new PointerEvent("pointerdown",e);let o=!1;return new Proxy(n,{get:(s,a)=>a==="currentTarget"?t:a==="target"?r:a==="preventDefault"?()=>{o=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:a==="defaultPrevented"?o:a in s?s[a]:e[a]})}function su(e,t){D(t,!0);let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"onInteractOutside",3,St),o=w(t,"onFocusOutside",3,St),i=w(t,"isValidEvent",3,()=>!1);const s=As.create({id:E(()=>t.id),interactOutsideBehavior:E(()=>r()),onInteractOutside:E(()=>n()),enabled:E(()=>t.enabled),onFocusOutside:E(()=>o()),isValidEvent:E(()=>i()),ref:t.ref});var a=N(),l=A(a);B(l,()=>t.children??Q,()=>({props:s.props})),y(e,a),F()}globalThis.bitsEscapeLayers??=new Map;class ks{static create(t){return new ks(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new zn(this.opts.ref);let r=St;Pt(()=>t.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),r=this.#t()),()=>{r(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>dt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Wp||!Jg(this))return;const r=new KeyboardEvent(t.type,t);t.preventDefault();const n=this.opts.escapeKeydownBehavior.current;n!=="close"&&n!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(r)}}function Jg(e){const t=[...globalThis.bitsEscapeLayers],r=t.findLast(([o,{current:i}])=>i==="close"||i==="ignore");if(r)return r[0]===e;const[n]=t[0];return n===e}function au(e,t){D(t,!0);let r=w(t,"escapeKeydownBehavior",3,"close"),n=w(t,"onEscapeKeydown",3,St);ks.create({escapeKeydownBehavior:E(()=>r()),onEscapeKeydown:E(()=>n()),enabled:E(()=>t.enabled),ref:t.ref});var o=N(),i=A(o);B(i,()=>t.children??Q),y(e,o),F()}class Es{static instance;#t=qt([]);#e=new WeakMap;#r=new WeakMap;static getInstance(){return this.instance||(this.instance=new Es),this.instance}register(t){const r=this.getActive();r&&r!==t&&r.pause();const n=document.activeElement;n&&n!==document.body&&this.#r.set(t,n),this.#t.current=this.#t.current.filter(o=>o!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(n=>n!==t);const r=this.getActive();r&&r.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,r){this.#e.set(t,r)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,r){this.#r.set(t,r)}getPreFocusMemory(t){return this.#r.get(t)}clearPreFocusMemory(t){this.#r.delete(t)}}class Os{#t=!1;#e=null;#r=Es.getInstance();#n=[];#o;constructor(t){this.#o=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#i(){for(const t of this.#n)t();this.#n=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#r.register(this),this.#l(),this.#a()}unmount(){this.#e&&(this.#i(),this.#s(),this.#r.unregister(this),this.#r.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#o.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const r=this.#u();r?(r.focus(),this.#r.setFocusMemory(this,r)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#o.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const r=this.#r.getPreFocusMemory(this);if(r&&document.contains(r))try{r.focus()}catch{document.body.focus()}}}#l(){if(!this.#e||!this.#o.trap.current)return;const t=this.#e,r=t.ownerDocument,n=s=>{if(this.#t||!this.#r.isActiveScope(this))return;const a=s.target;if(!a)return;if(t.contains(a))this.#r.setFocusMemory(this,a);else{const c=this.#r.getFocusMemory(this);if(c&&t.contains(c)&&eu(c))s.preventDefault(),c.focus();else{const d=this.#u(),f=this.#d()[0];(d||f||t).focus()}}},o=s=>{if(!this.#o.loop||this.#t||s.key!=="Tab"||!this.#r.isActiveScope(this))return;const a=this.#c();if(a.length===0)return;const l=a[0],c=a[a.length-1];!s.shiftKey&&r.activeElement===c?(s.preventDefault(),l.focus()):s.shiftKey&&r.activeElement===l&&(s.preventDefault(),c.focus())};this.#n.push(dt(r,"focusin",n,{capture:!0}),dt(t,"keydown",o));const i=new MutationObserver(()=>{const s=this.#r.getFocusMemory(this);if(s&&!t.contains(s)){const a=this.#u(),l=this.#d()[0],c=a||l;c?(c.focus(),this.#r.setFocusMemory(this,c)):t.focus()}});i.observe(t,{childList:!0,subtree:!0}),this.#n.push(()=>i.disconnect())}#c(){return this.#e?$c(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#c()[0]||null}#d(){return this.#e?tu(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let r=null;return Pt([()=>t.ref.current,()=>t.enabled.current],([n,o])=>{n&&o?(r||(r=new Os(t)),r.mount(n)):r&&(r.unmount(),r=null)}),Rr(()=>{r?.unmount()}),{get props(){return{tabindex:-1}}}}}function lu(e,t){D(t,!0);let r=w(t,"enabled",3,!1),n=w(t,"trapFocus",3,!1),o=w(t,"loop",3,!1),i=w(t,"onCloseAutoFocus",3,St),s=w(t,"onOpenAutoFocus",3,St);const a=Os.use({enabled:E(()=>r()),trap:E(()=>n()),loop:o(),onCloseAutoFocus:E(()=>i()),onOpenAutoFocus:E(()=>s()),ref:t.ref});var l=N(),c=A(l);B(c,()=>t.focusScope??Q,()=>({props:a.props})),y(e,l),F()}globalThis.bitsTextSelectionLayers??=new Map;class Ns{static create(t){return new Ns(t)}opts;domContext;#t=St;constructor(t){this.opts=t,this.domContext=new zn(t.ref);let r=St;Pt(()=>this.opts.enabled.current,n=>(n&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),r(),r=this.#e()),()=>{r(),this.#n(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return Ve(dt(this.domContext.getDocument(),"pointerdown",this.#r),dt(this.domContext.getDocument(),"pointerup",Oc(this.#n,this.opts.onPointerUp.current)))}#r=t=>{const r=this.opts.ref.current,n=t.target;!He(r)||!He(n)||!this.opts.enabled.current||!$g(this)||!Lp(r,n)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=Qg(r,this.domContext.getDocument().body)))};#n=()=>{this.#t(),this.#t=St}}const Ka=e=>e.style.userSelect||e.style.webkitUserSelect;function Qg(e,t){const r=Ka(t),n=Ka(e);return Xn(t,"none"),Xn(e,"text"),()=>{Xn(t,r),Xn(e,n)}}function Xn(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function $g(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const r=t.at(-1);return r?r[0]===e:!1}function cu(e,t){D(t,!0);let r=w(t,"preventOverflowTextSelection",3,!0),n=w(t,"onPointerDown",3,St),o=w(t,"onPointerUp",3,St);Ns.create({id:E(()=>t.id),onPointerDown:E(()=>n()),onPointerUp:E(()=>o()),enabled:E(()=>t.enabled&&r()),ref:t.ref});var i=N(),s=A(i);B(s,()=>t.children??Q),y(e,i),F()}globalThis.bitsIdCounter??={current:0};function Qr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class tv{#t;#e=0;#r=I();#n;constructor(t){this.#t=t}#o(){this.#e-=1,this.#n&&this.#e<=0&&(this.#n(),_(this.#r,void 0),this.#n=void 0)}get(...t){return this.#e+=1,u(this.#r)===void 0&&(this.#n=Nn(()=>{_(this.#r,this.#t(...t),!0)})),gt(()=>()=>{this.#o()}),u(this.#r)}}const no=new ah;let qn=I(null),ii=null,un=null,dn=!1;const ja=E(()=>{for(const e of no.values())if(e)return!0;return!1});let si=null;const ev=new tv(()=>{function e(){document.body.setAttribute("style",u(qn)??""),document.body.style.removeProperty("--scrollbar-width"),za&&ii?.(),_(qn,null)}function t(){un!==null&&(window.clearTimeout(un),un=null)}function r(o,i){t(),dn=!0,si=Date.now();const s=si,a=()=>{un=null,si===s&&(uu(no)?dn=!1:(dn=!1,i()))},l=o===null?24:o;un=window.setTimeout(a,l)}function n(){u(qn)===null&&no.size===0&&!dn&&_(qn,document.body.getAttribute("style"),!0)}return Pt(()=>ja.current,()=>{if(!ja.current)return;n(),dn=!1;const o=getComputedStyle(document.documentElement),i=getComputedStyle(document.body),s=o.scrollbarGutter?.includes("stable")||i.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,c={padding:Number.parseInt(i.paddingRight??"0",10)+a,margin:Number.parseInt(i.marginRight??"0",10)};a>0&&!s&&(document.body.style.paddingRight=`${c.padding}px`,document.body.style.marginRight=`${c.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",za&&(ii=dt(document,"touchmove",d=>{d.target===document.documentElement&&(d.touches.length>1||d.preventDefault())},{passive:!1})),Ie(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Rr(()=>()=>{ii?.()}),{get lockMap(){return no},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:r,cancelPendingCleanup:t,ensureInitialStyleCaptured:n}});class rv{#t=Qr();#e;#r=()=>null;#n;locked;constructor(t,r=()=>null){this.#e=t,this.#r=r,this.#n=ev.get(),this.#n&&(this.#n.cancelPendingCleanup(),this.#n.ensureInitialStyleCaptured(),this.#n.lockMap.set(this.#t,this.#e??!1),this.locked=E(()=>this.#n.lockMap.get(this.#t)??!1,n=>this.#n.lockMap.set(this.#t,n)),Rr(()=>{if(this.#n.lockMap.delete(this.#t),uu(this.#n.lockMap))return;const n=this.#r();this.#n.scheduleCleanupIfNoNewLocks(n,()=>{this.#n.resetBodyStyle()})}))}}function uu(e){for(const[t,r]of e)if(r)return!0;return!1}function bo(e,t){D(t,!0);let r=w(t,"preventScroll",3,!0),n=w(t,"restoreScrollDelay",3,null);r()&&new rv(r(),()=>n()),F()}var nv=z("
");function ov(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"forceMount",3,!1),i=w(t,"ref",15,null),s=K(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const a=ms.create({id:E(()=>n()),ref:E(()=>i(),h=>i(h))}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=h=>{var p=N(),g=A(p);{var v=b=>{var O=N(),C=A(O);{let x=P(()=>({props:ht(u(l)),...a.snippetProps}));B(C,()=>t.child,()=>u(x))}y(b,O)},m=b=>{var O=nv();wt(O,x=>({...x}),[()=>ht(u(l))]);var C=et(O);B(C,()=>t.children??Q,()=>a.snippetProps),y(b,O)};nt(g,b=>{t.child?b(v):b(m,!1)})}y(h,p)};nt(d,h=>{(a.shouldRender||o())&&h(f)})}y(e,c),F()}var iv=z("
");function sv(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=K(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=gs.create({id:E(()=>n()),ref:E(()=>o(),h=>o(h))}),a=P(()=>ht(i,s.props));var l=N(),c=A(l);{var d=h=>{var p=N(),g=A(p);B(g,()=>t.child,()=>({props:u(a)})),y(h,p)},f=h=>{var p=iv();wt(p,()=>({...u(a)}));var g=et(p);B(g,()=>t.children??Q),y(h,p)};nt(c,h=>{t.child?h(d):h(f,!1)})}y(e,l),F()}const av=["top","right","bottom","left"],ar=Math.min,ne=Math.max,yo=Math.round,Zn=Math.floor,Pe=e=>({x:e,y:e}),lv={left:"right",right:"left",bottom:"top",top:"bottom"},cv={start:"end",end:"start"};function Ni(e,t,r){return ne(e,ar(t,r))}function Ue(e,t){return typeof e=="function"?e(t):e}function Ke(e){return e.split("-")[0]}function $r(e){return e.split("-")[1]}function Ms(e){return e==="x"?"y":"x"}function Is(e){return e==="y"?"height":"width"}const uv=new Set(["top","bottom"]);function _e(e){return uv.has(Ke(e))?"y":"x"}function Ds(e){return Ms(_e(e))}function dv(e,t,r){r===void 0&&(r=!1);const n=$r(e),o=Ds(e),i=Is(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wo(s)),[s,wo(s)]}function fv(e){const t=wo(e);return[Mi(e),t,Mi(t)]}function Mi(e){return e.replace(/start|end/g,t=>cv[t])}const Ga=["left","right"],Ya=["right","left"],hv=["top","bottom"],pv=["bottom","top"];function gv(e,t,r){switch(e){case"top":case"bottom":return r?t?Ya:Ga:t?Ga:Ya;case"left":case"right":return t?hv:pv;default:return[]}}function vv(e,t,r,n){const o=$r(e);let i=gv(Ke(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Mi)))),i}function wo(e){return e.replace(/left|right|bottom|top/g,t=>lv[t])}function mv(e){return{top:0,right:0,bottom:0,left:0,...e}}function du(e){return typeof e!="number"?mv(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Xa(e,t,r){let{reference:n,floating:o}=e;const i=_e(t),s=Ds(t),a=Is(s),l=Ke(t),c=i==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch($r(t)){case"start":p[s]-=h*(r&&c?-1:1);break;case"end":p[s]+=h*(r&&c?-1:1);break}return p}async function bv(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ue(t,e),g=du(p),m=a[h?f==="floating"?"reference":"floating":f],b=_o(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(m)))==null||r?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),O=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:C,strategy:l}):O);return{top:(b.top-T.top+g.top)/x.y,bottom:(T.bottom-b.bottom+g.bottom)/x.y,left:(b.left-T.left+g.left)/x.x,right:(T.right-b.right+g.right)/x.x}}const yv=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Xa(c,n,l),h=n,p={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Ue(e,t)||{};if(c==null)return{};const f=du(d),h={x:r,y:n},p=Ds(o),g=Is(p),v=await s.getDimensions(c),m=p==="y",b=m?"top":"left",O=m?"bottom":"right",C=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[p]-h[p]-i.floating[g],T=h[p]-i.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=k?k[C]:0;(!R||!await(s.isElement==null?void 0:s.isElement(k)))&&(R=a.floating[C]||i.floating[g]);const S=x/2-T/2,L=R/2-v[g]/2-1,V=ar(f[b],L),ct=ar(f[O],L),st=V,_t=R-v[g]-ct,G=R/2-v[g]/2+S,Y=Ni(st,G,_t),W=!l.arrow&&$r(o)!=null&&G!==Y&&i.reference[g]/2-(GG<=0)){var ct,st;const G=(((ct=i.flip)==null?void 0:ct.index)||0)+1,Y=R[G];if(Y&&(!(f==="alignment"?O!==_e(Y):!1)||V.every(X=>_e(X.placement)===O?X.overflows[0]>0:!0)))return{data:{index:G,overflows:V},reset:{placement:Y}};let W=(st=V.filter(Z=>Z.overflows[0]<=0).sort((Z,X)=>Z.overflows[1]-X.overflows[1])[0])==null?void 0:st.placement;if(!W)switch(p){case"bestFit":{var _t;const Z=(_t=V.filter(X=>{if(k){const ot=_e(X.placement);return ot===O||ot==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ot=>ot>0).reduce((ot,M)=>ot+M,0)]).sort((X,ot)=>X[1]-ot[1])[0])==null?void 0:_t[0];Z&&(W=Z);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function qa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Za(e){return av.some(t=>e[t]>=0)}const xv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=Ue(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=qa(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Za(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=qa(s,r.floating);return{data:{escapedOffsets:a,escaped:Za(a)}}}default:return{}}}}},fu=new Set(["left","top"]);async function Sv(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Ke(r),a=$r(r),l=_e(r)==="y",c=fu.has(s)?-1:1,d=i&&l?-1:1,f=Ue(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Pv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Sv(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Tv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:O,y:C}=b;return{x:O,y:C}}},...c}=Ue(e,t),d={x:r,y:n},f=await i.detectOverflow(t,c),h=_e(Ke(o)),p=Ms(h);let g=d[p],v=d[h];if(s){const b=p==="y"?"top":"left",O=p==="y"?"bottom":"right",C=g+f[b],x=g-f[O];g=Ni(C,g,x)}if(a){const b=h==="y"?"top":"left",O=h==="y"?"bottom":"right",C=v+f[b],x=v-f[O];v=Ni(C,v,x)}const m=l.fn({...t,[p]:g,[h]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:s,[h]:a}}}}}},Cv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ue(e,t),d={x:r,y:n},f=_e(o),h=Ms(f);let p=d[h],g=d[f];const v=Ue(a,t),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const C=h==="y"?"height":"width",x=i.reference[h]-i.floating[C]+m.mainAxis,T=i.reference[h]+i.reference[C]-m.mainAxis;pT&&(p=T)}if(c){var b,O;const C=h==="y"?"width":"height",x=fu.has(Ke(o)),T=i.reference[f]-i.floating[C]+(x&&((b=s.offset)==null?void 0:b[f])||0)+(x?0:m.crossAxis),k=i.reference[f]+i.reference[C]+(x?0:((O=s.offset)==null?void 0:O[f])||0)-(x?m.crossAxis:0);gk&&(g=k)}return{[h]:p,[f]:g}}}},Av=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ue(e,t),d=await s.detectOverflow(t,c),f=Ke(o),h=$r(o),p=_e(o)==="y",{width:g,height:v}=i.floating;let m,b;f==="top"||f==="bottom"?(m=f,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,m=h==="end"?"top":"bottom");const O=v-d.top-d.bottom,C=g-d.left-d.right,x=ar(v-d[m],O),T=ar(g-d[b],C),k=!t.middlewareData.shift;let R=x,S=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(R=O),k&&!h){const V=ne(d.left,0),ct=ne(d.right,0),st=ne(d.top,0),_t=ne(d.bottom,0);p?S=g-2*(V!==0||ct!==0?V+ct:ne(d.left,d.right)):R=v-2*(st!==0||_t!==0?st+_t:ne(d.top,d.bottom))}await l({...t,availableWidth:S,availableHeight:R});const L=await s.getDimensions(a.floating);return g!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function Ho(){return typeof window<"u"}function tn(e){return hu(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(hu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hu(e){return Ho()?e instanceof Node||e instanceof ie(e).Node:!1}function ve(e){return Ho()?e instanceof Element||e instanceof ie(e).Element:!1}function Ce(e){return Ho()?e instanceof HTMLElement||e instanceof ie(e).HTMLElement:!1}function Ja(e){return!Ho()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}const kv=new Set(["inline","contents"]);function Bn(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!kv.has(o)}const Ev=new Set(["table","td","th"]);function Ov(e){return Ev.has(tn(e))}const Nv=[":popover-open",":modal"];function Uo(e){return Nv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mv=["transform","translate","scale","rotate","perspective"],Iv=["transform","translate","scale","rotate","perspective","filter"],Dv=["paint","layout","strict","content"];function Fs(e){const t=Rs(),r=ve(e)?me(e):e;return Mv.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Iv.some(n=>(r.willChange||"").includes(n))||Dv.some(n=>(r.contain||"").includes(n))}function Fv(e){let t=lr(e);for(;Ce(t)&&!Yr(t);){if(Fs(t))return t;if(Uo(t))return null;t=lr(t)}return null}function Rs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rv=new Set(["html","body","#document"]);function Yr(e){return Rv.has(tn(e))}function me(e){return ie(e).getComputedStyle(e)}function Ko(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lr(e){if(tn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ja(e)&&e.host||Ae(e);return Ja(t)?t.host:t}function pu(e){const t=lr(e);return Yr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&Bn(t)?t:pu(t)}function Cn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=pu(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=ie(o);if(i){const a=Ii(s);return t.concat(s,s.visualViewport||[],Bn(o)?o:[],a&&r?Cn(a):[])}return t.concat(o,Cn(o,[],r))}function Ii(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gu(e){const t=me(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ce(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=yo(r)!==i||yo(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ls(e){return ve(e)?e:e.contextElement}function Wr(e){const t=Ls(e);if(!Ce(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=gu(t);let s=(i?yo(r.width):r.width)/n,a=(i?yo(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Lv=Pe(0);function vu(e){const t=ie(e);return!Rs()||!t.visualViewport?Lv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ie(e)?!1:t}function Ir(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ls(e);let s=Pe(1);t&&(n?ve(n)&&(s=Wr(n)):s=Wr(e));const a=zv(i,r,n)?vu(i):Pe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const h=ie(i),p=n&&ve(n)?ie(n):n;let g=h,v=Ii(g);for(;v&&n&&p!==g;){const m=Wr(v),b=v.getBoundingClientRect(),O=me(v),C=b.left+(v.clientLeft+parseFloat(O.paddingLeft))*m.x,x=b.top+(v.clientTop+parseFloat(O.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,f*=m.y,l+=C,c+=x,g=ie(v),v=Ii(g)}}return _o({width:d,height:f,x:l,y:c})}function jo(e,t){const r=Ko(e).scrollLeft;return t?t.left+r:Ir(Ae(e)).left+r}function mu(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-jo(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Vv(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Ae(n),a=t?Uo(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Pe(1);const d=Pe(0),f=Ce(n);if((f||!f&&!i)&&((tn(n)!=="body"||Bn(s))&&(l=Ko(n)),Ce(n))){const p=Ir(n);c=Wr(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const h=s&&!f&&!i?mu(s,l):Pe(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:r.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Bv(e){return Array.from(e.getClientRects())}function Wv(e){const t=Ae(e),r=Ko(e),n=e.ownerDocument.body,o=ne(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ne(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+jo(e);const a=-r.scrollTop;return me(n).direction==="rtl"&&(s+=ne(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Qa=25;function Hv(e,t){const r=ie(e),n=Ae(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Rs();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=jo(n);if(c<=0){const d=n.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(n.clientWidth-f.clientWidth-p);g<=Qa&&(i-=g)}else c<=Qa&&(i+=c);return{width:i,height:s,x:a,y:l}}const Uv=new Set(["absolute","fixed"]);function Kv(e,t){const r=Ir(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Ce(e)?Wr(e):Pe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function $a(e,t,r){let n;if(t==="viewport")n=Hv(e,r);else if(t==="document")n=Wv(Ae(e));else if(ve(t))n=Kv(t,r);else{const o=vu(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _o(n)}function bu(e,t){const r=lr(e);return r===t||!ve(r)||Yr(r)?!1:me(r).position==="fixed"||bu(r,t)}function jv(e,t){const r=t.get(e);if(r)return r;let n=Cn(e,[],!1).filter(a=>ve(a)&&tn(a)!=="body"),o=null;const i=me(e).position==="fixed";let s=i?lr(e):e;for(;ve(s)&&!Yr(s);){const a=me(s),l=Fs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Uv.has(o.position)||Bn(s)&&!l&&bu(e,s))?n=n.filter(d=>d!==s):o=a,s=lr(s)}return t.set(e,n),n}function Gv(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Uo(t)?[]:jv(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const f=$a(t,d,o);return c.top=ne(f.top,c.top),c.right=ar(f.right,c.right),c.bottom=ar(f.bottom,c.bottom),c.left=ne(f.left,c.left),c},$a(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Yv(e){const{width:t,height:r}=gu(e);return{width:t,height:r}}function Xv(e,t,r){const n=Ce(t),o=Ae(t),i=r==="fixed",s=Ir(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Pe(0);function c(){l.x=jo(o)}if(n||!n&&!i)if((tn(t)!=="body"||Bn(o))&&(a=Ko(t)),n){const p=Ir(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?mu(o,a):Pe(0),f=s.left+a.scrollLeft-l.x-d.x,h=s.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function ai(e){return me(e).position==="static"}function tl(e,t){if(!Ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function yu(e,t){const r=ie(e);if(Uo(e))return r;if(!Ce(e)){let o=lr(e);for(;o&&!Yr(o);){if(ve(o)&&!ai(o))return o;o=lr(o)}return r}let n=tl(e,t);for(;n&&Ov(n)&&ai(n);)n=tl(n,t);return n&&Yr(n)&&ai(n)&&!Fs(n)?r:n||Fv(e)||r}const qv=async function(e){const t=this.getOffsetParent||yu,r=this.getDimensions,n=await r(e.floating);return{reference:Xv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Zv(e){return me(e).direction==="rtl"}const Jv={convertOffsetParentRelativeRectToViewportRelativeRect:Vv,getDocumentElement:Ae,getClippingRect:Gv,getOffsetParent:yu,getElementRects:qv,getClientRects:Bv,getDimensions:Yv,getScale:Wr,isElement:ve,isRTL:Zv};function wu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qv(e,t){let r=null,n;const o=Ae(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(a||t(),!h||!p)return;const g=Zn(f),v=Zn(o.clientWidth-(d+h)),m=Zn(o.clientHeight-(f+p)),b=Zn(d),C={rootMargin:-g+"px "+-v+"px "+-m+"px "+-b+"px",threshold:ne(0,ar(1,l))||1};let x=!0;function T(k){const R=k[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):n=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!wu(c,e.getBoundingClientRect())&&s(),x=!1}try{r=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,C)}r.observe(e)}return s(!0),i}function $v(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Ls(e),d=o||i?[...c?Cn(c):[],...Cn(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=c&&a?Qv(c,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(b=>{let[O]=b;O&&O.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let g,v=l?Ir(e):null;l&&m();function m(){const b=Ir(e);v&&!wu(v,b)&&r(),v=b,g=requestAnimationFrame(m)}return r(),()=>{var b;d.forEach(O=>{o&&O.removeEventListener("scroll",r),i&&O.removeEventListener("resize",r)}),f?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const tm=Pv,em=Tv,rm=_v,nm=Av,om=xv,im=wv,sm=Cv,am=(e,t,r)=>{const n=new Map,o={platform:Jv,...r},i={...o.platform,_c:n};return yv(e,t,{...o,platform:i})};function pr(e){return typeof e=="function"?e():e}function _u(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function el(e,t){const r=_u(e);return Math.round(t*r)/r}function xo(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function lm(e){const t=e.whileElementsMounted,r=P(()=>pr(e.open)??!0),n=P(()=>pr(e.middleware)),o=P(()=>pr(e.transform)??!0),i=P(()=>pr(e.placement)??"bottom"),s=P(()=>pr(e.strategy)??"absolute"),a=P(()=>pr(e.sideOffset)??0),l=P(()=>pr(e.alignOffset)??0),c=e.reference;let d=I(0),f=I(0);const h=qt(null);let p=I(It(u(s))),g=I(It(u(i))),v=I(It({})),m=I(!1),b=!1;const O=P(()=>{const L=h.current?el(h.current,u(d)):u(d),V=h.current?el(h.current,u(f)):u(f);return u(o)?{position:u(p),left:"0",top:"0",transform:`translate(${L}px, ${V}px)`,...h.current&&_u(h.current)>=1.5&&{willChange:"transform"}}:{position:u(p),left:`${L}px`,top:`${V}px`}});let C;function x(){c.current===null||h.current===null||am(c.current,h.current,{middleware:u(n),placement:u(i),strategy:u(s)}).then(L=>{const V=c.current;if(cm(V)){_(v,{...u(v),hide:{...u(v).hide,referenceHidden:!0}},!0);return}if(!u(r)&&u(d)!==0&&u(f)!==0){const st=Math.max(Math.abs(u(a)),Math.abs(u(l)),15);if(L.x<=st&&L.y<=st)return}_(d,L.x,!0),_(f,L.y,!0),_(p,L.strategy,!0),_(g,L.placement,!0),_(v,L.middlewareData,!0),_(m,!0)})}function T(){typeof C=="function"&&(C(),C=void 0)}function k(){if(T(),t===void 0){x();return}u(r)&&(c.current===null||h.current===null||(C=t(c.current,h.current,x)))}function R(){u(r)||_(m,!1)}function S(){return[u(n),u(i),u(s),u(a),u(l),u(r)]}return gt(()=>{t===void 0&&u(r)&&x()}),gt(k),gt(()=>{if(t!==void 0){if(S(),!u(r)){b=!1;return}if(!u(m)){b=!1;return}if(!b){b=!0;return}x()}}),gt(R),gt(()=>T),{floating:h,reference:c,get strategy(){return u(p)},get placement(){return u(g)},get middlewareData(){return u(v)},get isPositioned(){return u(m)},get floatingStyles(){return u(O)},get update(){return x}}}function cm(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const um={top:"bottom",right:"left",bottom:"top",left:"right"},zs=new Zt("Floating.Root"),Di=new Zt("Floating.Content"),Vs=new Zt("Floating.Root");class So{static create(t=!1){return t?Vs.set(new So):zs.set(new So)}anchorNode=qt(null);customAnchorNode=qt(null);triggerNode=qt(null);constructor(){gt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Po{static create(t,r=!1){return r?Di.set(new Po(t,Vs.get())):Di.set(new Po(t,zs.get()))}opts;root;contentRef=qt(null);wrapperRef=qt(null);arrowRef=qt(null);contentAttachment=Ot(this.contentRef);wrapperAttachment=Ot(this.wrapperRef);arrowAttachment=Ot(this.arrowRef);arrowId=qt(Qr());#t=P(()=>{if(typeof this.opts.style=="string")return gn(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#r=new Ep(()=>this.arrowRef.current??void 0);#n=P(()=>this.#r?.width??0);#o=P(()=>this.#r?.height??0);#i=P(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=P(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=P(()=>u(this.#a).length>0);get hasExplicitBoundaries(){return u(this.#s)}set hasExplicitBoundaries(t){_(this.#s,t)}#l=P(()=>({padding:this.opts.collisionPadding.current,boundary:u(this.#a).filter(Jp),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return u(this.#l)}set detectOverflowOptions(t){_(this.#l,t)}#c=I(void 0);#u=I(void 0);#d=I(void 0);#h=I(void 0);#p=P(()=>[tm({mainAxis:this.opts.sideOffset.current+u(this.#o),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&em({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?sm():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&rm({...this.detectOverflowOptions}),nm({...this.detectOverflowOptions,apply:({rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:i}=t.reference;_(this.#c,r,!0),_(this.#u,n,!0),_(this.#d,o,!0),_(this.#h,i,!0)}}),this.arrowRef.current&&im({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),dm({arrowWidth:u(this.#n),arrowHeight:u(this.#o)}),this.opts.hideWhenDetached.current&&om({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return u(this.#p)}set middleware(t){_(this.#p,t)}floating;#f=P(()=>fm(this.floating.placement));get placedSide(){return u(this.#f)}set placedSide(t){_(this.#f,t)}#g=P(()=>hm(this.floating.placement));get placedAlign(){return u(this.#g)}set placedAlign(t){_(this.#g,t)}#v=P(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return u(this.#v)}set arrowX(t){_(this.#v,t)}#m=P(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return u(this.#m)}set arrowY(t){_(this.#m,t)}#_=P(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return u(this.#_)}set cannotCenterArrow(t){_(this.#_,t)}#b=I();get contentZIndex(){return u(this.#b)}set contentZIndex(t){_(this.#b,t,!0)}#y=P(()=>um[this.placedSide]);get arrowBaseSide(){return u(this.#y)}set arrowBaseSide(t){_(this.#y,t)}#w=P(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${u(this.#c)}px`,"--bits-floating-available-height":`${u(this.#u)}px`,"--bits-floating-anchor-width":`${u(this.#d)}px`,"--bits-floating-anchor-height":`${u(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...u(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return u(this.#w)}set wrapperProps(t){_(this.#w,t)}#x=P(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Mc({...u(this.#t)}),...this.contentAttachment}));get props(){return u(this.#x)}set props(t){_(this.#x,t)}#S=P(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return u(this.#S)}set arrowStyle(t){_(this.#S,t)}constructor(t,r){this.opts=t,this.root=r,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),Pt(()=>t.customAnchor.current,n=>{this.root.customAnchorNode.current=n}),this.floating=lm({strategy:()=>this.opts.strategy.current,placement:()=>u(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...n)=>$v(...n,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),gt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Pt(()=>this.contentRef.current,n=>{if(!n||!this.opts.enabled.current)return;const o=Bo(n),i=o.requestAnimationFrame(()=>{if(this.contentRef.current!==n||!this.opts.enabled.current)return;const s=o.getComputedStyle(n).zIndex;s!==this.contentZIndex&&(this.contentZIndex=s)});return()=>{o.cancelAnimationFrame(i)}}),gt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Bs{static create(t){return new Bs(t,Di.get())}opts;content;constructor(t,r){this.opts=t,this.content=r}#t=P(()=>({id:this.opts.id.current,style:this.content.arrowStyle,"data-side":this.content.placedSide,...this.content.arrowAttachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class To{static create(t,r=!1){return r?new To(t,Vs.get()):new To(t,zs.get())}opts;root;constructor(t,r){this.opts=t,this.root=r,t.virtualEl&&t.virtualEl.current?r.triggerNode=Ec(t.virtualEl.current):r.triggerNode=t.ref}}function dm(e){return{name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Ws(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=s?f:`${h}px`,v=`${-l}px`):c==="top"?(g=s?f:`${h}px`,v=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=s?f:`${p}px`):c==="left"&&(g=`${n.floating.width+l}px`,v=s?f:`${p}px`),{data:{x:g,y:v}}}}}function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}function fm(e){return Ws(e)[0]}function hm(e){return Ws(e)[1]}function xu(e,t){D(t,!0);let r=w(t,"tooltip",3,!1);So.create(r());var n=N(),o=A(n);B(o,()=>t.children??Q),y(e,n),F()}function pm(e,t){D(t,!0);let r=w(t,"tooltip",3,!1);To.create({id:E(()=>t.id),virtualEl:E(()=>t.virtualEl),ref:t.ref},r());var n=N(),o=A(n);B(o,()=>t.children??Q),y(e,n),F()}var gm=pc(''),vm=z("");function mm(e,t){D(t,!0);let r=w(t,"id",19,Qr),n=w(t,"width",3,10),o=w(t,"height",3,5),i=K(t,["$$slots","$$events","$$legacy","id","children","child","width","height"]);const s=P(()=>ht(i,{id:r()}));var a=N(),l=A(a);{var c=f=>{var h=N(),p=A(h);B(p,()=>t.child,()=>({props:u(s)})),y(f,h)},d=f=>{var h=vm();wt(h,()=>({...u(s)}));var p=et(h);{var g=m=>{var b=N(),O=A(b);B(O,()=>t.children??Q),y(m,b)},v=m=>{var b=gm();zt(()=>{Wt(b,"width",n()),Wt(b,"height",o())}),y(m,b)};nt(p,m=>{t.children?m(g):m(v,!1)})}y(f,h)};nt(l,f=>{t.child?f(c):f(d,!1)})}y(e,a),F()}function bm(e,t){D(t,!0);let r=w(t,"id",19,Qr),n=w(t,"ref",15,null),o=K(t,["$$slots","$$events","$$legacy","id","ref"]);const i=Bs.create({id:E(()=>r()),ref:E(()=>n(),a=>n(a))}),s=P(()=>ht(o,i.props));mm(e,U(()=>u(s))),F()}function ym(e,t){D(t,!0);let r=w(t,"side",3,"bottom"),n=w(t,"sideOffset",3,0),o=w(t,"align",3,"center"),i=w(t,"alignOffset",3,0),s=w(t,"arrowPadding",3,0),a=w(t,"avoidCollisions",3,!0),l=w(t,"collisionBoundary",19,()=>[]),c=w(t,"collisionPadding",3,0),d=w(t,"hideWhenDetached",3,!1),f=w(t,"onPlaced",3,()=>{}),h=w(t,"sticky",3,"partial"),p=w(t,"updatePositionStrategy",3,"optimized"),g=w(t,"strategy",3,"fixed"),v=w(t,"dir",3,"ltr"),m=w(t,"style",19,()=>({})),b=w(t,"wrapperId",19,Qr),O=w(t,"customAnchor",3,null),C=w(t,"tooltip",3,!1);const x=Po.create({side:E(()=>r()),sideOffset:E(()=>n()),align:E(()=>o()),alignOffset:E(()=>i()),id:E(()=>t.id),arrowPadding:E(()=>s()),avoidCollisions:E(()=>a()),collisionBoundary:E(()=>l()),collisionPadding:E(()=>c()),hideWhenDetached:E(()=>d()),onPlaced:E(()=>f()),sticky:E(()=>h()),updatePositionStrategy:E(()=>p()),strategy:E(()=>g()),dir:E(()=>v()),style:E(()=>m()),enabled:E(()=>t.enabled),wrapperId:E(()=>b()),customAnchor:E(()=>O())},C()),T=P(()=>ht(x.wrapperProps,{style:{pointerEvents:"auto"}}));var k=N(),R=A(k);B(R,()=>t.content??Q,()=>({props:x.props,wrapperProps:u(T)})),y(e,k),F()}function wm(e,t){D(t,!0),es(()=>{t.onPlaced?.()});var r=N(),n=A(r);B(n,()=>t.content??Q,()=>({props:{},wrapperProps:{}})),y(e,r),F()}const _m=Vn({component:"separator",parts:["root"]});class Hs{static create(t){return new Hs(t)}opts;attachment;constructor(t){this.opts=t,this.attachment=Ot(t.ref)}#t=P(()=>({id:this.opts.id.current,role:this.opts.decorative.current?"none":"separator","aria-orientation":this.opts.orientation.current,"aria-hidden":Vp(this.opts.decorative.current),"data-orientation":this.opts.orientation.current,[_m.root]:"",...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}var xm=z("
");function Sm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"decorative",3,!1),s=w(t,"orientation",3,"horizontal"),a=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","decorative","orientation"]);const l=Hs.create({ref:E(()=>o(),g=>o(g)),id:E(()=>n()),decorative:E(()=>i()),orientation:E(()=>s())}),c=P(()=>ht(a,l.props));var d=N(),f=A(d);{var h=g=>{var v=N(),m=A(v);B(m,()=>t.child,()=>({props:u(c)})),y(g,v)},p=g=>{var v=xm();wt(v,()=>({...u(c)}));var m=et(v);B(m,()=>t.children??Q),y(g,v)};nt(f,g=>{t.child?g(h):g(p,!1)})}y(e,d),F()}function Pm(e,t){let r=w(t,"isStatic",3,!1),n=K(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=N(),i=A(o);{var s=l=>{wm(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{ym(l,U({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>n))};nt(i,l=>{r()?l(s):l(a,!1)})}y(e,o)}var Tm=z(" ",1);function Su(e,t){D(t,!0);let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=w(t,"tooltip",3,!1),l=w(t,"contentPointerEvents",3,"auto"),c=K(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Pm(e,{get isStatic(){return s()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get enabled(){return t.enabled},get tooltip(){return a()},content:(f,h)=>{let p=()=>h?.().props,g=()=>h?.().wrapperProps;var v=Tm(),m=A(v);{var b=x=>{bo(x,{get preventScroll(){return t.preventScroll}})},O=x=>{bo(x,{get preventScroll(){return t.preventScroll}})};nt(m,x=>{t.forceMount&&t.enabled?x(b):t.forceMount||x(O,1)})}var C=j(m,2);lu(C,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return n()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(T,k)=>{let R=()=>k?.().props;au(T,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(S,L)=>{su(S,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return r()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(ct,st)=>{let _t=()=>st?.().props;cu(ct,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(G,Y)=>{var W=N(),Z=A(W);{let X=P(()=>({props:ht(c,p(),_t(),R(),{style:{pointerEvents:l()}}),wrapperProps:g()}));B(Z,()=>t.popper??Q,()=>u(X))}y(G,W)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),y(f,v)},$$slots:{content:!0}}),F()}function Pu(e,t){let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=K(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=N(),c=A(l);{var d=f=>{Su(f,U({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return r()},get loop(){return t.loop},get trapFocus(){return n()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};nt(c,f=>{t.shouldRender&&f(d)})}y(e,l)}function Tu(e,t){let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=K(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Su(e,U({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return r()},get loop(){return t.loop},get trapFocus(){return n()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Cm=z("
");function Am(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=w(t,"disabled",3,!1),s=w(t,"onSelect",3,St),a=w(t,"closeOnSelect",3,!0),l=K(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const c=Ps.create({id:E(()=>o()),disabled:E(()=>i()),onSelect:E(()=>s()),ref:E(()=>n(),v=>n(v)),closeOnSelect:E(()=>a())}),d=P(()=>ht(l,c.props));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=Cm();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}var km=z("
");function Em(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const s=Ts.create({id:E(()=>o()),ref:E(()=>n(),h=>n(h))}),a=P(()=>ht(i,s.props));var l=N(),c=A(l);{var d=h=>{var p=N(),g=A(p);B(g,()=>t.child,()=>({props:u(a)})),y(h,p)},f=h=>{var p=km();wt(p,()=>({...u(a)}));var g=et(p);B(g,()=>t.children??Q),y(h,p)};nt(c,h=>{t.child?h(d):h(f,!1)})}y(e,l),F()}function rl(e,t){const[r,n]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s=n!=f>=n&&r<=(d-l)*(n-c)/(f-c)+l&&(o=!o)}return o}function nl(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function Om(e,t){const r=e.left+e.width/2,n=e.top+e.height/2,o=t.left+t.width/2,i=t.top+t.height/2,s=o-r,a=i-n;return Math.abs(s)>Math.abs(a)?s>0?"right":"left":a>0?"bottom":"top"}class Nm{#t;#e;#r=null;#n=null;#o=null;#i(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#a(){this.#i(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#n)&&(this.#l(),this.#t.onPointerExit())})}constructor(t){this.#t=t,this.#e=t.buffer??1,Pt([t.triggerNode,t.contentNode,t.enabled],([r,n,o])=>{if(!r||!n||!o){this.#l();return}const i=Jr(r),s=f=>{this.#s([f.clientX,f.clientY],r,n)},a=f=>{const h=f.relatedTarget;if(De(h)&&n.contains(h))return;const p=this.#t.ignoredTargets?.()??[];if(!(De(h)&&p.some(g=>g===h||g.contains(h)))){if(De(h)&&!r.contains(h)&&!n.contains(h)&&!h.contains(n)){this.#l(),this.#t.onPointerExit();return}this.#r=[f.clientX,f.clientY],this.#n="content",this.#a()}},l=()=>{this.#l()},c=()=>{this.#l()},d=f=>{const h=f.relatedTarget;De(h)&&r.contains(h)||(this.#r=[f.clientX,f.clientY],this.#n="trigger",this.#a())};return[dt(i,"pointermove",s),dt(r,"pointerleave",a),dt(r,"pointerenter",l),dt(n,"pointerenter",c),dt(n,"pointerleave",d)].reduce((f,h)=>()=>{f(),h()},()=>{})})}#s(t,r,n){if(!this.#r||!this.#n)return;this.#i();const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#n==="content"&&nl(t,i)){this.#l();return}if(this.#n==="trigger"&&nl(t,o)){this.#l();return}const s=Om(o,i),a=this.#c(o,i,s);if(a&&rl(t,a))return;const l=this.#n==="content"?i:o,c=this.#u(this.#r,l,s,this.#n);rl(t,c)||(this.#l(),this.#t.onPointerExit())}#l(){this.#r=null,this.#n=null,this.#i()}#c(t,r,n){const o=this.#e;switch(n){case"top":return[[Math.min(t.left,r.left)-o,t.top],[Math.min(t.left,r.left)-o,r.bottom],[Math.max(t.right,r.right)+o,r.bottom],[Math.max(t.right,r.right)+o,t.top]];case"bottom":return[[Math.min(t.left,r.left)-o,t.bottom],[Math.min(t.left,r.left)-o,r.top],[Math.max(t.right,r.right)+o,r.top],[Math.max(t.right,r.right)+o,t.bottom]];case"left":return[[t.left,Math.min(t.top,r.top)-o],[r.right,Math.min(t.top,r.top)-o],[r.right,Math.max(t.bottom,r.bottom)+o],[t.left,Math.max(t.bottom,r.bottom)+o]];case"right":return[[t.right,Math.min(t.top,r.top)-o],[r.left,Math.min(t.top,r.top)-o],[r.left,Math.max(t.bottom,r.bottom)+o],[t.right,Math.max(t.bottom,r.bottom)+o]]}}#u(t,r,n,o){const i=this.#e*4,[s,a]=t;switch(o==="trigger"?this.#d(n):n){case"top":return[[s-i,a+i],[s+i,a+i],[r.right+i,r.bottom],[r.right+i,r.top],[r.left-i,r.top],[r.left-i,r.bottom]];case"bottom":return[[s-i,a-i],[s+i,a-i],[r.right+i,r.top],[r.right+i,r.bottom],[r.left-i,r.bottom],[r.left-i,r.top]];case"left":return[[s+i,a-i],[s+i,a+i],[r.right,r.bottom+i],[r.left,r.bottom+i],[r.left,r.top-i],[r.right,r.top-i]];case"right":return[[s-i,a-i],[s-i,a+i],[r.left,r.bottom+i],[r.right,r.bottom+i],[r.right,r.top-i],[r.left,r.top-i]]}}#d(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}function Mm(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"onOpenChange",3,St),o=w(t,"onOpenChangeComplete",3,St);fs.create({variant:E(()=>"dialog"),open:E(()=>r(),a=>{r(a),n()(a)}),onOpenChangeComplete:E(()=>o())});var i=N(),s=A(i);B(s,()=>t.children??Q),y(e,i),F()}var Im=z("");function Dm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"disabled",3,!1),s=K(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const a=hs.create({variant:E(()=>"close"),id:E(()=>n()),ref:E(()=>o(),p=>o(p)),disabled:E(()=>!!i())}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=p=>{var g=N(),v=A(g);B(v,()=>t.child,()=>({props:u(l)})),y(p,g)},h=p=>{var g=Im();wt(g,()=>({...u(l)}));var v=et(g);B(v,()=>t.children??Q),y(p,g)};nt(d,p=>{t.child?p(f):p(h,!1)})}y(e,c),F()}var Fm=z(" ",1),Rm=z("
",1);function Lm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"forceMount",3,!1),s=w(t,"onCloseAutoFocus",3,St),a=w(t,"onOpenAutoFocus",3,St),l=w(t,"onEscapeKeydown",3,St),c=w(t,"onInteractOutside",3,St),d=w(t,"trapFocus",3,!0),f=w(t,"preventScroll",3,!0),h=w(t,"restoreScrollDelay",3,null),p=K(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const g=vs.create({id:E(()=>n()),ref:E(()=>o(),C=>o(C))}),v=P(()=>ht(p,g.props));var m=N(),b=A(m);{var O=C=>{lu(C,{get ref(){return g.opts.ref},loop:!0,get trapFocus(){return d()},get enabled(){return g.root.opts.open.current},get onOpenAutoFocus(){return a()},get onCloseAutoFocus(){return s()},focusScope:(T,k)=>{let R=()=>k?.().props;au(T,U(()=>u(v),{get enabled(){return g.root.opts.open.current},get ref(){return g.opts.ref},onEscapeKeydown:S=>{l()(S),!S.defaultPrevented&&g.root.handleClose()},children:(S,L)=>{su(S,U(()=>u(v),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},onInteractOutside:V=>{c()(V),!V.defaultPrevented&&g.root.handleClose()},children:(V,ct)=>{cu(V,U(()=>u(v),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},children:(st,_t)=>{var G=N(),Y=A(G);{var W=X=>{var ot=Fm(),M=A(ot);{var $=ft=>{bo(ft,{get preventScroll(){return f()},get restoreScrollDelay(){return h()}})};nt(M,ft=>{g.root.opts.open.current&&ft($)})}var it=j(M,2);{let ft=P(()=>({props:ht(u(v),R()),...g.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(X,ot)},Z=X=>{var ot=Rm(),M=A(ot);bo(M,{get preventScroll(){return f()}});var $=j(M,2);wt($,ft=>({...ft}),[()=>ht(u(v),R())]);var it=et($);B(it,()=>t.children??Q),y(X,ot)};nt(Y,X=>{t.child?X(W):X(Z,!1)})}y(st,G)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};nt(b,C=>{(g.shouldRender||i())&&C(O)})}y(e,m),F()}function zm(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"dir",3,"ltr"),o=w(t,"onOpenChange",3,St),i=w(t,"onOpenChangeComplete",3,St),s=w(t,"_internal_variant",3,"dropdown-menu");const a=_s.create({variant:E(()=>s()),dir:E(()=>n()),onClose:()=>{r(!1),o()(!1)}});xs.create({open:E(()=>r(),l=>{r(l),o()(l)}),onOpenChangeComplete:E(()=>i())},a),xu(e,{children:(l,c)=>{var d=N(),f=A(d);B(f,()=>t.children??Q),y(l,d)},$$slots:{default:!0}}),F()}var Vm=z("
"),Bm=z("
");function Wm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"loop",3,!0),s=w(t,"onInteractOutside",3,St),a=w(t,"onEscapeKeydown",3,St),l=w(t,"onCloseAutoFocus",3,St),c=w(t,"forceMount",3,!1),d=w(t,"trapFocus",3,!1),f=K(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const h=Ss.create({id:E(()=>n()),loop:E(()=>i()),ref:E(()=>o(),x=>o(x)),onCloseAutoFocus:E(()=>l())}),p=P(()=>ht(f,h.props));function g(x){if(h.handleInteractOutside(x),!x.defaultPrevented&&(s()(x),!x.defaultPrevented)){if(x.target&&x.target instanceof Element){const T=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(x.target.closest(T))return}h.parentMenu.onClose()}}function v(x){a()(x),!x.defaultPrevented&&h.parentMenu.onClose()}var m=N(),b=A(m);{var O=x=>{Tu(x,U(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:v,get trapFocus(){return d()},get loop(){return i()},forceMount:!0,get id(){return n()},get shouldRender(){return h.shouldRender},popper:(k,R)=>{let S=()=>R?.().props,L=()=>R?.().wrapperProps;const V=P(()=>ht(S(),{style:xo("dropdown-menu")},{style:t.style}));var ct=N(),st=A(ct);{var _t=Y=>{var W=N(),Z=A(W);{let X=P(()=>({props:u(V),wrapperProps:L(),...h.snippetProps}));B(Z,()=>t.child,()=>u(X))}y(Y,W)},G=Y=>{var W=Vm();wt(W,()=>({...L()}));var Z=et(W);wt(Z,()=>({...u(V)}));var X=et(Z);B(X,()=>t.children??Q),y(Y,W)};nt(st,Y=>{t.child?Y(_t):Y(G,!1)})}y(k,ct)},$$slots:{popper:!0}}))},C=x=>{Pu(x,U(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:v,get trapFocus(){return d()},get loop(){return i()},forceMount:!1,get id(){return n()},get shouldRender(){return h.shouldRender},popper:(k,R)=>{let S=()=>R?.().props,L=()=>R?.().wrapperProps;const V=P(()=>ht(S(),{style:xo("dropdown-menu")},{style:t.style}));var ct=N(),st=A(ct);{var _t=Y=>{var W=N(),Z=A(W);{let X=P(()=>({props:u(V),wrapperProps:L(),...h.snippetProps}));B(Z,()=>t.child,()=>u(X))}y(Y,W)},G=Y=>{var W=Bm();wt(W,()=>({...L()}));var Z=et(W);wt(Z,()=>({...u(V)}));var X=et(Z);B(X,()=>t.children??Q),y(Y,W)};nt(st,Y=>{t.child?Y(_t):Y(G,!1)})}y(k,ct)},$$slots:{popper:!0}}))};nt(b,x=>{c()?x(O):c()||x(C,1)})}y(e,m),F()}var Hm=z("");function Um(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"disabled",3,!1),s=w(t,"type",3,"button"),a=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Cs.create({id:E(()=>n()),disabled:E(()=>i()??!1),ref:E(()=>o(),d=>o(d))}),c=P(()=>ht(a,l.props,{type:s()}));pm(e,{get id(){return n()},get ref(){return l.opts.ref},children:(d,f)=>{var h=N(),p=A(h);{var g=m=>{var b=N(),O=A(b);B(O,()=>t.child,()=>({props:u(c)})),y(m,b)},v=m=>{var b=Hm();wt(b,()=>({...u(c)}));var O=et(b);B(O,()=>t.children??Q),y(m,b)};nt(p,m=>{t.child?m(g):m(v,!1)})}y(d,h)},$$slots:{default:!0}}),F()}class Xr{#t;#e;constructor(t,r){this.#t=t,this.#e=r,this.handler=this.handler.bind(this),gt(this.handler)}handler(){let t=0;const r=this.#t();if(!r)return;const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(this.#e)});return n.observe(r),()=>{window.cancelAnimationFrame(t),n.unobserve(r)}}}class Cu{state;#t;constructor(t,r){this.state=qt(t),this.#t=r,this.dispatch=this.dispatch.bind(this)}#e(t){return this.#t[this.state.current][t]??this.state.current}dispatch(t){this.state.current=this.#e(t)}}const ol=new WeakMap,Km=16,jm={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}};class Gm{opts;#t=I("none");get prevAnimationNameState(){return u(this.#t)}set prevAnimationNameState(t){_(this.#t,t,!0)}#e=I(It({display:"",animationName:"none"}));get styles(){return u(this.#e)}set styles(t){_(this.#e,t,!0)}initialStatus;previousPresent;machine;present;constructor(t){this.opts=t,this.present=this.opts.open,this.initialStatus=t.open.current?"mounted":"unmounted",this.previousPresent=new Op(()=>this.present.current),this.machine=new Cu(this.initialStatus,jm),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),Ym(this),Xm(this),qm(this)}handleAnimationEnd(t){if(!this.opts.ref.current)return;const r=this.styles.animationName||Co(this.opts.ref.current),n=r.includes(t.animationName)||r==="none";t.target===this.opts.ref.current&&n&&this.machine.dispatch("ANIMATION_END")}handleAnimationStart(t){if(this.opts.ref.current&&t.target===this.opts.ref.current){const r=Co(this.opts.ref.current,!0);this.prevAnimationNameState=r,this.styles.animationName=r}}#r=P(()=>["mounted","unmountSuspended"].includes(this.machine.state.current));get isPresent(){return u(this.#r)}set isPresent(t){_(this.#r,t)}}function Ym(e){Pt(()=>e.present.current,()=>{if(!e.opts.ref.current||!(e.present.current!==e.previousPresent.current))return;const r=e.prevAnimationNameState,n=Co(e.opts.ref.current,!0);if(e.styles.animationName=n,e.present.current)e.machine.dispatch("MOUNT");else if(n==="none"||e.styles.display==="none")e.machine.dispatch("UNMOUNT");else{const o=r!==n;e.previousPresent.current&&o?e.machine.dispatch("ANIMATION_OUT"):e.machine.dispatch("UNMOUNT")}})}function Xm(e){Pt(()=>e.machine.state.current,()=>{if(!e.opts.ref.current)return;const t=e.machine.state.current==="mounted"?Co(e.opts.ref.current,!0):"none";e.prevAnimationNameState=t,e.styles.animationName=t})}function qm(e){Pt(()=>e.opts.ref.current,()=>{if(!e.opts.ref.current)return;const t=getComputedStyle(e.opts.ref.current);return e.styles={display:t.display,animationName:t.animationName||"none"},Ve(dt(e.opts.ref.current,"animationstart",e.handleAnimationStart),dt(e.opts.ref.current,"animationcancel",e.handleAnimationEnd),dt(e.opts.ref.current,"animationend",e.handleAnimationEnd))})}function Co(e,t=!1){if(!e)return"none";const r=performance.now(),n=ol.get(e);if(!t&&n&&r-n.timestampt.open),ref:t.ref});var n=N(),o=A(n);{var i=s=>{var a=N(),l=A(a);B(l,()=>t.presence??Q,()=>({present:r.isPresent})),y(s,a)};nt(o,s=>{(t.forceMount||t.open||r.isPresent)&&s(i)})}y(e,n),F()}function Zm(e,t,r){return Math.min(r,Math.max(t,e))}const Wn=Vn({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),Hn=new Zt("ScrollArea.Root"),Un=new Zt("ScrollArea.Scrollbar"),Yo=new Zt("ScrollArea.ScrollbarVisible"),Us=new Zt("ScrollArea.ScrollbarAxis"),Au=new Zt("ScrollArea.ScrollbarShared");class Ks{static create(t){return Hn.set(new Ks(t))}opts;attachment;#t=I(null);get scrollAreaNode(){return u(this.#t)}set scrollAreaNode(t){_(this.#t,t,!0)}#e=I(null);get viewportNode(){return u(this.#e)}set viewportNode(t){_(this.#e,t,!0)}#r=I(null);get contentNode(){return u(this.#r)}set contentNode(t){_(this.#r,t,!0)}#n=I(null);get scrollbarXNode(){return u(this.#n)}set scrollbarXNode(t){_(this.#n,t,!0)}#o=I(null);get scrollbarYNode(){return u(this.#o)}set scrollbarYNode(t){_(this.#o,t,!0)}#i=I(0);get cornerWidth(){return u(this.#i)}set cornerWidth(t){_(this.#i,t,!0)}#a=I(0);get cornerHeight(){return u(this.#a)}set cornerHeight(t){_(this.#a,t,!0)}#s=I(!1);get scrollbarXEnabled(){return u(this.#s)}set scrollbarXEnabled(t){_(this.#s,t,!0)}#l=I(!1);get scrollbarYEnabled(){return u(this.#l)}set scrollbarYEnabled(t){_(this.#l,t,!0)}domContext;constructor(t){this.opts=t,this.attachment=Ot(t.ref,r=>this.scrollAreaNode=r),this.domContext=new zn(t.ref)}#c=P(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:"relative","--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Wn.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(t){_(this.#c,t)}}class js{static create(t){return new js(t,Hn.get())}opts;root;attachment;#t=qt(Qr());#e=qt(null);contentAttachment=Ot(this.#e,t=>this.root.contentNode=t);constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(t.ref,n=>this.root.viewportNode=n)}#r=P(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[Wn.viewport]:"",...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}#n=P(()=>({id:this.#t.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return u(this.#n)}set contentProps(t){_(this.#n,t)}}class Gs{static create(t){return Un.set(new Gs(t,Hn.get()))}opts;root;#t=P(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#t)}set isHorizontal(t){_(this.#t,t)}#e=I(!1);get hasThumb(){return u(this.#e)}set hasThumb(t){_(this.#e,t,!0)}constructor(t,r){this.opts=t,this.root=r,Pt(()=>this.isHorizontal,n=>n?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class Ys{static create(){return new Ys(Un.get())}scrollbar;root;#t=I(!1);get isVisible(){return u(this.#t)}set isVisible(t){_(this.#t,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root,gt(()=>{const r=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current;let o=0;if(!r)return;const i=()=>{this.root.domContext.clearTimeout(o),Bt(()=>this.isVisible=!0)},s=()=>{o&&this.root.domContext.clearTimeout(o),o=this.root.domContext.setTimeout(()=>{Bt(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)},a=Ve(dt(r,"pointerenter",i),dt(r,"pointerleave",s));return()=>{this.root.domContext.getWindow().clearTimeout(o),a()}})}#e=P(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Xs{static create(){return new Xs(Un.get())}scrollbar;root;machine=new Cu("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});#t=P(()=>this.machine.state.current==="hidden");get isHidden(){return u(this.#t)}set isHidden(t){_(this.#t,t)}constructor(t){this.scrollbar=t,this.root=t.root;const r=Vo(()=>this.machine.dispatch("SCROLL_END"),100);gt(()=>{const n=this.machine.state.current,o=this.root.opts.scrollHideDelay.current;if(n==="idle"){const i=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),o);return()=>this.root.domContext.clearTimeout(i)}}),gt(()=>{const n=this.root.viewportNode;if(!n)return;const o=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let i=n[o];return dt(n,"scroll",()=>{const l=n[o];i!==l&&(this.machine.dispatch("SCROLL"),r()),i=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(t){this.machine.dispatch("POINTER_ENTER")}onpointerleave(t){this.machine.dispatch("POINTER_LEAVE")}#e=P(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Xo{static create(){return new Xo(Un.get())}scrollbar;root;#t=I(!1);get isVisible(){return u(this.#t)}set isVisible(t){_(this.#t,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root;const r=Vo(()=>{const n=this.root.viewportNode;if(!n)return;const o=n.offsetWidththis.root.viewportNode,r),new Xr(()=>this.root.contentNode,r)}#e=P(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class qs{static create(){return Yo.set(new qs(Un.get()))}scrollbar;root;#t=I(null);get thumbNode(){return u(this.#t)}set thumbNode(t){_(this.#t,t,!0)}#e=I(0);get pointerOffset(){return u(this.#e)}set pointerOffset(t){_(this.#e,t,!0)}#r=I({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return u(this.#r)}set sizes(t){_(this.#r,t)}#n=P(()=>ku(this.sizes.viewport,this.sizes.content));get thumbRatio(){return u(this.#n)}set thumbRatio(t){_(this.#n,t)}#o=P(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return u(this.#o)}set hasThumb(t){_(this.#o,t)}#i=I("");get prevTransformStyle(){return u(this.#i)}set prevTransformStyle(t){_(this.#i,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root,gt(()=>{this.scrollbar.hasThumb=this.hasThumb}),gt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(t){this.sizes=t}getScrollPosition(t,r){return Jm({pointerPos:t,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:r})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(t){this.pointerOffset=t}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const t=this.root.viewportNode.scrollLeft,n=`translate3d(${il({scrollPos:t,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}xOnWheelScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=t)}xOnDragScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(t,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const t=this.root.viewportNode.scrollTop,n=`translate3d(0, ${il({scrollPos:t,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}yOnWheelScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollTop=t)}yOnDragScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(t,this.root.opts.dir.current))}}class Zs{static create(t){return Us.set(new Zs(t,Yo.get()))}opts;scrollbarVis;root;scrollbar;attachment;#t=I();get computedStyle(){return u(this.#t)}set computedStyle(t){_(this.#t,t,!0)}constructor(t,r){this.opts=t,this.scrollbarVis=r,this.root=r.root,this.scrollbar=r.scrollbar,this.attachment=Ot(this.scrollbar.opts.ref,n=>this.root.scrollbarXNode=n),gt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),gt(()=>{this.onResize()})}onThumbPointerDown=t=>{this.scrollbarVis.onThumbPointerDown(t.x)};onDragScroll=t=>{this.scrollbarVis.xOnDragScroll(t.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(t,r)=>{if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollLeft+t.deltaX;this.scrollbarVis.xOnWheelScroll(n),Ou(n,r)&&t.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:Ao(this.computedStyle.paddingLeft),paddingEnd:Ao(this.computedStyle.paddingRight)}})};#e=P(()=>qo(this.scrollbarVis.sizes));get thumbSize(){return u(this.#e)}set thumbSize(t){_(this.#e,t)}#r=P(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"horizontal",style:{bottom:0,left:this.root.opts.dir.current==="rtl"?"var(--bits-scroll-area-corner-width)":0,right:this.root.opts.dir.current==="ltr"?"var(--bits-scroll-area-corner-width)":0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Js{static create(t){return Us.set(new Js(t,Yo.get()))}opts;scrollbarVis;root;scrollbar;attachment;#t=I();get computedStyle(){return u(this.#t)}set computedStyle(t){_(this.#t,t,!0)}constructor(t,r){this.opts=t,this.scrollbarVis=r,this.root=r.root,this.scrollbar=r.scrollbar,this.attachment=Ot(this.scrollbar.opts.ref,n=>this.root.scrollbarYNode=n),gt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),gt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(t){this.scrollbarVis.onThumbPointerDown(t.y)}onDragScroll(t){this.scrollbarVis.yOnDragScroll(t.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(t,r){if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollTop+t.deltaY;this.scrollbarVis.yOnWheelScroll(n),Ou(n,r)&&t.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:Ao(this.computedStyle.paddingTop),paddingEnd:Ao(this.computedStyle.paddingBottom)}})}#e=P(()=>qo(this.scrollbarVis.sizes));get thumbSize(){return u(this.#e)}set thumbSize(t){_(this.#e,t)}#r=P(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"vertical",style:{top:0,right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:"var(--bits-scroll-area-corner-height)","--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Qs{static create(){return Au.set(new Qs(Us.get()))}scrollbarState;root;scrollbarVis;scrollbar;#t=I(null);get rect(){return u(this.#t)}set rect(t){_(this.#t,t)}#e=I("");get prevWebkitUserSelect(){return u(this.#e)}set prevWebkitUserSelect(t){_(this.#e,t,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#r=P(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return u(this.#r)}set maxScrollPos(t){_(this.#r,t)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=Vo(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,gt(()=>{const r=this.maxScrollPos,n=this.scrollbar.opts.ref.current;this.root.viewportNode;const o=s=>{const a=s.target;n?.contains(a)&&this.handleWheelScroll(s,r)};return dt(this.root.domContext.getDocument(),"wheel",o,{passive:!1})}),re(()=>{this.scrollbarVis.sizes,Bt(()=>this.handleThumbPositionChange())}),new Xr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Xr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(t){if(!this.rect)return;const r=t.clientX-this.rect.left,n=t.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:r,y:n})}#n(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(t){if(t.button!==0)return;t.target.setPointerCapture(t.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(t)}onpointermove(t){this.handleDragScroll(t)}onpointerup(t){const r=t.target;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId),this.#n()}onlostpointercapture(t){this.#n()}#o=P(()=>ht({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[Wn.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return u(this.#o)}set props(t){_(this.#o,t)}}class $s{static create(t){return new $s(t,Au.get())}opts;scrollbarState;attachment;#t;#e=I();#r=Vo(()=>{u(this.#e)&&(u(this.#e)(),_(this.#e,void 0))},100);constructor(t,r){this.opts=t,this.scrollbarState=r,this.#t=r.root,this.attachment=Ot(this.opts.ref,n=>this.scrollbarState.scrollbarVis.thumbNode=n),gt(()=>{const n=this.#t.viewportNode;if(!n)return;const o=()=>{if(this.#r(),!u(this.#e)){const s=Qm(n,this.scrollbarState.handleThumbPositionChange);_(this.#e,s,!0),this.scrollbarState.handleThumbPositionChange()}};return Bt(()=>this.scrollbarState.handleThumbPositionChange()),dt(n,"scroll",o)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(t){const r=t.target;if(!r)return;const n=r.getBoundingClientRect(),o=t.clientX-n.left,i=t.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:o,y:i})}onpointerup(t){this.scrollbarState.handleThumbPointerUp()}#n=P(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?"visible":"hidden",style:{width:"var(--bits-scroll-area-thumb-width)",height:"var(--bits-scroll-area-thumb-height)",transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Wn.thumb]:"",...this.attachment}));get props(){return u(this.#n)}set props(t){_(this.#n,t)}}class ta{static create(t){return new ta(t,Hn.get())}opts;root;attachment;#t=I(0);#e=I(0);#r=P(()=>!!(u(this.#t)&&u(this.#e)));get hasSize(){return u(this.#r)}set hasSize(t){_(this.#r,t)}constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref),new Xr(()=>this.root.scrollbarXNode,()=>{const n=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=n,_(this.#e,n,!0)}),new Xr(()=>this.root.scrollbarYNode,()=>{const n=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=n,_(this.#t,n,!0)})}#n=P(()=>({id:this.opts.id.current,style:{width:u(this.#t),height:u(this.#e),position:"absolute",right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:0},[Wn.corner]:"",...this.attachment}));get props(){return u(this.#n)}set props(t){_(this.#n,t)}}function Ao(e){return e?Number.parseInt(e,10):0}function ku(e,t){const r=e/t;return Number.isNaN(r)?0:r}function qo(e){const t=ku(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Jm({pointerPos:e,pointerOffset:t,sizes:r,dir:n="ltr"}){const o=qo(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return Eu([l,c],f)(e)}function il({scrollPos:e,sizes:t,dir:r="ltr"}){const n=qo(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=Zm(e,l[0],l[1]);return Eu([0,s],[0,a])(c)}function Eu(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Ou(e,t){return e>0&&eo.cancelAnimationFrame(n)}var $m=z("
");function tb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=w(t,"type",3,"hover"),s=w(t,"dir",3,"ltr"),a=w(t,"scrollHideDelay",3,600),l=K(t,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=Ks.create({type:E(()=>i()),dir:E(()=>s()),scrollHideDelay:E(()=>a()),id:E(()=>o()),ref:E(()=>n(),v=>n(v))}),d=P(()=>ht(l,c.props));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=$m();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}var eb=z("
");function rb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","children"]);const s=js.create({id:E(()=>o()),ref:E(()=>n(),h=>n(h))}),a=P(()=>ht(i,s.props)),l=P(()=>ht({},s.contentProps));var c=eb();wt(c,()=>({...u(a)}));var d=et(c);wt(d,()=>({...u(l)}));var f=et(d);B(f,()=>t.children??Q),y(e,c),F()}var nb=z("
");function Nu(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy","child","children"]);const n=Qs.create(),o=P(()=>ht(r,n.props));var i=N(),s=A(i);{var a=c=>{var d=N(),f=A(d);B(f,()=>t.child,()=>({props:u(o)})),y(c,d)},l=c=>{var d=nb();wt(d,()=>({...u(o)}));var f=et(d);B(f,()=>t.children??Q),y(c,d)};nt(s,c=>{t.child?c(a):c(l,!1)})}y(e,i),F()}function ob(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=new ss,o=Zs.create({mounted:E(()=>n.current)}),i=P(()=>ht(r,o.props));Nu(e,U(()=>u(i))),F()}function ib(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=new ss,o=Js.create({mounted:E(()=>n.current)}),i=P(()=>ht(r,o.props));Nu(e,U(()=>u(i))),F()}function Zo(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=qs.create();var o=N(),i=A(o);{var s=l=>{ob(l,U(()=>r))},a=l=>{ib(l,U(()=>r))};nt(i,l=>{n.scrollbar.opts.orientation.current==="horizontal"?l(s):l(a,!1)})}y(e,o),F()}function sb(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Xo.create(),i=P(()=>ht(n,o.props));{const s=l=>{Zo(l,U(()=>u(i)))};let a=P(()=>r()||o.isVisible);Go(e,{get open(){return u(a)},get ref(){return o.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}})}F()}function ab(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Xs.create(),i=P(()=>ht(n,o.props));{const s=l=>{Zo(l,U(()=>u(i)))};let a=P(()=>r()||!o.isHidden);Go(e,U(()=>u(i),{get open(){return u(a)},get ref(){return o.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}}))}F()}function lb(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Ys.create(),i=Xo.create(),s=P(()=>ht(n,o.props,i.props,{"data-state":o.isVisible?"visible":"hidden"})),a=P(()=>r()||o.isVisible&&i.isVisible);Go(e,{get open(){return u(a)},get ref(){return i.scrollbar.opts.ref},presence:c=>{Zo(c,U(()=>u(s)))},$$slots:{presence:!0}}),F()}function cb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","orientation"]);const s=Gs.create({orientation:E(()=>t.orientation),id:E(()=>o()),ref:E(()=>n(),g=>n(g))}),a=P(()=>s.root.opts.type.current);var l=N(),c=A(l);{var d=g=>{lb(g,U(()=>i,{get id(){return o()}}))},f=g=>{ab(g,U(()=>i,{get id(){return o()}}))},h=g=>{sb(g,U(()=>i,{get id(){return o()}}))},p=g=>{Zo(g,U(()=>i,{get id(){return o()}}))};nt(c,g=>{u(a)==="hover"?g(d):u(a)==="scroll"?g(f,1):u(a)==="auto"?g(h,2):u(a)==="always"&&g(p,3)})}y(e,l),F()}var ub=z("
");function db(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const o=new ss,i=$s.create({id:E(()=>t.id),ref:E(()=>r(),f=>r(f)),mounted:E(()=>o.current)}),s=P(()=>ht(n,i.props,{style:{hidden:!t.present}}));var a=N(),l=A(a);{var c=f=>{var h=N(),p=A(h);B(p,()=>t.child,()=>({props:u(s)})),y(f,h)},d=f=>{var h=ub();wt(h,()=>({...u(s)}));var p=et(h);B(p,()=>t.children??Q),y(f,h)};nt(l,f=>{t.child?f(c):f(d,!1)})}y(e,a),F()}function fb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"forceMount",3,!1),s=K(t,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const a=Yo.get();{const l=(d,f)=>{let h=()=>f?.().present;db(d,U(()=>s,{get id(){return n()},get present(){return h()},get ref(){return o()},set ref(p){o(p)}}))};let c=P(()=>i()||a.hasThumb);Go(e,{get open(){return u(c)},get ref(){return a.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}F()}var hb=z("
");function pb(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","id","children","child"]);const o=ta.create({id:E(()=>t.id),ref:E(()=>r(),d=>r(d))}),i=P(()=>ht(n,o.props));var s=N(),a=A(s);{var l=d=>{var f=N(),h=A(f);B(h,()=>t.child,()=>({props:u(i)})),y(d,f)},c=d=>{var f=hb();wt(f,()=>({...u(i)}));var h=et(f);B(h,()=>t.children??Q),y(d,f)};nt(a,d=>{t.child?d(l):d(c,!1)})}y(e,s),F()}function gb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id"]);const s=Hn.get(),a=P(()=>!!(s.scrollbarXNode&&s.scrollbarYNode)),l=P(()=>s.opts.type.current!=="scroll"&&u(a));var c=N(),d=A(c);{var f=h=>{pb(h,U(()=>i,{get id(){return o()},get ref(){return n()},set ref(p){n(p)}}))};nt(d,h=>{u(l)&&h(f)})}y(e,c),F()}class Fi{#t;#e;#r=null;constructor(t,r){this.#e=t,this.#t=r,this.stop=this.stop.bind(this),this.start=this.start.bind(this),Rr(this.stop)}#n(){this.#r!==null&&(window.clearTimeout(this.#r),this.#r=null)}stop(){this.#n()}start(...t){this.#n(),this.#r=window.setTimeout(()=>{this.#r=null,this.#e(...t)},this.#t)}}const Mu=Vn({component:"tooltip",parts:["content","trigger"]}),Iu=new Zt("Tooltip.Provider"),ea=new Zt("Tooltip.Root");class vb{#t=I(It(new Map));get triggers(){return u(this.#t)}set triggers(t){_(this.#t,t,!0)}#e=I(null);get activeTriggerId(){return u(this.#e)}set activeTriggerId(t){_(this.#e,t,!0)}#r=P(()=>{const t=this.activeTriggerId;return t===null?null:this.triggers.get(t)?.node??null});get activeTriggerNode(){return u(this.#r)}set activeTriggerNode(t){_(this.#r,t)}#n=P(()=>{const t=this.activeTriggerId;return t===null?null:this.triggers.get(t)?.payload??null});get activePayload(){return u(this.#n)}set activePayload(t){_(this.#n,t)}register=t=>{const r=new Map(this.triggers);r.set(t.id,t),this.triggers=r,this.#o()};update=t=>{const r=new Map(this.triggers);r.set(t.id,t),this.triggers=r,this.#o()};unregister=t=>{if(!this.triggers.has(t))return;const r=new Map(this.triggers);r.delete(t),this.triggers=r,this.activeTriggerId===t&&(this.activeTriggerId=null)};setActiveTrigger=t=>{if(t===null){this.activeTriggerId=null;return}if(!this.triggers.has(t)){this.activeTriggerId=null;return}this.activeTriggerId=t};get=t=>this.triggers.get(t);has=t=>this.triggers.has(t);getFirstTriggerId=()=>{const t=this.triggers.entries().next();return t.done?null:t.value[0]};#o=()=>{const t=this.activeTriggerId;t!==null&&(this.triggers.has(t)||(this.activeTriggerId=null))}}class ra{static create(t){return Iu.set(new ra(t))}opts;#t=I(!0);get isOpenDelayed(){return u(this.#t)}set isOpenDelayed(t){_(this.#t,t,!0)}isPointerInTransit=qt(!1);#e;#r=I(null);constructor(t){this.opts=t,this.#e=new Fi(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),as(()=>dt(window,"scroll",r=>{const n=u(this.#r);if(!n)return;const o=n.triggerNode;if(!o)return;const i=r.target;(i instanceof Element||i instanceof Document)&&i.contains(o)&&n.handleClose()}))}#n=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}else this.#e.start()};#o=()=>{this.#e.stop()};onOpen=t=>{u(this.#r)&&u(this.#r)!==t&&u(this.#r).handleClose(),this.#o(),this.isOpenDelayed=!1,_(this.#r,t,!0)};onClose=t=>{u(this.#r)===t&&_(this.#r,null),this.#n()};isTooltipOpen=t=>u(this.#r)===t}class na{static create(t){return ea.set(new na(t,Iu.get()))}opts;provider;#t=P(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return u(this.#t)}set delayDuration(t){_(this.#t,t)}#e=P(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return u(this.#e)}set disableHoverableContent(t){_(this.#e,t)}#r=P(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return u(this.#r)}set disableCloseOnTriggerClick(t){_(this.#r,t)}#n=P(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return u(this.#n)}set disabled(t){_(this.#n,t)}#o=P(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return u(this.#o)}set ignoreNonKeyboardFocus(t){_(this.#o,t)}registry;tether;#i=I(null);get contentNode(){return u(this.#i)}set contentNode(t){_(this.#i,t,!0)}contentPresence;#a=I(!1);#s;#l=P(()=>this.opts.open.current?u(this.#a)?"delayed-open":"instant-open":"closed");get stateAttr(){return u(this.#l)}set stateAttr(t){_(this.#l,t)}constructor(t,r){this.opts=t,this.provider=r,this.tether=t.tether.current?.state??null,this.registry=this.tether?.registry??new vb,this.#s=new Fi(()=>{_(this.#a,!0),this.opts.open.current=!0},this.delayDuration??0),this.tether&&(this.tether.root=this,as(()=>()=>{this.tether?.root===this&&(this.tether.root=null)})),this.contentPresence=new fo({open:this.opts.open,ref:E(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Pt(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new Fi(()=>{_(this.#a,!0),this.opts.open.current=!0},this.delayDuration))}),Pt(()=>this.opts.open.current,n=>{n?(this.ensureActiveTrigger(),this.provider.onOpen(this)):this.provider.onClose(this)},{lazy:!0}),Pt(()=>this.opts.triggerId.current,n=>{n!==this.registry.activeTriggerId&&this.registry.setActiveTrigger(n)}),Pt(()=>this.registry.activeTriggerId,n=>{this.opts.triggerId.current!==n&&(this.opts.triggerId.current=n)})}handleOpen=()=>{this.#s.stop(),_(this.#a,!1),this.ensureActiveTrigger(),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#c=()=>{this.#s.stop();const t=!this.provider.isOpenDelayed,r=this.delayDuration??0;t||r===0?(_(this.#a,!1),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=t=>{this.setActiveTrigger(t),this.#c()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()};ensureActiveTrigger=()=>{if(this.registry.activeTriggerId!==null&&this.registry.has(this.registry.activeTriggerId))return;if(this.opts.triggerId.current!==null&&this.registry.has(this.opts.triggerId.current)){this.registry.setActiveTrigger(this.opts.triggerId.current);return}const t=this.registry.getFirstTriggerId();this.registry.setActiveTrigger(t)};setActiveTrigger=t=>{this.registry.setActiveTrigger(t)};registerTrigger=t=>{this.registry.register(t),t.disabled&&this.registry.activeTriggerId===t.id&&this.opts.open.current&&this.handleClose()};updateTrigger=t=>{this.registry.update(t),t.disabled&&this.registry.activeTriggerId===t.id&&this.opts.open.current&&this.handleClose()};unregisterTrigger=t=>{const r=this.registry.activeTriggerId===t;this.registry.unregister(t),r&&this.opts.open.current&&this.handleClose()};isActiveTrigger=t=>this.registry.activeTriggerId===t;get triggerNode(){return this.registry.activeTriggerNode}get activePayload(){return this.registry.activePayload}get activeTriggerId(){return this.registry.activeTriggerId}}class ko{static create(t){return t.tether.current?new ko(t,null,t.tether.current.state):new ko(t,ea.get(),null)}opts;root;tether;attachment;#t=qt(!1);#e=I(!1);domContext;#r=null;#n=!1;#o=null;constructor(t,r,n){this.opts=t,this.root=r,this.tether=n,this.domContext=new zn(t.ref),this.attachment=Ot(this.opts.ref,o=>this.#s(o)),Pt(()=>this.opts.id.current,()=>{this.#s(this.opts.ref.current)}),Pt(()=>this.opts.payload.current,()=>{this.#s(this.opts.ref.current)}),Pt(()=>this.opts.disabled.current,()=>{this.#s(this.opts.ref.current)}),as(()=>(this.#n=!0,this.#s(this.opts.ref.current),()=>{const o=this.#i(),i=this.#o;i&&(this.tether?this.tether.registry.unregister(i):o?.unregisterTrigger(i)),this.#o=null,this.#n=!1}))}#i=()=>this.tether?.root??this.root;#a=()=>{const t=this.#i();return this.opts.disabled.current||!!t?.disabled};#s=t=>{if(!this.#n)return;const r=this.opts.id.current,n=this.opts.payload.current,o=this.opts.disabled.current;if(this.#o&&this.#o!==r){const a=this.#i();this.tether?this.tether.registry.unregister(this.#o):a?.unregisterTrigger(this.#o)}const i={id:r,node:t,payload:n,disabled:o},s=this.#i();this.tether?(this.tether.registry.has(r)?this.tether.registry.update(i):this.tether.registry.register(i),o&&this.tether.registry.activeTriggerId===r&&s?.opts.open.current&&s.handleClose()):s?.registry.has(r)?s.updateTrigger(i):s?.registerTrigger(i),this.#o=r};#l=()=>{this.#r!==null&&(clearTimeout(this.#r),this.#r=null)};handlePointerUp=()=>{this.#t.current=!1};#c=()=>{this.#a()||(this.#t.current=!1)};#u=()=>{this.#a()||(this.#t.current=!0,this.domContext.getDocument().addEventListener("pointerup",()=>{this.handlePointerUp()},{once:!0}))};#d=t=>{const r=this.#i();if(r){if(this.#a()){r.opts.open.current&&r.handleClose();return}if(t.pointerType!=="touch"){if(r.provider.isPointerInTransit.current){this.#l(),this.#r=window.setTimeout(()=>{r.provider.isPointerInTransit.current&&(r.provider.isPointerInTransit.current=!1,r.onTriggerEnter(this.opts.id.current),_(this.#e,!0))},250);return}r.onTriggerEnter(this.opts.id.current),_(this.#e,!0)}}};#h=t=>{const r=this.#i();if(r){if(this.#a()){r.opts.open.current&&r.handleClose();return}t.pointerType!=="touch"&&(u(this.#e)||(this.#l(),r.provider.isPointerInTransit.current=!1,r.onTriggerEnter(this.opts.id.current),_(this.#e,!0)))}};#p=t=>{const r=this.#i();if(!r||this.#a())return;if(this.#l(),!r.isActiveTrigger(this.opts.id.current)){_(this.#e,!1);return}const n=t.relatedTarget;if(De(n)&&r.provider.opts.skipDelayDuration.current>0){for(const o of r.registry.triggers.values())if(o.node===n){_(this.#e,!1);return}}r.onTriggerLeave(),_(this.#e,!1)};#f=t=>{const r=this.#i();if(r&&!this.#t.current){if(this.#a()){r.opts.open.current&&r.handleClose();return}r.ignoreNonKeyboardFocus&&!Zp(t.currentTarget)||(r.setActiveTrigger(this.opts.id.current),r.handleOpen())}};#g=()=>{const t=this.#i();!t||this.#a()||t.handleClose()};#v=()=>{const t=this.#i();!t||t.disableCloseOnTriggerClick||this.#a()||t.handleClose()};#m=P(()=>{const t=this.#i(),r=!!(t?.opts.open.current&&t.isActiveTrigger(this.opts.id.current)),n=this.#a();return{id:this.opts.id.current,"aria-describedby":r?t?.contentNode?.id:void 0,"data-state":r?t?.stateAttr:"closed","data-disabled":sr(n),"data-delay-duration":`${t?.delayDuration??0}`,[Mu.trigger]:"",tabindex:n?void 0:this.opts.tabindex.current,disabled:this.opts.disabled.current,onpointerup:this.#c,onpointerdown:this.#u,onpointerenter:this.#d,onpointermove:this.#h,onpointerleave:this.#p,onfocus:this.#f,onblur:this.#g,onclick:this.#v,...this.attachment}});get props(){return u(this.#m)}set props(t){_(this.#m,t)}}class oa{static create(t){return new oa(t,ea.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>this.root.contentNode=n),new Nm({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,ignoredTargets:()=>{if(this.root.provider.opts.skipDelayDuration.current===0)return[];const n=[],o=this.root.triggerNode;for(const i of this.root.registry.triggers.values())i.node&&i.node!==o&&n.push(i.node);return n},onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()}})}onInteractOutside=t=>{if(De(t.target)&&this.root.triggerNode?.contains(t.target)&&this.root.disableCloseOnTriggerClick){t.preventDefault();return}this.opts.onInteractOutside.current(t),!t.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current?.(t),!t.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=t=>{t.preventDefault()};onCloseAutoFocus=t=>{t.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":sr(this.root.disabled),style:{outline:"none"},[Mu.content]:"",...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}}function mb(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"triggerId",15,null),o=w(t,"onOpenChange",3,St),i=w(t,"onOpenChangeComplete",3,St);const s=na.create({open:E(()=>r(),a=>{r(a),o()(a)}),triggerId:E(()=>n(),a=>{n(a)}),delayDuration:E(()=>t.delayDuration),disableCloseOnTriggerClick:E(()=>t.disableCloseOnTriggerClick),disableHoverableContent:E(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:E(()=>t.ignoreNonKeyboardFocus),disabled:E(()=>t.disabled),onOpenChangeComplete:E(()=>i()),tether:E(()=>t.tether)});xu(e,{tooltip:!0,children:(a,l)=>{var c=N(),d=A(c);B(d,()=>t.children??Q,()=>({open:s.opts.open.current,triggerId:s.activeTriggerId,payload:s.activePayload})),y(a,c)},$$slots:{default:!0}}),F()}var bb=z("
"),yb=z("
");function wb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"side",3,"top"),s=w(t,"sideOffset",3,0),a=w(t,"align",3,"center"),l=w(t,"avoidCollisions",3,!0),c=w(t,"arrowPadding",3,0),d=w(t,"sticky",3,"partial"),f=w(t,"hideWhenDetached",3,!1),h=w(t,"collisionPadding",3,0),p=w(t,"onInteractOutside",3,St),g=w(t,"onEscapeKeydown",3,St),v=w(t,"forceMount",3,!1),m=K(t,["$$slots","$$events","$$legacy","children","child","id","ref","side","sideOffset","align","avoidCollisions","arrowPadding","sticky","strategy","hideWhenDetached","customAnchor","collisionPadding","onInteractOutside","onEscapeKeydown","forceMount","style"]);const b=oa.create({id:E(()=>n()),ref:E(()=>o(),S=>o(S)),onInteractOutside:E(()=>p()),onEscapeKeydown:E(()=>g())}),O=P(()=>({side:i(),sideOffset:s(),align:a(),avoidCollisions:l(),arrowPadding:c(),sticky:d(),hideWhenDetached:f(),collisionPadding:h(),strategy:t.strategy,customAnchor:t.customAnchor??b.root.triggerNode})),C=P(()=>ht(m,u(O),b.props));var x=N(),T=A(x);{var k=S=>{{const L=(ct,st)=>{let _t=()=>st?.().props,G=()=>st?.().wrapperProps;const Y=P(()=>ht(_t(),{style:xo("tooltip")},{style:t.style}));var W=N(),Z=A(W);{var X=M=>{var $=N(),it=A($);{let ft=P(()=>({props:u(Y),wrapperProps:G(),...b.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(M,$)},ot=M=>{var $=bb();wt($,()=>({...G()}));var it=et($);wt(it,()=>({...u(Y)}));var ft=et(it);B(ft,()=>t.children??Q),y(M,$)};nt(Z,M=>{t.child?M(X):M(ot,!1)})}y(ct,W)};let V=P(()=>b.root.disableHoverableContent?"none":"auto");Tu(S,U(()=>u(C),()=>b.popperProps,{get enabled(){return b.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return b.opts.ref},tooltip:!0,get shouldRender(){return b.shouldRender},get contentPointerEvents(){return u(V)},popper:L,$$slots:{popper:!0}}))}},R=S=>{{const L=(ct,st)=>{let _t=()=>st?.().props,G=()=>st?.().wrapperProps;const Y=P(()=>ht(_t(),{style:xo("tooltip")},{style:t.style}));var W=N(),Z=A(W);{var X=M=>{var $=N(),it=A($);{let ft=P(()=>({props:u(Y),wrapperProps:G(),...b.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(M,$)},ot=M=>{var $=yb();wt($,()=>({...G()}));var it=et($);wt(it,()=>({...u(Y)}));var ft=et(it);B(ft,()=>t.children??Q),y(M,$)};nt(Z,M=>{t.child?M(X):M(ot,!1)})}y(ct,W)};let V=P(()=>b.root.disableHoverableContent?"none":"auto");Pu(S,U(()=>u(C),()=>b.popperProps,{get open(){return b.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return b.opts.ref},tooltip:!0,get shouldRender(){return b.shouldRender},get contentPointerEvents(){return u(V)},popper:L,$$slots:{popper:!0}}))}};nt(T,S=>{v()?S(k):v()||S(R,1)})}y(e,x),F()}var _b=z("");function xb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"disabled",3,!1),i=w(t,"type",3,"button"),s=w(t,"tabindex",3,0),a=w(t,"ref",15,null),l=K(t,["$$slots","$$events","$$legacy","children","child","id","disabled","payload","tether","type","tabindex","ref"]);const c=ko.create({id:E(()=>n()),disabled:E(()=>o()??!1),tabindex:E(()=>s()??0),payload:E(()=>t.payload),tether:E(()=>t.tether),ref:E(()=>a(),v=>a(v))}),d=P(()=>ht(l,c.props,{type:i()}));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=_b();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}function Sb(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);bm(e,U(()=>n,{get ref(){return r()},set ref(o){r(o)}})),F()}function Pb(e,t){D(t,!0);let r=w(t,"delayDuration",3,700),n=w(t,"disableCloseOnTriggerClick",3,!1),o=w(t,"disableHoverableContent",3,!1),i=w(t,"disabled",3,!1),s=w(t,"ignoreNonKeyboardFocus",3,!1),a=w(t,"skipDelayDuration",3,300);ra.create({delayDuration:E(()=>r()),disableCloseOnTriggerClick:E(()=>n()),disableHoverableContent:E(()=>o()),disabled:E(()=>i()),ignoreNonKeyboardFocus:E(()=>s()),skipDelayDuration:E(()=>a())});var l=N(),c=A(l);B(c,()=>t.children??Q),y(e,l),F()}function gr(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>mb,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function vr(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=A(o);H(i,()=>xb,(s,a)=>{a(s,U({"data-slot":"tooltip-trigger"},()=>n,{get ref(){return r()},set ref(l){r(l)}}))}),y(e,o),F()}const Tb=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),Du=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Eo="-",sl=[],Ab="arbitrary..",kb=e=>{const t=Ob(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Eb(s);const a=s.split(Eo),l=a[0]===""&&a.length>1?1:0;return Fu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Tb(c,l):l:c||sl}return r[s]||sl}}},Fu=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Fu(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Eo):e.slice(t).join(Eo),l=s.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Ab+n:void 0})(),Ob=e=>{const{theme:t,classGroups:r}=e;return Nb(r,t)},Nb=(e,t)=>{const r=Du();for(const n in e){const o=e[n];ia(o,r,n,t)}return r},ia=(e,t,r,n)=>{const o=e.length;for(let i=0;i{if(typeof e=="string"){Ib(e,t,r);return}if(typeof e=="function"){Db(e,t,r,n);return}Fb(e,t,r,n)},Ib=(e,t,r)=>{const n=e===""?t:Ru(t,e);n.classGroupId=r},Db=(e,t,r,n)=>{if(Rb(e)){ia(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Cb(r,e))},Fb=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s{let r=e;const n=t.split(Eo),o=n.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Lb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},Ri="!",al=":",zb=[],ll=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Vb=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let v=0;vl?c-l:void 0;return ll(i,p,h,g)};if(t){const o=t+al,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):ll(zb,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Bb=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Wb=e=>({cache:Lb(e.cacheSize),parseClassName:Vb(e),sortModifiers:Bb(e),...kb(e)}),Hb=/\s+/,Ub=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Hb);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=r(d);if(f){l=d+(l.length>0?" "+l:l);continue}let m=!!v,b=n(m?g.substring(0,v):g);if(!b){if(!m){l=d+(l.length>0?" "+l:l);continue}if(b=n(g),!b){l=d+(l.length>0?" "+l:l);continue}m=!1}const O=h.length===0?"":h.length===1?h[0]:i(h).join(":"),C=p?O+Ri:O,x=C+b;if(s.indexOf(x)>-1)continue;s.push(x);const T=o(b,m);for(let k=0;k0?" "+l:l)}return l},Kb=(...e)=>{let t=0,r,n,o="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,o,i;const s=l=>{const c=t.reduce((d,f)=>f(d),e());return r=Wb(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=Ub(l,r);return o(l,d),d};return i=s,(...l)=>i(Kb(...l))},jb=[],Ft=e=>{const t=r=>r[e]||jb;return t.isThemeGetter=!0,t},zu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ye=e=>Gb.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),Xe=e=>!!e&&Number.isInteger(Number(e)),li=e=>e.endsWith("%")&&ut(e.slice(0,-1)),Ee=e=>Yb.test(e),Bu=()=>!0,Qb=e=>Xb.test(e)&&!qb.test(e),sa=()=>!1,$b=e=>Zb.test(e),ty=e=>Jb.test(e),ey=e=>!q(e)&&!J(e),ry=e=>fr(e,Uu,sa),q=e=>zu.test(e),mr=e=>fr(e,Ku,Qb),cl=e=>fr(e,uy,ut),ny=e=>fr(e,Gu,Bu),oy=e=>fr(e,ju,sa),ul=e=>fr(e,Wu,sa),iy=e=>fr(e,Hu,ty),Jn=e=>fr(e,Yu,$b),J=e=>Vu.test(e),fn=e=>Lr(e,Ku),sy=e=>Lr(e,ju),dl=e=>Lr(e,Wu),ay=e=>Lr(e,Uu),ly=e=>Lr(e,Hu),Qn=e=>Lr(e,Yu,!0),cy=e=>Lr(e,Gu,!0),fr=(e,t,r)=>{const n=zu.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lr=(e,t,r=!1)=>{const n=Vu.exec(e);return n?n[1]?t(n[1]):r:!1},Wu=e=>e==="position"||e==="percentage",Hu=e=>e==="image"||e==="url",Uu=e=>e==="length"||e==="size"||e==="bg-size",Ku=e=>e==="length",uy=e=>e==="number",ju=e=>e==="family-name",Gu=e=>e==="number"||e==="weight",Yu=e=>e==="shadow",zi=()=>{const e=Ft("color"),t=Ft("font"),r=Ft("text"),n=Ft("font-weight"),o=Ft("tracking"),i=Ft("leading"),s=Ft("breakpoint"),a=Ft("container"),l=Ft("spacing"),c=Ft("radius"),d=Ft("shadow"),f=Ft("inset-shadow"),h=Ft("text-shadow"),p=Ft("drop-shadow"),g=Ft("blur"),v=Ft("perspective"),m=Ft("aspect"),b=Ft("ease"),O=Ft("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...x(),J,q],k=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],S=()=>[J,q,l],L=()=>[Ye,"full","auto",...S()],V=()=>[Xe,"none","subgrid",J,q],ct=()=>["auto",{span:["full",Xe,J,q]},Xe,J,q],st=()=>[Xe,"auto",J,q],_t=()=>["auto","min","max","fr",J,q],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...S()],Z=()=>[Ye,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],X=()=>[Ye,"screen","full","dvw","lvw","svw","min","max","fit",...S()],ot=()=>[Ye,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],M=()=>[e,J,q],$=()=>[...x(),dl,ul,{position:[J,q]}],it=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ft=()=>["auto","cover","contain",ay,ry,{size:[J,q]}],pt=()=>[li,fn,mr],tt=()=>["","none","full",c,J,q],at=()=>["",ut,fn,mr],Tt=()=>["solid","dashed","dotted","double"],At=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],lt=()=>[ut,li,dl,ul],Et=()=>["","none",g,J,q],Ct=()=>["none",ut,J,q],hr=()=>["none",ut,J,q],xt=()=>[ut,J,q],Nt=()=>[Ye,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ee],breakpoint:[Ee],color:[Bu],container:[Ee],"drop-shadow":[Ee],ease:["in","out","in-out"],font:[ey],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ee],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ee],shadow:[Ee],spacing:["px",ut],text:[Ee],"text-shadow":[Ee],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ye,q,J,m]}],container:["container"],columns:[{columns:[ut,q,J,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Xe,"auto",J,q]}],basis:[{basis:[Ye,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,Ye,"auto","initial","none",q]}],grow:[{grow:["",ut,J,q]}],shrink:[{shrink:["",ut,J,q]}],order:[{order:[Xe,"first","last","none",J,q]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:ct()}],"col-start":[{"col-start":st()}],"col-end":[{"col-end":st()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:ct()}],"row-start":[{"row-start":st()}],"row-end":[{"row-end":st()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_t()}],"auto-rows":[{"auto-rows":_t()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mbs:[{mbs:W()}],mbe:[{mbe:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...ot()]}],"min-block-size":[{"min-block":["auto",...ot()]}],"max-block-size":[{"max-block":["none",...ot()]}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,fn,mr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,cy,ny]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",li,q]}],"font-family":[{font:[sy,oy,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,J,q]}],"line-clamp":[{"line-clamp":[ut,"none",J,cl]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",J,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Tt(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",J,mr]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[ut,"auto",J,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J,q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:it()}],"bg-size":[{bg:ft()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xe,J,q],radial:["",J,q],conic:[Xe,J,q]},ly,iy]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:pt()}],"gradient-via-pos":[{via:pt()}],"gradient-to-pos":[{to:pt()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:tt()}],"rounded-s":[{"rounded-s":tt()}],"rounded-e":[{"rounded-e":tt()}],"rounded-t":[{"rounded-t":tt()}],"rounded-r":[{"rounded-r":tt()}],"rounded-b":[{"rounded-b":tt()}],"rounded-l":[{"rounded-l":tt()}],"rounded-ss":[{"rounded-ss":tt()}],"rounded-se":[{"rounded-se":tt()}],"rounded-ee":[{"rounded-ee":tt()}],"rounded-es":[{"rounded-es":tt()}],"rounded-tl":[{"rounded-tl":tt()}],"rounded-tr":[{"rounded-tr":tt()}],"rounded-br":[{"rounded-br":tt()}],"rounded-bl":[{"rounded-bl":tt()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-bs":[{"border-bs":at()}],"border-w-be":[{"border-be":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Tt(),"hidden","none"]}],"divide-style":[{divide:[...Tt(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Tt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,J,q]}],"outline-w":[{outline:["",ut,fn,mr]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,Qn,Jn]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",f,Qn,Jn]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[ut,mr]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",h,Qn,Jn]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[ut,J,q]}],"mix-blend":[{"mix-blend":[...At(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":At()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":lt()}],"mask-image-linear-to-pos":[{"mask-linear-to":lt()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":lt()}],"mask-image-t-to-pos":[{"mask-t-to":lt()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":lt()}],"mask-image-r-to-pos":[{"mask-r-to":lt()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":lt()}],"mask-image-b-to-pos":[{"mask-b-to":lt()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":lt()}],"mask-image-l-to-pos":[{"mask-l-to":lt()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":lt()}],"mask-image-x-to-pos":[{"mask-x-to":lt()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":lt()}],"mask-image-y-to-pos":[{"mask-y-to":lt()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":lt()}],"mask-image-radial-to-pos":[{"mask-radial-to":lt()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":lt()}],"mask-image-conic-to-pos":[{"mask-conic-to":lt()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:it()}],"mask-size":[{mask:ft()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",J,q]}],filter:[{filter:["","none",J,q]}],blur:[{blur:Et()}],brightness:[{brightness:[ut,J,q]}],contrast:[{contrast:[ut,J,q]}],"drop-shadow":[{"drop-shadow":["","none",p,Qn,Jn]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",ut,J,q]}],"hue-rotate":[{"hue-rotate":[ut,J,q]}],invert:[{invert:["",ut,J,q]}],saturate:[{saturate:[ut,J,q]}],sepia:[{sepia:["",ut,J,q]}],"backdrop-filter":[{"backdrop-filter":["","none",J,q]}],"backdrop-blur":[{"backdrop-blur":Et()}],"backdrop-brightness":[{"backdrop-brightness":[ut,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[ut,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,J,q]}],"backdrop-invert":[{"backdrop-invert":["",ut,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[ut,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[ut,J,q]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,J,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",J,q]}],ease:[{ease:["linear","initial",b,J,q]}],delay:[{delay:[ut,J,q]}],animate:[{animate:["none",O,J,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,J,q]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ct()}],"rotate-x":[{"rotate-x":Ct()}],"rotate-y":[{"rotate-y":Ct()}],"rotate-z":[{"rotate-z":Ct()}],scale:[{scale:hr()}],"scale-x":[{"scale-x":hr()}],"scale-y":[{"scale-y":hr()}],"scale-z":[{"scale-z":hr()}],"scale-3d":["scale-3d"],skew:[{skew:xt()}],"skew-x":[{"skew-x":xt()}],"skew-y":[{"skew-y":xt()}],transform:[{transform:[J,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Nt()}],"translate-x":[{"translate-x":Nt()}],"translate-y":[{"translate-y":Nt()}],"translate-z":[{"translate-z":Nt()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J,q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J,q]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[ut,fn,mr,cl]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dy=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:i={}})=>(vn(e,"cacheSize",t),vn(e,"prefix",r),vn(e,"experimentalParseClassName",n),$n(e.theme,i.theme),$n(e.classGroups,i.classGroups),$n(e.conflictingClassGroups,i.conflictingClassGroups),$n(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),vn(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),to(e.theme,o.theme),to(e.classGroups,o.classGroups),to(e.conflictingClassGroups,o.conflictingClassGroups),to(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Xu(e,o,"orderSensitiveModifiers"),e),vn=(e,t,r)=>{r!==void 0&&(e[t]=r)},$n=(e,t)=>{if(t)for(const r in t)vn(e,r,t[r])},to=(e,t)=>{if(t)for(const r in t)Xu(e,t,r)},Xu=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},fy=(e,...t)=>typeof e=="function"?Li(zi,e,...t):Li(()=>dy(zi(),e),...t),qu=Li(zi);function Gt(...e){return qu(bn(e))}function hy(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}var py=z("
"),gy=z(" ",1);function br(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"sideOffset",3,0),o=w(t,"side",3,"top"),i=K(t,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","children","arrowClasses","portalProps"]);hy(e,U(()=>t.portalProps,{children:(s,a)=>{var l=N(),c=A(l);{let d=P(()=>Gt("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--bits-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t.class));H(c,()=>wb,(f,h)=>{h(f,U({"data-slot":"tooltip-content",get sideOffset(){return n()},get side(){return o()},get class(){return u(d)}},()=>i,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=gy(),m=A(v);B(m,()=>t.children??Q);var b=j(m,2);{const O=(C,x)=>{let T=()=>x?.().props;var k=py();wt(k,R=>({class:R,...T()}),[()=>Gt("bg-foreground z-50 size-2.5 rotate-45 rounded-[2px]","data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]","data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]","data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2","data-[side=left]:-translate-y-[calc(50%_-_3px)]",t.arrowClasses)]),y(C,k)};H(b,()=>Sb,(C,x)=>{x(C,{child:O,$$slots:{child:!0}})})}y(p,v)},$$slots:{default:!0}}))})}y(s,l)},$$slots:{default:!0}})),F()}function vy(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>Pb,(i,s)=>{s(i,U(()=>r))}),y(e,n)}const my={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const by=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var yy=pc("");function Yt(e,t){D(t,!0);const r=w(t,"color",3,"currentColor"),n=w(t,"size",3,24),o=w(t,"strokeWidth",3,2),i=w(t,"absoluteStrokeWidth",3,!1),s=w(t,"iconNode",19,()=>[]),a=K(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var l=yy();wt(l,(f,h)=>({...my,...f,...a,width:n(),height:n(),stroke:r(),"stroke-width":h,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!by(a)&&{"aria-hidden":"true"},()=>i()?Number(o())*24/Number(n()):o()]);var c=et(l);Sn(c,17,s,Df,(f,h)=>{var p=P(()=>hd(u(h),2));let g=()=>u(p)[0],v=()=>u(p)[1];var m=N(),b=A(m);Vf(b,g,!0,(O,C)=>{wt(O,()=>({...v()}))}),y(f,m)});var d=j(c);B(d,()=>t.children??Q),y(e,l),F()}function wy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["line",{x1:"2",x2:"22",y1:"2",y2:"22"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9"}]];Yt(e,U({name:"image-off"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function _y(){const e=new URL(window.location.href).searchParams;return{host:e.get("hgd")||e.get("host")||window.location.host,token:e.get("token")||void 0,allowWebsockets:e.has("ws")?e.get("ws")!=="0":!0,sidebarHidden:e.has("sidebar")?e.get("sidebar")==="0":!1}}function zr(e){const t=window.location.protocol==="https:"?"https":"http";return e.startsWith("http://")||e.startsWith("https://")?e:`${t}://${e}`}function xy(e){const t=window.location.protocol==="https:"?"wss":"ws";return e.startsWith("ws://")||e.startsWith("wss://")?e:`${t}://${e}`}function aa(e){const t={};return e&&(t["X-HTTPGD-TOKEN"]=e),t}async function Jo(e,t){const r=await fetch(e,{headers:aa(t)});if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);return r.json()}async function Sy(e,t){return Jo(`${zr(e)}/state`,t)}async function Py(e,t){return Jo(`${zr(e)}/plots`,t)}async function Ty(e,t){return(await Jo(`${zr(e)}/renderers`,t)).renderers}async function Cy(e,t){return Jo(`${zr(e)}/info`,t)}async function Zu(e,t,r){const n=new URL(`${zr(e)}/remove`);n.searchParams.set("id",t.id),await fetch(n.toString(),{headers:aa(r)})}async function Ay(e,t){await fetch(`${zr(e)}/clear`,{headers:aa(t)})}function _n(e,t,r,n){const o=new URL(`${zr(e)}/plot`);return t.id&&o.searchParams.set("id",t.id),t.renderer&&o.searchParams.set("renderer",t.renderer),t.width!=null&&o.searchParams.set("width",Math.round(t.width).toString()),t.height!=null&&o.searchParams.set("height",Math.round(t.height).toString()),t.zoom!=null&&o.searchParams.set("zoom",t.zoom.toString()),t.download&&o.searchParams.set("download",t.download),r&&o.searchParams.set("token",r),n&&o.searchParams.set("c",n),o.toString()}const oo=1.25,ci=oo/12,ky=.5;class Ey{#t=I(It([]));get plots(){return u(this.#t)}set plots(t){_(this.#t,t,!0)}#e=I("0");get upid(){return u(this.#e)}set upid(t){_(this.#e,t,!0)}#r=I(1);get page(){return u(this.#r)}set page(t){_(this.#r,t,!0)}#n=I(oo);get zoom(){return u(this.#n)}set zoom(t){_(this.#n,t,!0)}host="";token;get currentPlotId(){if(this.plots.length===0)return null;let t=this.page;const r=this.plots.length;for(;t<1;)t+=r;for(;t>r;)t-=r;return this.plots[t-1].id}get pageLabel(){return this.plots.length>0?`${this.page}/${this.plots.length}`:"0/0"}get zoomLabel(){return Math.ceil(this.zoom/oo*100)+"%"}configure(t,r){this.host=t,this.token=r}updatePlots(t){this.plots=t.plots,this.upid=t.state.upid.toString(),this.page=t.plots.length}getPlotImageUrl(t,r,n){const o=n??this.currentPlotId;return o?_n(this.host,{id:o,width:t,height:r,zoom:this.zoom},this.token,this.upid):null}nextPage(){this.plots.length!==0&&(this.page=this.page>=this.plots.length?1:this.page+1)}prevPage(){this.plots.length!==0&&(this.page=this.page<=1?this.plots.length:this.page-1)}newestPage(){this.plots.length!==0&&(this.page=this.plots.length)}setPage(t){const r=this.plots.findIndex(n=>n.id===t);r>=0&&(this.page=r+1)}zoomIn(){this.zoom+=ci}zoomOut(){this.zoom-ci>ky&&(this.zoom-=ci)}zoomReset(){this.zoom=oo}}const rt=new Ey;var Oy=z('Plot'),Ny=z('

Waiting for plots

'),My=z('
');function Iy(e,t){D(t,!0);let r=w(t,"imageRef",15,null),n,o=I(0),i=I(0),s=I(!1);const a=P(()=>u(o)===0||u(i)===0?null:rt.getPlotImageUrl(u(o),u(i))),l=P(()=>rt.currentPlotId!==null);gt(()=>{if(!n)return;const v=new ResizeObserver(m=>{const b=m[0];b&&(_(o,b.contentRect.width,!0),_(i,b.contentRect.height,!0))});return v.observe(n),()=>v.disconnect()});function c(){_(s,!1)}function d(){u(a)&&_(s,!0)}var f=My(),h=et(f);{var p=v=>{var m=Oy();let b;Or(m,O=>r(O),()=>r()),zt(()=>{Wt(m,"src",u(a)),b=nr(m,1,"max-h-full max-w-full object-contain transition-opacity duration-150",null,b,{"opacity-80":u(s)})}),_a("load",m,c),_a("loadstart",m,d),y(v,m)},g=v=>{var m=Ny(),b=et(m);wy(b,{class:"h-12 w-12 opacity-30"}),y(v,m)};nt(h,v=>{u(l)&&u(a)?v(p):v(g,!1)})}Or(f,v=>n=v,()=>n),y(e,f),F()}function Dy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m15 18-6-6 6-6"}]];Yt(e,U({name:"chevron-left"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Fy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m9 18 6-6-6-6"}]];Yt(e,U({name:"chevron-right"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ry(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];Yt(e,U({name:"zoom-out"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ly(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];Yt(e,U({name:"zoom-in"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function zy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];Yt(e,U({name:"trash-2"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Vy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];Yt(e,U({name:"download"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function By(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];Yt(e,U({name:"image"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Wy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Yt(e,U({name:"copy"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function la(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Yt(e,U({name:"x"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Hy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"m5 11-3 3"}],["path",{d:"m5 17-3-3h10"}]];Yt(e,U({name:"file-output"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Uy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M15 3v18"}]];Yt(e,U({name:"panel-right"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ky(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];Yt(e,U({name:"ellipsis-vertical"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function jy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];Yt(e,U({name:"sun"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Gy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];Yt(e,U({name:"moon"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Yy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 8h.01"}],["path",{d:"M12 12h.01"}],["path",{d:"M14 8h.01"}],["path",{d:"M16 12h.01"}],["path",{d:"M18 8h.01"}],["path",{d:"M6 8h.01"}],["path",{d:"M7 16h10"}],["path",{d:"M8 12h.01"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}]];Yt(e,U({name:"keyboard"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}var Xy=/\s+/g,qy=e=>typeof e!="string"||!e?e:e.replace(Xy," ").trim(),Oo=(...e)=>{const t=[],r=n=>{if(!n&&n!==0&&n!==0n)return;if(Array.isArray(n)){for(let i=0,s=n.length;i0?qy(t.join(" ")):void 0},fl=e=>e===!1?"false":e===!0?"true":e===0?"0":e,Jt=e=>{if(!e||typeof e!="object")return!0;for(const t in e)return!1;return!0},Zy=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];r in e?e[r]=Oo(e[r],n):e[r]=n}return e},Ju=(e,t)=>{for(let r=0;r{const t=[];Ju(e,t);const r=[];for(let n=0;n{const r={};for(const n in e){const o=e[n];if(n in t){const i=t[n];Array.isArray(o)||Array.isArray(i)?r[n]=Qu(i,o):typeof o=="object"&&typeof i=="object"&&o&&i?r[n]=Vi(o,i):r[n]=i+" "+o}else r[n]=o}for(const n in t)n in e||(r[n]=t[n]);return r},Qy={twMerge:!0,twMergeConfig:{}};function $y(){let e=null,t={},r=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(n){e=n},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(n){t=n},get didTwMergeConfigChange(){return r},set didTwMergeConfigChange(n){r=n},reset(){e=null,t={},r=!1}}}var Ne=$y(),tw=e=>{const t=(n,o)=>{const{extend:i=null,slots:s={},variants:a={},compoundVariants:l=[],compoundSlots:c=[],defaultVariants:d={}}=n,f={...Qy,...o},h=i?.base?Oo(i.base,n?.base):n?.base,p=i?.variants&&!Jt(i.variants)?Vi(a,i.variants):a,g=i?.defaultVariants&&!Jt(i.defaultVariants)?{...i.defaultVariants,...d}:d;!Jt(f.twMergeConfig)&&!Zy(f.twMergeConfig,Ne.cachedTwMergeConfig)&&(Ne.didTwMergeConfigChange=!0,Ne.cachedTwMergeConfig=f.twMergeConfig);const v=Jt(i?.slots),m=Jt(s)?{}:{base:Oo(n?.base,v&&i?.base),...s},b=v?m:Jy({...i?.slots},Jt(m)?{base:n?.base}:m),O=Jt(i?.compoundVariants)?l:Qu(i?.compoundVariants,l),C=T=>{if(Jt(p)&&Jt(s)&&v)return e(h,T?.class,T?.className)(f);if(O&&!Array.isArray(O))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof O}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const k=(G,Y=p,W=null,Z=null)=>{const X=Y[G];if(!X||Jt(X))return null;const ot=Z?.[G]??T?.[G];if(ot===null)return null;const M=fl(ot);if(typeof M=="object")return null;const $=g?.[G],it=M??fl($);return X[it||"false"]},R=()=>{if(!p)return null;const G=Object.keys(p),Y=[];for(let W=0;W{if(!p||typeof p!="object")return null;const W=[];for(const Z in p){const X=k(Z,p,G,Y),ot=G==="base"&&typeof X=="string"?X:X&&X[G];ot&&W.push(ot)}return W},L={};for(const G in T){const Y=T[G];Y!==void 0&&(L[G]=Y)}const V=(G,Y)=>{const W=typeof T?.[G]=="object"?{[G]:T[G]?.initial}:{};return{...g,...L,...W,...Y}},ct=(G=[],Y)=>{const W=[],Z=G.length;for(let X=0;X{const Y=ct(O,G);if(!Array.isArray(Y))return Y;const W={},Z=e;for(let X=0;X{if(c.length<1)return null;const Y={},W=V(null,G);for(let Z=0;Z{const X=st(Z),ot=_t(Z);return Y(b[W],S(W,Z),X?X[W]:void 0,ot?ot[W]:void 0,Z?.class,Z?.className)(f)}}return G}return e(h,R(),ct(O),T?.class,T?.className)(f)},x=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return C.variantKeys=x(),C.extend=i,C.base=h,C.slots=b,C.variants=p,C.defaultVariants=g,C.compoundSlots=c,C.compoundVariants=O,C};return{tv:t,createTV:n=>(o,i)=>t(o,i?Vi(n,i):n)}},ew=e=>Jt(e)?qu:fy({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),rw=(e,t)=>{const r=Oo(e);return!r||!(t?.twMerge??!0)?r:((!Ne.cachedTwMerge||Ne.didTwMergeConfigChange)&&(Ne.didTwMergeConfigChange=!1,Ne.cachedTwMerge=ew(Ne.cachedTwMergeConfig)),Ne.cachedTwMerge(r)||void 0)},nw=(...e)=>t=>rw(e,t),{tv:ow}=tw(nw);const hl=ow({base:"cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var iw=z(""),sw=z("");function ye(e,t){D(t,!0);let r=w(t,"variant",3,"default"),n=w(t,"size",3,"default"),o=w(t,"ref",15,null),i=w(t,"href",3,void 0),s=w(t,"type",3,"button"),a=K(t,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var l=N(),c=A(l);{var d=h=>{var p=iw();wt(p,v=>({"data-slot":"button",class:v,href:t.disabled?void 0:i(),"aria-disabled":t.disabled,role:t.disabled?"link":void 0,tabindex:t.disabled?-1:void 0,...a}),[()=>Gt(hl({variant:r(),size:n()}),t.class)]);var g=et(p);B(g,()=>t.children??Q),Or(p,v=>o(v),()=>o()),y(h,p)},f=h=>{var p=sw();wt(p,v=>({"data-slot":"button",class:v,type:s(),disabled:t.disabled,...a}),[()=>Gt(hl({variant:r(),size:n()}),t.class)]);var g=et(p);B(g,()=>t.children??Q),Or(p,v=>o(v),()=>o()),y(h,p)};nt(c,h=>{i()?h(d):h(f,!1)})}y(e,l),F()}function aw(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>zm,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function lw(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}function cw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"sideOffset",3,4),o=K(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);lw(e,U(()=>t.portalProps,{children:(i,s)=>{var a=N(),l=A(a);{let c=P(()=>Gt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",t.class));H(l,()=>Wm,(d,f)=>{f(d,U({"data-slot":"dropdown-menu-content",get sideOffset(){return n()},get class(){return u(c)}},()=>o,{get ref(){return r()},set ref(h){r(h)}}))})}y(i,a)},$$slots:{default:!0}})),F()}function qe(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"variant",3,"default"),o=K(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var i=N(),s=A(i);{let a=P(()=>Gt("data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class));H(s,()=>Am,(l,c)=>{c(l,U({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)}}))})}y(e,i),F()}function ui(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("bg-border -mx-1 my-1 h-px",t.class));H(i,()=>Em,(a,l)=>{l(a,U({"data-slot":"dropdown-menu-separator",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var uw=z("");function Ze(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=uw();wt(o,s=>({"data-slot":"dropdown-menu-shortcut",class:s,...n}),[()=>Gt("text-muted-foreground ms-auto text-xs tracking-widest",t.class)]);var i=et(o);B(i,()=>t.children??Q),Or(o,s=>r(s),()=>r()),y(e,o),F()}function dw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=A(o);H(i,()=>Um,(s,a)=>{a(s,U({"data-slot":"dropdown-menu-trigger"},()=>n,{get ref(){return r()},set ref(l){r(l)}}))}),y(e,o),F()}function pl(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"data-slot",3,"separator"),o=K(t,["$$slots","$$events","$$legacy","ref","class","data-slot"]);var i=N(),s=A(i);{let a=P(()=>Gt("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-full data-[orientation=vertical]:w-px",t.class));H(s,()=>Sm,(l,c)=>{c(l,U({get"data-slot"(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)}}))})}y(e,i),F()}const gl=4e3;function fw(e){let t;function r(){if(document.querySelector('[data-slot="dropdown-menu-content"]')){n();return}e.classList.add("toolbar-faded")}function n(){e.classList.remove("toolbar-faded"),clearTimeout(t),t=setTimeout(r,gl)}t=setTimeout(r,gl);const o=e.parentElement;return o&&(o.addEventListener("mousemove",n),o.addEventListener("mouseleave",r)),{destroy(){clearTimeout(t),o&&(o.removeEventListener("mousemove",n),o.removeEventListener("mouseleave",r))}}}var hw=z("

Previous (←)

"),pw=z(" ",1),gw=z("

Newest (N)

"),vw=z(" ",1),mw=z("

Next (→)

"),bw=z(" ",1),yw=z("

Zoom out (-)

"),ww=z(" ",1),_w=z("

Reset zoom (0)

"),xw=z(" ",1),Sw=z("

Zoom in (+)

"),Pw=z(" ",1),Tw=z("

Delete (D)

"),Cw=z(" ",1),Aw=z(" Download SVG ",1),kw=z(" Download PNG ",1),Ew=z(" Copy PNG ",1),Ow=z(" Clear all ",1),Nw=z(" Export ",1),Mw=z(" History ",1),Iw=z(" Light mode",1),Dw=z(" Dark mode",1),Fw=z(" ",1),Rw=z(" Shortcuts ",1),Lw=z(" ",1),zw=z(" ",1),Vw=z('
');function Bw(e,t){D(t,!0);var r=Vw(),n=et(r);H(n,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=pw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.prevPage(),children:(S,L)=>{Dy(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=hw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var o=j(n,2);H(o,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=vw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"sm",class:"h-8 min-w-[3rem] px-2 text-xs font-bold",onclick:()=>rt.newestPage(),children:(S,L)=>{var V=Xt();zt(()=>ir(V,rt.pageLabel)),y(S,V)},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=gw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var i=j(o,2);H(i,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=bw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.nextPage(),children:(S,L)=>{Fy(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=mw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var s=j(i,2);pl(s,{orientation:"vertical",class:"mx-1 h-6"});var a=j(s,2);H(a,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=ww(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.zoomOut(),children:(S,L)=>{Ry(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=yw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var l=j(a,2);H(l,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=xw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"sm",class:"h-8 min-w-[3rem] px-2 text-xs font-bold",onclick:()=>rt.zoomReset(),children:(S,L)=>{var V=Xt();zt(()=>ir(V,rt.zoomLabel)),y(S,V)},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=_w();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var c=j(l,2);H(c,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=Pw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.zoomIn(),children:(S,L)=>{Ly(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=Sw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var d=j(c,2);pl(d,{orientation:"vertical",class:"mx-1 h-6"});var f=j(d,2);H(f,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=Cw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"hover:text-destructive h-8 w-8",get onclick(){return t.onremove},children:(S,L)=>{la(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=Tw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var h=j(f,2);H(h,()=>aw,(p,g)=>{g(p,{children:(v,m)=>{var b=zw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",children:(S,L)=>{Ky(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>dw,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>cw,(x,T)=>{T(x,{align:"end",class:"w-48",children:(k,R)=>{var S=Lw(),L=A(S);H(L,()=>qe,(M,$)=>{$(M,{get onclick(){return t.ondownloadsvg},children:(it,ft)=>{var pt=Aw(),tt=A(pt);Vy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("S");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var V=j(L,2);H(V,()=>qe,(M,$)=>{$(M,{get onclick(){return t.ondownloadpng},children:(it,ft)=>{var pt=kw(),tt=A(pt);By(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("P");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var ct=j(V,2);H(ct,()=>qe,(M,$)=>{$(M,{get onclick(){return t.oncopypng},children:(it,ft)=>{var pt=Ew(),tt=A(pt);Wy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("C");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var st=j(ct,2);H(st,()=>ui,(M,$)=>{$(M,{})});var _t=j(st,2);H(_t,()=>qe,(M,$)=>{$(M,{get onclick(){return t.onclear},class:"text-destructive",children:(it,ft)=>{var pt=Ow(),tt=A(pt);zy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("Alt+D");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var G=j(_t,2);H(G,()=>ui,(M,$)=>{$(M,{})});var Y=j(G,2);H(Y,()=>qe,(M,$)=>{$(M,{onclick:()=>vt.openExportDialog(),children:(it,ft)=>{var pt=Nw(),tt=A(pt);Hy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("E");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var W=j(Y,2);H(W,()=>qe,(M,$)=>{$(M,{onclick:()=>vt.toggleSidebar(),children:(it,ft)=>{var pt=Mw(),tt=A(pt);Uy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("H");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var Z=j(W,2);H(Z,()=>ui,(M,$)=>{$(M,{})});var X=j(Z,2);H(X,()=>qe,(M,$)=>{$(M,{get onclick(){return kc},children:(it,ft)=>{var pt=Fw(),tt=A(pt);{var at=lt=>{var Et=Iw(),Ct=A(Et);jy(Ct,{class:"mr-2 h-4 w-4"}),y(lt,Et)},Tt=lt=>{var Et=Dw(),Ct=A(Et);Gy(Ct,{class:"mr-2 h-4 w-4"}),y(lt,Et)};nt(tt,lt=>{os.current==="dark"?lt(at):lt(Tt,!1)})}var At=j(tt,2);H(At,()=>Ze,(lt,Et)=>{Et(lt,{children:(Ct,hr)=>{var xt=Xt("T");y(Ct,xt)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var ot=j(X,2);H(ot,()=>qe,(M,$)=>{$(M,{onclick:()=>vt.shortcutsDialogOpen=!0,children:(it,ft)=>{var pt=Rw(),tt=A(pt);Yy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("?");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})}),y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})}),vc(r,p=>fw?.(p)),y(e,r),F()}var Ww=z(" ",1);function vl(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"orientation",3,"vertical"),o=K(t,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var i=N(),s=A(i);{let a=P(()=>Gt("flex touch-none p-px transition-colors select-none",n()==="vertical"&&"h-full w-2.5 border-s border-s-transparent",n()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t.class));H(s,()=>cb,(l,c)=>{c(l,U({"data-slot":"scroll-area-scrollbar",get orientation(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)},children:(d,f)=>{var h=Ww(),p=A(h);B(p,()=>t.children??Q);var g=j(p,2);H(g,()=>fb,(v,m)=>{m(v,{"data-slot":"scroll-area-thumb",class:"bg-border relative flex-1 rounded-full"})}),y(d,h)},$$slots:{default:!0}}))})}y(e,i),F()}var Hw=z(" ",1);function Uw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"viewportRef",15,null),o=w(t,"orientation",3,"vertical"),i=w(t,"scrollbarXClasses",3,""),s=w(t,"scrollbarYClasses",3,""),a=K(t,["$$slots","$$events","$$legacy","ref","viewportRef","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var l=N(),c=A(l);{let d=P(()=>Gt("relative",t.class));H(c,()=>tb,(f,h)=>{h(f,U({"data-slot":"scroll-area",get class(){return u(d)}},()=>a,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=Hw(),m=A(v);H(m,()=>rb,(k,R)=>{R(k,{"data-slot":"scroll-area-viewport",class:"ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1",get ref(){return n()},set ref(S){n(S)},children:(S,L)=>{var V=N(),ct=A(V);B(ct,()=>t.children??Q),y(S,V)},$$slots:{default:!0}})});var b=j(m,2);{var O=k=>{vl(k,{orientation:"vertical",get class(){return s()}})};nt(b,k=>{(o()==="vertical"||o()==="both")&&k(O)})}var C=j(b,2);{var x=k=>{vl(k,{orientation:"horizontal",get class(){return i()}})};nt(C,k=>{(o()==="horizontal"||o()==="both")&&k(x)})}var T=j(C,2);H(T,()=>gb,(k,R)=>{R(k,{})}),y(p,v)},$$slots:{default:!0}}))})}y(e,l),F()}var Kw=z('
Plot thumbnail
');function jw(e,t){D(t,!0);const r=P(()=>_n(rt.host,{id:t.plotId},rt.token,rt.upid));var n=Kw(),o=et(n),i=et(o),s=j(o,2),a=et(s);la(a,{class:"h-4 w-4"}),zt(()=>{nr(n,1,`group relative w-full cursor-pointer overflow-hidden rounded-md border shadow-sm transition-all hover:shadow-md ${t.selected?"ring-primary ring-2":""}`),Wt(i,"src",u(r))}),Br("click",n,function(...l){t.onselect?.apply(this,l)}),Br("keydown",n,l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onselect())}),Br("click",s,l=>{l.stopPropagation(),t.onremove()}),y(e,n),F()}Lo(["click","keydown"]);var Gw=z("
"),Yw=z('

No plots yet

'),Xw=z('
'),qw=z("
");function Zw(e,t){D(t,!0);let r=I(void 0);gt(()=>{rt.page,u(r)&&requestAnimationFrame(()=>{const a=u(r)?.querySelector("[data-selected=true]");a&&a.scrollIntoView({behavior:"smooth",block:"center"})})});async function n(a){try{await Zu(rt.host,{id:a},rt.token)}catch{vt.showToast("Failed to remove plot","error")}}var o=qw();let i;var s=et(o);Uw(s,{class:"h-full",children:(a,l)=>{var c=Xw();Sn(c,21,()=>rt.plots,d=>d.id,(d,f)=>{const h=P(()=>u(f).id===rt.currentPlotId);var p=Gw(),g=et(p);jw(g,{get plotId(){return u(f).id},get selected(){return u(h)},onselect:()=>rt.setPage(u(f).id),onremove:()=>n(u(f).id)}),zt(()=>Wt(p,"data-selected",u(h))),y(d,p)},d=>{var f=Yw();y(d,f)}),Or(c,d=>_(r,d),()=>u(r)),y(a,c)},$$slots:{default:!0}}),zt(()=>i=nr(o,1,`bg-sidebar h-full w-[20%] min-w-[120px] border-l transition-all duration-300 ${vt.sidebarVisible?"translate-x-0":"translate-x-full"}`,null,i,{hidden:!vt.sidebarVisible})),y(e,o),F()}function $u(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>Mm,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function Jw(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}function td(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("text-lg leading-none font-semibold",t.class));H(i,()=>ng,(a,l)=>{l(a,U({"data-slot":"dialog-title",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var Qw=z("
");function ed(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Qw();wt(o,s=>({"data-slot":"dialog-header",class:s,...n}),[()=>Gt("flex flex-col gap-2 text-center sm:text-start",t.class)]);var i=et(o);B(i,()=>t.children??Q),Or(o,s=>r(s),()=>r()),y(e,o),F()}function $w(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));H(i,()=>ov,(a,l)=>{l(a,U({"data-slot":"dialog-overlay",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var t_=z(' Close',1),e_=z(" ",1),r_=z(" ",1);function rd(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"showCloseButton",3,!0),o=K(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Jw(e,U(()=>t.portalProps,{children:(i,s)=>{var a=r_(),l=A(a);H(l,()=>$w,(d,f)=>{f(d,{})});var c=j(l,2);{let d=P(()=>Gt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));H(c,()=>Lm,(f,h)=>{h(f,U({"data-slot":"dialog-content",get class(){return u(d)}},()=>o,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=e_(),m=A(v);B(m,()=>t.children??Q);var b=j(m,2);{var O=C=>{var x=N(),T=A(x);H(T,()=>Dm,(k,R)=>{R(k,{class:"ring-offset-background focus:ring-ring absolute end-4 top-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(S,L)=>{var V=t_(),ct=A(V);la(ct,{}),y(S,V)},$$slots:{default:!0}})}),y(C,x)};nt(b,C=>{n()&&C(O)})}y(p,v)},$$slots:{default:!0}}))})}y(i,a)},$$slots:{default:!0}})),F()}function n_(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("text-muted-foreground text-sm",t.class));H(i,()=>sv,(a,l)=>{l(a,U({"data-slot":"dialog-description",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}class o_{#t=I(!1);get connected(){return u(this.#t)}set connected(t){_(this.#t,t,!0)}#e=I(!0);get deviceActive(){return u(this.#e)}set deviceActive(t){_(this.#e,t,!0)}#r=I(void 0);get info(){return u(this.#r)}set info(t){_(this.#r,t,!0)}#n=I(It([]));get renderers(){return u(this.#n)}set renderers(t){_(this.#n,t,!0)}setConnected(t){this.connected=t}setDeviceActive(t){this.deviceActive=t}setInfo(t){this.info=t}setRenderers(t){this.renderers=t}}const wr=new o_;function nd(e){return new Promise((t,r)=>{const n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;const o=n.getContext("2d");if(!o){r(new Error("Failed to get canvas context"));return}o.drawImage(e,0,0),n.toBlob(i=>{i?t(i):r(new Error("Failed to create blob"))})})}function Bi(e,t,r){const n=document.createElement("a");n.href=e,t&&(n.download=t),r&&(n.target="_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function ca(e,t){const r=URL.createObjectURL(e);Bi(r,t),URL.revokeObjectURL(r)}async function i_(e,t){const n=await(await fetch(e)).blob();ca(n,t)}async function s_(e,t){ca(await nd(e),t)}async function a_(e,t="plot.png"){const r=nd(e);if(window.isSecureContext&&navigator.clipboard?.write&&window.ClipboardItem)try{const n=new ClipboardItem({"image/png":r});return await navigator.clipboard.write([n]),"copied"}catch{}try{return ca(await r,t),"downloaded"}catch{return"failed"}}var l_=z(" ",1),c_=z('Export preview'),u_=z('

No plot selected.

'),d_=z(""),f_=z('
Size: × ~ %
',1);function h_(e,t){D(t,!0);const r=1,n=1e4,o=1,i=1e4;let s=I("800"),a=I("600"),l=I("100"),c=I("svg");const d=P(()=>rt.currentPlotId!==null);function f(){const S=wr.renderers;return Array.isArray(S)?S.slice().sort((L,V)=>L.name.localeCompare(V.name)):[]}function h(S,L,V){if(!/^\d+$/.test(S))return!1;const ct=parseInt(S);return ct>=L&&ct<=V}const p=P(()=>h(u(s),r,n)),g=P(()=>h(u(a),r,n)),v=P(()=>h(u(l),o,i)),m=P(()=>u(p)&&u(g)&&u(v)&&u(d)),b=P(()=>{const S=rt.currentPlotId;return!S||!u(p)||!u(g)||!u(v)?null:_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01)},rt.token,rt.upid)});function O(){return wr.renderers.find(S=>S.id===u(c))}function C(){const S=rt.currentPlotId;if(!S||!u(m))return;const L=O();if(!L)return;const V=_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01),renderer:L.id,download:`plot_${S}${L.ext}`},rt.token,rt.upid);Bi(V)}function x(){const S=rt.currentPlotId;if(!S||!u(m))return;const L=O();if(!L)return;const V=_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01),renderer:L.id},rt.token,rt.upid);Bi(V,void 0,!0)}function T(S){vt.exportDialogOpen=S}var k=N(),R=A(k);H(R,()=>$u,(S,L)=>{L(S,{get open(){return vt.exportDialogOpen},onOpenChange:T,children:(V,ct)=>{var st=N(),_t=A(st);H(_t,()=>rd,(G,Y)=>{Y(G,{class:"flex max-h-[85vh] max-w-[85vw] flex-col",children:(W,Z)=>{var X=f_(),ot=A(X);H(ot,()=>ed,(xt,Nt)=>{Nt(xt,{children:(ke,Vr)=>{var en=l_(),ua=A(en);H(ua,()=>td,(rn,Kn)=>{Kn(rn,{children:(Qo,da)=>{var $o=Xt("Export Plot");y(Qo,$o)},$$slots:{default:!0}})});var od=j(ua,2);{var id=rn=>{var Kn=N(),Qo=A(Kn);H(Qo,()=>n_,(da,$o)=>{$o(da,{children:(sd,E_)=>{var ad=Xt("No plot selected.");y(sd,ad)},$$slots:{default:!0}})}),y(rn,Kn)};nt(od,rn=>{u(d)||rn(id)})}y(ke,en)},$$slots:{default:!0}})});var M=j(ot,2),$=et(M);{var it=xt=>{var Nt=c_();zt(()=>Wt(Nt,"src",u(b))),y(xt,Nt)},ft=xt=>{var Nt=u_();y(xt,Nt)};nt($,xt=>{u(d)&&u(b)?xt(it):xt(ft,!1)})}var pt=j(M,2),tt=et(pt),at=j(et(tt),2);Wt(at,"min",r),Wt(at,"max",n);var Tt=j(at,4);Wt(Tt,"min",r),Wt(Tt,"max",n);var At=j(Tt,4);Wt(At,"min",o),Wt(At,"max",i);var lt=j(tt,2),Et=et(lt);Sn(Et,21,f,xt=>xt.id,(xt,Nt)=>{var ke=d_(),Vr=et(ke),en={};zt(()=>{Wt(ke,"title",u(Nt).descr),ir(Vr,`${u(Nt).name??""} (*${u(Nt).ext??""})`),en!==(en=u(Nt).id)&&(ke.value=(ke.__value=u(Nt).id)??"")}),y(xt,ke)});var Ct=j(Et,2);{let xt=P(()=>!u(m));ye(Ct,{variant:"secondary",onclick:x,get disabled(){return u(xt)},children:(Nt,ke)=>{var Vr=Xt("Open");y(Nt,Vr)},$$slots:{default:!0}})}var hr=j(Ct,2);{let xt=P(()=>!u(m));ye(hr,{onclick:C,get disabled(){return u(xt)},children:(Nt,ke)=>{var Vr=Xt("Download");y(Nt,Vr)},$$slots:{default:!0}})}zt(()=>{at.disabled=!u(d),nr(at,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(p)?"":"border-destructive bg-destructive/10"}`),Tt.disabled=!u(d),nr(Tt,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(g)?"":"border-destructive bg-destructive/10"}`),At.disabled=!u(d),nr(At,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(v)?"":"border-destructive bg-destructive/10"}`),Et.disabled=!u(d)}),ri(at,()=>u(s),xt=>_(s,xt)),ri(Tt,()=>u(a),xt=>_(a,xt)),ri(At,()=>u(l),xt=>_(l,xt)),Gf(Et,()=>u(c),xt=>_(c,xt)),y(W,X)},$$slots:{default:!0}})}),y(V,st)},$$slots:{default:!0}})}),y(e,k),F()}var p_=z(''),g_=z('

');function v_(e,t){D(t,!1),ts();var r=N(),n=A(r);{var o=i=>{var s=g_(),a=et(s),l=et(a),c=j(a,2);{var d=f=>{var h=p_(),p=et(h);zt(()=>ir(p,vt.overlayAction.label)),Br("click",h,function(...g){vt.overlayAction.callback?.apply(this,g)}),y(f,h)};nt(c,f=>{vt.overlayAction&&f(d)})}zt(()=>ir(l,vt.overlayText)),y(i,s)};nt(n,i=>{vt.overlayText&&i(o)})}y(e,r),F()}Lo(["click"]);var di=Jf(()=>vt),m_=z('/'),b_=z(' ',1),y_=z(' ',1),w_=z('
',1);function __(e,t){D(t,!1);const r=[{keys:["←","↓"],action:"Previous plot"},{keys:["→","↑"],action:"Next plot"},{keys:["N"],action:"Newest plot"},{keys:["+","="],action:"Zoom in"},{keys:["-"],action:"Zoom out"},{keys:["0"],action:"Reset zoom"},{keys:["D"],action:"Delete plot"},{keys:["Alt+D"],action:"Clear all plots"},{keys:["S"],action:"Download SVG"},{keys:["P"],action:"Download PNG"},{keys:["C"],action:"Copy PNG"},{keys:["E"],action:"Export dialog"},{keys:["H"],action:"Toggle history"},{keys:["T"],action:"Toggle theme"},{keys:["?"],action:"Show shortcuts"}];function n(o){di(di().shortcutsDialogOpen=o)}ts(),$u(e,{get open(){return di().shortcutsDialogOpen},onOpenChange:n,children:(o,i)=>{rd(o,{class:"flex max-h-[85vh] max-w-sm flex-col",children:(s,a)=>{var l=w_(),c=A(l);ed(c,{children:(f,h)=>{td(f,{children:(p,g)=>{var v=Xt("Keyboard shortcuts");y(p,v)},$$slots:{default:!0}})},$$slots:{default:!0}});var d=j(c,2);Sn(d,5,()=>r,f=>f.action,(f,h)=>{var p=y_(),g=A(p),v=et(g),m=j(g,2);Sn(m,7,()=>u(h).keys,b=>b,(b,O,C)=>{var x=b_(),T=A(x);{var k=L=>{var V=m_();y(L,V)};nt(T,L=>{u(C)>0&&L(k)})}var R=j(T,2),S=et(R);zt(()=>ir(S,u(O))),y(b,x)}),zt(()=>ir(v,u(h).action)),y(f,p)}),y(s,l)},$$slots:{default:!0}})},$$slots:{default:!0}}),F()}class x_{ws=null;host;onMessage;onStatus;reconnectTimer=null;closed=!1;constructor(t,r,n){this.host=t,this.onMessage=r,this.onStatus=n}connect(){this.closed=!1,this.clearReconnect();try{this.ws=new WebSocket(xy(this.host))}catch{this.onStatus(!1),this.scheduleReconnect();return}this.ws.onopen=()=>{this.onStatus(!0)},this.ws.onmessage=t=>{try{const r=JSON.parse(t.data);this.onMessage(r)}catch{}},this.ws.onclose=()=>{this.onStatus(!1),this.closed||this.scheduleReconnect()},this.ws.onerror=()=>{this.ws?.close()}}disconnect(){this.closed=!0,this.clearReconnect(),this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null)}scheduleReconnect(){this.closed||(this.clearReconnect(),this.reconnectTimer=setTimeout(()=>this.connect(),2e3))}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const S_=500;class P_{host;token;allowWebsockets;callbacks;mode=0;lastState;pollTimer=null;wsManager=null;info;renderers=[];plots;constructor(t,r,n,o){this.host=t,this.token=r,this.allowWebsockets=n,this.callbacks=o}async connect(){try{this.info=await Cy(this.host,this.token),await this.updateRenderers(),await this.updatePlots()}catch{}this.allowWebsockets?this.startWebSocket():this.startPolling()}disconnect(){this.stopPolling(),this.wsManager?.disconnect(),this.wsManager=null,this.mode=0}async updateRenderers(){try{this.renderers=await Ty(this.host,this.token),this.callbacks.onRenderersChanged(this.renderers)}catch{}}async updatePlots(){try{const t=await Py(this.host,this.token);this.plots=t,this.callbacks.onPlotsChanged(t)}catch{}}getUpid(){return this.plots?.state.upid.toString()??"0"}async reconnect(){this.disconnect(),await this.connect()}startWebSocket(){this.stopPolling(),this.mode=2,this.wsManager=new x_(this.host,t=>this.handleRemoteState(t),t=>{t?(this.callbacks.onConnectionChanged(!0),this.updateRenderers(),this.updatePlots()):(this.callbacks.onConnectionChanged(!1),this.wsManager?.disconnect(),this.wsManager=null,this.stopPolling(),this.mode=0)}),this.wsManager.connect()}startPolling(){this.stopPolling(),this.mode=1,this.pollTimer=setInterval(()=>this.poll(),S_)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}async poll(){try{const t=await Sy(this.host,this.token);this.handleRemoteState(t)}catch{this.mode===1&&(this.callbacks.onConnectionChanged(!1),this.stopPolling(),this.mode=0)}}handleRemoteState(t){const r=this.lastState;this.lastState=t,(!r||r.active!==t.active)&&this.callbacks.onDeviceActiveChanged(t.active),(!r||r.upid!==t.upid||r.hsize!==t.hsize)&&this.updatePlots()}}function T_(e,t){function r(n){const o=n.target;if(!(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT")&&!document.querySelector("[data-dialog-overlay]"))for(const i of t){const s=n.key===i.key,a=i.altKey?n.altKey:!n.altKey;if(s&&a){n.preventDefault(),i.action();return}}}return window.addEventListener("keydown",r),{destroy(){window.removeEventListener("keydown",r)},update(n){t=n}}}var C_=z('
',1),A_=z(" ",1);function k_(e,t){D(t,!0);let r=I(null),n,o;es(()=>{const v=_y();return rt.configure(v.host,v.token),v.sidebarHidden&&(vt.sidebarVisible=!1),n=new P_(v.host,v.token,v.allowWebsockets,{onPlotsChanged(m){rt.updatePlots(m)},onConnectionChanged(m){wr.setConnected(m),m?vt.hideOverlay():vt.showOverlay("Connection lost.",{label:"Reconnect",callback:()=>i()})},onDeviceActiveChanged(m){wr.setDeviceActive(m),o&&clearTimeout(o),m?vt.hideOverlay():o=setTimeout(()=>{vt.showOverlay("Device inactive.")},1e3)},onRenderersChanged(m){wr.setRenderers(m)}}),n.connect().then(()=>{n.info&&(wr.setInfo(n.info),console.log("Connected to "+n.info.version))}),()=>{n.disconnect(),o&&clearTimeout(o)}});async function i(){vt.showOverlay("Reconnecting…"),await n.reconnect(),n.info&&wr.setInfo(n.info)}async function s(){if(u(r)?.src)try{await i_(u(r).src,"plot.svg")}catch{vt.showToast("Failed to download SVG","error")}}async function a(){if(u(r))try{await s_(u(r),"plot.png")}catch{vt.showToast("Failed to download PNG","error")}}async function l(){if(!u(r))return;const v=await a_(u(r));v==="copied"?vt.showToast("PNG copied to clipboard"):v==="downloaded"?vt.showToast("Clipboard unavailable — PNG downloaded instead"):vt.showToast("Failed to copy PNG","error")}async function c(){const v=rt.currentPlotId;if(v)try{await Zu(rt.host,{id:v},rt.token)}catch{vt.showToast("Failed to remove plot","error")}}async function d(){try{await Ay(rt.host,rt.token)}catch{vt.showToast("Failed to clear plots","error")}}var f=A_(),h=A(f);sp(h,{});var p=j(h,2);ih(p,{});var g=j(p,2);H(g,()=>vy,(v,m)=>{m(v,{children:(b,O)=>{var C=C_(),x=A(C),T=et(x),k=et(T);Bw(k,{ondownloadsvg:s,ondownloadpng:a,oncopypng:l,onremove:c,onclear:d});var R=j(k,2);Iy(R,{get imageRef(){return u(r)},set imageRef(st){_(r,st,!0)}});var S=j(T,2);Zw(S,{}),vc(x,(st,_t)=>T_?.(st,_t),()=>[{key:"ArrowLeft",action:()=>rt.prevPage()},{key:"ArrowDown",action:()=>rt.prevPage()},{key:"ArrowRight",action:()=>rt.nextPage()},{key:"ArrowUp",action:()=>rt.nextPage()},{key:"n",action:()=>rt.newestPage()},{key:"+",action:()=>rt.zoomIn()},{key:"=",action:()=>rt.zoomIn()},{key:"-",action:()=>rt.zoomOut()},{key:"0",action:()=>rt.zoomReset()},{key:"d",altKey:!0,action:d},{key:"d",action:c},{key:"Delete",action:c},{key:"s",action:s},{key:"p",action:a},{key:"c",action:l},{key:"h",action:()=>vt.toggleSidebar()},{key:"e",action:()=>vt.openExportDialog()},{key:"t",action:kc},{key:"?",action:()=>vt.shortcutsDialogOpen=!0}]);var L=j(x,2);h_(L,{});var V=j(L,2);__(V,{});var ct=j(V,2);v_(ct,{}),y(b,C)},$$slots:{default:!0}})}),y(e,f),F()}gc(k_,{target:document.getElementById("app")}); +`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const Ic=typeof window<"u"?window:void 0;function Pp(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class Tp{#t;#e;constructor(t={}){const{window:r=Ic,document:n=r?.document}=t;r!==void 0&&(this.#t=n,this.#e=Dr(o=>{const i=dt(r,"focusin",o),s=dt(r,"focusout",o);return()=>{i(),s()}}))}get current(){return this.#e?.(),this.#t?Pp(this.#t):null}}new Tp;function Dc(e){return typeof e=="function"}function Cp(e,t){if(Dc(e)){const n=e();return n===void 0?t:n}return e===void 0?t:e}class Zt{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Ud(this.#e)}get(){const t=pa(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const r=pa(this.#e);return r===void 0?t:r}set(t){return Hd(this.#e,t)}}function Vo(e,t){let r=M(null);const n=P(()=>Cp(t,250));function o(...i){if(u(r))u(r).timeout&&clearTimeout(u(r).timeout);else{let s,a;const l=new Promise((c,d)=>{s=c,a=d});_(r,{timeout:null,runner:null,promise:l,resolve:s,reject:a},!0)}return u(r).runner=async()=>{if(!u(r))return;const s=u(r);_(r,null);try{s.resolve(await e.apply(this,i))}catch(a){s.reject(a)}},u(r).timeout=setTimeout(u(r).runner,u(n)),u(r).promise}return o.cancel=async()=>{(!u(r)||u(r).timeout===null)&&(await new Promise(i=>setTimeout(i,0)),!u(r)||u(r).timeout===null)||(clearTimeout(u(r).timeout),u(r).reject("Cancelled"),_(r,null))},o.runScheduledNow=async()=>{(!u(r)||!u(r).timeout)&&(await new Promise(i=>setTimeout(i,0)),!u(r)||!u(r).timeout)||(clearTimeout(u(r).timeout),u(r).timeout=null,await u(r).runner?.())},Object.defineProperty(o,"pending",{enumerable:!0,get(){return!!u(r)?.timeout}}),o}function Ap(e,t){switch(e){case"post":gt(t);break;case"pre":re(t);break}}function Fc(e,t,r,n={}){const{lazy:o=!1}=n;let i=!o,s=Array.isArray(e)?[]:void 0;Ap(t,()=>{const a=Array.isArray(e)?e.map(c=>c()):e();if(!i){i=!0,s=a;return}const l=Bt(()=>r(a,s));return s=a,l})}function Pt(e,t,r){Fc(e,"post",t,r)}function kp(e,t,r){Fc(e,"pre",t,r)}Pt.pre=kp;function La(e){return Dc(e)?e():e}class Ep{#t={width:0,height:0};#e=!1;#r;#n;#o;#i=P(()=>(u(this.#s)?.(),this.getSize().width));#a=P(()=>(u(this.#s)?.(),this.getSize().height));#s=P(()=>{const t=La(this.#n);if(t)return Dr(r=>{if(!this.#o)return;const n=new this.#o.ResizeObserver(o=>{this.#e=!0;for(const i of o){const s=this.#r.box==="content-box"?i.contentBoxSize:i.borderBoxSize,a=Array.isArray(s)?s:[s];this.#t.width=a.reduce((l,c)=>Math.max(l,c.inlineSize),0),this.#t.height=a.reduce((l,c)=>Math.max(l,c.blockSize),0)}r()});return n.observe(t),()=>{this.#e=!1,n.disconnect()}})});constructor(t,r={box:"border-box"}){this.#o=r.window??Ic,this.#r=r,this.#n=t,this.#t={width:0,height:0}}calculateSize(){const t=La(this.#n);if(!t||!this.#o)return;const r=t.offsetWidth,n=t.offsetHeight;if(this.#r.box==="border-box")return{width:r,height:n};const o=this.#o.getComputedStyle(t),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),a=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),l=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),c=r-i-a,d=n-s-l;return{width:c,height:d}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return u(this.#s)?.(),this.getSize()}get width(){return u(this.#i)}get height(){return u(this.#a)}}class ss{#t=M(!1);constructor(){gt(()=>(Bt(()=>_(this.#t,!0)),()=>{_(this.#t,!1)}))}get current(){return u(this.#t)}}class Op{#t=()=>{};#e=P(()=>this.#t());constructor(t,r){let n;r!==void 0&&(n=r),this.#t=()=>{try{return n}finally{n=t()}}}get current(){return u(this.#e)}}function Rr(e){gt(()=>()=>{e()})}function as(e){gt(()=>Bt(()=>e()))}function Np(e,t){return setTimeout(t,e)}function Ie(e){lc().then(e)}const Mp=1,Ip=9,Dp=11;function Ei(e){return Rn(e)&&e.nodeType===Mp&&typeof e.nodeName=="string"}function Rc(e){return Rn(e)&&e.nodeType===Ip}function Fp(e){return Rn(e)&&e.constructor?.name==="VisualViewport"}function Rp(e){return Rn(e)&&e.nodeType!==void 0}function Lc(e){return Rp(e)&&e.nodeType===Dp&&"host"in e}function Lp(e,t){if(!e||!t||!Ei(e)||!Ei(t))return!1;const r=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(r&&Lc(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Jr(e){return Rc(e)?e:Fp(e)?e.document:e?.ownerDocument??document}function Bo(e){return Lc(e)?Bo(e.host):Rc(e)?e.defaultView??window:Ei(e)?e.ownerDocument?.defaultView??window:window}function zp(e){let t=e.activeElement;for(;t?.shadowRoot;){const r=t.shadowRoot.activeElement;if(r===t)break;t=r}return t}class zn{element;#t=P(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return u(this.#t)}set root(t){_(this.#t,t)}constructor(t){typeof t=="function"?this.element=E(t):this.element=t}getDocument=()=>Jr(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>zp(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,r)=>this.getWindow().setTimeout(t,r);clearTimeout=t=>this.getWindow().clearTimeout(t)}function Ot(e,t){return{[yf()]:r=>Ln(e)?(e.current=r,Bt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||(e.current=null,t?.(null))}):(e(r),Bt(()=>t?.(r)),()=>{"isConnected"in r&&r.isConnected||(e(null),t?.(null))})}}function zc(e){return e?"true":"false"}function Vp(e){return e?"true":void 0}function sr(e){return e?"":void 0}function ls(e){return e?"open":"closed"}class Bp{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(r=>[r,this.getAttr(r)]))}getAttr(t,r){return r?`data-${r}-${t}`:`${this.#e}${t}`}selector(t,r){return`[${this.getAttr(t,r)}]`}}function Vn(e){const t=new Bp(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Tn="ArrowDown",cs="ArrowLeft",us="ArrowRight",uo="ArrowUp",Vc="End",ds="Enter",Wp="Escape",Bc="Home",Hp="PageDown",Up="PageUp",Wo=" ",Kp="Tab";function jp(e){return window.getComputedStyle(e).getPropertyValue("direction")}function Gp(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?cs:us,vertical:Tn}[t]}function Yp(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?us:cs,vertical:uo}[t]}function Xp(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Gp(e,t),prevKey:Yp(e,t)}}const Wc=typeof document<"u",za=qp();function qp(){return Wc&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function He(e){return e instanceof HTMLElement}function De(e){return e instanceof Element}function Hc(e){return e instanceof Element||e instanceof SVGElement}function Zp(e){return e.matches(":focus-visible")}function Jp(e){return e!==null}function Qp(e){return e instanceof HTMLInputElement&&"select"in e}class $p{#t;#e=Fr(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,r,n=!1){const o=this.#t.rootNode.current;if(!o||!t)return;const i=this.getCandidateNodes();if(!i.length)return;const s=i.indexOf(t),a=jp(o),{nextKey:l,prevKey:c}=Xp(a,this.#t.orientation.current),d=this.#t.loop.current,f={[l]:s+1,[c]:s-1,[Bc]:0,[Vc]:i.length-1};if(n){const g=l===Tn?us:Tn,v=c===uo?cs:uo;f[g]=s+1,f[v]=s-1}let h=f[r.key];if(h===void 0)return;r.preventDefault(),h<0&&d?h=i.length-1:h===i.length&&d&&(h=0);const p=i[h];if(p)return p.focus(),this.#e.current=p.id,this.#t.onCandidateFocus?.(p),p}getTabIndex(t){const r=this.getCandidateNodes(),n=this.#e.current!==null;return t&&!n&&r[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const r=this.#t.rootNode.current?.querySelector(`#${t}`);!r||!He(r)||r.focus()}}class tg{#t;#e=null;constructor(t){this.#t=t,Rr(()=>this.#r())}#r(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#r();const r=this.#t.ref.current;if(r){if(typeof r.getAnimations!="function"){this.#n(t);return}this.#e=window.requestAnimationFrame(()=>{const n=r.getAnimations();if(n.length===0){this.#n(t);return}Promise.allSettled(n.map(o=>o.finished)).then(()=>{this.#n(t)})})}}#n(t){const r=()=>{t()};this.#t.afterTick?Ie(r):r()}}class fo{#t;#e;#r;#n=M(!1);constructor(t){this.#t=t,_(this.#n,t.open.current,!0),this.#e=t.enabled??!0,this.#r=new tg({ref:this.#t.ref,afterTick:this.#t.open}),Pt(()=>this.#t.open.current,r=>{r&&_(this.#n,!0),this.#e&&this.#r.run(()=>{r===this.#t.open.current&&(this.#t.open.current||_(this.#n,!1),this.#t.onComplete?.())})})}get shouldRender(){return u(this.#n)}}function St(){}function jt(e,t){return`bits-${e}`}const eg=Vn({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Nr=new Zt("Dialog.Root | AlertDialog.Root");class fs{static create(t){const r=Nr.getOr(null);return Nr.set(new fs(t,r))}opts;#t=M(null);get triggerNode(){return u(this.#t)}set triggerNode(t){_(this.#t,t,!0)}#e=M(null);get contentNode(){return u(this.#e)}set contentNode(t){_(this.#e,t,!0)}#r=M(null);get overlayNode(){return u(this.#r)}set overlayNode(t){_(this.#r,t,!0)}#n=M(null);get descriptionNode(){return u(this.#n)}set descriptionNode(t){_(this.#n,t,!0)}#o=M(void 0);get contentId(){return u(this.#o)}set contentId(t){_(this.#o,t,!0)}#i=M(void 0);get titleId(){return u(this.#i)}set titleId(t){_(this.#i,t,!0)}#a=M(void 0);get triggerId(){return u(this.#a)}set triggerId(t){_(this.#a,t,!0)}#s=M(void 0);get descriptionId(){return u(this.#s)}set descriptionId(t){_(this.#s,t,!0)}#l=M(null);get cancelNode(){return u(this.#l)}set cancelNode(t){_(this.#l,t,!0)}#c=M(0);get nestedOpenCount(){return u(this.#c)}set nestedOpenCount(t){_(this.#c,t,!0)}depth;parent;contentPresence;overlayPresence;constructor(t,r){this.opts=t,this.parent=r,this.depth=r?r.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new fo({ref:E(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new fo({ref:E(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Pt(()=>this.opts.open.current,n=>{this.parent&&(n?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Rr(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=t=>eg.getAttr(t,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=P(()=>({"data-state":ls(this.opts.open.current)}));get sharedProps(){return u(this.#u)}set sharedProps(t){_(this.#u,t)}}class hs{static create(t){return new hs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Wo||t.key===ds)&&(t.preventDefault(),this.root.handleClose())}#t=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class ps{static create(t){return new ps(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.root.titleId=this.opts.id.current,this.attachment=Ot(this.opts.ref),Pt.pre(()=>this.opts.id.current,n=>{this.root.titleId=n})}#t=P(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class gs{static create(t){return new gs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.root.descriptionId=this.opts.id.current,this.attachment=Ot(this.opts.ref,n=>{this.root.descriptionNode=n}),Pt.pre(()=>this.opts.id.current,n=>{this.root.descriptionId=n})}#t=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class vs{static create(t){return new vs(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>{this.root.contentNode=n,this.root.contentId=n?.id})}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":sr(this.root.nestedOpenCount>0),"data-nested":sr(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}get shouldRender(){return this.root.contentPresence.shouldRender}}class ms{static create(t){return new ms(t,Nr.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>this.root.overlayNode=n)}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":sr(this.root.nestedOpenCount>0),"data-nested":sr(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}get shouldRender(){return this.root.overlayPresence.shouldRender}}var rg=z("
");function ng(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"level",3,2),s=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const a=ps.create({id:E(()=>n()),level:E(()=>i()),ref:E(()=>o(),p=>o(p))}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=p=>{var g=N(),v=A(g);B(v,()=>t.child,()=>({props:u(l)})),y(p,g)},h=p=>{var g=rg();wt(g,()=>({...u(l)}));var v=et(g);B(v,()=>t.children??Q),y(p,g)};nt(d,p=>{t.child?p(f):p(h,!1)})}y(e,c),F()}function og(e,t){var r=N(),n=A(r);If(n,()=>t.children,o=>{var i=N(),s=A(i);B(s,()=>t.children??Q),y(o,i)}),y(e,r)}const ig=new Zt("BitsConfig");function sg(){const e=new ag(null,{});return ig.getOr(e).opts}class ag{opts;constructor(t,r){const n=lg(t,r);this.opts={defaultPortalTo:n(o=>o.defaultPortalTo),defaultLocale:n(o=>o.defaultLocale)}}}function lg(e,t){return r=>E(()=>{const o=r(t)?.current;if(o!==void 0)return o;if(e!==null)return r(e.opts)?.current})}function cg(e,t){return r=>{const n=sg();return E(()=>{const o=r();if(o!==void 0)return o;const i=e(n).current;return i!==void 0?i:t})}}const ug=cg(e=>e.defaultPortalTo,"body");function bs(e,t){D(t,!0);const r=ug(()=>t.to),n=Kd();let o=P(i);function i(){if(!Wc||t.disabled)return null;let f=null;return typeof r.current=="string"?f=document.querySelector(r.current):f=r.current,f}let s;function a(){s&&(Nf(s),s=null)}Pt([()=>u(o),()=>t.disabled],([f,h])=>{if(!f||h){a();return}return s=gc(og,{target:f,props:{children:t.children},context:n}),()=>{a()}});var l=N(),c=A(l);{var d=f=>{var h=N(),p=A(h);B(p,()=>t.children??Q),y(f,h)};nt(c,f=>{t.disabled&&f(d)})}y(e,l),F()}class dg{eventName;options;constructor(t,r={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=r}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,r){const n=this.createEvent(r);return t.dispatchEvent(n),n}listen(t,r,n){const o=i=>{r(i)};return dt(t,this.eventName,o,n)}}function Va(e,t=500){let r=null;const n=(...o)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.destroy=()=>{r!==null&&(clearTimeout(r),r=null)},n}function Uc(e,t){return e===t||e.contains(t)}function Kc(e){return e?.ownerDocument??document}function fg(e,t){const{clientX:r,clientY:n}=e,o=t.getBoundingClientRect();return ro.right||no.bottom}const hg=[ds,Wo],pg=[Tn,Up,Bc],jc=[uo,Hp,Vc],gg=[...pg,...jc];function Ba(e){return e.pointerType==="mouse"}function vg(e,{select:t=!1}={}){if(!e||!e.focus)return;const r=Jr(e);if(r.activeElement===e)return;const n=r.activeElement;e.focus({preventScroll:!0}),e!==n&&Qp(e)&&t&&e.select()}function mg(e,{select:t=!1}={},r){const n=r();for(const o of e)if(vg(o,{select:t}),r()!==n)return!0}let cn=M(!1);class Je{static _refs=0;static _cleanup;constructor(){gt(()=>(Je._refs===0&&(Je._cleanup=Nn(()=>{const t=[],r=o=>{_(cn,!1)},n=o=>{_(cn,!0)};return t.push(dt(document,"pointerdown",r,{capture:!0}),dt(document,"pointermove",r,{capture:!0}),dt(document,"keydown",n,{capture:!0})),Ve(...t)})),Je._refs++,()=>{Je._refs--,Je._refs===0&&(_(cn,!1),Je._cleanup?.())}))}get current(){return u(cn)}set current(t){_(cn,t,!0)}}var Gc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ho=Gc.join(","),Yc=typeof Element>"u",Mr=Yc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,po=!Yc&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},go=function(t,r){var n;r===void 0&&(r=!0);var o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"inert"),i=o===""||o==="true",s=i||r&&t&&(typeof t.closest=="function"?t.closest("[inert]"):go(t.parentNode));return s},bg=function(t){var r,n=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return n===""||n==="true"},Xc=function(t,r,n){if(go(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ho));return r&&Mr.call(t,ho)&&o.unshift(t),o=o.filter(n),o},vo=function(t,r,n){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!go(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=vo(l,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Mr.call(s,ho);d&&n.filter(s)&&(r||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(s),h=!go(f,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(f&&h){var p=vo(f===!0?s.children:f.children,!0,n);n.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},qc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Zc=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||bg(t))&&!qc(t)?0:t.tabIndex},yg=function(t,r){var n=Zc(t);return n<0&&r&&!qc(t)?0:n},wg=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},Jc=function(t){return t.tagName==="INPUT"},_g=function(t){return Jc(t)&&t.type==="hidden"},xg=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(n){return n.tagName==="SUMMARY"});return r},Sg=function(t,r){for(var n=0;nsummary:first-of-type"),a=s?t.parentElement:t;if(Mr.call(a,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,d=po(t);if(c&&!c.shadowRoot&&o(c)===!0)return Wa(t);t.assignedSlot?t=t.assignedSlot:!c&&d!==t.ownerDocument?t=d.host:t=c}t=l}if(Ag(t))return!t.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Wa(t);return!1},Eg=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var n=0;n=0)},Qc=function(t){var r=[],n=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=yg(a,s),c=s?Qc(o.candidates):a;l===0?s?r.push.apply(r,c):r.push(a):n.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),n.sort(wg).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(r)},$c=function(t,r){r=r||{};var n;return r.getShadowRoot?n=vo([t],r.includeContainer,{filter:Oi.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:Og}):n=Xc(t,r.includeContainer,Oi.bind(null,r)),Qc(n)},tu=function(t,r){r=r||{};var n;return r.getShadowRoot?n=vo([t],r.includeContainer,{filter:mo.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):n=Xc(t,r.includeContainer,mo.bind(null,r)),n},ys=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Mr.call(t,ho)===!1?!1:Oi(r,t)},Ng=Gc.concat("iframe:not([inert]):not([inert] *)").join(","),eu=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Mr.call(t,Ng)===!1?!1:mo(r,t)};function wn(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Mg(e,t){if(!ys(e,wn()))return Ig(e,t);const r=Jr(e),n=$c(r.body,wn());t==="prev"&&n.reverse();const o=n.indexOf(e);return o===-1?r.body:n.slice(o+1)[0]}function Ig(e,t){const r=Jr(e);if(!eu(e,wn()))return r.body;const n=tu(r.body,wn());t==="prev"&&n.reverse();const o=n.indexOf(e);return o===-1?r.body:n.slice(o+1).find(s=>ys(s,wn()))??r.body}function ru(e,t,r){const n=t.toLowerCase();if(n.endsWith(" ")){const f=n.slice(0,-1);if(e.filter(v=>v.toLowerCase().startsWith(f)).length<=1)return ru(e,f,r);const p=r?.toLowerCase();if(p&&p.startsWith(f)&&p.charAt(f.length)===" "&&t.trim()===f)return r;const g=e.filter(v=>v.toLowerCase().startsWith(n));if(g.length>0){const v=r?e.indexOf(r):-1;return Ha(g,Math.max(v,0)).find(O=>O!==r)||r}}const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=i.toLowerCase(),a=r?e.indexOf(r):-1;let l=Ha(e,Math.max(a,0));i.length===1&&(l=l.filter(f=>f!==r));const d=l.find(f=>f?.toLowerCase().startsWith(s));return d!==r?d:void 0}function Ha(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const Dg={afterMs:1e4,onChange:St};function nu(e,t){const{afterMs:r,onChange:n,getWindow:o}={...Dg,...t};let i=null,s=M(It(e));function a(){return o().setTimeout(()=>{_(s,e,!0),n?.(e)},r)}return gt(()=>()=>{i&&o().clearTimeout(i)}),E(()=>u(s),l=>{_(s,l,!0),n?.(l),i&&o().clearTimeout(i),i=a()})}class Fg{#t;#e;#r=P(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#n=P(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=nu("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,r){if(!r.length)return;this.#e.current=this.#e.current+t;const n=u(this.#n)(),o=r.find(l=>l===n)?.textContent?.trim()??"",i=r.map(l=>l.textContent?.trim()??""),s=ru(i,this.#e.current,o),a=r.find(l=>l.textContent?.trim()===s);return a&&u(this.#r)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Rg{#t;#e;#r;#n=M(null);constructor(t){this.#t=t,this.#e=P(()=>this.#t.enabled()),this.#r=nu(!1,{afterMs:t.transitTimeout??300,onChange:r=>{u(this.#e)&&this.#t.setIsPointerInTransit?.(r)},getWindow:()=>Bo(this.#t.triggerNode())}),Pt([t.triggerNode,t.contentNode,t.enabled],([r,n,o])=>{if(!r||!n||!o)return;const i=a=>{this.#i(a,n)},s=a=>{this.#i(a,r)};return Ve(dt(r,"pointerleave",i),dt(n,"pointerleave",s))}),Pt(()=>u(this.#n),()=>{const r=o=>{if(!u(this.#n))return;const i=o.target;if(!De(i))return;const s={x:o.clientX,y:o.clientY},a=t.triggerNode()?.contains(i)||t.contentNode()?.contains(i),l=!Bg(s,u(this.#n));a?this.#o():l&&(this.#o(),t.onPointerExit())},n=Jr(t.triggerNode()??t.contentNode());if(n)return dt(n,"pointermove",r)})}#o(){_(this.#n,null),this.#r.current=!1}#i(t,r){const n=t.currentTarget;if(!He(n))return;const o={x:t.clientX,y:t.clientY},i=Lg(o,n.getBoundingClientRect()),s=zg(o,i),a=Vg(r.getBoundingClientRect()),l=Wg([...s,...a]);_(this.#n,l,!0),this.#r.current=!0}}function Lg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function zg(e,t,r=5){const n=r*1.5;switch(t){case"top":return[{x:e.x-r,y:e.y+r},{x:e.x,y:e.y-n},{x:e.x+r,y:e.y+r}];case"bottom":return[{x:e.x-r,y:e.y-r},{x:e.x,y:e.y+n},{x:e.x+r,y:e.y-r}];case"left":return[{x:e.x+r,y:e.y-r},{x:e.x-n,y:e.y},{x:e.x+r,y:e.y+r}];case"right":return[{x:e.x-r,y:e.y-r},{x:e.x+n,y:e.y},{x:e.x-r,y:e.y+r}]}}function Vg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Bg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;in!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(o=!o)}return o}function Wg(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),Hg(t)}function Hg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}const Ug="data-context-menu-trigger",Kg="data-context-menu-content",ou=new Zt("Menu.Root"),ws=new Zt("Menu.Root | Menu.Sub"),iu=new Zt("Menu.Content"),jg=new dg("bitsmenuopen",{bubbles:!1,cancelable:!0}),Gg=Vn({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class _s{static create(t){const r=new _s(t);return ou.set(r)}opts;isUsingKeyboard=new Je;#t=M(!1);get ignoreCloseAutoFocus(){return u(this.#t)}set ignoreCloseAutoFocus(t){_(this.#t,t,!0)}#e=M(!1);get isPointerInTransit(){return u(this.#e)}set isPointerInTransit(t){_(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Gg.getAttr(t,this.opts.variant.current)}class xs{static create(t,r){return ws.set(new xs(t,r,null))}opts;root;parentMenu;contentId=E(()=>"");#t=M(null);get contentNode(){return u(this.#t)}set contentNode(t){_(this.#t,t,!0)}contentPresence;#e=M(null);get triggerNode(){return u(this.#e)}set triggerNode(t){_(this.#e,t,!0)}constructor(t,r,n){this.opts=t,this.root=r,this.parentMenu=n,this.contentPresence=new fo({ref:E(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),n&&Pt(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Ss{static create(t){return iu.set(new Ss(t,ws.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=M("");get search(){return u(this.#t)}set search(t){_(this.#t,t,!0)}#e=0;#r;#n=M(!1);get mounted(){return u(this.#n)}set mounted(t){_(this.#n,t,!0)}#o;constructor(t,r){this.opts=t,this.parentMenu=r,this.domContext=new zn(t.ref),this.attachment=Ot(this.opts.ref,n=>{this.parentMenu.contentNode!==n&&(this.parentMenu.contentNode=n)}),r.contentId=t.id,this.#o=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Rg({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:n=>{this.parentMenu.root.isPointerInTransit=n}}),this.#r=new Fg({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new $p({rootNode:E(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:E(()=>"vertical")}),Pt(()=>this.parentMenu.contentNode,n=>{if(!n)return;const o=()=>{Ie(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return jg.listen(n,o)}),gt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#i(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#o)&&this.parentMenu.triggerNode&&ys(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let r=this.parentMenu;for(;r.parentMenu!==null;)r=r.parentMenu;if(!r.triggerNode)return;t.preventDefault();const n=Mg(r.triggerNode,t.shiftKey?"prev":"next");n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,r.onClose(),Ie(()=>{n.focus(),Ie(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===Kp){this.handleTabKeyDown(t);return}const r=t.target,n=t.currentTarget;if(!He(r)||!He(n))return;const o=r.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,i=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(r,t)||t.code==="Space")return;const l=this.#i();o&&!i&&s&&this.#r(t.key,l),t.target?.id===this.parentMenu.contentId.current&&gg.includes(t.key)&&(t.preventDefault(),jc.includes(t.key)&&l.reverse(),mg(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){De(t.currentTarget)&&De(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Ie(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Hc(t.target))return;const r=this.parentMenu.triggerNode?.id;if(t.target.id===r){t.preventDefault();return}t.target.closest(`#${r}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=P(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return u(this.#s)}set snippetProps(t){_(this.#s,t)}#l=P(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":ls(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return u(this.#l)}set props(t){_(this.#l,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Yg{opts;content;attachment;#t=M(!1);constructor(t,r){this.opts=t,this.content=r,this.attachment=Ot(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Ba(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const n=t.currentTarget;if(!He(n))return;n.focus()}}onpointerleave(t){t.defaultPrevented||Ba(t)&&this.content.onItemLeave(t)}onfocus(t){Ie(()=>{t.defaultPrevented||this.opts.disabled.current||_(this.#t,!0)})}onblur(t){Ie(()=>{t.defaultPrevented||_(this.#t,!1)})}#e=P(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":zc(this.opts.disabled.current),"data-disabled":sr(this.opts.disabled.current),"data-highlighted":u(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Ps{static create(t){const r=new Yg(t,iu.get());return new Ps(t,r)}opts;item;root;#t=!1;constructor(t,r){this.opts=t,this.item=r,this.root=r.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const r=this.item.content.search!=="";if(!(this.item.opts.disabled.current||r&&t.key===Wo)&&hg.includes(t.key)){if(!He(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!He(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#r=P(()=>ht(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Ts{static create(t){return new Ts(t,ou.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref)}#t=P(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class Cs{static create(t){return new Cs(t,ws.get())}opts;parentMenu;attachment;constructor(t,r){this.opts=t,this.parentMenu=r,this.attachment=Ot(this.opts.ref,n=>this.parentMenu.triggerNode=n)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===Wo||t.key===ds){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Tn&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=P(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=P(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":zc(this.parentMenu.opts.open.current),"aria-controls":u(this.#t),"data-disabled":sr(this.opts.disabled.current),"data-state":ls(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class As{static create(t){return new As(t)}opts;#t;#e;#r={pointerdown:!1};#n=!1;#o=!1;#i=void 0;#a;#s=St;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,gt(()=>{this.#i=Kc(this.opts.ref.current)});let r=St;const n=()=>{this.#v(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),r()};Pt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Np(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),r(),r=this.#c())}),n}),Rr(()=>{this.#v.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),r()})}#l=t=>{t.defaultPrevented||this.opts.ref.current&&Ie(()=>{!this.opts.ref.current||this.#g(t.target)||t.target&&!this.#o&&this.#a.current?.(t)})};#c(){return Ve(dt(this.#i,"pointerdown",Ve(this.#h,this.#f),{capture:!0}),dt(this.#i,"pointerdown",Ve(this.#p,this.#d)),dt(this.#i,"focusin",this.#l))}#u=t=>{let r=t;r.defaultPrevented&&(r=Ua(t)),this.#t.current(t)};#d=Va(t=>{if(!this.opts.ref.current){this.#s();return}const r=this.opts.isValidEvent.current(t,this.opts.ref.current)||Zg(t,this.opts.ref.current);if(!this.#n||this.#m()||!r){this.#s();return}let n=t;if(n.defaultPrevented&&(n=Ua(n)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=dt(this.#i,"click",this.#u,{once:!0})):this.#t.current(n)},10);#h=t=>{this.#r[t.type]=!0};#p=t=>{this.#r[t.type]=!1};#f=()=>{this.opts.ref.current&&(this.#n=qg(this.opts.ref.current))};#g=t=>this.opts.ref.current?Uc(this.opts.ref.current,t):!1;#v=Va(()=>{for(const t in this.#r)this.#r[t]=!1;this.#n=!1},20);#m(){return Object.values(this.#r).some(Boolean)}#_=()=>{this.#o=!0};#b=()=>{this.#o=!1};props={onfocuscapture:this.#_,onblurcapture:this.#b}}function Xg(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:r}])=>r==="close"||r==="ignore")}function qg(e){const t=[...globalThis.bitsDismissableLayers],r=Xg(t);if(r)return r[0].opts.ref.current===e;const[n]=t[0];return n.opts.ref.current===e}function Zg(e,t){const r=e.target;if(!Hc(r))return!1;const n=!!r.closest(`[${Ug}]`);if("button"in e&&e.button>0&&!n)return!1;if("button"in e&&e.button===0&&n)return!0;const o=!!t.closest(`[${Kg}]`);return n&&o?!1:Kc(r).documentElement.contains(r)&&!Uc(t,r)&&fg(e,t)}function Ua(e){const t=e.currentTarget,r=e.target;let n;e instanceof PointerEvent?n=new PointerEvent(e.type,e):n=new PointerEvent("pointerdown",e);let o=!1;return new Proxy(n,{get:(s,a)=>a==="currentTarget"?t:a==="target"?r:a==="preventDefault"?()=>{o=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:a==="defaultPrevented"?o:a in s?s[a]:e[a]})}function su(e,t){D(t,!0);let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"onInteractOutside",3,St),o=w(t,"onFocusOutside",3,St),i=w(t,"isValidEvent",3,()=>!1);const s=As.create({id:E(()=>t.id),interactOutsideBehavior:E(()=>r()),onInteractOutside:E(()=>n()),enabled:E(()=>t.enabled),onFocusOutside:E(()=>o()),isValidEvent:E(()=>i()),ref:t.ref});var a=N(),l=A(a);B(l,()=>t.children??Q,()=>({props:s.props})),y(e,a),F()}globalThis.bitsEscapeLayers??=new Map;class ks{static create(t){return new ks(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new zn(this.opts.ref);let r=St;Pt(()=>t.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),r=this.#t()),()=>{r(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>dt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Wp||!Jg(this))return;const r=new KeyboardEvent(t.type,t);t.preventDefault();const n=this.opts.escapeKeydownBehavior.current;n!=="close"&&n!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(r)}}function Jg(e){const t=[...globalThis.bitsEscapeLayers],r=t.findLast(([o,{current:i}])=>i==="close"||i==="ignore");if(r)return r[0]===e;const[n]=t[0];return n===e}function au(e,t){D(t,!0);let r=w(t,"escapeKeydownBehavior",3,"close"),n=w(t,"onEscapeKeydown",3,St);ks.create({escapeKeydownBehavior:E(()=>r()),onEscapeKeydown:E(()=>n()),enabled:E(()=>t.enabled),ref:t.ref});var o=N(),i=A(o);B(i,()=>t.children??Q),y(e,o),F()}class Es{static instance;#t=qt([]);#e=new WeakMap;#r=new WeakMap;static getInstance(){return this.instance||(this.instance=new Es),this.instance}register(t){const r=this.getActive();r&&r!==t&&r.pause();const n=document.activeElement;n&&n!==document.body&&this.#r.set(t,n),this.#t.current=this.#t.current.filter(o=>o!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(n=>n!==t);const r=this.getActive();r&&r.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,r){this.#e.set(t,r)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,r){this.#r.set(t,r)}getPreFocusMemory(t){return this.#r.get(t)}clearPreFocusMemory(t){this.#r.delete(t)}}class Os{#t=!1;#e=null;#r=Es.getInstance();#n=[];#o;constructor(t){this.#o=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#i(){for(const t of this.#n)t();this.#n=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#r.register(this),this.#l(),this.#a()}unmount(){this.#e&&(this.#i(),this.#s(),this.#r.unregister(this),this.#r.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#o.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const r=this.#u();r?(r.focus(),this.#r.setFocusMemory(this,r)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#o.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const r=this.#r.getPreFocusMemory(this);if(r&&document.contains(r))try{r.focus()}catch{document.body.focus()}}}#l(){if(!this.#e||!this.#o.trap.current)return;const t=this.#e,r=t.ownerDocument,n=s=>{if(this.#t||!this.#r.isActiveScope(this))return;const a=s.target;if(!a)return;if(t.contains(a))this.#r.setFocusMemory(this,a);else{const c=this.#r.getFocusMemory(this);if(c&&t.contains(c)&&eu(c))s.preventDefault(),c.focus();else{const d=this.#u(),f=this.#d()[0];(d||f||t).focus()}}},o=s=>{if(!this.#o.loop||this.#t||s.key!=="Tab"||!this.#r.isActiveScope(this))return;const a=this.#c();if(a.length===0)return;const l=a[0],c=a[a.length-1];!s.shiftKey&&r.activeElement===c?(s.preventDefault(),l.focus()):s.shiftKey&&r.activeElement===l&&(s.preventDefault(),c.focus())};this.#n.push(dt(r,"focusin",n,{capture:!0}),dt(t,"keydown",o));const i=new MutationObserver(()=>{const s=this.#r.getFocusMemory(this);if(s&&!t.contains(s)){const a=this.#u(),l=this.#d()[0],c=a||l;c?(c.focus(),this.#r.setFocusMemory(this,c)):t.focus()}});i.observe(t,{childList:!0,subtree:!0}),this.#n.push(()=>i.disconnect())}#c(){return this.#e?$c(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#c()[0]||null}#d(){return this.#e?tu(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let r=null;return Pt([()=>t.ref.current,()=>t.enabled.current],([n,o])=>{n&&o?(r||(r=new Os(t)),r.mount(n)):r&&(r.unmount(),r=null)}),Rr(()=>{r?.unmount()}),{get props(){return{tabindex:-1}}}}}function lu(e,t){D(t,!0);let r=w(t,"enabled",3,!1),n=w(t,"trapFocus",3,!1),o=w(t,"loop",3,!1),i=w(t,"onCloseAutoFocus",3,St),s=w(t,"onOpenAutoFocus",3,St);const a=Os.use({enabled:E(()=>r()),trap:E(()=>n()),loop:o(),onCloseAutoFocus:E(()=>i()),onOpenAutoFocus:E(()=>s()),ref:t.ref});var l=N(),c=A(l);B(c,()=>t.focusScope??Q,()=>({props:a.props})),y(e,l),F()}globalThis.bitsTextSelectionLayers??=new Map;class Ns{static create(t){return new Ns(t)}opts;domContext;#t=St;constructor(t){this.opts=t,this.domContext=new zn(t.ref);let r=St;Pt(()=>this.opts.enabled.current,n=>(n&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),r(),r=this.#e()),()=>{r(),this.#n(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return Ve(dt(this.domContext.getDocument(),"pointerdown",this.#r),dt(this.domContext.getDocument(),"pointerup",Oc(this.#n,this.opts.onPointerUp.current)))}#r=t=>{const r=this.opts.ref.current,n=t.target;!He(r)||!He(n)||!this.opts.enabled.current||!$g(this)||!Lp(r,n)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=Qg(r,this.domContext.getDocument().body)))};#n=()=>{this.#t(),this.#t=St}}const Ka=e=>e.style.userSelect||e.style.webkitUserSelect;function Qg(e,t){const r=Ka(t),n=Ka(e);return Xn(t,"none"),Xn(e,"text"),()=>{Xn(t,r),Xn(e,n)}}function Xn(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function $g(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const r=t.at(-1);return r?r[0]===e:!1}function cu(e,t){D(t,!0);let r=w(t,"preventOverflowTextSelection",3,!0),n=w(t,"onPointerDown",3,St),o=w(t,"onPointerUp",3,St);Ns.create({id:E(()=>t.id),onPointerDown:E(()=>n()),onPointerUp:E(()=>o()),enabled:E(()=>t.enabled&&r()),ref:t.ref});var i=N(),s=A(i);B(s,()=>t.children??Q),y(e,i),F()}globalThis.bitsIdCounter??={current:0};function Qr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class tv{#t;#e=0;#r=M();#n;constructor(t){this.#t=t}#o(){this.#e-=1,this.#n&&this.#e<=0&&(this.#n(),_(this.#r,void 0),this.#n=void 0)}get(...t){return this.#e+=1,u(this.#r)===void 0&&(this.#n=Nn(()=>{_(this.#r,this.#t(...t),!0)})),gt(()=>()=>{this.#o()}),u(this.#r)}}const no=new ah;let qn=M(null),ii=null,un=null,dn=!1;const ja=E(()=>{for(const e of no.values())if(e)return!0;return!1});let si=null;const ev=new tv(()=>{function e(){document.body.setAttribute("style",u(qn)??""),document.body.style.removeProperty("--scrollbar-width"),za&&ii?.(),_(qn,null)}function t(){un!==null&&(window.clearTimeout(un),un=null)}function r(o,i){t(),dn=!0,si=Date.now();const s=si,a=()=>{un=null,si===s&&(uu(no)?dn=!1:(dn=!1,i()))},l=o===null?24:o;un=window.setTimeout(a,l)}function n(){u(qn)===null&&no.size===0&&!dn&&_(qn,document.body.getAttribute("style"),!0)}return Pt(()=>ja.current,()=>{if(!ja.current)return;n(),dn=!1;const o=getComputedStyle(document.documentElement),i=getComputedStyle(document.body),s=o.scrollbarGutter?.includes("stable")||i.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,c={padding:Number.parseInt(i.paddingRight??"0",10)+a,margin:Number.parseInt(i.marginRight??"0",10)};a>0&&!s&&(document.body.style.paddingRight=`${c.padding}px`,document.body.style.marginRight=`${c.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",za&&(ii=dt(document,"touchmove",d=>{d.target===document.documentElement&&(d.touches.length>1||d.preventDefault())},{passive:!1})),Ie(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Rr(()=>()=>{ii?.()}),{get lockMap(){return no},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:r,cancelPendingCleanup:t,ensureInitialStyleCaptured:n}});class rv{#t=Qr();#e;#r=()=>null;#n;locked;constructor(t,r=()=>null){this.#e=t,this.#r=r,this.#n=ev.get(),this.#n&&(this.#n.cancelPendingCleanup(),this.#n.ensureInitialStyleCaptured(),this.#n.lockMap.set(this.#t,this.#e??!1),this.locked=E(()=>this.#n.lockMap.get(this.#t)??!1,n=>this.#n.lockMap.set(this.#t,n)),Rr(()=>{if(this.#n.lockMap.delete(this.#t),uu(this.#n.lockMap))return;const n=this.#r();this.#n.scheduleCleanupIfNoNewLocks(n,()=>{this.#n.resetBodyStyle()})}))}}function uu(e){for(const[t,r]of e)if(r)return!0;return!1}function bo(e,t){D(t,!0);let r=w(t,"preventScroll",3,!0),n=w(t,"restoreScrollDelay",3,null);r()&&new rv(r(),()=>n()),F()}var nv=z("
");function ov(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"forceMount",3,!1),i=w(t,"ref",15,null),s=K(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const a=ms.create({id:E(()=>n()),ref:E(()=>i(),h=>i(h))}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=h=>{var p=N(),g=A(p);{var v=b=>{var O=N(),C=A(O);{let x=P(()=>({props:ht(u(l)),...a.snippetProps}));B(C,()=>t.child,()=>u(x))}y(b,O)},m=b=>{var O=nv();wt(O,x=>({...x}),[()=>ht(u(l))]);var C=et(O);B(C,()=>t.children??Q,()=>a.snippetProps),y(b,O)};nt(g,b=>{t.child?b(v):b(m,!1)})}y(h,p)};nt(d,h=>{(a.shouldRender||o())&&h(f)})}y(e,c),F()}var iv=z("
");function sv(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=K(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=gs.create({id:E(()=>n()),ref:E(()=>o(),h=>o(h))}),a=P(()=>ht(i,s.props));var l=N(),c=A(l);{var d=h=>{var p=N(),g=A(p);B(g,()=>t.child,()=>({props:u(a)})),y(h,p)},f=h=>{var p=iv();wt(p,()=>({...u(a)}));var g=et(p);B(g,()=>t.children??Q),y(h,p)};nt(c,h=>{t.child?h(d):h(f,!1)})}y(e,l),F()}const av=["top","right","bottom","left"],ar=Math.min,ne=Math.max,yo=Math.round,Zn=Math.floor,Pe=e=>({x:e,y:e}),lv={left:"right",right:"left",bottom:"top",top:"bottom"},cv={start:"end",end:"start"};function Ni(e,t,r){return ne(e,ar(t,r))}function Ue(e,t){return typeof e=="function"?e(t):e}function Ke(e){return e.split("-")[0]}function $r(e){return e.split("-")[1]}function Ms(e){return e==="x"?"y":"x"}function Is(e){return e==="y"?"height":"width"}const uv=new Set(["top","bottom"]);function _e(e){return uv.has(Ke(e))?"y":"x"}function Ds(e){return Ms(_e(e))}function dv(e,t,r){r===void 0&&(r=!1);const n=$r(e),o=Ds(e),i=Is(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wo(s)),[s,wo(s)]}function fv(e){const t=wo(e);return[Mi(e),t,Mi(t)]}function Mi(e){return e.replace(/start|end/g,t=>cv[t])}const Ga=["left","right"],Ya=["right","left"],hv=["top","bottom"],pv=["bottom","top"];function gv(e,t,r){switch(e){case"top":case"bottom":return r?t?Ya:Ga:t?Ga:Ya;case"left":case"right":return t?hv:pv;default:return[]}}function vv(e,t,r,n){const o=$r(e);let i=gv(Ke(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Mi)))),i}function wo(e){return e.replace(/left|right|bottom|top/g,t=>lv[t])}function mv(e){return{top:0,right:0,bottom:0,left:0,...e}}function du(e){return typeof e!="number"?mv(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Xa(e,t,r){let{reference:n,floating:o}=e;const i=_e(t),s=Ds(t),a=Is(s),l=Ke(t),c=i==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch($r(t)){case"start":p[s]-=h*(r&&c?-1:1);break;case"end":p[s]+=h*(r&&c?-1:1);break}return p}async function bv(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ue(t,e),g=du(p),m=a[h?f==="floating"?"reference":"floating":f],b=_o(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(m)))==null||r?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),O=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},T=_o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:C,strategy:l}):O);return{top:(b.top-T.top+g.top)/x.y,bottom:(T.bottom-b.bottom+g.bottom)/x.y,left:(b.left-T.left+g.left)/x.x,right:(T.right-b.right+g.right)/x.x}}const yv=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Xa(c,n,l),h=n,p={},g=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Ue(e,t)||{};if(c==null)return{};const f=du(d),h={x:r,y:n},p=Ds(o),g=Is(p),v=await s.getDimensions(c),m=p==="y",b=m?"top":"left",O=m?"bottom":"right",C=m?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[p]-h[p]-i.floating[g],T=h[p]-i.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=k?k[C]:0;(!R||!await(s.isElement==null?void 0:s.isElement(k)))&&(R=a.floating[C]||i.floating[g]);const S=x/2-T/2,L=R/2-v[g]/2-1,V=ar(f[b],L),ct=ar(f[O],L),st=V,_t=R-v[g]-ct,G=R/2-v[g]/2+S,Y=Ni(st,G,_t),W=!l.arrow&&$r(o)!=null&&G!==Y&&i.reference[g]/2-(GG<=0)){var ct,st;const G=(((ct=i.flip)==null?void 0:ct.index)||0)+1,Y=R[G];if(Y&&(!(f==="alignment"?O!==_e(Y):!1)||V.every(X=>_e(X.placement)===O?X.overflows[0]>0:!0)))return{data:{index:G,overflows:V},reset:{placement:Y}};let W=(st=V.filter(Z=>Z.overflows[0]<=0).sort((Z,X)=>Z.overflows[1]-X.overflows[1])[0])==null?void 0:st.placement;if(!W)switch(p){case"bestFit":{var _t;const Z=(_t=V.filter(X=>{if(k){const ot=_e(X.placement);return ot===O||ot==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(ot=>ot>0).reduce((ot,I)=>ot+I,0)]).sort((X,ot)=>X[1]-ot[1])[0])==null?void 0:_t[0];Z&&(W=Z);break}case"initialPlacement":W=a;break}if(o!==W)return{reset:{placement:W}}}return{}}}};function qa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Za(e){return av.some(t=>e[t]>=0)}const xv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=Ue(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=qa(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Za(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=qa(s,r.floating);return{data:{escapedOffsets:a,escaped:Za(a)}}}default:return{}}}}},fu=new Set(["left","top"]);async function Sv(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Ke(r),a=$r(r),l=_e(r)==="y",c=fu.has(s)?-1:1,d=i&&l?-1:1,f=Ue(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const Pv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Sv(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Tv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:O,y:C}=b;return{x:O,y:C}}},...c}=Ue(e,t),d={x:r,y:n},f=await i.detectOverflow(t,c),h=_e(Ke(o)),p=Ms(h);let g=d[p],v=d[h];if(s){const b=p==="y"?"top":"left",O=p==="y"?"bottom":"right",C=g+f[b],x=g-f[O];g=Ni(C,g,x)}if(a){const b=h==="y"?"top":"left",O=h==="y"?"bottom":"right",C=v+f[b],x=v-f[O];v=Ni(C,v,x)}const m=l.fn({...t,[p]:g,[h]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:s,[h]:a}}}}}},Cv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ue(e,t),d={x:r,y:n},f=_e(o),h=Ms(f);let p=d[h],g=d[f];const v=Ue(a,t),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const C=h==="y"?"height":"width",x=i.reference[h]-i.floating[C]+m.mainAxis,T=i.reference[h]+i.reference[C]-m.mainAxis;pT&&(p=T)}if(c){var b,O;const C=h==="y"?"width":"height",x=fu.has(Ke(o)),T=i.reference[f]-i.floating[C]+(x&&((b=s.offset)==null?void 0:b[f])||0)+(x?0:m.crossAxis),k=i.reference[f]+i.reference[C]+(x?0:((O=s.offset)==null?void 0:O[f])||0)-(x?m.crossAxis:0);gk&&(g=k)}return{[h]:p,[f]:g}}}},Av=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ue(e,t),d=await s.detectOverflow(t,c),f=Ke(o),h=$r(o),p=_e(o)==="y",{width:g,height:v}=i.floating;let m,b;f==="top"||f==="bottom"?(m=f,b=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,m=h==="end"?"top":"bottom");const O=v-d.top-d.bottom,C=g-d.left-d.right,x=ar(v-d[m],O),T=ar(g-d[b],C),k=!t.middlewareData.shift;let R=x,S=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=C),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(R=O),k&&!h){const V=ne(d.left,0),ct=ne(d.right,0),st=ne(d.top,0),_t=ne(d.bottom,0);p?S=g-2*(V!==0||ct!==0?V+ct:ne(d.left,d.right)):R=v-2*(st!==0||_t!==0?st+_t:ne(d.top,d.bottom))}await l({...t,availableWidth:S,availableHeight:R});const L=await s.getDimensions(a.floating);return g!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function Ho(){return typeof window<"u"}function tn(e){return hu(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(hu(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hu(e){return Ho()?e instanceof Node||e instanceof ie(e).Node:!1}function ve(e){return Ho()?e instanceof Element||e instanceof ie(e).Element:!1}function Ce(e){return Ho()?e instanceof HTMLElement||e instanceof ie(e).HTMLElement:!1}function Ja(e){return!Ho()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}const kv=new Set(["inline","contents"]);function Bn(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!kv.has(o)}const Ev=new Set(["table","td","th"]);function Ov(e){return Ev.has(tn(e))}const Nv=[":popover-open",":modal"];function Uo(e){return Nv.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mv=["transform","translate","scale","rotate","perspective"],Iv=["transform","translate","scale","rotate","perspective","filter"],Dv=["paint","layout","strict","content"];function Fs(e){const t=Rs(),r=ve(e)?me(e):e;return Mv.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Iv.some(n=>(r.willChange||"").includes(n))||Dv.some(n=>(r.contain||"").includes(n))}function Fv(e){let t=lr(e);for(;Ce(t)&&!Yr(t);){if(Fs(t))return t;if(Uo(t))return null;t=lr(t)}return null}function Rs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rv=new Set(["html","body","#document"]);function Yr(e){return Rv.has(tn(e))}function me(e){return ie(e).getComputedStyle(e)}function Ko(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lr(e){if(tn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ja(e)&&e.host||Ae(e);return Ja(t)?t.host:t}function pu(e){const t=lr(e);return Yr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&Bn(t)?t:pu(t)}function Cn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=pu(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=ie(o);if(i){const a=Ii(s);return t.concat(s,s.visualViewport||[],Bn(o)?o:[],a&&r?Cn(a):[])}return t.concat(o,Cn(o,[],r))}function Ii(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gu(e){const t=me(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Ce(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=yo(r)!==i||yo(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Ls(e){return ve(e)?e:e.contextElement}function Wr(e){const t=Ls(e);if(!Ce(t))return Pe(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=gu(t);let s=(i?yo(r.width):r.width)/n,a=(i?yo(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Lv=Pe(0);function vu(e){const t=ie(e);return!Rs()||!t.visualViewport?Lv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zv(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ie(e)?!1:t}function Ir(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Ls(e);let s=Pe(1);t&&(n?ve(n)&&(s=Wr(n)):s=Wr(e));const a=zv(i,r,n)?vu(i):Pe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const h=ie(i),p=n&&ve(n)?ie(n):n;let g=h,v=Ii(g);for(;v&&n&&p!==g;){const m=Wr(v),b=v.getBoundingClientRect(),O=me(v),C=b.left+(v.clientLeft+parseFloat(O.paddingLeft))*m.x,x=b.top+(v.clientTop+parseFloat(O.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,f*=m.y,l+=C,c+=x,g=ie(v),v=Ii(g)}}return _o({width:d,height:f,x:l,y:c})}function jo(e,t){const r=Ko(e).scrollLeft;return t?t.left+r:Ir(Ae(e)).left+r}function mu(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-jo(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Vv(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Ae(n),a=t?Uo(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Pe(1);const d=Pe(0),f=Ce(n);if((f||!f&&!i)&&((tn(n)!=="body"||Bn(s))&&(l=Ko(n)),Ce(n))){const p=Ir(n);c=Wr(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const h=s&&!f&&!i?mu(s,l):Pe(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:r.y*c.y-l.scrollTop*c.y+d.y+h.y}}function Bv(e){return Array.from(e.getClientRects())}function Wv(e){const t=Ae(e),r=Ko(e),n=e.ownerDocument.body,o=ne(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ne(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+jo(e);const a=-r.scrollTop;return me(n).direction==="rtl"&&(s+=ne(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Qa=25;function Hv(e,t){const r=ie(e),n=Ae(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Rs();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=jo(n);if(c<=0){const d=n.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(n.clientWidth-f.clientWidth-p);g<=Qa&&(i-=g)}else c<=Qa&&(i+=c);return{width:i,height:s,x:a,y:l}}const Uv=new Set(["absolute","fixed"]);function Kv(e,t){const r=Ir(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Ce(e)?Wr(e):Pe(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function $a(e,t,r){let n;if(t==="viewport")n=Hv(e,r);else if(t==="document")n=Wv(Ae(e));else if(ve(t))n=Kv(t,r);else{const o=vu(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _o(n)}function bu(e,t){const r=lr(e);return r===t||!ve(r)||Yr(r)?!1:me(r).position==="fixed"||bu(r,t)}function jv(e,t){const r=t.get(e);if(r)return r;let n=Cn(e,[],!1).filter(a=>ve(a)&&tn(a)!=="body"),o=null;const i=me(e).position==="fixed";let s=i?lr(e):e;for(;ve(s)&&!Yr(s);){const a=me(s),l=Fs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Uv.has(o.position)||Bn(s)&&!l&&bu(e,s))?n=n.filter(d=>d!==s):o=a,s=lr(s)}return t.set(e,n),n}function Gv(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Uo(t)?[]:jv(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const f=$a(t,d,o);return c.top=ne(f.top,c.top),c.right=ar(f.right,c.right),c.bottom=ar(f.bottom,c.bottom),c.left=ne(f.left,c.left),c},$a(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Yv(e){const{width:t,height:r}=gu(e);return{width:t,height:r}}function Xv(e,t,r){const n=Ce(t),o=Ae(t),i=r==="fixed",s=Ir(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Pe(0);function c(){l.x=jo(o)}if(n||!n&&!i)if((tn(t)!=="body"||Bn(o))&&(a=Ko(t)),n){const p=Ir(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?mu(o,a):Pe(0),f=s.left+a.scrollLeft-l.x-d.x,h=s.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function ai(e){return me(e).position==="static"}function tl(e,t){if(!Ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function yu(e,t){const r=ie(e);if(Uo(e))return r;if(!Ce(e)){let o=lr(e);for(;o&&!Yr(o);){if(ve(o)&&!ai(o))return o;o=lr(o)}return r}let n=tl(e,t);for(;n&&Ov(n)&&ai(n);)n=tl(n,t);return n&&Yr(n)&&ai(n)&&!Fs(n)?r:n||Fv(e)||r}const qv=async function(e){const t=this.getOffsetParent||yu,r=this.getDimensions,n=await r(e.floating);return{reference:Xv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Zv(e){return me(e).direction==="rtl"}const Jv={convertOffsetParentRelativeRectToViewportRelativeRect:Vv,getDocumentElement:Ae,getClippingRect:Gv,getOffsetParent:yu,getElementRects:qv,getClientRects:Bv,getDimensions:Yv,getScale:Wr,isElement:ve,isRTL:Zv};function wu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qv(e,t){let r=null,n;const o=Ae(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(a||t(),!h||!p)return;const g=Zn(f),v=Zn(o.clientWidth-(d+h)),m=Zn(o.clientHeight-(f+p)),b=Zn(d),C={rootMargin:-g+"px "+-v+"px "+-m+"px "+-b+"px",threshold:ne(0,ar(1,l))||1};let x=!0;function T(k){const R=k[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):n=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!wu(c,e.getBoundingClientRect())&&s(),x=!1}try{r=new IntersectionObserver(T,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,C)}r.observe(e)}return s(!0),i}function $v(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Ls(e),d=o||i?[...c?Cn(c):[],...Cn(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=c&&a?Qv(c,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(b=>{let[O]=b;O&&O.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let g,v=l?Ir(e):null;l&&m();function m(){const b=Ir(e);v&&!wu(v,b)&&r(),v=b,g=requestAnimationFrame(m)}return r(),()=>{var b;d.forEach(O=>{o&&O.removeEventListener("scroll",r),i&&O.removeEventListener("resize",r)}),f?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const tm=Pv,em=Tv,rm=_v,nm=Av,om=xv,im=wv,sm=Cv,am=(e,t,r)=>{const n=new Map,o={platform:Jv,...r},i={...o.platform,_c:n};return yv(e,t,{...o,platform:i})};function pr(e){return typeof e=="function"?e():e}function _u(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function el(e,t){const r=_u(e);return Math.round(t*r)/r}function xo(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function lm(e){const t=e.whileElementsMounted,r=P(()=>pr(e.open)??!0),n=P(()=>pr(e.middleware)),o=P(()=>pr(e.transform)??!0),i=P(()=>pr(e.placement)??"bottom"),s=P(()=>pr(e.strategy)??"absolute"),a=P(()=>pr(e.sideOffset)??0),l=P(()=>pr(e.alignOffset)??0),c=e.reference;let d=M(0),f=M(0);const h=qt(null);let p=M(It(u(s))),g=M(It(u(i))),v=M(It({})),m=M(!1),b=!1;const O=P(()=>{const L=h.current?el(h.current,u(d)):u(d),V=h.current?el(h.current,u(f)):u(f);return u(o)?{position:u(p),left:"0",top:"0",transform:`translate(${L}px, ${V}px)`,...h.current&&_u(h.current)>=1.5&&{willChange:"transform"}}:{position:u(p),left:`${L}px`,top:`${V}px`}});let C;function x(){c.current===null||h.current===null||am(c.current,h.current,{middleware:u(n),placement:u(i),strategy:u(s)}).then(L=>{const V=c.current;if(cm(V)){_(v,{...u(v),hide:{...u(v).hide,referenceHidden:!0}},!0);return}if(!u(r)&&u(d)!==0&&u(f)!==0){const st=Math.max(Math.abs(u(a)),Math.abs(u(l)),15);if(L.x<=st&&L.y<=st)return}_(d,L.x,!0),_(f,L.y,!0),_(p,L.strategy,!0),_(g,L.placement,!0),_(v,L.middlewareData,!0),_(m,!0)})}function T(){typeof C=="function"&&(C(),C=void 0)}function k(){if(T(),t===void 0){x();return}u(r)&&(c.current===null||h.current===null||(C=t(c.current,h.current,x)))}function R(){u(r)||_(m,!1)}function S(){return[u(n),u(i),u(s),u(a),u(l),u(r)]}return gt(()=>{t===void 0&&u(r)&&x()}),gt(k),gt(()=>{if(t!==void 0){if(S(),!u(r)){b=!1;return}if(!u(m)){b=!1;return}if(!b){b=!0;return}x()}}),gt(R),gt(()=>T),{floating:h,reference:c,get strategy(){return u(p)},get placement(){return u(g)},get middlewareData(){return u(v)},get isPositioned(){return u(m)},get floatingStyles(){return u(O)},get update(){return x}}}function cm(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const um={top:"bottom",right:"left",bottom:"top",left:"right"},zs=new Zt("Floating.Root"),Di=new Zt("Floating.Content"),Vs=new Zt("Floating.Root");class So{static create(t=!1){return t?Vs.set(new So):zs.set(new So)}anchorNode=qt(null);customAnchorNode=qt(null);triggerNode=qt(null);constructor(){gt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Po{static create(t,r=!1){return r?Di.set(new Po(t,Vs.get())):Di.set(new Po(t,zs.get()))}opts;root;contentRef=qt(null);wrapperRef=qt(null);arrowRef=qt(null);contentAttachment=Ot(this.contentRef);wrapperAttachment=Ot(this.wrapperRef);arrowAttachment=Ot(this.arrowRef);arrowId=qt(Qr());#t=P(()=>{if(typeof this.opts.style=="string")return gn(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#r=new Ep(()=>this.arrowRef.current??void 0);#n=P(()=>this.#r?.width??0);#o=P(()=>this.#r?.height??0);#i=P(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=P(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=P(()=>u(this.#a).length>0);get hasExplicitBoundaries(){return u(this.#s)}set hasExplicitBoundaries(t){_(this.#s,t)}#l=P(()=>({padding:this.opts.collisionPadding.current,boundary:u(this.#a).filter(Jp),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return u(this.#l)}set detectOverflowOptions(t){_(this.#l,t)}#c=M(void 0);#u=M(void 0);#d=M(void 0);#h=M(void 0);#p=P(()=>[tm({mainAxis:this.opts.sideOffset.current+u(this.#o),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&em({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?sm():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&rm({...this.detectOverflowOptions}),nm({...this.detectOverflowOptions,apply:({rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:i}=t.reference;_(this.#c,r,!0),_(this.#u,n,!0),_(this.#d,o,!0),_(this.#h,i,!0)}}),this.arrowRef.current&&im({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),dm({arrowWidth:u(this.#n),arrowHeight:u(this.#o)}),this.opts.hideWhenDetached.current&&om({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return u(this.#p)}set middleware(t){_(this.#p,t)}floating;#f=P(()=>fm(this.floating.placement));get placedSide(){return u(this.#f)}set placedSide(t){_(this.#f,t)}#g=P(()=>hm(this.floating.placement));get placedAlign(){return u(this.#g)}set placedAlign(t){_(this.#g,t)}#v=P(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return u(this.#v)}set arrowX(t){_(this.#v,t)}#m=P(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return u(this.#m)}set arrowY(t){_(this.#m,t)}#_=P(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return u(this.#_)}set cannotCenterArrow(t){_(this.#_,t)}#b=M();get contentZIndex(){return u(this.#b)}set contentZIndex(t){_(this.#b,t,!0)}#y=P(()=>um[this.placedSide]);get arrowBaseSide(){return u(this.#y)}set arrowBaseSide(t){_(this.#y,t)}#w=P(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${u(this.#c)}px`,"--bits-floating-available-height":`${u(this.#u)}px`,"--bits-floating-anchor-width":`${u(this.#d)}px`,"--bits-floating-anchor-height":`${u(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...u(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return u(this.#w)}set wrapperProps(t){_(this.#w,t)}#x=P(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Mc({...u(this.#t)}),...this.contentAttachment}));get props(){return u(this.#x)}set props(t){_(this.#x,t)}#S=P(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return u(this.#S)}set arrowStyle(t){_(this.#S,t)}constructor(t,r){this.opts=t,this.root=r,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),Pt(()=>t.customAnchor.current,n=>{this.root.customAnchorNode.current=n}),this.floating=lm({strategy:()=>this.opts.strategy.current,placement:()=>u(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...n)=>$v(...n,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),gt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Pt(()=>this.contentRef.current,n=>{if(!n||!this.opts.enabled.current)return;const o=Bo(n),i=o.requestAnimationFrame(()=>{if(this.contentRef.current!==n||!this.opts.enabled.current)return;const s=o.getComputedStyle(n).zIndex;s!==this.contentZIndex&&(this.contentZIndex=s)});return()=>{o.cancelAnimationFrame(i)}}),gt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Bs{static create(t){return new Bs(t,Di.get())}opts;content;constructor(t,r){this.opts=t,this.content=r}#t=P(()=>({id:this.opts.id.current,style:this.content.arrowStyle,"data-side":this.content.placedSide,...this.content.arrowAttachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}class To{static create(t,r=!1){return r?new To(t,Vs.get()):new To(t,zs.get())}opts;root;constructor(t,r){this.opts=t,this.root=r,t.virtualEl&&t.virtualEl.current?r.triggerNode=Ec(t.virtualEl.current):r.triggerNode=t.ref}}function dm(e){return{name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Ws(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=s?f:`${h}px`,v=`${-l}px`):c==="top"?(g=s?f:`${h}px`,v=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=s?f:`${p}px`):c==="left"&&(g=`${n.floating.width+l}px`,v=s?f:`${p}px`),{data:{x:g,y:v}}}}}function Ws(e){const[t,r="center"]=e.split("-");return[t,r]}function fm(e){return Ws(e)[0]}function hm(e){return Ws(e)[1]}function xu(e,t){D(t,!0);let r=w(t,"tooltip",3,!1);So.create(r());var n=N(),o=A(n);B(o,()=>t.children??Q),y(e,n),F()}function pm(e,t){D(t,!0);let r=w(t,"tooltip",3,!1);To.create({id:E(()=>t.id),virtualEl:E(()=>t.virtualEl),ref:t.ref},r());var n=N(),o=A(n);B(o,()=>t.children??Q),y(e,n),F()}var gm=pc(''),vm=z("");function mm(e,t){D(t,!0);let r=w(t,"id",19,Qr),n=w(t,"width",3,10),o=w(t,"height",3,5),i=K(t,["$$slots","$$events","$$legacy","id","children","child","width","height"]);const s=P(()=>ht(i,{id:r()}));var a=N(),l=A(a);{var c=f=>{var h=N(),p=A(h);B(p,()=>t.child,()=>({props:u(s)})),y(f,h)},d=f=>{var h=vm();wt(h,()=>({...u(s)}));var p=et(h);{var g=m=>{var b=N(),O=A(b);B(O,()=>t.children??Q),y(m,b)},v=m=>{var b=gm();zt(()=>{Wt(b,"width",n()),Wt(b,"height",o())}),y(m,b)};nt(p,m=>{t.children?m(g):m(v,!1)})}y(f,h)};nt(l,f=>{t.child?f(c):f(d,!1)})}y(e,a),F()}function bm(e,t){D(t,!0);let r=w(t,"id",19,Qr),n=w(t,"ref",15,null),o=K(t,["$$slots","$$events","$$legacy","id","ref"]);const i=Bs.create({id:E(()=>r()),ref:E(()=>n(),a=>n(a))}),s=P(()=>ht(o,i.props));mm(e,U(()=>u(s))),F()}function ym(e,t){D(t,!0);let r=w(t,"side",3,"bottom"),n=w(t,"sideOffset",3,0),o=w(t,"align",3,"center"),i=w(t,"alignOffset",3,0),s=w(t,"arrowPadding",3,0),a=w(t,"avoidCollisions",3,!0),l=w(t,"collisionBoundary",19,()=>[]),c=w(t,"collisionPadding",3,0),d=w(t,"hideWhenDetached",3,!1),f=w(t,"onPlaced",3,()=>{}),h=w(t,"sticky",3,"partial"),p=w(t,"updatePositionStrategy",3,"optimized"),g=w(t,"strategy",3,"fixed"),v=w(t,"dir",3,"ltr"),m=w(t,"style",19,()=>({})),b=w(t,"wrapperId",19,Qr),O=w(t,"customAnchor",3,null),C=w(t,"tooltip",3,!1);const x=Po.create({side:E(()=>r()),sideOffset:E(()=>n()),align:E(()=>o()),alignOffset:E(()=>i()),id:E(()=>t.id),arrowPadding:E(()=>s()),avoidCollisions:E(()=>a()),collisionBoundary:E(()=>l()),collisionPadding:E(()=>c()),hideWhenDetached:E(()=>d()),onPlaced:E(()=>f()),sticky:E(()=>h()),updatePositionStrategy:E(()=>p()),strategy:E(()=>g()),dir:E(()=>v()),style:E(()=>m()),enabled:E(()=>t.enabled),wrapperId:E(()=>b()),customAnchor:E(()=>O())},C()),T=P(()=>ht(x.wrapperProps,{style:{pointerEvents:"auto"}}));var k=N(),R=A(k);B(R,()=>t.content??Q,()=>({props:x.props,wrapperProps:u(T)})),y(e,k),F()}function wm(e,t){D(t,!0),es(()=>{t.onPlaced?.()});var r=N(),n=A(r);B(n,()=>t.content??Q,()=>({props:{},wrapperProps:{}})),y(e,r),F()}const _m=Vn({component:"separator",parts:["root"]});class Hs{static create(t){return new Hs(t)}opts;attachment;constructor(t){this.opts=t,this.attachment=Ot(t.ref)}#t=P(()=>({id:this.opts.id.current,role:this.opts.decorative.current?"none":"separator","aria-orientation":this.opts.orientation.current,"aria-hidden":Vp(this.opts.decorative.current),"data-orientation":this.opts.orientation.current,[_m.root]:"",...this.attachment}));get props(){return u(this.#t)}set props(t){_(this.#t,t)}}var xm=z("
");function Sm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"decorative",3,!1),s=w(t,"orientation",3,"horizontal"),a=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","decorative","orientation"]);const l=Hs.create({ref:E(()=>o(),g=>o(g)),id:E(()=>n()),decorative:E(()=>i()),orientation:E(()=>s())}),c=P(()=>ht(a,l.props));var d=N(),f=A(d);{var h=g=>{var v=N(),m=A(v);B(m,()=>t.child,()=>({props:u(c)})),y(g,v)},p=g=>{var v=xm();wt(v,()=>({...u(c)}));var m=et(v);B(m,()=>t.children??Q),y(g,v)};nt(f,g=>{t.child?g(h):g(p,!1)})}y(e,d),F()}function Pm(e,t){let r=w(t,"isStatic",3,!1),n=K(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=N(),i=A(o);{var s=l=>{wm(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{ym(l,U({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>n))};nt(i,l=>{r()?l(s):l(a,!1)})}y(e,o)}var Tm=z(" ",1);function Su(e,t){D(t,!0);let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=w(t,"tooltip",3,!1),l=w(t,"contentPointerEvents",3,"auto"),c=K(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Pm(e,{get isStatic(){return s()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get enabled(){return t.enabled},get tooltip(){return a()},content:(f,h)=>{let p=()=>h?.().props,g=()=>h?.().wrapperProps;var v=Tm(),m=A(v);{var b=x=>{bo(x,{get preventScroll(){return t.preventScroll}})},O=x=>{bo(x,{get preventScroll(){return t.preventScroll}})};nt(m,x=>{t.forceMount&&t.enabled?x(b):t.forceMount||x(O,1)})}var C=j(m,2);lu(C,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return n()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(T,k)=>{let R=()=>k?.().props;au(T,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(S,L)=>{su(S,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return r()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(ct,st)=>{let _t=()=>st?.().props;cu(ct,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(G,Y)=>{var W=N(),Z=A(W);{let X=P(()=>({props:ht(c,p(),_t(),R(),{style:{pointerEvents:l()}}),wrapperProps:g()}));B(Z,()=>t.popper??Q,()=>u(X))}y(G,W)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),y(f,v)},$$slots:{content:!0}}),F()}function Pu(e,t){let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=K(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=N(),c=A(l);{var d=f=>{Su(f,U({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return r()},get loop(){return t.loop},get trapFocus(){return n()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};nt(c,f=>{t.shouldRender&&f(d)})}y(e,l)}function Tu(e,t){let r=w(t,"interactOutsideBehavior",3,"close"),n=w(t,"trapFocus",3,!0),o=w(t,"isValidEvent",3,()=>!1),i=w(t,"customAnchor",3,null),s=w(t,"isStatic",3,!1),a=K(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Su(e,U({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return r()},get loop(){return t.loop},get trapFocus(){return n()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Cm=z("
");function Am(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=w(t,"disabled",3,!1),s=w(t,"onSelect",3,St),a=w(t,"closeOnSelect",3,!0),l=K(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const c=Ps.create({id:E(()=>o()),disabled:E(()=>i()),onSelect:E(()=>s()),ref:E(()=>n(),v=>n(v)),closeOnSelect:E(()=>a())}),d=P(()=>ht(l,c.props));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=Cm();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}var km=z("
");function Em(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const s=Ts.create({id:E(()=>o()),ref:E(()=>n(),h=>n(h))}),a=P(()=>ht(i,s.props));var l=N(),c=A(l);{var d=h=>{var p=N(),g=A(p);B(g,()=>t.child,()=>({props:u(a)})),y(h,p)},f=h=>{var p=km();wt(p,()=>({...u(a)}));var g=et(p);B(g,()=>t.children??Q),y(h,p)};nt(c,h=>{t.child?h(d):h(f,!1)})}y(e,l),F()}function rl(e,t){const[r,n]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s=n!=f>=n&&r<=(d-l)*(n-c)/(f-c)+l&&(o=!o)}return o}function nl(e,t){return e[0]>=t.left&&e[0]<=t.right&&e[1]>=t.top&&e[1]<=t.bottom}function Om(e,t){const r=e.left+e.width/2,n=e.top+e.height/2,o=t.left+t.width/2,i=t.top+t.height/2,s=o-r,a=i-n;return Math.abs(s)>Math.abs(a)?s>0?"right":"left":a>0?"bottom":"top"}class Nm{#t;#e;#r=null;#n=null;#o=null;#i(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#a(){this.#i(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#n)&&(this.#l(),this.#t.onPointerExit())})}constructor(t){this.#t=t,this.#e=t.buffer??1,Pt([t.triggerNode,t.contentNode,t.enabled],([r,n,o])=>{if(!r||!n||!o){this.#l();return}const i=Jr(r),s=f=>{this.#s([f.clientX,f.clientY],r,n)},a=f=>{const h=f.relatedTarget;if(De(h)&&n.contains(h))return;const p=this.#t.ignoredTargets?.()??[];if(!(De(h)&&p.some(g=>g===h||g.contains(h)))){if(De(h)&&!r.contains(h)&&!n.contains(h)&&!h.contains(n)){this.#l(),this.#t.onPointerExit();return}this.#r=[f.clientX,f.clientY],this.#n="content",this.#a()}},l=()=>{this.#l()},c=()=>{this.#l()},d=f=>{const h=f.relatedTarget;De(h)&&r.contains(h)||(this.#r=[f.clientX,f.clientY],this.#n="trigger",this.#a())};return[dt(i,"pointermove",s),dt(r,"pointerleave",a),dt(r,"pointerenter",l),dt(n,"pointerenter",c),dt(n,"pointerleave",d)].reduce((f,h)=>()=>{f(),h()},()=>{})})}#s(t,r,n){if(!this.#r||!this.#n)return;this.#i();const o=r.getBoundingClientRect(),i=n.getBoundingClientRect();if(this.#n==="content"&&nl(t,i)){this.#l();return}if(this.#n==="trigger"&&nl(t,o)){this.#l();return}const s=Om(o,i),a=this.#c(o,i,s);if(a&&rl(t,a))return;const l=this.#n==="content"?i:o,c=this.#u(this.#r,l,s,this.#n);rl(t,c)||(this.#l(),this.#t.onPointerExit())}#l(){this.#r=null,this.#n=null,this.#i()}#c(t,r,n){const o=this.#e;switch(n){case"top":return[[Math.min(t.left,r.left)-o,t.top],[Math.min(t.left,r.left)-o,r.bottom],[Math.max(t.right,r.right)+o,r.bottom],[Math.max(t.right,r.right)+o,t.top]];case"bottom":return[[Math.min(t.left,r.left)-o,t.bottom],[Math.min(t.left,r.left)-o,r.top],[Math.max(t.right,r.right)+o,r.top],[Math.max(t.right,r.right)+o,t.bottom]];case"left":return[[t.left,Math.min(t.top,r.top)-o],[r.right,Math.min(t.top,r.top)-o],[r.right,Math.max(t.bottom,r.bottom)+o],[t.left,Math.max(t.bottom,r.bottom)+o]];case"right":return[[t.right,Math.min(t.top,r.top)-o],[r.left,Math.min(t.top,r.top)-o],[r.left,Math.max(t.bottom,r.bottom)+o],[t.right,Math.max(t.bottom,r.bottom)+o]]}}#u(t,r,n,o){const i=this.#e*4,[s,a]=t;switch(o==="trigger"?this.#d(n):n){case"top":return[[s-i,a+i],[s+i,a+i],[r.right+i,r.bottom],[r.right+i,r.top],[r.left-i,r.top],[r.left-i,r.bottom]];case"bottom":return[[s-i,a-i],[s+i,a-i],[r.right+i,r.top],[r.right+i,r.bottom],[r.left-i,r.bottom],[r.left-i,r.top]];case"left":return[[s+i,a-i],[s+i,a+i],[r.right,r.bottom+i],[r.left,r.bottom+i],[r.left,r.top-i],[r.right,r.top-i]];case"right":return[[s-i,a-i],[s-i,a+i],[r.left,r.bottom+i],[r.right,r.bottom+i],[r.right,r.top-i],[r.left,r.top-i]]}}#d(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}function Mm(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"onOpenChange",3,St),o=w(t,"onOpenChangeComplete",3,St);fs.create({variant:E(()=>"dialog"),open:E(()=>r(),a=>{r(a),n()(a)}),onOpenChangeComplete:E(()=>o())});var i=N(),s=A(i);B(s,()=>t.children??Q),y(e,i),F()}var Im=z("");function Dm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"disabled",3,!1),s=K(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const a=hs.create({variant:E(()=>"close"),id:E(()=>n()),ref:E(()=>o(),p=>o(p)),disabled:E(()=>!!i())}),l=P(()=>ht(s,a.props));var c=N(),d=A(c);{var f=p=>{var g=N(),v=A(g);B(v,()=>t.child,()=>({props:u(l)})),y(p,g)},h=p=>{var g=Im();wt(g,()=>({...u(l)}));var v=et(g);B(v,()=>t.children??Q),y(p,g)};nt(d,p=>{t.child?p(f):p(h,!1)})}y(e,c),F()}var Fm=z(" ",1),Rm=z("
",1);function Lm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"forceMount",3,!1),s=w(t,"onCloseAutoFocus",3,St),a=w(t,"onOpenAutoFocus",3,St),l=w(t,"onEscapeKeydown",3,St),c=w(t,"onInteractOutside",3,St),d=w(t,"trapFocus",3,!0),f=w(t,"preventScroll",3,!0),h=w(t,"restoreScrollDelay",3,null),p=K(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const g=vs.create({id:E(()=>n()),ref:E(()=>o(),C=>o(C))}),v=P(()=>ht(p,g.props));var m=N(),b=A(m);{var O=C=>{lu(C,{get ref(){return g.opts.ref},loop:!0,get trapFocus(){return d()},get enabled(){return g.root.opts.open.current},get onOpenAutoFocus(){return a()},get onCloseAutoFocus(){return s()},focusScope:(T,k)=>{let R=()=>k?.().props;au(T,U(()=>u(v),{get enabled(){return g.root.opts.open.current},get ref(){return g.opts.ref},onEscapeKeydown:S=>{l()(S),!S.defaultPrevented&&g.root.handleClose()},children:(S,L)=>{su(S,U(()=>u(v),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},onInteractOutside:V=>{c()(V),!V.defaultPrevented&&g.root.handleClose()},children:(V,ct)=>{cu(V,U(()=>u(v),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},children:(st,_t)=>{var G=N(),Y=A(G);{var W=X=>{var ot=Fm(),I=A(ot);{var $=ft=>{bo(ft,{get preventScroll(){return f()},get restoreScrollDelay(){return h()}})};nt(I,ft=>{g.root.opts.open.current&&ft($)})}var it=j(I,2);{let ft=P(()=>({props:ht(u(v),R()),...g.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(X,ot)},Z=X=>{var ot=Rm(),I=A(ot);bo(I,{get preventScroll(){return f()}});var $=j(I,2);wt($,ft=>({...ft}),[()=>ht(u(v),R())]);var it=et($);B(it,()=>t.children??Q),y(X,ot)};nt(Y,X=>{t.child?X(W):X(Z,!1)})}y(st,G)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};nt(b,C=>{(g.shouldRender||i())&&C(O)})}y(e,m),F()}function zm(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"dir",3,"ltr"),o=w(t,"onOpenChange",3,St),i=w(t,"onOpenChangeComplete",3,St),s=w(t,"_internal_variant",3,"dropdown-menu");const a=_s.create({variant:E(()=>s()),dir:E(()=>n()),onClose:()=>{r(!1),o()(!1)}});xs.create({open:E(()=>r(),l=>{r(l),o()(l)}),onOpenChangeComplete:E(()=>i())},a),xu(e,{children:(l,c)=>{var d=N(),f=A(d);B(f,()=>t.children??Q),y(l,d)},$$slots:{default:!0}}),F()}var Vm=z("
"),Bm=z("
");function Wm(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"loop",3,!0),s=w(t,"onInteractOutside",3,St),a=w(t,"onEscapeKeydown",3,St),l=w(t,"onCloseAutoFocus",3,St),c=w(t,"forceMount",3,!1),d=w(t,"trapFocus",3,!1),f=K(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const h=Ss.create({id:E(()=>n()),loop:E(()=>i()),ref:E(()=>o(),x=>o(x)),onCloseAutoFocus:E(()=>l())}),p=P(()=>ht(f,h.props));function g(x){if(h.handleInteractOutside(x),!x.defaultPrevented&&(s()(x),!x.defaultPrevented)){if(x.target&&x.target instanceof Element){const T=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(x.target.closest(T))return}h.parentMenu.onClose()}}function v(x){a()(x),!x.defaultPrevented&&h.parentMenu.onClose()}var m=N(),b=A(m);{var O=x=>{Tu(x,U(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:v,get trapFocus(){return d()},get loop(){return i()},forceMount:!0,get id(){return n()},get shouldRender(){return h.shouldRender},popper:(k,R)=>{let S=()=>R?.().props,L=()=>R?.().wrapperProps;const V=P(()=>ht(S(),{style:xo("dropdown-menu")},{style:t.style}));var ct=N(),st=A(ct);{var _t=Y=>{var W=N(),Z=A(W);{let X=P(()=>({props:u(V),wrapperProps:L(),...h.snippetProps}));B(Z,()=>t.child,()=>u(X))}y(Y,W)},G=Y=>{var W=Vm();wt(W,()=>({...L()}));var Z=et(W);wt(Z,()=>({...u(V)}));var X=et(Z);B(X,()=>t.children??Q),y(Y,W)};nt(st,Y=>{t.child?Y(_t):Y(G,!1)})}y(k,ct)},$$slots:{popper:!0}}))},C=x=>{Pu(x,U(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:v,get trapFocus(){return d()},get loop(){return i()},forceMount:!1,get id(){return n()},get shouldRender(){return h.shouldRender},popper:(k,R)=>{let S=()=>R?.().props,L=()=>R?.().wrapperProps;const V=P(()=>ht(S(),{style:xo("dropdown-menu")},{style:t.style}));var ct=N(),st=A(ct);{var _t=Y=>{var W=N(),Z=A(W);{let X=P(()=>({props:u(V),wrapperProps:L(),...h.snippetProps}));B(Z,()=>t.child,()=>u(X))}y(Y,W)},G=Y=>{var W=Bm();wt(W,()=>({...L()}));var Z=et(W);wt(Z,()=>({...u(V)}));var X=et(Z);B(X,()=>t.children??Q),y(Y,W)};nt(st,Y=>{t.child?Y(_t):Y(G,!1)})}y(k,ct)},$$slots:{popper:!0}}))};nt(b,x=>{c()?x(O):c()||x(C,1)})}y(e,m),F()}var Hm=z("");function Um(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"disabled",3,!1),s=w(t,"type",3,"button"),a=K(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Cs.create({id:E(()=>n()),disabled:E(()=>i()??!1),ref:E(()=>o(),d=>o(d))}),c=P(()=>ht(a,l.props,{type:s()}));pm(e,{get id(){return n()},get ref(){return l.opts.ref},children:(d,f)=>{var h=N(),p=A(h);{var g=m=>{var b=N(),O=A(b);B(O,()=>t.child,()=>({props:u(c)})),y(m,b)},v=m=>{var b=Hm();wt(b,()=>({...u(c)}));var O=et(b);B(O,()=>t.children??Q),y(m,b)};nt(p,m=>{t.child?m(g):m(v,!1)})}y(d,h)},$$slots:{default:!0}}),F()}class Xr{#t;#e;constructor(t,r){this.#t=t,this.#e=r,this.handler=this.handler.bind(this),gt(this.handler)}handler(){let t=0;const r=this.#t();if(!r)return;const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(this.#e)});return n.observe(r),()=>{window.cancelAnimationFrame(t),n.unobserve(r)}}}class Cu{state;#t;constructor(t,r){this.state=qt(t),this.#t=r,this.dispatch=this.dispatch.bind(this)}#e(t){return this.#t[this.state.current][t]??this.state.current}dispatch(t){this.state.current=this.#e(t)}}const ol=new WeakMap,Km=16,jm={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}};class Gm{opts;#t=M("none");get prevAnimationNameState(){return u(this.#t)}set prevAnimationNameState(t){_(this.#t,t,!0)}#e=M(It({display:"",animationName:"none"}));get styles(){return u(this.#e)}set styles(t){_(this.#e,t,!0)}initialStatus;previousPresent;machine;present;constructor(t){this.opts=t,this.present=this.opts.open,this.initialStatus=t.open.current?"mounted":"unmounted",this.previousPresent=new Op(()=>this.present.current),this.machine=new Cu(this.initialStatus,jm),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),Ym(this),Xm(this),qm(this)}handleAnimationEnd(t){if(!this.opts.ref.current)return;const r=this.styles.animationName||Co(this.opts.ref.current),n=r.includes(t.animationName)||r==="none";t.target===this.opts.ref.current&&n&&this.machine.dispatch("ANIMATION_END")}handleAnimationStart(t){if(this.opts.ref.current&&t.target===this.opts.ref.current){const r=Co(this.opts.ref.current,!0);this.prevAnimationNameState=r,this.styles.animationName=r}}#r=P(()=>["mounted","unmountSuspended"].includes(this.machine.state.current));get isPresent(){return u(this.#r)}set isPresent(t){_(this.#r,t)}}function Ym(e){Pt(()=>e.present.current,()=>{if(!e.opts.ref.current||!(e.present.current!==e.previousPresent.current))return;const r=e.prevAnimationNameState,n=Co(e.opts.ref.current,!0);if(e.styles.animationName=n,e.present.current)e.machine.dispatch("MOUNT");else if(n==="none"||e.styles.display==="none")e.machine.dispatch("UNMOUNT");else{const o=r!==n;e.previousPresent.current&&o?e.machine.dispatch("ANIMATION_OUT"):e.machine.dispatch("UNMOUNT")}})}function Xm(e){Pt(()=>e.machine.state.current,()=>{if(!e.opts.ref.current)return;const t=e.machine.state.current==="mounted"?Co(e.opts.ref.current,!0):"none";e.prevAnimationNameState=t,e.styles.animationName=t})}function qm(e){Pt(()=>e.opts.ref.current,()=>{if(!e.opts.ref.current)return;const t=getComputedStyle(e.opts.ref.current);return e.styles={display:t.display,animationName:t.animationName||"none"},Ve(dt(e.opts.ref.current,"animationstart",e.handleAnimationStart),dt(e.opts.ref.current,"animationcancel",e.handleAnimationEnd),dt(e.opts.ref.current,"animationend",e.handleAnimationEnd))})}function Co(e,t=!1){if(!e)return"none";const r=performance.now(),n=ol.get(e);if(!t&&n&&r-n.timestampt.open),ref:t.ref});var n=N(),o=A(n);{var i=s=>{var a=N(),l=A(a);B(l,()=>t.presence??Q,()=>({present:r.isPresent})),y(s,a)};nt(o,s=>{(t.forceMount||t.open||r.isPresent)&&s(i)})}y(e,n),F()}function Zm(e,t,r){return Math.min(r,Math.max(t,e))}const Wn=Vn({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),Hn=new Zt("ScrollArea.Root"),Un=new Zt("ScrollArea.Scrollbar"),Yo=new Zt("ScrollArea.ScrollbarVisible"),Us=new Zt("ScrollArea.ScrollbarAxis"),Au=new Zt("ScrollArea.ScrollbarShared");class Ks{static create(t){return Hn.set(new Ks(t))}opts;attachment;#t=M(null);get scrollAreaNode(){return u(this.#t)}set scrollAreaNode(t){_(this.#t,t,!0)}#e=M(null);get viewportNode(){return u(this.#e)}set viewportNode(t){_(this.#e,t,!0)}#r=M(null);get contentNode(){return u(this.#r)}set contentNode(t){_(this.#r,t,!0)}#n=M(null);get scrollbarXNode(){return u(this.#n)}set scrollbarXNode(t){_(this.#n,t,!0)}#o=M(null);get scrollbarYNode(){return u(this.#o)}set scrollbarYNode(t){_(this.#o,t,!0)}#i=M(0);get cornerWidth(){return u(this.#i)}set cornerWidth(t){_(this.#i,t,!0)}#a=M(0);get cornerHeight(){return u(this.#a)}set cornerHeight(t){_(this.#a,t,!0)}#s=M(!1);get scrollbarXEnabled(){return u(this.#s)}set scrollbarXEnabled(t){_(this.#s,t,!0)}#l=M(!1);get scrollbarYEnabled(){return u(this.#l)}set scrollbarYEnabled(t){_(this.#l,t,!0)}domContext;constructor(t){this.opts=t,this.attachment=Ot(t.ref,r=>this.scrollAreaNode=r),this.domContext=new zn(t.ref)}#c=P(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:"relative","--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[Wn.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(t){_(this.#c,t)}}class js{static create(t){return new js(t,Hn.get())}opts;root;attachment;#t=qt(Qr());#e=qt(null);contentAttachment=Ot(this.#e,t=>this.root.contentNode=t);constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(t.ref,n=>this.root.viewportNode=n)}#r=P(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[Wn.viewport]:"",...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}#n=P(()=>({id:this.#t.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return u(this.#n)}set contentProps(t){_(this.#n,t)}}class Gs{static create(t){return Un.set(new Gs(t,Hn.get()))}opts;root;#t=P(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#t)}set isHorizontal(t){_(this.#t,t)}#e=M(!1);get hasThumb(){return u(this.#e)}set hasThumb(t){_(this.#e,t,!0)}constructor(t,r){this.opts=t,this.root=r,Pt(()=>this.isHorizontal,n=>n?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class Ys{static create(){return new Ys(Un.get())}scrollbar;root;#t=M(!1);get isVisible(){return u(this.#t)}set isVisible(t){_(this.#t,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root,gt(()=>{const r=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current;let o=0;if(!r)return;const i=()=>{this.root.domContext.clearTimeout(o),Bt(()=>this.isVisible=!0)},s=()=>{o&&this.root.domContext.clearTimeout(o),o=this.root.domContext.setTimeout(()=>{Bt(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)},a=Ve(dt(r,"pointerenter",i),dt(r,"pointerleave",s));return()=>{this.root.domContext.getWindow().clearTimeout(o),a()}})}#e=P(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Xs{static create(){return new Xs(Un.get())}scrollbar;root;machine=new Cu("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});#t=P(()=>this.machine.state.current==="hidden");get isHidden(){return u(this.#t)}set isHidden(t){_(this.#t,t)}constructor(t){this.scrollbar=t,this.root=t.root;const r=Vo(()=>this.machine.dispatch("SCROLL_END"),100);gt(()=>{const n=this.machine.state.current,o=this.root.opts.scrollHideDelay.current;if(n==="idle"){const i=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),o);return()=>this.root.domContext.clearTimeout(i)}}),gt(()=>{const n=this.root.viewportNode;if(!n)return;const o=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let i=n[o];return dt(n,"scroll",()=>{const l=n[o];i!==l&&(this.machine.dispatch("SCROLL"),r()),i=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(t){this.machine.dispatch("POINTER_ENTER")}onpointerleave(t){this.machine.dispatch("POINTER_LEAVE")}#e=P(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class Xo{static create(){return new Xo(Un.get())}scrollbar;root;#t=M(!1);get isVisible(){return u(this.#t)}set isVisible(t){_(this.#t,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root;const r=Vo(()=>{const n=this.root.viewportNode;if(!n)return;const o=n.offsetWidththis.root.viewportNode,r),new Xr(()=>this.root.contentNode,r)}#e=P(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}}class qs{static create(){return Yo.set(new qs(Un.get()))}scrollbar;root;#t=M(null);get thumbNode(){return u(this.#t)}set thumbNode(t){_(this.#t,t,!0)}#e=M(0);get pointerOffset(){return u(this.#e)}set pointerOffset(t){_(this.#e,t,!0)}#r=M({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return u(this.#r)}set sizes(t){_(this.#r,t)}#n=P(()=>ku(this.sizes.viewport,this.sizes.content));get thumbRatio(){return u(this.#n)}set thumbRatio(t){_(this.#n,t)}#o=P(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return u(this.#o)}set hasThumb(t){_(this.#o,t)}#i=M("");get prevTransformStyle(){return u(this.#i)}set prevTransformStyle(t){_(this.#i,t,!0)}constructor(t){this.scrollbar=t,this.root=t.root,gt(()=>{this.scrollbar.hasThumb=this.hasThumb}),gt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(t){this.sizes=t}getScrollPosition(t,r){return Jm({pointerPos:t,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:r})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(t){this.pointerOffset=t}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const t=this.root.viewportNode.scrollLeft,n=`translate3d(${il({scrollPos:t,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}xOnWheelScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=t)}xOnDragScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(t,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const t=this.root.viewportNode.scrollTop,n=`translate3d(0, ${il({scrollPos:t,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=n,this.prevTransformStyle=n}yOnWheelScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollTop=t)}yOnDragScroll(t){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(t,this.root.opts.dir.current))}}class Zs{static create(t){return Us.set(new Zs(t,Yo.get()))}opts;scrollbarVis;root;scrollbar;attachment;#t=M();get computedStyle(){return u(this.#t)}set computedStyle(t){_(this.#t,t,!0)}constructor(t,r){this.opts=t,this.scrollbarVis=r,this.root=r.root,this.scrollbar=r.scrollbar,this.attachment=Ot(this.scrollbar.opts.ref,n=>this.root.scrollbarXNode=n),gt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),gt(()=>{this.onResize()})}onThumbPointerDown=t=>{this.scrollbarVis.onThumbPointerDown(t.x)};onDragScroll=t=>{this.scrollbarVis.xOnDragScroll(t.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(t,r)=>{if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollLeft+t.deltaX;this.scrollbarVis.xOnWheelScroll(n),Ou(n,r)&&t.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:Ao(this.computedStyle.paddingLeft),paddingEnd:Ao(this.computedStyle.paddingRight)}})};#e=P(()=>qo(this.scrollbarVis.sizes));get thumbSize(){return u(this.#e)}set thumbSize(t){_(this.#e,t)}#r=P(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"horizontal",style:{bottom:0,left:this.root.opts.dir.current==="rtl"?"var(--bits-scroll-area-corner-width)":0,right:this.root.opts.dir.current==="ltr"?"var(--bits-scroll-area-corner-width)":0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Js{static create(t){return Us.set(new Js(t,Yo.get()))}opts;scrollbarVis;root;scrollbar;attachment;#t=M();get computedStyle(){return u(this.#t)}set computedStyle(t){_(this.#t,t,!0)}constructor(t,r){this.opts=t,this.scrollbarVis=r,this.root=r.root,this.scrollbar=r.scrollbar,this.attachment=Ot(this.scrollbar.opts.ref,n=>this.root.scrollbarYNode=n),gt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),gt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(t){this.scrollbarVis.onThumbPointerDown(t.y)}onDragScroll(t){this.scrollbarVis.yOnDragScroll(t.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(t,r){if(!this.root.viewportNode)return;const n=this.root.viewportNode.scrollTop+t.deltaY;this.scrollbarVis.yOnWheelScroll(n),Ou(n,r)&&t.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:Ao(this.computedStyle.paddingTop),paddingEnd:Ao(this.computedStyle.paddingBottom)}})}#e=P(()=>qo(this.scrollbarVis.sizes));get thumbSize(){return u(this.#e)}set thumbSize(t){_(this.#e,t)}#r=P(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"vertical",style:{top:0,right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:"var(--bits-scroll-area-corner-height)","--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#r)}set props(t){_(this.#r,t)}}class Qs{static create(){return Au.set(new Qs(Us.get()))}scrollbarState;root;scrollbarVis;scrollbar;#t=M(null);get rect(){return u(this.#t)}set rect(t){_(this.#t,t)}#e=M("");get prevWebkitUserSelect(){return u(this.#e)}set prevWebkitUserSelect(t){_(this.#e,t,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#r=P(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return u(this.#r)}set maxScrollPos(t){_(this.#r,t)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=Vo(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,gt(()=>{const r=this.maxScrollPos,n=this.scrollbar.opts.ref.current;this.root.viewportNode;const o=s=>{const a=s.target;n?.contains(a)&&this.handleWheelScroll(s,r)};return dt(this.root.domContext.getDocument(),"wheel",o,{passive:!1})}),re(()=>{this.scrollbarVis.sizes,Bt(()=>this.handleThumbPositionChange())}),new Xr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Xr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(t){if(!this.rect)return;const r=t.clientX-this.rect.left,n=t.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:r,y:n})}#n(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(t){if(t.button!==0)return;t.target.setPointerCapture(t.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(t)}onpointermove(t){this.handleDragScroll(t)}onpointerup(t){const r=t.target;r.hasPointerCapture(t.pointerId)&&r.releasePointerCapture(t.pointerId),this.#n()}onlostpointercapture(t){this.#n()}#o=P(()=>ht({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[Wn.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return u(this.#o)}set props(t){_(this.#o,t)}}class $s{static create(t){return new $s(t,Au.get())}opts;scrollbarState;attachment;#t;#e=M();#r=Vo(()=>{u(this.#e)&&(u(this.#e)(),_(this.#e,void 0))},100);constructor(t,r){this.opts=t,this.scrollbarState=r,this.#t=r.root,this.attachment=Ot(this.opts.ref,n=>this.scrollbarState.scrollbarVis.thumbNode=n),gt(()=>{const n=this.#t.viewportNode;if(!n)return;const o=()=>{if(this.#r(),!u(this.#e)){const s=Qm(n,this.scrollbarState.handleThumbPositionChange);_(this.#e,s,!0),this.scrollbarState.handleThumbPositionChange()}};return Bt(()=>this.scrollbarState.handleThumbPositionChange()),dt(n,"scroll",o)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(t){const r=t.target;if(!r)return;const n=r.getBoundingClientRect(),o=t.clientX-n.left,i=t.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:o,y:i})}onpointerup(t){this.scrollbarState.handleThumbPointerUp()}#n=P(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?"visible":"hidden",style:{width:"var(--bits-scroll-area-thumb-width)",height:"var(--bits-scroll-area-thumb-height)",transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[Wn.thumb]:"",...this.attachment}));get props(){return u(this.#n)}set props(t){_(this.#n,t)}}class ta{static create(t){return new ta(t,Hn.get())}opts;root;attachment;#t=M(0);#e=M(0);#r=P(()=>!!(u(this.#t)&&u(this.#e)));get hasSize(){return u(this.#r)}set hasSize(t){_(this.#r,t)}constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref),new Xr(()=>this.root.scrollbarXNode,()=>{const n=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=n,_(this.#e,n,!0)}),new Xr(()=>this.root.scrollbarYNode,()=>{const n=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=n,_(this.#t,n,!0)})}#n=P(()=>({id:this.opts.id.current,style:{width:u(this.#t),height:u(this.#e),position:"absolute",right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:0},[Wn.corner]:"",...this.attachment}));get props(){return u(this.#n)}set props(t){_(this.#n,t)}}function Ao(e){return e?Number.parseInt(e,10):0}function ku(e,t){const r=e/t;return Number.isNaN(r)?0:r}function qo(e){const t=ku(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Jm({pointerPos:e,pointerOffset:t,sizes:r,dir:n="ltr"}){const o=qo(r),i=o/2,s=t||i,a=o-s,l=r.scrollbar.paddingStart+s,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return Eu([l,c],f)(e)}function il({scrollPos:e,sizes:t,dir:r="ltr"}){const n=qo(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-n,l=r==="ltr"?[0,s]:[s*-1,0],c=Zm(e,l[0],l[1]);return Eu([0,s],[0,a])(c)}function Eu(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Ou(e,t){return e>0&&eo.cancelAnimationFrame(n)}var $m=z("
");function tb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=w(t,"type",3,"hover"),s=w(t,"dir",3,"ltr"),a=w(t,"scrollHideDelay",3,600),l=K(t,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=Ks.create({type:E(()=>i()),dir:E(()=>s()),scrollHideDelay:E(()=>a()),id:E(()=>o()),ref:E(()=>n(),v=>n(v))}),d=P(()=>ht(l,c.props));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=$m();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}var eb=z("
");function rb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","children"]);const s=js.create({id:E(()=>o()),ref:E(()=>n(),h=>n(h))}),a=P(()=>ht(i,s.props)),l=P(()=>ht({},s.contentProps));var c=eb();wt(c,()=>({...u(a)}));var d=et(c);wt(d,()=>({...u(l)}));var f=et(d);B(f,()=>t.children??Q),y(e,c),F()}var nb=z("
");function Nu(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy","child","children"]);const n=Qs.create(),o=P(()=>ht(r,n.props));var i=N(),s=A(i);{var a=c=>{var d=N(),f=A(d);B(f,()=>t.child,()=>({props:u(o)})),y(c,d)},l=c=>{var d=nb();wt(d,()=>({...u(o)}));var f=et(d);B(f,()=>t.children??Q),y(c,d)};nt(s,c=>{t.child?c(a):c(l,!1)})}y(e,i),F()}function ob(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=new ss,o=Zs.create({mounted:E(()=>n.current)}),i=P(()=>ht(r,o.props));Nu(e,U(()=>u(i))),F()}function ib(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=new ss,o=Js.create({mounted:E(()=>n.current)}),i=P(()=>ht(r,o.props));Nu(e,U(()=>u(i))),F()}function Zo(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=qs.create();var o=N(),i=A(o);{var s=l=>{ob(l,U(()=>r))},a=l=>{ib(l,U(()=>r))};nt(i,l=>{n.scrollbar.opts.orientation.current==="horizontal"?l(s):l(a,!1)})}y(e,o),F()}function sb(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Xo.create(),i=P(()=>ht(n,o.props));{const s=l=>{Zo(l,U(()=>u(i)))};let a=P(()=>r()||o.isVisible);Go(e,{get open(){return u(a)},get ref(){return o.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}})}F()}function ab(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Xs.create(),i=P(()=>ht(n,o.props));{const s=l=>{Zo(l,U(()=>u(i)))};let a=P(()=>r()||!o.isHidden);Go(e,U(()=>u(i),{get open(){return u(a)},get ref(){return o.scrollbar.opts.ref},presence:s,$$slots:{presence:!0}}))}F()}function lb(e,t){D(t,!0);let r=w(t,"forceMount",3,!1),n=K(t,["$$slots","$$events","$$legacy","forceMount"]);const o=Ys.create(),i=Xo.create(),s=P(()=>ht(n,o.props,i.props,{"data-state":o.isVisible?"visible":"hidden"})),a=P(()=>r()||o.isVisible&&i.isVisible);Go(e,{get open(){return u(a)},get ref(){return i.scrollbar.opts.ref},presence:c=>{Zo(c,U(()=>u(s)))},$$slots:{presence:!0}}),F()}function cb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id","orientation"]);const s=Gs.create({orientation:E(()=>t.orientation),id:E(()=>o()),ref:E(()=>n(),g=>n(g))}),a=P(()=>s.root.opts.type.current);var l=N(),c=A(l);{var d=g=>{lb(g,U(()=>i,{get id(){return o()}}))},f=g=>{ab(g,U(()=>i,{get id(){return o()}}))},h=g=>{sb(g,U(()=>i,{get id(){return o()}}))},p=g=>{Zo(g,U(()=>i,{get id(){return o()}}))};nt(c,g=>{u(a)==="hover"?g(d):u(a)==="scroll"?g(f,1):u(a)==="auto"?g(h,2):u(a)==="always"&&g(p,3)})}y(e,l),F()}var ub=z("
");function db(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const o=new ss,i=$s.create({id:E(()=>t.id),ref:E(()=>r(),f=>r(f)),mounted:E(()=>o.current)}),s=P(()=>ht(n,i.props,{style:{hidden:!t.present}}));var a=N(),l=A(a);{var c=f=>{var h=N(),p=A(h);B(p,()=>t.child,()=>({props:u(s)})),y(f,h)},d=f=>{var h=ub();wt(h,()=>({...u(s)}));var p=et(h);B(p,()=>t.children??Q),y(f,h)};nt(l,f=>{t.child?f(c):f(d,!1)})}y(e,a),F()}function fb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"forceMount",3,!1),s=K(t,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const a=Yo.get();{const l=(d,f)=>{let h=()=>f?.().present;db(d,U(()=>s,{get id(){return n()},get present(){return h()},get ref(){return o()},set ref(p){o(p)}}))};let c=P(()=>i()||a.hasThumb);Go(e,{get open(){return u(c)},get ref(){return a.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}F()}var hb=z("
");function pb(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","id","children","child"]);const o=ta.create({id:E(()=>t.id),ref:E(()=>r(),d=>r(d))}),i=P(()=>ht(n,o.props));var s=N(),a=A(s);{var l=d=>{var f=N(),h=A(f);B(h,()=>t.child,()=>({props:u(i)})),y(d,f)},c=d=>{var f=hb();wt(f,()=>({...u(i)}));var h=et(f);B(h,()=>t.children??Q),y(d,f)};nt(a,d=>{t.child?d(l):d(c,!1)})}y(e,s),F()}function gb(e,t){const r=Kt();D(t,!0);let n=w(t,"ref",15,null),o=w(t,"id",19,()=>jt(r)),i=K(t,["$$slots","$$events","$$legacy","ref","id"]);const s=Hn.get(),a=P(()=>!!(s.scrollbarXNode&&s.scrollbarYNode)),l=P(()=>s.opts.type.current!=="scroll"&&u(a));var c=N(),d=A(c);{var f=h=>{pb(h,U(()=>i,{get id(){return o()},get ref(){return n()},set ref(p){n(p)}}))};nt(d,h=>{u(l)&&h(f)})}y(e,c),F()}class Fi{#t;#e;#r=null;constructor(t,r){this.#e=t,this.#t=r,this.stop=this.stop.bind(this),this.start=this.start.bind(this),Rr(this.stop)}#n(){this.#r!==null&&(window.clearTimeout(this.#r),this.#r=null)}stop(){this.#n()}start(...t){this.#n(),this.#r=window.setTimeout(()=>{this.#r=null,this.#e(...t)},this.#t)}}const Mu=Vn({component:"tooltip",parts:["content","trigger"]}),Iu=new Zt("Tooltip.Provider"),ea=new Zt("Tooltip.Root");class vb{#t=M(It(new Map));get triggers(){return u(this.#t)}set triggers(t){_(this.#t,t,!0)}#e=M(null);get activeTriggerId(){return u(this.#e)}set activeTriggerId(t){_(this.#e,t,!0)}#r=P(()=>{const t=this.activeTriggerId;return t===null?null:this.triggers.get(t)?.node??null});get activeTriggerNode(){return u(this.#r)}set activeTriggerNode(t){_(this.#r,t)}#n=P(()=>{const t=this.activeTriggerId;return t===null?null:this.triggers.get(t)?.payload??null});get activePayload(){return u(this.#n)}set activePayload(t){_(this.#n,t)}register=t=>{const r=new Map(this.triggers);r.set(t.id,t),this.triggers=r,this.#o()};update=t=>{const r=new Map(this.triggers);r.set(t.id,t),this.triggers=r,this.#o()};unregister=t=>{if(!this.triggers.has(t))return;const r=new Map(this.triggers);r.delete(t),this.triggers=r,this.activeTriggerId===t&&(this.activeTriggerId=null)};setActiveTrigger=t=>{if(t===null){this.activeTriggerId=null;return}if(!this.triggers.has(t)){this.activeTriggerId=null;return}this.activeTriggerId=t};get=t=>this.triggers.get(t);has=t=>this.triggers.has(t);getFirstTriggerId=()=>{const t=this.triggers.entries().next();return t.done?null:t.value[0]};#o=()=>{const t=this.activeTriggerId;t!==null&&(this.triggers.has(t)||(this.activeTriggerId=null))}}class ra{static create(t){return Iu.set(new ra(t))}opts;#t=M(!0);get isOpenDelayed(){return u(this.#t)}set isOpenDelayed(t){_(this.#t,t,!0)}isPointerInTransit=qt(!1);#e;#r=M(null);constructor(t){this.opts=t,this.#e=new Fi(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current),as(()=>dt(window,"scroll",r=>{const n=u(this.#r);if(!n)return;const o=n.triggerNode;if(!o)return;const i=r.target;(i instanceof Element||i instanceof Document)&&i.contains(o)&&n.handleClose()}))}#n=()=>{if(this.opts.skipDelayDuration.current===0){this.isOpenDelayed=!0;return}else this.#e.start()};#o=()=>{this.#e.stop()};onOpen=t=>{u(this.#r)&&u(this.#r)!==t&&u(this.#r).handleClose(),this.#o(),this.isOpenDelayed=!1,_(this.#r,t,!0)};onClose=t=>{u(this.#r)===t&&_(this.#r,null),this.#n()};isTooltipOpen=t=>u(this.#r)===t}class na{static create(t){return ea.set(new na(t,Iu.get()))}opts;provider;#t=P(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return u(this.#t)}set delayDuration(t){_(this.#t,t)}#e=P(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return u(this.#e)}set disableHoverableContent(t){_(this.#e,t)}#r=P(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return u(this.#r)}set disableCloseOnTriggerClick(t){_(this.#r,t)}#n=P(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return u(this.#n)}set disabled(t){_(this.#n,t)}#o=P(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return u(this.#o)}set ignoreNonKeyboardFocus(t){_(this.#o,t)}registry;tether;#i=M(null);get contentNode(){return u(this.#i)}set contentNode(t){_(this.#i,t,!0)}contentPresence;#a=M(!1);#s;#l=P(()=>this.opts.open.current?u(this.#a)?"delayed-open":"instant-open":"closed");get stateAttr(){return u(this.#l)}set stateAttr(t){_(this.#l,t)}constructor(t,r){this.opts=t,this.provider=r,this.tether=t.tether.current?.state??null,this.registry=this.tether?.registry??new vb,this.#s=new Fi(()=>{_(this.#a,!0),this.opts.open.current=!0},this.delayDuration??0),this.tether&&(this.tether.root=this,as(()=>()=>{this.tether?.root===this&&(this.tether.root=null)})),this.contentPresence=new fo({open:this.opts.open,ref:E(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Pt(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new Fi(()=>{_(this.#a,!0),this.opts.open.current=!0},this.delayDuration))}),Pt(()=>this.opts.open.current,n=>{n?(this.ensureActiveTrigger(),this.provider.onOpen(this)):this.provider.onClose(this)},{lazy:!0}),Pt(()=>this.opts.triggerId.current,n=>{n!==this.registry.activeTriggerId&&this.registry.setActiveTrigger(n)}),Pt(()=>this.registry.activeTriggerId,n=>{this.opts.triggerId.current!==n&&(this.opts.triggerId.current=n)})}handleOpen=()=>{this.#s.stop(),_(this.#a,!1),this.ensureActiveTrigger(),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#c=()=>{this.#s.stop();const t=!this.provider.isOpenDelayed,r=this.delayDuration??0;t||r===0?(_(this.#a,!1),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=t=>{this.setActiveTrigger(t),this.#c()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()};ensureActiveTrigger=()=>{if(this.registry.activeTriggerId!==null&&this.registry.has(this.registry.activeTriggerId))return;if(this.opts.triggerId.current!==null&&this.registry.has(this.opts.triggerId.current)){this.registry.setActiveTrigger(this.opts.triggerId.current);return}const t=this.registry.getFirstTriggerId();this.registry.setActiveTrigger(t)};setActiveTrigger=t=>{this.registry.setActiveTrigger(t)};registerTrigger=t=>{this.registry.register(t),t.disabled&&this.registry.activeTriggerId===t.id&&this.opts.open.current&&this.handleClose()};updateTrigger=t=>{this.registry.update(t),t.disabled&&this.registry.activeTriggerId===t.id&&this.opts.open.current&&this.handleClose()};unregisterTrigger=t=>{const r=this.registry.activeTriggerId===t;this.registry.unregister(t),r&&this.opts.open.current&&this.handleClose()};isActiveTrigger=t=>this.registry.activeTriggerId===t;get triggerNode(){return this.registry.activeTriggerNode}get activePayload(){return this.registry.activePayload}get activeTriggerId(){return this.registry.activeTriggerId}}class ko{static create(t){return t.tether.current?new ko(t,null,t.tether.current.state):new ko(t,ea.get(),null)}opts;root;tether;attachment;#t=qt(!1);#e=M(!1);domContext;#r=null;#n=!1;#o=null;constructor(t,r,n){this.opts=t,this.root=r,this.tether=n,this.domContext=new zn(t.ref),this.attachment=Ot(this.opts.ref,o=>this.#s(o)),Pt(()=>this.opts.id.current,()=>{this.#s(this.opts.ref.current)}),Pt(()=>this.opts.payload.current,()=>{this.#s(this.opts.ref.current)}),Pt(()=>this.opts.disabled.current,()=>{this.#s(this.opts.ref.current)}),as(()=>(this.#n=!0,this.#s(this.opts.ref.current),()=>{const o=this.#i(),i=this.#o;i&&(this.tether?this.tether.registry.unregister(i):o?.unregisterTrigger(i)),this.#o=null,this.#n=!1}))}#i=()=>this.tether?.root??this.root;#a=()=>{const t=this.#i();return this.opts.disabled.current||!!t?.disabled};#s=t=>{if(!this.#n)return;const r=this.opts.id.current,n=this.opts.payload.current,o=this.opts.disabled.current;if(this.#o&&this.#o!==r){const a=this.#i();this.tether?this.tether.registry.unregister(this.#o):a?.unregisterTrigger(this.#o)}const i={id:r,node:t,payload:n,disabled:o},s=this.#i();this.tether?(this.tether.registry.has(r)?this.tether.registry.update(i):this.tether.registry.register(i),o&&this.tether.registry.activeTriggerId===r&&s?.opts.open.current&&s.handleClose()):s?.registry.has(r)?s.updateTrigger(i):s?.registerTrigger(i),this.#o=r};#l=()=>{this.#r!==null&&(clearTimeout(this.#r),this.#r=null)};handlePointerUp=()=>{this.#t.current=!1};#c=()=>{this.#a()||(this.#t.current=!1)};#u=()=>{this.#a()||(this.#t.current=!0,this.domContext.getDocument().addEventListener("pointerup",()=>{this.handlePointerUp()},{once:!0}))};#d=t=>{const r=this.#i();if(r){if(this.#a()){r.opts.open.current&&r.handleClose();return}if(t.pointerType!=="touch"){if(r.provider.isPointerInTransit.current){this.#l(),this.#r=window.setTimeout(()=>{r.provider.isPointerInTransit.current&&(r.provider.isPointerInTransit.current=!1,r.onTriggerEnter(this.opts.id.current),_(this.#e,!0))},250);return}r.onTriggerEnter(this.opts.id.current),_(this.#e,!0)}}};#h=t=>{const r=this.#i();if(r){if(this.#a()){r.opts.open.current&&r.handleClose();return}t.pointerType!=="touch"&&(u(this.#e)||(this.#l(),r.provider.isPointerInTransit.current=!1,r.onTriggerEnter(this.opts.id.current),_(this.#e,!0)))}};#p=t=>{const r=this.#i();if(!r||this.#a())return;if(this.#l(),!r.isActiveTrigger(this.opts.id.current)){_(this.#e,!1);return}const n=t.relatedTarget;if(De(n)&&r.provider.opts.skipDelayDuration.current>0){for(const o of r.registry.triggers.values())if(o.node===n){_(this.#e,!1);return}}r.onTriggerLeave(),_(this.#e,!1)};#f=t=>{const r=this.#i();if(r&&!this.#t.current){if(this.#a()){r.opts.open.current&&r.handleClose();return}r.ignoreNonKeyboardFocus&&!Zp(t.currentTarget)||(r.setActiveTrigger(this.opts.id.current),r.handleOpen())}};#g=()=>{const t=this.#i();!t||this.#a()||t.handleClose()};#v=()=>{const t=this.#i();!t||t.disableCloseOnTriggerClick||this.#a()||t.handleClose()};#m=P(()=>{const t=this.#i(),r=!!(t?.opts.open.current&&t.isActiveTrigger(this.opts.id.current)),n=this.#a();return{id:this.opts.id.current,"aria-describedby":r?t?.contentNode?.id:void 0,"data-state":r?t?.stateAttr:"closed","data-disabled":sr(n),"data-delay-duration":`${t?.delayDuration??0}`,[Mu.trigger]:"",tabindex:n?void 0:this.opts.tabindex.current,disabled:this.opts.disabled.current,onpointerup:this.#c,onpointerdown:this.#u,onpointerenter:this.#d,onpointermove:this.#h,onpointerleave:this.#p,onfocus:this.#f,onblur:this.#g,onclick:this.#v,...this.attachment}});get props(){return u(this.#m)}set props(t){_(this.#m,t)}}class oa{static create(t){return new oa(t,ea.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,n=>this.root.contentNode=n),new Nm({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,ignoredTargets:()=>{if(this.root.provider.opts.skipDelayDuration.current===0)return[];const n=[],o=this.root.triggerNode;for(const i of this.root.registry.triggers.values())i.node&&i.node!==o&&n.push(i.node);return n},onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()}})}onInteractOutside=t=>{if(De(t.target)&&this.root.triggerNode?.contains(t.target)&&this.root.disableCloseOnTriggerClick){t.preventDefault();return}this.opts.onInteractOutside.current(t),!t.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current?.(t),!t.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=t=>{t.preventDefault()};onCloseAutoFocus=t=>{t.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#t=P(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){_(this.#t,t)}#e=P(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":sr(this.root.disabled),style:{outline:"none"},[Mu.content]:"",...this.attachment}));get props(){return u(this.#e)}set props(t){_(this.#e,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}}function mb(e,t){D(t,!0);let r=w(t,"open",15,!1),n=w(t,"triggerId",15,null),o=w(t,"onOpenChange",3,St),i=w(t,"onOpenChangeComplete",3,St);const s=na.create({open:E(()=>r(),a=>{r(a),o()(a)}),triggerId:E(()=>n(),a=>{n(a)}),delayDuration:E(()=>t.delayDuration),disableCloseOnTriggerClick:E(()=>t.disableCloseOnTriggerClick),disableHoverableContent:E(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:E(()=>t.ignoreNonKeyboardFocus),disabled:E(()=>t.disabled),onOpenChangeComplete:E(()=>i()),tether:E(()=>t.tether)});xu(e,{tooltip:!0,children:(a,l)=>{var c=N(),d=A(c);B(d,()=>t.children??Q,()=>({open:s.opts.open.current,triggerId:s.activeTriggerId,payload:s.activePayload})),y(a,c)},$$slots:{default:!0}}),F()}var bb=z("
"),yb=z("
");function wb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"ref",15,null),i=w(t,"side",3,"top"),s=w(t,"sideOffset",3,0),a=w(t,"align",3,"center"),l=w(t,"avoidCollisions",3,!0),c=w(t,"arrowPadding",3,0),d=w(t,"sticky",3,"partial"),f=w(t,"hideWhenDetached",3,!1),h=w(t,"collisionPadding",3,0),p=w(t,"onInteractOutside",3,St),g=w(t,"onEscapeKeydown",3,St),v=w(t,"forceMount",3,!1),m=K(t,["$$slots","$$events","$$legacy","children","child","id","ref","side","sideOffset","align","avoidCollisions","arrowPadding","sticky","strategy","hideWhenDetached","customAnchor","collisionPadding","onInteractOutside","onEscapeKeydown","forceMount","style"]);const b=oa.create({id:E(()=>n()),ref:E(()=>o(),S=>o(S)),onInteractOutside:E(()=>p()),onEscapeKeydown:E(()=>g())}),O=P(()=>({side:i(),sideOffset:s(),align:a(),avoidCollisions:l(),arrowPadding:c(),sticky:d(),hideWhenDetached:f(),collisionPadding:h(),strategy:t.strategy,customAnchor:t.customAnchor??b.root.triggerNode})),C=P(()=>ht(m,u(O),b.props));var x=N(),T=A(x);{var k=S=>{{const L=(ct,st)=>{let _t=()=>st?.().props,G=()=>st?.().wrapperProps;const Y=P(()=>ht(_t(),{style:xo("tooltip")},{style:t.style}));var W=N(),Z=A(W);{var X=I=>{var $=N(),it=A($);{let ft=P(()=>({props:u(Y),wrapperProps:G(),...b.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(I,$)},ot=I=>{var $=bb();wt($,()=>({...G()}));var it=et($);wt(it,()=>({...u(Y)}));var ft=et(it);B(ft,()=>t.children??Q),y(I,$)};nt(Z,I=>{t.child?I(X):I(ot,!1)})}y(ct,W)};let V=P(()=>b.root.disableHoverableContent?"none":"auto");Tu(S,U(()=>u(C),()=>b.popperProps,{get enabled(){return b.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return b.opts.ref},tooltip:!0,get shouldRender(){return b.shouldRender},get contentPointerEvents(){return u(V)},popper:L,$$slots:{popper:!0}}))}},R=S=>{{const L=(ct,st)=>{let _t=()=>st?.().props,G=()=>st?.().wrapperProps;const Y=P(()=>ht(_t(),{style:xo("tooltip")},{style:t.style}));var W=N(),Z=A(W);{var X=I=>{var $=N(),it=A($);{let ft=P(()=>({props:u(Y),wrapperProps:G(),...b.snippetProps}));B(it,()=>t.child,()=>u(ft))}y(I,$)},ot=I=>{var $=yb();wt($,()=>({...G()}));var it=et($);wt(it,()=>({...u(Y)}));var ft=et(it);B(ft,()=>t.children??Q),y(I,$)};nt(Z,I=>{t.child?I(X):I(ot,!1)})}y(ct,W)};let V=P(()=>b.root.disableHoverableContent?"none":"auto");Pu(S,U(()=>u(C),()=>b.popperProps,{get open(){return b.root.opts.open.current},get id(){return n()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return b.opts.ref},tooltip:!0,get shouldRender(){return b.shouldRender},get contentPointerEvents(){return u(V)},popper:L,$$slots:{popper:!0}}))}};nt(T,S=>{v()?S(k):v()||S(R,1)})}y(e,x),F()}var _b=z("");function xb(e,t){const r=Kt();D(t,!0);let n=w(t,"id",19,()=>jt(r)),o=w(t,"disabled",3,!1),i=w(t,"type",3,"button"),s=w(t,"tabindex",3,0),a=w(t,"ref",15,null),l=K(t,["$$slots","$$events","$$legacy","children","child","id","disabled","payload","tether","type","tabindex","ref"]);const c=ko.create({id:E(()=>n()),disabled:E(()=>o()??!1),tabindex:E(()=>s()??0),payload:E(()=>t.payload),tether:E(()=>t.tether),ref:E(()=>a(),v=>a(v))}),d=P(()=>ht(l,c.props,{type:i()}));var f=N(),h=A(f);{var p=v=>{var m=N(),b=A(m);B(b,()=>t.child,()=>({props:u(d)})),y(v,m)},g=v=>{var m=_b();wt(m,()=>({...u(d)}));var b=et(m);B(b,()=>t.children??Q),y(v,m)};nt(h,v=>{t.child?v(p):v(g,!1)})}y(e,f),F()}function Sb(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);bm(e,U(()=>n,{get ref(){return r()},set ref(o){r(o)}})),F()}function Pb(e,t){D(t,!0);let r=w(t,"delayDuration",3,700),n=w(t,"disableCloseOnTriggerClick",3,!1),o=w(t,"disableHoverableContent",3,!1),i=w(t,"disabled",3,!1),s=w(t,"ignoreNonKeyboardFocus",3,!1),a=w(t,"skipDelayDuration",3,300);ra.create({delayDuration:E(()=>r()),disableCloseOnTriggerClick:E(()=>n()),disableHoverableContent:E(()=>o()),disabled:E(()=>i()),ignoreNonKeyboardFocus:E(()=>s()),skipDelayDuration:E(()=>a())});var l=N(),c=A(l);B(c,()=>t.children??Q),y(e,l),F()}function gr(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>mb,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function vr(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=A(o);H(i,()=>xb,(s,a)=>{a(s,U({"data-slot":"tooltip-trigger"},()=>n,{get ref(){return r()},set ref(l){r(l)}}))}),y(e,o),F()}const Tb=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),Du=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Eo="-",sl=[],Ab="arbitrary..",kb=e=>{const t=Ob(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Eb(s);const a=s.split(Eo),l=a[0]===""&&a.length>1?1:0;return Fu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Tb(c,l):l:c||sl}return r[s]||sl}}},Fu=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Fu(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Eo):e.slice(t).join(Eo),l=s.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Ab+n:void 0})(),Ob=e=>{const{theme:t,classGroups:r}=e;return Nb(r,t)},Nb=(e,t)=>{const r=Du();for(const n in e){const o=e[n];ia(o,r,n,t)}return r},ia=(e,t,r,n)=>{const o=e.length;for(let i=0;i{if(typeof e=="string"){Ib(e,t,r);return}if(typeof e=="function"){Db(e,t,r,n);return}Fb(e,t,r,n)},Ib=(e,t,r)=>{const n=e===""?t:Ru(t,e);n.classGroupId=r},Db=(e,t,r,n)=>{if(Rb(e)){ia(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Cb(r,e))},Fb=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s{let r=e;const n=t.split(Eo),o=n.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Lb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},Ri="!",al=":",zb=[],ll=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Vb=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let v=0;vl?c-l:void 0;return ll(i,p,h,g)};if(t){const o=t+al,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):ll(zb,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Bb=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Wb=e=>({cache:Lb(e.cacheSize),parseClassName:Vb(e),sortModifiers:Bb(e),...kb(e)}),Hb=/\s+/,Ub=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Hb);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:v}=r(d);if(f){l=d+(l.length>0?" "+l:l);continue}let m=!!v,b=n(m?g.substring(0,v):g);if(!b){if(!m){l=d+(l.length>0?" "+l:l);continue}if(b=n(g),!b){l=d+(l.length>0?" "+l:l);continue}m=!1}const O=h.length===0?"":h.length===1?h[0]:i(h).join(":"),C=p?O+Ri:O,x=C+b;if(s.indexOf(x)>-1)continue;s.push(x);const T=o(b,m);for(let k=0;k0?" "+l:l)}return l},Kb=(...e)=>{let t=0,r,n,o="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,o,i;const s=l=>{const c=t.reduce((d,f)=>f(d),e());return r=Wb(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=Ub(l,r);return o(l,d),d};return i=s,(...l)=>i(Kb(...l))},jb=[],Ft=e=>{const t=r=>r[e]||jb;return t.isThemeGetter=!0,t},zu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Zb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ye=e=>Gb.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),Xe=e=>!!e&&Number.isInteger(Number(e)),li=e=>e.endsWith("%")&&ut(e.slice(0,-1)),Ee=e=>Yb.test(e),Bu=()=>!0,Qb=e=>Xb.test(e)&&!qb.test(e),sa=()=>!1,$b=e=>Zb.test(e),ty=e=>Jb.test(e),ey=e=>!q(e)&&!J(e),ry=e=>fr(e,Uu,sa),q=e=>zu.test(e),mr=e=>fr(e,Ku,Qb),cl=e=>fr(e,uy,ut),ny=e=>fr(e,Gu,Bu),oy=e=>fr(e,ju,sa),ul=e=>fr(e,Wu,sa),iy=e=>fr(e,Hu,ty),Jn=e=>fr(e,Yu,$b),J=e=>Vu.test(e),fn=e=>Lr(e,Ku),sy=e=>Lr(e,ju),dl=e=>Lr(e,Wu),ay=e=>Lr(e,Uu),ly=e=>Lr(e,Hu),Qn=e=>Lr(e,Yu,!0),cy=e=>Lr(e,Gu,!0),fr=(e,t,r)=>{const n=zu.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lr=(e,t,r=!1)=>{const n=Vu.exec(e);return n?n[1]?t(n[1]):r:!1},Wu=e=>e==="position"||e==="percentage",Hu=e=>e==="image"||e==="url",Uu=e=>e==="length"||e==="size"||e==="bg-size",Ku=e=>e==="length",uy=e=>e==="number",ju=e=>e==="family-name",Gu=e=>e==="number"||e==="weight",Yu=e=>e==="shadow",zi=()=>{const e=Ft("color"),t=Ft("font"),r=Ft("text"),n=Ft("font-weight"),o=Ft("tracking"),i=Ft("leading"),s=Ft("breakpoint"),a=Ft("container"),l=Ft("spacing"),c=Ft("radius"),d=Ft("shadow"),f=Ft("inset-shadow"),h=Ft("text-shadow"),p=Ft("drop-shadow"),g=Ft("blur"),v=Ft("perspective"),m=Ft("aspect"),b=Ft("ease"),O=Ft("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...x(),J,q],k=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],S=()=>[J,q,l],L=()=>[Ye,"full","auto",...S()],V=()=>[Xe,"none","subgrid",J,q],ct=()=>["auto",{span:["full",Xe,J,q]},Xe,J,q],st=()=>[Xe,"auto",J,q],_t=()=>["auto","min","max","fr",J,q],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...S()],Z=()=>[Ye,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],X=()=>[Ye,"screen","full","dvw","lvw","svw","min","max","fit",...S()],ot=()=>[Ye,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],I=()=>[e,J,q],$=()=>[...x(),dl,ul,{position:[J,q]}],it=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ft=()=>["auto","cover","contain",ay,ry,{size:[J,q]}],pt=()=>[li,fn,mr],tt=()=>["","none","full",c,J,q],at=()=>["",ut,fn,mr],Tt=()=>["solid","dashed","dotted","double"],At=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],lt=()=>[ut,li,dl,ul],Et=()=>["","none",g,J,q],Ct=()=>["none",ut,J,q],hr=()=>["none",ut,J,q],xt=()=>[ut,J,q],Nt=()=>[Ye,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ee],breakpoint:[Ee],color:[Bu],container:[Ee],"drop-shadow":[Ee],ease:["in","out","in-out"],font:[ey],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ee],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ee],shadow:[Ee],spacing:["px",ut],text:[Ee],"text-shadow":[Ee],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ye,q,J,m]}],container:["container"],columns:[{columns:[ut,q,J,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Xe,"auto",J,q]}],basis:[{basis:[Ye,"full","auto",a,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,Ye,"auto","initial","none",q]}],grow:[{grow:["",ut,J,q]}],shrink:[{shrink:["",ut,J,q]}],order:[{order:[Xe,"first","last","none",J,q]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:ct()}],"col-start":[{"col-start":st()}],"col-end":[{"col-end":st()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:ct()}],"row-start":[{"row-start":st()}],"row-end":[{"row-end":st()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_t()}],"auto-rows":[{"auto-rows":_t()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mbs:[{mbs:W()}],mbe:[{mbe:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...ot()]}],"min-block-size":[{"min-block":["auto",...ot()]}],"max-block-size":[{"max-block":["none",...ot()]}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,fn,mr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,cy,ny]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",li,q]}],"font-family":[{font:[sy,oy,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,J,q]}],"line-clamp":[{"line-clamp":[ut,"none",J,cl]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",J,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Tt(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",J,mr]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ut,"auto",J,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J,q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:it()}],"bg-size":[{bg:ft()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xe,J,q],radial:["",J,q],conic:[Xe,J,q]},ly,iy]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:pt()}],"gradient-via-pos":[{via:pt()}],"gradient-to-pos":[{to:pt()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:tt()}],"rounded-s":[{"rounded-s":tt()}],"rounded-e":[{"rounded-e":tt()}],"rounded-t":[{"rounded-t":tt()}],"rounded-r":[{"rounded-r":tt()}],"rounded-b":[{"rounded-b":tt()}],"rounded-l":[{"rounded-l":tt()}],"rounded-ss":[{"rounded-ss":tt()}],"rounded-se":[{"rounded-se":tt()}],"rounded-ee":[{"rounded-ee":tt()}],"rounded-es":[{"rounded-es":tt()}],"rounded-tl":[{"rounded-tl":tt()}],"rounded-tr":[{"rounded-tr":tt()}],"rounded-br":[{"rounded-br":tt()}],"rounded-bl":[{"rounded-bl":tt()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-bs":[{"border-bs":at()}],"border-w-be":[{"border-be":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Tt(),"hidden","none"]}],"divide-style":[{divide:[...Tt(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Tt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,J,q]}],"outline-w":[{outline:["",ut,fn,mr]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",d,Qn,Jn]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",f,Qn,Jn]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ut,mr]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",h,Qn,Jn]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ut,J,q]}],"mix-blend":[{"mix-blend":[...At(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":At()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":lt()}],"mask-image-linear-to-pos":[{"mask-linear-to":lt()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":lt()}],"mask-image-t-to-pos":[{"mask-t-to":lt()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":lt()}],"mask-image-r-to-pos":[{"mask-r-to":lt()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":lt()}],"mask-image-b-to-pos":[{"mask-b-to":lt()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":lt()}],"mask-image-l-to-pos":[{"mask-l-to":lt()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":lt()}],"mask-image-x-to-pos":[{"mask-x-to":lt()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":lt()}],"mask-image-y-to-pos":[{"mask-y-to":lt()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":lt()}],"mask-image-radial-to-pos":[{"mask-radial-to":lt()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":lt()}],"mask-image-conic-to-pos":[{"mask-conic-to":lt()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:it()}],"mask-size":[{mask:ft()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",J,q]}],filter:[{filter:["","none",J,q]}],blur:[{blur:Et()}],brightness:[{brightness:[ut,J,q]}],contrast:[{contrast:[ut,J,q]}],"drop-shadow":[{"drop-shadow":["","none",p,Qn,Jn]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",ut,J,q]}],"hue-rotate":[{"hue-rotate":[ut,J,q]}],invert:[{invert:["",ut,J,q]}],saturate:[{saturate:[ut,J,q]}],sepia:[{sepia:["",ut,J,q]}],"backdrop-filter":[{"backdrop-filter":["","none",J,q]}],"backdrop-blur":[{"backdrop-blur":Et()}],"backdrop-brightness":[{"backdrop-brightness":[ut,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[ut,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,J,q]}],"backdrop-invert":[{"backdrop-invert":["",ut,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[ut,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[ut,J,q]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,J,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",J,q]}],ease:[{ease:["linear","initial",b,J,q]}],delay:[{delay:[ut,J,q]}],animate:[{animate:["none",O,J,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,J,q]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ct()}],"rotate-x":[{"rotate-x":Ct()}],"rotate-y":[{"rotate-y":Ct()}],"rotate-z":[{"rotate-z":Ct()}],scale:[{scale:hr()}],"scale-x":[{"scale-x":hr()}],"scale-y":[{"scale-y":hr()}],"scale-z":[{"scale-z":hr()}],"scale-3d":["scale-3d"],skew:[{skew:xt()}],"skew-x":[{"skew-x":xt()}],"skew-y":[{"skew-y":xt()}],transform:[{transform:[J,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Nt()}],"translate-x":[{"translate-x":Nt()}],"translate-y":[{"translate-y":Nt()}],"translate-z":[{"translate-z":Nt()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J,q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J,q]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[ut,fn,mr,cl]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dy=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:i={}})=>(vn(e,"cacheSize",t),vn(e,"prefix",r),vn(e,"experimentalParseClassName",n),$n(e.theme,i.theme),$n(e.classGroups,i.classGroups),$n(e.conflictingClassGroups,i.conflictingClassGroups),$n(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),vn(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),to(e.theme,o.theme),to(e.classGroups,o.classGroups),to(e.conflictingClassGroups,o.conflictingClassGroups),to(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Xu(e,o,"orderSensitiveModifiers"),e),vn=(e,t,r)=>{r!==void 0&&(e[t]=r)},$n=(e,t)=>{if(t)for(const r in t)vn(e,r,t[r])},to=(e,t)=>{if(t)for(const r in t)Xu(e,t,r)},Xu=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},fy=(e,...t)=>typeof e=="function"?Li(zi,e,...t):Li(()=>dy(zi(),e),...t),qu=Li(zi);function Gt(...e){return qu(bn(e))}function hy(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}var py=z("
"),gy=z(" ",1);function br(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"sideOffset",3,0),o=w(t,"side",3,"top"),i=K(t,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","children","arrowClasses","portalProps"]);hy(e,U(()=>t.portalProps,{children:(s,a)=>{var l=N(),c=A(l);{let d=P(()=>Gt("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--bits-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t.class));H(c,()=>wb,(f,h)=>{h(f,U({"data-slot":"tooltip-content",get sideOffset(){return n()},get side(){return o()},get class(){return u(d)}},()=>i,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=gy(),m=A(v);B(m,()=>t.children??Q);var b=j(m,2);{const O=(C,x)=>{let T=()=>x?.().props;var k=py();wt(k,R=>({class:R,...T()}),[()=>Gt("bg-foreground z-50 size-2.5 rotate-45 rounded-[2px]","data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]","data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]","data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2","data-[side=left]:-translate-y-[calc(50%_-_3px)]",t.arrowClasses)]),y(C,k)};H(b,()=>Sb,(C,x)=>{x(C,{child:O,$$slots:{child:!0}})})}y(p,v)},$$slots:{default:!0}}))})}y(s,l)},$$slots:{default:!0}})),F()}function vy(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>Pb,(i,s)=>{s(i,U(()=>r))}),y(e,n)}const my={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const by=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var yy=pc("");function Yt(e,t){D(t,!0);const r=w(t,"color",3,"currentColor"),n=w(t,"size",3,24),o=w(t,"strokeWidth",3,2),i=w(t,"absoluteStrokeWidth",3,!1),s=w(t,"iconNode",19,()=>[]),a=K(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var l=yy();wt(l,(f,h)=>({...my,...f,...a,width:n(),height:n(),stroke:r(),"stroke-width":h,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!by(a)&&{"aria-hidden":"true"},()=>i()?Number(o())*24/Number(n()):o()]);var c=et(l);Sn(c,17,s,Df,(f,h)=>{var p=P(()=>hd(u(h),2));let g=()=>u(p)[0],v=()=>u(p)[1];var m=N(),b=A(m);Vf(b,g,!0,(O,C)=>{wt(O,()=>({...v()}))}),y(f,m)});var d=j(c);B(d,()=>t.children??Q),y(e,l),F()}function wy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["line",{x1:"2",x2:"22",y1:"2",y2:"22"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9"}]];Yt(e,U({name:"image-off"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function _y(){const e=new URL(window.location.href).searchParams;return{host:e.get("hgd")||e.get("host")||window.location.host,token:e.get("token")||void 0,allowWebsockets:e.has("ws")?e.get("ws")!=="0":!0,sidebarHidden:e.has("sidebar")?e.get("sidebar")==="0":!1}}function zr(e){const t=window.location.protocol==="https:"?"https":"http";return e.startsWith("http://")||e.startsWith("https://")?e:`${t}://${e}`}function xy(e){const t=window.location.protocol==="https:"?"wss":"ws";return e.startsWith("ws://")||e.startsWith("wss://")?e:`${t}://${e}`}function aa(e){const t={};return e&&(t["X-HTTPGD-TOKEN"]=e),t}async function Jo(e,t){const r=await fetch(e,{headers:aa(t)});if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);return r.json()}async function Sy(e,t){return Jo(`${zr(e)}/state`,t)}async function Py(e,t){return Jo(`${zr(e)}/plots`,t)}async function Ty(e,t){return(await Jo(`${zr(e)}/renderers`,t)).renderers}async function Cy(e,t){return Jo(`${zr(e)}/info`,t)}async function Zu(e,t,r){const n=new URL(`${zr(e)}/remove`);n.searchParams.set("id",t.id),await fetch(n.toString(),{headers:aa(r)})}async function Ay(e,t){await fetch(`${zr(e)}/clear`,{headers:aa(t)})}function _n(e,t,r,n){const o=new URL(`${zr(e)}/plot`);return t.id&&o.searchParams.set("id",t.id),t.renderer&&o.searchParams.set("renderer",t.renderer),t.width!=null&&o.searchParams.set("width",Math.round(t.width).toString()),t.height!=null&&o.searchParams.set("height",Math.round(t.height).toString()),t.zoom!=null&&o.searchParams.set("zoom",t.zoom.toString()),t.download&&o.searchParams.set("download",t.download),r&&o.searchParams.set("token",r),n&&o.searchParams.set("c",n),o.toString()}const oo=1.25,ci=oo/12,ky=.5;class Ey{#t=M(It([]));get plots(){return u(this.#t)}set plots(t){_(this.#t,t,!0)}#e=M("0");get upid(){return u(this.#e)}set upid(t){_(this.#e,t,!0)}#r=M(1);get page(){return u(this.#r)}set page(t){_(this.#r,t,!0)}#n=M(oo);get zoom(){return u(this.#n)}set zoom(t){_(this.#n,t,!0)}#o=M("httpgd");get title(){return u(this.#o)}set title(t){_(this.#o,t,!0)}host="";token;get currentPlotId(){if(this.plots.length===0)return null;let t=this.page;const r=this.plots.length;for(;t<1;)t+=r;for(;t>r;)t-=r;return this.plots[t-1].id}get pageLabel(){return this.plots.length>0?`${this.page}/${this.plots.length}`:"0/0"}get zoomLabel(){return Math.ceil(this.zoom/oo*100)+"%"}configure(t,r){this.host=t,this.token=r}updatePlots(t){this.plots=t.plots,this.upid=t.state.upid.toString(),this.page=t.plots.length,t.state.title!==void 0&&(this.title=t.state.title)}getPlotImageUrl(t,r,n){const o=n??this.currentPlotId;return o?_n(this.host,{id:o,width:t,height:r,zoom:this.zoom},this.token,this.upid):null}nextPage(){this.plots.length!==0&&(this.page=this.page>=this.plots.length?1:this.page+1)}prevPage(){this.plots.length!==0&&(this.page=this.page<=1?this.plots.length:this.page-1)}newestPage(){this.plots.length!==0&&(this.page=this.plots.length)}setPage(t){const r=this.plots.findIndex(n=>n.id===t);r>=0&&(this.page=r+1)}zoomIn(){this.zoom+=ci}zoomOut(){this.zoom-ci>ky&&(this.zoom-=ci)}zoomReset(){this.zoom=oo}}const rt=new Ey;var Oy=z('Plot'),Ny=z('

Waiting for plots

'),My=z('
');function Iy(e,t){D(t,!0);let r=w(t,"imageRef",15,null),n,o=M(0),i=M(0),s=M(!1);const a=P(()=>u(o)===0||u(i)===0?null:rt.getPlotImageUrl(u(o),u(i))),l=P(()=>rt.currentPlotId!==null);gt(()=>{if(!n)return;const v=new ResizeObserver(m=>{const b=m[0];b&&(_(o,b.contentRect.width,!0),_(i,b.contentRect.height,!0))});return v.observe(n),()=>v.disconnect()});function c(){_(s,!1)}function d(){u(a)&&_(s,!0)}var f=My(),h=et(f);{var p=v=>{var m=Oy();let b;Or(m,O=>r(O),()=>r()),zt(()=>{Wt(m,"src",u(a)),b=nr(m,1,"max-h-full max-w-full object-contain transition-opacity duration-150",null,b,{"opacity-80":u(s)})}),_a("load",m,c),_a("loadstart",m,d),y(v,m)},g=v=>{var m=Ny(),b=et(m);wy(b,{class:"h-12 w-12 opacity-30"}),y(v,m)};nt(h,v=>{u(l)&&u(a)?v(p):v(g,!1)})}Or(f,v=>n=v,()=>n),y(e,f),F()}function Dy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m15 18-6-6 6-6"}]];Yt(e,U({name:"chevron-left"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Fy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"m9 18 6-6-6-6"}]];Yt(e,U({name:"chevron-right"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ry(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];Yt(e,U({name:"zoom-out"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ly(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"11",cy:"11",r:"8"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11"}]];Yt(e,U({name:"zoom-in"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function zy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];Yt(e,U({name:"trash-2"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Vy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];Yt(e,U({name:"download"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function By(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];Yt(e,U({name:"image"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Wy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Yt(e,U({name:"copy"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function la(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Yt(e,U({name:"x"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Hy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"m5 11-3 3"}],["path",{d:"m5 17-3-3h10"}]];Yt(e,U({name:"file-output"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Uy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M15 3v18"}]];Yt(e,U({name:"panel-right"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Ky(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];Yt(e,U({name:"ellipsis-vertical"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function jy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];Yt(e,U({name:"sun"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Gy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];Yt(e,U({name:"moon"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}function Yy(e,t){D(t,!0);let r=K(t,["$$slots","$$events","$$legacy"]);const n=[["path",{d:"M10 8h.01"}],["path",{d:"M12 12h.01"}],["path",{d:"M14 8h.01"}],["path",{d:"M16 12h.01"}],["path",{d:"M18 8h.01"}],["path",{d:"M6 8h.01"}],["path",{d:"M7 16h10"}],["path",{d:"M8 12h.01"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}]];Yt(e,U({name:"keyboard"},()=>r,{get iconNode(){return n},children:(o,i)=>{var s=N(),a=A(s);B(a,()=>t.children??Q),y(o,s)},$$slots:{default:!0}})),F()}var Xy=/\s+/g,qy=e=>typeof e!="string"||!e?e:e.replace(Xy," ").trim(),Oo=(...e)=>{const t=[],r=n=>{if(!n&&n!==0&&n!==0n)return;if(Array.isArray(n)){for(let i=0,s=n.length;i0?qy(t.join(" ")):void 0},fl=e=>e===!1?"false":e===!0?"true":e===0?"0":e,Jt=e=>{if(!e||typeof e!="object")return!0;for(const t in e)return!1;return!0},Zy=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];r in e?e[r]=Oo(e[r],n):e[r]=n}return e},Ju=(e,t)=>{for(let r=0;r{const t=[];Ju(e,t);const r=[];for(let n=0;n{const r={};for(const n in e){const o=e[n];if(n in t){const i=t[n];Array.isArray(o)||Array.isArray(i)?r[n]=Qu(i,o):typeof o=="object"&&typeof i=="object"&&o&&i?r[n]=Vi(o,i):r[n]=i+" "+o}else r[n]=o}for(const n in t)n in e||(r[n]=t[n]);return r},Qy={twMerge:!0,twMergeConfig:{}};function $y(){let e=null,t={},r=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(n){e=n},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(n){t=n},get didTwMergeConfigChange(){return r},set didTwMergeConfigChange(n){r=n},reset(){e=null,t={},r=!1}}}var Ne=$y(),tw=e=>{const t=(n,o)=>{const{extend:i=null,slots:s={},variants:a={},compoundVariants:l=[],compoundSlots:c=[],defaultVariants:d={}}=n,f={...Qy,...o},h=i?.base?Oo(i.base,n?.base):n?.base,p=i?.variants&&!Jt(i.variants)?Vi(a,i.variants):a,g=i?.defaultVariants&&!Jt(i.defaultVariants)?{...i.defaultVariants,...d}:d;!Jt(f.twMergeConfig)&&!Zy(f.twMergeConfig,Ne.cachedTwMergeConfig)&&(Ne.didTwMergeConfigChange=!0,Ne.cachedTwMergeConfig=f.twMergeConfig);const v=Jt(i?.slots),m=Jt(s)?{}:{base:Oo(n?.base,v&&i?.base),...s},b=v?m:Jy({...i?.slots},Jt(m)?{base:n?.base}:m),O=Jt(i?.compoundVariants)?l:Qu(i?.compoundVariants,l),C=T=>{if(Jt(p)&&Jt(s)&&v)return e(h,T?.class,T?.className)(f);if(O&&!Array.isArray(O))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof O}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const k=(G,Y=p,W=null,Z=null)=>{const X=Y[G];if(!X||Jt(X))return null;const ot=Z?.[G]??T?.[G];if(ot===null)return null;const I=fl(ot);if(typeof I=="object")return null;const $=g?.[G],it=I??fl($);return X[it||"false"]},R=()=>{if(!p)return null;const G=Object.keys(p),Y=[];for(let W=0;W{if(!p||typeof p!="object")return null;const W=[];for(const Z in p){const X=k(Z,p,G,Y),ot=G==="base"&&typeof X=="string"?X:X&&X[G];ot&&W.push(ot)}return W},L={};for(const G in T){const Y=T[G];Y!==void 0&&(L[G]=Y)}const V=(G,Y)=>{const W=typeof T?.[G]=="object"?{[G]:T[G]?.initial}:{};return{...g,...L,...W,...Y}},ct=(G=[],Y)=>{const W=[],Z=G.length;for(let X=0;X{const Y=ct(O,G);if(!Array.isArray(Y))return Y;const W={},Z=e;for(let X=0;X{if(c.length<1)return null;const Y={},W=V(null,G);for(let Z=0;Z{const X=st(Z),ot=_t(Z);return Y(b[W],S(W,Z),X?X[W]:void 0,ot?ot[W]:void 0,Z?.class,Z?.className)(f)}}return G}return e(h,R(),ct(O),T?.class,T?.className)(f)},x=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return C.variantKeys=x(),C.extend=i,C.base=h,C.slots=b,C.variants=p,C.defaultVariants=g,C.compoundSlots=c,C.compoundVariants=O,C};return{tv:t,createTV:n=>(o,i)=>t(o,i?Vi(n,i):n)}},ew=e=>Jt(e)?qu:fy({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),rw=(e,t)=>{const r=Oo(e);return!r||!(t?.twMerge??!0)?r:((!Ne.cachedTwMerge||Ne.didTwMergeConfigChange)&&(Ne.didTwMergeConfigChange=!1,Ne.cachedTwMerge=ew(Ne.cachedTwMergeConfig)),Ne.cachedTwMerge(r)||void 0)},nw=(...e)=>t=>rw(e,t),{tv:ow}=tw(nw);const hl=ow({base:"cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",destructive:"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",outline:"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var iw=z(""),sw=z("");function ye(e,t){D(t,!0);let r=w(t,"variant",3,"default"),n=w(t,"size",3,"default"),o=w(t,"ref",15,null),i=w(t,"href",3,void 0),s=w(t,"type",3,"button"),a=K(t,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var l=N(),c=A(l);{var d=h=>{var p=iw();wt(p,v=>({"data-slot":"button",class:v,href:t.disabled?void 0:i(),"aria-disabled":t.disabled,role:t.disabled?"link":void 0,tabindex:t.disabled?-1:void 0,...a}),[()=>Gt(hl({variant:r(),size:n()}),t.class)]);var g=et(p);B(g,()=>t.children??Q),Or(p,v=>o(v),()=>o()),y(h,p)},f=h=>{var p=sw();wt(p,v=>({"data-slot":"button",class:v,type:s(),disabled:t.disabled,...a}),[()=>Gt(hl({variant:r(),size:n()}),t.class)]);var g=et(p);B(g,()=>t.children??Q),Or(p,v=>o(v),()=>o()),y(h,p)};nt(c,h=>{i()?h(d):h(f,!1)})}y(e,l),F()}function aw(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>zm,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function lw(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}function cw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"sideOffset",3,4),o=K(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);lw(e,U(()=>t.portalProps,{children:(i,s)=>{var a=N(),l=A(a);{let c=P(()=>Gt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",t.class));H(l,()=>Wm,(d,f)=>{f(d,U({"data-slot":"dropdown-menu-content",get sideOffset(){return n()},get class(){return u(c)}},()=>o,{get ref(){return r()},set ref(h){r(h)}}))})}y(i,a)},$$slots:{default:!0}})),F()}function qe(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"variant",3,"default"),o=K(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var i=N(),s=A(i);{let a=P(()=>Gt("data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class));H(s,()=>Am,(l,c)=>{c(l,U({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)}}))})}y(e,i),F()}function ui(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("bg-border -mx-1 my-1 h-px",t.class));H(i,()=>Em,(a,l)=>{l(a,U({"data-slot":"dropdown-menu-separator",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var uw=z("");function Ze(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=uw();wt(o,s=>({"data-slot":"dropdown-menu-shortcut",class:s,...n}),[()=>Gt("text-muted-foreground ms-auto text-xs tracking-widest",t.class)]);var i=et(o);B(i,()=>t.children??Q),Or(o,s=>r(s),()=>r()),y(e,o),F()}function dw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=A(o);H(i,()=>Um,(s,a)=>{a(s,U({"data-slot":"dropdown-menu-trigger"},()=>n,{get ref(){return r()},set ref(l){r(l)}}))}),y(e,o),F()}function pl(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"data-slot",3,"separator"),o=K(t,["$$slots","$$events","$$legacy","ref","class","data-slot"]);var i=N(),s=A(i);{let a=P(()=>Gt("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-full data-[orientation=vertical]:w-px",t.class));H(s,()=>Sm,(l,c)=>{c(l,U({get"data-slot"(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)}}))})}y(e,i),F()}const gl=4e3;function fw(e){let t;function r(){if(document.querySelector('[data-slot="dropdown-menu-content"]')){n();return}e.classList.add("toolbar-faded")}function n(){e.classList.remove("toolbar-faded"),clearTimeout(t),t=setTimeout(r,gl)}t=setTimeout(r,gl);const o=e.parentElement;return o&&(o.addEventListener("mousemove",n),o.addEventListener("mouseleave",r)),{destroy(){clearTimeout(t),o&&(o.removeEventListener("mousemove",n),o.removeEventListener("mouseleave",r))}}}var hw=z("

Previous (←)

"),pw=z(" ",1),gw=z("

Newest (N)

"),vw=z(" ",1),mw=z("

Next (→)

"),bw=z(" ",1),yw=z("

Zoom out (-)

"),ww=z(" ",1),_w=z("

Reset zoom (0)

"),xw=z(" ",1),Sw=z("

Zoom in (+)

"),Pw=z(" ",1),Tw=z("

Delete (D)

"),Cw=z(" ",1),Aw=z(" Download SVG ",1),kw=z(" Download PNG ",1),Ew=z(" Copy PNG ",1),Ow=z(" Clear all ",1),Nw=z(" Export ",1),Mw=z(" History ",1),Iw=z(" Light mode",1),Dw=z(" Dark mode",1),Fw=z(" ",1),Rw=z(" Shortcuts ",1),Lw=z(" ",1),zw=z(" ",1),Vw=z('
');function Bw(e,t){D(t,!0);var r=Vw(),n=et(r);H(n,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=pw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.prevPage(),children:(S,L)=>{Dy(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=hw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var o=j(n,2);H(o,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=vw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"sm",class:"h-8 min-w-[3rem] px-2 text-xs font-bold",onclick:()=>rt.newestPage(),children:(S,L)=>{var V=Xt();zt(()=>ir(V,rt.pageLabel)),y(S,V)},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=gw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var i=j(o,2);H(i,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=bw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.nextPage(),children:(S,L)=>{Fy(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=mw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var s=j(i,2);pl(s,{orientation:"vertical",class:"mx-1 h-6"});var a=j(s,2);H(a,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=ww(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.zoomOut(),children:(S,L)=>{Ry(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=yw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var l=j(a,2);H(l,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=xw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"sm",class:"h-8 min-w-[3rem] px-2 text-xs font-bold",onclick:()=>rt.zoomReset(),children:(S,L)=>{var V=Xt();zt(()=>ir(V,rt.zoomLabel)),y(S,V)},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=_w();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var c=j(l,2);H(c,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=Pw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",onclick:()=>rt.zoomIn(),children:(S,L)=>{Ly(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=Sw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var d=j(c,2);pl(d,{orientation:"vertical",class:"mx-1 h-6"});var f=j(d,2);H(f,()=>gr,(p,g)=>{g(p,{children:(v,m)=>{var b=Cw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"hover:text-destructive h-8 w-8",get onclick(){return t.onremove},children:(S,L)=>{la(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>vr,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>br,(x,T)=>{T(x,{children:(k,R)=>{var S=Tw();y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})});var h=j(f,2);H(h,()=>aw,(p,g)=>{g(p,{children:(v,m)=>{var b=zw(),O=A(b);{const x=(T,k)=>{ye(T,U(()=>k?.().props,{variant:"ghost",size:"icon",class:"h-8 w-8",children:(S,L)=>{Ky(S,{class:"h-4 w-4"})},$$slots:{default:!0}}))};H(O,()=>dw,(T,k)=>{k(T,{child:x,$$slots:{child:!0}})})}var C=j(O,2);H(C,()=>cw,(x,T)=>{T(x,{align:"end",class:"w-48",children:(k,R)=>{var S=Lw(),L=A(S);H(L,()=>qe,(I,$)=>{$(I,{get onclick(){return t.ondownloadsvg},children:(it,ft)=>{var pt=Aw(),tt=A(pt);Vy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("S");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var V=j(L,2);H(V,()=>qe,(I,$)=>{$(I,{get onclick(){return t.ondownloadpng},children:(it,ft)=>{var pt=kw(),tt=A(pt);By(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("P");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var ct=j(V,2);H(ct,()=>qe,(I,$)=>{$(I,{get onclick(){return t.oncopypng},children:(it,ft)=>{var pt=Ew(),tt=A(pt);Wy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("C");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var st=j(ct,2);H(st,()=>ui,(I,$)=>{$(I,{})});var _t=j(st,2);H(_t,()=>qe,(I,$)=>{$(I,{get onclick(){return t.onclear},class:"text-destructive",children:(it,ft)=>{var pt=Ow(),tt=A(pt);zy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("Alt+D");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var G=j(_t,2);H(G,()=>ui,(I,$)=>{$(I,{})});var Y=j(G,2);H(Y,()=>qe,(I,$)=>{$(I,{onclick:()=>vt.openExportDialog(),children:(it,ft)=>{var pt=Nw(),tt=A(pt);Hy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("E");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var W=j(Y,2);H(W,()=>qe,(I,$)=>{$(I,{onclick:()=>vt.toggleSidebar(),children:(it,ft)=>{var pt=Mw(),tt=A(pt);Uy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("H");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var Z=j(W,2);H(Z,()=>ui,(I,$)=>{$(I,{})});var X=j(Z,2);H(X,()=>qe,(I,$)=>{$(I,{get onclick(){return kc},children:(it,ft)=>{var pt=Fw(),tt=A(pt);{var at=lt=>{var Et=Iw(),Ct=A(Et);jy(Ct,{class:"mr-2 h-4 w-4"}),y(lt,Et)},Tt=lt=>{var Et=Dw(),Ct=A(Et);Gy(Ct,{class:"mr-2 h-4 w-4"}),y(lt,Et)};nt(tt,lt=>{os.current==="dark"?lt(at):lt(Tt,!1)})}var At=j(tt,2);H(At,()=>Ze,(lt,Et)=>{Et(lt,{children:(Ct,hr)=>{var xt=Xt("T");y(Ct,xt)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})});var ot=j(X,2);H(ot,()=>qe,(I,$)=>{$(I,{onclick:()=>vt.shortcutsDialogOpen=!0,children:(it,ft)=>{var pt=Rw(),tt=A(pt);Yy(tt,{class:"mr-2 h-4 w-4"});var at=j(tt,2);H(at,()=>Ze,(Tt,At)=>{At(Tt,{children:(lt,Et)=>{var Ct=Xt("?");y(lt,Ct)},$$slots:{default:!0}})}),y(it,pt)},$$slots:{default:!0}})}),y(k,S)},$$slots:{default:!0}})}),y(v,b)},$$slots:{default:!0}})}),vc(r,p=>fw?.(p)),y(e,r),F()}var Ww=z(" ",1);function vl(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"orientation",3,"vertical"),o=K(t,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var i=N(),s=A(i);{let a=P(()=>Gt("flex touch-none p-px transition-colors select-none",n()==="vertical"&&"h-full w-2.5 border-s border-s-transparent",n()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t.class));H(s,()=>cb,(l,c)=>{c(l,U({"data-slot":"scroll-area-scrollbar",get orientation(){return n()},get class(){return u(a)}},()=>o,{get ref(){return r()},set ref(d){r(d)},children:(d,f)=>{var h=Ww(),p=A(h);B(p,()=>t.children??Q);var g=j(p,2);H(g,()=>fb,(v,m)=>{m(v,{"data-slot":"scroll-area-thumb",class:"bg-border relative flex-1 rounded-full"})}),y(d,h)},$$slots:{default:!0}}))})}y(e,i),F()}var Hw=z(" ",1);function Uw(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"viewportRef",15,null),o=w(t,"orientation",3,"vertical"),i=w(t,"scrollbarXClasses",3,""),s=w(t,"scrollbarYClasses",3,""),a=K(t,["$$slots","$$events","$$legacy","ref","viewportRef","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var l=N(),c=A(l);{let d=P(()=>Gt("relative",t.class));H(c,()=>tb,(f,h)=>{h(f,U({"data-slot":"scroll-area",get class(){return u(d)}},()=>a,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=Hw(),m=A(v);H(m,()=>rb,(k,R)=>{R(k,{"data-slot":"scroll-area-viewport",class:"ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1",get ref(){return n()},set ref(S){n(S)},children:(S,L)=>{var V=N(),ct=A(V);B(ct,()=>t.children??Q),y(S,V)},$$slots:{default:!0}})});var b=j(m,2);{var O=k=>{vl(k,{orientation:"vertical",get class(){return s()}})};nt(b,k=>{(o()==="vertical"||o()==="both")&&k(O)})}var C=j(b,2);{var x=k=>{vl(k,{orientation:"horizontal",get class(){return i()}})};nt(C,k=>{(o()==="horizontal"||o()==="both")&&k(x)})}var T=j(C,2);H(T,()=>gb,(k,R)=>{R(k,{})}),y(p,v)},$$slots:{default:!0}}))})}y(e,l),F()}var Kw=z('
Plot thumbnail
');function jw(e,t){D(t,!0);const r=P(()=>_n(rt.host,{id:t.plotId},rt.token,rt.upid));var n=Kw(),o=et(n),i=et(o),s=j(o,2),a=et(s);la(a,{class:"h-4 w-4"}),zt(()=>{nr(n,1,`group relative w-full cursor-pointer overflow-hidden rounded-md border shadow-sm transition-all hover:shadow-md ${t.selected?"ring-primary ring-2":""}`),Wt(i,"src",u(r))}),Br("click",n,function(...l){t.onselect?.apply(this,l)}),Br("keydown",n,l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onselect())}),Br("click",s,l=>{l.stopPropagation(),t.onremove()}),y(e,n),F()}Lo(["click","keydown"]);var Gw=z("
"),Yw=z('

No plots yet

'),Xw=z('
'),qw=z("
");function Zw(e,t){D(t,!0);let r=M(void 0);gt(()=>{rt.page,u(r)&&requestAnimationFrame(()=>{const a=u(r)?.querySelector("[data-selected=true]");a&&a.scrollIntoView({behavior:"smooth",block:"center"})})});async function n(a){try{await Zu(rt.host,{id:a},rt.token)}catch{vt.showToast("Failed to remove plot","error")}}var o=qw();let i;var s=et(o);Uw(s,{class:"h-full",children:(a,l)=>{var c=Xw();Sn(c,21,()=>rt.plots,d=>d.id,(d,f)=>{const h=P(()=>u(f).id===rt.currentPlotId);var p=Gw(),g=et(p);jw(g,{get plotId(){return u(f).id},get selected(){return u(h)},onselect:()=>rt.setPage(u(f).id),onremove:()=>n(u(f).id)}),zt(()=>Wt(p,"data-selected",u(h))),y(d,p)},d=>{var f=Yw();y(d,f)}),Or(c,d=>_(r,d),()=>u(r)),y(a,c)},$$slots:{default:!0}}),zt(()=>i=nr(o,1,`bg-sidebar h-full w-[20%] min-w-[120px] border-l transition-all duration-300 ${vt.sidebarVisible?"translate-x-0":"translate-x-full"}`,null,i,{hidden:!vt.sidebarVisible})),y(e,o),F()}function $u(e,t){D(t,!0);let r=w(t,"open",15,!1),n=K(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=A(o);H(i,()=>Mm,(s,a)=>{a(s,U(()=>n,{get open(){return r()},set open(l){r(l)}}))}),y(e,o),F()}function Jw(e,t){let r=K(t,["$$slots","$$events","$$legacy"]);var n=N(),o=A(n);H(o,()=>bs,(i,s)=>{s(i,U(()=>r))}),y(e,n)}function td(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("text-lg leading-none font-semibold",t.class));H(i,()=>ng,(a,l)=>{l(a,U({"data-slot":"dialog-title",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var Qw=z("
");function ed(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Qw();wt(o,s=>({"data-slot":"dialog-header",class:s,...n}),[()=>Gt("flex flex-col gap-2 text-center sm:text-start",t.class)]);var i=et(o);B(i,()=>t.children??Q),Or(o,s=>r(s),()=>r()),y(e,o),F()}function $w(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));H(i,()=>ov,(a,l)=>{l(a,U({"data-slot":"dialog-overlay",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}var t_=z(' Close',1),e_=z(" ",1),r_=z(" ",1);function rd(e,t){D(t,!0);let r=w(t,"ref",15,null),n=w(t,"showCloseButton",3,!0),o=K(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Jw(e,U(()=>t.portalProps,{children:(i,s)=>{var a=r_(),l=A(a);H(l,()=>$w,(d,f)=>{f(d,{})});var c=j(l,2);{let d=P(()=>Gt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));H(c,()=>Lm,(f,h)=>{h(f,U({"data-slot":"dialog-content",get class(){return u(d)}},()=>o,{get ref(){return r()},set ref(p){r(p)},children:(p,g)=>{var v=e_(),m=A(v);B(m,()=>t.children??Q);var b=j(m,2);{var O=C=>{var x=N(),T=A(x);H(T,()=>Dm,(k,R)=>{R(k,{class:"ring-offset-background focus:ring-ring absolute end-4 top-4 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(S,L)=>{var V=t_(),ct=A(V);la(ct,{}),y(S,V)},$$slots:{default:!0}})}),y(C,x)};nt(b,C=>{n()&&C(O)})}y(p,v)},$$slots:{default:!0}}))})}y(i,a)},$$slots:{default:!0}})),F()}function n_(e,t){D(t,!0);let r=w(t,"ref",15,null),n=K(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=A(o);{let s=P(()=>Gt("text-muted-foreground text-sm",t.class));H(i,()=>sv,(a,l)=>{l(a,U({"data-slot":"dialog-description",get class(){return u(s)}},()=>n,{get ref(){return r()},set ref(c){r(c)}}))})}y(e,o),F()}class o_{#t=M(!1);get connected(){return u(this.#t)}set connected(t){_(this.#t,t,!0)}#e=M(!0);get deviceActive(){return u(this.#e)}set deviceActive(t){_(this.#e,t,!0)}#r=M(void 0);get info(){return u(this.#r)}set info(t){_(this.#r,t,!0)}#n=M(It([]));get renderers(){return u(this.#n)}set renderers(t){_(this.#n,t,!0)}setConnected(t){this.connected=t}setDeviceActive(t){this.deviceActive=t}setInfo(t){this.info=t}setRenderers(t){this.renderers=t}}const wr=new o_;function nd(e){return new Promise((t,r)=>{const n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight;const o=n.getContext("2d");if(!o){r(new Error("Failed to get canvas context"));return}o.drawImage(e,0,0),n.toBlob(i=>{i?t(i):r(new Error("Failed to create blob"))})})}function Bi(e,t,r){const n=document.createElement("a");n.href=e,t&&(n.download=t),r&&(n.target="_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function ca(e,t){const r=URL.createObjectURL(e);Bi(r,t),URL.revokeObjectURL(r)}async function i_(e,t){const n=await(await fetch(e)).blob();ca(n,t)}async function s_(e,t){ca(await nd(e),t)}async function a_(e,t="plot.png"){const r=nd(e);if(window.isSecureContext&&navigator.clipboard?.write&&window.ClipboardItem)try{const n=new ClipboardItem({"image/png":r});return await navigator.clipboard.write([n]),"copied"}catch{}try{return ca(await r,t),"downloaded"}catch{return"failed"}}var l_=z(" ",1),c_=z('Export preview'),u_=z('

No plot selected.

'),d_=z(""),f_=z('
Size: × ~ %
',1);function h_(e,t){D(t,!0);const r=1,n=1e4,o=1,i=1e4;let s=M("800"),a=M("600"),l=M("100"),c=M("svg");const d=P(()=>rt.currentPlotId!==null);function f(){const S=wr.renderers;return Array.isArray(S)?S.slice().sort((L,V)=>L.name.localeCompare(V.name)):[]}function h(S,L,V){if(!/^\d+$/.test(S))return!1;const ct=parseInt(S);return ct>=L&&ct<=V}const p=P(()=>h(u(s),r,n)),g=P(()=>h(u(a),r,n)),v=P(()=>h(u(l),o,i)),m=P(()=>u(p)&&u(g)&&u(v)&&u(d)),b=P(()=>{const S=rt.currentPlotId;return!S||!u(p)||!u(g)||!u(v)?null:_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01)},rt.token,rt.upid)});function O(){return wr.renderers.find(S=>S.id===u(c))}function C(){const S=rt.currentPlotId;if(!S||!u(m))return;const L=O();if(!L)return;const V=_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01),renderer:L.id,download:`plot_${S}${L.ext}`},rt.token,rt.upid);Bi(V)}function x(){const S=rt.currentPlotId;if(!S||!u(m))return;const L=O();if(!L)return;const V=_n(rt.host,{id:S,width:Math.min(parseInt(u(s)),n),height:Math.min(parseInt(u(a)),n),zoom:Math.max(parseInt(u(l))/100,.01),renderer:L.id},rt.token,rt.upid);Bi(V,void 0,!0)}function T(S){vt.exportDialogOpen=S}var k=N(),R=A(k);H(R,()=>$u,(S,L)=>{L(S,{get open(){return vt.exportDialogOpen},onOpenChange:T,children:(V,ct)=>{var st=N(),_t=A(st);H(_t,()=>rd,(G,Y)=>{Y(G,{class:"flex max-h-[85vh] max-w-[85vw] flex-col",children:(W,Z)=>{var X=f_(),ot=A(X);H(ot,()=>ed,(xt,Nt)=>{Nt(xt,{children:(ke,Vr)=>{var en=l_(),ua=A(en);H(ua,()=>td,(rn,Kn)=>{Kn(rn,{children:(Qo,da)=>{var $o=Xt("Export Plot");y(Qo,$o)},$$slots:{default:!0}})});var od=j(ua,2);{var id=rn=>{var Kn=N(),Qo=A(Kn);H(Qo,()=>n_,(da,$o)=>{$o(da,{children:(sd,E_)=>{var ad=Xt("No plot selected.");y(sd,ad)},$$slots:{default:!0}})}),y(rn,Kn)};nt(od,rn=>{u(d)||rn(id)})}y(ke,en)},$$slots:{default:!0}})});var I=j(ot,2),$=et(I);{var it=xt=>{var Nt=c_();zt(()=>Wt(Nt,"src",u(b))),y(xt,Nt)},ft=xt=>{var Nt=u_();y(xt,Nt)};nt($,xt=>{u(d)&&u(b)?xt(it):xt(ft,!1)})}var pt=j(I,2),tt=et(pt),at=j(et(tt),2);Wt(at,"min",r),Wt(at,"max",n);var Tt=j(at,4);Wt(Tt,"min",r),Wt(Tt,"max",n);var At=j(Tt,4);Wt(At,"min",o),Wt(At,"max",i);var lt=j(tt,2),Et=et(lt);Sn(Et,21,f,xt=>xt.id,(xt,Nt)=>{var ke=d_(),Vr=et(ke),en={};zt(()=>{Wt(ke,"title",u(Nt).descr),ir(Vr,`${u(Nt).name??""} (*${u(Nt).ext??""})`),en!==(en=u(Nt).id)&&(ke.value=(ke.__value=u(Nt).id)??"")}),y(xt,ke)});var Ct=j(Et,2);{let xt=P(()=>!u(m));ye(Ct,{variant:"secondary",onclick:x,get disabled(){return u(xt)},children:(Nt,ke)=>{var Vr=Xt("Open");y(Nt,Vr)},$$slots:{default:!0}})}var hr=j(Ct,2);{let xt=P(()=>!u(m));ye(hr,{onclick:C,get disabled(){return u(xt)},children:(Nt,ke)=>{var Vr=Xt("Download");y(Nt,Vr)},$$slots:{default:!0}})}zt(()=>{at.disabled=!u(d),nr(at,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(p)?"":"border-destructive bg-destructive/10"}`),Tt.disabled=!u(d),nr(Tt,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(g)?"":"border-destructive bg-destructive/10"}`),At.disabled=!u(d),nr(At,1,`bg-background h-9 w-20 rounded-md border px-3 text-sm ${u(v)?"":"border-destructive bg-destructive/10"}`),Et.disabled=!u(d)}),ri(at,()=>u(s),xt=>_(s,xt)),ri(Tt,()=>u(a),xt=>_(a,xt)),ri(At,()=>u(l),xt=>_(l,xt)),Gf(Et,()=>u(c),xt=>_(c,xt)),y(W,X)},$$slots:{default:!0}})}),y(V,st)},$$slots:{default:!0}})}),y(e,k),F()}var p_=z(''),g_=z('

');function v_(e,t){D(t,!1),ts();var r=N(),n=A(r);{var o=i=>{var s=g_(),a=et(s),l=et(a),c=j(a,2);{var d=f=>{var h=p_(),p=et(h);zt(()=>ir(p,vt.overlayAction.label)),Br("click",h,function(...g){vt.overlayAction.callback?.apply(this,g)}),y(f,h)};nt(c,f=>{vt.overlayAction&&f(d)})}zt(()=>ir(l,vt.overlayText)),y(i,s)};nt(n,i=>{vt.overlayText&&i(o)})}y(e,r),F()}Lo(["click"]);var di=Jf(()=>vt),m_=z('/'),b_=z(' ',1),y_=z(' ',1),w_=z('
',1);function __(e,t){D(t,!1);const r=[{keys:["←","↓"],action:"Previous plot"},{keys:["→","↑"],action:"Next plot"},{keys:["N"],action:"Newest plot"},{keys:["+","="],action:"Zoom in"},{keys:["-"],action:"Zoom out"},{keys:["0"],action:"Reset zoom"},{keys:["D"],action:"Delete plot"},{keys:["Alt+D"],action:"Clear all plots"},{keys:["S"],action:"Download SVG"},{keys:["P"],action:"Download PNG"},{keys:["C"],action:"Copy PNG"},{keys:["E"],action:"Export dialog"},{keys:["H"],action:"Toggle history"},{keys:["T"],action:"Toggle theme"},{keys:["?"],action:"Show shortcuts"}];function n(o){di(di().shortcutsDialogOpen=o)}ts(),$u(e,{get open(){return di().shortcutsDialogOpen},onOpenChange:n,children:(o,i)=>{rd(o,{class:"flex max-h-[85vh] max-w-sm flex-col",children:(s,a)=>{var l=w_(),c=A(l);ed(c,{children:(f,h)=>{td(f,{children:(p,g)=>{var v=Xt("Keyboard shortcuts");y(p,v)},$$slots:{default:!0}})},$$slots:{default:!0}});var d=j(c,2);Sn(d,5,()=>r,f=>f.action,(f,h)=>{var p=y_(),g=A(p),v=et(g),m=j(g,2);Sn(m,7,()=>u(h).keys,b=>b,(b,O,C)=>{var x=b_(),T=A(x);{var k=L=>{var V=m_();y(L,V)};nt(T,L=>{u(C)>0&&L(k)})}var R=j(T,2),S=et(R);zt(()=>ir(S,u(O))),y(b,x)}),zt(()=>ir(v,u(h).action)),y(f,p)}),y(s,l)},$$slots:{default:!0}})},$$slots:{default:!0}}),F()}class x_{ws=null;host;onMessage;onStatus;reconnectTimer=null;closed=!1;constructor(t,r,n){this.host=t,this.onMessage=r,this.onStatus=n}connect(){this.closed=!1,this.clearReconnect();try{this.ws=new WebSocket(xy(this.host))}catch{this.onStatus(!1),this.scheduleReconnect();return}this.ws.onopen=()=>{this.onStatus(!0)},this.ws.onmessage=t=>{try{const r=JSON.parse(t.data);this.onMessage(r)}catch{}},this.ws.onclose=()=>{this.onStatus(!1),this.closed||this.scheduleReconnect()},this.ws.onerror=()=>{this.ws?.close()}}disconnect(){this.closed=!0,this.clearReconnect(),this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null)}scheduleReconnect(){this.closed||(this.clearReconnect(),this.reconnectTimer=setTimeout(()=>this.connect(),2e3))}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const S_=500;class P_{host;token;allowWebsockets;callbacks;mode=0;lastState;pollTimer=null;wsManager=null;info;renderers=[];plots;constructor(t,r,n,o){this.host=t,this.token=r,this.allowWebsockets=n,this.callbacks=o}async connect(){try{this.info=await Cy(this.host,this.token),await this.updateRenderers(),await this.updatePlots()}catch{}this.allowWebsockets?this.startWebSocket():this.startPolling()}disconnect(){this.stopPolling(),this.wsManager?.disconnect(),this.wsManager=null,this.mode=0}async updateRenderers(){try{this.renderers=await Ty(this.host,this.token),this.callbacks.onRenderersChanged(this.renderers)}catch{}}async updatePlots(){try{const t=await Py(this.host,this.token);this.plots=t,this.callbacks.onPlotsChanged(t)}catch{}}getUpid(){return this.plots?.state.upid.toString()??"0"}async reconnect(){this.disconnect(),await this.connect()}startWebSocket(){this.stopPolling(),this.mode=2,this.wsManager=new x_(this.host,t=>this.handleRemoteState(t),t=>{t?(this.callbacks.onConnectionChanged(!0),this.updateRenderers(),this.updatePlots()):(this.callbacks.onConnectionChanged(!1),this.wsManager?.disconnect(),this.wsManager=null,this.stopPolling(),this.mode=0)}),this.wsManager.connect()}startPolling(){this.stopPolling(),this.mode=1,this.pollTimer=setInterval(()=>this.poll(),S_)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}async poll(){try{const t=await Sy(this.host,this.token);this.handleRemoteState(t)}catch{this.mode===1&&(this.callbacks.onConnectionChanged(!1),this.stopPolling(),this.mode=0)}}handleRemoteState(t){const r=this.lastState;this.lastState=t,(!r||r.active!==t.active)&&this.callbacks.onDeviceActiveChanged(t.active),t.title!==void 0&&(!r||r.title!==t.title)&&this.callbacks.onTitleChanged(t.title),(!r||r.upid!==t.upid||r.hsize!==t.hsize)&&this.updatePlots()}}function T_(e,t){function r(n){const o=n.target;if(!(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT")&&!document.querySelector("[data-dialog-overlay]"))for(const i of t){const s=n.key===i.key,a=i.altKey?n.altKey:!n.altKey;if(s&&a){n.preventDefault(),i.action();return}}}return window.addEventListener("keydown",r),{destroy(){window.removeEventListener("keydown",r)},update(n){t=n}}}var C_=z('
',1),A_=z(" ",1);function k_(e,t){D(t,!0);let r=M(null),n,o;gt(()=>{document.title=rt.title}),es(()=>{const v=_y();return rt.configure(v.host,v.token),v.sidebarHidden&&(vt.sidebarVisible=!1),n=new P_(v.host,v.token,v.allowWebsockets,{onPlotsChanged(m){rt.updatePlots(m)},onConnectionChanged(m){wr.setConnected(m),m?vt.hideOverlay():vt.showOverlay("Connection lost.",{label:"Reconnect",callback:()=>i()})},onDeviceActiveChanged(m){wr.setDeviceActive(m),o&&clearTimeout(o),m?vt.hideOverlay():o=setTimeout(()=>{vt.showOverlay("Device inactive.")},1e3)},onRenderersChanged(m){wr.setRenderers(m)},onTitleChanged(m){rt.title=m}}),n.connect().then(()=>{n.info&&(wr.setInfo(n.info),console.log("Connected to "+n.info.version))}),()=>{n.disconnect(),o&&clearTimeout(o)}});async function i(){vt.showOverlay("Reconnecting…"),await n.reconnect(),n.info&&wr.setInfo(n.info)}async function s(){if(u(r)?.src)try{await i_(u(r).src,"plot.svg")}catch{vt.showToast("Failed to download SVG","error")}}async function a(){if(u(r))try{await s_(u(r),"plot.png")}catch{vt.showToast("Failed to download PNG","error")}}async function l(){if(!u(r))return;const v=await a_(u(r));v==="copied"?vt.showToast("PNG copied to clipboard"):v==="downloaded"?vt.showToast("Clipboard unavailable — PNG downloaded instead"):vt.showToast("Failed to copy PNG","error")}async function c(){const v=rt.currentPlotId;if(v)try{await Zu(rt.host,{id:v},rt.token)}catch{vt.showToast("Failed to remove plot","error")}}async function d(){try{await Ay(rt.host,rt.token)}catch{vt.showToast("Failed to clear plots","error")}}var f=A_(),h=A(f);sp(h,{});var p=j(h,2);ih(p,{});var g=j(p,2);H(g,()=>vy,(v,m)=>{m(v,{children:(b,O)=>{var C=C_(),x=A(C),T=et(x),k=et(T);Bw(k,{ondownloadsvg:s,ondownloadpng:a,oncopypng:l,onremove:c,onclear:d});var R=j(k,2);Iy(R,{get imageRef(){return u(r)},set imageRef(st){_(r,st,!0)}});var S=j(T,2);Zw(S,{}),vc(x,(st,_t)=>T_?.(st,_t),()=>[{key:"ArrowLeft",action:()=>rt.prevPage()},{key:"ArrowDown",action:()=>rt.prevPage()},{key:"ArrowRight",action:()=>rt.nextPage()},{key:"ArrowUp",action:()=>rt.nextPage()},{key:"n",action:()=>rt.newestPage()},{key:"+",action:()=>rt.zoomIn()},{key:"=",action:()=>rt.zoomIn()},{key:"-",action:()=>rt.zoomOut()},{key:"0",action:()=>rt.zoomReset()},{key:"d",altKey:!0,action:d},{key:"d",action:c},{key:"Delete",action:c},{key:"s",action:s},{key:"p",action:a},{key:"c",action:l},{key:"h",action:()=>vt.toggleSidebar()},{key:"e",action:()=>vt.openExportDialog()},{key:"t",action:kc},{key:"?",action:()=>vt.shortcutsDialogOpen=!0}]);var L=j(x,2);h_(L,{});var V=j(L,2);__(V,{});var ct=j(V,2);v_(ct,{}),y(b,C)},$$slots:{default:!0}})}),y(e,f),F()}gc(k_,{target:document.getElementById("app")}); diff --git a/man/hgd.Rd b/man/hgd.Rd index 9cb55d5..0274f58 100644 --- a/man/hgd.Rd +++ b/man/hgd.Rd @@ -17,7 +17,8 @@ hgd( pointsize = getOption("httpgd.pointsize", 12), system_fonts = getOption("httpgd.system_fonts", list()), user_fonts = getOption("httpgd.user_fonts", list()), - reset_par = getOption("httpgd.reset_par", FALSE) + reset_par = getOption("httpgd.reset_par", FALSE), + title = getOption("httpgd.title", "httpgd") ) } \arguments{ @@ -68,6 +69,10 @@ font file.} \item{reset_par}{If set to \code{TRUE}, global graphics parameters will be saved on device start and reset every time the plots are cleared (see \code{\link[graphics:par]{graphics::par()}}).} + +\item{title}{Document title shown in the browser tab of connected web +clients. Useful to tell multiple R processes apart. Can be changed later +with \code{\link[=hgd_title]{hgd_title()}}.} } \value{ No return value, called to initialize graphics device. diff --git a/man/hgd_details.Rd b/man/hgd_details.Rd index 80570ba..978924c 100644 --- a/man/hgd_details.Rd +++ b/man/hgd_details.Rd @@ -14,6 +14,7 @@ List of status variables with the following named items: \verb{$host}: Server hostname, \verb{$port}: Server port, \verb{$token}: Security token, +\verb{$title}: Browser tab title (see \code{\link[=hgd_title]{hgd_title()}}), \verb{$hsize}: Plot history size (how many plots are accessible), \verb{$upid}: Update ID (changes when the device has received new information), \verb{$active}: Is the device the currently activated device. diff --git a/man/hgd_title.Rd b/man/hgd_title.Rd new file mode 100644 index 0000000..db1a183 --- /dev/null +++ b/man/hgd_title.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/httpgd.R +\name{hgd_title} +\alias{hgd_title} +\title{Get or set the browser tab title of a httpgd device.} +\usage{ +hgd_title(title, which = dev.cur()) +} +\arguments{ +\item{title}{New title string. If missing, the current title is returned.} + +\item{which}{Which device (ID).} +} +\value{ +The current title (when \code{title} is missing), otherwise the new +\code{title}, invisibly. +} +\description{ +Sets the document title shown in the browser tab of web clients connected +to a httpgd graphics device. Connected clients are updated immediately, +without having to reload the page. The initial title can be set with the +\code{title} argument of \code{\link[=hgd]{hgd()}}. When called without a \code{title} argument, the +current title is returned. +This function will only work after starting a device with \code{\link[=hgd]{hgd()}}. +} +\examples{ +\dontrun{ + +hgd(title = "Analysis A") +hgd_title("Analysis B") # connected clients update immediately +hgd_title() # returns "Analysis B" + +dev.off() +} +} diff --git a/man/httpgd-package.Rd b/man/httpgd-package.Rd index ba64469..0ace165 100644 --- a/man/httpgd-package.Rd +++ b/man/httpgd-package.Rd @@ -24,6 +24,7 @@ Other contributors: \itemize{ \item Kun Ren \email{mail@renkun.me} [contributor] \item Jeroen Ooms \email{jeroen@berkeley.edu} (\href{https://orcid.org/0000-0002-4035-0289}{ORCID}) [contributor] + \item Bill Evans \email{Bill@8PawExpress.com} [contributor] } } diff --git a/src/cpp11.cpp b/src/cpp11.cpp index dd8da01..57e203e 100644 --- a/src/cpp11.cpp +++ b/src/cpp11.cpp @@ -6,10 +6,10 @@ #include // httpgd.cpp -bool httpgd_(int devnum, std::string host, int port, bool cors, std::string token, bool silent, std::string wwwpath); -extern "C" SEXP _httpgd_httpgd_(SEXP devnum, SEXP host, SEXP port, SEXP cors, SEXP token, SEXP silent, SEXP wwwpath) { +bool httpgd_(int devnum, std::string host, int port, bool cors, std::string token, bool silent, std::string wwwpath, std::string title); +extern "C" SEXP _httpgd_httpgd_(SEXP devnum, SEXP host, SEXP port, SEXP cors, SEXP token, SEXP silent, SEXP wwwpath, SEXP title) { BEGIN_CPP11 - return cpp11::as_sexp(httpgd_(cpp11::as_cpp>(devnum), cpp11::as_cpp>(host), cpp11::as_cpp>(port), cpp11::as_cpp>(cors), cpp11::as_cpp>(token), cpp11::as_cpp>(silent), cpp11::as_cpp>(wwwpath))); + return cpp11::as_sexp(httpgd_(cpp11::as_cpp>(devnum), cpp11::as_cpp>(host), cpp11::as_cpp>(port), cpp11::as_cpp>(cors), cpp11::as_cpp>(token), cpp11::as_cpp>(silent), cpp11::as_cpp>(wwwpath), cpp11::as_cpp>(title))); END_CPP11 } // httpgd.cpp @@ -20,6 +20,13 @@ extern "C" SEXP _httpgd_httpgd_details_(SEXP devnum) { END_CPP11 } // httpgd.cpp +bool httpgd_title_(int devnum, std::string title); +extern "C" SEXP _httpgd_httpgd_title_(SEXP devnum, SEXP title) { + BEGIN_CPP11 + return cpp11::as_sexp(httpgd_title_(cpp11::as_cpp>(devnum), cpp11::as_cpp>(title))); + END_CPP11 +} +// httpgd.cpp std::string httpgd_random_token_(int len); extern "C" SEXP _httpgd_httpgd_random_token_(SEXP len) { BEGIN_CPP11 @@ -29,9 +36,10 @@ extern "C" SEXP _httpgd_httpgd_random_token_(SEXP len) { extern "C" { static const R_CallMethodDef CallEntries[] = { - {"_httpgd_httpgd_", (DL_FUNC) &_httpgd_httpgd_, 7}, + {"_httpgd_httpgd_", (DL_FUNC) &_httpgd_httpgd_, 8}, {"_httpgd_httpgd_details_", (DL_FUNC) &_httpgd_httpgd_details_, 1}, {"_httpgd_httpgd_random_token_", (DL_FUNC) &_httpgd_httpgd_random_token_, 1}, + {"_httpgd_httpgd_title_", (DL_FUNC) &_httpgd_httpgd_title_, 2}, {NULL, NULL, 0} }; } diff --git a/src/httpgd.cpp b/src/httpgd.cpp index 36b227d..876cf05 100644 --- a/src/httpgd.cpp +++ b/src/httpgd.cpp @@ -19,7 +19,8 @@ #include "unigd_impl.h" [[cpp11::register]] bool httpgd_(int devnum, std::string host, int port, bool cors, - std::string token, bool silent, std::string wwwpath) + std::string token, bool silent, std::string wwwpath, + std::string title) { // wwwpath must be determined in R, because devtools overrides system.path // with a shim which results in an empty string *sometimes*. @@ -29,7 +30,8 @@ const httpgd::web::HttpgdServerConfig conf{host, port, wwwpath, cors, use_token, token, - recording, silent, httpgd::rng::uuid()}; + recording, silent, httpgd::rng::uuid(), + title}; return (new httpgd::web::WebServer(conf))->attach(devnum); } @@ -48,14 +50,32 @@ auto* server = static_cast(client); const auto svr_config = server->get_config(); + const auto title = server->title(); using namespace cpp11::literals; return cpp11::writable::list{ "host"_nm = svr_config.host.c_str(), "port"_nm = server->port(), - "token"_nm = svr_config.token.c_str(), "status"_nm = server->status_info()}; + "token"_nm = svr_config.token.c_str(), "status"_nm = server->status_info(), + "title"_nm = title.c_str()}; return cpp11::writable::list{}; } +[[cpp11::register]] bool httpgd_title_(int devnum, std::string title) +{ + if (httpgd::ugd::api == nullptr) + { + cpp11::stop("unigd not initialized."); + } + auto* client = httpgd::ugd::api->device_get(devnum, httpgd::ugd::httpgd_client_id); + if (!client) + { + cpp11::stop("Device is not a unigd device with attached httpgd client."); + } + + static_cast(client)->set_title(title); + return true; +} + [[cpp11::register]] std::string httpgd_random_token_(int len) { if (len < 0) diff --git a/src/httpgd_webserver.cpp b/src/httpgd_webserver.cpp index 56f33e9..9b94e16 100644 --- a/src/httpgd_webserver.cpp +++ b/src/httpgd_webserver.cpp @@ -201,6 +201,28 @@ const HttpgdServerConfig& WebServer::get_config() return m_conf; } +std::string WebServer::title() +{ + std::lock_guard _(m_mtx_title); + return m_conf.title; +} + +void WebServer::set_title(const std::string& t_title) +{ + { + std::lock_guard _(m_mtx_title); + m_conf.title = t_title; + } + device_state_change(); +} + +crow::json::wvalue WebServer::state_json(const unigd_device_state& state) +{ + auto json = device_state_json(state); + json["title"] = title(); + return json; +} + unsigned short WebServer::port() { m_app.wait_for_server_start(); @@ -249,7 +271,7 @@ void WebServer::run() if (m_api) { const auto state = m_api->device_state(m_ugd_handle); - return crow::response(device_state_json(state)); + return crow::response(state_json(state)); } return crow::response(crow::status::NOT_FOUND); }); @@ -304,7 +326,7 @@ void WebServer::run() plot_list.push_back( crow::json::wvalue({{"id", fmt::format("{}", qr.ids[i])}})); } - const auto sj = device_state_json(qr.state); + const auto sj = state_json(qr.state); m_api->device_plots_find_destroy(find_handle); return crow::response( @@ -395,7 +417,7 @@ void WebServer::run() if (m_api->device_plots_remove(m_ugd_handle, *p_id)) { const auto state = m_api->device_state(m_ugd_handle); - return crow::response(device_state_json(state)); + return crow::response(state_json(state)); } } return crow::response(crow::status::NOT_FOUND); @@ -412,7 +434,7 @@ void WebServer::run() if (m_api->device_plots_clear(m_ugd_handle)) { const auto state = m_api->device_state(m_ugd_handle); - return crow::response(device_state_json(state)); + return crow::response(state_json(state)); } return crow::response(crow::status::NOT_FOUND); }); @@ -498,7 +520,7 @@ void WebServer::broadcast_state(const unigd_device_state& t_state) std::lock_guard _(m_mtx_update_subs); for (auto u : m_update_subs) { - u->send_text(device_state_json(t_state).dump()); + u->send_text(state_json(t_state).dump()); } } diff --git a/src/httpgd_webserver.h b/src/httpgd_webserver.h index 59d87bb..b567bb9 100644 --- a/src/httpgd_webserver.h +++ b/src/httpgd_webserver.h @@ -26,6 +26,7 @@ struct HttpgdServerConfig bool record_history; bool silent; std::string id; + std::string title; }; class HttpgdLogHandler : public crow::ILogHandler @@ -70,6 +71,9 @@ class WebServer unsigned short port(); void broadcast_state(const unigd_device_state& state); + void set_title(const std::string& t_title); + std::string title(); + private: unigd_api_v1* m_api = nullptr; UNIGD_HANDLE m_ugd_handle = nullptr; @@ -80,8 +84,10 @@ class WebServer HttpgdLogHandler m_log_handler; std::mutex m_mtx_update_subs; std::unordered_set m_update_subs; + std::mutex m_mtx_title; std::thread m_server_thread; + crow::json::wvalue state_json(const unigd_device_state& state); void run(); }; } // namespace web