diff --git a/app.md b/app.md index 8a113d6..e5a7727 100644 --- a/app.md +++ b/app.md @@ -2,8 +2,8 @@ name: kanban lang: go domain: tools -version: 0.2.0 -description: "Kanban board con persistencia SQLite, drag-and-drop entre columnas (dnd-kit), tracking del tiempo por columna y adjuntos de archivos por card (drag&drop en descripcion y chat). Frontend Vite + React + Mantine v9 embebido en el binario Go." +version: 0.5.0 +description: "Kanban board con persistencia SQLite, drag-and-drop entre columnas (dnd-kit), tracking del tiempo por columna, adjuntos de archivos por card, notificaciones realtime (SSE) y modulos externos (Jira). Frontend Vite + React + Mantine v9 embebido en el binario Go. Endpoint MCP Streamable HTTP en /mcp." tags: [service, kanban, web, dnd-kit, mantine, sqlite, time-tracking] uses_functions: - random_hex_id_go_core @@ -38,6 +38,7 @@ uses_functions: - fetch_json_ts_infra - claude_stream_go_core - mcp_server_stdio_go_infra + - mcp_server_http_go_infra - ws_upgrader_go_infra uses_types: - DurationStats_go_datascience @@ -192,3 +193,6 @@ Una linea por bump SemVer. Bump-type segun `.claude/commands/version.md`: - v0.1.0 (2026-05-18) — baseline. - v0.2.0 (2026-05-27) — adjuntos de archivos por card (issue 0128): tabla `card_files` con soft-delete, endpoints REST (`POST/GET/DELETE /api/cards/{id}/files`, `GET/DELETE /api/files/{id}`), tres vias de upload (drag&drop en descripcion y chat, boton en tab Archivos), render inline de imagenes via `MessageBody`. Limite 10 MB. +- v0.3.1 (2026-05-21) — patch: debounce board.invalidated (300ms trailing) + autoClose 4s en toasts de notification.created. Fix de blow-up de memoria en navegador por ráfagas de SSE. +- v0.4.0 (2026-05-22) — minor: endpoint MCP Streamable HTTP `/mcp` con per-user bearer tokens (tabla `mcp_tokens`, migration 017). Modal "MCP tokens" en avatar menu para generar/listar/revocar. Vite proxy enruta `/mcp` a WSL. Usa nueva funcion `mcp_server_http_go_infra`. Doc en `docs/MCP.md`. +- v0.5.0 (2026-05-27) — minor: merge ramas notifications-realtime + modules con master post-files. Trae notificaciones SSE (tabla `notifications`, migration 015), modulos externos para sincronizacion bidireccional (Jira, etc., tabla `modules`, migration 016), tokens MCP per-user (migration 017). Conserva files attachments del 0128. Renumeradas migrations notif 014/015/016 -> 015/016/017. diff --git a/backend/dist/assets/index-DFLRkdHe.js b/backend/dist/assets/index-DFLRkdHe.js new file mode 100644 index 0000000..2d39878 --- /dev/null +++ b/backend/dist/assets/index-DFLRkdHe.js @@ -0,0 +1,1318 @@ +function EK(e,t){for(var n=0;ni[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();var Uv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fk={exports:{}},uh={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var AT;function MK(){if(AT)return uh;AT=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var l in r)l!=="key"&&(a[l]=r[l])}else a=r;return r=a.ref,{$$typeof:e,type:i,key:o,ref:r!==void 0?r:null,props:a}}return uh.Fragment=t,uh.jsx=n,uh.jsxs=n,uh}var OT;function DK(){return OT||(OT=1,fk.exports=MK()),fk.exports}var v=DK();function Nn(e){return Object.keys(e)}function dk(e){return e&&typeof e=="object"&&!Array.isArray(e)}function q6(e,t){const n={...e},i=t;return dk(e)&&dk(t)&&Object.keys(t).forEach(r=>{dk(i[r])&&r in e?n[r]=q6(n[r],i[r]):n[r]=i[r]}),n}function RK(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function PK(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function em(e){const t=PK(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function TT(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function Az(e,{shouldScale:t=!1}={}){function n(i){if(i===0||i==="0")return`0${e}`;if(typeof i=="number"){const r=`${i/16}${e}`;return t?TT(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(a=>n(a)).join(",");if(i.includes(" "))return i.split(" ").map(a=>n(a)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const a=`${Number(r)/16}${e}`;return t?TT(a):a}}return i}return n}const pe=Az("rem",{shouldScale:!0}),Ig=Az("em");function Pu(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Oz(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(n=>t.test(n))}return!1}var hk={exports:{}},Pt={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ET;function NK(){if(ET)return Pt;ET=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function g(W){return W===null||typeof W!="object"?null:(W=p&&W[p]||W["@@iterator"],typeof W=="function"?W:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function _(W,V,L){this.props=W,this.context=V,this.refs=k,this.updater=L||b}_.prototype.isReactComponent={},_.prototype.setState=function(W,V){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,V,"setState")},_.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function x(){}x.prototype=_.prototype;function j(W,V,L){this.props=W,this.context=V,this.refs=k,this.updater=L||b}var T=j.prototype=new x;T.constructor=j,w(T,_.prototype),T.isPureReactComponent=!0;var A=Array.isArray;function O(){}var M={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(W,V,L){var Z=L.ref;return{$$typeof:e,type:W,key:V,ref:Z!==void 0?Z:null,props:L}}function R(W,V){return F(W.type,V,W.props)}function I(W){return typeof W=="object"&&W!==null&&W.$$typeof===e}function q(W){var V={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(L){return V[L]})}var G=/\/+/g;function U(W,V){return typeof W=="object"&&W!==null&&W.key!=null?q(""+W.key):V.toString(36)}function $(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status=="string"?W.then(O,O):(W.status="pending",W.then(function(V){W.status==="pending"&&(W.status="fulfilled",W.value=V)},function(V){W.status==="pending"&&(W.status="rejected",W.reason=V)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function D(W,V,L,Z,ie){var re=typeof W;(re==="undefined"||re==="boolean")&&(W=null);var X=!1;if(W===null)X=!0;else switch(re){case"bigint":case"string":case"number":X=!0;break;case"object":switch(W.$$typeof){case e:case t:X=!0;break;case h:return X=W._init,D(X(W._payload),V,L,Z,ie)}}if(X)return ie=ie(W),X=Z===""?"."+U(W,0):Z,A(ie)?(L="",X!=null&&(L=X.replace(G,"$&/")+"/"),D(ie,V,L,"",function(se){return se})):ie!=null&&(I(ie)&&(ie=R(ie,L+(ie.key==null||W&&W.key===ie.key?"":(""+ie.key).replace(G,"$&/")+"/")+X)),V.push(ie)),1;X=0;var le=Z===""?".":Z+":";if(A(W))for(var ee=0;ee{const i=S.use(t);if(i===null)throw new Error(e);return i}]}function DT(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Bg(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function $K(e,t,n){for(let i=e-1;i>=0;i-=1)if(!t[i].disabled)return i;if(n){for(let i=t.length-1;i>-1;i-=1)if(!t[i].disabled)return i}return e}function zK(e,t,n){for(let i=e+1;i{var b;n==null||n(l);const u=Array.from(((b=Bg(l.currentTarget,e))==null?void 0:b.querySelectorAll(t))||[]).filter(w=>LK(l.currentTarget,w,e)),f=u.findIndex(w=>l.currentTarget===w),h=zK(f,u,i),d=$K(f,u,i),p=a==="rtl"?d:h,g=a==="rtl"?h:d;switch(l.key){case"ArrowRight":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),r&&u[p].click());break;case"ArrowLeft":o==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[g].focus(),r&&u[g].click());break;case"ArrowUp":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[d].focus(),r&&u[d].click());break;case"ArrowDown":o==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),r&&u[h].click());break;case"Home":l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break;case"End":{l.stopPropagation(),l.preventDefault();const w=u.length-1;!u[w].disabled&&u[w].focus();break}}}}const IK={app:100,modal:200,popover:300,overlay:400,max:9999};function ka(e){return IK[e]}const wS=()=>{};function BK(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||wS:n=>{var i;n.key==="Escape"&&(e(n),(i=t.onTrigger)==null||i.call(t))}}function $t(e,t="size",n=!0){if(e!==void 0)return Oz(e)?n?pe(e):e:`var(--${t}-${e})`}function Yn(e){return $t(e,"mantine-spacing")}function qn(e){return e===void 0?"var(--mantine-radius-default)":$t(e,"mantine-radius")}function oi(e){return $t(e,"mantine-font-size")}function FK(e){return $t(e,"mantine-line-height",!1)}function W6(e){if(e)return $t(e,"mantine-shadow",!1)}function kr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function G6(e,t){return e in t?em(t[e]):em(e)}function tm(e,t){const n=e.map(i=>({value:i,px:G6(i,t)}));return n.sort((i,r)=>i.px-r.px),n}function Ur(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function qK(e,t,n){var i;return n?Array.from(((i=Bg(n,t))==null?void 0:i.querySelectorAll(e))||[]).findIndex(r=>r===n):null}function es(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function hl(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function Th(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)}),[])}function vy(e,t){const{delay:n,flushOnUnmount:i,leading:r,maxWait:a}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1,maxWait:void 0}:t,o=Th(e),l=S.useRef(0),u=S.useRef(0),f=S.useRef(null),h=S.useMemo(()=>{const d=Object.assign((...p)=>{window.clearTimeout(l.current),f.current=p;const g=d._isFirstCall;d._isFirstCall=!1;function b(){window.clearTimeout(l.current),window.clearTimeout(u.current),l.current=0,u.current=0,d._isFirstCall=!0,d._hasPendingCallback=!1}function w(){a!==void 0&&u.current===0&&(u.current=window.setTimeout(()=>{if(l.current!==0){const x=f.current;b(),o(...x)}},a))}if(r&&g){o(...p);const x=()=>{b()},j=()=>{l.current!==0&&(b(),o(...p))},T=()=>{b()};d.flush=j,d.cancel=T,l.current=window.setTimeout(x,n),w();return}if(r&&!g){d._hasPendingCallback=!0;const x=()=>{l.current!==0&&(b(),o(...p))},j=()=>{b()};d.flush=x,d.cancel=j;const T=()=>{b()};l.current=window.setTimeout(T,n),w();return}d._hasPendingCallback=!0;const k=()=>{l.current!==0&&(b(),o(...p))},_=()=>{b()};d.flush=k,d.cancel=_,l.current=window.setTimeout(k,n),w()},{flush:()=>{},cancel:()=>{},isPending:()=>d._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return d},[o,n,r,a]);return S.useEffect(()=>()=>{i?h.flush():h.cancel()},[h,i]),h}const HK=["mousedown","touchstart"];function UK(e,t,n,i=!0){const r=S.useRef(null),a=t||HK,o=S.useEffectEvent(u=>{const{target:f}=u??{};if(!document.body.contains(f)&&(f==null?void 0:f.tagName)!=="HTML")return;const h=u.composedPath();Array.isArray(n)?n.every(d=>!!d&&!h.includes(d))&&e(u):r.current&&!h.includes(r.current)&&e(u)}),l=a.join(",");return S.useEffect(()=>{if(!i)return;const u=l.split(",");return u.forEach(f=>document.addEventListener(f,o)),()=>{u.forEach(f=>document.removeEventListener(f,o))}},[l,i]),r}function VK(e={}){const t=e.timeout??2e3,[n,i]=S.useState(null),[r,a]=S.useState(!1),o=S.useRef(null);S.useEffect(()=>()=>{window.clearTimeout(o.current)},[]);const l=h=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(h)};return{copy:h=>{"clipboard"in navigator?navigator.clipboard.writeText(h).then(()=>{i(null),l(!0)}).catch(d=>i(d)):i(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{a(!1),i(null),window.clearTimeout(o.current)},error:n,copied:r}}function WK(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function GK(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[i,r]=S.useState(n?t:WK(e));return S.useEffect(()=>{try{if("matchMedia"in window){const a=window.matchMedia(e);r(a.matches);const o=l=>r(l.matches);return a.addEventListener("change",o),()=>{a.removeEventListener("change",o)}}}catch{return}},[e]),i||!1}const vs=typeof document<"u"?S.useLayoutEffect:S.useEffect;function ss(e,t){const n=S.useRef(!1);S.useEffect(()=>()=>{n.current=!1},[]),S.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function Ez({opened:e,shouldReturnFocus:t=!0}){const n=S.useRef(null),i=()=>{var r;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((r=n.current)==null||r.focus({preventScroll:!0}))};return ss(()=>{let r=-1;const a=o=>{o.key==="Tab"&&window.clearTimeout(r)};if(document.addEventListener("keydown",a),e)n.current=document.activeElement;else if(t){const o=document.activeElement;r=window.setTimeout(()=>{const l=document.activeElement;(l===null||l===document.body||l===o)&&i()},10)}return()=>{window.clearTimeout(r),document.removeEventListener("keydown",a)}},[e,t]),i}const YK=/input|select|textarea|button|object/,Mz="a, input, select, textarea, button, object, [tabindex]";function KK(e){return e.style.display==="none"}function XK(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let t=e;for(;t&&!(t===document.body||t.nodeType===11);){if(KK(t))return!1;t=t.parentNode}return!0}function Dz(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function kS(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(Dz(e));return(YK.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&XK(e)}function Rz(e){const t=Dz(e);return(Number.isNaN(t)||t>=0)&&kS(e)}function ZK(e){return Array.from(e.querySelectorAll(Mz)).filter(Rz)}function QK(e,t){const n=ZK(e);if(!n.length){t.preventDefault();return}const i=n[t.shiftKey?0:n.length-1],r=e.getRootNode();let a=i===r.activeElement||e===r.activeElement;const o=r.activeElement;if(o.tagName==="INPUT"&&o.getAttribute("type")==="radio"&&(a=n.filter(u=>u.getAttribute("type")==="radio"&&u.getAttribute("name")===o.getAttribute("name")).includes(i)),!a)return;t.preventDefault();const l=n[t.shiftKey?n.length-1:0];l&&l.focus()}function JK(e=!0){const t=S.useRef(null),n=r=>{let a=r.querySelector("[data-autofocus]");if(!a){const o=Array.from(r.querySelectorAll(Mz));a=o.find(Rz)||o.find(kS)||null,!a&&kS(r)&&(a=r)}a?a.focus({preventScroll:!0}):console.warn("[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node",r)},i=S.useCallback(r=>{if(e){if(r===null){t.current=null;return}t.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn("[@mantine/hooks/use-focus-trap] Ref node is not part of the dom",r)}),t.current=r)}},[e]);return S.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});const r=a=>{a.key==="Tab"&&t.current&&QK(t.current,a)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),i}const eX=e=>(e+1)%1e6;function tX(){const[,e]=S.useReducer(eX,0);return e}function Vi(e){const[t,n]=S.useState(`mantine-${S.useId().replace(/:/g,"")}`);return vs(()=>{n(hl())},[]),typeof e=="string"?e:t}function Pz(e,t,n){const i=S.useEffectEvent(t);S.useEffect(()=>(window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)),[e])}function nm(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function nX(...e){const t=new Map;return n=>{if(e.forEach(i=>{const r=nm(i,n);r&&t.set(i,r)}),t.size>0)return()=>{e.forEach(i=>{const r=t.get(i);r&&typeof r=="function"?r():nm(i,null)}),t.clear()}}}function Hn(...e){return S.useCallback(nX(...e),e)}function Nz(e){return{x:es(e.x,0,1),y:es(e.y,0,1)}}function $z(e,t,n="ltr"){const i=S.useRef(!1),r=S.useRef(!1),a=S.useRef(0),o=S.useRef(null),[l,u]=S.useState(!1);return S.useEffect(()=>(i.current=!0,()=>{var f;(f=o.current)==null||f.call(o)}),[]),{ref:S.useCallback(f=>{const h=({x:j,y:T})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(i.current&&f){f.style.userSelect="none";const A=f.getBoundingClientRect();if(A.width&&A.height){const O=es((j-A.left)/A.width,0,1);e({x:n==="ltr"?O:1-O,y:es((T-A.top)/A.height,0,1)})}}})},d=()=>{document.addEventListener("mousemove",k),document.addEventListener("mouseup",b),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",b)},p=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",b)},g=()=>{!r.current&&i.current&&(r.current=!0,typeof(t==null?void 0:t.onScrubStart)=="function"&&t.onScrubStart(),u(!0),d())},b=()=>{r.current&&i.current&&(r.current=!1,u(!1),p(),setTimeout(()=>{typeof(t==null?void 0:t.onScrubEnd)=="function"&&t.onScrubEnd()},0))},w=j=>{g(),j.preventDefault(),k(j)},k=j=>h({x:j.clientX,y:j.clientY}),_=j=>{j.cancelable&&j.preventDefault(),g(),x(j)},x=j=>{j.cancelable&&j.preventDefault(),h({x:j.changedTouches[0].clientX,y:j.changedTouches[0].clientY})};return f==null||f.addEventListener("mousedown",w),f==null||f.addEventListener("touchstart",_,{passive:!1}),o.current=()=>{p(),cancelAnimationFrame(a.current)},()=>{f&&(f.removeEventListener("mousedown",w),f.removeEventListener("touchstart",_))}},[n,e]),active:l}}function ji({value:e,defaultValue:t,finalValue:n,onChange:i=()=>{}}){const[r,a]=S.useState(t!==void 0?t:n),o=(l,...u)=>{a(l),i==null||i(l,...u)};return e!==void 0?[e,i,!0]:[r,o,!1]}function Y6(e,t){return GK("(prefers-reduced-motion: reduce)",e,t)}function zz(e=!1,t={}){const[n,i]=S.useState(e),r=S.useCallback(()=>{i(o=>{var l;return o||((l=t.onOpen)==null||l.call(t),!0)})},[t.onOpen]),a=S.useCallback(()=>{i(o=>{var l;return o&&((l=t.onClose)==null||l.call(t),!1)})},[t.onClose]);return[n,{open:r,close:a,toggle:S.useCallback(()=>{n?a():r()},[a,r,n]),set:i}]}function iX(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}var mk={exports:{}},Yi={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var RT;function rX(){if(RT)return Yi;RT=1;var e=H6();function t(u){var f="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mk.exports=rX(),mk.exports}var ol=Lz();const Eh=gn(ol);function aX(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function oX(e){function t(i){const r=Object.keys(i).reduce((a,o)=>(a[`${e}:${o}`]=l=>i[o](l.detail),a),{});vs(()=>(Object.keys(r).forEach(a=>{window.removeEventListener(a,r[a]),window.addEventListener(a,r[a])}),()=>Object.keys(r).forEach(a=>{window.removeEventListener(a,r[a])})),[r])}function n(i){return(...r)=>aX(`${e}:${String(i)}`,r[0])}return[t,n]}var sX={};function lX(){return"development"}function gy(e){var n;const t=J.version;return typeof J.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function Sg(e,t=document){const n=t.querySelector(e);if(n)return n;const i=t.querySelectorAll("*");for(let r=0;r{Object.entries(n).forEach(([i,r])=>{t[i]?t[i]=vt(t[i],r):t[i]=r})}),t}function im({theme:e,classNames:t,props:n,stylesCtx:i}){return cX((Array.isArray(t)?t:[t]).map(r=>typeof r=="function"?r(e,n,i):r||uX))}function Fg({theme:e,styles:t,props:n,stylesCtx:i}){const r=Array.isArray(t)?t:[t],a={};for(const o of r)typeof o=="function"?Object.assign(a,o(e,n,i)):o&&Object.assign(a,o);return a}function NT(e){return e==="auto"||e==="dark"||e==="light"}function fX({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const i=window.localStorage.getItem(e);return NT(i)?i:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:n=>{t=i=>{i.storageArea===window.localStorage&&i.key===e&&NT(i.newValue)&&n(i.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}function rm(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function dX(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function hX(e){let t=e.replace("#","");if(t.length===3){const i=t.split("");t=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}if(t.length===8){const i=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:i}}const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function mX(e){const[t,n,i,r]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:i,a:r===void 0?1:r}}function pX(e){const t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};const n=parseInt(t[1],10),i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*r-1))*i,l=n/60,u=o*(1-Math.abs(l%2-1)),f=r-o/2;let h,d,p;return l>=0&&l<1?(h=o,d=u,p=0):l>=1&&l<2?(h=u,d=o,p=0):l>=2&&l<3?(h=0,d=o,p=u):l>=3&&l<4?(h=0,d=u,p=o):l>=4&&l<5?(h=u,d=0,p=o):(h=o,d=0,p=u),{r:Math.round((h+f)*255),g:Math.round((d+f)*255),b:Math.round((p+f)*255),a:a||1}}function K6(e){return dX(e)?hX(e):e.startsWith("rgb")?mX(e):e.startsWith("hsl")?pX(e):{r:0,g:0,b:0,a:1}}function pk(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function vX(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function Bz(e){if(e.startsWith("oklch("))return(vX(e)||0)/100;const{r:t,g:n,b:i}=K6(e),r=t/255,a=n/255,o=i/255,l=pk(r),u=pk(a),f=pk(o);return .2126*l+.7152*u+.0722*f}function ch(e,t=.179){return e.startsWith("var(")?!1:Bz(e)>t}function gs({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ch(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:ch(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ch(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[i,r]=e.split("."),a=r?Number(r):void 0,o=i in t.colors;if(o){const l=a!==void 0?t.colors[i][a]:t.colors[i][rm(t,n||"light")];return{color:i,value:l,shade:a,isThemeColor:o,isLight:ch(l,t.luminanceThreshold),variable:r?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ch(e,t.luminanceThreshold),shade:a,variable:void 0}}function fn(e,t){const n=gs({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function uu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:i,b:r,a}=K6(e),o=1-t,l=u=>Math.round(u*o);return`rgba(${l(n)}, ${l(i)}, ${l(r)}, ${a})`}function _S(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)??t.defaultGradient.deg??0},i=fn(n.from,t),r=fn(n.to,t);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function el(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var("))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:i,b:r}=K6(e);return`rgba(${n}, ${i}, ${r}, ${t})`}const $T=el,gX=({color:e,theme:t,variant:n,gradient:i,autoContrast:r})=>{const a=gs({color:e,theme:t}),o=typeof r=="boolean"?r:t.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const l=o&&a.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${pe(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:l,border:`${pe(1)} solid transparent`}:{background:e,hover:uu(e,.1),color:l,border:`${pe(1)} solid transparent`}}if(n==="light"){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${pe(1)} solid transparent`};const l=t.colors[a.color][a.shade];return{background:l,hover:uu(l,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${pe(1)} solid transparent`}}return{background:el(e,.1),hover:el(e,.12),color:e,border:`${pe(1)} solid transparent`}}if(n==="outline")return a.isThemeColor?a.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${pe(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:el(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${pe(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:"transparent",hover:el(e,.05),color:e,border:`${pe(1)} solid ${e}`};if(n==="subtle"){if(a.isThemeColor){if(a.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${pe(1)} solid transparent`};const l=t.colors[a.color][a.shade];return{background:"transparent",hover:el(l,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${pe(1)} solid transparent`}}return{background:"transparent",hover:el(e,.12),color:e,border:`${pe(1)} solid transparent`}}return n==="transparent"?a.isThemeColor?a.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${pe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${pe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${pe(1)} solid transparent`}:n==="white"?a.isThemeColor?a.shade===void 0?{background:"var(--mantine-color-white)",hover:uu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${pe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:uu(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${pe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:uu(t.white,.01),color:e,border:`${pe(1)} solid transparent`}:n==="gradient"?{background:_S(i,t),hover:_S(i,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${pe(1)} solid var(--mantine-color-default-border)`}:{}};function If({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&gs({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function zT(e,t){return If({color:e.colors[e.primaryColor][rm(e,t)],theme:e,autoContrast:null})}function Qm(e,t){return typeof e=="boolean"?e:t.autoContrast}const Fz=S.createContext(null);function _o(){const e=S.use(Fz);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function yX(){return _o().cssVariablesResolver}function bX(){return _o().classNamesPrefix}function X6(){return _o().getStyleNonce}function wX(){return _o().withStaticClasses}function kX(){return _o().headless}function _X(){var e;return(e=_o().stylesTransform)==null?void 0:e.sx}function xX(){var e;return(e=_o().stylesTransform)==null?void 0:e.styles}function Jm(){return _o().env||"default"}function SX(){return _o().deduplicateInlineStyles}function Dc(e,t){var r,a;const n=typeof window<"u"&&"matchMedia"in window&&((r=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:r.matches),i=e!=="auto"?e:n?"dark":"light";(a=t())==null||a.setAttribute("data-mantine-color-scheme",i)}function CX({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:i}){const r=S.useRef(null),[a,o]=S.useState(()=>e.get(t)),l=i||a,u=S.useCallback(h=>{i||(Dc(h,n),o(h),e.set(h))},[e.set,l,i]),f=S.useCallback(()=>{o(t),Dc(t,n),e.clear()},[e.clear,t]);return S.useEffect(()=>(e.subscribe(u),e.unsubscribe),[e.subscribe,e.unsubscribe]),vs(()=>{Dc(e.get(t),n)},[]),S.useEffect(()=>{var d;if(i)return Dc(i,n),()=>{};i===void 0&&Dc(a,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const h=p=>{a==="auto"&&Dc(p.matches?"dark":"light",n)};return(d=r.current)==null||d.addEventListener("change",h),()=>{var p;return(p=r.current)==null?void 0:p.removeEventListener("change",h)}},[a,i]),{colorScheme:l,setColorScheme:u,clearColorScheme:f}}const jX={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},LT="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Z6={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:jX,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:gX,autoContrast:!1,luminanceThreshold:.3,fontFamily:LT,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"md",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:LT,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:pe(34),lineHeight:"1.3"},h2:{fontSize:pe(26),lineHeight:"1.35"},h3:{fontSize:pe(22),lineHeight:"1.4"},h4:{fontSize:pe(18),lineHeight:"1.45"},h5:{fontSize:pe(16),lineHeight:"1.5"},h6:{fontSize:pe(14),lineHeight:"1.5"}}},fontSizes:{xs:pe(12),sm:pe(14),md:pe(16),lg:pe(18),xl:pe(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},fontWeights:{regular:"400",medium:"600",bold:"700"},radius:{xs:pe(2),sm:pe(4),md:pe(8),lg:pe(16),xl:pe(32)},spacing:{xs:pe(10),sm:pe(12),md:pe(16),lg:pe(20),xl:pe(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${pe(1)} ${pe(3)} rgba(0, 0, 0, 0.05), 0 ${pe(1)} ${pe(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${pe(1)} ${pe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${pe(10)} ${pe(15)} ${pe(-5)}, rgba(0, 0, 0, 0.04) 0 ${pe(7)} ${pe(7)} ${pe(-5)}`,md:`0 ${pe(1)} ${pe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${pe(20)} ${pe(25)} ${pe(-5)}, rgba(0, 0, 0, 0.04) 0 ${pe(10)} ${pe(10)} ${pe(-5)}`,lg:`0 ${pe(1)} ${pe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${pe(28)} ${pe(23)} ${pe(-7)}, rgba(0, 0, 0, 0.04) 0 ${pe(12)} ${pe(12)} ${pe(-7)}`,xl:`0 ${pe(1)} ${pe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${pe(36)} ${pe(28)} ${pe(-7)}, rgba(0, 0, 0, 0.04) 0 ${pe(17)} ${pe(17)} ${pe(-7)}`},other:{},components:{}},AX="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",IT="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function vk(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function BT(e){if(!(e.primaryColor in e.colors))throw new Error(AX);if(typeof e.primaryShade=="object"&&(!vk(e.primaryShade.dark)||!vk(e.primaryShade.light)))throw new Error(IT);if(typeof e.primaryShade=="number"&&!vk(e.primaryShade))throw new Error(IT)}function OX(e,t){var i;if(!t)return BT(e),e;const n=q6(e,t);return t.fontFamily&&!((i=t.headings)!=null&&i.fontFamily)&&(n.headings.fontFamily=t.fontFamily),BT(n),n}const Q6=S.createContext(null),TX=()=>S.use(Q6)||Z6;function ci(){const e=S.use(Q6);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function qz({theme:e,children:t,inherit:n=!0}){const i=TX();return v.jsx(Q6,{value:S.useMemo(()=>OX(n?i:Z6,e),[e,i,n]),children:t})}qz.displayName="@mantine/core/MantineThemeProvider";function gk(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Hz(e,t){const n=t?[t]:[":root",":host"],i=gk(e.variables),r=i?`${n.join(", ")}{${i}}`:"",a=gk(e.dark),o=gk(e.light),l=u=>n.map(f=>f===":host"?`${f}([data-mantine-color-scheme="${u}"])`:`${f}[data-mantine-color-scheme="${u}"]`).join(", ");return`${r} + +${a?`${l("dark")}{${a}}`:""} + +${o?`${l("light")}{${o}}`:""}`}function Vv({theme:e,color:t,colorScheme:n,name:i=t,withColorValues:r=!0}){if(!e.colors[t])return{};if(n==="light"){const l=rm(e,"light"),u={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${l===9?8:l+1})`,[`--mantine-color-${i}-light`]:`var(--mantine-color-${i}-1)`,[`--mantine-color-${i}-light-hover`]:`var(--mantine-color-${i}-2)`,[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-9)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${l})`,[`--mantine-color-${i}-outline-hover`]:$T(e.colors[t][l],.05)};return r?{[`--mantine-color-${i}-0`]:e.colors[t][0],[`--mantine-color-${i}-1`]:e.colors[t][1],[`--mantine-color-${i}-2`]:e.colors[t][2],[`--mantine-color-${i}-3`]:e.colors[t][3],[`--mantine-color-${i}-4`]:e.colors[t][4],[`--mantine-color-${i}-5`]:e.colors[t][5],[`--mantine-color-${i}-6`]:e.colors[t][6],[`--mantine-color-${i}-7`]:e.colors[t][7],[`--mantine-color-${i}-8`]:e.colors[t][8],[`--mantine-color-${i}-9`]:e.colors[t][9],...u}:u}const a=rm(e,"dark"),o={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${a})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${a===9?8:a+1})`,[`--mantine-color-${i}-light`]:uu(e.colors[t][9],.5),[`--mantine-color-${i}-light-hover`]:uu(e.colors[t][9],.3),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-0)`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(a-4,0)})`,[`--mantine-color-${i}-outline-hover`]:$T(e.colors[t][Math.max(a-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:e.colors[t][0],[`--mantine-color-${i}-1`]:e.colors[t][1],[`--mantine-color-${i}-2`]:e.colors[t][2],[`--mantine-color-${i}-3`]:e.colors[t][3],[`--mantine-color-${i}-4`]:e.colors[t][4],[`--mantine-color-${i}-5`]:e.colors[t][5],[`--mantine-color-${i}-6`]:e.colors[t][6],[`--mantine-color-${i}-7`]:e.colors[t][7],[`--mantine-color-${i}-8`]:e.colors[t][8],[`--mantine-color-${i}-9`]:e.colors[t][9],...o}:o}function EX(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function eu(e,t,n){Nn(t).forEach(i=>Object.assign(e,{[`--mantine-${n}-${i}`]:t[i]}))}const Uz=e=>{const t=rm(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:pe(e.defaultRadius),i={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":zT(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":zT(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};eu(i.variables,e.breakpoints,"breakpoint"),eu(i.variables,e.spacing,"spacing"),eu(i.variables,e.fontSizes,"font-size"),eu(i.variables,e.lineHeights,"line-height"),eu(i.variables,e.shadows,"shadow"),eu(i.variables,e.radius,"radius"),eu(i.variables,e.fontWeights,"font-weight"),e.colors[e.primaryColor].forEach((a,o)=>{i.variables[`--mantine-primary-color-${o}`]=`var(--mantine-color-${e.primaryColor}-${o})`}),Nn(e.colors).forEach(a=>{const o=e.colors[a];if(EX(o)){Object.assign(i.light,Vv({theme:e,name:o.name,color:o.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,Vv({theme:e,name:o.name,color:o.dark,colorScheme:"dark",withColorValues:!0}));return}o.forEach((l,u)=>{i.variables[`--mantine-color-${a}-${u}`]=l}),Object.assign(i.light,Vv({theme:e,color:a,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,Vv({theme:e,color:a,colorScheme:"dark",withColorValues:!1}))});const r=e.headings.sizes;return Nn(r).forEach(a=>{i.variables[`--mantine-${a}-font-size`]=r[a].fontSize,i.variables[`--mantine-${a}-line-height`]=r[a].lineHeight,i.variables[`--mantine-${a}-font-weight`]=r[a].fontWeight||e.headings.fontWeight}),i};function MX(){const e=ci(),t=X6(),n=Nn(e.breakpoints).reduce((i,r)=>{const a=e.breakpoints[r].includes("px"),o=em(e.breakpoints[r]);return`${i}@media (max-width: ${a?`${o-.1}px`:Ig(o-.1)}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${a?`${o}px`:Ig(o)}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return v.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function DX({theme:e,generator:t}){const n=Uz(e),i=t==null?void 0:t(e);return i?q6(n,i):n}const yk=Uz(Z6);function RX(e){const t={variables:{},light:{},dark:{}};return Nn(e.variables).forEach(n=>{yk.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Nn(e.light).forEach(n=>{yk.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Nn(e.dark).forEach(n=>{yk.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function PX(e){return Hz({variables:{},dark:{"--mantine-color-scheme":"dark"},light:{"--mantine-color-scheme":"light"}},e)}function Vz({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=ci(),i=X6(),r=DX({theme:n,generator:yX()}),a=(e===void 0||e===":root"||e===":host")&&t,o=Hz(a?RX(r):r,e);return o?v.jsx("style",{"data-mantine-styles":!0,nonce:i==null?void 0:i(),dangerouslySetInnerHTML:{__html:`${o}${a?"":PX(e)}`}}):null}Vz.displayName="@mantine/CssVariables";function NX({respectReducedMotion:e,getRootElement:t}){vs(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}function Wz({theme:e,children:t,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:l,classNamesPrefix:u="mantine",colorSchemeManager:f=fX(),defaultColorScheme:h="light",getRootElement:d=()=>document.documentElement,cssVariablesResolver:p,forceColorScheme:g,stylesTransform:b,env:w,deduplicateInlineStyles:k=!1}){const{colorScheme:_,setColorScheme:x,clearColorScheme:j}=CX({defaultColorScheme:h,forceColorScheme:g,manager:f,getRootElement:d});return NX({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:d}),v.jsx(Fz,{value:{colorScheme:_,setColorScheme:x,clearColorScheme:j,getRootElement:d,classNamesPrefix:u,getStyleNonce:n,cssVariablesResolver:p,cssVariablesSelector:l??":root",withStaticClasses:i,stylesTransform:b,env:w,deduplicateInlineStyles:k},children:v.jsxs(qz,{theme:e,children:[o&&v.jsx(Vz,{cssVariablesSelector:l,deduplicateCssVariables:a}),r&&v.jsx(MX,{}),t]})})}Wz.displayName="@mantine/core/MantineProvider";function we(e,t,n){var o;const i=ci(),r=(o=i.components[e])==null?void 0:o.defaultProps,a=typeof r=="function"?r(i):r;return{...t,...a,...Pu(n)}}function Wi({classNames:e,styles:t,props:n,stylesCtx:i}){const r=ci();return{resolvedClassNames:e===void 0?void 0:im({theme:r,classNames:e,props:n,stylesCtx:i||void 0}),resolvedStyles:t===void 0?void 0:Fg({theme:r,styles:t,props:n,stylesCtx:i||void 0})}}const $X={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function zX({theme:e,options:t,unstyled:n}){return vt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||$X[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function LX({selector:e,stylesCtx:t,options:n,props:i,theme:r}){return im({theme:r,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||i,stylesCtx:t})[e]}function IX({selector:e,stylesCtx:t,theme:n,classNames:i,props:r}){return im({theme:n,classNames:i,props:r,stylesCtx:t})[e]}function BX({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function FX({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function qX({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:i}){return i===!1?[]:e.map(r=>`${t}-${r}-${n}`)}function HX({options:e,classes:t,selector:n,unstyled:i}){return e!=null&&e.variant&&!i?t[`${n}--${e.variant}`]:void 0}function UX({theme:e,options:t,themeName:n,selector:i,classNamesPrefix:r,resolvedClassNames:a,resolvedThemeClassNames:o,classes:l,unstyled:u,className:f,rootSelector:h,props:d,stylesCtx:p,withStaticClasses:g,headless:b,transformedStyles:w}){return vt(zX({theme:e,options:t,unstyled:u||b}),o.map(k=>k[i]),HX({options:t,classes:l,selector:i,unstyled:u||b}),a[i],IX({selector:i,stylesCtx:p,theme:e,classNames:w,props:d}),LX({selector:i,stylesCtx:p,options:t,props:d,theme:e}),BX({rootSelector:h,selector:i,className:f}),FX({selector:i,classes:l,unstyled:u||b}),g&&!b&&qX({themeName:n,classNamesPrefix:r,selector:i,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function J6({style:e,theme:t}){return Array.isArray(e)?e.reduce((n,i)=>({...n,...J6({style:i,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function VX({theme:e,selector:t,options:n,props:i,stylesCtx:r,rootSelector:a,withStylesTransform:o,resolvedStyles:l,resolvedThemeStyles:u,resolvedVars:f,resolvedRootStyle:h}){return{...u[t],...l[t],...!o&&Fg({theme:e,styles:n==null?void 0:n.styles,props:(n==null?void 0:n.props)||i,stylesCtx:r})[t],...f[t],...a===t?h:null,...J6({style:n==null?void 0:n.style,theme:e})}}function WX(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(i=>{t[i]={...t[i],...Pu(n[i])}}),t),{})}function GX({props:e,stylesCtx:t,themeName:n,theme:i}){var o;const r=(o=xX())==null?void 0:o();return{getTransformedStyles:l=>r?[...l.map(u=>r(u,{props:e,theme:i,ctx:t})),...n.map(u=>{var f;return r((f=i.components[u])==null?void 0:f.styles,{props:e,theme:i,ctx:t})})].filter(Boolean):[],withStylesTransform:!!r}}function Ze({name:e,classes:t,props:n,stylesCtx:i,className:r,style:a,rootSelector:o="root",unstyled:l,classNames:u,styles:f,vars:h,varsResolver:d,attributes:p}){var R;const g=ci(),b=bX(),w=wX(),k=kX(),_=(Array.isArray(e)?e:[e]).filter(I=>I),{withStylesTransform:x,getTransformedStyles:j}=GX({props:n,stylesCtx:i,themeName:_,theme:g}),T=im({theme:g,classNames:u,props:n,stylesCtx:i}),A=_.map(I=>{var q;return im({theme:g,classNames:(q=g.components[I])==null?void 0:q.classNames,props:n,stylesCtx:i})}),O=x?{}:Fg({theme:g,styles:f,props:n,stylesCtx:i}),M={};if(!x)for(const I of _){const q=Fg({theme:g,styles:(R=g.components[I])==null?void 0:R.styles,props:n,stylesCtx:i});for(const G of Object.keys(q))M[G]={...M[G],...q[G]}}const N=WX([k?{}:d==null?void 0:d(g,n,i),..._.map(I=>{var q,G,U;return(U=(G=(q=g.components)==null?void 0:q[I])==null?void 0:G.vars)==null?void 0:U.call(G,g,n,i)}),h==null?void 0:h(g,n,i)]),F=J6({style:a,theme:g});return(I,q)=>({...p==null?void 0:p[I],className:UX({theme:g,options:q,themeName:_,selector:I,classNamesPrefix:b,resolvedClassNames:T,resolvedThemeClassNames:A,classes:t,unstyled:l,className:r,rootSelector:o,props:n,stylesCtx:i,withStaticClasses:w,headless:k,transformedStyles:j([q==null?void 0:q.styles,f])}),style:VX({theme:g,selector:I,options:q,props:n,stylesCtx:i,rootSelector:o,withStylesTransform:x,resolvedStyles:O,resolvedThemeStyles:M,resolvedVars:N,resolvedRootStyle:F})})}function Bh(e){return Nn(e).reduce((t,n)=>e[n]!==void 0?`${t}${RK(n)}:${e[n]};`:t,"").trim()}function YX({selector:e,styles:t,media:n,container:i}){const r=t?Bh(t):"",a=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${Bh(l.styles)}}}`):[],o=Array.isArray(i)?i.map(l=>`@container ${l.query}{${e}{${Bh(l.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${a.join("")}${o.join("")}`.trim()}function KX(e){let t=5381;for(let n=0;n>>0).toString(36)}function Bf({deduplicate:e,...t}){const n=X6(),i=YX(t);return e?v.jsx("style",{href:`mantine-${KX(i)}`,precedence:"mantine",nonce:n==null?void 0:n(),children:i}):v.jsx("style",{"data-mantine-styles":"inline",nonce:n==null?void 0:n(),dangerouslySetInnerHTML:{__html:i}})}function XX(e){let t=5381;for(let n=0;n>>0).toString(36)}function ZX(e,t){return`__mdi__-${XX(`${e?Bh(e):""}|${Array.isArray(t)?t.map(n=>`${n.query}:${Bh(n.styles)}`).join("|"):""}`)}`}function $u(e){const{m:t,mx:n,my:i,mt:r,mb:a,ml:o,mr:l,me:u,ms:f,mis:h,mie:d,p,px:g,py:b,pt:w,pb:k,pl:_,pr:x,pe:j,ps:T,pis:A,pie:O,bd:M,bdrs:N,bg:F,c:R,opacity:I,ff:q,fz:G,fw:U,lts:$,ta:D,lh:z,fs:H,tt:Y,td:P,w:W,miw:V,maw:L,h:Z,mih:ie,mah:re,bgsz:X,bgp:le,bgr:ee,bga:se,pos:ke,top:ne,left:$e,bottom:xe,right:Ae,inset:ze,display:be,flex:Ce,hiddenFrom:Ne,visibleFrom:de,lightHidden:He,darkHidden:Ye,sx:We,...Qe}=e;return{styleProps:Pu({m:t,mx:n,my:i,mt:r,mb:a,ml:o,mr:l,me:u,ms:f,mis:h,mie:d,p,px:g,py:b,pt:w,pb:k,pl:_,pr:x,pis:A,pie:O,pe:j,ps:T,bd:M,bg:F,c:R,opacity:I,ff:q,fz:G,fw:U,lts:$,ta:D,lh:z,fs:H,tt:Y,td:P,w:W,miw:V,maw:L,h:Z,mih:ie,mah:re,bgsz:X,bgp:le,bgr:ee,bga:se,pos:ke,top:ne,left:$e,bottom:xe,right:Ae,inset:ze,display:be,flex:Ce,bdrs:N,hiddenFrom:Ne,visibleFrom:de,lightHidden:He,darkHidden:Ye,sx:We}),rest:Qe}}const QX={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mis:{type:"spacing",property:"marginInlineStart"},mie:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},pis:{type:"spacing",property:"paddingInlineStart"},pie:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function eC(e,t){const n=gs({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function JX(e,t){const n=gs({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:eC(e,t)}function eZ(e,t){if(typeof e=="number")return pe(e);if(typeof e=="string"){const[n,i,...r]=e.split(" ").filter(o=>o.trim()!=="");let a=`${pe(n)}`;return i&&(a+=` ${i}`),r.length>0&&(a+=` ${eC(r.join(" "),t)}`),a.trim()}return e}const FT={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function tZ(e){return typeof e=="string"&&e in FT?FT[e]:e}const nZ=["h1","h2","h3","h4","h5","h6"];function iZ(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&nZ.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?pe(e):e}function rZ(e){return e}const aZ=["h1","h2","h3","h4","h5","h6"];function oZ(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&aZ.includes(e)?`var(--mantine-${e}-line-height)`:e}function sZ(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?pe(e):e}function lZ(e){return typeof e=="number"?pe(e):e}function uZ(e,t){if(typeof e=="number")return pe(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return pe(e);const i=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${i}) * -1)`:`var(${i})`}return e}const bk={color:eC,textColor:JX,fontSize:iZ,spacing:uZ,radius:sZ,identity:rZ,size:lZ,lineHeight:oZ,fontFamily:tZ,border:eZ};function qT(e){return e.replace("(min-width: ","").replace("em)","")}function cZ({media:e,...t}){const n=Object.keys(e).sort((i,r)=>Number(qT(i))-Number(qT(r))).map(i=>({query:i,styles:e[i]}));return{...t,media:n}}function fZ(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function dZ(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function hZ(e){return typeof e=="object"&&e!==null?Nn(e).filter(t=>t!=="base"):[]}function mZ(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function pZ({styleProps:e,data:t,theme:n}){return cZ(Nn(e).reduce((i,r)=>{if(r==="hiddenFrom"||r==="visibleFrom"||r==="sx")return i;const a=t[r],o=Array.isArray(a.property)?a.property:[a.property],l=dZ(e[r]);if(!fZ(e[r]))return o.forEach(f=>{i.inlineStyles[f]=bk[a.type](l,n)}),i;i.hasResponsiveStyles=!0;const u=hZ(e[r]);return o.forEach(f=>{l!=null&&(i.styles[f]=bk[a.type](l,n)),u.forEach(h=>{const d=`(min-width: ${n.breakpoints[h]})`;i.media[d]={...i.media[d],[f]:bk[a.type](mZ(e[r],h),n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function yy(){return`__m__-${S.useId().replace(/[:«»]/g,"")}`}function Gz(e,t){return Array.isArray(e)?[...e].reduce((n,i)=>({...n,...Gz(i,t)}),{}):typeof e=="function"?e(t):e??{}}function vZ(e){return e}const gZ=vZ;function Yz(e){return e}function De(e){const t=e;return t.extend=Yz,t.withProps=n=>{const i=r=>v.jsx(t,{...n,...r});return i.extend=t.extend,i.displayName=`WithProps(${t.displayName})`,i},t}function ep(e){return De(e)}function wi(e){const t=e;return t.withProps=n=>{const i=r=>v.jsx(t,{...n,...r});return i.extend=t.extend,i.displayName=`WithProps(${t.displayName})`,i},t.extend=Yz,t}function Kz(e){return`data-${(e.startsWith("data-")?e.slice(5):e).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`}function yZ(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];return i===void 0||i===""||i===!1||i===null||(t[Kz(n)]=e[n]),t},{})}function Xz(e){return e?typeof e=="string"?{[Kz(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...Xz(n)}),{}):yZ(e):null}function xS(e,t){return Array.isArray(e)?[...e].reduce((n,i)=>({...n,...xS(i,t)}),{}):typeof e=="function"?e(t):e??{}}function bZ({theme:e,style:t,vars:n,styleProps:i}){const r=xS(t,e),a=xS(n,e);return{...r,...a,...i}}function Zz({component:e,style:t,__vars:n,className:i,variant:r,mod:a,size:o,hiddenFrom:l,visibleFrom:u,lightHidden:f,darkHidden:h,renderRoot:d,__size:p,ref:g,...b}){var F,R;const w=ci(),k=e||"div",{styleProps:_,rest:x}=$u(b),j=(R=(F=_X())==null?void 0:F())==null?void 0:R(_.sx),T=yy(),A=pZ({styleProps:_,theme:w,data:QX}),O=SX(),M=O&&A.hasResponsiveStyles?ZX(A.styles,A.media):T,N={ref:g,style:bZ({theme:w,style:t,vars:n,styleProps:A.inlineStyles}),className:vt(i,j,{[M]:A.hasResponsiveStyles,"mantine-light-hidden":f,"mantine-dark-hidden":h,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${u}`]:u}),"data-variant":r,"data-size":Oz(o)?void 0:o||void 0,size:p,...Xz(a),...x};return v.jsxs(v.Fragment,{children:[A.hasResponsiveStyles&&v.jsx(Bf,{selector:`.${M}`,styles:A.styles,media:A.media,deduplicate:O}),typeof d=="function"?d(N):v.jsx(k,{...N})]})}Zz.displayName="@mantine/core/Box";const fe=gZ(Zz),wZ=S.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function zu(){return S.use(wZ)}const[kZ,_a]=Gr("ScrollArea.Root component was not found in tree");function gl(e,t){const n=S.useEffectEvent(t);vs(()=>{let i=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(i),r.unobserve(e)}}},[e])}function _Z(e){const{style:t,...n}=e,i=_a(),[r,a]=S.useState(0),[o,l]=S.useState(0),u=!!(r&&o);return gl(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),l(f)}),gl(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),a(f)}),u?v.jsx("div",{...n,style:{...t,width:r,height:o}}):null}function xZ(e){const t=_a(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&n?v.jsx(_Z,{...e}):null}const SZ={scrollHideDelay:1e3,type:"hover"};function Qz(e){const{type:t,scrollHideDelay:n,scrollbars:i,getStyles:r,ref:a,...o}=we("ScrollAreaRoot",SZ,e),[l,u]=S.useState(null),[f,h]=S.useState(null),[d,p]=S.useState(null),[g,b]=S.useState(null),[w,k]=S.useState(null),[_,x]=S.useState(0),[j,T]=S.useState(0),[A,O]=S.useState(!1),[M,N]=S.useState(!1),F=Hn(a,R=>u(R));return v.jsx(kZ,{value:{type:t,scrollHideDelay:n,scrollArea:l,viewport:f,onViewportChange:h,content:d,onContentChange:p,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:O,scrollbarY:w,onScrollbarYChange:k,scrollbarYEnabled:M,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:T,getStyles:r},children:v.jsx(fe,{...o,ref:F,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${_}px`,"--sa-corner-height":i!=="xy"?"0px":`${j}px`}})})}Qz.displayName="@mantine/core/ScrollAreaRoot";function Jz(e,t){const n=e/t;return Number.isNaN(n)?0:n}function by(e){const t=Jz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function eL(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function CZ(e,[t,n]){return Math.min(n,Math.max(t,e))}function HT(e,t,n="ltr"){const i=by(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-r,o=t.content-t.viewport,l=a-i,u=CZ(e,n==="ltr"?[0,o]:[o*-1,0]);return eL([0,o],[0,l])(u)}function jZ(e,t,n,i="ltr"){const r=by(n),a=r/2,o=t||a,l=r-o,u=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,d=i==="ltr"?[0,h]:[h*-1,0];return eL([u,f],d)(e)}function tL(e,t){return e>0&&e{e==null||e(i),(n===!1||!i.defaultPrevented)&&(t==null||t(i))}}const[AZ,nL]=Gr("ScrollAreaScrollbar was not found in tree");function iL(e){const{sizes:t,hasThumb:n,onThumbChange:i,onThumbPointerUp:r,onThumbPointerDown:a,onThumbPositionChange:o,onDragScroll:l,onWheelScroll:u,onResize:f,ref:h,...d}=e,p=_a(),[g,b]=S.useState(null),w=Hn(h,N=>b(N)),k=S.useRef(null),_=S.useRef(""),{viewport:x}=p,j=t.content-t.viewport,T=S.useEffectEvent(u),A=Th(o),O=vy(f,10),M=N=>{k.current&&l({x:N.clientX-k.current.left,y:N.clientY-k.current.top})};return S.useEffect(()=>{const N=F=>{const R=F.target;g!=null&&g.contains(R)&&T(F,j)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,g,j]),S.useEffect(A,[t,A]),gl(g,O),gl(p.content,O),v.jsx(AZ,{value:{scrollbar:g,hasThumb:n,onThumbChange:Th(i),onThumbPointerUp:Th(r),onThumbPositionChange:A,onThumbPointerDown:Th(a)},children:v.jsx("div",{...d,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...d.style},onPointerDown:yu(e.onPointerDown,N=>{N.preventDefault(),N.button===0&&(N.target.setPointerCapture(N.pointerId),k.current=g.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(N))}),onPointerMove:yu(e.onPointerMove,M),onPointerUp:yu(e.onPointerUp,N=>{const F=N.target;F.hasPointerCapture(N.pointerId)&&(N.preventDefault(),F.releasePointerCapture(N.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,k.current=null}})})}const rL=e=>{const{sizes:t,onSizesChange:n,style:i,ref:r,...a}=e,o=_a(),[l,u]=S.useState(),f=S.useRef(null),h=Hn(r,f,o.onScrollbarXChange);return S.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),v.jsx(iL,{"data-orientation":"horizontal",...a,ref:h,sizes:t,style:{...i,"--sa-thumb-width":`${by(t)}px`},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),tL(g,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:qg(l.paddingLeft),paddingEnd:qg(l.paddingRight)}})}})};rL.displayName="@mantine/core/ScrollAreaScrollbarX";function aL(e){const{sizes:t,onSizesChange:n,style:i,ref:r,...a}=e,o=_a(),[l,u]=S.useState(),f=S.useRef(null),h=Hn(r,f,o.onScrollbarYChange);return S.useEffect(()=>{f.current&&u(window.getComputedStyle(f.current))},[]),v.jsx(iL,{...a,"data-orientation":"vertical",ref:h,sizes:t,style:{"--sa-thumb-height":`${by(t)}px`,...i},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const g=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),tL(g,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:qg(l.paddingTop),paddingEnd:qg(l.paddingBottom)}})}})}aL.displayName="@mantine/core/ScrollAreaScrollbarY";function wy(e){const{orientation:t="vertical",...n}=e,{dir:i}=zu(),r=_a(),a=S.useRef(null),o=S.useRef(0),[l,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Jz(l.viewport,l.content),h={...n,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:p=>{a.current=p},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:p=>{o.current=p}},d=(p,g)=>jZ(p,o.current,l,g);return t==="horizontal"?v.jsx(rL,{...h,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollLeft,g=HT(p,l,i);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollLeft=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollLeft=d(p,i))}}):t==="vertical"?v.jsx(aL,{...h,onThumbPositionChange:()=>{if(r.viewport&&a.current){const p=r.viewport.scrollTop,g=HT(p,l);l.scrollbar.size===0?a.current.style.setProperty("--thumb-opacity","0"):a.current.style.setProperty("--thumb-opacity","1"),a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{r.viewport&&(r.viewport.scrollTop=p)},onDragScroll:p=>{r.viewport&&(r.viewport.scrollTop=d(p))}}):null}wy.displayName="@mantine/core/ScrollAreaScrollbarVisible";function tC(e){const t=_a(),{forceMount:n,...i}=e,[r,a]=S.useState(!1),o=e.orientation==="horizontal",l=vy(()=>{if(t.viewport){const u=t.viewport.offsetWidth{const{scrollArea:o}=i;let l=0;if(o){const u=()=>{window.clearTimeout(l),a(!0)},f=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),t||r?v.jsx(tC,{"data-state":r?"visible":"hidden",...n}):null}oL.displayName="@mantine/core/ScrollAreaScrollbarHover";function OZ(e){const{forceMount:t,...n}=e,i=_a(),r=e.orientation==="horizontal",[a,o]=S.useState("hidden"),l=vy(()=>o("idle"),100);return S.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>o("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,i.scrollHideDelay]),S.useEffect(()=>{const{viewport:u}=i,f=r?"scrollLeft":"scrollTop";if(u){let h=u[f];const d=()=>{const p=u[f];h!==p&&(o("scrolling"),l()),h=p};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[i.viewport,r,l]),t||a!=="hidden"?v.jsx(wy,{"data-state":a==="hidden"?"hidden":"visible",...n,onPointerEnter:yu(e.onPointerEnter,()=>o("interacting")),onPointerLeave:yu(e.onPointerLeave,()=>o("idle"))}):null}function SS(e){const{forceMount:t,...n}=e,i=_a(),{onScrollbarXEnabledChange:r,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return S.useEffect(()=>(o?r(!0):a(!0),()=>{o?r(!1):a(!1)}),[o,r,a]),i.type==="hover"?v.jsx(oL,{...n,forceMount:t}):i.type==="scroll"?v.jsx(OZ,{...n,forceMount:t}):i.type==="auto"?v.jsx(tC,{...n,forceMount:t}):i.type==="always"?v.jsx(wy,{...n}):null}SS.displayName="@mantine/core/ScrollAreaScrollbar";function TZ(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function r(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,i=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(i)}function sL(e){const{style:t,ref:n,...i}=e,r=_a(),a=nL(),{onThumbPositionChange:o}=a,l=Hn(n,h=>a.onThumbChange(h)),u=S.useRef(void 0),f=vy(()=>{u.current&&(u.current(),u.current=void 0)},100);return S.useEffect(()=>{const{viewport:h}=r;if(h){const d=()=>{f(),u.current||(u.current=TZ(h,o),o())};return o(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[r.viewport,f,o]),v.jsx("div",{"data-state":a.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...t},onPointerDownCapture:yu(e.onPointerDownCapture,h=>{const d=h.target.getBoundingClientRect(),p=h.clientX-d.left,g=h.clientY-d.top;a.onThumbPointerDown({x:p,y:g})}),onPointerUp:yu(e.onPointerUp,a.onThumbPointerUp)})}sL.displayName="@mantine/core/ScrollAreaThumb";function CS(e){const{forceMount:t,...n}=e,i=nL();return t||i.hasThumb?v.jsx(sL,{...n}):null}CS.displayName="@mantine/core/ScrollAreaThumb";function lL({children:e,style:t,ref:n,onWheel:i,...r}){const a=_a(),o=Hn(n,a.onViewportChange),l=u=>{if(i==null||i(u),a.scrollbarXEnabled&&a.viewport&&u.shiftKey){const{scrollTop:f,scrollHeight:h,clientHeight:d,scrollWidth:p,clientWidth:g}=a.viewport,b=f<1,w=f>=h-d-1;p>g&&(b||w)&&u.stopPropagation()}};return v.jsx(fe,{...r,ref:o,onWheel:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t},children:v.jsx("div",{...a.getStyles("content"),ref:a.onContentChange,children:e})})}lL.displayName="@mantine/core/ScrollAreaViewport";var nC={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};function ky(){return typeof window<"u"}function Ff(e){return uL(e)?(e.nodeName||"").toLowerCase():"#document"}function Sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xo(e){var t;return(t=(uL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uL(e){return ky()?e instanceof Node||e instanceof Sr(e).Node:!1}function Kn(e){return ky()?e instanceof Element||e instanceof Sr(e).Element:!1}function xa(e){return ky()?e instanceof HTMLElement||e instanceof Sr(e).HTMLElement:!1}function jS(e){return!ky()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sr(e).ShadowRoot}function tp(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function EZ(e){return/^(table|td|th)$/.test(Ff(e))}function _y(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const MZ=/transform|translate|scale|rotate|perspective|filter/,DZ=/paint|layout|strict|content/,tu=e=>!!e&&e!=="none";let wk;function iC(e){const t=Kn(e)?ba(e):e;return tu(t.transform)||tu(t.translate)||tu(t.scale)||tu(t.rotate)||tu(t.perspective)||!xy()&&(tu(t.backdropFilter)||tu(t.filter))||MZ.test(t.willChange||"")||DZ.test(t.contain||"")}function RZ(e){let t=ls(e);for(;xa(t)&&!ts(t);){if(iC(t))return t;if(_y(t))return null;t=ls(t)}return null}function xy(){return wk==null&&(wk=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wk}function ts(e){return/^(html|body|#document)$/.test(Ff(e))}function ba(e){return Sr(e).getComputedStyle(e)}function Sy(e){return Kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ls(e){if(Ff(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jS(e)&&e.host||xo(e);return jS(t)?t.host:t}function cL(e){const t=ls(e);return ts(t)?e.ownerDocument?e.ownerDocument.body:e.body:xa(t)&&tp(t)?t:cL(t)}function ns(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=cL(e),a=r===((i=e.ownerDocument)==null?void 0:i.body),o=Sr(r);if(a){const l=AS(o);return t.concat(o,o.visualViewport||[],tp(r)?r:[],l&&n?ns(l):[])}else return t.concat(r,ns(r,[],n))}function AS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const PZ=["top","right","bottom","left"],Va=Math.min,Zi=Math.max,Hg=Math.round,Wv=Math.floor,so=e=>({x:e,y:e}),NZ={left:"right",right:"left",bottom:"top",top:"bottom"};function OS(e,t,n){return Zi(e,Va(t,n))}function mo(e,t){return typeof e=="function"?e(t):e}function Wa(e){return e.split("-")[0]}function qf(e){return e.split("-")[1]}function rC(e){return e==="x"?"y":"x"}function aC(e){return e==="y"?"height":"width"}function Fa(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function oC(e){return rC(Fa(e))}function $Z(e,t,n){n===void 0&&(n=!1);const i=qf(e),r=oC(e),a=aC(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Ug(o)),[o,Ug(o)]}function zZ(e){const t=Ug(e);return[TS(e),t,TS(t)]}function TS(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const UT=["left","right"],VT=["right","left"],LZ=["top","bottom"],IZ=["bottom","top"];function BZ(e,t,n){switch(e){case"top":case"bottom":return n?t?VT:UT:t?UT:VT;case"left":case"right":return t?LZ:IZ;default:return[]}}function FZ(e,t,n,i){const r=qf(e);let a=BZ(Wa(e),n==="start",i);return r&&(a=a.map(o=>o+"-"+r),t&&(a=a.concat(a.map(TS)))),a}function Ug(e){const t=Wa(e);return NZ[t]+e.slice(t.length)}function qZ(e){return{top:0,right:0,bottom:0,left:0,...e}}function sC(e){return typeof e!="number"?qZ(e):{top:e,right:e,bottom:e,left:e}}function sf(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function HZ(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function UZ(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:i}=t;return n+"/"+i}).join(" "):navigator.userAgent}function VZ(){return/apple/i.test(navigator.vendor)}function WZ(){return HZ().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function GZ(){return UZ().includes("jsdom/")}const WT="data-floating-ui-focusable",YZ="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function GT(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function am(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&jS(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Uc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kk(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function KZ(e){return e.matches("html,body")}function fu(e){return(e==null?void 0:e.ownerDocument)||document}function XZ(e){return xa(e)&&e.matches(YZ)}function ZZ(e){if(!e||GZ())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function QZ(e){return e?e.hasAttribute(WT)?e:e.querySelector("["+WT+"]")||e:null}function Cg(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var a;return r.parentId===t&&(!n||((a=r.context)==null?void 0:a.open))}).flatMap(r=>[r,...Cg(e,r.id,n)])}function JZ(e){return"nativeEvent"in e}function ES(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var eQ=typeof document<"u",tQ=function(){},lo=eQ?S.useLayoutEffect:tQ;const nQ={...Tz};function Gv(e){const t=S.useRef(e);return lo(()=>{t.current=e}),t}const iQ=nQ.useInsertionEffect,rQ=iQ||(e=>e());function io(e){const t=S.useRef(()=>{});return rQ(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:aQ},u=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:d}=YT(f,i,u),p=i,g=0;const b={};for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:a,platform:o,elements:l,middlewareData:u}=t,{element:f,padding:h=0}=mo(e,t)||{};if(f==null)return{};const d=sC(h),p={x:n,y:i},g=oC(r),b=aC(g),w=await o.getDimensions(f),k=g==="y",_=k?"top":"left",x=k?"bottom":"right",j=k?"clientHeight":"clientWidth",T=a.reference[b]+a.reference[g]-p[g]-a.floating[b],A=p[g]-a.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let M=O?O[j]:0;(!M||!await(o.isElement==null?void 0:o.isElement(O)))&&(M=l.floating[j]||a.floating[b]);const N=T/2-A/2,F=M/2-w[b]/2-1,R=Va(d[_],F),I=Va(d[x],F),q=R,G=M-w[b]-I,U=M/2-w[b]/2+N,$=OS(q,U,G),D=!u.arrow&&qf(r)!=null&&U!==$&&a.reference[b]/2-(UU<=0)){var I,q;const U=(((I=a.flip)==null?void 0:I.index)||0)+1,$=M[U];if($&&(!(d==="alignment"?x!==Fa($):!1)||R.every(H=>Fa(H.placement)===x?H.overflows[0]>0:!0)))return{data:{index:U,overflows:R},reset:{placement:$}};let D=(q=R.filter(z=>z.overflows[0]<=0).sort((z,H)=>z.overflows[1]-H.overflows[1])[0])==null?void 0:q.placement;if(!D)switch(g){case"bestFit":{var G;const z=(G=R.filter(H=>{if(O){const Y=Fa(H.placement);return Y===x||Y==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Y=>Y>0).reduce((Y,P)=>Y+P,0)]).sort((H,Y)=>H[1]-Y[1])[0])==null?void 0:G[0];z&&(D=z);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function KT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function XT(e){return PZ.some(t=>e[t]>=0)}const cQ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...a}=mo(e,t);switch(r){case"referenceHidden":{const o=await i.detectOverflow(t,{...a,elementContext:"reference"}),l=KT(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:XT(l)}}}case"escaped":{const o=await i.detectOverflow(t,{...a,altBoundary:!0}),l=KT(o,n.floating);return{data:{escapedOffsets:l,escaped:XT(l)}}}default:return{}}}}};function fL(e){const t=Va(...e.map(a=>a.left)),n=Va(...e.map(a=>a.top)),i=Zi(...e.map(a=>a.right)),r=Zi(...e.map(a=>a.bottom));return{x:t,y:n,width:i-t,height:r-n}}function fQ(e){const t=e.slice().sort((r,a)=>r.y-a.y),n=[];let i=null;for(let r=0;ri.height/2?n.push([a]):n[n.length-1].push(a),i=a}return n.map(r=>sf(fL(r)))}const dQ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:i,rects:r,platform:a,strategy:o}=t,{padding:l=2,x:u,y:f}=mo(e,t),h=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(i.reference))||[]),d=fQ(h),p=sf(fL(h)),g=sC(l);function b(){if(d.length===2&&d[0].left>d[1].right&&u!=null&&f!=null)return d.find(k=>u>k.left-g.left&&uk.top-g.top&&f=2){if(Fa(n)==="y"){const R=d[0],I=d[d.length-1],q=Wa(n)==="top",G=R.top,U=I.bottom,$=q?R.left:I.left,D=q?R.right:I.right,z=D-$,H=U-G;return{top:G,bottom:U,left:$,right:D,width:z,height:H,x:$,y:G}}const k=Wa(n)==="left",_=Zi(...d.map(R=>R.right)),x=Va(...d.map(R=>R.left)),j=d.filter(R=>k?R.left===x:R.right===_),T=j[0].top,A=j[j.length-1].bottom,O=x,M=_,N=M-O,F=A-T;return{top:T,bottom:A,left:O,right:M,width:N,height:F,x:O,y:T}}return p}const w=await a.getElementRects({reference:{getBoundingClientRect:b},floating:i.floating,strategy:o});return r.reference.x!==w.reference.x||r.reference.y!==w.reference.y||r.reference.width!==w.reference.width||r.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}},dL=new Set(["left","top"]);async function hQ(e,t){const{placement:n,platform:i,elements:r}=e,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Wa(n),l=qf(n),u=Fa(n)==="y",f=dL.has(o)?-1:1,h=a&&u?-1:1,d=mo(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(g=l==="end"?b*-1:b),u?{x:g*h,y:p*f}:{x:p*f,y:g*h}}const mQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:a,placement:o,middlewareData:l}=t,u=await hQ(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+u.x,y:a+u.y,data:{...u,placement:o}}}}},pQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:_=>{let{x,y:j}=_;return{x,y:j}}},...f}=mo(e,t),h={x:n,y:i},d=await a.detectOverflow(t,f),p=Fa(Wa(r)),g=rC(p);let b=h[g],w=h[p];if(o){const _=g==="y"?"top":"left",x=g==="y"?"bottom":"right",j=b+d[_],T=b-d[x];b=OS(j,b,T)}if(l){const _=p==="y"?"top":"left",x=p==="y"?"bottom":"right",j=w+d[_],T=w-d[x];w=OS(j,w,T)}const k=u.fn({...t,[g]:b,[p]:w});return{...k,data:{x:k.x-n,y:k.y-i,enabled:{[g]:o,[p]:l}}}}}},vQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:r,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=mo(e,t),h={x:n,y:i},d=Fa(r),p=rC(d);let g=h[p],b=h[d];const w=mo(l,t),k=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const j=p==="y"?"height":"width",T=a.reference[p]-a.floating[j]+k.mainAxis,A=a.reference[p]+a.reference[j]-k.mainAxis;gA&&(g=A)}if(f){var _,x;const j=p==="y"?"width":"height",T=dL.has(Wa(r)),A=a.reference[d]-a.floating[j]+(T&&((_=o.offset)==null?void 0:_[d])||0)+(T?0:k.crossAxis),O=a.reference[d]+a.reference[j]+(T?0:((x=o.offset)==null?void 0:x[d])||0)-(T?k.crossAxis:0);bO&&(b=O)}return{[p]:g,[d]:b}}}},gQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:r,rects:a,platform:o,elements:l}=t,{apply:u=()=>{},...f}=mo(e,t),h=await o.detectOverflow(t,f),d=Wa(r),p=qf(r),g=Fa(r)==="y",{width:b,height:w}=a.floating;let k,_;d==="top"||d==="bottom"?(k=d,_=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=d,k=p==="end"?"top":"bottom");const x=w-h.top-h.bottom,j=b-h.left-h.right,T=Va(w-h[k],x),A=Va(b-h[_],j),O=!t.middlewareData.shift;let M=T,N=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=j),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(M=x),O&&!p){const R=Zi(h.left,0),I=Zi(h.right,0),q=Zi(h.top,0),G=Zi(h.bottom,0);g?N=b-2*(R!==0||I!==0?R+I:Zi(h.left,h.right)):M=w-2*(q!==0||G!==0?q+G:Zi(h.top,h.bottom))}await u({...t,availableWidth:N,availableHeight:M});const F=await o.getDimensions(l.floating);return b!==F.width||w!==F.height?{reset:{rects:!0}}:{}}}};function hL(e){const t=ba(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=xa(e),a=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=Hg(n)!==a||Hg(i)!==o;return l&&(n=a,i=o),{width:n,height:i,$:l}}function lC(e){return Kn(e)?e:e.contextElement}function Zc(e){const t=lC(e);if(!xa(t))return so(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:a}=hL(t);let o=(a?Hg(n.width):n.width)/i,l=(a?Hg(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const yQ=so(0);function mL(e){const t=Sr(e);return!xy()||!t.visualViewport?yQ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bQ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sr(e)?!1:t}function ku(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=lC(e);let o=so(1);t&&(i?Kn(i)&&(o=Zc(i)):o=Zc(e));const l=bQ(a,n,i)?mL(a):so(0);let u=(r.left+l.x)/o.x,f=(r.top+l.y)/o.y,h=r.width/o.x,d=r.height/o.y;if(a){const p=Sr(a),g=i&&Kn(i)?Sr(i):i;let b=p,w=AS(b);for(;w&&i&&g!==b;){const k=Zc(w),_=w.getBoundingClientRect(),x=ba(w),j=_.left+(w.clientLeft+parseFloat(x.paddingLeft))*k.x,T=_.top+(w.clientTop+parseFloat(x.paddingTop))*k.y;u*=k.x,f*=k.y,h*=k.x,d*=k.y,u+=j,f+=T,b=Sr(w),w=AS(b)}}return sf({width:h,height:d,x:u,y:f})}function Cy(e,t){const n=Sy(e).scrollLeft;return t?t.left+n:ku(xo(e)).left+n}function pL(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Cy(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function wQ(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const a=r==="fixed",o=xo(i),l=t?_y(t.floating):!1;if(i===o||l&&a)return n;let u={scrollLeft:0,scrollTop:0},f=so(1);const h=so(0),d=xa(i);if((d||!d&&!a)&&((Ff(i)!=="body"||tp(o))&&(u=Sy(i)),d)){const g=ku(i);f=Zc(i),h.x=g.x+i.clientLeft,h.y=g.y+i.clientTop}const p=o&&!d&&!a?pL(o,u):so(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+h.x+p.x,y:n.y*f.y-u.scrollTop*f.y+h.y+p.y}}function kQ(e){return Array.from(e.getClientRects())}function _Q(e){const t=xo(e),n=Sy(e),i=e.ownerDocument.body,r=Zi(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),a=Zi(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Cy(e);const l=-n.scrollTop;return ba(i).direction==="rtl"&&(o+=Zi(t.clientWidth,i.clientWidth)-r),{width:r,height:a,x:o,y:l}}const ZT=25;function xQ(e,t){const n=Sr(e),i=xo(e),r=n.visualViewport;let a=i.clientWidth,o=i.clientHeight,l=0,u=0;if(r){a=r.width,o=r.height;const h=xy();(!h||h&&t==="fixed")&&(l=r.offsetLeft,u=r.offsetTop)}const f=Cy(i);if(f<=0){const h=i.ownerDocument,d=h.body,p=getComputedStyle(d),g=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(i.clientWidth-d.clientWidth-g);b<=ZT&&(a-=b)}else f<=ZT&&(a+=f);return{width:a,height:o,x:l,y:u}}function SQ(e,t){const n=ku(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,a=xa(e)?Zc(e):so(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,u=r*a.x,f=i*a.y;return{width:o,height:l,x:u,y:f}}function QT(e,t,n){let i;if(t==="viewport")i=xQ(e,n);else if(t==="document")i=_Q(xo(e));else if(Kn(t))i=SQ(t,n);else{const r=mL(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sf(i)}function vL(e,t){const n=ls(e);return n===t||!Kn(n)||ts(n)?!1:ba(n).position==="fixed"||vL(n,t)}function CQ(e,t){const n=t.get(e);if(n)return n;let i=ns(e,[],!1).filter(l=>Kn(l)&&Ff(l)!=="body"),r=null;const a=ba(e).position==="fixed";let o=a?ls(e):e;for(;Kn(o)&&!ts(o);){const l=ba(o),u=iC(o);!u&&l.position==="fixed"&&(r=null),(a?!u&&!r:!u&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||tp(o)&&!u&&vL(e,o))?i=i.filter(h=>h!==o):r=l,o=ls(o)}return t.set(e,i),i}function jQ(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const o=[...n==="clippingAncestors"?_y(t)?[]:CQ(t,this._c):[].concat(n),i],l=QT(t,o[0],r);let u=l.top,f=l.right,h=l.bottom,d=l.left;for(let p=1;p{o(!1,1e-7)},1e3)}M===1&&!yL(f,e.getBoundingClientRect())&&o(),T=!1}try{n=new IntersectionObserver(A,{...j,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return o(!0),a}function MS(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,f=lC(e),h=r||a?[...f?ns(f):[],...t?ns(t):[]]:[];h.forEach(_=>{r&&_.addEventListener("scroll",n,{passive:!0}),a&&_.addEventListener("resize",n)});const d=f&&l?DQ(f,n):null;let p=-1,g=null;o&&(g=new ResizeObserver(_=>{let[x]=_;x&&x.target===f&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var j;(j=g)==null||j.observe(t)})),n()}),f&&!u&&g.observe(f),t&&g.observe(t));let b,w=u?ku(e):null;u&&k();function k(){const _=ku(e);w&&!yL(w,_)&&n(),w=_,b=requestAnimationFrame(k)}return n(),()=>{var _;h.forEach(x=>{r&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),d==null||d(),(_=g)==null||_.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const RQ=mQ,PQ=pQ,NQ=uQ,$Q=gQ,zQ=cQ,eE=lQ,LQ=dQ,IQ=vQ,BQ=(e,t,n)=>{const i=new Map,r={platform:MQ,...n},a={...r.platform,_c:i};return sQ(e,t,{...r,platform:a})};var FQ=typeof document<"u",qQ=function(){},jg=FQ?S.useLayoutEffect:qQ;function Vg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!Vg(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const a=r[i];if(!(a==="_owner"&&e.$$typeof)&&!Vg(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function bL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tE(e,t){const n=bL(e);return Math.round(t*n)/n}function xk(e){const t=S.useRef(e);return jg(()=>{t.current=e}),t}function HQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:f}=e,[h,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=S.useState(i);Vg(p,i)||g(i);const[b,w]=S.useState(null),[k,_]=S.useState(null),x=S.useCallback(H=>{H!==O.current&&(O.current=H,w(H))},[]),j=S.useCallback(H=>{H!==M.current&&(M.current=H,_(H))},[]),T=a||b,A=o||k,O=S.useRef(null),M=S.useRef(null),N=S.useRef(h),F=u!=null,R=xk(u),I=xk(r),q=xk(f),G=S.useCallback(()=>{if(!O.current||!M.current)return;const H={placement:t,strategy:n,middleware:p};I.current&&(H.platform=I.current),BQ(O.current,M.current,H).then(Y=>{const P={...Y,isPositioned:q.current!==!1};U.current&&!Vg(N.current,P)&&(N.current=P,ol.flushSync(()=>{d(P)}))})},[p,t,n,I,q]);jg(()=>{f===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(H=>({...H,isPositioned:!1})))},[f]);const U=S.useRef(!1);jg(()=>(U.current=!0,()=>{U.current=!1}),[]),jg(()=>{if(T&&(O.current=T),A&&(M.current=A),T&&A){if(R.current)return R.current(T,A,G);G()}},[T,A,G,R,F]);const $=S.useMemo(()=>({reference:O,floating:M,setReference:x,setFloating:j}),[x,j]),D=S.useMemo(()=>({reference:T,floating:A}),[T,A]),z=S.useMemo(()=>{const H={position:n,left:0,top:0};if(!D.floating)return H;const Y=tE(D.floating,h.x),P=tE(D.floating,h.y);return l?{...H,transform:"translate("+Y+"px, "+P+"px)",...bL(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:P}},[n,l,D.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:G,refs:$,elements:D,floatingStyles:z}),[h,G,$,D,z])}const UQ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?eE({element:i.current,padding:r}).fn(n):{}:i?eE({element:i,padding:r}).fn(n):{}}}},wL=(e,t)=>{const n=RQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},uC=(e,t)=>{const n=PQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},nE=(e,t)=>({fn:IQ(e).fn,options:[e,t]}),Wg=(e,t)=>{const n=NQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},VQ=(e,t)=>{const n=$Q(e);return{name:n.name,fn:n.fn,options:[e,t]}},WQ=(e,t)=>{const n=zQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fh=(e,t)=>{const n=LQ(e);return{name:n.name,fn:n.fn,options:[e,t]}},kL=(e,t)=>{const n=UQ(e);return{name:n.name,fn:n.fn,options:[e,t]}};function _L(e){const t=S.useRef(void 0),n=S.useCallback(i=>{const r=e.map(a=>{if(a!=null){if(typeof a=="function"){const o=a,l=o(i);return typeof l=="function"?l:()=>{o(null)}}return a.current=i,()=>{a.current=null}}});return()=>{r.forEach(a=>a==null?void 0:a())}},e);return S.useMemo(()=>e.every(i=>i==null)?null:i=>{t.current&&(t.current(),t.current=void 0),i!=null&&(t.current=n(i))},e)}const GQ="data-floating-ui-focusable",iE="active",rE="selected",YQ={...Tz};let aE=!1,KQ=0;const oE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+KQ++;function XQ(){const[e,t]=S.useState(()=>aE?oE():void 0);return lo(()=>{e==null&&t(oE())},[]),S.useEffect(()=>{aE=!0},[]),e}const ZQ=YQ.useId,xL=ZQ||XQ;function QQ(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}const JQ=S.createContext(null),eJ=S.createContext(null),cC=()=>{var e;return((e=S.useContext(JQ))==null?void 0:e.id)||null},fC=()=>S.useContext(eJ);function dC(e){return"data-floating-ui-"+e}function ca(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const sE=dC("safe-polygon");function Ag(e,t,n){if(n&&!ES(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const i=e();return typeof i=="number"?i:i==null?void 0:i[t]}return e==null?void 0:e[t]}function Sk(e){return typeof e=="function"?e():e}function tJ(e,t){t===void 0&&(t={});const{open:n,onOpenChange:i,dataRef:r,events:a,elements:o}=e,{enabled:l=!0,delay:u=0,handleClose:f=null,mouseOnly:h=!1,restMs:d=0,move:p=!0}=t,g=fC(),b=cC(),w=Gv(f),k=Gv(u),_=Gv(n),x=Gv(d),j=S.useRef(),T=S.useRef(-1),A=S.useRef(),O=S.useRef(-1),M=S.useRef(!0),N=S.useRef(!1),F=S.useRef(()=>{}),R=S.useRef(!1),I=io(()=>{var z;const H=(z=r.current.openEvent)==null?void 0:z.type;return(H==null?void 0:H.includes("mouse"))&&H!=="mousedown"});S.useEffect(()=>{if(!l)return;function z(H){let{open:Y}=H;Y||(ca(T),ca(O),M.current=!0,R.current=!1)}return a.on("openchange",z),()=>{a.off("openchange",z)}},[l,a]),S.useEffect(()=>{if(!l||!w.current||!n)return;function z(Y){I()&&i(!1,Y,"hover")}const H=fu(o.floating).documentElement;return H.addEventListener("mouseleave",z),()=>{H.removeEventListener("mouseleave",z)}},[o.floating,n,i,l,w,I]);const q=S.useCallback(function(z,H,Y){H===void 0&&(H=!0),Y===void 0&&(Y="hover");const P=Ag(k.current,"close",j.current);P&&!A.current?(ca(T),T.current=window.setTimeout(()=>i(!1,z,Y),P)):H&&(ca(T),i(!1,z,Y))},[k,i]),G=io(()=>{F.current(),A.current=void 0}),U=io(()=>{if(N.current){const z=fu(o.floating).body;z.style.pointerEvents="",z.removeAttribute(sE),N.current=!1}}),$=io(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);S.useEffect(()=>{if(!l)return;function z(V){if(ca(T),M.current=!1,h&&!ES(j.current)||Sk(x.current)>0&&!Ag(k.current,"open"))return;const L=Ag(k.current,"open",j.current);L?T.current=window.setTimeout(()=>{_.current||i(!0,V,"hover")},L):n||i(!0,V,"hover")}function H(V){if($()){U();return}F.current();const L=fu(o.floating);if(ca(O),R.current=!1,w.current&&r.current.floatingContext){n||ca(T),A.current=w.current({...r.current.floatingContext,tree:g,x:V.clientX,y:V.clientY,onClose(){U(),G(),$()||q(V,!0,"safe-polygon")}});const ie=A.current;L.addEventListener("mousemove",ie),F.current=()=>{L.removeEventListener("mousemove",ie)};return}(j.current==="touch"?!am(o.floating,V.relatedTarget):!0)&&q(V)}function Y(V){$()||r.current.floatingContext&&(w.current==null||w.current({...r.current.floatingContext,tree:g,x:V.clientX,y:V.clientY,onClose(){U(),G(),$()||q(V)}})(V))}function P(){ca(T)}function W(V){$()||q(V,!1)}if(Kn(o.domReference)){const V=o.domReference,L=o.floating;return n&&V.addEventListener("mouseleave",Y),p&&V.addEventListener("mousemove",z,{once:!0}),V.addEventListener("mouseenter",z),V.addEventListener("mouseleave",H),L&&(L.addEventListener("mouseleave",Y),L.addEventListener("mouseenter",P),L.addEventListener("mouseleave",W)),()=>{n&&V.removeEventListener("mouseleave",Y),p&&V.removeEventListener("mousemove",z),V.removeEventListener("mouseenter",z),V.removeEventListener("mouseleave",H),L&&(L.removeEventListener("mouseleave",Y),L.removeEventListener("mouseenter",P),L.removeEventListener("mouseleave",W))}}},[o,l,e,h,p,q,G,U,i,n,_,g,k,w,r,$,x]),lo(()=>{var z;if(l&&n&&(z=w.current)!=null&&(z=z.__options)!=null&&z.blockPointerEvents&&I()){N.current=!0;const Y=o.floating;if(Kn(o.domReference)&&Y){var H;const P=fu(o.floating).body;P.setAttribute(sE,"");const W=o.domReference,V=g==null||(H=g.nodesRef.current.find(L=>L.id===b))==null||(H=H.context)==null?void 0:H.elements.floating;return V&&(V.style.pointerEvents=""),P.style.pointerEvents="none",W.style.pointerEvents="auto",Y.style.pointerEvents="auto",()=>{P.style.pointerEvents="",W.style.pointerEvents="",Y.style.pointerEvents=""}}}},[l,n,b,o,g,w,I]),lo(()=>{n||(j.current=void 0,R.current=!1,G(),U())},[n,G,U]),S.useEffect(()=>()=>{G(),ca(T),ca(O),U()},[l,o.domReference,G,U]);const D=S.useMemo(()=>{function z(H){j.current=H.pointerType}return{onPointerDown:z,onPointerEnter:z,onMouseMove(H){const{nativeEvent:Y}=H;function P(){!M.current&&!_.current&&i(!0,Y,"hover")}h&&!ES(j.current)||n||Sk(x.current)===0||R.current&&H.movementX**2+H.movementY**2<2||(ca(O),j.current==="touch"?P():(R.current=!0,O.current=window.setTimeout(P,Sk(x.current))))}}},[h,i,n,_,x]);return S.useMemo(()=>l?{reference:D}:{},[l,D])}const DS=()=>{},SL=S.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:DS,setState:DS,isInstantPhase:!1}),nJ=()=>S.useContext(SL);function iJ(e){const{children:t,delay:n,timeoutMs:i=0}=e,[r,a]=S.useReducer((u,f)=>({...u,...f}),{delay:n,timeoutMs:i,initialDelay:n,currentId:null,isInstantPhase:!1}),o=S.useRef(null),l=S.useCallback(u=>{a({currentId:u})},[]);return lo(()=>{r.currentId?o.current===null?o.current=r.currentId:r.isInstantPhase||a({isInstantPhase:!0}):(r.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[r.currentId,r.isInstantPhase]),v.jsx(SL.Provider,{value:S.useMemo(()=>({...r,setState:a,setCurrentId:l}),[r,l]),children:t})}function rJ(e,t){t===void 0&&(t={});const{open:n,onOpenChange:i,floatingId:r}=e,{id:a,enabled:o=!0}=t,l=a??r,u=nJ(),{currentId:f,setCurrentId:h,initialDelay:d,setState:p,timeoutMs:g}=u;return lo(()=>{o&&f&&(p({delay:{open:1,close:Ag(d,"close")}}),f!==l&&i(!1))},[o,l,i,p,f,d]),lo(()=>{function b(){i(!1),p({delay:d,currentId:null})}if(o&&f&&!n&&f===l){if(g){const w=window.setTimeout(b,g);return()=>{clearTimeout(w)}}b()}},[o,n,p,f,l,i,d,g]),lo(()=>{o&&(h===DS||!n||h(l))},[o,n,h,l]),u}const aJ={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oJ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lE=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function sJ(e,t){t===void 0&&(t={});const{open:n,onOpenChange:i,elements:r,dataRef:a}=e,{enabled:o=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:g,capture:b}=t,w=fC(),k=io(typeof u=="function"?u:()=>!1),_=typeof u=="function"?k:u,x=S.useRef(!1),{escapeKey:j,outsidePress:T}=lE(g),{escapeKey:A,outsidePress:O}=lE(b),M=S.useRef(!1),N=io(U=>{var $;if(!n||!o||!l||U.key!=="Escape"||M.current)return;const D=($=a.current.floatingContext)==null?void 0:$.nodeId,z=w?Cg(w.nodesRef.current,D):[];if(!j&&(U.stopPropagation(),z.length>0)){let H=!0;if(z.forEach(Y=>{var P;if((P=Y.context)!=null&&P.open&&!Y.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}i(!1,JZ(U)?U.nativeEvent:U,"escape-key")}),F=io(U=>{var $;const D=()=>{var z;N(U),(z=Uc(U))==null||z.removeEventListener("keydown",D)};($=Uc(U))==null||$.addEventListener("keydown",D)}),R=io(U=>{var $;const D=a.current.insideReactTree;a.current.insideReactTree=!1;const z=x.current;if(x.current=!1,f==="click"&&z||D||typeof _=="function"&&!_(U))return;const H=Uc(U),Y="["+dC("inert")+"]",P=fu(r.floating).querySelectorAll(Y);let W=Kn(H)?H:null;for(;W&&!ts(W);){const ie=ls(W);if(ts(ie)||!Kn(ie))break;W=ie}if(P.length&&Kn(H)&&!KZ(H)&&!am(H,r.floating)&&Array.from(P).every(ie=>!am(W,ie)))return;if(xa(H)&&G){const ie=ts(H),re=ba(H),X=/auto|scroll/,le=ie||X.test(re.overflowX),ee=ie||X.test(re.overflowY),se=le&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,ke=ee&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,ne=re.direction==="rtl",$e=ke&&(ne?U.offsetX<=H.offsetWidth-H.clientWidth:U.offsetX>H.clientWidth),xe=se&&U.offsetY>H.clientHeight;if($e||xe)return}const V=($=a.current.floatingContext)==null?void 0:$.nodeId,L=w&&Cg(w.nodesRef.current,V).some(ie=>{var re;return kk(U,(re=ie.context)==null?void 0:re.elements.floating)});if(kk(U,r.floating)||kk(U,r.domReference)||L)return;const Z=w?Cg(w.nodesRef.current,V):[];if(Z.length>0){let ie=!0;if(Z.forEach(re=>{var X;if((X=re.context)!=null&&X.open&&!re.context.dataRef.current.__outsidePressBubbles){ie=!1;return}}),!ie)return}i(!1,U,"outside-press")}),I=io(U=>{var $;const D=()=>{var z;R(U),(z=Uc(U))==null||z.removeEventListener(f,D)};($=Uc(U))==null||$.addEventListener(f,D)});S.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=j,a.current.__outsidePressBubbles=T;let U=-1;function $(P){i(!1,P,"ancestor-scroll")}function D(){window.clearTimeout(U),M.current=!0}function z(){U=window.setTimeout(()=>{M.current=!1},xy()?5:0)}const H=fu(r.floating);l&&(H.addEventListener("keydown",A?F:N,A),H.addEventListener("compositionstart",D),H.addEventListener("compositionend",z)),_&&H.addEventListener(f,O?I:R,O);let Y=[];return p&&(Kn(r.domReference)&&(Y=ns(r.domReference)),Kn(r.floating)&&(Y=Y.concat(ns(r.floating))),!Kn(r.reference)&&r.reference&&r.reference.contextElement&&(Y=Y.concat(ns(r.reference.contextElement)))),Y=Y.filter(P=>{var W;return P!==((W=H.defaultView)==null?void 0:W.visualViewport)}),Y.forEach(P=>{P.addEventListener("scroll",$,{passive:!0})}),()=>{l&&(H.removeEventListener("keydown",A?F:N,A),H.removeEventListener("compositionstart",D),H.removeEventListener("compositionend",z)),_&&H.removeEventListener(f,O?I:R,O),Y.forEach(P=>{P.removeEventListener("scroll",$)}),window.clearTimeout(U)}},[a,r,l,_,f,n,i,p,o,j,T,N,A,F,R,O,I]),S.useEffect(()=>{a.current.insideReactTree=!1},[a,_,f]);const q=S.useMemo(()=>({onKeyDown:N,...h&&{[aJ[d]]:U=>{i(!1,U.nativeEvent,"reference-press")},...d!=="click"&&{onClick(U){i(!1,U.nativeEvent,"reference-press")}}}}),[N,i,h,d]),G=S.useMemo(()=>{function U($){$.button===0&&(x.current=!0)}return{onKeyDown:N,onMouseDown:U,onMouseUp:U,[oJ[f]]:()=>{a.current.insideReactTree=!0}}},[N,f,a]);return S.useMemo(()=>o?{reference:q,floating:G}:{},[o,q,G])}function lJ(e){const{open:t=!1,onOpenChange:n,elements:i}=e,r=xL(),a=S.useRef({}),[o]=S.useState(()=>QQ()),l=cC()!=null,[u,f]=S.useState(i.reference),h=io((g,b,w)=>{a.current.openEvent=g?b:void 0,o.emit("openchange",{open:g,event:b,reason:w,nested:l}),n==null||n(g,b,w)}),d=S.useMemo(()=>({setPositionReference:f}),[]),p=S.useMemo(()=>({reference:u||i.reference||null,floating:i.floating||null,domReference:i.reference}),[u,i.reference,i.floating]);return S.useMemo(()=>({dataRef:a,open:t,onOpenChange:h,elements:p,events:o,floatingId:r,refs:d}),[t,h,p,o,r,d])}function hC(e){e===void 0&&(e={});const{nodeId:t}=e,n=lJ({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||n,r=i.elements,[a,o]=S.useState(null),[l,u]=S.useState(null),h=(r==null?void 0:r.domReference)||a,d=S.useRef(null),p=fC();lo(()=>{h&&(d.current=h)},[h]);const g=HQ({...e,elements:{...r,...l&&{reference:l}}}),b=S.useCallback(j=>{const T=Kn(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;u(T),g.refs.setReference(T)},[g.refs]),w=S.useCallback(j=>{(Kn(j)||j===null)&&(d.current=j,o(j)),(Kn(g.refs.reference.current)||g.refs.reference.current===null||j!==null&&!Kn(j))&&g.refs.setReference(j)},[g.refs]),k=S.useMemo(()=>({...g.refs,setReference:w,setPositionReference:b,domReference:d}),[g.refs,w,b]),_=S.useMemo(()=>({...g.elements,domReference:h}),[g.elements,h]),x=S.useMemo(()=>({...g,...i,refs:k,elements:_,nodeId:t}),[g,k,_,t,i]);return lo(()=>{i.dataRef.current.floatingContext=x;const j=p==null?void 0:p.nodesRef.current.find(T=>T.id===t);j&&(j.context=x)}),S.useMemo(()=>({...g,context:x,refs:k,elements:_}),[g,k,_,x])}function Ck(){return WZ()&&VZ()}function uJ(e,t){t===void 0&&(t={});const{open:n,onOpenChange:i,events:r,dataRef:a,elements:o}=e,{enabled:l=!0,visibleOnly:u=!0}=t,f=S.useRef(!1),h=S.useRef(-1),d=S.useRef(!0);S.useEffect(()=>{if(!l)return;const g=Sr(o.domReference);function b(){!n&&xa(o.domReference)&&o.domReference===GT(fu(o.domReference))&&(f.current=!0)}function w(){d.current=!0}function k(){d.current=!1}return g.addEventListener("blur",b),Ck()&&(g.addEventListener("keydown",w,!0),g.addEventListener("pointerdown",k,!0)),()=>{g.removeEventListener("blur",b),Ck()&&(g.removeEventListener("keydown",w,!0),g.removeEventListener("pointerdown",k,!0))}},[o.domReference,n,l]),S.useEffect(()=>{if(!l)return;function g(b){let{reason:w}=b;(w==="reference-press"||w==="escape-key")&&(f.current=!0)}return r.on("openchange",g),()=>{r.off("openchange",g)}},[r,l]),S.useEffect(()=>()=>{ca(h)},[]);const p=S.useMemo(()=>({onMouseLeave(){f.current=!1},onFocus(g){if(f.current)return;const b=Uc(g.nativeEvent);if(u&&Kn(b)){if(Ck()&&!g.relatedTarget){if(!d.current&&!XZ(b))return}else if(!ZZ(b))return}i(!0,g.nativeEvent,"focus")},onBlur(g){f.current=!1;const b=g.relatedTarget,w=g.nativeEvent,k=Kn(b)&&b.hasAttribute(dC("focus-guard"))&&b.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var _;const x=GT(o.domReference?o.domReference.ownerDocument:document);!b&&x===o.domReference||am((_=a.current.floatingContext)==null?void 0:_.refs.floating.current,x)||am(o.domReference,x)||k||i(!1,w,"focus")})}}),[a,o.domReference,i,u]);return S.useMemo(()=>l?{reference:p}:{},[l,p])}function jk(e,t,n){const i=new Map,r=n==="item";let a=e;if(r&&e){const{[iE]:o,[rE]:l,...u}=e;a=u}return{...n==="floating"&&{tabIndex:-1,[GQ]:""},...a,...t.map(o=>{const l=o?o[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((o,l)=>(l&&Object.entries(l).forEach(u=>{let[f,h]=u;if(!(r&&[iE,rE].includes(f)))if(f.indexOf("on")===0){if(i.has(f)||i.set(f,[]),typeof h=="function"){var d;(d=i.get(f))==null||d.push(h),o[f]=function(){for(var p,g=arguments.length,b=new Array(g),w=0;wk(...b)).find(k=>k!==void 0)}}}else o[f]=h}),o),{})}}function cJ(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),i=e.map(l=>l==null?void 0:l.item),r=S.useCallback(l=>jk(l,e,"reference"),t),a=S.useCallback(l=>jk(l,e,"floating"),n),o=S.useCallback(l=>jk(l,e,"item"),i);return S.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:o}),[r,a,o])}const fJ=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function dJ(e,t){var n,i;t===void 0&&(t={});const{open:r,elements:a,floatingId:o}=e,{enabled:l=!0,role:u="dialog"}=t,f=xL(),h=((n=a.domReference)==null?void 0:n.id)||f,d=S.useMemo(()=>{var x;return((x=QZ(a.floating))==null?void 0:x.id)||o},[a.floating,o]),p=(i=fJ.get(u))!=null?i:u,b=cC()!=null,w=S.useMemo(()=>p==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:r?d:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":r?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:h},...p==="menu"&&b&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[p,d,b,r,h,u]),k=S.useMemo(()=>{const x={id:d,...p&&{role:p}};return p==="tooltip"||u==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":h}}},[p,d,h,u]),_=S.useCallback(x=>{let{active:j,selected:T}=x;const A={role:"option",...j&&{id:d+"-fui-option"}};switch(u){case"select":case"combobox":return{...A,"aria-selected":T}}return{}},[d,u]);return S.useMemo(()=>l?{reference:w,floating:k,item:_}:{},[l,w,k,_])}const CL={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},jL=(e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:i})=>{let r=n;return n&&i&&(i==="x"?r=`${n} auto`:i==="y"&&(r=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":pe(t),"--scrollarea-over-scroll-behavior":r}}},lr=De(e=>{const t=we("ScrollArea",CL,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,scrollbarSize:l,vars:u,type:f,scrollHideDelay:h,viewportProps:d,viewportRef:p,onScrollPositionChange:g,children:b,offsetScrollbars:w,scrollbars:k,onBottomReached:_,onTopReached:x,onLeftReached:j,onRightReached:T,overscrollBehavior:A,startScrollPosition:O,attributes:M,...N}=t,[F,R]=S.useState(!1),[I,q]=S.useState(!1),[G,U]=S.useState(!1),$=S.useRef(!0),D=S.useRef(!1),z=S.useRef(!0),H=S.useRef(!1),Y=Ze({name:"ScrollArea",props:t,classes:nC,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:M,vars:u,varsResolver:jL}),P=S.useRef(null),[W,V]=S.useState(null),L=_L([p,P,S.useCallback(Z=>{V(ie=>ie===Z?ie:Z)},[])]);return gl(w==="present"?W:null,()=>{const Z=P.current;Z&&(q(Z.scrollHeight>Z.clientHeight),U(Z.scrollWidth>Z.clientWidth))}),vs(()=>{O&&P.current&&P.current.scrollTo({left:O.x??0,top:O.y??0})},[]),v.jsxs(Qz,{getStyles:Y,type:f==="never"?"always":f,scrollHideDelay:h,scrollbars:k,...Y("root"),...N,children:[v.jsx(lL,{...d,...Y("viewport",{style:d==null?void 0:d.style}),ref:L,"data-offset-scrollbars":w===!0?"xy":w||void 0,"data-scrollbars":k||void 0,"data-horizontal-hidden":w==="present"&&!G?"true":void 0,"data-vertical-hidden":w==="present"&&!I?"true":void 0,onScroll:Z=>{var Ae;(Ae=d==null?void 0:d.onScroll)==null||Ae.call(d,Z),g==null||g({x:Z.currentTarget.scrollLeft,y:Z.currentTarget.scrollTop});const{scrollTop:ie,scrollHeight:re,clientHeight:X,scrollLeft:le,scrollWidth:ee,clientWidth:se}=Z.currentTarget,ke=ie-(re-X)>=-.8,ne=ie===0;ke&&!D.current&&(_==null||_()),ne&&!$.current&&(x==null||x()),D.current=ke,$.current=ne;const $e=le-(ee-se)>=-.8,xe=le===0;$e&&!H.current&&(T==null||T()),xe&&!z.current&&(j==null||j()),H.current=$e,z.current=xe},children:b}),(k==="xy"||k==="x")&&v.jsx(SS,{...Y("scrollbar"),orientation:"horizontal","data-hidden":f==="never"||w==="present"&&!G?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:v.jsx(CS,{...Y("thumb")})}),(k==="xy"||k==="y")&&v.jsx(SS,{...Y("scrollbar"),orientation:"vertical","data-hidden":f==="never"||w==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:v.jsx(CS,{...Y("thumb")})}),v.jsx(xZ,{...Y("corner"),"data-hovered":F||void 0,"data-hidden":f==="never"||void 0})]})});lr.displayName="@mantine/core/ScrollArea";const mC=De(e=>{const{children:t,classNames:n,styles:i,scrollbarSize:r,scrollHideDelay:a,type:o,dir:l,offsetScrollbars:u,overscrollBehavior:f,viewportRef:h,onScrollPositionChange:d,unstyled:p,variant:g,viewportProps:b,scrollbars:w,style:k,vars:_,onBottomReached:x,onTopReached:j,startScrollPosition:T,onOverflowChange:A,...O}=we("ScrollAreaAutosize",CL,e),M=S.useRef(null),[N,F]=S.useState(null),R=_L([h,M,S.useCallback(U=>{F($=>$===U?$:U)},[])]),I=S.useRef(!1),q=S.useRef(!1),G=S.useEffectEvent(()=>{const U=M.current;if(!U||!A)return;const $=U.scrollHeight>U.clientHeight;$!==I.current&&(q.current?A($):(q.current=!0,$&&A(!0)),I.current=$)});return gl(A?N:null,G),v.jsx(fe,{...O,variant:g,style:[{display:"flex",overflow:"hidden"},k],children:v.jsx(fe,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...w==="y"&&{minWidth:0},...w==="x"&&{minHeight:0},...w==="xy"&&{minWidth:0,minHeight:0},...w===!1&&{minWidth:0,minHeight:0}},children:v.jsx(lr,{classNames:n,styles:i,scrollHideDelay:a,scrollbarSize:r,type:o,dir:l,offsetScrollbars:u,overscrollBehavior:f,viewportRef:R,onScrollPositionChange:d,unstyled:p,variant:g,viewportProps:b,vars:_,scrollbars:w,onBottomReached:x,onTopReached:j,startScrollPosition:T,"data-autosize":"true",children:t})})})});lr.classes=nC;lr.varsResolver=jL;mC.displayName="@mantine/core/ScrollAreaAutosize";mC.classes=nC;lr.Autosize=mC;var AL={root:"m_87cf2631"};const hJ={__staticSelector:"UnstyledButton"},En=wi(e=>{const t=we("UnstyledButton",hJ,e),{className:n,component:i="button",__staticSelector:r,unstyled:a,classNames:o,styles:l,style:u,attributes:f,...h}=t;return v.jsx(fe,{...Ze({name:r,props:t,classes:AL,className:n,style:u,classNames:o,styles:l,unstyled:a,attributes:f})("root",{focusable:!0}),component:i,type:i==="button"?"button":void 0,...h})});En.classes=AL;En.displayName="@mantine/core/UnstyledButton";var OL={root:"m_515a97f8"};const pC=De(e=>{const t=we("VisuallyHidden",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:u,...f}=t;return v.jsx(fe,{component:"span",...Ze({name:"VisuallyHidden",classes:OL,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:u})("root"),...f})});pC.classes=OL;pC.displayName="@mantine/core/VisuallyHidden";var TL={root:"m_1b7284a3"};const EL=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:qn(t),"--paper-shadow":W6(n)}}),Tn=wi(e=>{const t=we("Paper",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,withBorder:l,vars:u,radius:f,shadow:h,variant:d,mod:p,attributes:g,...b}=t,w=Ze({name:"Paper",props:t,classes:TL,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:g,vars:u,varsResolver:EL});return v.jsx(fe,{mod:[{"data-with-border":l},p],...w("root"),variant:d,...b})});Tn.classes=TL;Tn.varsResolver=EL;Tn.displayName="@mantine/core/Paper";function uE(e,t,n,i){return e==="center"||i==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function cE(e,t,n,i,r){return e==="center"||i==="center"?{left:t}:e==="end"?{[r==="ltr"?"right":"left"]:n}:e==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const mJ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function pJ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:i,arrowPosition:r,arrowX:a,arrowY:o,dir:l}){const[u,f="center"]=e.split("-"),h={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[mJ[u]]:i},d=-t/2;return u==="left"?{...h,...uE(f,o,n,r),right:d,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:u==="right"?{...h,...uE(f,o,n,r),left:d,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:u==="top"?{...h,...cE(f,a,n,r,l),bottom:d,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:u==="bottom"?{...h,...cE(f,a,n,r,l),top:d,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}function Gg({position:e,arrowSize:t,arrowOffset:n,arrowRadius:i,arrowPosition:r,visible:a,arrowX:o,arrowY:l,style:u,...f}){const{dir:h}=zu();return a?v.jsx("div",{...f,style:{...u,...pJ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:i,arrowPosition:r,dir:h,arrowX:o,arrowY:l})}}):null}Gg.displayName="@mantine/core/FloatingArrow";function ML(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,i]=t.split("-"),r=n==="right"?"left":"right";return i===void 0?r:`${r}-${i}`}return t}function DL({open:e,close:t,openDelay:n,closeDelay:i}){const r=S.useRef(-1),a=S.useRef(-1),o=()=>{window.clearTimeout(r.current),window.clearTimeout(a.current)},l=()=>{o(),n===0||n===void 0?e():r.current=window.setTimeout(e,n)},u=()=>{o(),i===0||i===void 0?t():a.current=window.setTimeout(t,i)};return S.useEffect(()=>o,[]),{openDropdown:l,closeDropdown:u}}var RL={root:"m_9814e45f"};const vJ={zIndex:ka("modal")},PL=(e,{gradient:t,color:n,backgroundOpacity:i,blur:r,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||i!==void 0)&&el(n||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${pe(r)})`:void 0,"--overlay-radius":a===void 0?void 0:qn(a),"--overlay-z-index":o==null?void 0:o.toString()}}),np=wi(e=>{const t=we("Overlay",vJ,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,fixed:u,center:f,children:h,radius:d,zIndex:p,gradient:g,blur:b,color:w,backgroundOpacity:k,mod:_,attributes:x,...j}=t;return v.jsx(fe,{...Ze({name:"Overlay",props:t,classes:RL,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:PL})("root"),mod:[{center:f,fixed:u},_],...j,children:h})});np.classes=RL;np.varsResolver=PL;np.displayName="@mantine/core/Overlay";function Ak(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function gJ({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Ak(n):e;if(t){const i=document.querySelector("[data-mantine-shared-portal-node]");if(i)return i;const r=Ak(n);return r.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(r),r}return Ak(n)}const yJ={reuseTargetNode:!0},NL=De(e=>{const{children:t,target:n,reuseTargetNode:i,ref:r,...a}=we("Portal",yJ,e),[o,l]=S.useState(!1),u=S.useRef(null);return vs(()=>(l(!0),u.current=gJ({target:n,reuseTargetNode:i,...a}),nm(r,u.current),!n&&!i&&u.current&&document.body.appendChild(u.current),()=>{!n&&!i&&u.current&&document.body.removeChild(u.current)}),[n]),!o||!u.current?null:ol.createPortal(v.jsx(v.Fragment,{children:t}),u.current)});NL.displayName="@mantine/core/Portal";const yl=De(({withinPortal:e=!0,children:t,...n})=>Jm()==="test"||!e?v.jsx(v.Fragment,{children:t}):v.jsx(NL,{...n,children:t}));yl.displayName="@mantine/core/OptionalPortal";const fh=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Yv={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...fh("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...fh("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...fh("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...fh("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...fh("top"),common:{transformOrigin:"top right"}}},fE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function dE({transition:e,state:t,duration:n,timingFunction:i}){const r={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:i};return typeof e=="string"?e in Yv?{transitionProperty:Yv[e].transitionProperty,...r,...Yv[e].common,...Yv[e][fE[t]]}:{}:{transitionProperty:e.transitionProperty,...r,...e.common,...e[fE[t]]}}function bJ({duration:e,exitDuration:t,timingFunction:n,mounted:i,onEnter:r,onExit:a,onEntered:o,onExited:l,enterDelay:u,exitDelay:f}){const h=ci(),d=Y6(),p=h.respectReducedMotion?d:!1,[g,b]=S.useState(p?0:e),[w,k]=S.useState(i?"entered":"exited"),_=S.useRef(-1),x=S.useRef(-1),j=S.useRef(-1);function T(){window.clearTimeout(_.current),window.clearTimeout(x.current),cancelAnimationFrame(j.current)}const A=M=>{T();const N=M?r:a,F=M?o:l,R=p?0:M?e:t;b(R),R===0?(typeof N=="function"&&N(),typeof F=="function"&&F(),k(M?"entered":"exited")):j.current=requestAnimationFrame(()=>{Eh.flushSync(()=>{k(M?"pre-entering":"pre-exiting")}),j.current=requestAnimationFrame(()=>{typeof N=="function"&&N(),k(M?"entering":"exiting"),_.current=window.setTimeout(()=>{typeof F=="function"&&F(),k(M?"entered":"exited")},R)})})},O=M=>{if(T(),typeof(M?u:f)!="number"){A(M);return}x.current=window.setTimeout(()=>{A(M)},M?u:f)};return ss(()=>{O(i)},[i]),S.useEffect(()=>()=>{T()},[]),{transitionDuration:g,transitionStatus:w,transitionTimingFunction:n||"ease"}}function us({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:i=n,mounted:r,children:a,timingFunction:o="ease",onExit:l,onEntered:u,onEnter:f,onExited:h,enterDelay:d,exitDelay:p}){const g=Jm(),{transitionDuration:b,transitionStatus:w,transitionTimingFunction:k}=bJ({mounted:r,exitDuration:i,duration:n,timingFunction:o,onExit:l,onEntered:u,onEnter:f,onExited:h,enterDelay:d,exitDelay:p});if(g==="test")return r?v.jsx(v.Fragment,{children:a({})}):e?a({display:"none"}):null;if(b===0)return e?v.jsx(S.Activity,{mode:r?"visible":"hidden",children:a({})}):r?v.jsx(v.Fragment,{children:a({})}):null;const _=w==="exited";return e?v.jsx(S.Activity,{mode:_?"hidden":"visible",children:a(_?{}:dE({transition:t,duration:b,state:w,timingFunction:k}))}):_?null:v.jsx(v.Fragment,{children:a(dE({transition:t,duration:b,state:w,timingFunction:k}))})}us.displayName="@mantine/core/Transition";const wJ={duration:100,transition:"fade"};function hE(e,t){return{...wJ,...t,...e}}const[kJ,$L]=Gr("Popover component was not found in the tree");function jy({children:e,active:t=!0,refProp:n="ref",innerRef:i}){const r=Hn(JK(t),i),a=Nu(e);return a?S.cloneElement(a,{[n]:r}):e}function zL(e){return v.jsx(pC,{tabIndex:-1,"data-autofocus":!0,...e})}jy.displayName="@mantine/core/FocusTrap";zL.displayName="@mantine/core/FocusTrapInitialFocus";jy.InitialFocus=zL;var LL={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const vC=De(e=>{var k,_,x,j;const t=we("PopoverDropdown",null,e),{className:n,style:i,vars:r,children:a,onKeyDownCapture:o,variant:l,classNames:u,styles:f,ref:h,...d}=t,p=$L(),g=Ez({opened:p.opened,shouldReturnFocus:p.returnFocus}),b=p.withRoles?{"aria-labelledby":p.getTargetId(),id:p.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=Hn(h,p.floating);return p.disabled?null:v.jsx(yl,{...p.portalProps,withinPortal:p.withinPortal,children:v.jsx(us,{mounted:p.opened,...p.transitionProps,transition:((k=p.transitionProps)==null?void 0:k.transition)||"fade",duration:((_=p.transitionProps)==null?void 0:_.duration)??150,keepMounted:p.keepMounted,exitDuration:typeof((x=p.transitionProps)==null?void 0:x.exitDuration)=="number"?p.transitionProps.exitDuration:(j=p.transitionProps)==null?void 0:j.duration,children:T=>{var A;return v.jsx(jy,{active:p.trapFocus&&p.opened,innerRef:w,children:v.jsxs(fe,{...b,...d,variant:l,onKeyDownCapture:BK(()=>{var O,M;(O=p.onClose)==null||O.call(p),(M=p.onDismiss)==null||M.call(p)},{active:p.closeOnEscape,onTrigger:g,onKeyDown:o}),"data-position":p.placement,"data-fixed":p.floatingStrategy==="fixed"||void 0,...p.getStyles("dropdown",{className:n,props:t,classNames:u,styles:f,style:[{...T,zIndex:p.zIndex,top:p.y??0,left:p.x??0,width:p.width==="target"?void 0:pe(p.width),...p.referenceHidden?{display:"none"}:null},(A=p.resolvedStyles)==null?void 0:A.dropdown,f==null?void 0:f.dropdown,i]}),children:[a,v.jsx(Gg,{ref:p.arrowRef,arrowX:p.arrowX,arrowY:p.arrowY,visible:p.withArrow,position:p.placement,arrowSize:p.arrowSize,arrowRadius:p.arrowRadius,arrowOffset:p.arrowOffset,arrowPosition:p.arrowPosition,...p.getStyles("arrow",{props:t,classNames:u,styles:f})})]})})}})})});vC.classes=LL;vC.displayName="@mantine/core/PopoverDropdown";const _J={refProp:"ref",popupType:"dialog"},IL=De(e=>{const{children:t,refProp:n,popupType:i,ref:r,...a}=we("PopoverTarget",_J,e),o=Nu(t);if(!o)throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const l=a,u=$L(),f=Hn(u.reference,gy(o),r),h=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.opened?u.getDropdownId():void 0,id:u.getTargetId()}:{},d=o.props;return S.cloneElement(o,{...l,...h,...u.targetProps,className:vt(u.targetProps.className,l.className,d.className),[n]:f,...u.controlled?null:{onClick:p=>{var g;u.onToggle(),(g=d.onClick)==null||g.call(d,p)}}})});IL.displayName="@mantine/core/PopoverTarget";function xJ(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function SJ(e,t,n){const i=xJ(e.middlewares),r=[wL(e.offset),WQ()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(i.flip=!1),i.flip&&r.push(typeof i.flip=="boolean"?Wg():Wg(i.flip)),i.shift&&r.push(uC(typeof i.shift=="boolean"?{limiter:nE(),padding:5}:{limiter:nE(),padding:5,...i.shift})),i.inline&&r.push(typeof i.inline=="boolean"?Fh():Fh(i.inline)),r.push(kL({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width==="target")&&r.push(VQ({...typeof i.size=="boolean"?{}:i.size,apply({rects:a,availableWidth:o,availableHeight:l,...u}){var h;const f=((h=t().refs.floating.current)==null?void 0:h.style)??{};i.size&&(typeof i.size=="object"&&i.size.apply?i.size.apply({rects:a,availableWidth:o,availableHeight:l,...u}):Object.assign(f,{maxWidth:`${o}px`,maxHeight:`${l}px`})),e.width==="target"&&Object.assign(f,{width:`${a.reference.width}px`})}})),r}function CJ(e){const t=Jm(),[n,i]=ji({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=S.useRef(n),a=()=>{n&&!e.disabled&&i(!1)},o=()=>{e.disabled||i(!n)},l=hC({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:SJ(e,()=>l,t),whileElementsMounted:e.keepMounted?void 0:MS});return S.useEffect(()=>{if(!(!l.refs.reference.current||!l.refs.floating.current)&&n)return MS(l.refs.reference.current,l.refs.floating.current,l.update)},[n,l.update]),ss(()=>{var u;(u=e.onPositionChange)==null||u.call(e,l.placement),e.positionRef.current=l.placement},[l.placement,e.preventPositionChangeWhenVisible]),ss(()=>{var u,f;n!==r.current&&(n?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=n},[n,e.onClose,e.onOpen]),vs(()=>{let u=-1;return n&&(u=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(u)}},[n,e.position]),{floating:l,controlled:typeof e.opened=="boolean",opened:n,onClose:a,onToggle:o}}const jJ={position:"bottom",offset:8,transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:ka("popover"),__staticSelector:"Popover",width:"max-content"},BL=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:qn(t),"--popover-shadow":W6(n)}});function Et(e){var rt,pt,Dt,yt,ot,tt,Nt;const t=we("Popover",jJ,e),{children:n,position:i,offset:r,onPositionChange:a,opened:o,transitionProps:l,onExitTransitionEnd:u,onEnterTransitionEnd:f,width:h,middlewares:d,withArrow:p,arrowSize:g,arrowOffset:b,arrowRadius:w,arrowPosition:k,unstyled:_,classNames:x,styles:j,closeOnClickOutside:T,withinPortal:A,portalProps:O,closeOnEscape:M,clickOutsideEvents:N,trapFocus:F,onClose:R,onDismiss:I,onOpen:q,onChange:G,zIndex:U,radius:$,shadow:D,id:z,defaultOpened:H,__staticSelector:Y,withRoles:P,disabled:W,returnFocus:V,variant:L,keepMounted:Z,vars:ie,floatingStrategy:re,withOverlay:X,overlayProps:le,hideDetached:ee,attributes:se,preventPositionChangeWhenVisible:ke,...ne}=t,$e=Ze({name:Y,props:t,classes:LL,classNames:x,styles:j,unstyled:_,attributes:se,rootSelector:"dropdown",vars:ie,varsResolver:BL}),{resolvedStyles:xe}=Wi({classNames:x,styles:j,props:t}),[Ae,ze]=S.useState(o??H??!1),be=S.useRef(i),Ce=S.useRef(null),[Ne,de]=S.useState(null),[He,Ye]=S.useState(null),{dir:We}=zu(),Qe=Jm(),Je=Vi(z),oe=CJ({middlewares:d,width:h,position:ML(We,i),offset:typeof r=="number"?r+(p?g/2:0):r,arrowRef:Ce,arrowOffset:b,onPositionChange:a,opened:o,defaultOpened:H,onChange:G,onOpen:q,onClose:R,onDismiss:I,strategy:re,dropdownVisible:Ae,setDropdownVisible:ze,positionRef:be,disabled:W,preventPositionChangeWhenVisible:ke,keepMounted:Z});UK(()=>{T&&(oe.onClose(),I==null||I())},N,[Ne,He]);const ye=S.useCallback(Re=>{de(Re),oe.floating.refs.setReference(Re)},[oe.floating.refs.setReference]),Ke=S.useCallback(Re=>{Ye(Re),oe.floating.refs.setFloating(Re)},[oe.floating.refs.setFloating]),et=S.useCallback(()=>{var Re;(Re=l==null?void 0:l.onExited)==null||Re.call(l),u==null||u(),ze(!1),ke||(be.current=i)},[l==null?void 0:l.onExited,u,ke,i]),je=S.useCallback(()=>{var Re;(Re=l==null?void 0:l.onEntered)==null||Re.call(l),f==null||f()},[l==null?void 0:l.onEntered,f]);return v.jsxs(kJ,{value:{returnFocus:V,disabled:W,controlled:oe.controlled,reference:ye,floating:Ke,x:oe.floating.x,y:oe.floating.y,arrowX:(Dt=(pt=(rt=oe.floating)==null?void 0:rt.middlewareData)==null?void 0:pt.arrow)==null?void 0:Dt.x,arrowY:(tt=(ot=(yt=oe.floating)==null?void 0:yt.middlewareData)==null?void 0:ot.arrow)==null?void 0:tt.y,opened:oe.opened,arrowRef:Ce,transitionProps:{...l,onExited:et,onEntered:je},width:h,withArrow:p,arrowSize:g,arrowOffset:b,arrowRadius:w,arrowPosition:k,placement:oe.floating.placement,trapFocus:F,withinPortal:A,portalProps:O,zIndex:U,radius:$,shadow:D,closeOnEscape:M,onDismiss:I,onClose:oe.onClose,onToggle:oe.onToggle,getTargetId:()=>Je,getDropdownId:()=>`${Je}-dropdown`,withRoles:P,targetProps:ne,__staticSelector:Y,classNames:x,styles:j,unstyled:_,variant:L,keepMounted:Z,getStyles:$e,resolvedStyles:xe,floatingStrategy:re,referenceHidden:ee&&Qe!=="test"?(Nt=oe.floating.middlewareData.hide)==null?void 0:Nt.referenceHidden:!1},children:[n,X&&v.jsx(us,{transition:"fade",mounted:oe.opened,duration:(l==null?void 0:l.duration)||250,exitDuration:(l==null?void 0:l.exitDuration)||250,children:Re=>v.jsx(yl,{withinPortal:A,children:v.jsx(np,{...le,...$e("overlay",{className:le==null?void 0:le.className,style:[Re,le==null?void 0:le.style]})})})})]})}Et.Target=IL;Et.Dropdown=vC;Et.varsResolver=BL;Et.displayName="@mantine/core/Popover";Et.extend=e=>e;Et.withProps=e=>{const t=n=>v.jsx(Et,{...e,...n});return t.extend=Et.extend,t.displayName=`WithProps(${Et.displayName})`,t};var qa={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const FL=({className:e,...t})=>v.jsxs(fe,{component:"span",className:vt(qa.barsLoader,e),...t,children:[v.jsx("span",{className:qa.bar}),v.jsx("span",{className:qa.bar}),v.jsx("span",{className:qa.bar})]});FL.displayName="@mantine/core/Bars";const qL=({className:e,...t})=>v.jsxs(fe,{component:"span",className:vt(qa.dotsLoader,e),...t,children:[v.jsx("span",{className:qa.dot}),v.jsx("span",{className:qa.dot}),v.jsx("span",{className:qa.dot})]});qL.displayName="@mantine/core/Dots";const HL=({className:e,...t})=>v.jsx(fe,{component:"span",className:vt(qa.ovalLoader,e),...t});HL.displayName="@mantine/core/Oval";const UL={bars:FL,oval:HL,dots:qL},AJ={loaders:UL,type:"oval"},VL=(e,{size:t,color:n})=>({root:{"--loader-size":$t(t,"loader-size"),"--loader-color":n?fn(n,e):void 0}}),Jn=De(e=>{const t=we("Loader",AJ,e),{size:n,color:i,type:r,vars:a,className:o,style:l,classNames:u,styles:f,unstyled:h,loaders:d,variant:p,children:g,attributes:b,...w}=t,k=Ze({name:"Loader",props:t,classes:qa,className:o,style:l,classNames:u,styles:f,unstyled:h,attributes:b,vars:a,varsResolver:VL});return g?v.jsx(fe,{...k("root"),...w,children:g}):v.jsx(fe,{...k("root"),component:d[r],variant:p,size:n,...w})});Jn.defaultLoaders=UL;Jn.classes=qa;Jn.varsResolver=VL;Jn.displayName="@mantine/core/Loader";var Hf={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const mE={orientation:"horizontal"},WL=(e,{borderWidth:t})=>({group:{"--ai-border-width":pe(t)}}),Ay=De(e=>{const t=we("ActionIconGroup",mE,e),{className:n,style:i,classNames:r,styles:a,unstyled:o,orientation:l,vars:u,borderWidth:f,variant:h,mod:d,attributes:p,...g}=we("ActionIconGroup",mE,e);return v.jsx(fe,{...Ze({name:"ActionIconGroup",props:t,classes:Hf,className:n,style:i,classNames:r,styles:a,unstyled:o,attributes:p,vars:u,varsResolver:WL,rootSelector:"group"})("group"),variant:h,mod:[{"data-orientation":l},d],role:"group",...g})});Ay.classes=Hf;Ay.varsResolver=WL;Ay.displayName="@mantine/core/ActionIconGroup";const GL=(e,{radius:t,color:n,gradient:i,variant:r,autoContrast:a,size:o})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":$t(o,"section-height"),"--section-padding-x":$t(o,"section-padding-x"),"--section-fz":oi(o),"--section-radius":t===void 0?void 0:qn(t),"--section-bg":n||r?l.background:void 0,"--section-color":l.color,"--section-bd":n||r?l.border:void 0}}},Oy=De(e=>{const t=we("ActionIconGroupSection",null,e),{className:n,style:i,classNames:r,styles:a,unstyled:o,vars:l,variant:u,gradient:f,radius:h,autoContrast:d,attributes:p,...g}=t;return v.jsx(fe,{...Ze({name:"ActionIconGroupSection",props:t,classes:Hf,className:n,style:i,classNames:r,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:GL,rootSelector:"groupSection"})("groupSection"),variant:u,...g})});Oy.classes=Hf;Oy.varsResolver=GL;Oy.displayName="@mantine/core/ActionIconGroupSection";const YL=(e,{size:t,radius:n,variant:i,gradient:r,color:a,autoContrast:o})=>{const l=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:o});return{root:{"--ai-size":$t(t,"ai-size"),"--ai-radius":n===void 0?void 0:qn(n),"--ai-bg":a||i?l.background:void 0,"--ai-hover":a||i?l.hover:void 0,"--ai-hover-color":a||i?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":a||i?l.border:void 0}}},Zt=wi(e=>{const t=we("ActionIcon",null,e),{className:n,unstyled:i,variant:r,classNames:a,styles:o,style:l,loading:u,loaderProps:f,size:h,color:d,radius:p,__staticSelector:g,gradient:b,vars:w,children:k,disabled:_,"data-disabled":x,autoContrast:j,mod:T,attributes:A,...O}=t,M=Ze({name:["ActionIcon",g],props:t,className:n,style:l,classes:Hf,classNames:a,styles:o,unstyled:i,attributes:A,vars:w,varsResolver:YL});return v.jsxs(En,{...M("root",{active:!_&&!u&&!x}),...O,unstyled:i,variant:r,size:h,disabled:_||u,mod:[{loading:u,disabled:_||x},T],children:[typeof u=="boolean"&&v.jsx(us,{mounted:u,transition:"slide-down",duration:150,children:N=>v.jsx(fe,{component:"span",...M("loader",{style:N}),"aria-hidden":!0,children:v.jsx(Jn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...f})})}),v.jsx(fe,{component:"span",mod:{loading:u},...M("icon"),children:k})]})});Zt.classes=Hf;Zt.varsResolver=YL;Zt.displayName="@mantine/core/ActionIcon";Zt.Group=Ay;Zt.GroupSection=Oy;function KL({size:e="var(--cb-icon-size, 70%)",style:t,...n}){return v.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},...n,children:v.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}KL.displayName="@mantine/core/CloseIcon";var XL={root:"m_86a44da5","root--subtle":"m_220c80f2"};const OJ={variant:"subtle"},ZL=(e,{size:t,radius:n,iconSize:i})=>({root:{"--cb-size":$t(t,"cb-size"),"--cb-radius":n===void 0?void 0:qn(n),"--cb-icon-size":pe(i)}}),xl=wi(e=>{const t=we("CloseButton",OJ,e),{iconSize:n,children:i,vars:r,radius:a,className:o,classNames:l,style:u,styles:f,unstyled:h,"data-disabled":d,disabled:p,variant:g,icon:b,mod:w,attributes:k,__staticSelector:_,...x}=t,j=Ze({name:_||"CloseButton",props:t,className:o,style:u,classes:XL,classNames:l,styles:f,unstyled:h,attributes:k,vars:r,varsResolver:ZL});return v.jsxs(En,{...x,unstyled:h,variant:g,disabled:p,mod:[{disabled:p||d},w],...j("root",{variant:g,active:!p&&!d}),children:[b||v.jsx(KL,{}),i]})});xl.classes=XL;xl.varsResolver=ZL;xl.displayName="@mantine/core/CloseButton";function TJ(e){return S.Children.toArray(e).filter(Boolean)}var QL={root:"m_4081bf90"};const EJ={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},JL=(e,{grow:t,preventGrowOverflow:n,gap:i,align:r,justify:a,wrap:o},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":Yn(i),"--group-align":r,"--group-justify":a,"--group-wrap":o}}),Pe=De(e=>{const t=we("Group",EJ,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,children:l,gap:u,align:f,justify:h,wrap:d,grow:p,preventGrowOverflow:g,vars:b,variant:w,__size:k,mod:_,attributes:x,...j}=t,T=TJ(l),A=T.length,O=Yn(u??"md");return v.jsx(fe,{...Ze({name:"Group",props:t,stylesCtx:{childWidth:`calc(${100/A}% - (${O} - ${O} / ${A}))`},className:i,style:r,classes:QL,classNames:n,styles:a,unstyled:o,attributes:x,vars:b,varsResolver:JL})("root"),variant:w,mod:[{grow:p},_],size:k,...j,children:T})});Pe.classes=QL;Pe.varsResolver=JL;Pe.displayName="@mantine/core/Group";const[MJ,ys]=Gr("ModalBase component was not found in tree");function DJ({opened:e,transitionDuration:t}){const[n,i]=S.useState(e),r=S.useRef(-1),a=Y6()?0:t;return S.useEffect(()=>(e?(i(!0),window.clearTimeout(r.current)):a===0?i(!1):r.current=window.setTimeout(()=>i(!1),a),()=>window.clearTimeout(r.current)),[e,a]),n}function RJ({id:e,transitionProps:t,opened:n,trapFocus:i,closeOnEscape:r,onClose:a,returnFocus:o}){const l=Vi(e),[u,f]=S.useState(!1),[h,d]=S.useState(!1),p=DJ({opened:n,transitionDuration:typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200});return Pz("keydown",g=>{var b;g.key==="Escape"&&r&&!g.isComposing&&n&&((b=g.target)==null?void 0:b.getAttribute("data-mantine-stop-propagation"))!=="true"&&a()},{capture:!0}),Ez({opened:n,shouldReturnFocus:i&&o}),{_id:l,titleMounted:u,bodyMounted:h,shouldLockScroll:p,setTitleMounted:f,setBodyMounted:d}}var ro=function(){return ro=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return XJ;var t=ZJ(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},JJ=iI(),Qc="data-scroll-locked",eee=function(e,t,n,i){var r=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(NJ,` { + overflow: hidden `).concat(i,`; + padding-right: `).concat(l,"px ").concat(i,`; + } + body[`).concat(Qc,`] { + overflow: hidden `).concat(i,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&` + padding-left: `.concat(r,`px; + padding-top: `).concat(a,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(i,`; + `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` + } + + .`).concat(Og,` { + right: `).concat(l,"px ").concat(i,`; + } + + .`).concat(Tg,` { + margin-right: `).concat(l,"px ").concat(i,`; + } + + .`).concat(Og," .").concat(Og,` { + right: 0 `).concat(i,`; + } + + .`).concat(Tg," .").concat(Tg,` { + margin-right: 0 `).concat(i,`; + } + + body[`).concat(Qc,`] { + `).concat($J,": ").concat(l,`px; + } +`)},vE=function(){var e=parseInt(document.body.getAttribute(Qc)||"0",10);return isFinite(e)?e:0},tee=function(){S.useEffect(function(){return document.body.setAttribute(Qc,(vE()+1).toString()),function(){var e=vE()-1;e<=0?document.body.removeAttribute(Qc):document.body.setAttribute(Qc,e.toString())}},[])},nee=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;tee();var a=S.useMemo(function(){return QJ(r)},[r]);return S.createElement(JJ,{styles:eee(a,!t,r,n?"":"!important")})},RS=!1;if(typeof window<"u")try{var Kv=Object.defineProperty({},"passive",{get:function(){return RS=!0,!0}});window.addEventListener("test",Kv,Kv),window.removeEventListener("test",Kv,Kv)}catch{RS=!1}var Rc=RS?{passive:!1}:!1,iee=function(e){return e.tagName==="TEXTAREA"},rI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!iee(e)&&n[t]==="visible")},ree=function(e){return rI(e,"overflowY")},aee=function(e){return rI(e,"overflowX")},gE=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=aI(e,i);if(r){var a=oI(e,i),o=a[1],l=a[2];if(o>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},oee=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},see=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},aI=function(e,t){return e==="v"?ree(t):aee(t)},oI=function(e,t){return e==="v"?oee(t):see(t)},lee=function(e,t){return e==="h"&&t==="rtl"?-1:1},uee=function(e,t,n,i,r){var a=lee(e,window.getComputedStyle(t).direction),o=a*i,l=n.target,u=t.contains(l),f=!1,h=o>0,d=0,p=0;do{if(!l)break;var g=oI(e,l),b=g[0],w=g[1],k=g[2],_=w-k-a*b;(b||_)&&aI(e,l)&&(d+=_,p+=b);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(p)<1)&&(f=!0),f},Xv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yE=function(e){return[e.deltaX,e.deltaY]},bE=function(e){return e&&"current"in e?e.current:e},cee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fee=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},dee=0,Pc=[];function hee(e){var t=S.useRef([]),n=S.useRef([0,0]),i=S.useRef(),r=S.useState(dee++)[0],a=S.useState(iI)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var w=PJ([e.lockRef.current],(e.shards||[]).map(bE),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var l=S.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var _=Xv(w),x=n.current,j="deltaX"in w?w.deltaX:x[0]-_[0],T="deltaY"in w?w.deltaY:x[1]-_[1],A,O=w.target,M=Math.abs(j)>Math.abs(T)?"h":"v";if("touches"in w&&M==="h"&&O.type==="range")return!1;var N=window.getSelection(),F=N&&N.anchorNode,R=F?F===O||F.contains(O):!1;if(R)return!1;var I=gE(M,O);if(!I)return!0;if(I?A=M:(A=M==="v"?"h":"v",I=gE(M,O)),!I)return!1;if(!i.current&&"changedTouches"in w&&(j||T)&&(i.current=A),!A)return!0;var q=i.current||A;return uee(q,k,w,q==="h"?j:T)},[]),u=S.useCallback(function(w){var k=w;if(!(!Pc.length||Pc[Pc.length-1]!==a)){var _="deltaY"in k?yE(k):Xv(k),x=t.current.filter(function(A){return A.name===k.type&&(A.target===k.target||k.target===A.shadowParent)&&cee(A.delta,_)})[0];if(x&&x.should){k.cancelable&&k.preventDefault();return}if(!x){var j=(o.current.shards||[]).map(bE).filter(Boolean).filter(function(A){return A.contains(k.target)}),T=j.length>0?l(k,j[0]):!o.current.noIsolation;T&&k.cancelable&&k.preventDefault()}}},[]),f=S.useCallback(function(w,k,_,x){var j={name:w,delta:k,target:_,should:x,shadowParent:mee(_)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(T){return T!==j})},1)},[]),h=S.useCallback(function(w){n.current=Xv(w),i.current=void 0},[]),d=S.useCallback(function(w){f(w.type,yE(w),w.target,l(w,e.lockRef.current))},[]),p=S.useCallback(function(w){f(w.type,Xv(w),w.target,l(w,e.lockRef.current))},[]);S.useEffect(function(){return Pc.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Rc),document.addEventListener("touchmove",u,Rc),document.addEventListener("touchstart",h,Rc),function(){Pc=Pc.filter(function(w){return w!==a}),document.removeEventListener("wheel",u,Rc),document.removeEventListener("touchmove",u,Rc),document.removeEventListener("touchstart",h,Rc)}},[]);var g=e.removeScrollBar,b=e.inert;return S.createElement(S.Fragment,null,b?S.createElement(a,{styles:fee(r)}):null,g?S.createElement(nee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pee=HJ(nI,hee);var _u=S.forwardRef(function(e,t){return S.createElement(Ty,ro({},e,{ref:t,sideCar:pee}))});_u.classNames=Ty.classNames;function sI({keepMounted:e,opened:t,onClose:n,id:i,transitionProps:r,onExitTransitionEnd:a,onEnterTransitionEnd:o,trapFocus:l,closeOnEscape:u,returnFocus:f,closeOnClickOutside:h,withinPortal:d,portalProps:p,lockScroll:g,children:b,zIndex:w,shadow:k,padding:_,__vars:x,unstyled:j,removeScrollProps:T,...A}){const{_id:O,titleMounted:M,bodyMounted:N,shouldLockScroll:F,setTitleMounted:R,setBodyMounted:I}=RJ({id:i,transitionProps:r,opened:t,trapFocus:l,closeOnEscape:u,onClose:n,returnFocus:f}),{key:q,...G}=T||{};return v.jsx(yl,{...p,withinPortal:d,children:v.jsx(MJ,{value:{opened:t,onClose:n,closeOnClickOutside:h,onExitTransitionEnd:a,onEnterTransitionEnd:o,transitionProps:{...r,keepMounted:e},getTitleId:()=>`${O}-title`,getBodyId:()=>`${O}-body`,titleMounted:M,bodyMounted:N,setTitleMounted:R,setBodyMounted:I,trapFocus:l,closeOnEscape:u,zIndex:w,unstyled:j},children:v.jsx(_u,{enabled:F&&g,...G,children:v.jsx(fe,{...A,id:O,__vars:{...x,"--mb-z-index":(w||ka("modal")).toString(),"--mb-shadow":W6(k),"--mb-padding":Yn(_)},children:b})},q)})})}sI.displayName="@mantine/core/ModalBase";function vee(){const e=ys();return S.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var lf={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};function lI({className:e,...t}){const n=vee(),i=ys();return v.jsx(fe,{id:n,className:vt({[lf.body]:!i.unstyled},e),...t})}lI.displayName="@mantine/core/ModalBaseBody";function uI({className:e,onClick:t,...n}){const i=ys();return v.jsx(xl,{...n,onClick:r=>{i.onClose(),t==null||t(r)},className:vt({[lf.close]:!i.unstyled},e),unstyled:i.unstyled})}uI.displayName="@mantine/core/ModalBaseCloseButton";function cI({transitionProps:e,className:t,innerProps:n,onKeyDown:i,style:r,ref:a,...o}){const l=ys();return v.jsx(us,{mounted:l.opened,transition:"pop",...l.transitionProps,onExited:()=>{var u,f,h;(u=l.onExitTransitionEnd)==null||u.call(l),(h=(f=l.transitionProps)==null?void 0:f.onExited)==null||h.call(f)},onEntered:()=>{var u,f,h;(u=l.onEnterTransitionEnd)==null||u.call(l),(h=(f=l.transitionProps)==null?void 0:f.onEntered)==null||h.call(f)},...e,children:u=>v.jsx("div",{...n,className:vt({[lf.inner]:!l.unstyled},n.className),children:v.jsx(jy,{active:l.opened&&l.trapFocus,innerRef:a,children:v.jsx(Tn,{...o,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,style:[r,u],className:vt({[lf.content]:!l.unstyled},t),unstyled:l.unstyled,children:o.children})})})})}cI.displayName="@mantine/core/ModalBaseContent";function fI({className:e,...t}){const n=ys();return v.jsx(fe,{component:"header",className:vt({[lf.header]:!n.unstyled},e),...t})}fI.displayName="@mantine/core/ModalBaseHeader";const gee={duration:200,timingFunction:"ease",transition:"fade"};function yee(e){const t=ys();return{...gee,...t.transitionProps,...e}}function dI({onClick:e,transitionProps:t,style:n,visible:i,...r}){const a=ys(),o=yee(t);return v.jsx(us,{mounted:i!==void 0?i:a.opened,...o,transition:"fade",children:l=>v.jsx(np,{fixed:!0,style:[n,l],zIndex:a.zIndex,unstyled:a.unstyled,onClick:u=>{e==null||e(u),a.closeOnClickOutside&&a.onClose()},...r})})}dI.displayName="@mantine/core/ModalBaseOverlay";function bee(){const e=ys();return S.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function hI({className:e,...t}){const n=bee(),i=ys();return v.jsx(fe,{component:"h2",className:vt({[lf.title]:!i.unstyled},e),id:n,...t})}hI.displayName="@mantine/core/ModalBaseTitle";function wee({children:e}){return v.jsx(v.Fragment,{children:e})}const mI=S.createContext({size:"sm"}),pI=De(e=>{const t=we("InputClearButton",null,e),{size:n,variant:i,vars:r,classNames:a,styles:o,...l}=t,u=S.use(mI),{resolvedClassNames:f,resolvedStyles:h}=Wi({classNames:a,styles:o,props:t});return v.jsx(xl,{variant:i||"transparent",size:n||(u==null?void 0:u.size)||"sm",classNames:f,styles:h,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});pI.displayName="@mantine/core/InputClearButton";const kee={xs:7,sm:8,md:10,lg:12,xl:15};function _ee({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:i,size:r="sm",__clearSectionMode:a="both"}){const o=e&&t;return a==="rightSection"?n===null?null:n||i:a==="clear"?n===null?null:o||i:o&&(n||i)?v.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:kee[r]},children:[o,n||i]}):n===null?null:n||o||i}const Lu=S.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Sa={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const vI=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${oi(t)} - ${pe(2)})`}}),ip=De(e=>{const t=we("InputDescription",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:u,__inheritStyles:f=!0,attributes:h,...d}=we("InputDescription",null,t),p=S.use(Lu),g=Ze({name:["InputWrapper",u],props:t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:h,rootSelector:"description",vars:l,varsResolver:vI});return v.jsx(fe,{component:"p",...(f&&(p==null?void 0:p.getStyles)||g)("description",p!=null&&p.getStyles?{className:i,style:r}:void 0),...d})});ip.classes=Sa;ip.varsResolver=vI;ip.displayName="@mantine/core/InputDescription";const gI=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${oi(t)} - ${pe(2)})`}}),rp=De(e=>{const t=we("InputError",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:u,__staticSelector:f,__inheritStyles:h=!0,...d}=t,p=Ze({name:["InputWrapper",f],props:t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:u,rootSelector:"error",vars:l,varsResolver:gI}),g=S.use(Lu);return v.jsx(fe,{component:"p",...(h&&(g==null?void 0:g.getStyles)||p)("error",g!=null&&g.getStyles?{className:i,style:r}:void 0),...d})});rp.classes=Sa;rp.varsResolver=gI;rp.displayName="@mantine/core/InputError";const xee={labelElement:"label"},yI=(e,{size:t})=>({label:{"--input-label-size":oi(t),"--input-asterisk-color":void 0}}),ap=De(e=>{const t=we("InputLabel",xee,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,labelElement:u,required:f,htmlFor:h,onMouseDown:d,children:p,__staticSelector:g,mod:b,attributes:w,...k}=t,_=Ze({name:["InputWrapper",g],props:t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,rootSelector:"label",vars:l,varsResolver:yI}),x=S.use(Lu),j=(x==null?void 0:x.getStyles)||_;return v.jsxs(fe,{...j("label",x!=null&&x.getStyles?{className:i,style:r}:void 0),component:u,htmlFor:u==="label"?h:void 0,mod:[{required:f},b],onMouseDown:T=>{d==null||d(T),!T.defaultPrevented&&T.detail>1&&T.preventDefault()},...k,children:[p,f&&v.jsx("span",{...j("required"),"aria-hidden":!0,children:" *"})]})});ap.classes=Sa;ap.varsResolver=yI;ap.displayName="@mantine/core/InputLabel";const gC=De(e=>{const t=we("InputPlaceholder",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:u,error:f,mod:h,attributes:d,...p}=t;return v.jsx(fe,{...Ze({name:["InputPlaceholder",u],props:t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:d,rootSelector:"placeholder"})("placeholder"),mod:[{error:!!f},h],component:"span",...p})});gC.classes=Sa;gC.displayName="@mantine/core/InputPlaceholder";function See(e,{hasDescription:t,hasError:n}){const i=e.findIndex(l=>l==="input"),r=e.slice(0,i),a=e.slice(i+1),o=t&&r.includes("description")||n&&r.includes("error");return{offsetBottom:t&&a.includes("description")||n&&a.includes("error"),offsetTop:o}}const Cee={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},bI=(e,{size:t})=>({label:{"--input-label-size":oi(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${oi(t)} - ${pe(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${oi(t)} - ${pe(2)})`}}),Ey=De(e=>{const t=we("InputWrapper",Cee,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,size:u,variant:f,__staticSelector:h,inputContainer:d,inputWrapperOrder:p,label:g,error:b,description:w,labelProps:k,descriptionProps:_,errorProps:x,labelElement:j,children:T,withAsterisk:A,id:O,required:M,__stylesApiProps:N,mod:F,attributes:R,...I}=t,q=Ze({name:["InputWrapper",h],props:N||t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:R,vars:l,varsResolver:bI}),G={size:u,variant:f,__staticSelector:h},U=Vi(O),$=typeof A=="boolean"?A:M,D=(x==null?void 0:x.id)||`${U}-error`,z=(_==null?void 0:_.id)||`${U}-description`,H=U,Y=!!b&&typeof b!="boolean",P=!!w,W=`${Y?D:""} ${P?z:""}`,V=W.trim().length>0?W.trim():void 0,L=(k==null?void 0:k.id)||`${U}-label`,Z=g&&v.jsx(ap,{labelElement:j,id:L,htmlFor:H,required:$,...G,...k,children:g},"label"),ie=P&&v.jsx(ip,{..._,...G,size:(_==null?void 0:_.size)||G.size,id:(_==null?void 0:_.id)||z,children:w},"description"),re=v.jsx(S.Fragment,{children:d(T)},"input"),X=Y&&S.createElement(rp,{...x,...G,size:(x==null?void 0:x.size)||G.size,key:"error",id:(x==null?void 0:x.id)||D},b),le=p.map(ee=>{switch(ee){case"label":return Z;case"input":return re;case"description":return ie;case"error":return X;default:return null}});return v.jsx(Lu,{value:{getStyles:q,describedBy:V,inputId:H,labelId:L,...See(p,{hasDescription:P,hasError:Y})},children:v.jsx(fe,{variant:f,size:u,mod:[{error:!!b},F],id:j==="label"?void 0:O,...q("root"),...I,children:le})})});Ey.classes=Sa;Ey.varsResolver=bI;Ey.displayName="@mantine/core/InputWrapper";const jee={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm",loading:!1,loadingPosition:"right"},wI=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":$t(t.size,"input-height"),"--input-fz":oi(t.size),"--input-radius":t.radius===void 0?void 0:qn(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?pe(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?pe(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?$t(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Xn=wi(e=>{const t=we("Input",jee,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,required:l,__staticSelector:u,__stylesApiProps:f,size:h,wrapperProps:d,error:p,disabled:g,leftSection:b,leftSectionProps:w,leftSectionWidth:k,rightSection:_,rightSectionProps:x,rightSectionWidth:j,rightSectionPointerEvents:T,leftSectionPointerEvents:A,variant:O,vars:M,pointer:N,multiline:F,radius:R,id:I,withAria:q,withErrorStyles:G,mod:U,inputSize:$,attributes:D,__clearSection:z,__clearable:H,__clearSectionMode:Y,__defaultRightSection:P,loading:W,loadingPosition:V,rootRef:L,...Z}=t,{styleProps:ie,rest:re}=$u(Z),X=S.use(Lu),le={offsetBottom:X==null?void 0:X.offsetBottom,offsetTop:X==null?void 0:X.offsetTop},ee=Ze({name:["Input",u],props:f||t,classes:Sa,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:D,stylesCtx:le,rootSelector:"wrapper",vars:M,varsResolver:wI}),se=q?{required:l,disabled:g,"aria-invalid":p?!0:void 0,"aria-describedby":X==null?void 0:X.describedBy,id:(X==null?void 0:X.inputId)||I}:{},ke=W?v.jsx(Jn,{size:V==="left"?"calc(var(--input-left-section-size) / 2)":"calc(var(--input-right-section-size) / 2)"}):null,ne=W&&V==="left"?ke:b,$e=_ee({__clearable:H,__clearSection:z,rightSection:W&&V==="right"?ke:_,__defaultRightSection:P,size:h,__clearSectionMode:Y});return v.jsx(mI,{value:{size:h||"sm"},children:v.jsxs(fe,{ref:L,...ee("wrapper"),...ie,...d,mod:[{error:!!p&&G,pointer:N,disabled:g,multiline:F,"data-with-right-section":!!$e,"data-with-left-section":!!ne},U],variant:O,size:h,children:[ne&&v.jsx("div",{...w,"data-position":"left",...ee("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style}),children:ne}),v.jsx(fe,{component:"input",...re,...se,required:l,mod:{disabled:g,error:!!p&&G},variant:O,__size:$,...ee("input")}),$e&&v.jsx("div",{...x,"data-position":"right",...ee("section",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),children:$e})]})})});Xn.classes=Sa;Xn.varsResolver=wI;Xn.Wrapper=Ey;Xn.Label=ap;Xn.Error=rp;Xn.Description=ip;Xn.Placeholder=gC;Xn.ClearButton=pI;Xn.displayName="@mantine/core/Input";function kI(e,t,n){const i=we(e,t,n),{label:r,description:a,error:o,required:l,classNames:u,styles:f,className:h,unstyled:d,__staticSelector:p,__stylesApiProps:g,errorProps:b,labelProps:w,descriptionProps:k,wrapperProps:_,id:x,size:j,style:T,inputContainer:A,inputWrapperOrder:O,withAsterisk:M,variant:N,vars:F,mod:R,attributes:I,...q}=i,{styleProps:G,rest:U}=$u(q),$={label:r,description:a,error:o,required:l,classNames:u,className:h,__staticSelector:p,__stylesApiProps:g||i,errorProps:b,labelProps:w,descriptionProps:k,unstyled:d,styles:f,size:j,style:T,inputContainer:A,inputWrapperOrder:O,withAsterisk:M,variant:N,id:x,mod:R,attributes:I,..._};return{...U,classNames:u,styles:f,unstyled:d,wrapperProps:{...$,...G},inputProps:{required:l,classNames:u,styles:f,unstyled:d,size:j,__staticSelector:p,__stylesApiProps:g||i,error:o,variant:N,id:x,attributes:I}}}const Aee={__staticSelector:"InputBase",withAria:!0,size:"sm"},Ni=wi(e=>{const{inputProps:t,wrapperProps:n,...i}=kI("InputBase",Aee,e);return v.jsx(Xn.Wrapper,{...n,children:v.jsx(Xn,{...t,...i})})});Ni.classes={...Xn.classes,...Xn.Wrapper.classes};Ni.displayName="@mantine/core/InputBase";function Yg({style:e,size:t=16,...n}){return v.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:pe(t),height:pe(t),display:"block"},...n,children:v.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}Yg.displayName="@mantine/core/AccordionChevron";var _I={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const xI=(e,{radius:t,color:n,variant:i,autoContrast:r})=>{const a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:i||"light",autoContrast:r});return{root:{"--alert-radius":t===void 0?void 0:qn(t),"--alert-bg":n||i?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||i?a.border:void 0}}},bl=De(e=>{const t=we("Alert",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,radius:u,color:f,title:h,children:d,id:p,icon:g,withCloseButton:b,onClose:w,closeButtonLabel:k,variant:_,autoContrast:x,role:j,attributes:T,...A}=t,O=Ze({name:"Alert",classes:_I,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:T,vars:l,varsResolver:xI}),M=Vi(p),N=h&&`${M}-title`||void 0,F=`${M}-body`;return v.jsx(fe,{id:M,...O("root",{variant:_}),variant:_,...A,role:j||"alert","aria-describedby":d?F:void 0,"aria-labelledby":h?N:void 0,children:v.jsxs("div",{...O("wrapper"),children:[g&&v.jsx("div",{...O("icon"),children:g}),v.jsxs("div",{...O("body"),children:[h&&v.jsx("div",{...O("title"),"data-with-close-button":b||void 0,children:v.jsx("span",{id:N,...O("label"),children:h})}),d&&v.jsx("div",{id:F,...O("message"),"data-variant":_,children:d})]}),b&&v.jsx(xl,{...O("closeButton"),onClick:w,variant:"transparent",size:16,iconSize:16,"aria-label":k,unstyled:o})]})})});bl.classes=_I;bl.varsResolver=xI;bl.displayName="@mantine/core/Alert";var SI={root:"m_b6d8b162"};function Oee(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const Tee={inherit:!1},CI=(e,{variant:t,lineClamp:n,gradient:i,size:r})=>({root:{"--text-fz":oi(r),"--text-lh":FK(r),"--text-gradient":t==="gradient"?_S(i,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0}}),ge=wi(e=>{const t=we("Text",Tee,e),{lineClamp:n,truncate:i,inline:r,inherit:a,gradient:o,span:l,__staticSelector:u,vars:f,className:h,style:d,classNames:p,styles:g,unstyled:b,variant:w,mod:k,size:_,attributes:x,...j}=t;return v.jsx(fe,{...Ze({name:["Text",u],props:t,classes:SI,className:h,style:d,classNames:p,styles:g,unstyled:b,attributes:x,vars:f,varsResolver:CI})("root",{focusable:!0}),component:l?"span":"p",variant:w,mod:[{"data-truncate":Oee(i),"data-line-clamp":typeof n=="number","data-inline":r,"data-inherit":a},k],size:_,...j})});ge.classes=SI;ge.varsResolver=CI;ge.displayName="@mantine/core/Text";var jI={root:"m_849cf0da"};const Eee={underline:"hover"},wl=wi(e=>{const{underline:t,className:n,unstyled:i,mod:r,...a}=we("Anchor",Eee,e);return v.jsx(ge,{component:"a",className:vt({[jI.root]:!i},n),...a,mod:[{underline:t},r],__staticSelector:"Anchor",unstyled:i})});wl.classes=jI;wl.displayName="@mantine/core/Anchor";const[Mee,Uf]=Gr("AppShell was not found in tree");var Sl={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const yC=De(e=>{const{classNames:t,className:n,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:u,mod:f,...h}=we("AppShellAside",null,e),d=Uf();return d.disabled?null:v.jsx(fe,{component:"aside",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("aside",{className:vt({[_u.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:r,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${u??d.zIndex} + 1)`}})});yC.classes=Sl;yC.displayName="@mantine/core/AppShellAside";const bC=De(e=>{var p;const{classNames:t,className:n,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:u,mod:f,...h}=we("AppShellFooter",null,e),d=Uf();return d.disabled?null:v.jsx(fe,{component:"footer",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("footer",{className:vt({[_u.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:r,style:i}),...h,__vars:{"--app-shell-footer-z-index":(p=u??d.zIndex)==null?void 0:p.toString()}})});bC.classes=Sl;bC.displayName="@mantine/core/AppShellFooter";const wC=De(e=>{var p;const{classNames:t,className:n,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:u,mod:f,...h}=we("AppShellHeader",null,e),d=Uf();return d.disabled?null:v.jsx(fe,{component:"header",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("header",{className:vt({[_u.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:r,style:i}),...h,__vars:{"--app-shell-header-z-index":(p=u??d.zIndex)==null?void 0:p.toString()}})});wC.classes=Sl;wC.displayName="@mantine/core/AppShellHeader";const kC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("AppShellMain",null,e);return v.jsx(fe,{component:"main",...Uf().getStyles("main",{className:n,style:i,classNames:t,styles:r}),...o})});kC.classes=Sl;kC.displayName="@mantine/core/AppShellMain";const _C=De(e=>{const{classNames:t,className:n,style:i,styles:r,unstyled:a,vars:o,withBorder:l,zIndex:u,mod:f,...h}=we("AppShellNavbar",null,e),d=Uf();return d.disabled?null:v.jsx(fe,{component:"nav",mod:[{"with-border":l??d.withBorder},f],...d.getStyles("navbar",{className:n,classNames:t,styles:r,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${u??d.zIndex} + 1)`}})});_C.classes=Sl;_C.displayName="@mantine/core/AppShellNavbar";const xC=wi(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,grow:o,mod:l,...u}=we("AppShellSection",null,e),f=Uf();return v.jsx(fe,{mod:[{grow:o},l],...f.getStyles("section",{className:n,style:i,classNames:t,styles:r}),...u})});xC.classes=Sl;xC.displayName="@mantine/core/AppShellSection";function op(e){return typeof e=="object"?e.base:e}function sp(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function lp(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function Dee({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:i,theme:r,mode:a}){var f,h,d;const o=i==null?void 0:i.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(i!=null&&i.breakpoint&&!((f=i==null?void 0:i.collapsed)!=null&&f.mobile)&&(n[i==null?void 0:i.breakpoint]=n[i==null?void 0:i.breakpoint]||{},a==="fixed"?(n[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="100%",n[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px"):(n[i==null?void 0:i.breakpoint]["--app-shell-aside-width"]="0px",n[i==null?void 0:i.breakpoint]["--app-shell-aside-offset"]="0px")),sp(o)){const p=pe(op(o));e["--app-shell-aside-width"]=p,e["--app-shell-aside-offset"]=p}if(lp(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=pe(o.base),e["--app-shell-aside-offset"]=pe(o.base)),Nn(o).forEach(p=>{p!=="base"&&(t[p]=t[p]||{},t[p]["--app-shell-aside-width"]=pe(o[p]),t[p]["--app-shell-aside-offset"]=pe(o[p]))})),i!=null&&i.breakpoint&&a==="static"&&(t[i.breakpoint]=t[i.breakpoint]||{},t[i.breakpoint]["--app-shell-aside-position"]="sticky",t[i.breakpoint]["--app-shell-aside-grid-row"]="2",t[i.breakpoint]["--app-shell-aside-grid-column"]="3",t[i.breakpoint]["--app-shell-main-column-end"]="3"),(h=i==null?void 0:i.collapsed)!=null&&h.desktop){const p=i.breakpoint;t[p]=t[p]||{},t[p]["--app-shell-aside-transform"]=l,t[p]["--app-shell-aside-transform-rtl"]=u,a==="fixed"?t[p]["--app-shell-aside-offset"]="0px !important":(t[p]["--app-shell-aside-width"]="0px",t[p]["--app-shell-aside-display"]="none",t[p]["--app-shell-main-column-end"]="-1"),t[p]["--app-shell-aside-scroll-locked-visibility"]="hidden"}if((d=i==null?void 0:i.collapsed)!=null&&d.mobile){const p=G6(i.breakpoint,r.breakpoints)-.1;n[p]=n[p]||{},a==="fixed"?(n[p]["--app-shell-aside-width"]="100%",n[p]["--app-shell-aside-offset"]="0px"):n[p]["--app-shell-aside-width"]="0px",n[p]["--app-shell-aside-transform"]=l,n[p]["--app-shell-aside-transform-rtl"]=u,n[p]["--app-shell-aside-scroll-locked-visibility"]="hidden"}}function Ree({baseStyles:e,minMediaStyles:t,footer:n,mode:i}){const r=n==null?void 0:n.height,a="translateY(var(--app-shell-footer-height))",o=i==="static"?!0:(n==null?void 0:n.offset)??!0;if(i==="static"&&n&&(e["--app-shell-footer-position"]="sticky",e["--app-shell-footer-grid-column"]="1 / -1",e["--app-shell-footer-grid-row"]="3"),sp(r)){const l=pe(op(r));e["--app-shell-footer-height"]=l,o&&(e["--app-shell-footer-offset"]=l)}lp(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=pe(r.base),o&&(e["--app-shell-footer-offset"]=pe(r.base))),Nn(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-footer-height"]=pe(r[l]),o&&(t[l]["--app-shell-footer-offset"]=pe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=a,i==="fixed"&&(e["--app-shell-footer-offset"]="0px !important"))}function Pee({baseStyles:e,minMediaStyles:t,header:n,mode:i}){const r=n==null?void 0:n.height,a="translateY(calc(var(--app-shell-header-height) * -1))",o=i==="static"?!0:(n==null?void 0:n.offset)??!0;if(i==="static"&&n&&(e["--app-shell-header-position"]="sticky",e["--app-shell-header-grid-column"]="1 / -1",e["--app-shell-header-grid-row"]="1"),sp(r)){const l=pe(op(r));e["--app-shell-header-height"]=l,o&&(e["--app-shell-header-offset"]=l)}lp(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=pe(r.base),o&&(e["--app-shell-header-offset"]=pe(r.base))),Nn(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-header-height"]=pe(r[l]),o&&(t[l]["--app-shell-header-offset"]=pe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=a,i==="fixed"&&(e["--app-shell-header-offset"]="0px !important"))}function Nee({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:i,theme:r,mode:a}){var f,h,d;const o=i==null?void 0:i.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(i!=null&&i.breakpoint&&!((f=i==null?void 0:i.collapsed)!=null&&f.mobile)&&(n[i==null?void 0:i.breakpoint]=n[i==null?void 0:i.breakpoint]||{},n[i==null?void 0:i.breakpoint]["--app-shell-navbar-offset"]="0px",n[i==null?void 0:i.breakpoint]["--app-shell-navbar-width"]="100%",a==="static"&&(n[i==null?void 0:i.breakpoint]["--app-shell-navbar-grid-width"]="0px")),sp(o)){const p=pe(op(o));e["--app-shell-navbar-width"]=p,e["--app-shell-navbar-offset"]=p,a==="static"&&(e["--app-shell-navbar-grid-width"]=p)}if(lp(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=pe(o.base),e["--app-shell-navbar-offset"]=pe(o.base),a==="static"&&(e["--app-shell-navbar-grid-width"]=pe(o.base))),Nn(o).forEach(p=>{p!=="base"&&(t[p]=t[p]||{},t[p]["--app-shell-navbar-width"]=pe(o[p]),t[p]["--app-shell-navbar-offset"]=pe(o[p]),a==="static"&&(t[p]["--app-shell-navbar-grid-width"]=pe(o[p])))})),i!=null&&i.breakpoint&&a==="static"&&(t[i.breakpoint]=t[i.breakpoint]||{},t[i.breakpoint]["--app-shell-navbar-position"]="sticky",t[i.breakpoint]["--app-shell-navbar-grid-row"]="2",t[i.breakpoint]["--app-shell-navbar-grid-column"]="1",t[i.breakpoint]["--app-shell-main-column-start"]="2"),(h=i==null?void 0:i.collapsed)!=null&&h.desktop){const p=i.breakpoint;t[p]=t[p]||{},t[p]["--app-shell-navbar-transform"]=l,t[p]["--app-shell-navbar-transform-rtl"]=u,a==="fixed"?t[p]["--app-shell-navbar-offset"]="0px !important":(t[p]["--app-shell-navbar-width"]="0px",t[p]["--app-shell-navbar-display"]="none",t[p]["--app-shell-main-column-start"]="1")}if((d=i==null?void 0:i.collapsed)!=null&&d.mobile){const p=G6(i.breakpoint,r.breakpoints)-.1;n[p]=n[p]||{},n[p]["--app-shell-navbar-width"]="100%",n[p]["--app-shell-navbar-offset"]="0px",a==="static"&&(n[p]["--app-shell-navbar-grid-width"]="0px"),n[p]["--app-shell-navbar-transform"]=l,n[p]["--app-shell-navbar-transform-rtl"]=u}}function Mk(e){return Number(e)===0?"0px":Yn(e)}function $ee({padding:e,baseStyles:t,minMediaStyles:n}){sp(e)&&(t["--app-shell-padding"]=Mk(op(e))),lp(e)&&(e.base&&(t["--app-shell-padding"]=Mk(e.base)),Nn(e).forEach(i=>{i!=="base"&&(n[i]=n[i]||{},n[i]["--app-shell-padding"]=Mk(e[i]))}))}function zee({navbar:e,header:t,footer:n,aside:i,padding:r,theme:a,mode:o}){const l={},u={},f={};o==="static"&&(f["--app-shell-main-grid-column"]="1 / -1",f["--app-shell-main-grid-row"]="2"),Nee({baseStyles:f,minMediaStyles:l,maxMediaStyles:u,navbar:e,theme:a,mode:o}),Dee({baseStyles:f,minMediaStyles:l,maxMediaStyles:u,aside:i,theme:a,mode:o}),Pee({baseStyles:f,minMediaStyles:l,header:t,mode:o}),Ree({baseStyles:f,minMediaStyles:l,footer:n,mode:o}),$ee({baseStyles:f,minMediaStyles:l,padding:r});const h=tm(Nn(l),a.breakpoints).map(p=>({query:`(min-width: ${Ig(p.px)})`,styles:l[p.value]})),d=tm(Nn(u),a.breakpoints).map(p=>({query:`(max-width: ${Ig(p.px)})`,styles:u[p.value]}));return{baseStyles:f,media:[...h,...d]}}function Lee({navbar:e,header:t,aside:n,footer:i,padding:r,mode:a,selector:o}){const l=ci(),u=_o(),{media:f,baseStyles:h}=zee({navbar:e,header:t,footer:i,aside:n,padding:r,theme:l,mode:a});return v.jsx(Bf,{media:f,styles:h,selector:o||u.cssVariablesSelector})}function Iee({transitionDuration:e,disabled:t}){const[n,i]=S.useState(!0),r=S.useRef(-1),a=S.useRef(-1);return Pz("resize",()=>{i(!0),clearTimeout(r.current),r.current=window.setTimeout(()=>S.startTransition(()=>{i(!1)}),200)}),vs(()=>{i(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>S.startTransition(()=>{i(!1)}),e||0)},[t,e]),n}const Bee={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:ka("app"),mode:"fixed"},AI=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),wr=De(e=>{const t=we("AppShell",Bee,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,navbar:u,withBorder:f,padding:h,transitionDuration:d,transitionTimingFunction:p,header:g,zIndex:b,layout:w,disabled:k,aside:_,footer:x,offsetScrollbars:j=!0,mode:T,mod:A,attributes:O,id:M,...N}=t,F=Ze({name:"AppShell",classes:Sl,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:O,vars:l,varsResolver:AI}),R=Iee({disabled:k,transitionDuration:d}),I=Vi(M);return v.jsxs(Mee,{value:{getStyles:F,withBorder:f,zIndex:b,disabled:k,offsetScrollbars:j,mode:T},children:[v.jsx(Lee,{navbar:u,header:g,aside:_,footer:x,padding:h,mode:T,selector:T==="static"?`#${I}`:void 0}),v.jsx(fe,{...F("root"),id:I,mod:[{resizing:R,layout:w,disabled:k,mode:T},A],...N})]})});wr.classes=Sl;wr.varsResolver=AI;wr.displayName="@mantine/core/AppShell";wr.Navbar=_C;wr.Header=wC;wr.Main=kC;wr.Aside=yC;wr.Footer=bC;wr.Section=xC;function OI(e){return typeof e=="string"?{value:e,label:e}:typeof e=="object"&&"value"in e&&!("label"in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e=="object"&&"group"in e?{group:e.group,items:e.items.map(t=>OI(t))}:typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"?{value:e,label:`${e}`}:e}function My(e){return e?e.map(t=>OI(t)):[]}function up(e){return e.reduce((t,n)=>"group"in n?{...t,...up(n.items)}:(t[`${n.value}`]=n,t),{})}var sr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const Fee={error:null},TI=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":$t(t,"combobox-chevron-size"),"--combobox-chevron-color":n?fn(n,e):void 0}}),Dy=De(e=>{const t=we("ComboboxChevron",Fee,e),{size:n,error:i,style:r,className:a,classNames:o,styles:l,unstyled:u,vars:f,attributes:h,mod:d,...p}=t,g=Ze({name:"ComboboxChevron",classes:sr,props:t,style:r,className:a,classNames:o,styles:l,unstyled:u,vars:f,varsResolver:TI,attributes:h,rootSelector:"chevron"});return v.jsx(fe,{component:"svg",...p,...g("chevron"),size:n,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},d],children:v.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Dy.classes=sr;Dy.varsResolver=TI;Dy.displayName="@mantine/core/ComboboxChevron";const[qee,Ca]=Gr("Combobox component was not found in tree");function EI({onMouseDown:e,onClick:t,onClear:n,...i}){return v.jsx(Xn.ClearButton,{tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:r=>{r.preventDefault(),e==null||e(r)},onClick:r=>{n(),t==null||t(r)}})}EI.displayName="@mantine/core/ComboboxClearButton";const SC=De(e=>{const{classNames:t,styles:n,className:i,style:r,hidden:a,...o}=we("ComboboxDropdown",null,e),l=Ca();return v.jsx(Et.Dropdown,{...o,role:"presentation","data-hidden":a||void 0,...l.getStyles("dropdown",{className:i,style:r,classNames:t,styles:n})})});SC.classes=sr;SC.displayName="@mantine/core/ComboboxDropdown";const Hee={refProp:"ref"},MI=De(e=>{const{children:t,refProp:n,ref:i}=we("ComboboxDropdownTarget",Hee,e);if(Ca(),!U6(t))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return v.jsx(Et.Target,{ref:i,refProp:n,children:t})});MI.displayName="@mantine/core/ComboboxDropdownTarget";const CC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ComboboxEmpty",null,e);return v.jsx(fe,{...Ca().getStyles("empty",{className:n,classNames:t,styles:r,style:i}),...o})});CC.classes=sr;CC.displayName="@mantine/core/ComboboxEmpty";function jC({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:i,withExpandedAttribute:r,targetType:a,autoComplete:o}){const l=Ca(),[u,f]=S.useState(null),h=g=>{if(e==null||e(g),!l.readOnly&&n){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),l.store.dropdownOpened?f(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),f(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),l.store.dropdownOpened?f(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),f(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const b=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&b!==-1?(g.preventDefault(),l.store.clickSelectedOption()):a==="button"&&(g.preventDefault(),l.store.openDropdown("keyboard"))}g.key==="Escape"&&l.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&a==="button"&&(g.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...i?{...r?{role:"combobox"}:{},"aria-haspopup":"listbox","aria-expanded":r?!!(l.store.listId&&l.store.dropdownOpened):void 0,"aria-controls":l.store.dropdownOpened&&l.store.listId?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:h,onClick:g=>{a==="button"&&g.currentTarget.focus(),t==null||t(g)}}}const Uee={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},DI=De(e=>{const{children:t,refProp:n,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:a,targetType:o,autoComplete:l,ref:u,...f}=we("ComboboxEventsTarget",Uee,e),h=Nu(t);if(!h)throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const d=Ca();return S.cloneElement(h,{...jC({targetType:o,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:a,onKeyDown:h.props.onKeyDown,onClick:h.props.onClick,autoComplete:l}),...f,[n]:Hn(u,d.store.targetRef,gy(h))})});DI.displayName="@mantine/core/ComboboxEventsTarget";const AC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ComboboxFooter",null,e);return v.jsx(fe,{...Ca().getStyles("footer",{className:n,classNames:t,style:i,styles:r}),...o,onMouseDown:l=>{l.preventDefault()}})});AC.classes=sr;AC.displayName="@mantine/core/ComboboxFooter";const OC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,children:o,label:l,id:u,...f}=we("ComboboxGroup",null,e),h=Ca(),d=Vi(u);return v.jsxs(fe,{role:"group","aria-labelledby":l?d:void 0,...h.getStyles("group",{className:n,classNames:t,style:i,styles:r}),...f,children:[l&&v.jsx("div",{id:d,...h.getStyles("groupLabel",{classNames:t,styles:r}),children:l}),o]})});OC.classes=sr;OC.displayName="@mantine/core/ComboboxGroup";const TC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ComboboxHeader",null,e);return v.jsx(fe,{...Ca().getStyles("header",{className:n,classNames:t,style:i,styles:r}),...o,onMouseDown:l=>{l.preventDefault()}})});TC.classes=sr;TC.displayName="@mantine/core/ComboboxHeader";function RI({value:e,valuesDivider:t=",",...n}){return v.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e?`${e}`:"",...n})}RI.displayName="@mantine/core/ComboboxHiddenInput";const EC=De(e=>{const t=we("ComboboxOption",null,e),{classNames:n,className:i,style:r,styles:a,vars:o,onClick:l,id:u,active:f,onMouseDown:h,onMouseOver:d,disabled:p,selected:g,mod:b,...w}=t,k=Ca(),_=S.useId(),x=u||_;return v.jsx(fe,{...k.getStyles("option",{className:i,classNames:n,styles:a,style:r}),...w,id:x,mod:["combobox-option",{"combobox-active":f,"combobox-disabled":p,"combobox-selected":g},b],role:"option",onClick:j=>{var T;p?j.preventDefault():((T=k.onOptionSubmit)==null||T.call(k,t.value,t),l==null||l(j))},onMouseDown:j=>{j.preventDefault(),h==null||h(j)},onMouseOver:j=>{k.resetSelectionOnOptionHover&&k.store.resetSelectedOption(),d==null||d(j)}})});EC.classes=sr;EC.displayName="@mantine/core/ComboboxOption";const MC=De(e=>{const{classNames:t,className:n,style:i,styles:r,id:a,onMouseDown:o,labelledBy:l,...u}=we("ComboboxOptions",null,e),f=Ca(),h=Vi(a);return S.useEffect(()=>{f.store.setListId(h)},[h]),v.jsx(fe,{...f.getStyles("options",{className:n,style:i,classNames:t,styles:r}),...u,id:h,role:"listbox","aria-labelledby":l,onMouseDown:d=>{d.preventDefault(),o==null||o(d)}})});MC.classes=sr;MC.displayName="@mantine/core/ComboboxOptions";const Vee={withAriaAttributes:!0,withKeyboardNavigation:!0},DC=De(e=>{const{classNames:t,styles:n,unstyled:i,vars:r,withAriaAttributes:a,onKeyDown:o,onClick:l,withKeyboardNavigation:u,size:f,ref:h,...d}=we("ComboboxSearch",Vee,e),p=Ca(),g=p.getStyles("search"),b=jC({targetType:"input",withAriaAttributes:a,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:o,onClick:l,autoComplete:"off"});return v.jsx(Xn,{ref:Hn(h,p.store.searchRef),classNames:[{input:g.className},t],styles:[{input:g.style},n],size:f||p.size,...b,...d,__staticSelector:"Combobox"})});DC.classes=sr;DC.displayName="@mantine/core/ComboboxSearch";const Wee={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},PI=De(e=>{const{children:t,refProp:n,withKeyboardNavigation:i,withAriaAttributes:r,withExpandedAttribute:a,targetType:o,autoComplete:l,ref:u,...f}=we("ComboboxTarget",Wee,e),h=Nu(t);if(!h)throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const d=Ca(),p=S.cloneElement(h,{...jC({targetType:o,withAriaAttributes:r,withKeyboardNavigation:i,withExpandedAttribute:a,onKeyDown:h.props.onKeyDown,onClick:h.props.onClick,autoComplete:l}),...f});return v.jsx(Et.Target,{refProp:n,ref:Hn(u,d.store.targetRef),children:p})});PI.displayName="@mantine/core/ComboboxTarget";function Gee(e,t,n){for(let i=e-1;i>=0;i-=1)if(!t[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=t.length-1;i>-1;i-=1)if(!t[i].hasAttribute("data-combobox-disabled"))return i}return e}function Yee(e,t,n){for(let i=e+1;i{l||(u(!0),r==null||r(D))},[u,r,l]),_=S.useCallback((D="unknown")=>{l&&(u(!1),i==null||i(D))},[u,i,l]),x=S.useCallback((D="unknown")=>{l?_(D):k(D)},[_,k,l]),j=S.useCallback(()=>{const D=Vo(p.current),z=Sg(`#${f.current} [data-combobox-selected]`,D);z==null||z.removeAttribute("data-combobox-selected"),z==null||z.removeAttribute("aria-selected")},[]),T=S.useCallback(D=>{const z=Vo(p.current),H=Sg(`#${f.current}`,z),Y=H?Yo("[data-combobox-option]",H):null;if(!Y)return null;const P=D>=Y.length?0:D<0?Y.length-1:D;return h.current=P,Y!=null&&Y[P]&&!Y[P].hasAttribute("data-combobox-disabled")?(j(),Y[P].setAttribute("data-combobox-selected","true"),Y[P].setAttribute("aria-selected","true"),Y[P].scrollIntoView({block:"nearest",behavior:o}),Y[P].id):null},[o,j]),A=S.useCallback(()=>{const D=Vo(p.current),z=Sg(`#${f.current} [data-combobox-active]`,D);return T(z?Yo(`#${f.current} [data-combobox-option]`,D).findIndex(H=>H===z):0)},[T]),O=S.useCallback(()=>{const D=Vo(p.current),z=Yo(`#${f.current} [data-combobox-option]`,D);return T(Yee(h.current,z,a))},[T,a]),M=S.useCallback(()=>{const D=Vo(p.current),z=Yo(`#${f.current} [data-combobox-option]`,D);return T(Gee(h.current,z,a))},[T,a]),N=S.useCallback(()=>{const D=Vo(p.current);return T(Kee(Yo(`#${f.current} [data-combobox-option]`,D)))},[T]),F=S.useCallback((D="selected",z)=>{var H;if(typeof D=="number"){h.current=D;const Y=Vo(p.current),P=Yo(`#${f.current} [data-combobox-option]`,Y);z!=null&&z.scrollIntoView&&((H=P[D])==null||H.scrollIntoView({block:"nearest",behavior:o}));return}w.current=window.setTimeout(()=>{var V;const Y=Vo(p.current),P=Yo(`#${f.current} [data-combobox-option]`,Y),W=P.findIndex(L=>L.hasAttribute(`data-combobox-${D}`));h.current=W,z!=null&&z.scrollIntoView&&((V=P[W])==null||V.scrollIntoView({block:"nearest",behavior:o}))},0)},[]),R=S.useCallback(()=>{h.current=-1,j()},[j]),I=S.useCallback(()=>{var z,H;const D=Vo(p.current);(H=(z=Yo(`#${f.current} [data-combobox-option]`,D))==null?void 0:z[h.current])==null||H.click()},[]),q=S.useCallback(D=>{f.current=D},[]),G=S.useCallback(()=>{g.current=window.setTimeout(()=>{var D;return(D=d.current)==null?void 0:D.focus()},0)},[]),U=S.useCallback(()=>{b.current=window.setTimeout(()=>{var D;return(D=p.current)==null?void 0:D.focus()},0)},[]),$=S.useCallback(()=>h.current,[]);return S.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),{dropdownOpened:l,openDropdown:k,closeDropdown:_,toggleDropdown:x,selectedOptionIndex:h.current,getSelectedOptionIndex:$,selectOption:T,selectFirstOption:N,selectActiveOption:A,selectNextOption:O,selectPreviousOption:M,resetSelectedOption:R,updateSelectedOptionIndex:F,listId:f.current,setListId:q,clickSelectedOption:I,searchRef:d,focusSearchInput:G,targetRef:p,focusTarget:U}}const Xee={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},NI=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":oi(t),"--combobox-option-padding":$t(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:pe(n),"--combobox-option-fz":oi(t),"--combobox-option-padding":$t(t,"combobox-option-padding")}}),jt=e=>{const t=we("Combobox",Xee,e),{classNames:n,styles:i,unstyled:r,children:a,store:o,vars:l,onOptionSubmit:u,onClose:f,size:h,dropdownPadding:d,resetSelectionOnOptionHover:p,__staticSelector:g,readOnly:b,attributes:w,...k}=t,_=Vf(),x=o||_,j=Ze({name:g||"Combobox",classes:sr,props:t,classNames:n,styles:i,unstyled:r,attributes:w,vars:l,varsResolver:NI}),T=()=>{f==null||f(),x.closeDropdown()};return v.jsx(qee,{value:{getStyles:j,store:x,onOptionSubmit:u,size:h,resetSelectionOnOptionHover:p,readOnly:b},children:v.jsx(Et,{opened:x.dropdownOpened,preventPositionChangeWhenVisible:!1,...k,onChange:A=>!A&&T(),withRoles:!1,unstyled:r,children:a})})},Zee=e=>e;jt.extend=Zee;jt.classes=sr;jt.varsResolver=NI;jt.displayName="@mantine/core/Combobox";jt.Target=PI;jt.Dropdown=SC;jt.Options=MC;jt.Option=EC;jt.Search=DC;jt.Empty=CC;jt.Chevron=Dy;jt.Footer=AC;jt.Header=TC;jt.EventsTarget=DI;jt.DropdownTarget=MI;jt.Group=OC;jt.ClearButton=EI;jt.HiddenInput=RI;function Qee({children:e,role:t}){const n=S.use(Lu);return n?v.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):v.jsx(v.Fragment,{children:e})}const RC=S.createContext(null),Jee={hiddenInputValuesSeparator:","},PC=ep((e=>{const{value:t,defaultValue:n,onChange:i,size:r,wrapperProps:a,children:o,readOnly:l,name:u,hiddenInputValuesSeparator:f,hiddenInputProps:h,maxSelectedValues:d,disabled:p,...g}=we("CheckboxGroup",Jee,e),[b,w]=ji({value:t,defaultValue:n,finalValue:[],onChange:i}),k=j=>{const T=typeof j=="string"?j:j.currentTarget.value;if(l)return;const A=b.includes(T);!A&&d&&b.length>=d||w(A?b.filter(O=>O!==T):[...b,T])},_=j=>{if(p)return!0;if(!d)return!1;const T=b.includes(j),A=b.length>=d;return!T&&A},x=b.join(f);return v.jsx(RC,{value:{value:b,onChange:k,size:r,isDisabled:_},children:v.jsxs(Xn.Wrapper,{size:r,...a,...g,labelElement:"div",__staticSelector:"CheckboxGroup",children:[v.jsx(Qee,{role:"group",children:o}),v.jsx("input",{type:"hidden",name:u,value:x,...h})]})})}));PC.classes=Xn.Wrapper.classes;PC.displayName="@mantine/core/CheckboxGroup";var $I={card:"m_26775b0a"};const zI=S.createContext(null),ete={withBorder:!0},LI=(e,{radius:t})=>({card:{"--card-radius":qn(t)}}),Ry=De(e=>{const t=we("CheckboxCard",ete,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,checked:u,mod:f,withBorder:h,value:d,onClick:p,defaultChecked:g,onChange:b,attributes:w,...k}=t,_=Ze({name:"CheckboxCard",classes:$I,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:LI,rootSelector:"card"}),x=S.use(RC),[j,T]=ji({value:typeof u=="boolean"?u:x?x.value.includes(d||""):void 0,defaultValue:g,finalValue:!1,onChange:b});return v.jsx(zI,{value:{checked:j},children:v.jsx(En,{mod:[{"with-border":h,checked:j},f],..._("card"),...k,role:"checkbox","aria-checked":j,onClick:A=>{p==null||p(A),x==null||x.onChange(d||""),T(!j)}})})});Ry.displayName="@mantine/core/CheckboxCard";Ry.classes=$I;Ry.varsResolver=LI;function NC({size:e,style:t,...n}){return v.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e!==void 0?{width:pe(e),height:pe(e),...t}:t,"aria-hidden":!0,...n,children:v.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function II({indeterminate:e,...t}){return e?v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:v.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):v.jsx(NC,{...t})}var BI={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const tte={icon:II,variant:"filled",radius:"sm"},FI=(e,{radius:t,color:n,size:i,iconColor:r,variant:a,autoContrast:o})=>{const l=gs({color:n||e.primaryColor,theme:e}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":$t(i,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:qn(t),"--checkbox-color":a==="outline"?u:fn(n,e),"--checkbox-icon-color":r?fn(r,e):Qm(o,e)?If({color:n,theme:e,autoContrast:o}):void 0}}},Py=De(e=>{const t=we("CheckboxIndicator",tte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,icon:u,indeterminate:f,radius:h,color:d,iconColor:p,autoContrast:g,checked:b,mod:w,variant:k,disabled:_,attributes:x,...j}=t,T=Ze({name:"CheckboxIndicator",classes:BI,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:FI,rootSelector:"indicator"}),A=S.use(zI),O=typeof b=="boolean"||typeof f=="boolean"?b||f:(A==null?void 0:A.checked)||!1;return v.jsx(fe,{...T("indicator",{variant:k}),variant:k,mod:[{checked:O,disabled:_},w],...j,children:v.jsx(u,{indeterminate:f,...T("icon")})})});Py.displayName="@mantine/core/CheckboxIndicator";Py.classes=BI;Py.varsResolver=FI;var qI={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const nte=qI;function HI({__staticSelector:e,__stylesApiProps:t,className:n,classNames:i,styles:r,unstyled:a,children:o,label:l,description:u,id:f,disabled:h,error:d,size:p,labelPosition:g="left",bodyElement:b="div",labelElement:w="label",variant:k,style:_,vars:x,mod:j,attributes:T,...A}){const O=Ze({name:e,props:t,className:n,style:_,classes:qI,classNames:i,styles:r,unstyled:a,attributes:T});return v.jsx(fe,{...O("root"),__vars:{"--label-fz":oi(p),"--label-lh":$t(p,"label-lh")},mod:[{"label-position":g},j],variant:k,size:p,...A,children:v.jsxs(fe,{component:b,htmlFor:b==="label"?f:void 0,...O("body"),children:[o,v.jsxs("div",{...O("labelWrapper"),"data-disabled":h||void 0,children:[l&&v.jsx(fe,{component:w,htmlFor:w==="label"?f:void 0,...O("label"),"data-disabled":h||void 0,children:l}),u&&v.jsx(Xn.Description,{size:p,__inheritStyles:!1,...O("description"),children:u}),d&&typeof d!="boolean"&&v.jsx(Xn.Error,{size:p,__inheritStyles:!1,...O("error"),children:d})]})]})})}HI.displayName="@mantine/core/InlineInput";var UI={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const ite={labelPosition:"right",icon:II,withErrorStyles:!0,variant:"filled",radius:"sm"},VI=(e,{radius:t,color:n,size:i,iconColor:r,variant:a,autoContrast:o})=>{const l=gs({color:n||e.primaryColor,theme:e}),u=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":$t(i,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:qn(t),"--checkbox-color":a==="outline"?u:fn(n,e),"--checkbox-icon-color":r?fn(r,e):Qm(o,e)?If({color:n,theme:e,autoContrast:o}):void 0}}},po=De(e=>{var X;const t=we("Checkbox",ite,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,color:u,label:f,id:h,size:d,radius:p,wrapperProps:g,checked:b,labelPosition:w,description:k,error:_,disabled:x,variant:j,indeterminate:T,icon:A,rootRef:O,iconColor:M,onChange:N,autoContrast:F,mod:R,attributes:I,readOnly:q,onClick:G,withErrorStyles:U,ref:$,...D}=t,z=S.useRef(null),H=S.use(RC),Y=d||(H==null?void 0:H.size),P=Ze({name:"Checkbox",props:t,classes:UI,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:I,vars:l,varsResolver:VI}),{styleProps:W,rest:V}=$u(D),L=Vi(h),Z={checked:(H==null?void 0:H.value.includes(V.value))??b,onChange:le=>{H==null||H.onChange(le),N==null||N(le)}},ie=((X=H==null?void 0:H.isDisabled)==null?void 0:X.call(H,V.value))??!1,re=x||ie;return S.useEffect(()=>{z.current&&(z.current.indeterminate=T||!1,T?z.current.setAttribute("data-indeterminate","true"):z.current.removeAttribute("data-indeterminate"))},[T]),v.jsx(HI,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:t,id:L,size:Y,labelPosition:w,label:f,description:k,error:_,disabled:re,classNames:n,styles:a,unstyled:o,"data-checked":Z.checked||b||void 0,variant:j,ref:O,mod:R,attributes:I,inert:V.inert,...W,...g,children:v.jsxs(fe,{...P("inner"),mod:{"data-label-position":w},children:[v.jsx(fe,{component:"input",id:L,ref:Hn(z,$),mod:{error:!!_},...P("input",{focusable:!0,variant:j}),...V,...Z,disabled:re,inert:V.inert,type:"checkbox",onClick:le=>{q&&le.preventDefault(),G==null||G(le)}}),v.jsx(A,{indeterminate:T,...P("icon")})]})})});po.classes={...UI,...nte};po.varsResolver=VI;po.displayName="@mantine/core/Checkbox";po.Group=PC;po.Indicator=Py;po.Card=Ry;function xu(e){return"group"in e}function WI({options:e,search:t,limit:n}){const i=t.trim().toLowerCase(),r=[];for(let a=0;a0)return!1;return!0}function GI(e,t=new Set){if(Array.isArray(e))for(const n of e)if(xu(n))GI(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function ate(e,t){return Array.isArray(e)?e.includes(t):e===t}function YI({data:e,withCheckIcon:t,withAlignedLabels:n,value:i,checkIconPosition:r,unstyled:a,renderOption:o}){if(!xu(e)){const u=ate(i,e.value),f=t&&(u?v.jsx(NC,{className:sr.optionsDropdownCheckIcon}):n?v.jsx("div",{className:sr.optionsDropdownCheckPlaceholder}):null),h=v.jsxs(v.Fragment,{children:[r==="left"&&f,v.jsx("span",{children:e.label}),r==="right"&&f]});return v.jsx(jt.Option,{value:e.value,disabled:e.disabled,className:vt({[sr.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):h})}const l=e.items.map(u=>v.jsx(YI,{data:u,value:i,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:r,renderOption:o},`${u.value}`));return v.jsx(jt.Group,{label:e.group,children:l})}function Ny({data:e,hidden:t,hiddenWhenEmpty:n,filter:i,search:r,limit:a,maxDropdownHeight:o,withScrollArea:l=!0,filterOptions:u=!0,withCheckIcon:f=!1,withAlignedLabels:h=!1,value:d,checkIconPosition:p,nothingFoundMessage:g,unstyled:b,labelId:w,renderOption:k,scrollAreaProps:_,"aria-label":x}){GI(e);const j=typeof r=="string"?(i||WI)({options:e,search:u?r:"",limit:a??1/0}):e,T=rte(j),A=j.map(O=>v.jsx(YI,{data:O,withCheckIcon:f,withAlignedLabels:h,value:d,checkIconPosition:p,unstyled:b,renderOption:k},xu(O)?O.group:`${O.value}`));return v.jsx(jt.Dropdown,{hidden:t||n&&T,"data-composed":!0,children:v.jsxs(jt.Options,{labelledBy:w,"aria-label":x,children:[l?v.jsx(lr.Autosize,{mah:o??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",..._,children:A}):A,T&&g&&v.jsx(jt.Empty,{children:g})]})})}const $y=De(e=>{const t=we("Autocomplete",{size:"sm"},e),{classNames:n,styles:i,unstyled:r,vars:a,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:f,onFocus:h,onBlur:d,onClick:p,onChange:g,data:b,value:w,defaultValue:k,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:x,onOptionSubmit:j,comboboxProps:T,readOnly:A,disabled:O,filter:M,limit:N,withScrollArea:F,maxDropdownHeight:R,size:I,id:q,renderOption:G,autoComplete:U,scrollAreaProps:$,onClear:D,clearButtonProps:z,error:H,clearable:Y,clearSectionMode:P,rightSection:W,autoSelectOnBlur:V,openOnFocus:L=!0,attributes:Z,...ie}=t,re=Vi(q),X=My(b),le=up(X),[ee,se]=ji({value:w,defaultValue:k,finalValue:"",onChange:g}),ke=Vf({opened:o,defaultOpened:l,onDropdownOpen:()=>{f==null||f(),x&&ke.selectFirstOption()},onDropdownClose:()=>{u==null||u(),setTimeout(ke.resetSelectedOption,0)}}),ne=ze=>{se(ze),ke.resetSelectedOption()},{resolvedClassNames:$e,resolvedStyles:xe}=Wi({props:t,styles:i,classNames:n});S.useEffect(()=>{_&&ke.selectFirstOption()},[_,ee]);const Ae=v.jsx(jt.ClearButton,{...z,onClear:()=>{ne(""),D==null||D()}});return v.jsxs(jt,{store:ke,__staticSelector:"Autocomplete",classNames:$e,styles:xe,unstyled:r,readOnly:A,size:I,attributes:Z,keepMounted:V,onOptionSubmit:ze=>{j==null||j(ze),ne(le[ze].label),ke.closeDropdown()},...T,children:[v.jsx(jt.Target,{autoComplete:U,withExpandedAttribute:!0,children:v.jsx(Ni,{...ie,size:I,__staticSelector:"Autocomplete",__clearSection:Ae,__clearable:Y&&!!ee&&!O&&!A,__clearSectionMode:P,rightSection:W,disabled:O,readOnly:A,value:ee,error:H,onChange:ze=>{ne(ze.currentTarget.value),ke.openDropdown(),_&&ke.selectFirstOption()},onFocus:ze=>{L&&ke.openDropdown(),h==null||h(ze)},onBlur:ze=>{V&&ke.clickSelectedOption(),ke.closeDropdown(),d==null||d(ze)},onClick:ze=>{ke.openDropdown(),p==null||p(ze)},classNames:$e,styles:xe,unstyled:r,attributes:Z,id:re})}),v.jsx(Ny,{data:X,hidden:A||O,filter:M,search:ee,limit:N,hiddenWhenEmpty:!0,withScrollArea:F,maxDropdownHeight:R,unstyled:r,labelId:ie.label?`${re}-label`:void 0,"aria-label":ie.label?void 0:ie["aria-label"],renderOption:G,scrollAreaProps:$})]})});$y.classes={...Ni.classes,...jt.classes};$y.displayName="@mantine/core/Autocomplete";var zy={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const KI=S.createContext({withinGroup:!1}),XI=(e,{spacing:t})=>({group:{"--ag-spacing":Yn(t)}}),Ly=De(e=>{const t=we("AvatarGroup",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,spacing:u,attributes:f,...h}=t;return v.jsx(KI,{value:{withinGroup:!0},children:v.jsx(fe,{...Ze({name:"AvatarGroup",classes:zy,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:XI,rootSelector:"group"})("group"),...h})})});Ly.classes=zy;Ly.varsResolver=XI;Ly.displayName="@mantine/core/AvatarGroup";function ote(e){return v.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function ste(e){let t=0;for(let n=0;ni[0]).slice(0,t).join("").toUpperCase()}const ZI=(e,{size:t,radius:n,variant:i,gradient:r,color:a,autoContrast:o,name:l,allowedInitialsColors:u})=>{const f=a==="initials"&&typeof l=="string"?ute(l,u):a,h=e.variantColorResolver({color:f||"gray",theme:e,gradient:r,variant:i||"light",autoContrast:o});return{root:{"--avatar-size":$t(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:qn(n),"--avatar-bg":f||i?h.background:void 0,"--avatar-color":f||i?h.color:void 0,"--avatar-bd":f||i?h.border:void 0}}},vo=wi(e=>{const t=we("Avatar",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,src:u,alt:f,radius:h,color:d,gradient:p,imageProps:g,children:b,autoContrast:w,mod:k,name:_,allowedInitialsColors:x,attributes:j,...T}=t,A=S.use(KI),[O,M]=S.useState(!u),N=Ze({name:"Avatar",props:t,classes:zy,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:j,vars:l,varsResolver:ZI});return S.useEffect(()=>M(!u),[u]),v.jsx(fe,{...N("root"),mod:[{"within-group":A.withinGroup},k],...T,children:O||!u?v.jsx("span",{...N("placeholder"),title:f,children:b||typeof _=="string"&&cte(_)||v.jsx(ote,{})}):v.jsx("img",{...g,...N("image"),src:u,alt:f,onError:F=>{var R;M(!0),(R=g==null?void 0:g.onError)==null||R.call(g,F)}})})});vo.classes=zy;vo.varsResolver=ZI;vo.displayName="@mantine/core/Avatar";vo.Group=Ly;var QI={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const JI=(e,{radius:t,color:n,gradient:i,variant:r,size:a,autoContrast:o,circle:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--badge-height":$t(a,"badge-height"),"--badge-padding-x":$t(a,"badge-padding-x"),"--badge-fz":$t(a,"badge-fz"),"--badge-radius":l||t===void 0?void 0:qn(t),"--badge-bg":n||r?u.background:void 0,"--badge-color":n||r?u.color:void 0,"--badge-bd":n||r?u.border:void 0,"--badge-dot-color":r==="dot"?fn(n,e):void 0}}},ln=wi(e=>{const t=we("Badge",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,radius:u,color:f,gradient:h,leftSection:d,rightSection:p,children:g,variant:b,fullWidth:w,autoContrast:k,circle:_,mod:x,attributes:j,...T}=t,A=Ze({name:"Badge",props:t,classes:QI,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:j,vars:l,varsResolver:JI});return v.jsxs(fe,{variant:b,mod:[{block:w,circle:_,"with-right-section":!!p,"with-left-section":!!d},x],...A("root",{variant:b}),...T,children:[d&&v.jsx("span",{...A("section"),"data-position":"left",children:d}),v.jsx("span",{...A("label"),children:g}),p&&v.jsx("span",{...A("section"),"data-position":"right",children:p})]})});ln.classes=QI;ln.varsResolver=JI;ln.displayName="@mantine/core/Badge";var Wf={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const wE={orientation:"horizontal"},eB=(e,{borderWidth:t})=>({group:{"--button-border-width":pe(t)}}),Iy=De(e=>{const t=we("ButtonGroup",wE,e),{className:n,style:i,classNames:r,styles:a,unstyled:o,orientation:l,vars:u,borderWidth:f,mod:h,attributes:d,...p}=we("ButtonGroup",wE,e);return v.jsx(fe,{...Ze({name:"ButtonGroup",props:t,classes:Wf,className:n,style:i,classNames:r,styles:a,unstyled:o,attributes:d,vars:u,varsResolver:eB,rootSelector:"group"})("group"),mod:[{"data-orientation":l},h],role:"group",...p})});Iy.classes=Wf;Iy.varsResolver=eB;Iy.displayName="@mantine/core/ButtonGroup";const tB=(e,{radius:t,color:n,gradient:i,variant:r,autoContrast:a,size:o})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":$t(o,"section-height"),"--section-padding-x":$t(o,"section-padding-x"),"--section-fz":o!=null&&o.includes("compact")?oi(o.replace("compact-","")):oi(o),"--section-radius":t===void 0?void 0:qn(t),"--section-bg":n||r?l.background:void 0,"--section-color":l.color,"--section-bd":n||r?l.border:void 0}}},By=De(e=>{const t=we("ButtonGroupSection",null,e),{className:n,style:i,classNames:r,styles:a,unstyled:o,vars:l,gradient:u,radius:f,autoContrast:h,attributes:d,...p}=t;return v.jsx(fe,{...Ze({name:"ButtonGroupSection",props:t,classes:Wf,className:n,style:i,classNames:r,styles:a,unstyled:o,attributes:d,vars:l,varsResolver:tB,rootSelector:"groupSection"})("groupSection"),...p})});By.classes=Wf;By.varsResolver=tB;By.displayName="@mantine/core/ButtonGroupSection";const fte={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${pe(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},nB=(e,{radius:t,color:n,gradient:i,variant:r,size:a,justify:o,autoContrast:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:l});return{root:{"--button-justify":o,"--button-height":$t(a,"button-height"),"--button-padding-x":$t(a,"button-padding-x"),"--button-fz":a!=null&&a.includes("compact")?oi(a.replace("compact-","")):oi(a),"--button-radius":t===void 0?void 0:qn(t),"--button-bg":n||r?u.background:void 0,"--button-hover":n||r?u.hover:void 0,"--button-color":u.color,"--button-bd":n||r?u.border:void 0,"--button-hover-color":n||r?u.hoverColor:void 0}}},tn=wi(e=>{const t=we("Button",null,e),{style:n,vars:i,className:r,color:a,disabled:o,children:l,leftSection:u,rightSection:f,fullWidth:h,variant:d,radius:p,loading:g,loaderProps:b,gradient:w,classNames:k,styles:_,unstyled:x,"data-disabled":j,autoContrast:T,mod:A,attributes:O,...M}=t,N=Ze({name:"Button",props:t,classes:Wf,className:r,style:n,classNames:k,styles:_,unstyled:x,attributes:O,vars:i,varsResolver:nB}),F=!!u,R=!!f;return v.jsxs(En,{...N("root",{active:!o&&!g&&!j}),unstyled:x,variant:d,disabled:o||g,mod:[{disabled:o||j,loading:g,block:h,"with-left-section":F,"with-right-section":R},A],...M,children:[typeof g=="boolean"&&v.jsx(us,{mounted:g,transition:fte,duration:150,children:I=>v.jsx(fe,{component:"span",...N("loader",{style:I}),"aria-hidden":!0,children:v.jsx(Jn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...b})})}),v.jsxs("span",{...N("inner"),children:[u&&v.jsx(fe,{component:"span",...N("section"),mod:{position:"left"},children:u}),v.jsx(fe,{component:"span",mod:{loading:g},...N("label"),children:l}),f&&v.jsx(fe,{component:"span",...N("section"),mod:{position:"right"},children:f})]})]})});tn.classes=Wf;tn.varsResolver=nB;tn.displayName="@mantine/core/Button";tn.Group=Iy;tn.GroupSection=By;const[dte,hte]=Gr("Card component was not found in tree");var $C={root:"m_e615b15f",section:"m_599a2148"};const Fy=wi(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,withBorder:o,inheritPadding:l,mod:u,...f}=we("CardSection",null,e),h=hte();return v.jsx(fe,{mod:[{"with-border":o,"inherit-padding":l},u],...h.getStyles("section",{className:n,style:i,styles:r,classNames:t}),...f})});Fy.classes=$C;Fy.displayName="@mantine/core/CardSection";const iB=(e,{padding:t})=>({root:{"--card-padding":Yn(t)}}),mte={orientation:"vertical"},Ia=wi(e=>{const t=we("Card",mte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,children:u,padding:f,attributes:h,orientation:d,...p}=t,g=Ze({name:"Card",props:t,classes:$C,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:iB}),b=S.Children.toArray(u),w=b.map((k,_)=>{var x;return typeof k=="object"&&k&&"type"in k&&(k.type===Fy||((x=k.type)==null?void 0:x.displayName)==="@mantine/core/CardSection")?S.cloneElement(k,{"data-orientation":d,"data-first-section":_===0||void 0,"data-last-section":_===b.length-1||void 0}):k});return v.jsx(dte,{value:{getStyles:g},children:v.jsx(Tn,{unstyled:o,"data-orientation":d,...g("root"),...p,children:w})})});Ia.classes=$C;Ia.varsResolver=iB;Ia.displayName="@mantine/core/Card";Ia.Section=Fy;var rB={root:"m_4451eb3a"};const Gf=wi(e=>{const t=we("Center",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,inline:u,mod:f,attributes:h,...d}=t,p=Ze({name:"Center",props:t,classes:rB,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:h,vars:l});return v.jsx(fe,{mod:[{inline:u},f],...p("root"),...d})});Gf.classes=rB;Gf.displayName="@mantine/core/Center";var aB={root:"m_b183c0a2"};const oB=(e,{color:t})=>({root:{"--code-bg":t?fn(t,e):void 0}}),ml=De(e=>{const t=we("Code",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,color:u,block:f,mod:h,attributes:d,...p}=t,g=Ze({name:"Code",props:t,classes:aB,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:d,vars:l,varsResolver:oB});return v.jsx(fe,{component:f?"pre":"code",mod:[{block:f},h],...g("root"),...p,dir:"ltr"})});ml.classes=aB;ml.varsResolver=oB;ml.displayName="@mantine/core/Code";var sB={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const kE={withShadow:!0},lB=(e,{radius:t,size:n})=>({root:{"--cs-radius":t===void 0?void 0:qn(t),"--cs-size":pe(n)}}),Yf=wi(e=>{const t=we("ColorSwatch",kE,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,color:u,radius:f,withShadow:h,children:d,attributes:p,...g}=we("ColorSwatch",kE,t),b=Ze({name:"ColorSwatch",props:t,classes:sB,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:lB});return v.jsxs(fe,{...b("root",{focusable:!0}),...g,children:[v.jsx("span",{...b("alphaOverlay")}),h&&v.jsx("span",{...b("shadowOverlay")}),v.jsx("span",{...b("colorOverlay",{style:{backgroundColor:u}})}),v.jsx("span",{...b("childrenOverlay"),children:d})]})});Yf.classes=sB;Yf.varsResolver=lB;Yf.displayName="@mantine/core/ColorSwatch";function pa(e,t=0,n=10**t){return Math.round(n*e)/n}function pte({h:e,s:t,l:n,a:i}){const r=t*((n<50?n:100-n)/100);return{h:e,s:r>0?2*r/(n+r)*100:0,v:n+r,a:i}}const vte={grad:360/400,turn:360,rad:360/(Math.PI*2)};function gte(e,t="deg"){return Number(e)*(vte[t]||1)}const yte=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function _E(e){const t=yte.exec(e);return t?pte({h:gte(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}}function PS({r:e,g:t,b:n,a:i}){const r=Math.max(e,t,n),a=r-Math.min(e,t,n),o=a?r===e?(t-n)/a:r===t?2+(n-e)/a:4+(e-t)/a:0;return{h:pa(60*(o<0?o+6:o),3),s:pa(r?a/r*100:0,3),v:pa(r/255*100,3),a:i}}function NS(e){const t=e[0]==="#"?e.slice(1):e;return t.length===3?PS({r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:1}):PS({r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:1})}function bte(e){const t=e[0]==="#"?e.slice(1):e,n=a=>pa(parseInt(a,16)/255,3);if(t.length===4){const a=t.slice(0,3),o=n(t[3]+t[3]);return{...NS(a),a:o}}const i=t.slice(0,6),r=n(t.slice(6,8));return{...NS(i),a:r}}const wte=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function xE(e){const t=wte.exec(e);return t?PS({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}}const uB={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},kte={hex:NS,hexa:bte,rgb:xE,rgba:xE,hsl:_E,hsla:_E};function _te(e){for(const[,t]of Object.entries(uB))if(t.test(e))return!0;return!1}function Zv(e){if(typeof e!="string")return{h:0,s:0,v:0,a:1};if(e==="transparent")return{h:0,s:0,v:0,a:0};const t=e.trim();for(const[n,i]of Object.entries(uB))if(i.test(t))return kte[n](t);return{h:0,s:0,v:0,a:1}}const qy=S.createContext(null);function zC({position:e,...t}){return v.jsx(fe,{__vars:{"--thumb-y-offset":`${e.y*100}%`,"--thumb-x-offset":`${e.x*100}%`},...t})}zC.displayName="@mantine/core/ColorPickerThumb";var Hy={wrapper:"m_fee9c77",preview:"m_9dddfbac",body:"m_bffecc3e",sliders:"m_3283bb96",thumb:"m_40d572ba",swatch:"m_d8ee6fd8",swatches:"m_5711e686",saturation:"m_202a296e",saturationOverlay:"m_11b3db02",slider:"m_d856d47d",sliderOverlay:"m_8f327113"};const Kf=De(e=>{var H;const t=we("ColorSlider",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,onChange:u,onChangeEnd:f,maxValue:h,round:d,size:p="md",focusable:g=!0,value:b,overlays:w,thumbColor:k="transparent",onScrubStart:_,onScrubEnd:x,__staticSelector:j="ColorPicker",attributes:T,ref:A,...O}=t,M=Ze({name:j,classes:Hy,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:T,rootSelector:"slider"}),N=((H=S.use(qy))==null?void 0:H.getStyles)||M,F=ci(),[R,I]=S.useState({y:0,x:b/h}),q=S.useRef(R),G=Y=>d?Math.round(Y*h):Y*h,{ref:U}=$z(({x:Y,y:P})=>{q.current={x:Y,y:P},u==null||u(G(Y))},{onScrubEnd:()=>{const{x:Y}=q.current;f==null||f(G(Y)),x==null||x()},onScrubStart:_});ss(()=>{I({y:0,x:b/h})},[b]);const $=(Y,P)=>{Y.preventDefault();const W=Nz(P);u==null||u(G(W.x)),f==null||f(G(W.x))},D=Y=>{switch(Y.key){case"ArrowRight":$(Y,{x:R.x+.05,y:R.y});break;case"ArrowLeft":$(Y,{x:R.x-.05,y:R.y});break}},z=w.map((Y,P)=>S.createElement("div",{...N("sliderOverlay"),style:Y,key:P}));return v.jsxs(fe,{...O,ref:Hn(U,A),...N("slider"),size:p,role:"slider","aria-valuenow":b,"aria-valuemax":h,"aria-valuemin":0,tabIndex:g?0:-1,onKeyDown:D,"data-focus-ring":F.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${p})`},children:[z,v.jsx(zC,{position:R,...N("thumb",{style:{top:pe(1),background:k}})})]})});Kf.displayName="@mantine/core/ColorSlider";Kf.classes=Hy;const xte={__staticSelector:"AlphaSlider"},LC=De(e=>{const{value:t,onChange:n,onChangeEnd:i,color:r,...a}=we("AlphaSlider",xte,e);return v.jsx(Kf,{...a,value:t,onChange:o=>n==null?void 0:n(pa(o,2)),onChangeEnd:o=>i==null?void 0:i(pa(o,2)),maxValue:1,round:!1,"data-alpha":!0,overlays:[{backgroundImage:"linear-gradient(45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--slider-checkers) 75%), linear-gradient(-45deg, var(--mantine-color-body) 75%, var(--slider-checkers) 75%)",backgroundSize:`${pe(8)} ${pe(8)}`,backgroundPosition:`0 0, 0 ${pe(4)}, ${pe(4)} ${pe(-4)}, ${pe(-4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${r})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${pe(1)} inset, rgb(0, 0, 0, .15) 0 0 ${pe(4)} inset`}]})});LC.displayName="@mantine/core/AlphaSlider";LC.classes=Kf.classes;function cB({h:e,s:t,v:n,a:i}){const r=e/360*6,a=t/100,o=n/100,l=Math.floor(r),u=o*(1-a),f=o*(1-(r-l)*a),h=o*(1-(1-r+l)*a),d=l%6;return{r:pa([o,f,u,u,h,o][d]*255),g:pa([h,o,o,f,u,u][d]*255),b:pa([u,u,h,o,o,f][d]*255),a:pa(i,2)}}function SE(e,t){const{r:n,g:i,b:r,a}=cB(e);return t?`rgba(${n}, ${i}, ${r}, ${pa(a,2)})`:`rgb(${n}, ${i}, ${r})`}function CE({h:e,s:t,v:n,a:i},r){const a=(200-t)*n/100,o={h:Math.round(e),s:Math.round(a>0&&a<200?t*n/100/(a<=100?a:200-a)*100:0),l:Math.round(a/2)};return r?`hsla(${o.h}, ${o.s}%, ${o.l}%, ${pa(i,2)})`:`hsl(${o.h}, ${o.s}%, ${o.l}%)`}function Eg(e){const t=e.toString(16);return t.length<2?`0${t}`:t}function fB(e){const{r:t,g:n,b:i}=cB(e);return`#${Eg(t)}${Eg(n)}${Eg(i)}`}function Ste(e){const t=Math.round(e.a*255);return`${fB(e)}${Eg(t)}`}const Dk={hex:fB,hexa:e=>Ste(e),rgb:e=>SE(e,!1),rgba:e=>SE(e,!0),hsl:e=>CE(e,!1),hsla:e=>CE(e,!0)};function Qs(e,t){return t?e in Dk?Dk[e](t):Dk.hex(t):"#000000"}const Cte={__staticSelector:"HueSlider"},IC=De(e=>{const{value:t,onChange:n,onChangeEnd:i,color:r,...a}=we("HueSlider",Cte,e);return v.jsx(Kf,{...a,value:t,onChange:n,onChangeEnd:i,maxValue:360,thumbColor:`hsl(${t}, 100%, 50%)`,round:!0,"data-hue":!0,overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${pe(1)} inset, rgb(0, 0, 0, .15) 0 0 ${pe(4)} inset`}]})});IC.displayName="@mantine/core/HueSlider";IC.classes=Kf.classes;function dB({className:e,onChange:t,onChangeEnd:n,value:i,saturationLabel:r,focusable:a=!0,size:o,color:l,onScrubStart:u,onScrubEnd:f,...h}){const{getStyles:d}=S.use(qy),[p,g]=S.useState({x:i.s/100,y:1-i.v/100}),b=S.useRef(p),{ref:w}=$z(({x,y:j})=>{b.current={x,y:j},t({s:Math.round(x*100),v:Math.round((1-j)*100)})},{onScrubEnd:()=>{const{x,y:j}=b.current;n({s:Math.round(x*100),v:Math.round((1-j)*100)}),f==null||f()},onScrubStart:u});S.useEffect(()=>{g({x:i.s/100,y:1-i.v/100})},[i.s,i.v]);const k=(x,j)=>{x.preventDefault();const T=Nz(j);t({s:Math.round(T.x*100),v:Math.round((1-T.y)*100)}),n({s:Math.round(T.x*100),v:Math.round((1-T.y)*100)})},_=x=>{switch(x.key){case"ArrowUp":k(x,{y:p.y-.05,x:p.x});break;case"ArrowDown":k(x,{y:p.y+.05,x:p.x});break;case"ArrowRight":k(x,{x:p.x+.05,y:p.y});break;case"ArrowLeft":k(x,{x:p.x-.05,y:p.y});break}};return v.jsxs(fe,{...d("saturation"),ref:w,...h,role:"slider","aria-label":r,"aria-valuenow":p.x,"aria-valuetext":Qs("rgba",i),tabIndex:a?0:-1,onKeyDown:_,children:[v.jsx("div",{...d("saturationOverlay",{style:{backgroundColor:`hsl(${i.h}, 100%, 50%)`}})}),v.jsx("div",{...d("saturationOverlay",{style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}})}),v.jsx("div",{...d("saturationOverlay",{style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}})}),v.jsx(zC,{position:p,...d("thumb",{style:{backgroundColor:l}})})]})}dB.displayName="@mantine/core/Saturation";function hB({className:e,datatype:t,setValue:n,onChangeEnd:i,size:r,focusable:a,data:o,swatchesPerRow:l,value:u,...f}){const h=S.use(qy),d=o.map((p,g)=>S.createElement(Yf,{...h.getStyles("swatch"),unstyled:h.unstyled,component:"button",type:"button",color:p,key:g,radius:"sm",onClick:()=>{n(p),i==null||i(p)},"aria-label":p,tabIndex:a?0:-1,"data-swatch":!0},u===p&&v.jsx(NC,{size:"35%",color:Bz(p)<.5?"white":"black"})));return v.jsx(fe,{...h.getStyles("swatches"),...f,children:d})}hB.displayName="@mantine/core/Swatches";const jte={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},mB=(e,{size:t,swatchesPerRow:n})=>({wrapper:{"--cp-preview-size":$t(t,"cp-preview-size"),"--cp-width":$t(t,"cp-width"),"--cp-body-spacing":Yn(t),"--cp-swatch-size":`${100/n}%`,"--cp-thumb-size":$t(t,"cp-thumb-size"),"--cp-saturation-height":$t(t,"cp-saturation-height")}}),Uy=De(e=>{const t=we("ColorPicker",jte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,format:u="hex",value:f,defaultValue:h,onChange:d,onChangeEnd:p,withPicker:g,size:b,saturationLabel:w,hueLabel:k,alphaLabel:_,focusable:x,swatches:j,swatchesPerRow:T,fullWidth:A,onColorSwatchClick:O,__staticSelector:M,mod:N,attributes:F,name:R,hiddenInputProps:I,...q}=t,G=Ze({name:M,props:t,classes:Hy,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:F,rootSelector:"wrapper",vars:l,varsResolver:mB}),U=S.useRef(u||"hex"),$=S.useRef(""),D=S.useRef(-1),z=S.useRef(!1),H=u==="hexa"||u==="rgba"||u==="hsla",[Y,P,W]=ji({value:f,defaultValue:h,finalValue:"#FFFFFF",onChange:d}),[V,L]=S.useState(Zv(Y)),Z=()=>{window.clearTimeout(D.current),z.current=!0},ie=()=>{window.clearTimeout(D.current),D.current=window.setTimeout(()=>{z.current=!1},200)},re=X=>{L(le=>{const ee={...le,...X};return $.current=Qs(U.current,ee),ee}),P($.current)};return ss(()=>{typeof f=="string"&&_te(f)&&!z.current&&L(Zv(f))},[f]),ss(()=>{U.current=u||"hex",P(Qs(U.current,V))},[u]),v.jsx(qy,{value:{getStyles:G,unstyled:o},children:v.jsxs(fe,{...G("wrapper"),size:b,mod:[{"full-width":A},N],...q,children:[R&&v.jsx("input",{type:"hidden",name:R,value:Y,...I}),g&&v.jsxs(v.Fragment,{children:[v.jsx(dB,{value:V,onChange:re,onChangeEnd:({s:X,v:le})=>p==null?void 0:p(Qs(U.current,{...V,s:X,v:le})),color:Y,size:b,focusable:x,saturationLabel:w,onScrubStart:Z,onScrubEnd:ie}),v.jsxs("div",{...G("body"),children:[v.jsxs("div",{...G("sliders"),children:[v.jsx(IC,{value:V.h,onChange:X=>re({h:X}),onChangeEnd:X=>p==null?void 0:p(Qs(U.current,{...V,h:X})),size:b,focusable:x,"aria-label":k,onScrubStart:Z,onScrubEnd:ie}),H&&v.jsx(LC,{value:V.a,onChange:X=>re({a:X}),onChangeEnd:X=>{p==null||p(Qs(U.current,{...V,a:X}))},size:b,color:Qs("hex",V),focusable:x,"aria-label":_,onScrubStart:Z,onScrubEnd:ie})]}),H&&v.jsx(Yf,{color:Y,radius:"sm",size:"var(--cp-preview-size)",...G("preview")})]})]}),Array.isArray(j)&&v.jsx(hB,{data:j,swatchesPerRow:T,focusable:x,setValue:P,value:Y,onChangeEnd:X=>{const le=Qs(u,Zv(X));O==null||O(le),p==null||p(le),W||L(Zv(X))}})]})})});Uy.classes=Hy;Uy.varsResolver=mB;Uy.displayName="@mantine/core/ColorPicker";const Ate={timeout:1e3};function $S(e){const{children:t,timeout:n,value:i,...r}=we("CopyButton",Ate,e),a=VK({timeout:n}),o=()=>a.copy(i);return v.jsx(v.Fragment,{children:t({copy:o,copied:a.copied,...r})})}$S.displayName="@mantine/core/CopyButton";var pB={root:"m_3eebeb36",label:"m_9e365f20"};const Ote={orientation:"horizontal"},vB=(e,{color:t,variant:n,size:i})=>({root:{"--divider-color":t?fn(t,e):void 0,"--divider-border-style":n,"--divider-size":$t(i,"divider-size")}}),cs=De(e=>{const t=we("Divider",Ote,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,color:u,orientation:f,label:h,labelPosition:d,mod:p,attributes:g,...b}=t,w=Ze({name:"Divider",classes:pB,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:g,vars:l,varsResolver:vB});return v.jsx(fe,{mod:[{orientation:f,withLabel:!!h},p],role:"separator",...w("root"),...b,children:h&&v.jsx(fe,{component:"span",mod:{position:d},...w("label"),children:h})})});cs.classes=pB;cs.varsResolver=vB;cs.displayName="@mantine/core/Divider";const BC=ep(e=>{const{onChange:t,children:n,multiple:i,accept:r,name:a,form:o,resetRef:l,disabled:u,capture:f,inputProps:h,ref:d,...p}=we("FileButton",null,e),g=S.useRef(null),b=()=>{var _;!u&&((_=g.current)==null||_.click())},w=_=>{if(_.currentTarget.files===null)return t(i?[]:null);t(i?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return nm(l,()=>{g.current&&(g.current.value="")}),v.jsxs(v.Fragment,{children:[v.jsx("input",{style:{display:"none"},type:"file",accept:r,multiple:i,onChange:w,ref:Hn(d,g),name:a,form:o,capture:f,...h}),n({onClick:b,...p})]})});BC.displayName="@mantine/core/FileButton";const[jE,gB]=Gr("Grid component was not found in tree"),zS=(e,t)=>{if(e==="content")return"auto";if(e==="auto")return"0rem";if(e)return e===t?"100%":`calc(${100*e/t}% - ${(t-e)/t} * var(--grid-column-gap))`},AE=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":zS(e,t),OE=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},TE=(e,t)=>{if(e===0)return"0";if(e)return`calc(${100*e/t}% + ${e/t} * var(--grid-column-gap))`};function Tte({span:e,order:t,offset:n,align:i,selector:r}){var g;const a=ci(),o=gB(),l=o.breakpoints||a.breakpoints,u=Ur(e),f=u===void 0?12:u,h=Pu({"--col-order":(g=Ur(t))==null?void 0:g.toString(),"--col-flex-grow":OE(f,o.grow),"--col-flex-basis":zS(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":AE(f,o.columns,o.grow),"--col-offset":TE(Ur(n),o.columns),"--col-align-self":Ur(i)}),d=Nn(l).reduce((b,w)=>{var k;return b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=(k=t[w])==null?void 0:k.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=OE(e[w],o.grow),b[w]["--col-flex-basis"]=zS(e[w],o.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=AE(e[w],o.columns,o.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=TE(n[w],o.columns)),typeof i=="object"&&i[w]!==void 0&&(b[w]["--col-align-self"]=i[w]),b},{}),p=tm(Nn(d),l).filter(b=>Nn(d[b.value]).length>0).map(b=>({query:o.type==="container"?`mantine-grid (min-width: ${l[b.value]})`:`(min-width: ${l[b.value]})`,styles:d[b.value]}));return v.jsx(Bf,{styles:h,media:o.type==="container"?void 0:p,container:o.type==="container"?p:void 0,selector:r})}var FC={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Ete={span:12},qC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,span:o,order:l,offset:u,align:f,...h}=we("GridCol",Ete,e),d=gB(),p=yy();return v.jsxs(v.Fragment,{children:[v.jsx(Tte,{selector:`.${p}`,span:o,order:l,offset:u,align:f}),v.jsx(fe,{...d.getStyles("col",{className:vt(n,p),style:i,classNames:t,styles:r}),...h})]})});qC.classes=FC;qC.displayName="@mantine/core/GridCol";function EE({gap:e,rowGap:t,columnGap:n,selector:i,breakpoints:r,type:a}){const o=ci(),l=r||o.breakpoints,u=Pu({"--grid-gap":Yn(Ur(e)),"--grid-row-gap":Yn(Ur(t)),"--grid-column-gap":Yn(Ur(n))}),f=Nn(l).reduce((d,p)=>(d[p]||(d[p]={}),typeof e=="object"&&e[p]!==void 0&&(d[p]["--grid-gap"]=Yn(e[p])),typeof t=="object"&&t[p]!==void 0&&(d[p]["--grid-row-gap"]=Yn(t[p])),typeof n=="object"&&n[p]!==void 0&&(d[p]["--grid-column-gap"]=Yn(n[p])),d),{}),h=tm(Nn(f),l).filter(d=>Nn(f[d.value]).length>0).map(d=>({query:a==="container"?`mantine-grid (min-width: ${l[d.value]})`:`(min-width: ${l[d.value]})`,styles:f[d.value]}));return v.jsx(Bf,{styles:u,media:a==="container"?void 0:h,container:a==="container"?h:void 0,selector:i})}const Mte={gap:"md",columns:12},yB=(e,{justify:t,align:n,overflow:i})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":i}}),Fr=De(e=>{const t=we("Grid",Mte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,grow:u,gap:f,rowGap:h,columnGap:d,columns:p,align:g,justify:b,children:w,breakpoints:k,type:_,attributes:x,...j}=t,T=Ze({name:"Grid",classes:FC,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:yB}),A=yy();return _==="container"&&k?v.jsxs(jE,{value:{getStyles:T,grow:u,columns:p,breakpoints:k,type:_},children:[v.jsx(EE,{selector:`.${A}`,...t}),v.jsx("div",{...T("container"),children:v.jsx(fe,{...T("root",{className:A}),...j,children:v.jsx("div",{...T("inner"),children:w})})})]}):v.jsxs(jE,{value:{getStyles:T,grow:u,columns:p,breakpoints:k,type:_},children:[v.jsx(EE,{selector:`.${A}`,...t}),v.jsx(fe,{...T("root",{className:A}),...j,children:v.jsx("div",{...T("inner"),children:w})})]})});Fr.classes=FC;Fr.varsResolver=yB;Fr.displayName="@mantine/core/Grid";Fr.Col=qC;var bB={root:"m_9e117634"};const wB=(e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:qn(t),"--image-object-fit":n}}),cp=wi(e=>{const t=we("Image",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,onError:u,src:f,radius:h,fit:d,fallbackSrc:p,mod:g,attributes:b,...w}=t,[k,_]=S.useState(!f);S.useEffect(()=>_(!f),[f]);const x=Ze({name:"Image",classes:bB,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:b,vars:l,varsResolver:wB});return k&&p?v.jsx(fe,{component:"img",src:p,...x("root"),onError:u,mod:["fallback",g],...w}):v.jsx(fe,{component:"img",...x("root"),src:f,onError:j=>{u==null||u(j),_(!0)},mod:g,...w})});cp.classes=bB;cp.varsResolver=wB;cp.displayName="@mantine/core/Image";function Dte(e="top-end",t=0){const n={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},i=typeof t=="number"?t:t.x,r=typeof t=="number"?t:t.y,a=pe(i),o=pe(r),[l,u]=e.split("-");return l==="top"&&(n["--indicator-top"]=o,n["--indicator-translate-y"]="-50%"),l==="middle"&&(n["--indicator-top"]="50%",n["--indicator-translate-y"]="-50%"),l==="bottom"&&(n["--indicator-bottom"]=o,n["--indicator-translate-y"]="50%"),u==="start"&&(n["--indicator-left"]=a,n["--indicator-translate-x"]="-50%"),u==="center"&&(n["--indicator-left"]="50%",n["--indicator-translate-x"]="-50%"),u==="end"&&(n["--indicator-right"]=a,n["--indicator-translate-x"]="50%"),n}var kB={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"};const Rte={position:"top-end",offset:0,showZero:!0},_B=(e,{color:t,position:n,offset:i,size:r,radius:a,zIndex:o,autoContrast:l})=>({root:{"--indicator-color":t?fn(t,e):void 0,"--indicator-text-color":Qm(l,e)?If({color:t,theme:e,autoContrast:l}):void 0,"--indicator-size":pe(r),"--indicator-radius":a===void 0?void 0:qn(a),"--indicator-z-index":o==null?void 0:o.toString(),...Dte(n,i)}}),Vy=De(e=>{const t=we("Indicator",Rte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,children:u,position:f,offset:h,inline:d,label:p,radius:g,color:b,withBorder:w,disabled:k,processing:_,zIndex:x,autoContrast:j,maxValue:T,showZero:A,mod:O,attributes:M,...N}=t,F=Ze({name:"Indicator",classes:kB,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:M,vars:l,varsResolver:_B}),R=!A&&(p===0||p==="0"),I=T!==void 0&&typeof p=="number"&&p>T?`${T}+`:p;return v.jsxs(fe,{...F("root"),mod:[{inline:d},O],...N,children:[!k&&!R&&v.jsx(fe,{mod:{"with-label":!!p,"with-border":w,processing:_},...F("indicator"),children:I}),u]})});Vy.classes=kB;Vy.varsResolver=_B;Vy.displayName="@mantine/core/Indicator";const Pte=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ME={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"};function DE(e){Object.keys(ME).forEach(t=>{e.style.setProperty(t,ME[t],"important")})}function Nte(e){const t=window.getComputedStyle(e);if(t===null)return null;const n={};for(const i of Pte)n[i]=t[i];return n.boxSizing===""?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}let Di=null;function $te(e,t,n=1,i=1/0){Di||(Di=document.createElement("textarea"),Di.setAttribute("tabindex","-1"),Di.setAttribute("aria-hidden","true"),Di.setAttribute("aria-label","autosize measurement"),DE(Di)),Di.parentNode===null&&document.body.appendChild(Di);const{paddingSize:r,borderSize:a,sizingStyle:o}=e,{boxSizing:l}=o;Object.keys(o).forEach(p=>{Di.style[p]=o[p]}),DE(Di),Di.value=t;let u=l==="border-box"?Di.scrollHeight+a:Di.scrollHeight-r;Di.value=t,u=l==="border-box"?Di.scrollHeight+a:Di.scrollHeight-r,Di.value="x";const f=Di.scrollHeight-r;let h=f*n;l==="border-box"&&(h=h+r+a),u=Math.max(h,u);let d=f*i;return l==="border-box"&&(d=d+r+a),u=Math.min(d,u),[u,f]}function zte({maxRows:e,minRows:t,onChange:n,ref:i,...r}){const a=r.value!==void 0,o=S.useRef(null),l=Hn(o,i),u=S.useRef(0),f=()=>{const d=o.current;if(!d)return;const p=Nte(d);if(!p)return;const[g]=$te(p,d.value||d.placeholder||"x",t,e);u.current!==g&&(u.current=g,d.style.setProperty("height",`${g}px`,"important"))},h=d=>{a||f(),n==null||n(d)};return S.useLayoutEffect(f),S.useEffect(()=>{const d=()=>f();return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]),S.useEffect(()=>{const d=()=>f();return document.fonts.addEventListener("loadingdone",d),()=>document.fonts.removeEventListener("loadingdone",d)},[]),S.useEffect(()=>{const d=p=>{var g;if(((g=o.current)==null?void 0:g.form)===p.target&&!a){const b=o.current.value;requestAnimationFrame(()=>{o.current&&b!==o.current.value&&f()})}};return document.body.addEventListener("reset",d),()=>document.body.removeEventListener("reset",d)},[a]),v.jsx("textarea",{...r,onChange:h,ref:l})}const Lte={size:"sm"},kl=De(e=>{const{autosize:t,maxRows:n,minRows:i,__staticSelector:r,resize:a,...o}=we("Textarea",Lte,e),l=t&&lX()!=="test",u=l?{maxRows:n,minRows:i}:{};return v.jsx(Ni,{component:l?zte:"textarea",...o,__staticSelector:r||"Textarea",multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});kl.classes=Ni.classes;kl.displayName="@mantine/core/Textarea";function RE(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const Ite={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm",indentSpaces:2},HC=De(e=>{const{value:t,defaultValue:n,onChange:i,formatOnBlur:r,validationError:a,serialize:o,deserialize:l,onFocus:u,onBlur:f,readOnly:h,error:d,indentSpaces:p,...g}=we("JsonInput",Ite,e),[b,w]=ji({value:t,defaultValue:n,finalValue:"",onChange:i}),[k,_]=S.useState(RE(b,l)),x=T=>{u==null||u(T),_(!0)},j=T=>{f==null||f(T);const A=RE(T.currentTarget.value,l);r&&!h&&A&&T.currentTarget.value.trim()!==""&&w(o(l(T.currentTarget.value),null,p)),_(A)};return v.jsx(kl,{value:b,onChange:T=>w(T.currentTarget.value),onFocus:x,onBlur:j,readOnly:h,...g,autoComplete:"off",__staticSelector:"JsonInput",error:k?d:a||!0,"data-monospace":!0})});HC.classes=Ni.classes;HC.displayName="@mantine/core/JsonInput";const[Bte,Cl]=Gr("Menu component was not found in the tree");var jl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const UC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("MenuDivider",null,e);return v.jsx(fe,{...Cl().getStyles("divider",{className:n,style:i,styles:r,classNames:t}),...o})});UC.classes=jl;UC.displayName="@mantine/core/MenuDivider";const VC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,onMouseEnter:o,onMouseLeave:l,onKeyDown:u,children:f,ref:h,...d}=we("MenuDropdown",null,e),p=S.useRef(null),g=Cl(),b=kr(u,_=>{var x,j;(_.key==="ArrowUp"||_.key==="ArrowDown")&&(_.preventDefault(),(j=(x=p.current)==null?void 0:x.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||j.focus())}),w=kr(o,()=>(g.trigger==="hover"||g.trigger==="click-hover")&&g.openDropdown()),k=kr(l,()=>(g.trigger==="hover"||g.trigger==="click-hover")&&g.closeDropdown());return v.jsxs(Et.Dropdown,{...d,onMouseEnter:w,onMouseLeave:k,role:"menu","aria-orientation":"vertical",ref:Hn(h,p),...g.getStyles("dropdown",{className:n,style:i,styles:r,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[g.withInitialFocusPlaceholder&&v.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),f]})});VC.classes=jl;VC.displayName="@mantine/core/MenuDropdown";const om=S.createContext(null),WC=wi(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,color:o,closeMenuOnClick:l,leftSection:u,rightSection:f,children:h,disabled:d,"data-disabled":p,ref:g,...b}=we("MenuItem",null,e),w=Cl(),k=S.use(om),_=ci(),{dir:x}=zu(),j=S.useRef(null),T=b,A=kr(T.onClick,()=>{p||(typeof l=="boolean"?l&&w.closeDropdownImmediately():w.closeOnItemClick&&w.closeDropdownImmediately())}),O=o?_.variantColorResolver({color:o,theme:_,variant:"light"}):void 0,M=o?gs({color:o,theme:_}):null,N=kr(T.onKeyDown,F=>{F.key==="ArrowLeft"&&k&&(k.close(),k.focusParentItem())});return v.jsxs(En,{onMouseDown:F=>F.preventDefault(),...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,...w.getStyles("item",{className:n,style:i,styles:r,classNames:t}),ref:Hn(j,g),role:"menuitem",disabled:d,"data-menu-item":!0,"data-disabled":d||p||void 0,"data-mantine-stop-propagation":!0,onClick:A,onKeyDown:V6({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:x,orientation:"vertical",onKeyDown:N}),__vars:{"--menu-item-color":M!=null&&M.isThemeColor&&(M==null?void 0:M.shade)===void 0?`var(--mantine-color-${M.color}-6)`:O==null?void 0:O.color,"--menu-item-hover":O==null?void 0:O.hover},children:[u&&v.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:t}),"data-position":"left",children:u}),h&&v.jsx("div",{...w.getStyles("itemLabel",{styles:r,classNames:t}),children:h}),f&&v.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:t}),"data-position":"right",children:f})]})});WC.classes=jl;WC.displayName="@mantine/core/MenuItem";const GC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("MenuLabel",null,e);return v.jsx(fe,{...Cl().getStyles("label",{className:n,style:i,styles:r,classNames:t}),...o})});GC.classes=jl;GC.displayName="@mantine/core/MenuLabel";const YC=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,onMouseEnter:o,onMouseLeave:l,onKeyDown:u,children:f,ref:h,...d}=we("MenuSubDropdown",null,e),p=S.useRef(null),g=Cl(),b=S.use(om),w=kr(o,b==null?void 0:b.open),k=kr(l,b==null?void 0:b.close);return v.jsx(Et.Dropdown,{...d,onMouseEnter:w,onMouseLeave:k,role:"menu","aria-orientation":"vertical",ref:Hn(h,p),...g.getStyles("dropdown",{className:n,style:i,styles:r,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:f})});YC.classes=jl;YC.displayName="@mantine/core/MenuSubDropdown";const KC=wi(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,color:o,leftSection:l,rightSection:u,children:f,disabled:h,"data-disabled":d,closeMenuOnClick:p,ref:g,...b}=we("MenuSubItem",null,e),w=Cl(),k=S.use(om),_=ci(),{dir:x}=zu(),j=S.useRef(null),T=b,A=o?_.variantColorResolver({color:o,theme:_,variant:"light"}):void 0,O=o?gs({color:o,theme:_}):null,M=kr(T.onKeyDown,I=>{I.key==="ArrowRight"&&(k==null||k.open(),k==null||k.focusFirstItem()),I.key==="ArrowLeft"&&(k!=null&&k.parentContext)&&(k.parentContext.close(),k.parentContext.focusParentItem())}),N=kr(T.onClick,()=>{!d&&p&&w.closeDropdownImmediately()}),F=kr(T.onMouseEnter,k==null?void 0:k.open),R=kr(T.onMouseLeave,k==null?void 0:k.close);return v.jsxs(En,{onMouseDown:I=>I.preventDefault(),...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,...w.getStyles("item",{className:n,style:i,styles:r,classNames:t}),ref:Hn(j,g),role:"menuitem",disabled:h,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":h||d||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:F,onMouseLeave:R,onClick:N,onKeyDown:V6({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:x,orientation:"vertical",onKeyDown:M}),__vars:{"--menu-item-color":O!=null&&O.isThemeColor&&(O==null?void 0:O.shade)===void 0?`var(--mantine-color-${O.color}-6)`:A==null?void 0:A.color,"--menu-item-hover":A==null?void 0:A.hover},children:[l&&v.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:t}),"data-position":"left",children:l}),f&&v.jsx("div",{...w.getStyles("itemLabel",{styles:r,classNames:t}),children:f}),v.jsx("div",{...w.getStyles("itemSection",{styles:r,classNames:t}),"data-position":"right",children:u||v.jsx(Yg,{...w.getStyles("chevron"),size:14})})]})});KC.classes=jl;KC.displayName="@mantine/core/MenuSubItem";function xB({children:e,refProp:t}){if(!U6(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return Cl(),v.jsx(Et.Target,{refProp:t,popupType:"menu",children:e})}xB.displayName="@mantine/core/MenuSubTarget";const Fte={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Xf(e){const{children:t,closeDelay:n,openDelay:i,...r}=we("MenuSub",Fte,e),a=Vi(),[o,{open:l,close:u}]=zz(!1),f=S.use(om),{openDropdown:h,closeDropdown:d}=DL({open:l,close:u,closeDelay:n,openDelay:i}),p=()=>window.setTimeout(()=>{var b,w;(w=(b=document.getElementById(`${a}-dropdown`))==null?void 0:b.querySelectorAll("[data-menu-item]:not([data-disabled])")[0])==null||w.focus()},16),g=()=>window.setTimeout(()=>{var b;(b=document.getElementById(`${a}-target`))==null||b.focus()},16);return v.jsx(om,{value:{opened:o,close:d,open:h,focusFirstItem:p,focusParentItem:g,parentContext:f},children:v.jsx(Et,{opened:o,withinPortal:!1,withArrow:!1,id:a,...r,children:t})})}Xf.extend=e=>e;Xf.displayName="@mantine/core/MenuSub";Xf.Target=xB;Xf.Dropdown=YC;Xf.Item=KC;const qte={refProp:"ref"};function SB(e){const{children:t,refProp:n,...i}=we("MenuTarget",qte,e),r=Nu(t);if(!r)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=Cl(),o=r.props,l=kr(o.onClick,()=>{a.trigger==="click"?a.toggleDropdown():a.trigger==="click-hover"&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),u=kr(o.onMouseEnter,()=>(a.trigger==="hover"||a.trigger==="click-hover")&&a.openDropdown()),f=kr(o.onMouseLeave,()=>{(a.trigger==="hover"||a.trigger==="click-hover"&&!a.openedViaClick)&&a.closeDropdown()});return v.jsx(Et.Target,{refProp:n,popupType:"menu",...i,children:S.cloneElement(r,{onClick:l,onMouseEnter:u,onMouseLeave:f,"data-expanded":a.opened?!0:void 0})})}SB.displayName="@mantine/core/MenuTarget";const Hte={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1},It=De(e=>{const t=we("Menu",Hte,e),{children:n,onOpen:i,onClose:r,opened:a,defaultOpened:o,trapFocus:l,onChange:u,closeOnItemClick:f,loop:h,closeOnEscape:d,trigger:p,openDelay:g,closeDelay:b,classNames:w,styles:k,unstyled:_,variant:x,vars:j,menuItemTabIndex:T,keepMounted:A,withInitialFocusPlaceholder:O,attributes:M,...N}=t,F=Ze({name:"Menu",classes:jl,props:t,classNames:w,styles:k,unstyled:_,attributes:M}),[R,I]=ji({value:a,defaultValue:o,finalValue:!1,onChange:u}),[q,G]=S.useState(!1),U=()=>{I(!1),G(!1),R&&(r==null||r())},$=()=>{I(!0),!R&&(i==null||i())},D=()=>{R?U():$()},{openDropdown:z,closeDropdown:H}=DL({open:$,close:U,closeDelay:b,openDelay:g}),Y=V=>qK("[data-menu-item]","[data-menu-dropdown]",V),{resolvedClassNames:P,resolvedStyles:W}=Wi({classNames:w,styles:k,props:t});return v.jsx(Bte,{value:{getStyles:F,opened:R,toggleDropdown:D,getItemIndex:Y,openedViaClick:q,setOpenedViaClick:G,closeOnItemClick:f,closeDropdown:p==="click"?U:H,openDropdown:p==="click"?$:z,closeDropdownImmediately:U,loop:h,trigger:p,unstyled:_,menuItemTabIndex:T,withInitialFocusPlaceholder:O},children:v.jsx(Et,{returnFocus:!0,...N,opened:R,onChange:D,defaultOpened:o,trapFocus:A?!1:l,closeOnEscape:d,__staticSelector:"Menu",classNames:P,styles:W,unstyled:_,variant:x,keepMounted:A,children:n})})});It.displayName="@mantine/core/Menu";It.classes=jl;It.Item=WC;It.Label=GC;It.Dropdown=VC;It.Target=SB;It.Divider=UC;It.Sub=Xf;const[Ute,Zf]=Gr("Modal component was not found in tree");var bs={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const Wy=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ModalBody",null,e);return v.jsx(lI,{...Zf().getStyles("body",{classNames:t,style:i,styles:r,className:n}),...o})});Wy.classes=bs;Wy.displayName="@mantine/core/ModalBody";const Gy=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ModalCloseButton",null,e);return v.jsx(uI,{...Zf().getStyles("close",{classNames:t,style:i,styles:r,className:n}),...o})});Gy.classes=bs;Gy.displayName="@mantine/core/ModalCloseButton";const Yy=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,children:o,__hidden:l,...u}=we("ModalContent",null,e),f=Zf(),h=f.scrollAreaComponent||wee;return v.jsx(cI,{...f.getStyles("content",{className:n,style:i,styles:r,classNames:t}),innerProps:f.getStyles("inner",{className:n,style:i,styles:r,classNames:t}),"data-full-screen":f.fullScreen||void 0,"data-modal-content":!0,"data-hidden":l||void 0,...u,children:v.jsx(h,{style:{maxHeight:f.fullScreen?"100dvh":`calc(100dvh - (${pe(f.yOffset)} * 2))`},children:o})})});Yy.classes=bs;Yy.displayName="@mantine/core/ModalContent";const Ky=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ModalHeader",null,e);return v.jsx(fI,{...Zf().getStyles("header",{classNames:t,style:i,styles:r,className:n}),...o})});Ky.classes=bs;Ky.displayName="@mantine/core/ModalHeader";const Xy=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ModalOverlay",null,e);return v.jsx(dI,{...Zf().getStyles("overlay",{classNames:t,style:i,styles:r,className:n}),...o})});Xy.classes=bs;Xy.displayName="@mantine/core/ModalOverlay";const Vte={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},CB=(e,{radius:t,size:n,yOffset:i,xOffset:r})=>({root:{"--modal-radius":t===void 0?void 0:qn(t),"--modal-size":$t(n,"modal-size"),"--modal-y-offset":pe(i),"--modal-x-offset":pe(r)}}),fp=De(e=>{const t=we("ModalRoot",Vte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,yOffset:u,scrollAreaComponent:f,radius:h,fullScreen:d,centered:p,xOffset:g,__staticSelector:b,attributes:w,...k}=t,_=Ze({name:b,classes:bs,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:CB});return v.jsx(Ute,{value:{yOffset:u,scrollAreaComponent:f,getStyles:_,fullScreen:d},children:v.jsx(sI,{..._("root"),"data-full-screen":d||void 0,"data-centered":p||void 0,"data-offset-scrollbars":f===lr.Autosize||void 0,unstyled:o,...k})})});fp.classes=bs;fp.varsResolver=CB;fp.displayName="@mantine/core/ModalRoot";const jB=S.createContext(null);function AB({children:e}){const[t,n]=S.useState([]),[i,r]=S.useState(ka("modal"));return v.jsx(jB,{value:{stack:t,addModal:(a,o)=>{n(l=>[...new Set([...l,a])]),r(l=>typeof o=="number"&&typeof l=="number"?Math.max(l,o):l)},removeModal:a=>n(o=>o.filter(l=>l!==a)),getZIndex:a=>`calc(${i} + ${t.indexOf(a)} + 1)`,currentId:t[t.length-1],maxZIndex:i},children:e})}AB.displayName="@mantine/core/ModalStack";const Zy=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,...o}=we("ModalTitle",null,e);return v.jsx(hI,{...Zf().getStyles("title",{classNames:t,style:i,styles:r,className:n}),...o})});Zy.classes=bs;Zy.displayName="@mantine/core/ModalTitle";const Wte={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},tr=De(e=>{const{title:t,withOverlay:n,overlayProps:i,withCloseButton:r,closeButtonProps:a,children:o,radius:l,opened:u,stackId:f,zIndex:h,...d}=we("Modal",Wte,e),p=S.use(jB),g=!!t||r,b=p&&f?{closeOnEscape:p.currentId===f,trapFocus:p.currentId===f,zIndex:p.getZIndex(f)}:{},w=n===!1?!1:f&&p?p.currentId===f:u;return S.useEffect(()=>{p&&f&&(u?p.addModal(f,h||ka("modal")):p.removeModal(f))},[u,f,h]),v.jsxs(fp,{radius:l,opened:u,zIndex:p&&f?p.getZIndex(f):h,...d,...b,children:[n&&v.jsx(Xy,{visible:w,transitionProps:p&&f?{duration:0}:void 0,...i}),v.jsxs(Yy,{radius:l,__hidden:p&&f&&u?f!==p.currentId:!1,children:[g&&v.jsxs(Ky,{children:[t&&v.jsx(Zy,{children:t}),r&&v.jsx(Gy,{...a})]}),v.jsx(Wy,{children:o})]})]})});tr.classes=bs;tr.displayName="@mantine/core/Modal";tr.Root=fp;tr.Overlay=Xy;tr.Content=Yy;tr.Body=Wy;tr.Header=Ky;tr.Title=Zy;tr.CloseButton=Gy;tr.Stack=AB;const Qy=S.createContext(null);var Jy={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const OB=S.createContext(null),TB=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?$t(t):$t(n,"pg-gap")}}),e0=De(e=>{var b;const t=we("PillGroup",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,size:u,disabled:f,attributes:h,...d}=t,p=((b=S.use(Qy))==null?void 0:b.size)||u||void 0,g=Ze({name:"PillGroup",classes:Jy,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:TB,stylesCtx:{size:p},rootSelector:"group"});return v.jsx(OB,{value:{size:p,disabled:f},children:v.jsx(fe,{size:p,...g("group"),...d})})});e0.classes=Jy;e0.varsResolver=TB;e0.displayName="@mantine/core/PillGroup";const Gte={variant:"default"},EB=(e,{radius:t},{size:n})=>({root:{"--pill-fz":$t(n,"pill-fz"),"--pill-height":$t(n,"pill-height"),"--pill-radius":t===void 0?void 0:qn(t)}}),_l=De(e=>{const t=we("Pill",Gte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,variant:u,children:f,withRemoveButton:h,onRemove:d,removeButtonProps:p,radius:g,size:b,disabled:w,mod:k,attributes:_,...x}=t,j=S.use(OB),T=S.use(Qy),A=b||(j==null?void 0:j.size)||void 0,O=(T==null?void 0:T.variant)==="filled"?"contrast":u||"default",M=Ze({name:"Pill",classes:Jy,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:_,vars:l,varsResolver:EB,stylesCtx:{size:A}});return v.jsxs(fe,{component:"span",variant:O,size:A,...M("root",{variant:O}),mod:[{"with-remove":h&&!w,disabled:w||(j==null?void 0:j.disabled)},k],...x,children:[v.jsx("span",{...M("label"),children:f}),h&&v.jsx(xl,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:o,...p,...M("remove",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onMouseDown:N=>{var F;N.preventDefault(),N.stopPropagation(),(F=p==null?void 0:p.onMouseDown)==null||F.call(p,N)},onClick:N=>{var F;N.stopPropagation(),d==null||d(),(F=p==null?void 0:p.onClick)==null||F.call(p,N)}})]})});_l.classes=Jy;_l.varsResolver=EB;_l.displayName="@mantine/core/Pill";_l.Group=e0;var MB={field:"m_45c4369d"};const Yte={type:"visible"},XC=De(e=>{const t=we("PillsInputField",Yte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,type:u,disabled:f,id:h,pointer:d,mod:p,attributes:g,ref:b,...w}=t,k=S.use(Qy),_=S.use(Lu),x=Ze({name:"PillsInputField",classes:MB,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:g,rootSelector:"field"}),j=f||(k==null?void 0:k.disabled);return v.jsx(fe,{component:"input",ref:Hn(b,k==null?void 0:k.fieldRef),"data-type":u,disabled:j,mod:[{disabled:j,pointer:d},p],...x("field"),...w,id:(_==null?void 0:_.inputId)||h,"aria-invalid":k==null?void 0:k.hasError,"aria-describedby":_==null?void 0:_.describedBy,type:"text",onMouseDown:T=>!d&&T.stopPropagation()})});XC.classes=MB;XC.displayName="@mantine/core/PillsInputField";const Kte={size:"sm"},Su=De(e=>{const{children:t,onMouseDown:n,onClick:i,size:r,disabled:a,__staticSelector:o,error:l,variant:u,...f}=we("PillsInput",Kte,e),h=S.useRef(null);return v.jsx(Qy,{value:{fieldRef:h,size:r,disabled:a,hasError:!!l,variant:u},children:v.jsx(Ni,{size:r,error:l,variant:u,component:"div","data-no-overflow":!0,onMouseDown:d=>{var p;d.preventDefault(),n==null||n(d),(p=h.current)==null||p.focus()},onClick:d=>{var p,g;d.preventDefault(),(p=d.currentTarget.closest("fieldset"))!=null&&p.disabled||((g=h.current)==null||g.focus(),i==null||i(d))},...f,multiline:!0,disabled:a,__staticSelector:o||"PillsInput",withAria:!1,children:t})})});Su.displayName="@mantine/core/PillsInput";Su.classes=Ni.classes;Su.Field=XC;function Rk(e){return typeof e=="string"?e.trim().toLowerCase():e}function Xte({data:e,value:t}){const n=t.map(Rk);return e.reduce((i,r)=>(xu(r)?i.push({group:r.group,items:r.items.filter(a=>n.indexOf(Rk(a.value))===-1)}):n.indexOf(Rk(r.value))===-1&&i.push(r),i),[])}const PE={xs:41,sm:50,md:60,lg:72,xl:89},Zte={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,openOnFocus:!0,size:"sm"},t0=ep(e=>{const t=we("MultiSelect",Zte,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,size:u,value:f,defaultValue:h,onChange:d,onKeyDown:p,variant:g,data:b,dropdownOpened:w,defaultDropdownOpened:k,onDropdownOpen:_,onDropdownClose:x,selectFirstOptionOnChange:j,selectFirstOptionOnDropdownOpen:T,onOptionSubmit:A,comboboxProps:O,filter:M,limit:N,withScrollArea:F,maxDropdownHeight:R,searchValue:I,defaultSearchValue:q,onSearchChange:G,readOnly:U,disabled:$,onFocus:D,onBlur:z,radius:H,rightSection:Y,rightSectionWidth:P,rightSectionPointerEvents:W,rightSectionProps:V,leftSection:L,leftSectionWidth:Z,leftSectionPointerEvents:ie,leftSectionProps:re,inputContainer:X,inputWrapperOrder:le,withAsterisk:ee,labelProps:se,descriptionProps:ke,errorProps:ne,wrapperProps:$e,description:xe,label:Ae,error:ze,maxValues:be,searchable:Ce,nothingFoundMessage:Ne,withCheckIcon:de,withAlignedLabels:He,checkIconPosition:Ye,hidePickedOptions:We,withErrorStyles:Qe,name:Je,form:oe,id:ye,clearable:Ke,clearSectionMode:et,clearButtonProps:je,hiddenInputProps:rt,placeholder:pt,hiddenInputValuesDivider:Dt,required:yt,mod:ot,renderOption:tt,renderPill:Nt,onRemove:Re,onClear:Fe,onMaxValues:Vt,scrollAreaProps:Tt,chevronColor:gt,attributes:wt,clearSearchOnChange:rn,openOnFocus:Mn,loading:qe,loadingPosition:Ue,...zt}=t,an=Vi(ye),Rt=My(b),nt=up(Rt),at=S.useRef({}),st=Vf({opened:w,defaultOpened:k,onDropdownOpen:()=>{_==null||_(),T&&st.selectFirstOption()},onDropdownClose:()=>{x==null||x(),st.resetSelectedOption()}}),{styleProps:Wt,rest:{type:Gt,autoComplete:Sn,...Mt}}=$u(zt),[xt,Xt]=ji({value:f,defaultValue:h,finalValue:[],onChange:d}),[zn,Oi]=ji({value:I,defaultValue:q,finalValue:"",onChange:G}),fr=dt=>{Oi(dt),st.resetSelectedOption()},Aa=Ze({name:"MultiSelect",classes:{},props:t,classNames:n,styles:a,unstyled:o,attributes:wt}),{resolvedClassNames:Yr,resolvedStyles:Xa}=Wi({props:t,styles:a,classNames:n}),Kr=dt=>{p==null||p(dt),dt.key===" "&&!Ce&&(dt.preventDefault(),st.toggleDropdown()),dt.key==="Backspace"&&zn.length===0&&xt.length>0&&(Re==null||Re(xt[xt.length-1]),Xt(xt.slice(0,xt.length-1)))},Oa=xt.map((dt,Xr)=>{var Or;const Ao=nt[`${dt}`]||at.current[`${dt}`];return Nt?v.jsx(S.Fragment,{children:Nt({option:Ao,value:dt,onRemove:()=>{Xt(xt.filter(Tr=>dt!==Tr)),Re==null||Re(dt)},disabled:$})},`${dt}-${Xr}`):v.jsx(_l,{withRemoveButton:!U&&!((Or=nt[`${dt}`])!=null&&Or.disabled),onRemove:()=>{Xt(xt.filter(Tr=>dt!==Tr)),Re==null||Re(dt)},unstyled:o,disabled:$,...Aa("pill"),children:(Ao==null?void 0:Ao.label)||dt},`${dt}-${Xr}`)});S.useEffect(()=>{j&&st.selectFirstOption()},[j,zn]),S.useEffect(()=>{xt.forEach(dt=>{`${dt}`in nt&&(at.current[`${dt}`]=nt[`${dt}`])})},[nt,xt]);const Ar=v.jsx(jt.ClearButton,{...je,onClear:()=>{Fe==null||Fe(),Xt([]),fr("")}}),dr=Xte({data:Rt,value:xt}),mt=Ke&&xt.length>0&&!$&&!U,fi=mt?{paddingInlineEnd:PE[u]??PE.sm}:void 0;return v.jsxs(v.Fragment,{children:[v.jsxs(jt,{store:st,classNames:Yr,styles:Xa,unstyled:o,size:u,readOnly:U,__staticSelector:"MultiSelect",attributes:wt,onOptionSubmit:dt=>{A==null||A(dt),rn&&fr(""),st.updateSelectedOptionIndex("selected"),xt.includes(nt[`${dt}`].value)?(Xt(xt.filter(Xr=>Xr!==nt[`${dt}`].value)),Re==null||Re(nt[`${dt}`].value)):xt.lengthCe?st.openDropdown():st.toggleDropdown(),"data-expanded":st.dropdownOpened||void 0,id:an,required:yt,mod:ot,attributes:wt,children:v.jsxs(_l.Group,{attributes:wt,disabled:$,unstyled:o,...Aa("pillsList",{style:fi}),children:[Oa,v.jsx(jt.EventsTarget,{autoComplete:Sn,withExpandedAttribute:!0,children:v.jsx(Su.Field,{...Mt,id:an,placeholder:pt,type:!Ce&&!pt?"hidden":"visible",...Aa("inputField"),unstyled:o,onFocus:dt=>{D==null||D(dt),Mn&&Ce&&st.openDropdown()},onBlur:dt=>{z==null||z(dt),st.closeDropdown(),fr("")},onKeyDown:Kr,value:zn,onChange:dt=>{fr(dt.currentTarget.value),Ce&&st.openDropdown(),j&&st.selectFirstOption()},disabled:$,readOnly:U||!Ce,pointer:!Ce})})]})})}),v.jsx(Ny,{data:We?dr:Rt,hidden:U||$,filter:M,search:zn,limit:N,hiddenWhenEmpty:!Ne,withScrollArea:F,maxDropdownHeight:R,filterOptions:Ce,value:xt,checkIconPosition:Ye,withCheckIcon:de,withAlignedLabels:He,nothingFoundMessage:Ne,unstyled:o,labelId:Ae?`${an}-label`:void 0,"aria-label":Ae?void 0:zt["aria-label"],renderOption:tt,scrollAreaProps:Tt})]}),v.jsx(jt.HiddenInput,{name:Je,valuesDivider:Dt,value:xt,form:oe,disabled:$,...rt})]})});t0.classes={...Ni.classes,...jt.classes};t0.displayName="@mantine/core/MultiSelect";var DB={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const Qte={withCloseButton:!0},RB=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:qn(t),"--notification-color":n?fn(n,e):void 0}}),n0=De(e=>{const t=we("Notification",Qte,e),{className:n,color:i,radius:r,loading:a,withCloseButton:o,withBorder:l,title:u,icon:f,children:h,onClose:d,closeButtonProps:p,classNames:g,style:b,styles:w,unstyled:k,vars:_,mod:x,loaderProps:j,role:T,attributes:A,...O}=t,M=Ze({name:"Notification",classes:DB,props:t,className:n,style:b,classNames:g,styles:w,unstyled:k,attributes:A,vars:_,varsResolver:RB});return v.jsxs(fe,{...M("root"),mod:[{"data-with-icon":!!f||a,"data-with-border":l},x],role:T||"alert",...O,children:[f&&!a&&v.jsx("div",{...M("icon"),children:f}),a&&v.jsx(Jn,{size:28,color:i,...M("loader"),...j}),v.jsxs("div",{...M("body"),children:[u&&v.jsx("div",{...M("title"),children:u}),v.jsx(fe,{...M("description"),mod:{"data-with-title":!!u},children:h})]}),o&&v.jsx(xl,{iconSize:16,color:"gray",...p,unstyled:k,onClick:N=>{var F;(F=p==null?void 0:p.onClick)==null||F.call(p,N),d==null||d()},...M("closeButton")})]})});n0.classes=DB;n0.varsResolver=RB;n0.displayName="@mantine/core/Notification";function PB(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r=l?r=r+$E("0",o-l):r=(r.substring(0,o)||"0")+"."+r.substring(o),n+r}function zE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var i=(e.indexOf(".")!==-1||n)&&t,r=ZC(e),a=r.beforeDecimal,o=r.afterDecimal,l=r.hasNegation,u=parseFloat("0."+(o||"0")),f=o.length<=t?"0."+o:u.toFixed(t),h=f.split("."),d=a;a&&Number(h[0])&&(d=a.split("").reverse().reduce(function(w,k,_){return w.length>_?(Number(w[0])+Number(k)).toString()+w.substring(1,w.length):k+w},h[0]));var p=zB(h[1]||"",t,n),g=l?"-":"",b=i?".":"";return""+g+d+b+p}function cu(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var IB=Jte(function(e,t){for(var n=0,i=0,r=e.length,a=t.length;e[n]===t[n]&&nn&&r-i>n;)i++;return{from:{start:n,end:r-i},to:{start:n,end:a-i}}}),rne=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function ane(e,t,n){return Math.min(Math.max(e,t),n)}function Pk(e){return Math.max(e.selectionStart,e.selectionEnd)}function one(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function sne(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function lne(e){var t=e.currentValue,n=e.formattedValue,i=e.currentValueIndex,r=e.formattedValueIndex;return t[i]===n[r]}function une(e,t,n,i,r,a,o){o===void 0&&(o=lne);var l=r.findIndex(function(T){return T}),u=e.slice(0,l);!t&&!n.startsWith(u)&&(t=u,n=u+n,i=i+u.length);for(var f=n.length,h=e.length,d={},p=new Array(f),g=0;g0&&p[_]===-1;)_--;var j=_===-1||p[_]===-1?0:p[_]+1;return j>x?x:i-j=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=r&&!n[t];)t++;t>r&&(t=n.lastIndexOf(!0))}return t===-1&&(t=r),t}function cne(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,i=t.length;nM.length-o.length||OI||d>e.length-o.length)&&(R=d),e=e.substring(0,R),e=mne(j?"-"+e:e,r),e=(e.match(pne(b))||[]).join("");var q=e.indexOf(b);e=e.replace(new RegExp($B(b),"g"),function(z,H){return H===q?".":""});var G=ZC(e,r),U=G.beforeDecimal,$=G.afterDecimal,D=G.addNegation;return f.end-f.startW?!1:P>=ie.start&&Pn?n:e}function Sne(e){return e.toString().replace(".","").length}function Cne(e,t){return(typeof e=="number"?e=t)&&(n===void 0||e<=n)}const Lk={size:"sm",step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[".",","]},HB=(e,{size:t})=>({controls:{"--ni-chevron-size":$t(t,"ni-chevron-size")}});function Ane(e,t,n){const i=e.toString(),r=FB.test(i),a=i.replace(/^0+(?=\d)/,""),o=parseFloat(a);if(Number.isNaN(o))return a;if(o>Number.MAX_SAFE_INTEGER)return t!==void 0?t:a;const l=es(o,n,t);return r?`${l.toString().replace(/^0+(?=\d)/,"")}.`:l}function One(e,t){if(e===""||e==="-")return e;const n=Mh(e);return n===null?e:t.clampBehavior==="blur"?Mg(n,t.min,t.max):n}const lm=ep(e=>{const t=we("NumberInput",Lk,e),{className:n,classNames:i,styles:r,unstyled:a,vars:o,onChange:l,onValueChange:u,value:f,defaultValue:h,max:d,min:p,step:g,hideControls:b,rightSection:w,isAllowed:k,clampBehavior:_,onBlur:x,allowDecimal:j,decimalScale:T,onKeyDown:A,onKeyDownCapture:O,handlersRef:M,startValue:N,disabled:F,rightSectionPointerEvents:R,allowNegative:I,readOnly:q,size:G,rightSectionWidth:U,stepHoldInterval:$,stepHoldDelay:D,allowLeadingZeros:z,withKeyboardEvents:H,trimLeadingZeroesOnBlur:Y,allowedDecimalSeparators:P,selectAllOnFocus:W,onMinReached:V,onMaxReached:L,onFocus:Z,attributes:ie,ref:re,...X}=t,le=I??!0,ee=z??!0,se=Ze({name:"NumberInput",classes:LS,props:t,classNames:i,styles:r,unstyled:a,attributes:ie,vars:o,varsResolver:HB}),{resolvedClassNames:ke,resolvedStyles:ne}=Wi({classNames:i,styles:r,props:t}),$e=S.useRef(Nk(f)||Nk(h)?"bigint":"number");Nk(f)?$e.current="bigint":typeof f=="number"&&($e.current="number");const xe=$e.current==="bigint",[Ae,ze]=ji({value:f,defaultValue:h,finalValue:"",onChange:l}),be=D!==void 0&&$!==void 0,Ce=S.useRef(null),Ne=S.useRef(null),de=S.useRef(0),He=typeof p=="number"?p:void 0,Ye=typeof d=="number"?d:void 0,We=typeof g=="number"?g:Lk.step,Qe=typeof N=="number"?N:Lk.startValue,Je=Qv(p),oe=Qv(d),ye=Qv(g)??BigInt(1),Ke=Qv(N)??BigInt(0),et=qe=>!qB(qe,le)||ee&&FE.test(qe)?qe:Mh(qe)??qe,je=qe=>{const Ue=Number(qe);return Number.isSafeInteger(Ue)?Ue:void 0},rt=(qe,Ue)=>{Ue.source==="event"&&ze(xe?et(qe.value):Cne(qe.floatValue,qe.value)&&!_ne.test(qe.value)&&!(ee&&FE.test(qe.value))&&!xne.test(qe.value)&&!FB.test(qe.value)?qe.floatValue:qe.value),u==null||u(qe,Ue)},pt=qe=>{const Ue=String(qe).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ue?Math.max(0,(Ue[1]?Ue[1].length:0)-(Ue[2]?+Ue[2]:0)):0},Dt=qe=>{Ce.current&&typeof qe<"u"&&Ce.current.setSelectionRange(qe,qe)},yt=S.useRef(wS);yt.current=()=>{if(xe){if(!zk(Ae,le))return;let at;const st=Ae;if(typeof st=="bigint"){const Gt=st+ye;oe!==void 0&&Gt>oe&&(L==null||L()),at=oe!==void 0&&Gt>oe?oe:Gt}else if(typeof st=="string"&&st!==""){const Gt=Mh(st);if(Gt===null)return;const Sn=Gt+ye;oe!==void 0&&Sn>oe&&(L==null||L()),at=oe!==void 0&&Sn>oe?oe:Sn}else at=Mg(Ke,Je,oe);const Wt=at.toString();ze(at),u==null||u({floatValue:je(at),formattedValue:Wt,value:Wt},{source:"increment"}),setTimeout(()=>{var Gt;return Dt((Gt=Ce.current)==null?void 0:Gt.value.length)},0);return}if(!$k(Ae))return;let qe;const Ue=pt(Ae),zt=pt(We),an=Math.max(Ue,zt),Rt=10**an;if(!IS(Ae)&&(typeof Ae!="number"||Number.isNaN(Ae)))qe=es(Qe,He,Ye);else if(Ye!==void 0){const at=(Math.round(Number(Ae)*Rt)+Math.round(We*Rt))/Rt;at>Ye&&(L==null||L()),qe=at<=Ye?at:Ye}else qe=(Math.round(Number(Ae)*Rt)+Math.round(We*Rt))/Rt;const nt=qe.toFixed(an);ze(parseFloat(nt)),u==null||u({floatValue:parseFloat(nt),formattedValue:nt,value:nt},{source:"increment"}),setTimeout(()=>{var at;return Dt((at=Ce.current)==null?void 0:at.value.length)},0)};const ot=S.useRef(wS);ot.current=()=>{if(xe){if(!zk(Ae,le))return;let st;const Wt=Je!==void 0?Je:le?void 0:BigInt(0),Gt=Ae;if(typeof Gt=="bigint"){const Mt=Gt-ye;Wt!==void 0&&Mt{var Mt;return Dt((Mt=Ce.current)==null?void 0:Mt.value.length)},0);return}if(!$k(Ae))return;let qe;const Ue=He!==void 0?He:le?Number.MIN_SAFE_INTEGER:0,zt=pt(Ae),an=pt(We),Rt=Math.max(zt,an),nt=10**Rt;if(!IS(Ae)&&typeof Ae!="number"||Number.isNaN(Ae))qe=es(Qe,Ue,Ye);else{const st=(Math.round(Number(Ae)*nt)-Math.round(We*nt))/nt;Ue!==void 0&&st{var st;return Dt((st=Ce.current)==null?void 0:st.value.length)},0)};const tt=qe=>{var Rt,nt,at;const Ue=qe.clipboardData.getData("text"),zt=X.decimalSeparator||".",an=(P||[".",","]).filter(st=>st!==zt);if(an.some(st=>Ue.includes(st))){qe.preventDefault();let st=Ue;an.forEach(Gt=>{st=st.split(Gt).join(zt)});const Wt=Ce.current;if(Wt){const Gt=Wt.selectionStart??0,Sn=Wt.selectionEnd??0,Mt=Wt.value,xt=Mt.substring(0,Gt)+st+Mt.substring(Sn);(nt=(Rt=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:Rt.set)==null||nt.call(Wt,xt),Wt.dispatchEvent(new Event("change",{bubbles:!0}));const Xt=Gt+st.length;setTimeout(()=>Dt(Xt),0)}}(at=X.onPaste)==null||at.call(X,qe)},Nt=qe=>{var Ue,zt;A==null||A(qe),!(q||!H)&&(qe.key==="ArrowUp"&&(qe.preventDefault(),(Ue=yt.current)==null||Ue.call(yt)),qe.key==="ArrowDown"&&(qe.preventDefault(),(zt=ot.current)==null||zt.call(ot)))},Re=qe=>{if(O==null||O(qe),qe.key==="Backspace"){const Ue=Ce.current;Ue&&Ue.selectionStart===0&&Ue.selectionStart===Ue.selectionEnd&&(qe.preventDefault(),window.setTimeout(()=>Dt(0),0))}},Fe=qe=>{W&&setTimeout(()=>qe.currentTarget.select(),0),Z==null||Z(qe)},Vt=qe=>{let Ue=Ae;xe?(_==="blur"&&typeof Ue=="bigint"&&(Ue=Mg(Ue,Je,oe)),Y&&typeof Ue=="string"&&(Ue=One(Ue,{min:Je,max:oe,clampBehavior:_}))):(_==="blur"&&typeof Ue=="number"&&(Ue=es(Ue,He,Ye)),Y&&typeof Ue=="string"&&pt(Ue)<15&&(Ue=Ane(Ue,Ye,He))),Ae!==Ue&&ze(Ue),x==null||x(qe)};nm(M,{increment:yt.current,decrement:ot.current});const Tt=qe=>{var Ue,zt;qe?(Ue=yt.current)==null||Ue.call(yt):(zt=ot.current)==null||zt.call(ot),de.current+=1},gt=qe=>{if(Tt(qe),be){const Ue=typeof $=="number"?$:$(de.current);Ne.current=window.setTimeout(()=>gt(qe),Ue)}},wt=(qe,Ue)=>{var zt;qe.preventDefault(),(zt=Ce.current)==null||zt.focus(),Tt(Ue),be&&(Ne.current=window.setTimeout(()=>gt(Ue),D))},rn=()=>{Ne.current&&window.clearTimeout(Ne.current),Ne.current=null,de.current=0},Mn=v.jsxs("div",{...se("controls"),children:[v.jsx(En,{...se("control"),tabIndex:-1,"aria-hidden":!0,disabled:F||typeof Ae=="number"&&Ye!==void 0&&Ae>=Ye||typeof Ae=="bigint"&&oe!==void 0&&Ae>=oe,mod:{direction:"up"},onMouseDown:qe=>qe.preventDefault(),onPointerDown:qe=>{wt(qe,!0)},onPointerUp:rn,onPointerLeave:rn,children:v.jsx(BE,{direction:"up"})}),v.jsx(En,{...se("control"),tabIndex:-1,"aria-hidden":!0,disabled:F||typeof Ae=="number"&&He!==void 0&&Ae<=He||typeof Ae=="bigint"&&Je!==void 0&&Ae<=Je,mod:{direction:"down"},onMouseDown:qe=>qe.preventDefault(),onPointerDown:qe=>{wt(qe,!1)},onPointerUp:rn,onPointerLeave:rn,children:v.jsx(BE,{direction:"down"})})]});return v.jsx(Ni,{component:kne,allowNegative:I,className:vt(LS.root,n),size:G,...X,inputMode:xe?"numeric":"decimal",readOnly:q,disabled:F,value:typeof Ae=="bigint"?Ae.toString():Ae,getInputRef:Hn(re,Ce),onValueChange:rt,rightSection:b||q||!(xe?zk(Ae,le):$k(Ae))?w:w||Mn,classNames:ke,styles:ne,unstyled:a,__staticSelector:"NumberInput",decimalScale:xe?0:j?T:0,onPaste:tt,onFocus:Fe,onKeyDown:Nt,onKeyDownCapture:Re,rightSectionPointerEvents:R??(F?"none":void 0),rightSectionWidth:U??`var(--ni-right-section-width-${G||"sm"})`,allowLeadingZeros:z,allowedDecimalSeparators:P,onBlur:Vt,attributes:ie,isAllowed:qe=>{if(!(!k||k(qe)))return!1;if(_!=="strict")return!0;if(!xe)return jne(qe.floatValue,He,Ye);if(qe.value===""||qe.value==="-")return!0;const Ue=Mh(qe.value);return Ue===null?!0:(Je===void 0||Ue>=Je)&&(oe===void 0||Ue<=oe)}})});lm.classes={...Ni.classes,...LS};lm.varsResolver=HB;lm.displayName="@mantine/core/NumberInput";function Tne({reveal:e}){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:e?v.jsxs(v.Fragment,{children:[v.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),v.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M48 40l160 176M154.91 157.6a40 40 0 01-53.82-59.2M135.53 88.71a40 40 0 0132.3 35.53"}),v.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M208.61 169.1C230.41 149.58 240 128 240 128s-32-72-112-72a126 126 0 00-20.68 1.68M74 68.6C33.23 89.24 16 128 16 128s32 72 112 72a118.05 118.05 0 0054-12.6"})]}):v.jsxs(v.Fragment,{children:[v.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),v.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M128 56c-80 0-112 72-112 72s32 72 112 72 112-72 112-72-32-72-112-72z"}),v.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"})]})})}var BS={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const Ene={visibilityToggleIcon:Tne,size:"sm"},UB=(e,{size:t})=>({root:{"--psi-icon-size":$t(t,"psi-icon-size"),"--psi-button-size":$t(t,"psi-button-size")}}),r0=De(e=>{const t=we("PasswordInput",Ene,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,required:u,error:f,leftSection:h,disabled:d,id:p,variant:g,inputContainer:b,description:w,label:k,size:_,errorProps:x,descriptionProps:j,labelProps:T,withAsterisk:A,inputWrapperOrder:O,wrapperProps:M,radius:N,rightSection:F,rightSectionWidth:R,rightSectionPointerEvents:I,leftSectionWidth:q,visible:G,defaultVisible:U,onVisibilityChange:$,visibilityToggleIcon:D,visibilityToggleButtonProps:z,rightSectionProps:H,leftSectionProps:Y,leftSectionPointerEvents:P,withErrorStyles:W,mod:V,attributes:L,...Z}=t,ie=Vi(p),[re,X]=ji({value:G,defaultValue:U,finalValue:!1,onChange:$}),le=()=>X(!re),ee=Ze({name:"PasswordInput",classes:BS,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:L,vars:l,varsResolver:UB}),{resolvedClassNames:se,resolvedStyles:ke}=Wi({classNames:n,styles:a,props:t}),{styleProps:ne,rest:$e}=$u(Z),xe=(x==null?void 0:x.id)||`${ie}-error`,Ae=(j==null?void 0:j.id)||`${ie}-description`,ze=`${f&&typeof f!="boolean"?xe:""} ${w?Ae:""}`,be=ze.trim().length>0?ze.trim():void 0,Ce=v.jsx(Zt,{...ee("visibilityToggle"),disabled:d,radius:N,"aria-pressed":re,tabIndex:-1,"aria-label":"Toggle password visibility",...z,variant:(z==null?void 0:z.variant)??"subtle",color:"gray",unstyled:o,onTouchEnd:Ne=>{var de;Ne.preventDefault(),(de=z==null?void 0:z.onTouchEnd)==null||de.call(z,Ne),le()},onMouseDown:Ne=>{var de;Ne.preventDefault(),(de=z==null?void 0:z.onMouseDown)==null||de.call(z,Ne),le()},onKeyDown:Ne=>{var de;(de=z==null?void 0:z.onKeyDown)==null||de.call(z,Ne),Ne.key===" "&&(Ne.preventDefault(),le())},children:v.jsx(D,{reveal:re})});return v.jsx(Xn.Wrapper,{required:u,id:ie,label:k,error:f,description:w,size:_,classNames:se,styles:ke,__staticSelector:"PasswordInput",__stylesApiProps:t,unstyled:o,withAsterisk:A,inputWrapperOrder:O,inputContainer:b,variant:g,labelProps:{...T,htmlFor:ie},descriptionProps:{...j,id:Ae},errorProps:{...x,id:xe},mod:V,attributes:L,...ee("root"),...ne,...M,children:v.jsx(Xn,{component:"div",error:f,leftSection:h,size:_,classNames:{...se,input:vt(BS.input,se==null?void 0:se.input)},styles:ke,radius:N,disabled:d,__staticSelector:"PasswordInput",__stylesApiProps:t,rightSectionWidth:R,rightSection:F??Ce,variant:g,unstyled:o,leftSectionWidth:q,rightSectionPointerEvents:I||"all",rightSectionProps:H,leftSectionProps:Y,leftSectionPointerEvents:P,withAria:!1,withErrorStyles:W,attributes:L,children:v.jsx("input",{required:u,"data-invalid":!!f||void 0,"data-with-left-section":!!h||void 0,...ee("innerInput"),disabled:d,id:ie,...$e,"aria-describedby":be,autoComplete:$e.autoComplete||"off",type:re?"text":"password"})})})});r0.classes={...Ni.classes,...BS};r0.varsResolver=UB;r0.displayName="@mantine/core/PasswordInput";function Mne({offset:e,position:t,defaultOpened:n}){const[i,r]=S.useState(n),a=S.useRef(null),{x:o,y:l,elements:u,refs:f,update:h,placement:d}=hC({placement:t,middleware:[uC({crossAxis:!0,padding:5,rootBoundary:"document"})]}),p=d.includes("right")?e:t.includes("left")?e*-1:0,g=d.includes("bottom")?e:t.includes("top")?e*-1:0,b=S.useCallback(({clientX:w,clientY:k})=>{f.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:k,left:w+p,top:k+g,right:w,bottom:k}}})},[u.reference]);return S.useEffect(()=>{if(f.floating.current){const w=a.current;w.addEventListener("mousemove",b);const k=ns(f.floating.current);return k.forEach(_=>{_.addEventListener("scroll",h)}),()=>{w.removeEventListener("mousemove",b),k.forEach(_=>{_.removeEventListener("scroll",h)})}}},[u.reference,f.floating.current,h,b,i]),{handleMouseMove:b,x:o,y:l,opened:i,setOpened:r,boundaryRef:a,floating:f.setFloating}}var a0={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Dne={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ka("popover")},VB=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:qn(t),"--tooltip-bg":n?fn(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),o0=De(e=>{const t=we("TooltipFloating",Dne,e),{children:n,refProp:i,withinPortal:r,style:a,className:o,classNames:l,styles:u,unstyled:f,radius:h,color:d,label:p,offset:g,position:b,multiline:w,zIndex:k,disabled:_,defaultOpened:x,variant:j,vars:T,portalProps:A,attributes:O,ref:M,...N}=t,F=ci(),R=Ze({name:"TooltipFloating",props:t,classes:a0,className:o,style:a,classNames:l,styles:u,unstyled:f,attributes:O,rootSelector:"tooltip",vars:T,varsResolver:VB}),{handleMouseMove:I,x:q,y:G,opened:U,boundaryRef:$,floating:D,setOpened:z}=Mne({offset:g,position:b,defaultOpened:x}),H=Nu(n);if(!H)throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Y=Hn($,gy(H),M),P=H.props,W=L=>{var Z;(Z=P.onMouseEnter)==null||Z.call(P,L),I(L),z(!0)},V=L=>{var Z;(Z=P.onMouseLeave)==null||Z.call(P,L),z(!1)};return v.jsxs(v.Fragment,{children:[v.jsx(yl,{...A,withinPortal:r,children:v.jsx(fe,{...N,...R("tooltip",{style:{...Gz(a,F),zIndex:k,display:!_&&U?"block":"none",top:(G&&Math.round(G))??"",left:(q&&Math.round(q))??""}}),variant:j,ref:D,mod:{multiline:w},children:p})}),S.cloneElement(H,{...P,[i]:Y,onMouseEnter:W,onMouseLeave:V})]})});o0.classes=a0;o0.varsResolver=VB;o0.displayName="@mantine/core/TooltipFloating";const WB=S.createContext({withinGroup:!1}),Rne={openDelay:0,closeDelay:0};function QC(e){const{openDelay:t,closeDelay:n,children:i}=we("TooltipGroup",Rne,e);return v.jsx(WB,{value:{withinGroup:!0},children:v.jsx(iJ,{delay:{open:t,close:n},children:i})})}QC.displayName="@mantine/core/TooltipGroup";QC.extend=e=>e;function Pne(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Nne(e){const t=Pne(e.middlewares),n=[wL(e.offset)];return t.shift&&n.push(uC(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Wg():Wg(t.flip)),n.push(kL({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Fh():Fh(t.inline)):e.inline&&n.push(Fh()),n}function $ne(e){var T,A,O;const[t,n]=S.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,r=S.use(WB).withinGroup,a=Vi(),o=S.useCallback(M=>{n(M),M&&k(a)},[a]),{x:l,y:u,context:f,refs:h,placement:d,middlewareData:{arrow:{x:p,y:g}={}}}=hC({strategy:e.strategy,placement:e.position,open:i,onOpenChange:o,middleware:Nne(e),whileElementsMounted:MS}),{delay:b,currentId:w,setCurrentId:k}=rJ(f,{id:a}),{getReferenceProps:_,getFloatingProps:x}=cJ([tJ(f,{enabled:(T=e.events)==null?void 0:T.hover,delay:r?b:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((A=e.events)!=null&&A.touch)}),uJ(f,{enabled:(O=e.events)==null?void 0:O.focus,visibleOnly:!0}),dJ(f,{role:"tooltip"}),sJ(f,{enabled:typeof e.opened>"u"})]);ss(()=>{var M;(M=e.onPositionChange)==null||M.call(e,d)},[d]);const j=i&&w&&w!==a;return{x:l,y:u,arrowX:p,arrowY:g,reference:h.setReference,floating:h.setFloating,getFloatingProps:x,getReferenceProps:_,isGroupPhase:j,opened:i,placement:d}}const zne={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:ka("popover"),middlewares:{flip:!0,shift:!0,inline:!1}},GB=(e,{radius:t,color:n,variant:i,autoContrast:r})=>{const a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:r,variant:i||"filled"});return{tooltip:{"--tooltip-radius":t===void 0?void 0:qn(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}},kn=De(e=>{const t=we("Tooltip",zne,e),{children:n,position:i,refProp:r,label:a,openDelay:o,closeDelay:l,onPositionChange:u,opened:f,defaultOpened:h,withinPortal:d,radius:p,color:g,classNames:b,styles:w,unstyled:k,style:_,className:x,withArrow:j,arrowSize:T,arrowOffset:A,arrowRadius:O,arrowPosition:M,offset:N,transitionProps:F,multiline:R,events:I,zIndex:q,disabled:G,onClick:U,onMouseEnter:$,onMouseLeave:D,inline:z,variant:H,keepMounted:Y,vars:P,portalProps:W,mod:V,floatingStrategy:L,middlewares:Z,autoContrast:ie,attributes:re,target:X,ref:le,...ee}=t,{dir:se}=zu(),ke=S.useRef(null),ne=$ne({position:ML(se,i),closeDelay:l,openDelay:o,onPositionChange:u,opened:f,defaultOpened:h,events:I,arrowRef:ke,arrowOffset:A,offset:typeof N=="number"?N+(j?T/2:0):N,inline:z,strategy:L,middlewares:Z});S.useEffect(()=>{const Ne=X instanceof HTMLElement?X:typeof X=="string"?document.querySelector(X):(X==null?void 0:X.current)||null;Ne&&ne.reference(Ne)},[X,ne]);const $e=Ze({name:"Tooltip",props:t,classes:a0,className:x,style:_,classNames:b,styles:w,unstyled:k,attributes:re,rootSelector:"tooltip",vars:P,varsResolver:GB}),xe=Nu(n);if(!X&&!xe)throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ae=$e("tooltip");if(X){const Ne=hE(F,{duration:100,transition:"fade"});return v.jsx(v.Fragment,{children:v.jsx(yl,{...W,withinPortal:d,children:v.jsx(us,{...Ne,keepMounted:Y,mounted:!G&&!!ne.opened,duration:ne.isGroupPhase?10:Ne.duration,children:de=>v.jsxs(fe,{...ee,"data-fixed":L==="fixed"||void 0,variant:H,mod:[{multiline:R},V],...Ae,...ne.getFloatingProps({ref:ne.floating,className:Ae.className,style:{...Ae.style,...de,zIndex:q,top:ne.y??0,left:ne.x??0}}),children:[a,v.jsx(Gg,{ref:ke,arrowX:ne.arrowX,arrowY:ne.arrowY,visible:j,position:ne.placement,arrowSize:T,arrowOffset:A,arrowRadius:O,arrowPosition:M,...$e("arrow")})]})})})})}const ze=xe.props,be=Hn(ne.reference,gy(xe),le),Ce=hE(F,{duration:100,transition:"fade"});return v.jsxs(v.Fragment,{children:[v.jsx(yl,{...W,withinPortal:d,children:v.jsx(us,{...Ce,keepMounted:Y,mounted:!G&&!!ne.opened,duration:ne.isGroupPhase?10:Ce.duration,children:Ne=>v.jsxs(fe,{...ee,"data-fixed":L==="fixed"||void 0,variant:H,mod:[{multiline:R},V],...ne.getFloatingProps({ref:ne.floating,className:$e("tooltip").className,style:{...$e("tooltip").style,...Ne,zIndex:q,top:ne.y??0,left:ne.x??0}}),children:[a,v.jsx(Gg,{ref:ke,arrowX:ne.arrowX,arrowY:ne.arrowY,visible:j,position:ne.placement,arrowSize:T,arrowOffset:A,arrowRadius:O,arrowPosition:M,...$e("arrow")})]})})}),S.cloneElement(xe,ne.getReferenceProps({onClick:U,onMouseEnter:$,onMouseLeave:D,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...ze,className:vt(x,ze.className),[r]:be}))]})});kn.classes=a0;kn.varsResolver=GB;kn.displayName="@mantine/core/Tooltip";kn.Floating=o0;kn.Group=QC;const Lne={size:"sm",withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left",openOnFocus:!0},Wr=ep(e=>{const t=we("Select",Lne,e),{classNames:n,styles:i,unstyled:r,vars:a,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:f,onFocus:h,onBlur:d,onClick:p,onChange:g,data:b,value:w,defaultValue:k,selectFirstOptionOnChange:_,selectFirstOptionOnDropdownOpen:x,onOptionSubmit:j,comboboxProps:T,readOnly:A,disabled:O,filter:M,limit:N,withScrollArea:F,maxDropdownHeight:R,size:I,searchable:q,rightSection:G,checkIconPosition:U,withCheckIcon:$,withAlignedLabels:D,nothingFoundMessage:z,name:H,form:Y,searchValue:P,defaultSearchValue:W,onSearchChange:V,allowDeselect:L,error:Z,rightSectionPointerEvents:ie,id:re,clearable:X,clearSectionMode:le,clearButtonProps:ee,hiddenInputProps:se,renderOption:ke,onClear:ne,autoComplete:$e,scrollAreaProps:xe,__defaultRightSection:Ae,__clearSection:ze,__clearable:be,chevronColor:Ce,autoSelectOnBlur:Ne,openOnFocus:de,attributes:He,...Ye}=t,We=S.useMemo(()=>My(b),[b]),Qe=S.useRef({}),Je=S.useMemo(()=>up(We),[We]),oe=Vi(re),[ye,Ke,et]=ji({value:w,defaultValue:k,finalValue:null,onChange:g}),je=ye!=null?`${ye}`in Je?Je[`${ye}`]:Qe.current[`${ye}`]:void 0,rt=iX(je),[pt,Dt,yt]=ji({value:P,defaultValue:W,finalValue:je?je.label:"",onChange:V}),ot=Vf({opened:o,defaultOpened:l,onDropdownOpen:()=>{f==null||f(),x?ot.selectFirstOption():ot.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{u==null||u(),setTimeout(ot.resetSelectedOption,0)}}),tt=Tt=>{Dt(Tt),ot.resetSelectedOption()},{resolvedClassNames:Nt,resolvedStyles:Re}=Wi({props:t,styles:i,classNames:n});S.useEffect(()=>{_&&ot.selectFirstOption()},[_,pt]),S.useEffect(()=>{w===null&&tt(""),w!=null&&je&&((rt==null?void 0:rt.value)!==je.value||(rt==null?void 0:rt.label)!==je.label)&&tt(je.label)},[w,je]),S.useEffect(()=>{var Tt,gt;!et&&!yt&&tt(ye!=null?`${ye}`in Je?(Tt=Je[`${ye}`])==null?void 0:Tt.label:((gt=Qe.current[`${ye}`])==null?void 0:gt.label)||"":"")},[Je,ye]),S.useEffect(()=>{ye&&`${ye}`in Je&&(Qe.current[`${ye}`]=Je[`${ye}`])},[Je,ye]);const Fe=v.jsx(jt.ClearButton,{...ee,onClear:()=>{Ke(null,null),tt(""),ne==null||ne()}}),Vt=X&&!!ye&&!O&&!A;return v.jsxs(v.Fragment,{children:[v.jsxs(jt,{store:ot,__staticSelector:"Select",classNames:Nt,styles:Re,unstyled:r,readOnly:A,size:I,attributes:He,keepMounted:Ne,onOptionSubmit:Tt=>{j==null||j(Tt);const gt=L&&`${Je[Tt].value}`==`${ye}`?null:Je[Tt],wt=gt?gt.value:null;wt!==ye&&Ke(wt,gt),!et&&tt(wt!=null&&(gt==null?void 0:gt.label)||""),ot.closeDropdown()},...T,children:[v.jsx(jt.Target,{targetType:q?"input":"button",autoComplete:$e,withExpandedAttribute:!0,children:v.jsx(Ni,{id:oe,__defaultRightSection:v.jsx(jt.Chevron,{size:I,error:Z,unstyled:r,color:Ce}),__clearSection:Fe,__clearable:Vt,__clearSectionMode:le,rightSection:G,rightSectionPointerEvents:ie||"none",...Ye,size:I,__staticSelector:"Select",disabled:O,readOnly:A||!q,value:pt,onChange:Tt=>{tt(Tt.currentTarget.value),ot.openDropdown(),_&&ot.selectFirstOption()},onFocus:Tt=>{de&&q&&ot.openDropdown(),h==null||h(Tt)},onBlur:Tt=>{Ne&&ot.clickSelectedOption(),q&&ot.closeDropdown();const gt=ye!=null&&(`${ye}`in Je?Je[`${ye}`]:Qe.current[`${ye}`]);tt(gt&>.label||""),d==null||d(Tt)},onClick:Tt=>{q?ot.openDropdown():ot.toggleDropdown(),p==null||p(Tt)},classNames:Nt,styles:Re,unstyled:r,pointer:!q,error:Z,attributes:He})}),v.jsx(Ny,{data:We,hidden:A||O,filter:M,search:pt,limit:N,hiddenWhenEmpty:!z,withScrollArea:F,maxDropdownHeight:R,filterOptions:!!q&&(je==null?void 0:je.label)!==pt,value:ye,checkIconPosition:U,withCheckIcon:$,withAlignedLabels:D,nothingFoundMessage:z,unstyled:r,labelId:Ye.label?`${oe}-label`:void 0,"aria-label":Ye.label?void 0:Ye["aria-label"],renderOption:ke,scrollAreaProps:xe})]}),v.jsx(jt.HiddenInput,{value:ye,name:H,form:Y,disabled:O,...se})]})});Wr.classes={...Ni.classes,...jt.classes};Wr.displayName="@mantine/core/Select";function YB(e){if(e!==void 0)return typeof e=="number"?pe(e):e}function Ine({spacing:e,verticalSpacing:t,cols:n,minColWidth:i,autoRows:r,selector:a}){var d;const o=ci(),l=t===void 0?e:t,u=i!==void 0,f=Pu({"--sg-spacing-x":Yn(Ur(e)),"--sg-spacing-y":Yn(Ur(l)),"--sg-auto-rows":r,...u?{"--sg-min-col-width":YB(i)}:{"--sg-cols":(d=Ur(n))==null?void 0:d.toString()}}),h=Nn(o.breakpoints).reduce((p,g)=>(p[g]||(p[g]={}),typeof e=="object"&&e[g]!==void 0&&(p[g]["--sg-spacing-x"]=Yn(e[g])),typeof l=="object"&&l[g]!==void 0&&(p[g]["--sg-spacing-y"]=Yn(l[g])),!u&&typeof n=="object"&&n[g]!==void 0&&(p[g]["--sg-cols"]=n[g]),p),{});return v.jsx(Bf,{styles:f,media:tm(Nn(h),o.breakpoints).filter(p=>Nn(h[p.value]).length>0).map(p=>({query:`(min-width: ${o.breakpoints[p.value]})`,styles:h[p.value]})),selector:a})}function Ik(e){return typeof e=="object"&&e!==null?Nn(e):[]}function Bne(e){return e.sort((t,n)=>em(t)-em(n))}function Fne({spacing:e,verticalSpacing:t,cols:n,minColWidth:i}){return Bne(Array.from(new Set([...Ik(e),...Ik(t),...i!==void 0?[]:Ik(n)])))}function qne({spacing:e,verticalSpacing:t,cols:n,minColWidth:i,autoRows:r,selector:a}){var d;const o=t===void 0?e:t,l=i!==void 0,u=Pu({"--sg-spacing-x":Yn(Ur(e)),"--sg-spacing-y":Yn(Ur(o)),"--sg-auto-rows":r,...l?{"--sg-min-col-width":YB(i)}:{"--sg-cols":(d=Ur(n))==null?void 0:d.toString()}}),f=Fne({spacing:e,verticalSpacing:t,cols:n,minColWidth:i}),h=f.reduce((p,g)=>(p[g]||(p[g]={}),typeof e=="object"&&e[g]!==void 0&&(p[g]["--sg-spacing-x"]=Yn(e[g])),typeof o=="object"&&o[g]!==void 0&&(p[g]["--sg-spacing-y"]=Yn(o[g])),!l&&typeof n=="object"&&n[g]!==void 0&&(p[g]["--sg-cols"]=n[g]),p),{});return v.jsx(Bf,{styles:u,container:f.map(p=>({query:`simple-grid (min-width: ${p})`,styles:h[p]})),selector:a})}var KB={container:"m_925c2d2c",root:"m_2415a157"};const Hne={cols:1,spacing:"md",type:"media"},Xo=De(e=>{const t=we("SimpleGrid",Hne,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,cols:u,verticalSpacing:f,spacing:h,type:d,minColWidth:p,autoFlow:g,autoRows:b,attributes:w,...k}=t,_=Ze({name:"SimpleGrid",classes:KB,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,vars:l}),x=yy(),j=p!==void 0?g||"auto-fill":void 0;return d==="container"?v.jsxs(v.Fragment,{children:[v.jsx(qne,{...t,selector:`.${x}`}),v.jsx("div",{..._("container"),children:v.jsx(fe,{..._("root",{className:x}),...k,"data-auto-cols":j})})]}):v.jsxs(v.Fragment,{children:[v.jsx(Ine,{...t,selector:`.${x}`}),v.jsx(fe,{..._("root",{className:x}),...k,"data-auto-cols":j})]})});Xo.classes=KB;Xo.displayName="@mantine/core/SimpleGrid";var XB={root:"m_6d731127"};const Une={gap:"md",align:"stretch",justify:"flex-start"},ZB=(e,{gap:t,align:n,justify:i})=>({root:{"--stack-gap":Yn(t),"--stack-align":n,"--stack-justify":i}}),Ot=De(e=>{const t=we("Stack",Une,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,align:u,justify:f,gap:h,variant:d,attributes:p,...g}=t;return v.jsx(fe,{...Ze({name:"Stack",props:t,classes:XB,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:p,vars:l,varsResolver:ZB})("root"),variant:d,...g})});Ot.classes=XB;Ot.varsResolver=ZB;Ot.displayName="@mantine/core/Stack";const[Vne,Wne]=Gr("Table component was not found in the tree");var dp={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function Gne(e,t){if(!t)return;const n={};return t.columnBorder&&e.withColumnBorders&&(n["data-with-column-border"]=!0),t.rowBorder&&e.withRowBorders&&(n["data-with-row-border"]=!0),t.striped&&e.striped&&(n["data-striped"]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n["data-hover"]=!0),t.captionSide&&e.captionSide&&(n["data-side"]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n["data-sticky"]=!0),n}function Iu(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,i=De(r=>{const a=we(n,{},r),{classNames:o,className:l,style:u,styles:f,...h}=a,d=Wne();return v.jsx(fe,{component:e,...Gne(d,t),...d.getStyles(e,{className:l,classNames:o,style:u,styles:f,props:a}),...h})});return i.displayName=`@mantine/core/${n}`,i.classes=dp,i}const FS=Iu("th",{columnBorder:!0}),QB=Iu("td",{columnBorder:!0}),Dg=Iu("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),JB=Iu("thead",{stickyHeader:!0}),eF=Iu("tbody"),tF=Iu("tfoot"),nF=Iu("caption",{captionSide:!0}),Yne={type:"scrollarea"},iF=(e,{minWidth:t,maxHeight:n,type:i})=>({scrollContainer:{"--table-min-width":pe(t),"--table-max-height":pe(n),"--table-overflow":i==="native"?"auto":void 0}}),s0=De(e=>{const t=we("TableScrollContainer",Yne,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,children:u,minWidth:f,maxHeight:h,type:d,scrollAreaProps:p,attributes:g,...b}=t,w=Ze({name:"TableScrollContainer",classes:dp,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:g,vars:l,varsResolver:iF,rootSelector:"scrollContainer"});return v.jsx(fe,{component:d==="scrollarea"?lr:"div",...d==="scrollarea"?h?{offsetScrollbars:"xy",...p}:{offsetScrollbars:"x",...p}:{},...w("scrollContainer"),...b,children:v.jsx("div",{...w("scrollContainerInner"),children:u})})});s0.classes=dp;s0.varsResolver=iF;s0.displayName="@mantine/core/TableScrollContainer";function JC({data:e}){return v.jsxs(v.Fragment,{children:[e.caption&&v.jsx(nF,{children:e.caption}),e.head&&v.jsx(JB,{children:v.jsx(Dg,{children:e.head.map((t,n)=>v.jsx(FS,{children:t},n))})}),e.body&&v.jsx(eF,{children:e.body.map((t,n)=>v.jsx(Dg,{children:t.map((i,r)=>v.jsx(QB,{children:i},r))},n))}),e.foot&&v.jsx(tF,{children:v.jsx(Dg,{children:e.foot.map((t,n)=>v.jsx(FS,{children:t},n))})})]})}JC.displayName="@mantine/core/TableDataRenderer";const Kne={withRowBorders:!0,verticalSpacing:7},rF=(e,{layout:t,captionSide:n,horizontalSpacing:i,verticalSpacing:r,borderColor:a,stripedColor:o,highlightOnHoverColor:l,striped:u,highlightOnHover:f,stickyHeaderOffset:h,stickyHeader:d})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Yn(i),"--table-vertical-spacing":Yn(r),"--table-border-color":a?fn(a,e):void 0,"--table-striped-color":u&&o?fn(o,e):void 0,"--table-highlight-on-hover-color":f&&l?fn(l,e):void 0,"--table-sticky-header-offset":d?pe(h):void 0}}),Xe=De(e=>{const t=we("Table",Kne,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,horizontalSpacing:u,verticalSpacing:f,captionSide:h,stripedColor:d,highlightOnHoverColor:p,striped:g,highlightOnHover:b,withColumnBorders:w,withRowBorders:k,withTableBorder:_,borderColor:x,layout:j,data:T,children:A,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:F,attributes:R,...I}=t,q=Ze({name:"Table",props:t,className:i,style:r,classes:dp,classNames:n,styles:a,unstyled:o,attributes:R,rootSelector:"table",vars:l,varsResolver:rF});return v.jsx(Vne,{value:{getStyles:q,stickyHeader:O,striped:g===!0?"odd":g||void 0,highlightOnHover:b,withColumnBorders:w,withRowBorders:k,captionSide:h||"bottom"},children:v.jsx(fe,{component:"table",mod:[{"data-with-table-border":_,"data-tabular-nums":F},N],...q("table"),...I,children:A||!!T&&v.jsx(JC,{data:T})})})});Xe.classes=dp;Xe.varsResolver=rF;Xe.displayName="@mantine/core/Table";Xe.Td=QB;Xe.Th=FS;Xe.Tr=Dg;Xe.Thead=JB;Xe.Tbody=eF;Xe.Tfoot=tF;Xe.Caption=nF;Xe.ScrollContainer=s0;Xe.DataRenderer=JC;const[Xne,e9]=Gr("Tabs component was not found in the tree");var hp={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const t9=De(e=>{const t=we("TabsList",null,e),{children:n,className:i,grow:r,justify:a,classNames:o,styles:l,style:u,mod:f,...h}=t,d=e9();return v.jsx(fe,{...d.getStyles("list",{className:i,style:u,classNames:o,styles:l,props:t,variant:d.variant}),role:"tablist",variant:d.variant,mod:[{grow:r,orientation:d.orientation,placement:d.orientation==="vertical"&&d.placement,inverted:d.inverted},f],"aria-orientation":d.orientation,__vars:{"--tabs-justify":a},...h,children:n})});t9.classes=hp;t9.displayName="@mantine/core/TabsList";const n9=De(e=>{const t=we("TabsPanel",null,e),{children:n,className:i,value:r,classNames:a,styles:o,style:l,mod:u,keepMounted:f,...h}=t,d=Jm(),p=e9(),g=p.value===r,b=p.keepMounted||f,w=p.keepMountedMode!=="display-none",k=b&&w&&d!=="test"?v.jsx(S.Activity,{mode:g?"visible":"hidden",children:n}):b||g?n:null;return v.jsx(fe,{...p.getStyles("panel",{className:i,classNames:a,styles:o,style:[l,g?void 0:{display:"none"}],props:t}),mod:[{orientation:p.orientation},u],role:"tabpanel",id:p.getPanelId(r),"aria-labelledby":p.getTabId(r),...h,children:k})});n9.classes=hp;n9.displayName="@mantine/core/TabsPanel";const i9=De(e=>{const t=we("TabsTab",null,e),{className:n,children:i,rightSection:r,leftSection:a,value:o,onClick:l,onKeyDown:u,disabled:f,color:h,style:d,classNames:p,styles:g,vars:b,mod:w,tabIndex:k,..._}=t,x=ci(),{dir:j}=zu(),T=e9(),A=o===T.value,O=N=>{T.onChange(T.allowTabDeactivation&&o===T.value?null:o),l==null||l(N)},M={classNames:p,styles:g,props:t};return v.jsxs(En,{...T.getStyles("tab",{className:n,style:d,variant:T.variant,...M}),disabled:f,unstyled:T.unstyled,variant:T.variant,mod:[{active:A,disabled:f,orientation:T.orientation,inverted:T.inverted,placement:T.orientation==="vertical"&&T.placement},w],role:"tab",id:T.getTabId(o),"aria-selected":A,tabIndex:k!==void 0?k:A||T.value===null?0:-1,"aria-controls":T.getPanelId(o),onClick:O,__vars:{"--tabs-color":h?fn(h,x):void 0},onKeyDown:V6({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:T.activateTabWithKeyboard,loop:T.loop,orientation:T.orientation||"horizontal",dir:j,onKeyDown:u}),..._,children:[a&&v.jsx("span",{...T.getStyles("tabSection",M),"data-position":"left",children:a}),i&&v.jsx("span",{...T.getStyles("tabLabel",M),children:i}),r&&v.jsx("span",{...T.getStyles("tabSection",M),"data-position":"right",children:r})]})});i9.classes=hp;i9.displayName="@mantine/core/TabsTab";const qE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",Zne={keepMounted:!0,keepMountedMode:"activity",orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},aF=(e,{radius:t,color:n,autoContrast:i})=>({root:{"--tabs-radius":qn(t),"--tabs-color":fn(n,e),"--tabs-text-color":Qm(i,e)?If({color:n,theme:e,autoContrast:i}):void 0}}),Gn=De(e=>{const t=we("Tabs",Zne,e),{defaultValue:n,value:i,onChange:r,orientation:a,children:o,loop:l,id:u,activateTabWithKeyboard:f,allowTabDeactivation:h,variant:d,color:p,radius:g,inverted:b,placement:w,keepMounted:k,keepMountedMode:_,classNames:x,styles:j,unstyled:T,className:A,style:O,vars:M,autoContrast:N,mod:F,attributes:R,...I}=t,q=Vi(u),[G,U]=ji({value:i,defaultValue:n,finalValue:null,onChange:r}),$=Ze({name:"Tabs",props:t,classes:hp,className:A,style:O,classNames:x,styles:j,unstyled:T,attributes:R,vars:M,varsResolver:aF});return v.jsx(Xne,{value:{placement:w,value:G,orientation:a,id:q,loop:l,activateTabWithKeyboard:f,getTabId:DT(`${q}-tab`,qE),getPanelId:DT(`${q}-panel`,qE),onChange:U,allowTabDeactivation:h,variant:d,color:p,radius:g,inverted:b,keepMounted:k,keepMountedMode:_,unstyled:T,getStyles:$},children:v.jsx(fe,{id:q,variant:d,mod:[{orientation:a,inverted:a==="horizontal"&&b,placement:a==="vertical"&&w},F],...$("root"),...I,children:o})})});Gn.classes=hp;Gn.varsResolver=aF;Gn.displayName="@mantine/core/Tabs";Gn.Tab=i9;Gn.Panel=n9;Gn.List=t9;function Qne({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,r)=>(xu(r)?i.push({group:r.group,items:r.items.filter(a=>n.indexOf(a.label.toLowerCase().trim())===-1)}):n.indexOf(r.label.toLowerCase().trim())===-1&&i.push(r),i),[])}function Jne(e,t){return e?t.split(new RegExp(`[${e.join("")}]`)).map(n=>n.trim()).filter(n=>n!==""):[t]}function HE({splitChars:e,allowDuplicates:t,maxTags:n,value:i,currentTags:r,isDuplicate:a,onDuplicate:o}){const l=Jne(e,i),u=[];if(t)u.push(...r,...l);else{u.push(...r);for(const f of l)(a?h=>a(h,u):h=>u.some(d=>d.toLowerCase()===h.toLowerCase()))(f)?o==null||o(f):u.push(f)}return n?u.slice(0,n):u}const eie={maxTags:1/0,acceptValueOnBlur:!0,splitChars:[","],hiddenInputValuesDivider:",",openOnFocus:!0,size:"sm"},r9=De(e=>{const t=we("TagsInput",eie,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,size:u,value:f,defaultValue:h,onChange:d,onKeyDown:p,maxTags:g,allowDuplicates:b,onDuplicate:w,variant:k,data:_,dropdownOpened:x,defaultDropdownOpened:j,onDropdownOpen:T,onDropdownClose:A,selectFirstOptionOnChange:O,selectFirstOptionOnDropdownOpen:M,onOptionSubmit:N,comboboxProps:F,filter:R,limit:I,withScrollArea:q,maxDropdownHeight:G,searchValue:U,defaultSearchValue:$,onSearchChange:D,readOnly:z,disabled:H,splitChars:Y,onFocus:P,onBlur:W,onPaste:V,radius:L,rightSection:Z,rightSectionWidth:ie,rightSectionPointerEvents:re,rightSectionProps:X,leftSection:le,leftSectionWidth:ee,leftSectionPointerEvents:se,leftSectionProps:ke,inputContainer:ne,inputWrapperOrder:$e,withAsterisk:xe,required:Ae,labelProps:ze,descriptionProps:be,errorProps:Ce,wrapperProps:Ne,description:de,label:He,error:Ye,withErrorStyles:We,name:Qe,form:Je,id:oe,clearable:ye,clearSectionMode:Ke,clearButtonProps:et,hiddenInputProps:je,hiddenInputValuesDivider:rt,mod:pt,renderOption:Dt,renderPill:yt,onRemove:ot,onClear:tt,onMaxTags:Nt,scrollAreaProps:Re,acceptValueOnBlur:Fe,isDuplicate:Vt,openOnFocus:Tt,attributes:gt,ref:wt,loading:rn,loadingPosition:Mn,...qe}=t,Ue=Vi(oe),zt=My(_),an=up(zt),Rt=S.useRef(null),nt=Hn(Rt,wt),at=Vf({opened:x,defaultOpened:j,onDropdownOpen:()=>{T==null||T(),M&&at.selectFirstOption()},onDropdownClose:()=>{A==null||A(),at.resetSelectedOption()}}),{styleProps:st,rest:{type:Wt,autoComplete:Gt,...Sn}}=$u(qe),[Mt,xt]=ji({value:f,defaultValue:h,finalValue:[],onChange:d}),[Xt,zn]=ji({value:U,defaultValue:$,finalValue:"",onChange:D}),Oi=mt=>{zn(mt),at.resetSelectedOption()},fr=Ze({name:"TagsInput",classes:{},props:t,classNames:n,styles:a,unstyled:o}),{resolvedClassNames:Aa,resolvedStyles:Yr}=Wi({props:t,styles:a,classNames:n}),Xa=mt=>{if((Vt?Vt(mt,Mt):Mt.some(fi=>fi.toLowerCase()===mt.toLowerCase()))&&(w==null||w(mt),!b)){Oi("");return}if(Mt.length>=g){Nt==null||Nt(mt);return}N==null||N(mt),Oi(""),mt.length>0&&xt([...Mt,mt])},Kr=mt=>{if(p==null||p(mt),mt.isPropagationStopped())return;const fi=Xt.trim(),{length:dt}=fi;if(Y.includes(mt.key)&&dt>0&&(xt(HE({splitChars:Y,allowDuplicates:b,maxTags:g,value:Xt,currentTags:Mt,isDuplicate:Vt,onDuplicate:w})),Oi(""),mt.preventDefault()),mt.key==="Enter"&&dt>0&&!mt.nativeEvent.isComposing){if(mt.preventDefault(),document.querySelector(`#${at.listId} [data-combobox-option][data-combobox-selected]`))return;Xa(fi)}mt.key==="Backspace"&&dt===0&&Mt.length>0&&!mt.nativeEvent.isComposing&&!z&&(ot==null||ot(Mt[Mt.length-1]),xt(Mt.slice(0,Mt.length-1)))},Oa=mt=>{V==null||V(mt),mt.preventDefault(),mt.clipboardData&&(xt(HE({splitChars:Y,allowDuplicates:b,maxTags:g,value:`${Xt}${mt.clipboardData.getData("text/plain")}`,currentTags:Mt,isDuplicate:Vt,onDuplicate:w})),Oi(""))},Ar=Mt.map((mt,fi)=>{const dt=()=>{const Xr=Mt.slice();Xr.splice(fi,1),xt(Xr),ot==null||ot(mt)};return yt?v.jsx(S.Fragment,{children:yt({option:an[mt]||{value:mt,label:mt,disabled:!1},value:mt,onRemove:dt,disabled:H||z})},`${mt}-${fi}`):v.jsx(_l,{withRemoveButton:!z,onRemove:dt,unstyled:o,disabled:H,attributes:gt,...fr("pill"),children:mt},`${mt}-${fi}`)});S.useEffect(()=>{O&&at.selectFirstOption()},[O,Mt,Xt]);const dr=v.jsx(jt.ClearButton,{...et,onClear:()=>{var mt;xt([]),Oi(""),(mt=Rt.current)==null||mt.focus(),at.openDropdown(),tt==null||tt()}});return v.jsxs(v.Fragment,{children:[v.jsxs(jt,{store:at,classNames:Aa,styles:Yr,unstyled:o,size:u,readOnly:z,__staticSelector:"TagsInput",attributes:gt,onOptionSubmit:mt=>{N==null||N(mt),Oi(""),Mt.length>=g?Nt==null||Nt(mt):xt([...Mt,an[mt].value]),at.resetSelectedOption()},...F,children:[v.jsx(jt.DropdownTarget,{children:v.jsx(Su,{...st,__staticSelector:"TagsInput",classNames:Aa,styles:Yr,unstyled:o,size:u,className:i,style:r,variant:k,disabled:H,radius:L,rightSection:Z,__clearSection:dr,__clearable:ye&&Mt.length>0&&!H&&!z,__clearSectionMode:Ke,rightSectionWidth:ie,rightSectionPointerEvents:re,rightSectionProps:X,leftSection:le,leftSectionWidth:ee,leftSectionPointerEvents:se,leftSectionProps:ke,loading:rn,loadingPosition:Mn,inputContainer:ne,inputWrapperOrder:$e,withAsterisk:xe,required:Ae,labelProps:ze,descriptionProps:be,errorProps:Ce,wrapperProps:Ne,description:de,label:He,error:Ye,withErrorStyles:We,__stylesApiProps:{...t,multiline:!0},id:Ue,mod:pt,attributes:gt,children:v.jsxs(_l.Group,{disabled:H,unstyled:o,...fr("pillsList"),children:[Ar,v.jsx(jt.EventsTarget,{autoComplete:Gt,withExpandedAttribute:!0,children:v.jsx(Su.Field,{...Sn,ref:nt,...fr("inputField"),unstyled:o,onKeyDown:Kr,onFocus:mt=>{P==null||P(mt),Tt&&at.openDropdown()},onBlur:mt=>{W==null||W(mt),Fe&&Xa(Xt),at.closeDropdown()},onPaste:Oa,value:Xt,onChange:mt=>Oi(mt.currentTarget.value),required:Ae&&Mt.length===0,disabled:H,readOnly:z,id:Ue})})]})})}),v.jsx(Ny,{data:Qne({data:zt,value:Mt}),hidden:z||H,filter:R,search:Xt,limit:I,hiddenWhenEmpty:!0,withScrollArea:q,maxDropdownHeight:G,unstyled:o,labelId:He?`${Ue}-label`:void 0,"aria-label":He?void 0:qe["aria-label"],renderOption:Dt,scrollAreaProps:Re})]}),v.jsx(jt.HiddenInput,{name:Qe,form:Je,value:Mt,valuesDivider:rt,disabled:H,...je})]})});r9.classes={...Ni.classes,...jt.classes};r9.displayName="@mantine/core/TagsInput";const _r=De(e=>v.jsx(Ni,{component:"input",...we("TextInput",null,e),__staticSelector:"TextInput"}));_r.classes=Ni.classes;_r.displayName="@mantine/core/TextInput";const[tie,nie]=Gr("Timeline component was not found in tree");var a9={root:"m_43657ece",itemTitle:"m_2ebe8099",item:"m_436178ff",itemBullet:"m_8affcee1",itemBody:"m_540e8f41"};const o9=De(e=>{const{classNames:t,className:n,style:i,styles:r,vars:a,__active:o,__align:l,__lineActive:u,__vars:f,bullet:h,radius:d,color:p,lineVariant:g,children:b,title:w,mod:k,..._}=we("TimelineItem",null,e),x=nie(),j=ci(),T={classNames:t,styles:r};return v.jsxs(fe,{...x.getStyles("item",{...T,className:n,style:i}),mod:[{"line-active":u,active:o},k],__vars:{"--tli-radius":d!==void 0?qn(d):void 0,"--tli-color":p?fn(p,j):void 0,"--tli-border-style":g||void 0},..._,children:[v.jsx(fe,{...x.getStyles("itemBullet",T),mod:{"with-child":!!h,align:l,active:o},children:h}),v.jsxs("div",{...x.getStyles("itemBody",T),children:[w&&v.jsx("div",{...x.getStyles("itemTitle",T),children:w}),v.jsx("div",{...x.getStyles("itemContent",T),children:b})]})]})});o9.classes=a9;o9.displayName="@mantine/core/TimelineItem";const iie={active:-1,align:"left"},oF=(e,{bulletSize:t,lineWidth:n,radius:i,color:r,autoContrast:a})=>({root:{"--tl-bullet-size":pe(t),"--tl-line-width":pe(n),"--tl-radius":i===void 0?void 0:qn(i),"--tl-color":r?fn(r,e):void 0,"--tl-icon-color":Qm(a,e)?If({color:r,theme:e,autoContrast:a}):void 0}}),cf=De(e=>{const t=we("Timeline",iie,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,children:u,active:f,color:h,radius:d,bulletSize:p,align:g,lineWidth:b,reverseActive:w,mod:k,autoContrast:_,attributes:x,...j}=t,T=Ze({name:"Timeline",classes:a9,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:x,vars:l,varsResolver:oF}),A=S.Children.toArray(u),O=A.map((M,N)=>{var F,R;return S.cloneElement(M,{unstyled:o,__align:g,__active:((F=M.props)==null?void 0:F.active)||(w?f>=A.length-N-1:f>=N),__lineActive:((R=M.props)==null?void 0:R.lineActive)||(w?f>=A.length-N-1:f-1>=N)})});return v.jsx(tie,{value:{getStyles:T},children:v.jsx(fe,{...T("root"),mod:[{align:g},k],...j,children:O})})});cf.classes=a9;cf.varsResolver=oF;cf.displayName="@mantine/core/Timeline";cf.Item=o9;const rie=["h1","h2","h3","h4","h5","h6"],aie=["xs","sm","md","lg","xl"];function oie(e,t){const n=t!==void 0?t:`h${e}`;return rie.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:aie.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:pe(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var sF={root:"m_8a5d1357"};const sie={order:1},lF=(e,{order:t,size:n,lineClamp:i,textWrap:r})=>{const a=oie(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof i=="number"?i.toString():void 0,"--title-text-wrap":r}}},Al=De(e=>{const t=we("Title",sie,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,order:l,vars:u,size:f,variant:h,lineClamp:d,textWrap:p,mod:g,attributes:b,...w}=t,k=Ze({name:"Title",props:t,classes:sF,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:b,vars:u,varsResolver:lF});return[1,2,3,4,5,6].includes(l)?v.jsx(fe,{...k("root"),component:`h${l}`,variant:h,mod:[{order:l,"data-line-clamp":typeof d=="number"},g],size:f,...w}):null});Al.classes=sF;Al.varsResolver=lF;Al.displayName="@mantine/core/Title";const s9=S.createContext(null);s9.displayName="@mantine/modals/ModalsContext";function lie(){const e=S.use(s9);if(!e)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return e}const[uie,Bu]=oX("mantine-modals"),cie=e=>{const t=e.modalId||hl();return Bu("openModal")({...e,modalId:t}),t},fie=e=>{const t=e.modalId||hl();return Bu("openConfirmModal")({...e,modalId:t}),t},die=e=>{const t=e.modalId||hl();return Bu("openContextModal")({...e,modalId:t}),t},hie=Bu("closeModal"),mie=Bu("closeAllModals"),pie=e=>Bu("updateModal")(e),vie=e=>Bu("updateContextModal")(e),Na={open:cie,close:hie,closeAll:mie,openConfirmModal:fie,openContextModal:die,updateModal:pie,updateContextModal:vie};function gie({id:e,cancelProps:t,confirmProps:n,labels:i={cancel:"",confirm:""},closeOnConfirm:r=!0,closeOnCancel:a=!0,groupProps:o,onCancel:l,onConfirm:u,children:f}){const{cancel:h,confirm:d}=i,p=lie(),g=w=>{typeof(t==null?void 0:t.onClick)=="function"&&(t==null||t.onClick(w)),typeof l=="function"&&l(),a&&p.closeModal(e)},b=w=>{typeof(n==null?void 0:n.onClick)=="function"&&(n==null||n.onClick(w)),typeof u=="function"&&u(),r&&p.closeModal(e)};return v.jsxs(v.Fragment,{children:[f&&v.jsx(fe,{mb:"md",children:f}),v.jsxs(Pe,{mt:f?0:"md",justify:"flex-end",...o,children:[v.jsx(tn,{variant:"default",...t,onClick:g,children:(t==null?void 0:t.children)||h}),v.jsx(tn,{...n,onClick:b,children:(n==null?void 0:n.children)||d})]})]})}function UE(e,t){var n,i,r,a;t&&e.type==="confirm"&&((i=(n=e.props).onCancel)==null||i.call(n)),(a=(r=e.props).onClose)==null||a.call(r)}function yie(e,t){var n;switch(t.type){case"OPEN":return{current:t.modal,modals:[...e.modals,t.modal]};case"CLOSE":{if(!e.modals.find(r=>r.id===t.modalId))return e;const i=e.modals.filter(r=>r.id!==t.modalId);return{current:i[i.length-1]||e.current,modals:i}}case"CLOSE_ALL":return e.modals.length?{current:e.current,modals:[]}:e;case"UPDATE":{const{modalId:i,newProps:r}=t,a=e.modals.map(l=>l.id!==i?l:l.type==="content"||l.type==="confirm"?{...l,props:{...l.props,...r}}:l.type==="context"?{...l,props:{...l.props,...r,innerProps:{...l.props.innerProps,...r.innerProps}}}:l),o=((n=e.current)==null?void 0:n.id)===i&&a.find(l=>l.id===i)||e.current;return{...e,modals:a,current:o}}default:return e}}function bie(e){if(!e)return{confirmProps:{},modalProps:{}};const{id:t,children:n,onCancel:i,onConfirm:r,closeOnConfirm:a,closeOnCancel:o,cancelProps:l,confirmProps:u,groupProps:f,labels:h,...d}=e;return{confirmProps:{id:t,children:n,onCancel:i,onConfirm:r,closeOnConfirm:a,closeOnCancel:o,cancelProps:l,confirmProps:u,groupProps:f,labels:h},modalProps:{id:t,...d}}}function wie({children:e,modalProps:t,labels:n,modals:i}){const[r,a]=S.useReducer(yie,{modals:[],current:null}),o=S.useRef(r);o.current=r;const l=S.useRef(!1),u=S.useCallback(j=>{l.current||(l.current=!0,o.current.modals.concat().reverse().forEach(T=>{UE(T,j)}),l.current=!1),a({type:"CLOSE_ALL",canceled:j})},[o,a]),f=S.useCallback(({modalId:j,...T})=>{const A=j||hl();return a({type:"OPEN",modal:{id:A,type:"content",props:T}}),A},[a]),h=S.useCallback(({modalId:j,...T})=>{const A=j||hl();return a({type:"OPEN",modal:{id:A,type:"confirm",props:T}}),A},[a]),d=S.useCallback((j,{modalId:T,...A})=>{const O=T||hl();return a({type:"OPEN",modal:{id:O,type:"context",props:A,ctx:j}}),O},[a]),p=S.useCallback((j,T)=>{if(!l.current){const A=o.current.modals.find(O=>O.id===j);A&&(l.current=!0,UE(A,T),l.current=!1)}a({type:"CLOSE",modalId:j,canceled:T})},[o,a]),g=S.useCallback(({modalId:j,...T})=>{a({type:"UPDATE",modalId:j,newProps:T})},[a]),b=S.useCallback(({modalId:j,...T})=>{a({type:"UPDATE",modalId:j,newProps:T})},[a]);uie({openModal:f,openConfirmModal:h,openContextModal:({modal:j,...T})=>d(j,T),closeModal:p,closeContextModal:p,closeAllModals:u,updateModal:g,updateContextModal:b});const w={modalProps:t||{},modals:r.modals,openModal:f,openConfirmModal:h,openContextModal:d,closeModal:p,closeContextModal:p,closeAll:u,updateModal:g,updateContextModal:b},k=()=>{const j=o.current.current;switch(j==null?void 0:j.type){case"context":{const{innerProps:T,...A}=j.props,O=i[j.ctx];return{modalProps:A,content:v.jsx(O,{innerProps:T,context:w,id:j.id})}}case"confirm":{const{modalProps:T,confirmProps:A}=bie(j.props);return{modalProps:T,content:v.jsx(gie,{...A,id:j.id,labels:j.props.labels||n})}}case"content":{const{children:T,...A}=j.props;return{modalProps:A,content:T}}default:return{modalProps:{},content:null}}},{modalProps:_,content:x}=k();return v.jsxs(s9,{value:w,children:[v.jsx(tr,{zIndex:ka("modal")+1,...t,..._,opened:r.modals.length>0,onClose:()=>{var j;return p((j=r.current)==null?void 0:j.id)},children:x}),e]})}function kie(e){let t=e,n=!1;const i=new Set;return{getState(){return t},updateState(r){t=typeof r=="function"?r(t):r},setState(r){this.updateState(r),i.forEach(a=>a(t))},initialize(r){n||(t=r,n=!0)},subscribe(r){return i.add(r),()=>i.delete(r)}}}function _ie(e){return S.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function xie(e,t,n){const i=[],r=[],a={};for(const o of e){const l=o.position||t;a[l]=a[l]||0,a[l]+=1,a[l]<=n?r.push(o):i.push(o)}return{notifications:r,queue:i}}const Sie=()=>kie({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Fu=Sie(),Cie=(e=Fu)=>_ie(e);function Qf(e,t){const n=e.getState(),i=xie(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function jie(e,t=Fu){const n=e.id||hl();return Qf(t,i=>e.id&&i.some(r=>r.id===e.id)?i:[...i,{...e,id:n}]),n}function uF(e,t=Fu){return Qf(t,n=>n.filter(i=>{var r;return i.id===e?((r=i.onClose)==null||r.call(i,i),!1):!0})),e}function Aie(e,t=Fu){return Qf(t,n=>n.map(i=>i.id===e.id?{...i,...e}:i)),e.id}function Oie(e=Fu){Qf(e,()=>[])}function Tie(e=Fu){Qf(e,t=>t.slice(0,e.getState().limit))}const ft={show:jie,hide:uF,update:Aie,clean:Oie,cleanQueue:Tie,updateState:Qf},cF=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function Eie(e,t){return e.reduce((n,i)=>(n[i.position||t].push(i),n),cF.reduce((n,i)=>(n[i]=[],n),{}))}const VE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Mie={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Die({state:e,maxHeight:t,position:n,transitionDuration:i}){const[r,a]=n.split("-"),o=a==="center"?`${r}-center`:a,l={opacity:0,maxHeight:t,transform:VE[o],transitionDuration:`${i}ms, ${i}ms, ${i}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},u={opacity:1,transform:Mie[o]},f={opacity:0,maxHeight:0,transform:VE[o]};return{...l,...{entering:u,entered:u,exiting:f,exited:f}[e]}}function Rie(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}function fF({data:e,onHide:t,autoClose:n,paused:i,onHoverStart:r,onHoverEnd:a,...o}){const{autoClose:l,message:u,onOpen:f,...h}=e,d=Rie(n,e.autoClose),p=S.useRef(-1),[g,b]=S.useState(!1),w=()=>window.clearTimeout(p.current),k=()=>{t(e.id),w()},_=()=>{w(),typeof d=="number"&&(p.current=window.setTimeout(k,d))},x=()=>{b(!0),r==null||r()},j=()=>{b(!1),a==null||a()};return S.useEffect(()=>{var T;(T=e.onOpen)==null||T.call(e,e)},[]),S.useEffect(()=>(_(),w),[d]),S.useEffect(()=>(i||g?w():_(),w),[i,g]),v.jsx(n0,{...o,...h,onClose:k,onMouseEnter:x,onMouseLeave:j,children:u})}fF.displayName="@mantine/notifications/NotificationContainer";var dF={root:"m_b37d9ac7",notification:"m_5ed0edd0"};function qS(){return qS=Object.assign?Object.assign.bind():function(e){for(var t=1;t({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":pe(n)}}),So=De(e=>{const t=we("Notifications",Wie,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,attributes:u,position:f,autoClose:h,transitionDuration:d,containerWidth:p,notificationMaxHeight:g,limit:b,zIndex:w,store:k,portalProps:_,withinPortal:x,pauseResetOnHover:j,...T}=t,A=ci(),O=Cie(k),M=tX(),N=Y6(),F=S.useRef({}),R=S.useRef(0),[I,q]=S.useState(0),G=S.useCallback(()=>q(Y=>Y+1),[]),U=S.useCallback(()=>q(Y=>Math.max(0,Y-1)),[]),$=A.respectReducedMotion&&N?1:d,D=Ze({name:"Notifications",classes:dF,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:u,vars:l,varsResolver:pF});S.useEffect(()=>{k==null||k.updateState(Y=>({...Y,limit:b||5,defaultPosition:f}))},[b,f]),ss(()=>{O.notifications.length>R.current&&setTimeout(()=>M(),0),R.current=O.notifications.length},[O.notifications]);const z=Eie(O.notifications,f),H=cF.reduce((Y,P)=>(Y[P]=z[P].map(({style:W,...V})=>v.jsx(Vie,{timeout:$,onEnter:()=>F.current[V.id].offsetHeight,nodeRef:{current:F.current[V.id]},children:L=>v.jsx(fF,{ref:Z=>{Z&&(F.current[V.id]=Z)},data:V,onHide:Z=>uF(Z,k),autoClose:h,paused:j==="all"?I>0:!1,onHoverStart:G,onHoverEnd:U,...D("notification",{style:{...Die({state:L,position:P,transitionDuration:$,maxHeight:g}),...W}})})},V.id)),Y),{});return v.jsxs(yl,{withinPortal:x,..._,children:[v.jsx(fe,{...D("root"),"data-position":"top-center",...T,children:v.jsx(tl,{children:H["top-center"]})}),v.jsx(fe,{...D("root"),"data-position":"top-left",...T,children:v.jsx(tl,{children:H["top-left"]})}),v.jsx(fe,{...D("root",{className:_u.classNames.fullWidth}),"data-position":"top-right",...T,children:v.jsx(tl,{children:H["top-right"]})}),v.jsx(fe,{...D("root",{className:_u.classNames.fullWidth}),"data-position":"bottom-right",...T,children:v.jsx(tl,{children:H["bottom-right"]})}),v.jsx(fe,{...D("root"),"data-position":"bottom-left",...T,children:v.jsx(tl,{children:H["bottom-left"]})}),v.jsx(fe,{...D("root"),"data-position":"bottom-center",...T,children:v.jsx(tl,{children:H["bottom-center"]})})]})});So.classes=dF;So.varsResolver=pF;So.displayName="@mantine/notifications/Notifications";So.show=ft.show;So.hide=ft.hide;So.update=ft.update;So.clean=ft.clean;So.cleanQueue=ft.cleanQueue;So.updateState=ft.updateState;var Hk={exports:{}},dh={},Uk={exports:{}},Vk={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var XE;function Gie(){return XE||(XE=1,(function(e){function t(D,z){var H=D.length;D.push(z);e:for(;0>>1,P=D[Y];if(0>>1;Yr(L,H))Zr(ie,L)?(D[Y]=ie,D[Z]=H,Y=Z):(D[Y]=L,D[V]=H,Y=V);else if(Zr(ie,H))D[Y]=ie,D[Z]=H,Y=Z;else break e}}return z}function r(D,z){var H=D.sortIndex-z.sortIndex;return H!==0?H:D.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],f=[],h=1,d=null,p=3,g=!1,b=!1,w=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function T(D){for(var z=n(f);z!==null;){if(z.callback===null)i(f);else if(z.startTime<=D)i(f),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(f)}}function A(D){if(w=!1,T(D),!b)if(n(u)!==null)b=!0,O||(O=!0,q());else{var z=n(f);z!==null&&$(A,z.startTime-D)}}var O=!1,M=-1,N=5,F=-1;function R(){return k?!0:!(e.unstable_now()-FD&&R());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var P=Y(d.expirationTime<=D);if(D=e.unstable_now(),typeof P=="function"){d.callback=P,T(D),z=!0;break t}d===n(u)&&i(u),T(D)}else i(u);d=n(u)}if(d!==null)z=!0;else{var W=n(f);W!==null&&$(A,W.startTime-D),z=!1}}break e}finally{d=null,p=H,g=!1}z=void 0}}finally{z?q():O=!1}}}var q;if(typeof j=="function")q=function(){j(I)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,U=G.port2;G.port1.onmessage=I,q=function(){U.postMessage(null)}}else q=function(){_(I,0)};function $(D,z){M=_(function(){D(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125Y?(D.sortIndex=H,t(f,D),n(u)===null&&D===n(f)&&(w?(x(M),M=-1):w=!0,$(A,H-Y))):(D.sortIndex=P,t(u,D),b||g||(b=!0,O||(O=!0,q()))),D},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(D){var z=p;return function(){var H=p;p=z;try{return D.apply(this,arguments)}finally{p=H}}}})(Vk)),Vk}var ZE;function Yie(){return ZE||(ZE=1,Uk.exports=Gie()),Uk.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var QE;function Kie(){if(QE)return dh;QE=1;var e=Yie(),t=H6(),n=Lz();function i(s){var c="https://react.dev/errors/"+s;if(1P||(s.current=Y[P],Y[P]=null,P--)}function L(s,c){P++,Y[P]=s.current,s.current=c}var Z=W(null),ie=W(null),re=W(null),X=W(null);function le(s,c){switch(L(re,c),L(ie,s),L(Z,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?X5(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=X5(c),s=Z5(c,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}V(Z),L(Z,s)}function ee(){V(Z),V(ie),V(re)}function se(s){s.memoizedState!==null&&L(X,s);var c=Z.current,m=Z5(c,s.type);c!==m&&(L(ie,s),L(Z,m))}function ke(s){ie.current===s&&(V(Z),V(ie)),X.current===s&&(V(X),ah._currentValue=H)}var ne,$e;function xe(s){if(ne===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);ne=c&&c[1]||"",$e=-1)":-1C||te[y]!==me[C]){var Oe=` +`+te[y].replace(" at new "," at ");return s.displayName&&Oe.includes("")&&(Oe=Oe.replace("",s.displayName)),Oe}while(1<=y&&0<=C);break}}}finally{Ae=!1,Error.prepareStackTrace=m}return(m=s?s.displayName||s.name:"")?xe(m):""}function be(s,c){switch(s.tag){case 26:case 27:case 5:return xe(s.type);case 16:return xe("Lazy");case 13:return s.child!==c&&c!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return ze(s.type,!1);case 11:return ze(s.type.render,!1);case 1:return ze(s.type,!0);case 31:return xe("Activity");default:return""}}function Ce(s){try{var c="",m=null;do c+=be(s,m),m=s,s=s.return;while(s);return c}catch(y){return` +Error generating stack: `+y.message+` +`+y.stack}}var Ne=Object.prototype.hasOwnProperty,de=e.unstable_scheduleCallback,He=e.unstable_cancelCallback,Ye=e.unstable_shouldYield,We=e.unstable_requestPaint,Qe=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,oe=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Ke=e.unstable_NormalPriority,et=e.unstable_LowPriority,je=e.unstable_IdlePriority,rt=e.log,pt=e.unstable_setDisableYieldValue,Dt=null,yt=null;function ot(s){if(typeof rt=="function"&&pt(s),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Dt,s)}catch{}}var tt=Math.clz32?Math.clz32:Fe,Nt=Math.log,Re=Math.LN2;function Fe(s){return s>>>=0,s===0?32:31-(Nt(s)/Re|0)|0}var Vt=256,Tt=262144,gt=4194304;function wt(s){var c=s&42;if(c!==0)return c;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function rn(s,c,m){var y=s.pendingLanes;if(y===0)return 0;var C=0,E=s.suspendedLanes,B=s.pingedLanes;s=s.warmLanes;var K=y&134217727;return K!==0?(y=K&~E,y!==0?C=wt(y):(B&=K,B!==0?C=wt(B):m||(m=K&~s,m!==0&&(C=wt(m))))):(K=y&~E,K!==0?C=wt(K):B!==0?C=wt(B):m||(m=y&~s,m!==0&&(C=wt(m)))),C===0?0:c!==0&&c!==C&&(c&E)===0&&(E=C&-C,m=c&-c,E>=m||E===32&&(m&4194048)!==0)?c:C}function Mn(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function qe(s,c){switch(s){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var s=gt;return gt<<=1,(gt&62914560)===0&&(gt=4194304),s}function zt(s){for(var c=[],m=0;31>m;m++)c.push(s);return c}function an(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Rt(s,c,m,y,C,E){var B=s.pendingLanes;s.pendingLanes=m,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=m,s.entangledLanes&=m,s.errorRecoveryDisabledLanes&=m,s.shellSuspendCounter=0;var K=s.entanglements,te=s.expirationTimes,me=s.hiddenUpdates;for(m=B&~m;0"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var db=/[\n"\\]/g;function ir(s){return s.replace(db,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function yd(s,c,m,y,C,E,B,K){s.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?s.type=B:s.removeAttribute("type"),c!=null?B==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+Gi(c)):s.value!==""+Gi(c)&&(s.value=""+Gi(c)):B!=="submit"&&B!=="reset"||s.removeAttribute("value"),c!=null?Qu(s,B,Gi(c)):m!=null?Qu(s,B,Gi(m)):y!=null&&s.removeAttribute("value"),C==null&&E!=null&&(s.defaultChecked=!!E),C!=null&&(s.checked=C&&typeof C!="function"&&typeof C!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?s.name=""+Gi(K):s.removeAttribute("name")}function Zu(s,c,m,y,C,E,B,K){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.type=E),c!=null||m!=null){if(!(E!=="submit"&&E!=="reset"||c!=null)){Ku(s);return}m=m!=null?""+Gi(m):"",c=c!=null?""+Gi(c):m,K||c===s.value||(s.value=c),s.defaultValue=c}y=y??C,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=K?s.checked:!!y,s.defaultChecked=!!y,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(s.name=B),Ku(s)}function Qu(s,c,m){c==="number"&&Xu(s.ownerDocument)===s||s.defaultValue===""+m||(s.defaultValue=""+m)}function Oo(s,c,m,y){if(s=s.options,c){c={};for(var C=0;C"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ut=!1;if(Ie)try{var Ft={};Object.defineProperty(Ft,"passive",{get:function(){ut=!0}}),window.addEventListener("test",Ft,Ft),window.removeEventListener("test",Ft,Ft)}catch{ut=!1}var Yt=null,Ln=null,si=null;function hr(){if(si)return si;var s,c=Ln,m=c.length,y,C="value"in Yt?Yt.value:Yt.textContent,E=C.length;for(s=0;s=jd),iA=" ",rA=!1;function aA(s,c){switch(s){case"keyup":return QG.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ic=!1;function eY(s,c){switch(s){case"compositionend":return oA(c);case"keypress":return c.which!==32?null:(rA=!0,iA);case"textInput":return s=c.data,s===iA&&rA?null:s;default:return null}}function tY(s,c){if(ic)return s==="compositionend"||!gb&&aA(s,c)?(s=hr(),si=Ln=Yt=null,ic=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:m,offset:c-s};s=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=mA(m)}}function vA(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?vA(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function gA(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=Xu(s.document);c instanceof s.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)s=c.contentWindow;else break;c=Xu(s.document)}return c}function wb(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}var uY=Ie&&"documentMode"in document&&11>=document.documentMode,rc=null,kb=null,Ed=null,_b=!1;function yA(s,c,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;_b||rc==null||rc!==Xu(y)||(y=rc,"selectionStart"in y&&wb(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Ed&&Td(Ed,y)||(Ed=y,y=Tv(kb,"onSelect"),0>=B,C-=B,Qa=1<<32-tt(c)+C|m<qt?(sn=ht,ht=null):sn=ht.sibling;var pn=ve(ue,ht,he[qt],Ee);if(pn===null){ht===null&&(ht=sn);break}s&&ht&&pn.alternate===null&&c(ue,ht),ae=E(pn,ae,qt),mn===null?bt=pn:mn.sibling=pn,mn=pn,ht=sn}if(qt===he.length)return m(ue,ht),un&&Mo(ue,qt),bt;if(ht===null){for(;qtqt?(sn=ht,ht=null):sn=ht.sibling;var Xs=ve(ue,ht,pn.value,Ee);if(Xs===null){ht===null&&(ht=sn);break}s&&ht&&Xs.alternate===null&&c(ue,ht),ae=E(Xs,ae,qt),mn===null?bt=Xs:mn.sibling=Xs,mn=Xs,ht=sn}if(pn.done)return m(ue,ht),un&&Mo(ue,qt),bt;if(ht===null){for(;!pn.done;qt++,pn=he.next())pn=Me(ue,pn.value,Ee),pn!==null&&(ae=E(pn,ae,qt),mn===null?bt=pn:mn.sibling=pn,mn=pn);return un&&Mo(ue,qt),bt}for(ht=y(ht);!pn.done;qt++,pn=he.next())pn=Se(ht,ue,qt,pn.value,Ee),pn!==null&&(s&&pn.alternate!==null&&ht.delete(pn.key===null?qt:pn.key),ae=E(pn,ae,qt),mn===null?bt=pn:mn.sibling=pn,mn=pn);return s&&ht.forEach(function(TK){return c(ue,TK)}),un&&Mo(ue,qt),bt}function An(ue,ae,he,Ee){if(typeof he=="object"&&he!==null&&he.type===w&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case g:e:{for(var bt=he.key;ae!==null;){if(ae.key===bt){if(bt=he.type,bt===w){if(ae.tag===7){m(ue,ae.sibling),Ee=C(ae,he.props.children),Ee.return=ue,ue=Ee;break e}}else if(ae.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===N&&Gl(bt)===ae.type){m(ue,ae.sibling),Ee=C(ae,he.props),$d(Ee,he),Ee.return=ue,ue=Ee;break e}m(ue,ae);break}else c(ue,ae);ae=ae.sibling}he.type===w?(Ee=ql(he.props.children,ue.mode,Ee,he.key),Ee.return=ue,ue=Ee):(Ee=Wp(he.type,he.key,he.props,null,ue.mode,Ee),$d(Ee,he),Ee.return=ue,ue=Ee)}return B(ue);case b:e:{for(bt=he.key;ae!==null;){if(ae.key===bt)if(ae.tag===4&&ae.stateNode.containerInfo===he.containerInfo&&ae.stateNode.implementation===he.implementation){m(ue,ae.sibling),Ee=C(ae,he.children||[]),Ee.return=ue,ue=Ee;break e}else{m(ue,ae);break}else c(ue,ae);ae=ae.sibling}Ee=Tb(he,ue.mode,Ee),Ee.return=ue,ue=Ee}return B(ue);case N:return he=Gl(he),An(ue,ae,he,Ee)}if($(he))return ct(ue,ae,he,Ee);if(q(he)){if(bt=q(he),typeof bt!="function")throw Error(i(150));return he=bt.call(he),St(ue,ae,he,Ee)}if(typeof he.then=="function")return An(ue,ae,Jp(he),Ee);if(he.$$typeof===j)return An(ue,ae,Kp(ue,he),Ee);ev(ue,he)}return typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint"?(he=""+he,ae!==null&&ae.tag===6?(m(ue,ae.sibling),Ee=C(ae,he),Ee.return=ue,ue=Ee):(m(ue,ae),Ee=Ob(he,ue.mode,Ee),Ee.return=ue,ue=Ee),B(ue)):m(ue,ae)}return function(ue,ae,he,Ee){try{Nd=0;var bt=An(ue,ae,he,Ee);return pc=null,bt}catch(ht){if(ht===mc||ht===Zp)throw ht;var mn=Dr(29,ht,null,ue.mode);return mn.lanes=Ee,mn.return=ue,mn}finally{}}}var Kl=FA(!0),qA=FA(!1),Rs=!1;function Fb(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qb(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ps(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ns(s,c,m){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(yn&2)!==0){var C=y.pending;return C===null?c.next=c:(c.next=C.next,C.next=c),y.pending=c,c=Vp(s),CA(s,null,m),c}return Up(s,y,c,m),Vp(s)}function zd(s,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194048)!==0)){var y=c.lanes;y&=s.pendingLanes,m|=y,c.lanes=m,at(s,m)}}function Hb(s,c){var m=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var B={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};E===null?C=E=B:E=E.next=B,m=m.next}while(m!==null);E===null?C=E=c:E=E.next=c}else C=E=c;m={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:y.shared,callbacks:y.callbacks},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=c:s.next=c,m.lastBaseUpdate=c}var Ub=!1;function Ld(){if(Ub){var s=hc;if(s!==null)throw s}}function Id(s,c,m,y){Ub=!1;var C=s.updateQueue;Rs=!1;var E=C.firstBaseUpdate,B=C.lastBaseUpdate,K=C.shared.pending;if(K!==null){C.shared.pending=null;var te=K,me=te.next;te.next=null,B===null?E=me:B.next=me,B=te;var Oe=s.alternate;Oe!==null&&(Oe=Oe.updateQueue,K=Oe.lastBaseUpdate,K!==B&&(K===null?Oe.firstBaseUpdate=me:K.next=me,Oe.lastBaseUpdate=te))}if(E!==null){var Me=C.baseState;B=0,Oe=me=te=null,K=E;do{var ve=K.lane&-536870913,Se=ve!==K.lane;if(Se?(on&ve)===ve:(y&ve)===ve){ve!==0&&ve===dc&&(Ub=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var ct=s,St=K;ve=c;var An=m;switch(St.tag){case 1:if(ct=St.payload,typeof ct=="function"){Me=ct.call(An,Me,ve);break e}Me=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=St.payload,ve=typeof ct=="function"?ct.call(An,Me,ve):ct,ve==null)break e;Me=d({},Me,ve);break e;case 2:Rs=!0}}ve=K.callback,ve!==null&&(s.flags|=64,Se&&(s.flags|=8192),Se=C.callbacks,Se===null?C.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Oe===null?(me=Oe=Se,te=Me):Oe=Oe.next=Se,B|=ve;if(K=K.next,K===null){if(K=C.shared.pending,K===null)break;Se=K,K=Se.next,Se.next=null,C.lastBaseUpdate=Se,C.shared.pending=null}}while(!0);Oe===null&&(te=Me),C.baseState=te,C.firstBaseUpdate=me,C.lastBaseUpdate=Oe,E===null&&(C.shared.lanes=0),Bs|=B,s.lanes=B,s.memoizedState=Me}}function HA(s,c){if(typeof s!="function")throw Error(i(191,s));s.call(c)}function UA(s,c){var m=s.callbacks;if(m!==null)for(s.callbacks=null,s=0;sE?E:8;var B=D.T,K={};D.T=K,uw(s,!1,c,m);try{var te=C(),me=D.S;if(me!==null&&me(K,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var Oe=yY(te,y);qd(s,c,Oe,zr(s))}else qd(s,c,y,zr(s))}catch(Me){qd(s,c,{then:function(){},status:"rejected",reason:Me},zr())}finally{z.p=E,B!==null&&K.types!==null&&(B.types=K.types),D.T=B}}function SY(){}function sw(s,c,m,y){if(s.tag!==5)throw Error(i(476));var C=_O(s).queue;kO(s,C,c,H,m===null?SY:function(){return xO(s),m(y)})}function _O(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:H},next:null};var m={};return c.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:m},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function xO(s){var c=_O(s);c.next===null&&(c=s.alternate.memoizedState),qd(s,c.next.queue,{},zr())}function lw(){return Li(ah)}function SO(){return ui().memoizedState}function CO(){return ui().memoizedState}function CY(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var m=zr();s=Ps(m);var y=Ns(c,s,m);y!==null&&(yr(y,c,m),zd(y,c,m)),c={cache:zb()},s.payload=c;return}c=c.return}}function jY(s,c,m){var y=zr();m={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},cv(s)?AO(c,m):(m=jb(s,c,m,y),m!==null&&(yr(m,s,y),OO(m,c,y)))}function jO(s,c,m){var y=zr();qd(s,c,m,y)}function qd(s,c,m,y){var C={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(cv(s))AO(c,C);else{var E=s.alternate;if(s.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var B=c.lastRenderedState,K=E(B,m);if(C.hasEagerState=!0,C.eagerState=K,Mr(K,B))return Up(s,c,C,0),Rn===null&&Hp(),!1}catch{}finally{}if(m=jb(s,c,C,y),m!==null)return yr(m,s,y),OO(m,c,y),!0}return!1}function uw(s,c,m,y){if(y={lane:2,revertLane:Fw(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},cv(s)){if(c)throw Error(i(479))}else c=jb(s,m,y,2),c!==null&&yr(c,s,2)}function cv(s){var c=s.alternate;return s===Lt||c!==null&&c===Lt}function AO(s,c){gc=iv=!0;var m=s.pending;m===null?c.next=c:(c.next=m.next,m.next=c),s.pending=c}function OO(s,c,m){if((m&4194048)!==0){var y=c.lanes;y&=s.pendingLanes,m|=y,c.lanes=m,at(s,m)}}var Hd={readContext:Li,use:ov,useCallback:ni,useContext:ni,useEffect:ni,useImperativeHandle:ni,useLayoutEffect:ni,useInsertionEffect:ni,useMemo:ni,useReducer:ni,useRef:ni,useState:ni,useDebugValue:ni,useDeferredValue:ni,useTransition:ni,useSyncExternalStore:ni,useId:ni,useHostTransitionStatus:ni,useFormState:ni,useActionState:ni,useOptimistic:ni,useMemoCache:ni,useCacheRefresh:ni};Hd.useEffectEvent=ni;var TO={readContext:Li,use:ov,useCallback:function(s,c){return rr().memoizedState=[s,c===void 0?null:c],s},useContext:Li,useEffect:dO,useImperativeHandle:function(s,c,m){m=m!=null?m.concat([s]):null,lv(4194308,4,vO.bind(null,c,s),m)},useLayoutEffect:function(s,c){return lv(4194308,4,s,c)},useInsertionEffect:function(s,c){lv(4,2,s,c)},useMemo:function(s,c){var m=rr();c=c===void 0?null:c;var y=s();if(Xl){ot(!0);try{s()}finally{ot(!1)}}return m.memoizedState=[y,c],y},useReducer:function(s,c,m){var y=rr();if(m!==void 0){var C=m(c);if(Xl){ot(!0);try{m(c)}finally{ot(!1)}}}else C=c;return y.memoizedState=y.baseState=C,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:C},y.queue=s,s=s.dispatch=jY.bind(null,Lt,s),[y.memoizedState,s]},useRef:function(s){var c=rr();return s={current:s},c.memoizedState=s},useState:function(s){s=nw(s);var c=s.queue,m=jO.bind(null,Lt,c);return c.dispatch=m,[s.memoizedState,m]},useDebugValue:aw,useDeferredValue:function(s,c){var m=rr();return ow(m,s,c)},useTransition:function(){var s=nw(!1);return s=kO.bind(null,Lt,s.queue,!0,!1),rr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,m){var y=Lt,C=rr();if(un){if(m===void 0)throw Error(i(407));m=m()}else{if(m=c(),Rn===null)throw Error(i(349));(on&127)!==0||XA(y,c,m)}C.memoizedState=m;var E={value:m,getSnapshot:c};return C.queue=E,dO(QA.bind(null,y,E,s),[s]),y.flags|=2048,bc(9,{destroy:void 0},ZA.bind(null,y,E,m,c),null),m},useId:function(){var s=rr(),c=Rn.identifierPrefix;if(un){var m=Ja,y=Qa;m=(y&~(1<<32-tt(y)-1)).toString(32)+m,c="_"+c+"R_"+m,m=rv++,0<\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof y.is=="string"?B.createElement("select",{is:y.is}):B.createElement("select"),y.multiple?E.multiple=!0:y.size&&(E.size=y.size);break;default:E=typeof y.is=="string"?B.createElement(C,{is:y.is}):B.createElement(C)}}E[Xt]=c,E[zn]=y;e:for(B=c.child;B!==null;){if(B.tag===5||B.tag===6)E.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===c)break e;for(;B.sibling===null;){if(B.return===null||B.return===c)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}c.stateNode=E;e:switch(Bi(E,C,y),C){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&zo(c)}}return Vn(c),xw(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,m),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==y&&zo(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(i(166));if(s=re.current,cc(c)){if(s=c.stateNode,m=c.memoizedProps,y=null,C=zi,C!==null)switch(C.tag){case 27:case 5:y=C.memoizedProps}s[Xt]=c,s=!!(s.nodeValue===m||y!==null&&y.suppressHydrationWarning===!0||Y5(s.nodeValue,m)),s||Ms(c,!0)}else s=Ev(s).createTextNode(y),s[Xt]=c,c.stateNode=s}return Vn(c),null;case 31:if(m=c.memoizedState,s===null||s.memoizedState!==null){if(y=cc(c),m!==null){if(s===null){if(!y)throw Error(i(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Xt]=c}else Hl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Vn(c),s=!1}else m=Rb(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),s=!0;if(!s)return c.flags&256?(Pr(c),c):(Pr(c),null);if((c.flags&128)!==0)throw Error(i(558))}return Vn(c),null;case 13:if(y=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(C=cc(c),y!==null&&y.dehydrated!==null){if(s===null){if(!C)throw Error(i(318));if(C=c.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));C[Xt]=c}else Hl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Vn(c),C=!1}else C=Rb(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=C),C=!0;if(!C)return c.flags&256?(Pr(c),c):(Pr(c),null)}return Pr(c),(c.flags&128)!==0?(c.lanes=m,c):(m=y!==null,s=s!==null&&s.memoizedState!==null,m&&(y=c.child,C=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(C=y.alternate.memoizedState.cachePool.pool),E=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(E=y.memoizedState.cachePool.pool),E!==C&&(y.flags|=2048)),m!==s&&m&&(c.child.flags|=8192),pv(c,c.updateQueue),Vn(c),null);case 4:return ee(),s===null&&Vw(c.stateNode.containerInfo),Vn(c),null;case 10:return Ro(c.type),Vn(c),null;case 19:if(V(li),y=c.memoizedState,y===null)return Vn(c),null;if(C=(c.flags&128)!==0,E=y.rendering,E===null)if(C)Vd(y,!1);else{if(ii!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(E=nv(s),E!==null){for(c.flags|=128,Vd(y,!1),s=E.updateQueue,c.updateQueue=s,pv(c,s),c.subtreeFlags=0,s=m,m=c.child;m!==null;)jA(m,s),m=m.sibling;return L(li,li.current&1|2),un&&Mo(c,y.treeForkCount),c.child}s=s.sibling}y.tail!==null&&Qe()>wv&&(c.flags|=128,C=!0,Vd(y,!1),c.lanes=4194304)}else{if(!C)if(s=nv(E),s!==null){if(c.flags|=128,C=!0,s=s.updateQueue,c.updateQueue=s,pv(c,s),Vd(y,!0),y.tail===null&&y.tailMode==="hidden"&&!E.alternate&&!un)return Vn(c),null}else 2*Qe()-y.renderingStartTime>wv&&m!==536870912&&(c.flags|=128,C=!0,Vd(y,!1),c.lanes=4194304);y.isBackwards?(E.sibling=c.child,c.child=E):(s=y.last,s!==null?s.sibling=E:c.child=E,y.last=E)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=Qe(),s.sibling=null,m=li.current,L(li,C?m&1|2:m&1),un&&Mo(c,y.treeForkCount),s):(Vn(c),null);case 22:case 23:return Pr(c),Wb(),y=c.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(m&536870912)!==0&&(c.flags&128)===0&&(Vn(c),c.subtreeFlags&6&&(c.flags|=8192)):Vn(c),m=c.updateQueue,m!==null&&pv(c,m.retryQueue),m=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==m&&(c.flags|=2048),s!==null&&V(Wl),null;case 24:return m=null,s!==null&&(m=s.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),Ro(hi),Vn(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function MY(s,c){switch(Mb(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return Ro(hi),ee(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return ke(c),null;case 31:if(c.memoizedState!==null){if(Pr(c),c.alternate===null)throw Error(i(340));Hl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(Pr(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Hl()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return V(li),null;case 4:return ee(),null;case 10:return Ro(c.type),null;case 22:case 23:return Pr(c),Wb(),s!==null&&V(Wl),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return Ro(hi),null;case 25:return null;default:return null}}function JO(s,c){switch(Mb(c),c.tag){case 3:Ro(hi),ee();break;case 26:case 27:case 5:ke(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&Pr(c);break;case 13:Pr(c);break;case 19:V(li);break;case 10:Ro(c.type);break;case 22:case 23:Pr(c),Wb(),s!==null&&V(Wl);break;case 24:Ro(hi)}}function Wd(s,c){try{var m=c.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var C=y.next;m=C;do{if((m.tag&s)===s){y=void 0;var E=m.create,B=m.inst;y=E(),B.destroy=y}m=m.next}while(m!==C)}}catch(K){xn(c,c.return,K)}}function Ls(s,c,m){try{var y=c.updateQueue,C=y!==null?y.lastEffect:null;if(C!==null){var E=C.next;y=E;do{if((y.tag&s)===s){var B=y.inst,K=B.destroy;if(K!==void 0){B.destroy=void 0,C=c;var te=m,me=K;try{me()}catch(Oe){xn(C,te,Oe)}}}y=y.next}while(y!==E)}}catch(Oe){xn(c,c.return,Oe)}}function e5(s){var c=s.updateQueue;if(c!==null){var m=s.stateNode;try{UA(c,m)}catch(y){xn(s,s.return,y)}}}function t5(s,c,m){m.props=Zl(s.type,s.memoizedProps),m.state=s.memoizedState;try{m.componentWillUnmount()}catch(y){xn(s,c,y)}}function Gd(s,c){try{var m=s.ref;if(m!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof m=="function"?s.refCleanup=m(y):m.current=y}}catch(C){xn(s,c,C)}}function eo(s,c){var m=s.ref,y=s.refCleanup;if(m!==null)if(typeof y=="function")try{y()}catch(C){xn(s,c,C)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(C){xn(s,c,C)}else m.current=null}function n5(s){var c=s.type,m=s.memoizedProps,y=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":m.autoFocus&&y.focus();break e;case"img":m.src?y.src=m.src:m.srcSet&&(y.srcset=m.srcSet)}}catch(C){xn(s,s.return,C)}}function Sw(s,c,m){try{var y=s.stateNode;JY(y,s.type,m,c),y[zn]=c}catch(C){xn(s,s.return,C)}}function i5(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Vs(s.type)||s.tag===4}function Cw(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||i5(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Vs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function jw(s,c,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(s,c):(c=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,c.appendChild(s),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=Ta));else if(y!==4&&(y===27&&Vs(s.type)&&(m=s.stateNode,c=null),s=s.child,s!==null))for(jw(s,c,m),s=s.sibling;s!==null;)jw(s,c,m),s=s.sibling}function vv(s,c,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,c?m.insertBefore(s,c):m.appendChild(s);else if(y!==4&&(y===27&&Vs(s.type)&&(m=s.stateNode),s=s.child,s!==null))for(vv(s,c,m),s=s.sibling;s!==null;)vv(s,c,m),s=s.sibling}function r5(s){var c=s.stateNode,m=s.memoizedProps;try{for(var y=s.type,C=c.attributes;C.length;)c.removeAttributeNode(C[0]);Bi(c,y,m),c[Xt]=s,c[zn]=m}catch(E){xn(s,s.return,E)}}var Lo=!1,vi=!1,Aw=!1,a5=typeof WeakSet=="function"?WeakSet:Set,Mi=null;function DY(s,c){if(s=s.containerInfo,Yw=zv,s=gA(s),wb(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var C=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var B=0,K=-1,te=-1,me=0,Oe=0,Me=s,ve=null;t:for(;;){for(var Se;Me!==m||C!==0&&Me.nodeType!==3||(K=B+C),Me!==E||y!==0&&Me.nodeType!==3||(te=B+y),Me.nodeType===3&&(B+=Me.nodeValue.length),(Se=Me.firstChild)!==null;)ve=Me,Me=Se;for(;;){if(Me===s)break t;if(ve===m&&++me===C&&(K=B),ve===E&&++Oe===y&&(te=B),(Se=Me.nextSibling)!==null)break;Me=ve,ve=Me.parentNode}Me=Se}m=K===-1||te===-1?null:{start:K,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Kw={focusedElem:s,selectionRange:m},zv=!1,Mi=c;Mi!==null;)if(c=Mi,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Mi=s;else for(;Mi!==null;){switch(c=Mi,E=c.alternate,s=c.flags,c.tag){case 0:if((s&4)!==0&&(s=c.updateQueue,s=s!==null?s.events:null,s!==null))for(m=0;m title"))),Bi(E,y,m),E[Xt]=s,dt(E),y=E;break e;case"link":var B=fT("link","href",C).get(y+(m.href||""));if(B){for(var K=0;KAn&&(B=An,An=St,St=B);var ue=pA(K,St),ae=pA(K,An);if(ue&&ae&&(Se.rangeCount!==1||Se.anchorNode!==ue.node||Se.anchorOffset!==ue.offset||Se.focusNode!==ae.node||Se.focusOffset!==ae.offset)){var he=Me.createRange();he.setStart(ue.node,ue.offset),Se.removeAllRanges(),St>An?(Se.addRange(he),Se.extend(ae.node,ae.offset)):(he.setEnd(ae.node,ae.offset),Se.addRange(he))}}}}for(Me=[],Se=K;Se=Se.parentNode;)Se.nodeType===1&&Me.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;Km?32:m,D.T=null,m=Pw,Pw=null;var E=qs,B=Ho;if(ki=0,Sc=qs=null,Ho=0,(yn&6)!==0)throw Error(i(331));var K=yn;if(yn|=4,v5(E.current),h5(E,E.current,B,m),yn=K,Jd(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Dt,E)}catch{}return!0}finally{z.p=C,D.T=y,P5(s,c)}}function $5(s,c,m){c=ea(m,c),c=hw(s.stateNode,c,2),s=Ns(s,c,2),s!==null&&(an(s,2),to(s))}function xn(s,c,m){if(s.tag===3)$5(s,s,m);else for(;c!==null;){if(c.tag===3){$5(c,s,m);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fs===null||!Fs.has(y))){s=ea(m,s),m=zO(2),y=Ns(c,m,2),y!==null&&(LO(m,y,c,s),an(y,2),to(y));break}}c=c.return}}function Lw(s,c,m){var y=s.pingCache;if(y===null){y=s.pingCache=new NY;var C=new Set;y.set(c,C)}else C=y.get(c),C===void 0&&(C=new Set,y.set(c,C));C.has(m)||(Ew=!0,C.add(m),s=BY.bind(null,s,c,m),c.then(s,s))}function BY(s,c,m){var y=s.pingCache;y!==null&&y.delete(c),s.pingedLanes|=s.suspendedLanes&m,s.warmLanes&=~m,Rn===s&&(on&m)===m&&(ii===4||ii===3&&(on&62914560)===on&&300>Qe()-bv?(yn&2)===0&&Cc(s,0):Mw|=m,xc===on&&(xc=0)),to(s)}function z5(s,c){c===0&&(c=Ue()),s=Fl(s,c),s!==null&&(an(s,c),to(s))}function FY(s){var c=s.memoizedState,m=0;c!==null&&(m=c.retryLane),z5(s,m)}function qY(s,c){var m=0;switch(s.tag){case 31:case 13:var y=s.stateNode,C=s.memoizedState;C!==null&&(m=C.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(i(314))}y!==null&&y.delete(c),z5(s,m)}function HY(s,c){return de(s,c)}var jv=null,Ac=null,Iw=!1,Av=!1,Bw=!1,Us=0;function to(s){s!==Ac&&s.next===null&&(Ac===null?jv=Ac=s:Ac=Ac.next=s),Av=!0,Iw||(Iw=!0,VY())}function Jd(s,c){if(!Bw&&Av){Bw=!0;do for(var m=!1,y=jv;y!==null;){if(s!==0){var C=y.pendingLanes;if(C===0)var E=0;else{var B=y.suspendedLanes,K=y.pingedLanes;E=(1<<31-tt(42|s)+1)-1,E&=C&~(B&~K),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(m=!0,F5(y,E))}else E=on,E=rn(y,y===Rn?E:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(E&3)===0||Mn(y,E)||(m=!0,F5(y,E));y=y.next}while(m);Bw=!1}}function UY(){L5()}function L5(){Av=Iw=!1;var s=0;Us!==0&&tK()&&(s=Us);for(var c=Qe(),m=null,y=jv;y!==null;){var C=y.next,E=I5(y,c);E===0?(y.next=null,m===null?jv=C:m.next=C,C===null&&(Ac=m)):(m=y,(s!==0||(E&3)!==0)&&(Av=!0)),y=C}ki!==0&&ki!==5||Jd(s),Us!==0&&(Us=0)}function I5(s,c){for(var m=s.suspendedLanes,y=s.pingedLanes,C=s.expirationTimes,E=s.pendingLanes&-62914561;0K)break;var Oe=te.transferSize,Me=te.initiatorType;Oe&&K5(Me)&&(te=te.responseEnd,B+=Oe*(te"u"?null:document;function sT(s,c,m){var y=Oc;if(y&&typeof c=="string"&&c){var C=ir(c);C='link[rel="'+s+'"][href="'+C+'"]',typeof m=="string"&&(C+='[crossorigin="'+m+'"]'),oT.has(C)||(oT.add(C),s={rel:s,crossOrigin:m,href:c},y.querySelector(C)===null&&(c=y.createElement("link"),Bi(c,"link",s),dt(c),y.head.appendChild(c)))}}function cK(s){Uo.D(s),sT("dns-prefetch",s,null)}function fK(s,c){Uo.C(s,c),sT("preconnect",s,c)}function dK(s,c,m){Uo.L(s,c,m);var y=Oc;if(y&&s&&c){var C='link[rel="preload"][as="'+ir(c)+'"]';c==="image"&&m&&m.imageSrcSet?(C+='[imagesrcset="'+ir(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(C+='[imagesizes="'+ir(m.imageSizes)+'"]')):C+='[href="'+ir(s)+'"]';var E=C;switch(c){case"style":E=Tc(s);break;case"script":E=Ec(s)}oa.has(E)||(s=d({rel:"preload",href:c==="image"&&m&&m.imageSrcSet?void 0:s,as:c},m),oa.set(E,s),y.querySelector(C)!==null||c==="style"&&y.querySelector(ih(E))||c==="script"&&y.querySelector(rh(E))||(c=y.createElement("link"),Bi(c,"link",s),dt(c),y.head.appendChild(c)))}}function hK(s,c){Uo.m(s,c);var m=Oc;if(m&&s){var y=c&&typeof c.as=="string"?c.as:"script",C='link[rel="modulepreload"][as="'+ir(y)+'"][href="'+ir(s)+'"]',E=C;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=Ec(s)}if(!oa.has(E)&&(s=d({rel:"modulepreload",href:s},c),oa.set(E,s),m.querySelector(C)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(rh(E)))return}y=m.createElement("link"),Bi(y,"link",s),dt(y),m.head.appendChild(y)}}}function mK(s,c,m){Uo.S(s,c,m);var y=Oc;if(y&&s){var C=fi(y).hoistableStyles,E=Tc(s);c=c||"default";var B=C.get(E);if(!B){var K={loading:0,preload:null};if(B=y.querySelector(ih(E)))K.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":c},m),(m=oa.get(E))&&nk(s,m);var te=B=y.createElement("link");dt(te),Bi(te,"link",s),te._p=new Promise(function(me,Oe){te.onload=me,te.onerror=Oe}),te.addEventListener("load",function(){K.loading|=1}),te.addEventListener("error",function(){K.loading|=2}),K.loading|=4,Dv(B,c,y)}B={type:"stylesheet",instance:B,count:1,state:K},C.set(E,B)}}}function pK(s,c){Uo.X(s,c);var m=Oc;if(m&&s){var y=fi(m).hoistableScripts,C=Ec(s),E=y.get(C);E||(E=m.querySelector(rh(C)),E||(s=d({src:s,async:!0},c),(c=oa.get(C))&&ik(s,c),E=m.createElement("script"),dt(E),Bi(E,"link",s),m.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},y.set(C,E))}}function vK(s,c){Uo.M(s,c);var m=Oc;if(m&&s){var y=fi(m).hoistableScripts,C=Ec(s),E=y.get(C);E||(E=m.querySelector(rh(C)),E||(s=d({src:s,async:!0,type:"module"},c),(c=oa.get(C))&&ik(s,c),E=m.createElement("script"),dt(E),Bi(E,"link",s),m.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},y.set(C,E))}}function lT(s,c,m,y){var C=(C=re.current)?Mv(C):null;if(!C)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(c=Tc(m.href),m=fi(C).hoistableStyles,y=m.get(c),y||(y={type:"style",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){s=Tc(m.href);var E=fi(C).hoistableStyles,B=E.get(s);if(B||(C=C.ownerDocument||C,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(s,B),(E=C.querySelector(ih(s)))&&!E._p&&(B.instance=E,B.state.loading=5),oa.has(s)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},oa.set(s,m),E||gK(C,s,m,B.state))),c&&y===null)throw Error(i(528,""));return B}if(c&&y!==null)throw Error(i(529,""));return null;case"script":return c=m.async,m=m.src,typeof m=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ec(m),m=fi(C).hoistableScripts,y=m.get(c),y||(y={type:"script",instance:null,count:0,state:null},m.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function Tc(s){return'href="'+ir(s)+'"'}function ih(s){return'link[rel="stylesheet"]['+s+"]"}function uT(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function gK(s,c,m,y){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=s.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),Bi(c,"link",m),dt(c),s.head.appendChild(c))}function Ec(s){return'[src="'+ir(s)+'"]'}function rh(s){return"script[async]"+s}function cT(s,c,m){if(c.count++,c.instance===null)switch(c.type){case"style":var y=s.querySelector('style[data-href~="'+ir(m.href)+'"]');if(y)return c.instance=y,dt(y),y;var C=d({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),dt(y),Bi(y,"style",C),Dv(y,m.precedence,s),c.instance=y;case"stylesheet":C=Tc(m.href);var E=s.querySelector(ih(C));if(E)return c.state.loading|=4,c.instance=E,dt(E),E;y=uT(m),(C=oa.get(C))&&nk(y,C),E=(s.ownerDocument||s).createElement("link"),dt(E);var B=E;return B._p=new Promise(function(K,te){B.onload=K,B.onerror=te}),Bi(E,"link",y),c.state.loading|=4,Dv(E,m.precedence,s),c.instance=E;case"script":return E=Ec(m.src),(C=s.querySelector(rh(E)))?(c.instance=C,dt(C),C):(y=m,(C=oa.get(E))&&(y=d({},m),ik(y,C)),s=s.ownerDocument||s,C=s.createElement("script"),dt(C),Bi(C,"link",y),s.head.appendChild(C),c.instance=C);case"void":return null;default:throw Error(i(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Dv(y,m.precedence,s));return c.instance}function Dv(s,c,m){for(var y=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=y.length?y[y.length-1]:null,E=C,B=0;B title"):null)}function yK(s,c,m){if(m===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function hT(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function bK(s,c,m,y){if(m.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var C=Tc(y.href),E=c.querySelector(ih(C));if(E){c=E._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Pv.bind(s),c.then(s,s)),m.state.loading|=4,m.instance=E,dt(E);return}E=c.ownerDocument||c,y=uT(y),(C=oa.get(C))&&nk(y,C),E=E.createElement("link"),dt(E);var B=E;B._p=new Promise(function(K,te){B.onload=K,B.onerror=te}),Bi(E,"link",y),m.instance=E}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(m,c),(c=m.state.preload)&&(m.state.loading&3)===0&&(s.count++,m=Pv.bind(s),c.addEventListener("load",m),c.addEventListener("error",m))}}var rk=0;function wK(s,c){return s.stylesheets&&s.count===0&&$v(s,s.stylesheets),0rk?50:800)+c);return s.unsuspend=m,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(C)}}:null}function Pv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$v(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Nv=null;function $v(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Nv=new Map,c.forEach(kK,s),Nv=null,Pv.call(s))}function kK(s,c){if(!(c.state.loading&4)){var m=Nv.get(s);if(m)var y=m.get(null);else{m=new Map,Nv.set(s,m);for(var C=s.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hk.exports=Kie(),Hk.exports}var Zie=Xie();class u9 extends Error{constructor(t,n){super(n),this.status=t,this.name="HTTPError"}}async function Qie(e,t,n){const i=await fetch(`${n}${e}`,{credentials:"include",...t,headers:{"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!i.ok){const r=await i.json().catch(()=>({Message:i.statusText}));throw new u9(i.status,r.Message??r.message??i.statusText)}if(i.status!==204)return i.json()}const vF="/api";function _t(e,t){return Qie(e,t,vF)}function eM(){return _t("/board")}function Jie(){return _t("/flags")}function gF(){return _t("/version")}function ere(e){return _t("/columns",{method:"POST",body:JSON.stringify({name:e})})}function nu(e,t){return _t(`/columns/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function tre(e){return _t(`/columns/${e}`,{method:"DELETE"})}function nre(e){return _t("/columns/reorder",{method:"POST",body:JSON.stringify({ids:e})})}function ire(e){return _t("/cards",{method:"POST",body:JSON.stringify(e)})}function $c(e,t){return _t(`/cards/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function rre(e){return _t(`/cards/${e}`,{method:"DELETE"})}function Wk(e,t){return _t(`/cards/${e}/stickers`,{method:"PUT",body:JSON.stringify({stickers:t})})}function tM(){return _t("/trash")}function are(e){return _t(`/cards/${e}/restore`,{method:"POST"})}function ore(e){return _t(`/cards/${e}/purge`,{method:"DELETE"})}function nM(){return _t("/archive")}function sre(e){return _t(`/cards/${e}/archive`,{method:"POST"})}function lre(e){return _t(`/cards/${e}/unarchive`,{method:"POST"})}function ure(e,t){const n=new URLSearchParams({date:e});return _t(`/reports/daily?${n.toString()}`)}function cre(e){return _t(`/reports/daily/summary?date=${encodeURIComponent(e)}`)}function fre(e,t){const n=new URLSearchParams({date:e});return _t(`/reports/daily/summary?${n.toString()}`,{method:"POST"})}function dre(e){return _t(`/settings/${encodeURIComponent(e)}`)}function hre(e,t){return _t(`/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}function mre(e,t,n){return _t(`/cards/${e}/move`,{method:"POST",body:JSON.stringify({column_id:t,ordered_ids:n})})}function pre(e){return _t(`/cards/${e}/history`)}function vre(e){return _t(`/cards/${e}/messages`)}function iM(e,t){return _t(`/cards/${e}/messages`,{method:"POST",body:JSON.stringify({body:t})})}function gre(e,t){return _t(`/cards/${e}/messages/${t}`,{method:"DELETE"})}function yre(e){return _t(`/cards/${e}/duplicate`,{method:"POST"})}function bre(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/chat/ws`}function wre(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/cards/${e}/chat/ws`}function yF(e=!1){return _t(`/notifications${e?"?unread=1":""}`)}function bF(){return _t("/notifications/unread-count")}function kre(e){return _t(`/notifications/${e}/read`,{method:"POST"})}function _re(){return _t("/notifications/read-all",{method:"POST"})}function xre(){return _t("/modules")}function Sre(e){return _t("/modules",{method:"POST",body:JSON.stringify(e)})}function Cre(e,t){return _t(`/modules/${e}`,{method:"PATCH",body:JSON.stringify(t)})}function jre(e){return _t(`/modules/${e}`,{method:"DELETE"})}function Are(e,t=100){return _t(`/modules/${e}/logs?limit=${t}`)}function rM(e,t){const n={method:"POST"};return t&&(n.body=JSON.stringify(t)),_t(`/modules/${e}/test`,n)}function Ore(e,t,n){return new Promise((i,r)=>{const a=new WebSocket(bre());let o=!1;const l=u=>{if(!o){o=!0;try{a.close()}catch{}u?r(u):i()}};a.onopen=()=>{a.send(JSON.stringify({messages:e}))},a.onmessage=u=>{try{const f=JSON.parse(typeof u.data=="string"?u.data:"");t(f),(f.type==="done"||f.type==="error")&&l(f.type==="error"?new Error(f.error):void 0)}catch(f){l(f)}},a.onerror=()=>l(new Error("websocket error")),a.onclose=()=>l()})}function aM(e,t){return _t("/auth/login",{method:"POST",body:JSON.stringify({username:e,password:t})})}function Tre(e,t,n){return _t("/auth/register",{method:"POST",body:JSON.stringify({username:e,password:t,display_name:n})})}function Ere(){return _t("/auth/logout",{method:"POST"})}function Mre(){return _t("/me")}function oM(e){return _t("/me",{method:"PATCH",body:JSON.stringify(e)})}function wF(){return _t("/users")}function kF(){return _t("/tags")}function Dre(){return _t("/requesters")}function Rre(e){return _t(`/cards/${e}/files`)}async function c9(e,t,n="upload"){const i=new FormData;i.append("file",t),i.append("source",n);const r=await fetch(`${vF}/cards/${e}/files`,{method:"POST",credentials:"same-origin",body:i});if(!r.ok){let a=`upload failed: ${r.status}`;try{const o=await r.json();(o.Message||o.message)&&(a=o.Message||o.message||a)}catch{}throw new u9(r.status,a)}return await r.json()}function Pre(e){return _t(`/files/${e}`,{method:"DELETE"})}function Nre(e){return _t("/mcp-tokens",{method:"POST",body:JSON.stringify({name:e})})}function $re(){return _t("/mcp-tokens")}function zre(e){return _t(`/mcp-tokens/${e}`,{method:"DELETE"})}function _F(e){const t=new URLSearchParams;e.from&&t.set("from",e.from),e.to&&t.set("to",e.to),e.assignee_id&&t.set("assignee_id",e.assignee_id),e.requester&&t.set("requester",e.requester),e.tags&&e.tags.length>0&&t.set("tags",e.tags.join(","));const n=t.toString();return _t(`/metrics${n?`?${n}`:""}`)}const xF=S.createContext(null);function Lre({children:e}){const[t,n]=S.useState(null),[i,r]=S.useState(!0);S.useEffect(()=>{Mre().then(n).catch(u=>{(!(u instanceof u9)||u.status!==401)&&console.warn("getMe failed",u)}).finally(()=>r(!1))},[]);const a=S.useCallback(async(u,f)=>{const h=await aM(u,f);n(h)},[]),o=S.useCallback(async(u,f,h)=>{await Tre(u,f,h);const d=await aM(u,f);n(d)},[]),l=S.useCallback(async()=>{await Ere(),n(null)},[]);return v.jsx(xF.Provider,{value:{user:t,loading:i,login:a,register:o,logout:l,setUser:n},children:e})}function f9(){const e=S.useContext(xF);if(!e)throw new Error("useAuth: missing AuthProvider");return e}function Ire(){for(var e=arguments.length,t=new Array(e),n=0;ni=>{t.forEach(r=>r(i))},t)}const l0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jf(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function d9(e){return"nodeType"in e}function cr(e){var t,n;return e?Jf(e)?e:d9(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function h9(e){const{Document:t}=cr(e);return e instanceof t}function mp(e){return Jf(e)?!1:e instanceof cr(e).HTMLElement}function SF(e){return e instanceof cr(e).SVGElement}function ed(e){return e?Jf(e)?e.document:d9(e)?h9(e)?e:mp(e)||SF(e)?e.ownerDocument:document:document:document}const Ga=l0?S.useLayoutEffect:S.useEffect;function u0(e){const t=S.useRef(e);return Ga(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r{e.current=setInterval(i,r)},[]),n=S.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function um(e,t){t===void 0&&(t=[e]);const n=S.useRef(e);return Ga(()=>{n.current!==e&&(n.current=e)},t),n}function pp(e,t){const n=S.useRef();return S.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Xg(e){const t=u0(e),n=S.useRef(null),i=S.useCallback(r=>{r!==n.current&&(t==null||t(r,n.current)),n.current=r},[]);return[n,i]}function Zg(e){const t=S.useRef();return S.useEffect(()=>{t.current=e},[e]),t.current}let Gk={};function vp(e,t){return S.useMemo(()=>{if(t)return t;const n=Gk[e]==null?0:Gk[e]+1;return Gk[e]=n,e+"-"+n},[e,t])}function CF(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r{const l=Object.entries(o);for(const[u,f]of l){const h=a[u];h!=null&&(a[u]=h+e*f)}return a},{...t})}}const Jc=CF(1),cm=CF(-1);function Fre(e){return"clientX"in e&&"clientY"in e}function c0(e){if(!e)return!1;const{KeyboardEvent:t}=cr(e.target);return t&&e instanceof t}function qre(e){if(!e)return!1;const{TouchEvent:t}=cr(e.target);return t&&e instanceof t}function Qg(e){if(qre(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Fre(e)?{x:e.clientX,y:e.clientY}:null}const go=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[go.Translate.toString(e),go.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),sM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Hre(e){return e.matches(sM)?e:e.querySelector(sM)}const Ure={display:"none"};function Vre(e){let{id:t,value:n}=e;return J.createElement("div",{id:t,style:Ure},n)}function Wre(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return J.createElement("div",{id:t,style:r,role:"status","aria-live":i,"aria-atomic":!0},n)}function Gre(){const[e,t]=S.useState("");return{announce:S.useCallback(i=>{i!=null&&t(i)},[]),announcement:e}}const jF=S.createContext(null);function Yre(e){const t=S.useContext(jF);S.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function Kre(){const[e]=S.useState(()=>new Set),t=S.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[S.useCallback(i=>{let{type:r,event:a}=i;e.forEach(o=>{var l;return(l=o[r])==null?void 0:l.call(o,a)})},[e]),t]}const Xre={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},Zre={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Qre(e){let{announcements:t=Zre,container:n,hiddenTextDescribedById:i,screenReaderInstructions:r=Xre}=e;const{announce:a,announcement:o}=Gre(),l=vp("DndLiveRegion"),[u,f]=S.useState(!1);if(S.useEffect(()=>{f(!0)},[]),Yre(S.useMemo(()=>({onDragStart(d){let{active:p}=d;a(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&a(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;a(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;a(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;a(t.onDragCancel({active:p,over:g}))}}),[a,t])),!u)return null;const h=J.createElement(J.Fragment,null,J.createElement(Vre,{id:i,value:r.draggable}),J.createElement(Wre,{id:l,announcement:o}));return n?ol.createPortal(h,n):h}var Si;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Si||(Si={}));function Jg(){}function lM(e,t){return S.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Jre(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(i=>i!=null),[...t])}const Ya=Object.freeze({x:0,y:0});function m9(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function eae(e,t){const n=Qg(e);if(!n)return"0 0";const i={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return i.x+"% "+i.y+"%"}function p9(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function tae(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function VS(e){let{left:t,top:n,height:i,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+i},{x:t+r,y:n+i}]}function AF(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function uM(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const nae=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const r=uM(t,t.left,t.top),a=[];for(const o of i){const{id:l}=o,u=n.get(l);if(u){const f=m9(uM(u),r);a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(p9)},OF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const r=VS(t),a=[];for(const o of i){const{id:l}=o,u=n.get(l);if(u){const f=VS(u),h=r.reduce((p,g,b)=>p+m9(f[b],g),0),d=Number((h/4).toFixed(4));a.push({id:l,data:{droppableContainer:o,value:d}})}}return a.sort(p9)};function iae(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=r-i,l=a-n;if(i{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const r=[];for(const a of i){const{id:o}=a,l=n.get(o);if(l){const u=iae(l,t);u>0&&r.push({id:o,data:{droppableContainer:a,value:u}})}}return r.sort(tae)};function rae(e,t){const{top:n,left:i,bottom:r,right:a}=t;return n<=e.y&&e.y<=r&&i<=e.x&&e.x<=a}const aae=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:i}=e;if(!i)return[];const r=[];for(const a of t){const{id:o}=a,l=n.get(o);if(l&&rae(i,l)){const f=VS(l).reduce((d,p)=>d+m9(i,p),0),h=Number((f/4).toFixed(4));r.push({id:o,data:{droppableContainer:a,value:h}})}}return r.sort(p9)};function oae(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function EF(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ya}function sae(e){return function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),a=1;a({...o,top:o.top+e*l.y,bottom:o.bottom+e*l.y,left:o.left+e*l.x,right:o.right+e*l.x}),{...n})}}const lae=sae(1);function MF(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function uae(e,t,n){const i=MF(t);if(!i)return e;const{scaleX:r,scaleY:a,x:o,y:l}=i,u=e.left-o-(1-r)*parseFloat(n),f=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),h=r?e.width/r:e.width,d=a?e.height/a:e.height;return{width:h,height:d,top:f,right:u+h,bottom:f+d,left:u}}const cae={ignoreTransform:!1};function td(e,t){t===void 0&&(t=cae);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:h}=cr(e).getComputedStyle(e);f&&(n=uae(n,f,h))}const{top:i,left:r,width:a,height:o,bottom:l,right:u}=n;return{top:i,left:r,width:a,height:o,bottom:l,right:u}}function cM(e){return td(e,{ignoreTransform:!0})}function fae(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function dae(e,t){return t===void 0&&(t=cr(e).getComputedStyle(e)),t.position==="fixed"}function hae(e,t){t===void 0&&(t=cr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const a=t[r];return typeof a=="string"?n.test(a):!1})}function f0(e,t){const n=[];function i(r){if(t!=null&&n.length>=t||!r)return n;if(h9(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!mp(r)||SF(r)||n.includes(r))return n;const a=cr(e).getComputedStyle(r);return r!==e&&hae(r,a)&&n.push(r),dae(r,a)?n:i(r.parentNode)}return e?i(e):n}function DF(e){const[t]=f0(e,1);return t??null}function Yk(e){return!l0||!e?null:Jf(e)?e:d9(e)?h9(e)||e===ed(e).scrollingElement?window:mp(e)?e:null:null}function RF(e){return Jf(e)?e.scrollX:e.scrollLeft}function PF(e){return Jf(e)?e.scrollY:e.scrollTop}function WS(e){return{x:RF(e),y:PF(e)}}var Pi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pi||(Pi={}));function NF(e){return!l0||!e?!1:e===document.scrollingElement}function $F(e){const t={x:0,y:0},n=NF(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,o=e.scrollTop>=i.y,l=e.scrollLeft>=i.x;return{isTop:r,isLeft:a,isBottom:o,isRight:l,maxScroll:i,minScroll:t}}const mae={x:.2,y:.2};function pae(e,t,n,i,r){let{top:a,left:o,right:l,bottom:u}=n;i===void 0&&(i=10),r===void 0&&(r=mae);const{isTop:f,isBottom:h,isLeft:d,isRight:p}=$F(e),g={x:0,y:0},b={x:0,y:0},w={height:t.height*r.y,width:t.width*r.x};return!f&&a<=t.top+w.height?(g.y=Pi.Backward,b.y=i*Math.abs((t.top+w.height-a)/w.height)):!h&&u>=t.bottom-w.height&&(g.y=Pi.Forward,b.y=i*Math.abs((t.bottom-w.height-u)/w.height)),!p&&l>=t.right-w.width?(g.x=Pi.Forward,b.x=i*Math.abs((t.right-w.width-l)/w.width)):!d&&o<=t.left+w.width&&(g.x=Pi.Backward,b.x=i*Math.abs((t.left+w.width-o)/w.width)),{direction:g,speed:b}}function vae(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:t,left:n,right:i,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:r,width:e.clientWidth,height:e.clientHeight}}function zF(e){return e.reduce((t,n)=>Jc(t,WS(n)),Ya)}function gae(e){return e.reduce((t,n)=>t+RF(n),0)}function yae(e){return e.reduce((t,n)=>t+PF(n),0)}function LF(e,t){if(t===void 0&&(t=td),!e)return;const{top:n,left:i,bottom:r,right:a}=t(e);DF(e)&&(r<=0||a<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const bae=[["x",["left","right"],gae],["y",["top","bottom"],yae]];class v9{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=f0(n),r=zF(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,o,l]of bae)for(const u of o)Object.defineProperty(this,u,{get:()=>{const f=l(i),h=r[a]-f;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class qh{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var r;(r=this.target)==null||r.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function wae(e){const{EventTarget:t}=cr(e);return e instanceof t?e:ed(e)}function Kk(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t?i>t.y:!1}var da;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(da||(da={}));function fM(e){e.preventDefault()}function kae(e){e.stopPropagation()}var cn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(cn||(cn={}));const IF={start:[cn.Space,cn.Enter],cancel:[cn.Esc],end:[cn.Space,cn.Enter,cn.Tab]},_ae=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case cn.Right:return{...n,x:n.x+25};case cn.Left:return{...n,x:n.x-25};case cn.Down:return{...n,y:n.y+25};case cn.Up:return{...n,y:n.y-25}}};class g9{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new qh(ed(n)),this.windowListeners=new qh(cr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(da.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&LF(i),n(Ya)}handleKeyDown(t){if(c0(t)){const{active:n,context:i,options:r}=this.props,{keyboardCodes:a=IF,coordinateGetter:o=_ae,scrollBehavior:l="smooth"}=r,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:f}=i.current,h=f?{x:f.left,y:f.top}:Ya;this.referenceCoordinates||(this.referenceCoordinates=h);const d=o(t,{active:n,context:i.current,currentCoordinates:h});if(d){const p=cm(d,h),g={x:0,y:0},{scrollableAncestors:b}=i.current;for(const w of b){const k=t.code,{isTop:_,isRight:x,isLeft:j,isBottom:T,maxScroll:A,minScroll:O}=$F(w),M=vae(w),N={x:Math.min(k===cn.Right?M.right-M.width/2:M.right,Math.max(k===cn.Right?M.left:M.left+M.width/2,d.x)),y:Math.min(k===cn.Down?M.bottom-M.height/2:M.bottom,Math.max(k===cn.Down?M.top:M.top+M.height/2,d.y))},F=k===cn.Right&&!x||k===cn.Left&&!j,R=k===cn.Down&&!T||k===cn.Up&&!_;if(F&&N.x!==d.x){const I=w.scrollLeft+p.x,q=k===cn.Right&&I<=A.x||k===cn.Left&&I>=O.x;if(q&&!p.y){w.scrollTo({left:I,behavior:l});return}q?g.x=w.scrollLeft-I:g.x=k===cn.Right?w.scrollLeft-A.x:w.scrollLeft-O.x,g.x&&w.scrollBy({left:-g.x,behavior:l});break}else if(R&&N.y!==d.y){const I=w.scrollTop+p.y,q=k===cn.Down&&I<=A.y||k===cn.Up&&I>=O.y;if(q&&!p.x){w.scrollTo({top:I,behavior:l});return}q?g.y=w.scrollTop-I:g.y=k===cn.Down?w.scrollTop-A.y:w.scrollTop-O.y,g.y&&w.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Jc(cm(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}g9.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=IF,onActivation:r}=t,{active:a}=n;const{code:o}=e.nativeEvent;if(i.start.includes(o)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),r==null||r({event:e.nativeEvent}),!0)}return!1}}];function dM(e){return!!(e&&"distance"in e)}function hM(e){return!!(e&&"delay"in e)}class y9{constructor(t,n,i){var r;i===void 0&&(i=wae(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:o}=a;this.props=t,this.events=n,this.document=ed(o),this.documentListeners=new qh(this.document),this.listeners=new qh(i),this.windowListeners=new qh(cr(o)),this.initialCoordinates=(r=Qg(a))!=null?r:Ya,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(da.Resize,this.handleCancel),this.windowListeners.add(da.DragStart,fM),this.windowListeners.add(da.VisibilityChange,this.handleCancel),this.windowListeners.add(da.ContextMenu,fM),this.documentListeners.add(da.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(hM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(dM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:r}=this.props;r(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(da.Click,kae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(da.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:r,props:a}=this,{onMove:o,options:{activationConstraint:l}}=a;if(!r)return;const u=(n=Qg(t))!=null?n:Ya,f=cm(r,u);if(!i&&l){if(dM(l)){if(l.tolerance!=null&&Kk(f,l.tolerance))return this.handleCancel();if(Kk(f,l.distance))return this.handleStart()}if(hM(l)&&Kk(f,l.tolerance))return this.handleCancel();this.handlePending(l,f);return}t.cancelable&&t.preventDefault(),o(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===cn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xae={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class b9 extends y9{constructor(t){const{event:n}=t,i=ed(n.target);super(t,xae,i)}}b9.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!n.isPrimary||n.button!==0?!1:(i==null||i({event:n}),!0)}}];const Sae={move:{name:"mousemove"},end:{name:"mouseup"}};var GS;(function(e){e[e.RightClick=2]="RightClick"})(GS||(GS={}));class Cae extends y9{constructor(t){super(t,Sae,ed(t.event.target))}}Cae.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button===GS.RightClick?!1:(i==null||i({event:n}),!0)}}];const Xk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class jae extends y9{constructor(t){super(t,Xk)}static setup(){return window.addEventListener(Xk.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Xk.move.name,t)};function t(){}}}jae.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:r}=n;return r.length>1?!1:(i==null||i({event:n}),!0)}}];var Hh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Hh||(Hh={}));var e1;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(e1||(e1={}));function Aae(e){let{acceleration:t,activator:n=Hh.Pointer,canScroll:i,draggingRect:r,enabled:a,interval:o=5,order:l=e1.TreeOrder,pointerCoordinates:u,scrollableAncestors:f,scrollableAncestorRects:h,delta:d,threshold:p}=e;const g=Tae({delta:d,disabled:!a}),[b,w]=Bre(),k=S.useRef({x:0,y:0}),_=S.useRef({x:0,y:0}),x=S.useMemo(()=>{switch(n){case Hh.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Hh.DraggableRect:return r}},[n,r,u]),j=S.useRef(null),T=S.useCallback(()=>{const O=j.current;if(!O)return;const M=k.current.x*_.current.x,N=k.current.y*_.current.y;O.scrollBy(M,N)},[]),A=S.useMemo(()=>l===e1.TreeOrder?[...f].reverse():f,[l,f]);S.useEffect(()=>{if(!a||!f.length||!x){w();return}for(const O of A){if((i==null?void 0:i(O))===!1)continue;const M=f.indexOf(O),N=h[M];if(!N)continue;const{direction:F,speed:R}=pae(O,N,x,t,p);for(const I of["x","y"])g[I][F[I]]||(R[I]=0,F[I]=0);if(R.x>0||R.y>0){w(),j.current=O,b(T,o),k.current=R,_.current=F;return}}k.current={x:0,y:0},_.current={x:0,y:0},w()},[t,T,i,w,a,o,JSON.stringify(x),JSON.stringify(g),b,f,A,h,JSON.stringify(p)])}const Oae={x:{[Pi.Backward]:!1,[Pi.Forward]:!1},y:{[Pi.Backward]:!1,[Pi.Forward]:!1}};function Tae(e){let{delta:t,disabled:n}=e;const i=Zg(t);return pp(r=>{if(n||!i||!r)return Oae;const a={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[Pi.Backward]:r.x[Pi.Backward]||a.x===-1,[Pi.Forward]:r.x[Pi.Forward]||a.x===1},y:{[Pi.Backward]:r.y[Pi.Backward]||a.y===-1,[Pi.Forward]:r.y[Pi.Forward]||a.y===1}}},[n,t,i])}function Eae(e,t){const n=t!=null?e.get(t):void 0,i=n?n.node.current:null;return pp(r=>{var a;return t==null?null:(a=i??r)!=null?a:null},[i,t])}function Mae(e,t){return S.useMemo(()=>e.reduce((n,i)=>{const{sensor:r}=i,a=r.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,i)}));return[...n,...a]},[]),[e,t])}var fm;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(fm||(fm={}));var YS;(function(e){e.Optimized="optimized"})(YS||(YS={}));const mM=new Map;function Dae(e,t){let{dragging:n,dependencies:i,config:r}=t;const[a,o]=S.useState(null),{frequency:l,measure:u,strategy:f}=r,h=S.useRef(e),d=k(),p=um(d),g=S.useCallback(function(_){_===void 0&&(_=[]),!p.current&&o(x=>x===null?_:x.concat(_.filter(j=>!x.includes(j))))},[p]),b=S.useRef(null),w=pp(_=>{if(d&&!n)return mM;if(!_||_===mM||h.current!==e||a!=null){const x=new Map;for(let j of e){if(!j)continue;if(a&&a.length>0&&!a.includes(j.id)&&j.rect.current){x.set(j.id,j.rect.current);continue}const T=j.node.current,A=T?new v9(u(T),T):null;j.rect.current=A,A&&x.set(j.id,A)}return x}return _},[e,a,n,d,u]);return S.useEffect(()=>{h.current=e},[e]),S.useEffect(()=>{d||g()},[n,d]),S.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),S.useEffect(()=>{d||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null},l))},[l,d,g,...i]),{droppableRects:w,measureDroppableContainers:g,measuringScheduled:a!=null};function k(){switch(f){case fm.Always:return!1;case fm.BeforeDragging:return n;default:return!n}}}function w9(e,t){return pp(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Rae(e,t){return w9(e,t)}function Pae(e){let{callback:t,disabled:n}=e;const i=u0(t),r=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(i)},[i,n]);return S.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function d0(e){let{callback:t,disabled:n}=e;const i=u0(t),r=S.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(i)},[n]);return S.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function Nae(e){return new v9(td(e),e)}function pM(e,t,n){t===void 0&&(t=Nae);const[i,r]=S.useState(null);function a(){r(u=>{if(!e)return null;if(e.isConnected===!1){var f;return(f=u??n)!=null?f:null}const h=t(e);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const o=Pae({callback(u){if(e)for(const f of u){const{type:h,target:d}=f;if(h==="childList"&&d instanceof HTMLElement&&d.contains(e)){a();break}}}}),l=d0({callback:a});return Ga(()=>{a(),e?(l==null||l.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),o==null||o.disconnect())},[e]),i}function $ae(e){const t=w9(e);return EF(e,t)}const vM=[];function zae(e){const t=S.useRef(e),n=pp(i=>e?i&&i!==vM&&e&&t.current&&e.parentNode===t.current.parentNode?i:f0(e):vM,[e]);return S.useEffect(()=>{t.current=e},[e]),n}function Lae(e){const[t,n]=S.useState(null),i=S.useRef(e),r=S.useCallback(a=>{const o=Yk(a.target);o&&n(l=>l?(l.set(o,WS(o)),new Map(l)):null)},[]);return S.useEffect(()=>{const a=i.current;if(e!==a){o(a);const l=e.map(u=>{const f=Yk(u);return f?(f.addEventListener("scroll",r,{passive:!0}),[f,WS(f)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),i.current=e}return()=>{o(e),o(a)};function o(l){l.forEach(u=>{const f=Yk(u);f==null||f.removeEventListener("scroll",r)})}},[r,e]),S.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,o)=>Jc(a,o),Ya):zF(e):Ya,[e,t])}function gM(e,t){t===void 0&&(t=[]);const n=S.useRef(null);return S.useEffect(()=>{n.current=null},t),S.useEffect(()=>{const i=e!==Ya;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?cm(e,n.current):Ya}function Iae(e){S.useEffect(()=>{if(!l0)return;const t=e.map(n=>{let{sensor:i}=n;return i.setup==null?void 0:i.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Bae(e,t){return S.useMemo(()=>e.reduce((n,i)=>{let{eventName:r,handler:a}=i;return n[r]=o=>{a(o,t)},n},{}),[e,t])}function BF(e){return S.useMemo(()=>e?fae(e):null,[e])}const yM=[];function Fae(e,t){t===void 0&&(t=td);const[n]=e,i=BF(n?cr(n):null),[r,a]=S.useState(yM);function o(){a(()=>e.length?e.map(u=>NF(u)?i:new v9(t(u),u)):yM)}const l=d0({callback:o});return Ga(()=>{l==null||l.disconnect(),o(),e.forEach(u=>l==null?void 0:l.observe(u))},[e]),r}function FF(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return mp(t)?t:e}function qae(e){let{measure:t}=e;const[n,i]=S.useState(null),r=S.useCallback(f=>{for(const{target:h}of f)if(mp(h)){i(d=>{const p=t(h);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),a=d0({callback:r}),o=S.useCallback(f=>{const h=FF(f);a==null||a.disconnect(),h&&(a==null||a.observe(h)),i(h?t(h):null)},[t,a]),[l,u]=Xg(o);return S.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const Hae=[{sensor:b9,options:{}},{sensor:g9,options:{}}],Uae={current:{}},Rg={draggable:{measure:cM},droppable:{measure:cM,strategy:fm.WhileDragging,frequency:YS.Optimized},dragOverlay:{measure:td}};class Uh extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Vae={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Uh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Jg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Rg,measureDroppableContainers:Jg,windowRect:null,measuringScheduled:!1},qF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jg,draggableNodes:new Map,over:null,measureDroppableContainers:Jg},gp=S.createContext(qF),HF=S.createContext(Vae);function Wae(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Uh}}}function Gae(e,t){switch(t.type){case Si.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Si.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Si.DragEnd:case Si.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Si.RegisterDroppable:{const{element:n}=t,{id:i}=n,r=new Uh(e.droppable.containers);return r.set(i,n),{...e,droppable:{...e.droppable,containers:r}}}case Si.SetDroppableDisabled:{const{id:n,key:i,disabled:r}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const o=new Uh(e.droppable.containers);return o.set(n,{...a,disabled:r}),{...e,droppable:{...e.droppable,containers:o}}}case Si.UnregisterDroppable:{const{id:n,key:i}=t,r=e.droppable.containers.get(n);if(!r||i!==r.key)return e;const a=new Uh(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Yae(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:r}=S.useContext(gp),a=Zg(i),o=Zg(n==null?void 0:n.id);return S.useEffect(()=>{if(!t&&!i&&a&&o!=null){if(!c0(a)||document.activeElement===a.target)return;const l=r.get(o);if(!l)return;const{activatorNode:u,node:f}=l;if(!u.current&&!f.current)return;requestAnimationFrame(()=>{for(const h of[u.current,f.current]){if(!h)continue;const d=Hre(h);if(d){d.focus();break}}})}},[i,t,r,o,a]),null}function UF(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((r,a)=>a({transform:r,...i}),n):n}function Kae(e){return S.useMemo(()=>({draggable:{...Rg.draggable,...e==null?void 0:e.draggable},droppable:{...Rg.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Rg.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Xae(e){let{activeNode:t,measure:n,initialRect:i,config:r=!0}=e;const a=S.useRef(!1),{x:o,y:l}=typeof r=="boolean"?{x:r,y:r}:r;Ga(()=>{if(!o&&!l||!t){a.current=!1;return}if(a.current||!i)return;const f=t==null?void 0:t.node.current;if(!f||f.isConnected===!1)return;const h=n(f),d=EF(h,i);if(o||(d.x=0),l||(d.y=0),a.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=DF(f);p&&p.scrollBy({top:d.y,left:d.x})}},[t,o,l,i,n])}const h0=S.createContext({...Ya,scaleX:1,scaleY:1});var nl;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(nl||(nl={}));const Zae=S.memo(function(t){var n,i,r,a;let{id:o,accessibility:l,autoScroll:u=!0,children:f,sensors:h=Hae,collisionDetection:d=TF,measuring:p,modifiers:g,...b}=t;const w=S.useReducer(Gae,void 0,Wae),[k,_]=w,[x,j]=Kre(),[T,A]=S.useState(nl.Uninitialized),O=T===nl.Initialized,{draggable:{active:M,nodes:N,translate:F},droppable:{containers:R}}=k,I=M!=null?N.get(M):null,q=S.useRef({initial:null,translated:null}),G=S.useMemo(()=>{var gt;return M!=null?{id:M,data:(gt=I==null?void 0:I.data)!=null?gt:Uae,rect:q}:null},[M,I]),U=S.useRef(null),[$,D]=S.useState(null),[z,H]=S.useState(null),Y=um(b,Object.values(b)),P=vp("DndDescribedBy",o),W=S.useMemo(()=>R.getEnabled(),[R]),V=Kae(p),{droppableRects:L,measureDroppableContainers:Z,measuringScheduled:ie}=Dae(W,{dragging:O,dependencies:[F.x,F.y],config:V.droppable}),re=Eae(N,M),X=S.useMemo(()=>z?Qg(z):null,[z]),le=Tt(),ee=Rae(re,V.draggable.measure);Xae({activeNode:M!=null?N.get(M):null,config:le.layoutShiftCompensation,initialRect:ee,measure:V.draggable.measure});const se=pM(re,V.draggable.measure,ee),ke=pM(re?re.parentElement:null),ne=S.useRef({activatorEvent:null,active:null,activeNode:re,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$e=R.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=qae({measure:V.dragOverlay.measure}),Ae=(i=xe.nodeRef.current)!=null?i:re,ze=O?(r=xe.rect)!=null?r:se:null,be=!!(xe.nodeRef.current&&xe.rect),Ce=$ae(be?null:se),Ne=BF(Ae?cr(Ae):null),de=zae(O?$e??re:null),He=Fae(de),Ye=UF(g,{transform:{x:F.x-Ce.x,y:F.y-Ce.y,scaleX:1,scaleY:1},activatorEvent:z,active:G,activeNodeRect:se,containerNodeRect:ke,draggingNodeRect:ze,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:de,scrollableAncestorRects:He,windowRect:Ne}),We=X?Jc(X,F):null,Qe=Lae(de),Je=gM(Qe),oe=gM(Qe,[se]),ye=Jc(Ye,Je),Ke=ze?lae(ze,Ye):null,et=G&&Ke?d({active:G,collisionRect:Ke,droppableRects:L,droppableContainers:W,pointerCoordinates:We}):null,je=AF(et,"id"),[rt,pt]=S.useState(null),Dt=be?Ye:Jc(Ye,oe),yt=oae(Dt,(a=rt==null?void 0:rt.rect)!=null?a:null,se),ot=S.useRef(null),tt=S.useCallback((gt,wt)=>{let{sensor:rn,options:Mn}=wt;if(U.current==null)return;const qe=N.get(U.current);if(!qe)return;const Ue=gt.nativeEvent,zt=new rn({active:U.current,activeNode:qe,event:Ue,options:Mn,context:ne,onAbort(Rt){if(!N.get(Rt))return;const{onDragAbort:at}=Y.current,st={id:Rt};at==null||at(st),x({type:"onDragAbort",event:st})},onPending(Rt,nt,at,st){if(!N.get(Rt))return;const{onDragPending:Gt}=Y.current,Sn={id:Rt,constraint:nt,initialCoordinates:at,offset:st};Gt==null||Gt(Sn),x({type:"onDragPending",event:Sn})},onStart(Rt){const nt=U.current;if(nt==null)return;const at=N.get(nt);if(!at)return;const{onDragStart:st}=Y.current,Wt={activatorEvent:Ue,active:{id:nt,data:at.data,rect:q}};ol.unstable_batchedUpdates(()=>{st==null||st(Wt),A(nl.Initializing),_({type:Si.DragStart,initialCoordinates:Rt,active:nt}),x({type:"onDragStart",event:Wt}),D(ot.current),H(Ue)})},onMove(Rt){_({type:Si.DragMove,coordinates:Rt})},onEnd:an(Si.DragEnd),onCancel:an(Si.DragCancel)});ot.current=zt;function an(Rt){return async function(){const{active:at,collisions:st,over:Wt,scrollAdjustedTranslate:Gt}=ne.current;let Sn=null;if(at&&Gt){const{cancelDrop:Mt}=Y.current;Sn={activatorEvent:Ue,active:at,collisions:st,delta:Gt,over:Wt},Rt===Si.DragEnd&&typeof Mt=="function"&&await Promise.resolve(Mt(Sn))&&(Rt=Si.DragCancel)}U.current=null,ol.unstable_batchedUpdates(()=>{_({type:Rt}),A(nl.Uninitialized),pt(null),D(null),H(null),ot.current=null;const Mt=Rt===Si.DragEnd?"onDragEnd":"onDragCancel";if(Sn){const xt=Y.current[Mt];xt==null||xt(Sn),x({type:Mt,event:Sn})}})}}},[N]),Nt=S.useCallback((gt,wt)=>(rn,Mn)=>{const qe=rn.nativeEvent,Ue=N.get(Mn);if(U.current!==null||!Ue||qe.dndKit||qe.defaultPrevented)return;const zt={active:Ue};gt(rn,wt.options,zt)===!0&&(qe.dndKit={capturedBy:wt.sensor},U.current=Mn,tt(rn,wt))},[N,tt]),Re=Mae(h,Nt);Iae(h),Ga(()=>{se&&T===nl.Initializing&&A(nl.Initialized)},[se,T]),S.useEffect(()=>{const{onDragMove:gt}=Y.current,{active:wt,activatorEvent:rn,collisions:Mn,over:qe}=ne.current;if(!wt||!rn)return;const Ue={active:wt,activatorEvent:rn,collisions:Mn,delta:{x:ye.x,y:ye.y},over:qe};ol.unstable_batchedUpdates(()=>{gt==null||gt(Ue),x({type:"onDragMove",event:Ue})})},[ye.x,ye.y]),S.useEffect(()=>{const{active:gt,activatorEvent:wt,collisions:rn,droppableContainers:Mn,scrollAdjustedTranslate:qe}=ne.current;if(!gt||U.current==null||!wt||!qe)return;const{onDragOver:Ue}=Y.current,zt=Mn.get(je),an=zt&&zt.rect.current?{id:zt.id,rect:zt.rect.current,data:zt.data,disabled:zt.disabled}:null,Rt={active:gt,activatorEvent:wt,collisions:rn,delta:{x:qe.x,y:qe.y},over:an};ol.unstable_batchedUpdates(()=>{pt(an),Ue==null||Ue(Rt),x({type:"onDragOver",event:Rt})})},[je]),Ga(()=>{ne.current={activatorEvent:z,active:G,activeNode:re,collisionRect:Ke,collisions:et,droppableRects:L,draggableNodes:N,draggingNode:Ae,draggingNodeRect:ze,droppableContainers:R,over:rt,scrollableAncestors:de,scrollAdjustedTranslate:ye},q.current={initial:ze,translated:Ke}},[G,re,et,Ke,N,Ae,ze,L,R,rt,de,ye]),Aae({...le,delta:F,draggingRect:Ke,pointerCoordinates:We,scrollableAncestors:de,scrollableAncestorRects:He});const Fe=S.useMemo(()=>({active:G,activeNode:re,activeNodeRect:se,activatorEvent:z,collisions:et,containerNodeRect:ke,dragOverlay:xe,draggableNodes:N,droppableContainers:R,droppableRects:L,over:rt,measureDroppableContainers:Z,scrollableAncestors:de,scrollableAncestorRects:He,measuringConfiguration:V,measuringScheduled:ie,windowRect:Ne}),[G,re,se,z,et,ke,xe,N,R,L,rt,Z,de,He,V,ie,Ne]),Vt=S.useMemo(()=>({activatorEvent:z,activators:Re,active:G,activeNodeRect:se,ariaDescribedById:{draggable:P},dispatch:_,draggableNodes:N,over:rt,measureDroppableContainers:Z}),[z,Re,G,se,_,P,N,rt,Z]);return J.createElement(jF.Provider,{value:j},J.createElement(gp.Provider,{value:Vt},J.createElement(HF.Provider,{value:Fe},J.createElement(h0.Provider,{value:yt},f)),J.createElement(Yae,{disabled:(l==null?void 0:l.restoreFocus)===!1})),J.createElement(Qre,{...l,hiddenTextDescribedById:P}));function Tt(){const gt=($==null?void 0:$.autoScrollEnabled)===!1,wt=typeof u=="object"?u.enabled===!1:u===!1,rn=O&&!gt&&!wt;return typeof u=="object"?{...u,enabled:rn}:{enabled:rn}}}),Qae=S.createContext(null),bM="button",Jae="Draggable";function eoe(e){let{id:t,data:n,disabled:i=!1,attributes:r}=e;const a=vp(Jae),{activators:o,activatorEvent:l,active:u,activeNodeRect:f,ariaDescribedById:h,draggableNodes:d,over:p}=S.useContext(gp),{role:g=bM,roleDescription:b="draggable",tabIndex:w=0}=r??{},k=(u==null?void 0:u.id)===t,_=S.useContext(k?h0:Qae),[x,j]=Xg(),[T,A]=Xg(),O=Bae(o,t),M=um(n);Ga(()=>(d.set(t,{id:t,key:a,node:x,activatorNode:T,data:M}),()=>{const F=d.get(t);F&&F.key===a&&d.delete(t)}),[d,t]);const N=S.useMemo(()=>({role:g,tabIndex:w,"aria-disabled":i,"aria-pressed":k&&g===bM?!0:void 0,"aria-roledescription":b,"aria-describedby":h.draggable}),[i,g,w,k,b,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:f,attributes:N,isDragging:k,listeners:i?void 0:O,node:x,over:p,setNodeRef:j,setActivatorNodeRef:A,transform:_}}function VF(){return S.useContext(HF)}const toe="Droppable",noe={timeout:25};function ioe(e){let{data:t,disabled:n=!1,id:i,resizeObserverConfig:r}=e;const a=vp(toe),{active:o,dispatch:l,over:u,measureDroppableContainers:f}=S.useContext(gp),h=S.useRef({disabled:n}),d=S.useRef(!1),p=S.useRef(null),g=S.useRef(null),{disabled:b,updateMeasurementsFor:w,timeout:k}={...noe,...r},_=um(w??i),x=S.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{f(Array.isArray(_.current)?_.current:[_.current]),g.current=null},k)},[k]),j=d0({callback:x,disabled:b||!o}),T=S.useCallback((N,F)=>{j&&(F&&(j.unobserve(F),d.current=!1),N&&j.observe(N))},[j]),[A,O]=Xg(T),M=um(t);return S.useEffect(()=>{!j||!A.current||(j.disconnect(),d.current=!1,j.observe(A.current))},[A,j]),S.useEffect(()=>(l({type:Si.RegisterDroppable,element:{id:i,key:a,disabled:n,node:A,rect:p,data:M}}),()=>l({type:Si.UnregisterDroppable,key:a,id:i})),[i]),S.useEffect(()=>{n!==h.current.disabled&&(l({type:Si.SetDroppableDisabled,id:i,key:a,disabled:n}),h.current.disabled=n)},[i,a,n,l]),{active:o,rect:p,isOver:(u==null?void 0:u.id)===i,node:A,over:u,setNodeRef:O}}function roe(e){let{animation:t,children:n}=e;const[i,r]=S.useState(null),[a,o]=S.useState(null),l=Zg(n);return!n&&!i&&l&&r(l),Ga(()=>{if(!a)return;const u=i==null?void 0:i.key,f=i==null?void 0:i.props.id;if(u==null||f==null){r(null);return}Promise.resolve(t(f,a)).then(()=>{r(null)})},[t,i,a]),J.createElement(J.Fragment,null,n,i?S.cloneElement(i,{ref:o}):null)}const aoe={x:0,y:0,scaleX:1,scaleY:1};function ooe(e){let{children:t}=e;return J.createElement(gp.Provider,{value:qF},J.createElement(h0.Provider,{value:aoe},t))}const soe={position:"fixed",touchAction:"none"},loe=e=>c0(e)?"transform 250ms ease":void 0,uoe=S.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:r,children:a,className:o,rect:l,style:u,transform:f,transition:h=loe}=e;if(!l)return null;const d=r?f:{...f,scaleX:1,scaleY:1},p={...soe,width:l.width,height:l.height,top:l.top,left:l.left,transform:go.Transform.toString(d),transformOrigin:r&&i?eae(i,l):void 0,transition:typeof h=="function"?h(i):h,...u};return J.createElement(n,{className:o,style:p,ref:t},a)}),coe=e=>t=>{let{active:n,dragOverlay:i}=t;const r={},{styles:a,className:o}=e;if(a!=null&&a.active)for(const[l,u]of Object.entries(a.active))u!==void 0&&(r[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(a!=null&&a.dragOverlay)for(const[l,u]of Object.entries(a.dragOverlay))u!==void 0&&i.node.style.setProperty(l,u);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&i.node.classList.add(o.dragOverlay),function(){for(const[u,f]of Object.entries(r))n.node.style.setProperty(u,f);o!=null&&o.active&&n.node.classList.remove(o.active)}},foe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:go.Transform.toString(t)},{transform:go.Transform.toString(n)}]},doe={duration:250,easing:"ease",keyframes:foe,sideEffects:coe({styles:{active:{opacity:"0"}}})};function hoe(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:r}=e;return u0((a,o)=>{if(t===null)return;const l=n.get(a);if(!l)return;const u=l.node.current;if(!u)return;const f=FF(o);if(!f)return;const{transform:h}=cr(o).getComputedStyle(o),d=MF(h);if(!d)return;const p=typeof t=="function"?t:moe(t);return LF(u,r.draggable.measure),p({active:{id:a,data:l.data,node:u,rect:r.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:o,rect:r.dragOverlay.measure(f)},droppableContainers:i,measuringConfiguration:r,transform:d})})}function moe(e){const{duration:t,easing:n,sideEffects:i,keyframes:r}={...doe,...e};return a=>{let{active:o,dragOverlay:l,transform:u,...f}=a;if(!t)return;const h={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},d={scaleX:u.scaleX!==1?o.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?o.rect.height*u.scaleY/l.rect.height:1},p={x:u.x-h.x,y:u.y-h.y,...d},g=r({...f,active:o,dragOverlay:l,transform:{initial:u,final:p}}),[b]=g,w=g[g.length-1];if(JSON.stringify(b)===JSON.stringify(w))return;const k=i==null?void 0:i({active:o,dragOverlay:l,...f}),_=l.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{_.onfinish=()=>{k==null||k(),x()}})}}let wM=0;function poe(e){return S.useMemo(()=>{if(e!=null)return wM++,wM},[e])}const voe=J.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:r,transition:a,modifiers:o,wrapperElement:l="div",className:u,zIndex:f=999}=e;const{activatorEvent:h,active:d,activeNodeRect:p,containerNodeRect:g,draggableNodes:b,droppableContainers:w,dragOverlay:k,over:_,measuringConfiguration:x,scrollableAncestors:j,scrollableAncestorRects:T,windowRect:A}=VF(),O=S.useContext(h0),M=poe(d==null?void 0:d.id),N=UF(o,{activatorEvent:h,active:d,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:k.rect,over:_,overlayNodeRect:k.rect,scrollableAncestors:j,scrollableAncestorRects:T,transform:O,windowRect:A}),F=w9(p),R=hoe({config:i,draggableNodes:b,droppableContainers:w,measuringConfiguration:x}),I=F?k.setRef:void 0;return J.createElement(ooe,null,J.createElement(roe,{animation:R},d&&M?J.createElement(uoe,{key:M,id:d.id,ref:I,as:l,activatorEvent:h,adjustScale:t,className:u,transition:a,rect:F,style:{zIndex:f,...r},transform:N},n):null))});function t1(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function goe(e,t){return e.reduce((n,i,r)=>{const a=t.get(i);return a&&(n[r]=a),n},Array(e.length))}function Jv(e){return e!==null&&e>=0}function yoe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{var t;let{rects:n,activeNodeRect:i,activeIndex:r,overIndex:a,index:o}=e;const l=(t=n[r])!=null?t:i;if(!l)return null;const u=koe(n,o,r);if(o===r){const f=n[a];return f?{x:rr&&o<=a?{x:-l.width-u,y:0,...eg}:o=a?{x:l.width+u,y:0,...eg}:{x:0,y:0,...eg}};function koe(e,t,n){const i=e[t],r=e[t-1],a=e[t+1];return!i||!r&&!a?0:n{let{rects:t,activeIndex:n,overIndex:i,index:r}=e;const a=t1(t,i,n),o=t[r],l=a[r];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},tg={scaleX:1,scaleY:1},GF=e=>{var t;let{activeIndex:n,activeNodeRect:i,index:r,rects:a,overIndex:o}=e;const l=(t=a[n])!=null?t:i;if(!l)return null;if(r===n){const f=a[o];return f?{x:0,y:nn&&r<=o?{x:0,y:-l.height-u,...tg}:r=o?{x:0,y:l.height+u,...tg}:{x:0,y:0,...tg}};function _oe(e,t,n){const i=e[t],r=e[t-1],a=e[t+1];return i?ni.map(O=>typeof O=="object"&&"id"in O?O.id:O),[i]),b=o!=null,w=o?g.indexOf(o.id):-1,k=f?g.indexOf(f.id):-1,_=S.useRef(g),x=!yoe(g,_.current),j=k!==-1&&w===-1||x,T=boe(a);Ga(()=>{x&&b&&h(g)},[x,g,b,h]),S.useEffect(()=>{_.current=g},[g]);const A=S.useMemo(()=>({activeIndex:w,containerId:d,disabled:T,disableTransforms:j,items:g,overIndex:k,useDragOverlay:p,sortedRects:goe(g,u),strategy:r}),[w,d,T.draggable,T.droppable,j,g,k,u,p,r]);return J.createElement(KF.Provider,{value:A},t)}const xoe=e=>{let{id:t,items:n,activeIndex:i,overIndex:r}=e;return t1(n,i,r).indexOf(t)},Soe=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:r,items:a,newIndex:o,previousItems:l,previousContainerId:u,transition:f}=e;return!f||!i||l!==a&&r===o?!1:n?!0:o!==r&&t===u},Coe={duration:200,easing:"ease"},XF="transform",joe=go.Transition.toString({property:XF,duration:0,easing:"linear"}),Aoe={roleDescription:"sortable"};function Ooe(e){let{disabled:t,index:n,node:i,rect:r}=e;const[a,o]=S.useState(null),l=S.useRef(n);return Ga(()=>{if(!t&&n!==l.current&&i.current){const u=r.current;if(u){const f=td(i.current,{ignoreTransform:!0}),h={x:u.left-f.left,y:u.top-f.top,scaleX:u.width/f.width,scaleY:u.height/f.height};(h.x||h.y)&&o(h)}}n!==l.current&&(l.current=n)},[t,n,i,r]),S.useEffect(()=>{a&&o(null)},[a]),a}function ZF(e){let{animateLayoutChanges:t=Soe,attributes:n,disabled:i,data:r,getNewIndex:a=xoe,id:o,strategy:l,resizeObserverConfig:u,transition:f=Coe}=e;const{items:h,containerId:d,activeIndex:p,disabled:g,disableTransforms:b,sortedRects:w,overIndex:k,useDragOverlay:_,strategy:x}=S.useContext(KF),j=Toe(i,g),T=h.indexOf(o),A=S.useMemo(()=>({sortable:{containerId:d,index:T,items:h},...r}),[d,r,T,h]),O=S.useMemo(()=>h.slice(h.indexOf(o)),[h,o]),{rect:M,node:N,isOver:F,setNodeRef:R}=ioe({id:o,data:A,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...u}}),{active:I,activatorEvent:q,activeNodeRect:G,attributes:U,setNodeRef:$,listeners:D,isDragging:z,over:H,setActivatorNodeRef:Y,transform:P}=eoe({id:o,data:A,attributes:{...Aoe,...n},disabled:j.draggable}),W=Ire(R,$),V=!!I,L=V&&!b&&Jv(p)&&Jv(k),Z=!_&&z,ie=Z&&L?P:null,X=L?ie??(l??x)({rects:w,activeNodeRect:G,activeIndex:p,overIndex:k,index:T}):null,le=Jv(p)&&Jv(k)?a({id:o,items:h,activeIndex:p,overIndex:k}):T,ee=I==null?void 0:I.id,se=S.useRef({activeId:ee,items:h,newIndex:le,containerId:d}),ke=h!==se.current.items,ne=t({active:I,containerId:d,isDragging:z,isSorting:V,id:o,index:T,items:h,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:f,wasDragging:se.current.activeId!=null}),$e=Ooe({disabled:!ne,index:T,node:N,rect:M});return S.useEffect(()=>{V&&se.current.newIndex!==le&&(se.current.newIndex=le),d!==se.current.containerId&&(se.current.containerId=d),h!==se.current.items&&(se.current.items=h)},[V,le,d,h]),S.useEffect(()=>{if(ee===se.current.activeId)return;if(ee!=null&&se.current.activeId==null){se.current.activeId=ee;return}const Ae=setTimeout(()=>{se.current.activeId=ee},50);return()=>clearTimeout(Ae)},[ee]),{active:I,activeIndex:p,attributes:U,data:A,rect:M,index:T,newIndex:le,items:h,isOver:F,isSorting:V,isDragging:z,listeners:D,node:N,overIndex:k,over:H,setNodeRef:W,setActivatorNodeRef:Y,setDroppableNodeRef:R,setDraggableNodeRef:$,transform:$e??X,transition:xe()};function xe(){if($e||ke&&se.current.newIndex===T)return joe;if(!(Z&&!c0(q)||!f)&&(V||ne))return go.Transition.toString({...f,property:XF})}}function Toe(e,t){var n,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(i=e==null?void 0:e.droppable)!=null?i:t.droppable}}function n1(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Eoe=[cn.Down,cn.Right,cn.Up,cn.Left],Moe=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:r,droppableContainers:a,over:o,scrollableAncestors:l}}=t;if(Eoe.includes(e.code)){if(e.preventDefault(),!n||!i)return;const u=[];a.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=r.get(d.id);if(p)switch(e.code){case cn.Down:i.topp.top&&u.push(d);break;case cn.Left:i.left>p.left&&u.push(d);break;case cn.Right:i.left1&&(h=f[1].id),h!=null){const d=a.get(n.id),p=a.get(h),g=p?r.get(p.id):null,b=p==null?void 0:p.node.current;if(b&&g&&d&&p){const k=f0(b).some((O,M)=>l[M]!==O),_=QF(d,p),x=Doe(d,p),j=k||!_?{x:0,y:0}:{x:x?i.width-g.width:0,y:x?i.height-g.height:0},T={x:g.left,y:g.top};return j.x&&j.y?T:cm(T,j)}}}};function QF(e,t){return!n1(e)||!n1(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Doe(e,t){return!n1(e)||!n1(t)||!QF(e,t)?!1:e.data.current.sortable.index=$?U:""+Array($+1-z.length).join(D)+U},T={s:j,z:function(U){var $=-U.utcOffset(),D=Math.abs($),z=Math.floor(D/60),H=D%60;return($<=0?"+":"-")+j(z,2,"0")+":"+j(H,2,"0")},m:function U($,D){if($.date()1)return U(P[0])}else{var W=$.name;O[W]=$,H=W}return!z&&H&&(A=H),H||!z&&A},R=function(U,$){if(N(U))return U.clone();var D=typeof $=="object"?$:{};return D.date=U,D.args=arguments,new q(D)},I=T;I.l=F,I.i=N,I.w=function(U,$){return R(U,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var q=(function(){function U(D){this.$L=F(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[M]=!0}var $=U.prototype;return $.parse=function(D){this.$d=(function(z){var H=z.date,Y=z.utc;if(H===null)return new Date(NaN);if(I.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var P=H.match(k);if(P){var W=P[2]-1||0,V=(P[7]||"0").substring(0,3);return Y?new Date(Date.UTC(P[1],W,P[3]||1,P[4]||0,P[5]||0,P[6]||0,V)):new Date(P[1],W,P[3]||1,P[4]||0,P[5]||0,P[6]||0,V)}}return new Date(H)})(D),this.init()},$.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},$.$utils=function(){return I},$.isValid=function(){return this.$d.toString()!==w},$.isSame=function(D,z){var H=R(D);return this.startOf(z)<=H&&H<=this.endOf(z)},$.isAfter=function(D,z){return R(D)Be(o).locale(n).format(i);return e==="default"?t===null?"":a(t):e==="multiple"?t.map(a).join(", "):e==="range"&&Array.isArray(t)?t[0]&&t[1]?`${a(t[0])} ${r} ${a(t[1])}`:t[0]?`${a(t[0])} ${r} `:"":""}function zoe({formatter:e,...t}){return(e||$oe)(t)}function Loe({direction:e,levelIndex:t,rowIndex:n,cellIndex:i,size:r}){switch(e){case"up":return t===0&&n===0?null:n===0?{levelIndex:t-1,rowIndex:i<=r[t-1][r[t-1].length-1]-1?r[t-1].length-1:r[t-1].length-2,cellIndex:i}:{levelIndex:t,rowIndex:n-1,cellIndex:i};case"down":return n===r[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:i}:n===r[t].length-2&&i>=r[t][r[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:i}:{levelIndex:t,rowIndex:n+1,cellIndex:i};case"left":return t===0&&n===0&&i===0?null:n===0&&i===0?{levelIndex:t-1,rowIndex:r[t-1].length-1,cellIndex:r[t-1][r[t-1].length-1]-1}:i===0?{levelIndex:t,rowIndex:n-1,cellIndex:r[t][n-1]-1}:{levelIndex:t,rowIndex:n,cellIndex:i-1};case"right":return n===r[t].length-1&&i===r[t][n]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:i===r[t][n]-1?{levelIndex:t,rowIndex:n+1,cellIndex:0}:{levelIndex:t,rowIndex:n,cellIndex:i+1};default:return{levelIndex:t,rowIndex:n,cellIndex:i}}}function JF({controlsRef:e,direction:t,levelIndex:n,rowIndex:i,cellIndex:r,size:a}){var u,f,h;const o=Loe({direction:t,size:a,rowIndex:i,cellIndex:r,levelIndex:n});if(!o)return;const l=(h=(f=(u=e.current)==null?void 0:u[o.levelIndex])==null?void 0:f[o.rowIndex])==null?void 0:h[o.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?JF({controlsRef:e,direction:t,levelIndex:o.levelIndex,cellIndex:o.cellIndex,rowIndex:o.rowIndex,size:a}):l.focus())}function Ioe(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function Boe(e){var t;return(t=e.current)==null?void 0:t.map(n=>n.map(i=>i.length))}function k9({controlsRef:e,levelIndex:t,rowIndex:n,cellIndex:i,event:r}){const a=Ioe(r.key);a&&(r.preventDefault(),JF({controlsRef:e,direction:a,levelIndex:t,rowIndex:n,cellIndex:i,size:Boe(e)}))}function Ji(e){return e==null||e===""?e:Be(e).format("YYYY-MM-DD")}function eq(e){return e==null||e===""?e:Be(e).format("YYYY-MM-DD HH:mm:ss")}function XS({minDate:e,maxDate:t}){const n=Be();return!e&&!t?Ji(n):e&&Be(n).isBefore(e)?Ji(e):t&&Be(n).isAfter(t)?Ji(t):Ji(n)}const Foe={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},qoe=S.createContext(Foe);function Ol(){const e=S.use(qoe),t=S.useCallback(a=>a||e.locale,[e.locale]),n=S.useCallback(a=>typeof a=="number"?a:e.firstDayOfWeek,[e.firstDayOfWeek]),i=S.useCallback(a=>Array.isArray(a)?a:e.weekendDays,[e.weekendDays]),r=S.useCallback(a=>typeof a=="string"?a:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getFirstDayOfWeek:n,getWeekendDays:i,getLabelSeparator:r}}function Hoe({value:e,type:t,withTime:n}){const i=n?eq:Ji;if(t==="range"&&Array.isArray(e)){const r=i(e[0]),a=i(e[1]);return r?a?`${r} – ${a}`:`${r} –`:""}return t==="multiple"&&Array.isArray(e)?e.filter(Boolean).join(", "):!Array.isArray(e)&&e?i(e):""}function tq({value:e,type:t,name:n,form:i,withTime:r=!1}){return v.jsx("input",{type:"hidden",value:Hoe({value:e,type:t,withTime:r}),name:n,form:i})}tq.displayName="@mantine/dates/HiddenDatesInput";var nq={day:"m_396ce5cb"};const iq=(e,{size:t})=>({day:{"--day-size":$t(t,"day-size")}}),m0=De(e=>{const t=we("Day",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,date:u,disabled:f,__staticSelector:h,weekend:d,outside:p,selected:g,renderDay:b,inRange:w,firstInRange:k,lastInRange:_,hidden:x,static:j,highlightToday:T,fullWidth:A,attributes:O,...M}=t;return v.jsx(En,{...Ze({name:h||"Day",classes:nq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:O,vars:l,varsResolver:iq,rootSelector:"day"})("day",{style:x?{display:"none"}:void 0}),component:j?"div":"button",disabled:f,"data-today":Be(u).isSame(new Date,"day")||void 0,"data-hidden":x||void 0,"data-highlight-today":T||void 0,"data-disabled":f||void 0,"data-weekend":!f&&!p&&d||void 0,"data-outside":!f&&p||void 0,"data-selected":!f&&g||void 0,"data-in-range":w&&!f||void 0,"data-first-in-range":k&&!f||void 0,"data-last-in-range":_&&!f||void 0,"data-static":j||void 0,"data-full-width":A||void 0,unstyled:o,...M,children:(b==null?void 0:b(u))||Be(u).date()})});m0.classes=nq;m0.varsResolver=iq;m0.displayName="@mantine/dates/Day";function Uoe({locale:e,format:t="dd",firstDayOfWeek:n=1}){const i=Be().day(n),r=[];for(let a=0;a<7;a+=1)typeof t=="string"?r.push(Be(i).add(a,"days").locale(e).format(t)):r.push(t(Be(i).add(a,"days").format("YYYY-MM-DD")));return r}var rq={weekday:"m_18a3eca"};const aq=(e,{size:t})=>({weekdaysRow:{"--wr-fz":oi(t),"--wr-spacing":Yn(t)}}),p0=De(e=>{const t=we("WeekdaysRow",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,locale:u,firstDayOfWeek:f,weekdayFormat:h,cellComponent:d="th",__staticSelector:p,withWeekNumbers:g,attributes:b,...w}=t,k=Ze({name:p||"WeekdaysRow",classes:rq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:b,vars:l,varsResolver:aq,rootSelector:"weekdaysRow"}),_=Ol(),x=Uoe({locale:_.getLocale(u),format:h,firstDayOfWeek:_.getFirstDayOfWeek(f)}).map((j,T)=>v.jsx(d,{...k("weekday"),children:j},T));return v.jsxs(fe,{component:"tr",...k("weekdaysRow"),...w,children:[g&&v.jsx(d,{...k("weekday"),children:"#"}),x]})});p0.classes=rq;p0.varsResolver=aq;p0.displayName="@mantine/dates/WeekdaysRow";function Voe(e,t=1){let n=Be(e);if(!n.isValid())return n;const i=t===0?6:t-1;for(;n.day()!==i;)n=n.add(1,"day");return n.format("YYYY-MM-DD")}function Woe(e,t=1){let n=Be(e);for(;n.day()!==t;)n=n.subtract(1,"day");return n.format("YYYY-MM-DD")}function Goe({month:e,firstDayOfWeek:t=1,consistentWeeks:n}){const i=Be(Be(e).subtract(Be(e).date()-1,"day").format("YYYY-M-D")),r=i.format("YYYY-MM-DD"),a=Voe(i.add(+i.daysInMonth()-1,"day").format("YYYY-MM-DD"),t),o=[];let l=Be(Woe(r,t));for(;Be(l).isBefore(a,"day");){const u=[];for(let f=0;f<7;f+=1)u.push(l.format("YYYY-MM-DD")),l=l.add(1,"day");o.push(u)}if(n&&o.length<6){const u=o[o.length-1],f=u[u.length-1];let h=Be(f).add(1,"day");for(;o.length<6;){const d=[];for(let p=0;p<7;p+=1)d.push(h.format("YYYY-MM-DD")),h=h.add(1,"day");o.push(d)}}return o}function _9(e,t){return Be(e).format("YYYY-MM")===Be(t).format("YYYY-MM")}function oq(e,t){return t?Be(e).isAfter(Be(t).subtract(1,"day"),"day"):!0}function sq(e,t){return t?Be(e).isBefore(Be(t).add(1,"day"),"day"):!0}function Yoe({dates:e,minDate:t,maxDate:n,getDayProps:i,excludeDate:r,hideOutsideDates:a,month:o}){const l=e.flat().filter(h=>{var d;return sq(h,n)&&oq(h,t)&&!(r!=null&&r(h))&&!((d=i==null?void 0:i(h))!=null&&d.disabled)&&(!a||_9(h,o))}),u=l.find(h=>{var d;return(d=i==null?void 0:i(h))==null?void 0:d.selected});if(u)return u;const f=l.find(h=>Be().isSame(h,"date"));return f||l[0]}var Ng={exports:{}},Koe=Ng.exports,_M;function Xoe(){return _M||(_M=1,(function(e,t){(function(n,i){e.exports=i()})(Koe,(function(){var n="day";return function(i,r,a){var o=function(f){return f.add(4-f.isoWeekday(),n)},l=r.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(f){if(!this.$utils().u(f))return this.add(7*(f-this.isoWeek()),n);var h,d,p,g,b=o(this),w=(h=this.isoWeekYear(),d=this.$u,p=(d?a.utc:a)().year(h).startOf("year"),g=4-p.isoWeekday(),p.isoWeekday()>4&&(g+=7),p.add(g,n));return b.diff(w,"week")+1},l.isoWeekday=function(f){return this.$utils().u(f)?this.day()||7:this.day(this.day()%7?f:f-7)};var u=l.startOf;l.startOf=function(f,h){var d=this.$utils(),p=!!d.u(h)||h;return d.p(f)==="isoweek"?p?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(f,h)}}}))})(Ng)),Ng.exports}var Zoe=Xoe();const Qoe=gn(Zoe);Be.extend(Qoe);function Joe(e){return Be(e.find(t=>Be(t).day()===1)).isoWeek()}var lq={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const ese={withCellSpacing:!0},uq=(e,{size:t})=>({weekNumber:{"--wn-fz":oi(t),"--wn-size":$t(t,"wn-size")}}),yp=De(e=>{const t=we("Month",ese,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:u,locale:f,firstDayOfWeek:h,weekdayFormat:d,month:p,weekendDays:g,getDayProps:b,excludeDate:w,minDate:k,maxDate:_,renderDay:x,hideOutsideDates:j,hideWeekdays:T,getDayAriaLabel:A,static:O,__getDayRef:M,__onDayKeyDown:N,__onDayClick:F,__onDayMouseEnter:R,__preventFocus:I,__stopPropagation:q,withCellSpacing:G,size:U,highlightToday:$,withWeekNumbers:D,fullWidth:z,attributes:H,...Y}=t,P=Ze({name:u||"Month",classes:lq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:H,vars:l,varsResolver:uq,rootSelector:"month"}),W=Ol(),V=Goe({month:p,firstDayOfWeek:W.getFirstDayOfWeek(h),consistentWeeks:W.consistentWeeks}),L=Yoe({dates:V,minDate:Ji(k),maxDate:Ji(_),getDayProps:b,excludeDate:w,hideOutsideDates:j,month:p}),{resolvedClassNames:Z,resolvedStyles:ie}=Wi({classNames:n,styles:a,props:t}),re=V.map((X,le)=>{const ee=X.map((se,ke)=>{const ne=!_9(se,p),$e=(A==null?void 0:A(se))||Be(se).locale(f||W.locale).format("D MMMM YYYY"),xe=b==null?void 0:b(se),Ae=Be(se).isSame(L,"date");return v.jsx("td",{...P("monthCell"),"data-with-spacing":G||void 0,children:v.jsx(m0,{__staticSelector:u||"Month",classNames:Z,styles:ie,attributes:H,unstyled:o,"data-mantine-stop-propagation":q||void 0,highlightToday:$,renderDay:x,date:se,size:U,weekend:W.getWeekendDays(g).includes(Be(se).get("day")),outside:ne,hidden:j?ne:!1,"aria-label":$e,static:O,fullWidth:z,disabled:(w==null?void 0:w(se))||!sq(se,Ji(_))||!oq(se,Ji(k)),ref:ze=>{ze&&(M==null||M(le,ke,ze))},...xe,onKeyDown:ze=>{var be;(be=xe==null?void 0:xe.onKeyDown)==null||be.call(xe,ze),N==null||N(ze,{rowIndex:le,cellIndex:ke,date:se})},onMouseEnter:ze=>{var be;(be=xe==null?void 0:xe.onMouseEnter)==null||be.call(xe,ze),R==null||R(ze,se)},onClick:ze=>{var be;(be=xe==null?void 0:xe.onClick)==null||be.call(xe,ze),F==null||F(ze,se)},onMouseDown:ze=>{var be;(be=xe==null?void 0:xe.onMouseDown)==null||be.call(xe,ze),I&&ze.preventDefault()},tabIndex:I||!Ae?-1:0})},se.toString())});return v.jsxs("tr",{...P("monthRow"),children:[D&&v.jsx("td",{...P("weekNumber"),children:Joe(X)}),ee]},le)});return v.jsxs(fe,{component:"table",...P("month"),size:U,"data-full-width":z||void 0,...Y,children:[!T&&v.jsx("thead",{...P("monthThead"),children:v.jsx(p0,{__staticSelector:u||"Month",locale:f,firstDayOfWeek:h,weekdayFormat:d,withWeekNumbers:D,size:U,classNames:Z,styles:ie,unstyled:o,attributes:H})}),v.jsx("tbody",{...P("monthTbody"),children:re})]})});yp.classes=lq;yp.varsResolver=uq;yp.displayName="@mantine/dates/Month";var cq={pickerControl:"m_dc6a3c71"};const fq=(e,{size:t})=>({pickerControl:{"--dpc-fz":oi(t),"--dpc-size":$t(t,"dpc-size")}}),bp=De(e=>{const t=we("PickerControl",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,firstInRange:u,lastInRange:f,inRange:h,__staticSelector:d,selected:p,disabled:g,fullWidth:b,attributes:w,...k}=t;return v.jsx(En,{...Ze({name:d||"PickerControl",classes:cq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,vars:l,varsResolver:fq,rootSelector:"pickerControl"})("pickerControl"),unstyled:o,"data-picker-control":!0,"data-full-width":b||void 0,"data-selected":p&&!g||void 0,"data-disabled":g||void 0,"data-in-range":h&&!g&&!p||void 0,"data-first-in-range":u&&!g||void 0,"data-last-in-range":f&&!g||void 0,disabled:g,...k})});bp.classes=cq;bp.varsResolver=fq;bp.displayName="@mantine/dates/PickerControl";function dq({year:e,minDate:t,maxDate:n}){return!t&&!n?!1:!!(t&&Be(e).isBefore(t,"year")||n&&Be(e).isAfter(n,"year"))}function tse({years:e,minDate:t,maxDate:n,getYearControlProps:i}){const r=e.flat().filter(l=>{var u;return!dq({year:l,minDate:t,maxDate:n})&&!((u=i==null?void 0:i(l))!=null&&u.disabled)}),a=r.find(l=>{var u;return(u=i==null?void 0:i(l))==null?void 0:u.selected});if(a)return a;const o=r.find(l=>Be().isSame(l,"year"));return o||r[0]}function hq(e){const t=Be(e).year(),n=t-t%10;let i=0;const r=[[],[],[],[]];for(let a=0;a<4;a+=1){const o=a===3?1:3;for(let l=0;l{const t=we("YearsList",nse,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,decade:u,yearsListFormat:f,locale:h,minDate:d,maxDate:p,getYearControlProps:g,__staticSelector:b,__getControlRef:w,__onControlKeyDown:k,__onControlClick:_,__onControlMouseEnter:x,__preventFocus:j,__stopPropagation:T,withCellSpacing:A,fullWidth:O,size:M,attributes:N,...F}=t,R=Ze({name:b||"YearsList",classes:mq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:N,vars:l,rootSelector:"yearsList"}),I=Ol(),q=hq(u),G=tse({years:q,minDate:d,maxDate:p,getYearControlProps:g}),U=q.map(($,D)=>{const z=$.map((H,Y)=>{const P=g==null?void 0:g(H),W=Be(H).isSame(G,"year");return v.jsx("td",{...R("yearsListCell"),"data-with-spacing":A||void 0,children:v.jsx(bp,{...R("yearsListControl"),size:M,unstyled:o,fullWidth:O,"data-mantine-stop-propagation":T||void 0,disabled:dq({year:H,minDate:d,maxDate:p}),ref:V=>{V&&(w==null||w(D,Y,V))},...P,onKeyDown:V=>{var L;(L=P==null?void 0:P.onKeyDown)==null||L.call(P,V),k==null||k(V,{rowIndex:D,cellIndex:Y,date:H})},onClick:V=>{var L;(L=P==null?void 0:P.onClick)==null||L.call(P,V),_==null||_(V,H)},onMouseEnter:V=>{var L;(L=P==null?void 0:P.onMouseEnter)==null||L.call(P,V),x==null||x(V,H)},onMouseDown:V=>{var L;(L=P==null?void 0:P.onMouseDown)==null||L.call(P,V),j&&V.preventDefault()},tabIndex:j||!W?-1:0,children:(P==null?void 0:P.children)??Be(H).locale(I.getLocale(h)).format(f)})},Y)});return v.jsx("tr",{...R("yearsListRow"),children:z},D)});return v.jsx(fe,{component:"table",size:M,...R("yearsList"),"data-full-width":O||void 0,...F,children:v.jsx("tbody",{children:U})})});v0.classes=mq;v0.displayName="@mantine/dates/YearsList";function pq({month:e,minDate:t,maxDate:n}){return!t&&!n?!1:!!(t&&Be(e).isBefore(t,"month")||n&&Be(e).isAfter(n,"month"))}function ise({months:e,minDate:t,maxDate:n,getMonthControlProps:i}){const r=e.flat().filter(l=>{var u;return!pq({month:l,minDate:t,maxDate:n})&&!((u=i==null?void 0:i(l))!=null&&u.disabled)}),a=r.find(l=>{var u;return(u=i==null?void 0:i(l))==null?void 0:u.selected});if(a)return a;const o=r.find(l=>Be().isSame(l,"month"));return o||r[0]}function rse(e){const t=Be(e).startOf("year").toDate(),n=[[],[],[],[]];let i=0;for(let r=0;r<4;r+=1)for(let a=0;a<3;a+=1)n[r].push(Be(t).add(i,"months").format("YYYY-MM-DD")),i+=1;return n}var vq={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const ase={monthsListFormat:"MMM",withCellSpacing:!0},g0=De(e=>{const t=we("MonthsList",ase,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:u,year:f,monthsListFormat:h,locale:d,minDate:p,maxDate:g,getMonthControlProps:b,__getControlRef:w,__onControlKeyDown:k,__onControlClick:_,__onControlMouseEnter:x,__preventFocus:j,__stopPropagation:T,withCellSpacing:A,fullWidth:O,size:M,attributes:N,...F}=t,R=Ze({name:u||"MonthsList",classes:vq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:N,vars:l,rootSelector:"monthsList"}),I=Ol(),q=rse(f),G=ise({months:q,minDate:Ji(p),maxDate:Ji(g),getMonthControlProps:b}),U=q.map(($,D)=>{const z=$.map((H,Y)=>{const P=b==null?void 0:b(H),W=Be(H).isSame(G,"month");return v.jsx("td",{...R("monthsListCell"),"data-with-spacing":A||void 0,children:v.jsx(bp,{...R("monthsListControl"),size:M,unstyled:o,fullWidth:O,__staticSelector:u||"MonthsList","data-mantine-stop-propagation":T||void 0,disabled:pq({month:H,minDate:Ji(p),maxDate:Ji(g)}),ref:V=>{V&&(w==null||w(D,Y,V))},...P,onKeyDown:V=>{var L;(L=P==null?void 0:P.onKeyDown)==null||L.call(P,V),k==null||k(V,{rowIndex:D,cellIndex:Y,date:H})},onClick:V=>{var L;(L=P==null?void 0:P.onClick)==null||L.call(P,V),_==null||_(V,H)},onMouseEnter:V=>{var L;(L=P==null?void 0:P.onMouseEnter)==null||L.call(P,V),x==null||x(V,H)},onMouseDown:V=>{var L;(L=P==null?void 0:P.onMouseDown)==null||L.call(P,V),j&&V.preventDefault()},tabIndex:j||!W?-1:0,children:(P==null?void 0:P.children)??Be(H).locale(I.getLocale(d)).format(h)})},Y)});return v.jsx("tr",{...R("monthsListRow"),children:z},D)});return v.jsx(fe,{component:"table",size:M,...R("monthsList"),"data-full-width":O||void 0,...F,children:v.jsx("tbody",{children:U})})});g0.classes=vq;g0.displayName="@mantine/dates/MonthsList";var gq={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const ose={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},yq=(e,{size:t})=>({calendarHeader:{"--dch-control-size":$t(t,"dch-control-size"),"--dch-fz":oi(t)}}),ks=De(e=>{const t=we("CalendarHeader",ose,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,nextIcon:u,previousIcon:f,nextLabel:h,previousLabel:d,onNext:p,onPrevious:g,onLevelClick:b,label:w,nextDisabled:k,previousDisabled:_,hasNextLevel:x,levelControlAriaLabel:j,withNext:T,withPrevious:A,headerControlsOrder:O,fullWidth:M,__staticSelector:N,__preventFocus:F,__stopPropagation:R,attributes:I,...q}=t,G=Ze({name:N||"CalendarHeader",classes:gq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:I,vars:l,varsResolver:yq,rootSelector:"calendarHeader"}),U=F?Y=>Y.preventDefault():void 0,$=A&&S.createElement(En,{...G("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":d,onClick:g,unstyled:o,onMouseDown:U,disabled:_,"data-disabled":_||void 0,tabIndex:F||_?-1:0,"data-mantine-stop-propagation":R||void 0},f||v.jsx(Yg,{...G("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),D=S.createElement(En,{component:x?"button":"div",...G("calendarHeaderLevel"),key:"level",onClick:x?b:void 0,unstyled:o,onMouseDown:x?U:void 0,disabled:!x,"data-static":!x||void 0,"aria-label":j,tabIndex:F||!x?-1:0,"data-mantine-stop-propagation":R||void 0},w),z=T&&S.createElement(En,{...G("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":h,onClick:p,unstyled:o,onMouseDown:U,disabled:k,"data-disabled":k||void 0,tabIndex:F||k?-1:0,"data-mantine-stop-propagation":R||void 0},u||v.jsx(Yg,{...G("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),H=O.map(Y=>Y==="previous"?$:Y==="level"?D:Y==="next"?z:null);return v.jsx(fe,{...G("calendarHeader"),"data-full-width":M||void 0,...q,children:H})});ks.classes=gq;ks.varsResolver=yq;ks.displayName="@mantine/dates/CalendarHeader";function sse(e){const t=hq(e);return[t[0][0],t[3][0]]}const lse={decadeLabelFormat:"YYYY"},y0=De(e=>{const{decade:t,locale:n,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:d,__preventFocus:p,nextIcon:g,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:x,nextDisabled:j,previousDisabled:T,levelControlAriaLabel:A,withNext:O,withPrevious:M,headerControlsOrder:N,decadeLabelFormat:F,classNames:R,styles:I,unstyled:q,__staticSelector:G,__stopPropagation:U,size:$,fullWidth:D,attributes:z,...H}=we("DecadeLevel",lse,e),Y=Ol(),[P,W]=sse(t),V={__staticSelector:G||"DecadeLevel",classNames:R,styles:I,unstyled:q,size:$,attributes:z},L=typeof j=="boolean"?j:r?!Be(W).endOf("year").isBefore(r):!1,Z=typeof T=="boolean"?T:i?!Be(P).startOf("year").isAfter(i):!1,ie=(re,X)=>Be(re).locale(n||Y.locale).format(X);return v.jsxs(fe,{"data-decade-level":!0,size:$,...H,children:[v.jsx(ks,{label:typeof F=="function"?F(P,W):`${ie(P,F)} – ${ie(W,F)}`,__preventFocus:p,__stopPropagation:U,nextIcon:g,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:x,nextDisabled:L,previousDisabled:Z,hasNextLevel:!1,levelControlAriaLabel:A,withNext:O,withPrevious:M,headerControlsOrder:N,fullWidth:D,...V}),v.jsx(v0,{decade:t,locale:n,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__getControlRef:l,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:U,withCellSpacing:d,fullWidth:D,...V})]})});y0.classes={...v0.classes,...ks.classes};y0.displayName="@mantine/dates/DecadeLevel";const use={yearLabelFormat:"YYYY"},b0=De(e=>{const{year:t,locale:n,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,withCellSpacing:d,__preventFocus:p,nextIcon:g,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:x,onLevelClick:j,nextDisabled:T,previousDisabled:A,hasNextLevel:O,levelControlAriaLabel:M,withNext:N,withPrevious:F,headerControlsOrder:R,yearLabelFormat:I,__staticSelector:q,__stopPropagation:G,size:U,classNames:$,styles:D,unstyled:z,fullWidth:H,attributes:Y,...P}=we("YearLevel",use,e),W=Ol(),V={__staticSelector:q||"YearLevel",classNames:$,styles:D,unstyled:z,size:U,attributes:Y},L=typeof T=="boolean"?T:r?!Be(t).endOf("year").isBefore(r):!1,Z=typeof A=="boolean"?A:i?!Be(t).startOf("year").isAfter(i):!1;return v.jsxs(fe,{"data-year-level":!0,size:U,...P,children:[v.jsx(ks,{label:typeof I=="function"?I(t):Be(t).locale(n||W.locale).format(I),__preventFocus:p,__stopPropagation:G,nextIcon:g,previousIcon:b,nextLabel:w,previousLabel:k,onNext:_,onPrevious:x,onLevelClick:j,nextDisabled:L,previousDisabled:Z,hasNextLevel:O,levelControlAriaLabel:M,withNext:N,withPrevious:F,headerControlsOrder:R,fullWidth:H,...V}),v.jsx(g0,{year:t,locale:n,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__getControlRef:l,__onControlKeyDown:u,__onControlClick:f,__onControlMouseEnter:h,__preventFocus:p,__stopPropagation:G,withCellSpacing:d,fullWidth:H,...V})]})});b0.classes={...ks.classes,...g0.classes};b0.displayName="@mantine/dates/YearLevel";const cse={monthLabelFormat:"MMMM YYYY"},w0=De(e=>{const{month:t,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:b,__onDayKeyDown:w,__onDayClick:k,__onDayMouseEnter:_,withCellSpacing:x,highlightToday:j,withWeekNumbers:T,__preventFocus:A,__stopPropagation:O,nextIcon:M,previousIcon:N,nextLabel:F,previousLabel:R,onNext:I,onPrevious:q,onLevelClick:G,nextDisabled:U,previousDisabled:$,hasNextLevel:D,levelControlAriaLabel:z,withNext:H,withPrevious:Y,headerControlsOrder:P,monthLabelFormat:W,classNames:V,styles:L,unstyled:Z,__staticSelector:ie,size:re,static:X,fullWidth:le,attributes:ee,...se}=we("MonthLevel",cse,e),ke=Ol(),ne={__staticSelector:ie||"MonthLevel",classNames:V,styles:L,unstyled:Z,size:re,attributes:ee},$e=typeof U=="boolean"?U:f?!Be(t).endOf("month").isBefore(f):!1,xe=typeof $=="boolean"?$:u?!Be(t).startOf("month").isAfter(u):!1;return v.jsxs(fe,{"data-month-level":!0,size:re,...se,children:[v.jsx(ks,{label:typeof W=="function"?W(t):Be(t).locale(n||ke.locale).format(W),__preventFocus:A,__stopPropagation:O,nextIcon:M,previousIcon:N,nextLabel:F,previousLabel:R,onNext:I,onPrevious:q,onLevelClick:G,nextDisabled:$e,previousDisabled:xe,hasNextLevel:D,levelControlAriaLabel:z,withNext:H,withPrevious:Y,headerControlsOrder:P,fullWidth:le,...ne}),v.jsx(yp,{month:t,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:b,__onDayKeyDown:w,__onDayClick:k,__onDayMouseEnter:_,__preventFocus:A,__stopPropagation:O,static:X,withCellSpacing:x,highlightToday:j,withWeekNumbers:T,fullWidth:le,...ne})]})});w0.classes={...yp.classes,...ks.classes};w0.displayName="@mantine/dates/MonthLevel";var bq={levelsGroup:"m_30b26e33"};const Tl=De(e=>{const t=we("LevelsGroup",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,__staticSelector:u,fullWidth:f,attributes:h,...d}=t;return v.jsx(fe,{...Ze({name:u||"LevelsGroup",classes:bq,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,rootSelector:"levelsGroup"})("levelsGroup"),"data-full-width":f||void 0,...d})});Tl.classes=bq;Tl.displayName="@mantine/dates/LevelsGroup";const fse={numberOfColumns:1},k0=De(e=>{const{decade:t,locale:n,minDate:i,maxDate:r,yearsListFormat:a,getYearControlProps:o,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:f,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:g,previousLabel:b,onNext:w,onPrevious:k,nextDisabled:_,previousDisabled:x,headerControlsOrder:j,classNames:T,styles:A,unstyled:O,__staticSelector:M,__stopPropagation:N,numberOfColumns:F,levelControlAriaLabel:R,decadeLabelFormat:I,size:q,fullWidth:G,vars:U,attributes:$,...D}=we("DecadeLevelGroup",fse,e),z=S.useRef([]),H=Array(F).fill(0).map((Y,P)=>{const W=Be(t).add(P*10,"years").format("YYYY-MM-DD");return v.jsx(y0,{size:q,yearsListFormat:a,decade:W,withNext:P===F-1,withPrevious:P===0,decadeLabelFormat:I,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(V,L)=>k9({levelIndex:P,rowIndex:L.rowIndex,cellIndex:L.cellIndex,event:V,controlsRef:z}),__getControlRef:(V,L,Z)=>{Array.isArray(z.current[P])||(z.current[P]=[]),Array.isArray(z.current[P][V])||(z.current[P][V]=[]),z.current[P][V][L]=Z},levelControlAriaLabel:typeof R=="function"?R(W):R,locale:n,minDate:i,maxDate:r,__preventFocus:h,__stopPropagation:N,nextIcon:d,previousIcon:p,nextLabel:g,previousLabel:b,onNext:w,onPrevious:k,nextDisabled:_,previousDisabled:x,getYearControlProps:o,__staticSelector:M||"DecadeLevelGroup",classNames:T,styles:A,unstyled:O,withCellSpacing:f,headerControlsOrder:j,fullWidth:G,attributes:$},P)});return v.jsx(Tl,{classNames:T,styles:A,__staticSelector:M||"DecadeLevelGroup",size:q,unstyled:O,fullWidth:G,attributes:$,...D,children:H})});k0.classes={...Tl.classes,...y0.classes};k0.displayName="@mantine/dates/DecadeLevelGroup";const dse={numberOfColumns:1},_0=De(e=>{const{year:t,locale:n,minDate:i,maxDate:r,monthsListFormat:a,getMonthControlProps:o,__onControlClick:l,__onControlMouseEnter:u,withCellSpacing:f,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:g,previousLabel:b,onNext:w,onPrevious:k,onLevelClick:_,nextDisabled:x,previousDisabled:j,hasNextLevel:T,headerControlsOrder:A,classNames:O,styles:M,unstyled:N,__staticSelector:F,__stopPropagation:R,numberOfColumns:I,levelControlAriaLabel:q,yearLabelFormat:G,size:U,fullWidth:$,vars:D,attributes:z,...H}=we("YearLevelGroup",dse,e),Y=S.useRef([]),P=Array(I).fill(0).map((W,V)=>{const L=Be(t).add(V,"years").format("YYYY-MM-DD");return v.jsx(b0,{size:U,monthsListFormat:a,year:L,withNext:V===I-1,withPrevious:V===0,yearLabelFormat:G,__stopPropagation:R,__onControlClick:l,__onControlMouseEnter:u,__onControlKeyDown:(Z,ie)=>k9({levelIndex:V,rowIndex:ie.rowIndex,cellIndex:ie.cellIndex,event:Z,controlsRef:Y}),__getControlRef:(Z,ie,re)=>{Array.isArray(Y.current[V])||(Y.current[V]=[]),Array.isArray(Y.current[V][Z])||(Y.current[V][Z]=[]),Y.current[V][Z][ie]=re},levelControlAriaLabel:typeof q=="function"?q(L):q,locale:n,minDate:i,maxDate:r,__preventFocus:h,nextIcon:d,previousIcon:p,nextLabel:g,previousLabel:b,onNext:w,onPrevious:k,onLevelClick:_,nextDisabled:x,previousDisabled:j,hasNextLevel:T,getMonthControlProps:o,classNames:O,styles:M,unstyled:N,__staticSelector:F||"YearLevelGroup",withCellSpacing:f,headerControlsOrder:A,fullWidth:$,attributes:z},V)});return v.jsx(Tl,{classNames:O,styles:M,__staticSelector:F||"YearLevelGroup",size:U,unstyled:N,fullWidth:$,attributes:z,...H,children:P})});_0.classes={...b0.classes,...Tl.classes};_0.displayName="@mantine/dates/YearLevelGroup";const hse={numberOfColumns:1},x0=De(e=>{const{month:t,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:g,__onDayClick:b,__onDayMouseEnter:w,withCellSpacing:k,highlightToday:_,withWeekNumbers:x,__preventFocus:j,nextIcon:T,previousIcon:A,nextLabel:O,previousLabel:M,onNext:N,onPrevious:F,onLevelClick:R,nextDisabled:I,previousDisabled:q,hasNextLevel:G,headerControlsOrder:U,classNames:$,styles:D,unstyled:z,numberOfColumns:H,levelControlAriaLabel:Y,monthLabelFormat:P,__staticSelector:W,__stopPropagation:V,size:L,static:Z,fullWidth:ie,vars:re,attributes:X,...le}=we("MonthLevelGroup",hse,e),ee=S.useRef([]),se=Array(H).fill(0).map((ke,ne)=>{const $e=Be(t).add(ne,"months").format("YYYY-MM-DD");return v.jsx(w0,{month:$e,withNext:ne===H-1,withPrevious:ne===0,monthLabelFormat:P,__stopPropagation:V,__onDayClick:b,__onDayMouseEnter:w,__onDayKeyDown:(xe,Ae)=>k9({levelIndex:ne,rowIndex:Ae.rowIndex,cellIndex:Ae.cellIndex,event:xe,controlsRef:ee}),__getDayRef:(xe,Ae,ze)=>{Array.isArray(ee.current[ne])||(ee.current[ne]=[]),Array.isArray(ee.current[ne][xe])||(ee.current[ne][xe]=[]),ee.current[ne][xe][Ae]=ze},levelControlAriaLabel:typeof Y=="function"?Y($e):Y,locale:n,firstDayOfWeek:i,weekdayFormat:r,weekendDays:a,getDayProps:o,excludeDate:l,minDate:u,maxDate:f,renderDay:h,hideOutsideDates:d,hideWeekdays:p,getDayAriaLabel:g,__preventFocus:j,nextIcon:T,previousIcon:A,nextLabel:O,previousLabel:M,onNext:N,onPrevious:F,onLevelClick:R,nextDisabled:I,previousDisabled:q,hasNextLevel:G,classNames:$,styles:D,unstyled:z,__staticSelector:W||"MonthLevelGroup",size:L,static:Z,withCellSpacing:k,highlightToday:_,withWeekNumbers:x,headerControlsOrder:U,fullWidth:ie,attributes:X},ne)});return v.jsx(Tl,{classNames:$,styles:D,__staticSelector:W||"MonthLevelGroup",size:L,fullWidth:ie,attributes:X,...le,children:se})});x0.classes={...Tl.classes,...w0.classes};x0.displayName="@mantine/dates/MonthLevelGroup";var wq={input:"m_6fa5e2aa"};const nd=De(e=>{const{inputProps:t,wrapperProps:n,placeholder:i,classNames:r,styles:a,unstyled:o,popoverProps:l,modalProps:u,dropdownType:f,children:h,formattedValue:d,dropdownHandlers:p,dropdownOpened:g,onClick:b,clearable:w,clearSectionMode:k,onClear:_,clearButtonProps:x,rightSection:j,shouldClear:T,readOnly:A,disabled:O,value:M,name:N,form:F,type:R,onDropdownClose:I,withTime:q,...G}=kI("PickerInputBase",{size:"sm"},e),U=v.jsx(Xn.ClearButton,{onClick:_,unstyled:o,...x}),$=()=>{R==="range"&&Array.isArray(M)&&M[0]&&!M[1]&&_(),p.close()};return v.jsxs(v.Fragment,{children:[f==="modal"&&!A&&v.jsx(tr,{opened:g,onClose:$,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:o,...u,children:h}),v.jsx(Xn.Wrapper,{...n,children:v.jsxs(Et,{position:"bottom-start",opened:g,trapFocus:!0,returnFocus:!1,unstyled:o,onClose:I,...l,disabled:(l==null?void 0:l.disabled)||f==="modal"||A,onChange:D=>{var z;D||((z=l==null?void 0:l.onClose)==null||z.call(l),$())},children:[v.jsx(Et.Target,{children:v.jsx(Xn,{"data-dates-input":!0,"data-read-only":A||void 0,disabled:O,component:"button",type:"button",multiline:!0,onClick:D=>{b==null||b(D),p.toggle()},__clearSection:U,__clearable:w&&T&&!A&&!O,__clearSectionMode:k,rightSection:j,...t,classNames:{...r,input:vt(wq.input,r==null?void 0:r.input)},...G,children:d||v.jsx(Xn.Placeholder,{error:t.error,unstyled:o,classNames:r,styles:a,__staticSelector:t.__staticSelector,children:i})})}),v.jsx(Et.Dropdown,{"data-dates-dropdown":!0,children:h})]})}),v.jsx(tq,{value:M,name:N,form:F,type:R,withTime:q})]})});nd.classes=wq;nd.displayName="@mantine/dates/PickerInputBase";const xM=e=>e==="range"?[null,null]:e==="multiple"?[]:null,SM=(e,t)=>{const n=t?eq:Ji;return Array.isArray(e)?e.map(n):n(e)};function x9({type:e,value:t,defaultValue:n,onChange:i,withTime:r=!1}){const a=S.useRef(e),[o,l,u]=ji({value:SM(t,r),defaultValue:SM(n,r),finalValue:xM(e),onChange:i});let f=o;return a.current!==e&&(a.current=e,t===void 0&&(f=n!==void 0?n:xM(e),l(f))),[f,l,u]}function Zk(e,t){return e?e==="month"?0:e==="year"?1:2:t||0}function mse(e){return e===0?"month":e===1?"year":"decade"}function hh(e,t,n){return mse(es(Zk(e,0),Zk(t,0),Zk(n,2)))}const pse={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},id=De(e=>{const t=we("Calendar",pse,e),{vars:n,maxLevel:i,minLevel:r,defaultLevel:a,level:o,onLevelChange:l,date:u,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:g,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:x,onMonthMouseEnter:j,headerControlsOrder:T,__updateDateOnYearSelect:A,__updateDateOnMonthSelect:O,__setDateRef:M,__setLevelRef:N,firstDayOfWeek:F,weekdayFormat:R,weekendDays:I,getDayProps:q,excludeDate:G,renderDay:U,hideOutsideDates:$,hideWeekdays:D,getDayAriaLabel:z,monthLabelFormat:H,nextIcon:Y,previousIcon:P,__onDayClick:W,__onDayMouseEnter:V,withCellSpacing:L,highlightToday:Z,withWeekNumbers:ie,monthsListFormat:re,getMonthControlProps:X,yearLabelFormat:le,yearsListFormat:ee,getYearControlProps:se,decadeLabelFormat:ke,classNames:ne,styles:$e,unstyled:xe,minDate:Ae,maxDate:ze,locale:be,__staticSelector:Ce,size:Ne,__preventFocus:de,__stopPropagation:He,onNextDecade:Ye,onPreviousDecade:We,onNextYear:Qe,onPreviousYear:Je,onNextMonth:oe,onPreviousMonth:ye,static:Ke,enableKeyboardNavigation:et,fullWidth:je,attributes:rt,ref:pt,...Dt}=t,{resolvedClassNames:yt,resolvedStyles:ot}=Wi({classNames:ne,styles:$e,props:t}),[tt,Nt]=ji({value:o?hh(o,r,i):void 0,defaultValue:a?hh(a,r,i):void 0,finalValue:hh(void 0,r,i),onChange:l}),[Re,Fe]=x9({type:"default",value:Ji(u),defaultValue:Ji(f),onChange:h});S.useImperativeHandle(M,()=>nt=>{Fe(nt)}),S.useImperativeHandle(N,()=>nt=>{Nt(nt)});const Vt={__staticSelector:Ce||"Calendar",styles:ot,classNames:yt,unstyled:xe,size:Ne,attributes:rt},Tt=p||d||1,gt=S.useRef(null);if(gt.current===null){const nt=new Date;gt.current=Ae&&Be(nt).isAfter(Ae)?Ae:Be(nt).format("YYYY-MM-DD")}const wt=Re||gt.current,rn=()=>{const nt=Be(wt).add(Tt,"month").format("YYYY-MM-DD");oe==null||oe(nt),Fe(nt)},Mn=()=>{const nt=Be(wt).subtract(Tt,"month").format("YYYY-MM-DD");ye==null||ye(nt),Fe(nt)},qe=()=>{const nt=Be(wt).add(Tt,"year").format("YYYY-MM-DD");Qe==null||Qe(nt),Fe(nt)},Ue=()=>{const nt=Be(wt).subtract(Tt,"year").format("YYYY-MM-DD");Je==null||Je(nt),Fe(nt)},zt=()=>{const nt=Be(wt).add(10*Tt,"year").format("YYYY-MM-DD");Ye==null||Ye(nt),Fe(nt)},an=()=>{const nt=Be(wt).subtract(10*Tt,"year").format("YYYY-MM-DD");We==null||We(nt),Fe(nt)},Rt=S.useRef(null);return S.useEffect(()=>{if(!et||Ke)return;const nt=at=>{var Gt;if(!((Gt=Rt.current)!=null&&Gt.contains(document.activeElement)))return;const st=at.ctrlKey||at.metaKey,Wt=at.shiftKey;switch(at.key){case"ArrowUp":st&&Wt?(at.preventDefault(),an()):st&&(at.preventDefault(),Ue());break;case"ArrowDown":st&&Wt?(at.preventDefault(),zt()):st&&(at.preventDefault(),qe());break;case"y":case"Y":tt==="month"&&(at.preventDefault(),Nt("year"));break}};return document.addEventListener("keydown",nt),()=>{document.removeEventListener("keydown",nt)}},[et,Ke,tt,qe,Ue,zt,an]),v.jsxs(fe,{ref:Hn(Rt,pt),size:Ne,"data-calendar":!0,"data-full-width":je||void 0,...Dt,children:[tt==="month"&&v.jsx(x0,{month:wt,minDate:Ae,maxDate:ze,firstDayOfWeek:F,weekdayFormat:R,weekendDays:I,getDayProps:q,excludeDate:G,renderDay:U,hideOutsideDates:$,hideWeekdays:D,getDayAriaLabel:z,onNext:rn,onPrevious:Mn,hasNextLevel:i!=="month",onLevelClick:()=>Nt("year"),numberOfColumns:d,locale:be,levelControlAriaLabel:g==null?void 0:g.monthLevelControl,nextLabel:(g==null?void 0:g.nextMonth)??b,nextIcon:Y,previousLabel:(g==null?void 0:g.previousMonth)??w,previousIcon:P,monthLabelFormat:H,__onDayClick:W,__onDayMouseEnter:V,__preventFocus:de,__stopPropagation:He,static:Ke,withCellSpacing:L,highlightToday:Z,withWeekNumbers:ie,headerControlsOrder:T,fullWidth:je,...Vt}),tt==="year"&&v.jsx(_0,{year:wt,numberOfColumns:d,minDate:Ae,maxDate:ze,monthsListFormat:re,getMonthControlProps:X,locale:be,onNext:qe,onPrevious:Ue,hasNextLevel:i!=="month"&&i!=="year",onLevelClick:()=>Nt("decade"),levelControlAriaLabel:g==null?void 0:g.yearLevelControl,nextLabel:(g==null?void 0:g.nextYear)??b,nextIcon:Y,previousLabel:(g==null?void 0:g.previousYear)??w,previousIcon:P,yearLabelFormat:le,__onControlMouseEnter:j,__onControlClick:(nt,at)=>{O&&Fe(at),Nt(hh("month",r,i)),_==null||_(at)},__preventFocus:de,__stopPropagation:He,withCellSpacing:L,headerControlsOrder:T,fullWidth:je,...Vt}),tt==="decade"&&v.jsx(k0,{decade:wt,minDate:Ae,maxDate:ze,yearsListFormat:ee,getYearControlProps:se,locale:be,onNext:zt,onPrevious:an,numberOfColumns:d,nextLabel:(g==null?void 0:g.nextDecade)??b,nextIcon:Y,previousLabel:(g==null?void 0:g.previousDecade)??w,previousIcon:P,decadeLabelFormat:ke,__onControlMouseEnter:x,__onControlClick:(nt,at)=>{A&&Fe(at),Nt(hh("year",r,i)),k==null||k(at)},__preventFocus:de,__stopPropagation:He,withCellSpacing:L,headerControlsOrder:T,fullWidth:je,...Vt})]})});id.classes={...k0.classes,..._0.classes,...x0.classes};id.displayName="@mantine/dates/Calendar";function S0(e){const{maxLevel:t,minLevel:n,defaultLevel:i,level:r,onLevelChange:a,nextIcon:o,previousIcon:l,date:u,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:g,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:x,onMonthMouseEnter:j,onNextMonth:T,onPreviousMonth:A,onNextYear:O,onPreviousYear:M,onNextDecade:N,onPreviousDecade:F,withCellSpacing:R,highlightToday:I,__updateDateOnYearSelect:q,__updateDateOnMonthSelect:G,__setDateRef:U,__setLevelRef:$,withWeekNumbers:D,headerControlsOrder:z,firstDayOfWeek:H,weekdayFormat:Y,weekendDays:P,getDayProps:W,excludeDate:V,renderDay:L,hideOutsideDates:Z,hideWeekdays:ie,getDayAriaLabel:re,monthLabelFormat:X,monthsListFormat:le,getMonthControlProps:ee,yearLabelFormat:se,yearsListFormat:ke,getYearControlProps:ne,decadeLabelFormat:$e,allowSingleDateInRange:xe,allowDeselect:Ae,minDate:ze,maxDate:be,locale:Ce,...Ne}=e;return{calendarProps:{maxLevel:t,minLevel:n,defaultLevel:i,level:r,onLevelChange:a,nextIcon:o,previousIcon:l,date:u,defaultDate:f,onDateChange:h,numberOfColumns:d,columnsToScroll:p,ariaLabels:g,nextLabel:b,previousLabel:w,onYearSelect:k,onMonthSelect:_,onYearMouseEnter:x,onMonthMouseEnter:j,onNextMonth:T,onPreviousMonth:A,onNextYear:O,onPreviousYear:M,onNextDecade:N,onPreviousDecade:F,withCellSpacing:R,highlightToday:I,__updateDateOnYearSelect:q,__updateDateOnMonthSelect:G,__setDateRef:U,withWeekNumbers:D,headerControlsOrder:z,firstDayOfWeek:H,weekdayFormat:Y,weekendDays:P,getDayProps:W,excludeDate:V,renderDay:L,hideOutsideDates:Z,hideWeekdays:ie,getDayAriaLabel:re,monthLabelFormat:X,monthsListFormat:le,getMonthControlProps:ee,yearLabelFormat:se,yearsListFormat:ke,getYearControlProps:ne,decadeLabelFormat:$e,allowSingleDateInRange:xe,allowDeselect:Ae,minDate:ze,maxDate:be,locale:Ce},others:Ne}}function CM(e,t){const n=[...t].sort((i,r)=>Be(i).isAfter(Be(r))?1:-1);return Be(n[0]).startOf("day").subtract(1,"ms").isBefore(e)&&Be(n[1]).endOf("day").add(1,"ms").isAfter(e)}function kq({type:e,level:t,value:n,defaultValue:i,onChange:r,allowSingleDateInRange:a,allowDeselect:o,onMouseLeave:l}){const[u,f]=x9({type:e,value:n,defaultValue:i,onChange:r}),[h,d]=S.useState(e==="range"&&u[0]&&!u[1]?u[0]:null),[p,g]=S.useState(null),b=A=>{if(e==="range"){if(h&&!u[1]){if(Be(A).isSame(h,t)&&!a){d(null),g(null),f([null,null]);return}const O=[A,h];O.sort((M,N)=>Be(M).isAfter(Be(N))?1:-1),f(O),g(null),d(null);return}if(u[0]&&!u[1]&&Be(A).isSame(u[0],t)&&!a){d(null),g(null),f([null,null]);return}f([A,null]),g(null),d(A);return}if(e==="multiple"){u.some(O=>Be(O).isSame(A,t))?f(u.filter(O=>!Be(O).isSame(A,t))):f([...u,A]);return}u&&o&&Be(A).isSame(u,t)?f(null):f(A)},w=A=>h&&p?CM(A,[p,h]):u[0]&&u[1]?CM(A,u):!1,k=e==="range"?A=>{l==null||l(A),g(null)}:l,_=A=>u[0]&&Be(A).isSame(u[0],t)?!(p&&Be(p).isBefore(u[0])):!1,x=A=>u[1]?Be(A).isSame(u[1],t):!u[0]||!p?!1:Be(p).isBefore(u[0])&&Be(A).isSame(u[0],t),j=A=>{if(e==="range")return{selected:u.some(M=>M&&Be(M).isSame(A,t)),inRange:w(A),firstInRange:_(A),lastInRange:x(A),"data-autofocus":!!u[0]&&Be(u[0]).isSame(A,t)||void 0};if(e==="multiple")return{selected:u.some(M=>M&&Be(M).isSame(A,t)),"data-autofocus":!!u[0]&&Be(u[0]).isSame(A,t)||void 0};const O=Be(u).isSame(A,t);return{selected:O,"data-autofocus":O||void 0}},T=e==="range"&&h?g:()=>{};return S.useEffect(()=>{if(e==="range")if(u[0]&&!u[1])d(u[0]);else{const A=u[0]==null&&u[1]==null,O=u[0]!=null&&u[1]!=null;(A||O)&&(d(null),g(null))}},[u]),{onDateChange:b,onRootMouseLeave:k,onHoveredDateChange:T,getControlProps:j,_value:u,setValue:f}}var _q={monthPickerRoot:"m_53c9e871",presetsList:"m_cccb8ff3",presetButton:"m_7b4fbf50"};const xq=(e,{size:t})=>({monthPickerRoot:{"--preset-font-size":oi(t)}}),vse={type:"default"},wp=De(e=>{const t=we("MonthPicker",vse,e),{classNames:n,styles:i,vars:r,type:a,defaultValue:o,value:l,onChange:u,__staticSelector:f,getMonthControlProps:h,allowSingleDateInRange:d,allowDeselect:p,onMouseLeave:g,onMonthSelect:b,__updateDateOnMonthSelect:w,__onPresetSelect:k,__stopPropagation:_,presets:x,className:j,style:T,unstyled:A,size:O,attributes:M,onLevelChange:N,...F}=t,{calendarProps:R,others:I}=S0(F),q=S.useRef(null),G=S.useRef(null),U=Ze({name:f||"MonthPicker",classes:_q,props:t,className:j,style:T,classNames:n,styles:i,unstyled:A,attributes:M,rootSelector:x?"monthPickerRoot":void 0,varsResolver:xq,vars:r}),{onDateChange:$,onRootMouseLeave:D,onHoveredDateChange:z,getControlProps:H,setValue:Y}=kq({type:a,level:"month",allowDeselect:p,allowSingleDateInRange:d,value:l,defaultValue:o,onChange:u,onMouseLeave:g}),{resolvedClassNames:P,resolvedStyles:W}=Wi({classNames:n,styles:i,props:t}),V=v.jsx(id,{classNames:P,styles:W,size:O,...R,...x?{}:I,minLevel:"year",__updateDateOnMonthSelect:w??!1,__staticSelector:f||"MonthPicker",onMouseLeave:D,onMonthMouseEnter:(ie,re)=>z(re),onMonthSelect:ie=>{$(ie),b==null||b(ie)},getMonthControlProps:ie=>({...H(ie),...h==null?void 0:h(ie)}),onLevelChange:N,__setDateRef:q,__setLevelRef:G,__stopPropagation:_,attributes:M,...x?{}:{className:j,style:T}});if(!x)return V;const L=ie=>{var X,le;const re=Array.isArray(ie)?ie[0]:ie;re!==void 0&&((X=q.current)==null||X.call(q,re),(le=G.current)==null||le.call(G,"year"),k?k(re):Y(ie))},Z=x.map((ie,re)=>v.jsx(En,{...U("presetButton"),onClick:()=>L(ie.value),onMouseDown:X=>X.preventDefault(),"data-mantine-stop-propagation":_||void 0,children:ie.label},re));return v.jsxs(fe,{...U("monthPickerRoot"),size:O,...I,children:[v.jsx("div",{...U("presetsList"),children:Z}),V]})});wp.classes={...id.classes,..._q};wp.varsResolver=xq;wp.displayName="@mantine/dates/MonthPicker";var gse={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const Sq=(e,{size:t})=>({datePickerRoot:{"--preset-font-size":oi(t)}}),yse={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},kp=De(e=>{const t=we("DatePicker",yse,e),{allowDeselect:n,allowSingleDateInRange:i,value:r,defaultValue:a,onChange:o,onMouseLeave:l,classNames:u,styles:f,__staticSelector:h,__onDayClick:d,__onDayMouseEnter:p,__onPresetSelect:g,__stopPropagation:b,presets:w,className:k,style:_,unstyled:x,size:j,vars:T,attributes:A,...O}=t,{calendarProps:M,others:N}=S0(O),F=S.useRef(null),R=S.useRef(null),I=Ze({name:h||"DatePicker",classes:gse,props:t,className:k,style:_,classNames:u,styles:f,unstyled:x,attributes:A,rootSelector:w?"datePickerRoot":void 0,varsResolver:Sq,vars:T}),{onDateChange:q,onRootMouseLeave:G,onHoveredDateChange:U,getControlProps:$,_value:D,setValue:z}=kq({type:N.type,level:"day",allowDeselect:n,allowSingleDateInRange:i,value:r,defaultValue:a,onChange:o,onMouseLeave:l}),{resolvedClassNames:H,resolvedStyles:Y}=Wi({classNames:u,styles:f,props:t}),P=v.jsx(id,{classNames:H,styles:Y,__staticSelector:h||"DatePicker",onMouseLeave:G,size:j,...M,...w?{}:N,__stopPropagation:b,__setDateRef:F,__setLevelRef:R,minLevel:M.minLevel||"month",__onDayMouseEnter:(L,Z)=>{U(Z),p==null||p(L,Z)},__onDayClick:(L,Z)=>{q(Z),d==null||d(L,Z)},getDayProps:L=>{var Z;return{...$(L),...(Z=M.getDayProps)==null?void 0:Z.call(M,L)}},getMonthControlProps:L=>{var Z;return{selected:typeof D=="string"?_9(L,D):!1,...(Z=M.getMonthControlProps)==null?void 0:Z.call(M,L)}},getYearControlProps:L=>{var Z;return{selected:typeof D=="string"?Be(L).isSame(D,"year"):!1,...(Z=M.getYearControlProps)==null?void 0:Z.call(M,L)}},hideOutsideDates:M.hideOutsideDates??M.numberOfColumns!==1,attributes:A,...w?{}:{className:k,style:_}});if(!w)return P;const W=L=>{var ie,re;const Z=Array.isArray(L)?L[0]:L;Z!==void 0&&((ie=F.current)==null||ie.call(F,Z),(re=R.current)==null||re.call(R,"month"),g?g(Z):z(L))},V=w.map((L,Z)=>v.jsx(En,{...I("presetButton"),onClick:()=>W(L.value),onMouseDown:ie=>ie.preventDefault(),"data-mantine-stop-propagation":b||void 0,children:L.label},Z));return v.jsxs(fe,{...I("datePickerRoot"),size:j,...N,children:[v.jsx("div",{...I("presetsList"),children:V}),P]})});kp.classes=id.classes;kp.varsResolver=Sq;kp.displayName="@mantine/dates/DatePicker";function Cq({type:e,value:t,defaultValue:n,onChange:i,locale:r,format:a,closeOnChange:o,sortDates:l,labelSeparator:u,valueFormatter:f}){const h=Ol(),[d,p]=zz(!1),[g,b]=x9({type:e,value:t,defaultValue:n,onChange:i}),w=zoe({type:e,date:g,locale:h.getLocale(r),format:a,labelSeparator:h.getLabelSeparator(u),formatter:f}),k=x=>{o&&(e==="default"&&p.close(),e==="range"&&x[0]&&x[1]&&p.close()),b(l&&e==="multiple"?[...x].sort((j,T)=>Be(j).isAfter(Be(T))?1:-1):x)};return{_value:g,setValue:k,onClear:()=>k(e==="range"?[null,null]:e==="multiple"?[]:null),shouldClear:e==="range"?!!g[0]:e==="multiple"?g.length>0:g!==null,formattedValue:w,dropdownOpened:d,dropdownHandlers:p}}const bse={type:"default",size:"sm",valueFormat:"MMMM YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},S9=De(e=>{const t=we("MonthPickerInput",bse,e),{type:n,value:i,defaultValue:r,onChange:a,valueFormat:o,labelSeparator:l,locale:u,classNames:f,styles:h,unstyled:d,closeOnChange:p,size:g,variant:b,dropdownType:w,sortDates:k,minDate:_,maxDate:x,vars:j,valueFormatter:T,presets:A,attributes:O,...M}=t,{resolvedClassNames:N,resolvedStyles:F}=Wi({classNames:f,styles:h,props:t}),{calendarProps:R,others:I}=S0(M),{_value:q,setValue:G,formattedValue:U,dropdownHandlers:$,dropdownOpened:D,onClear:z,shouldClear:H}=Cq({type:n,value:i,defaultValue:r,onChange:a,locale:u,format:o,labelSeparator:l,closeOnChange:p,sortDates:k,valueFormatter:T});return v.jsx(nd,{formattedValue:U,dropdownOpened:D,dropdownHandlers:$,classNames:N,styles:F,unstyled:d,onClear:z,shouldClear:H,value:q,size:g,variant:b,dropdownType:w,...I,attributes:O,type:n,__staticSelector:"MonthPickerInput",children:v.jsx(wp,{...R,size:g,variant:b,type:n,value:q,defaultDate:R.defaultDate||(Array.isArray(q)?q[0]||XS({maxDate:x,minDate:_}):q||XS({maxDate:x,minDate:_})),onChange:G,locale:u,classNames:N,styles:F,unstyled:d,__staticSelector:"MonthPickerInput",__stopPropagation:w==="popover",minDate:_,maxDate:x,presets:A,attributes:O})})});S9.classes={...nd.classes,...wp.classes};S9.displayName="@mantine/dates/MonthPickerInput";const wse={type:"default",size:"sm",valueFormat:"MMMM D, YYYY",closeOnChange:!0,sortDates:!0,dropdownType:"popover"},Cu=De(e=>{const t=we("DatePickerInput",wse,e),{type:n,value:i,defaultValue:r,onChange:a,valueFormat:o,labelSeparator:l,locale:u,classNames:f,styles:h,unstyled:d,closeOnChange:p,size:g,variant:b,dropdownType:w,sortDates:k,minDate:_,maxDate:x,vars:j,defaultDate:T,valueFormatter:A,presets:O,attributes:M,...N}=t,{resolvedClassNames:F,resolvedStyles:R}=Wi({classNames:f,styles:h,props:t}),{calendarProps:I,others:q}=S0(N),{_value:G,setValue:U,formattedValue:$,dropdownHandlers:D,dropdownOpened:z,onClear:H,shouldClear:Y}=Cq({type:n,value:i,defaultValue:r,onChange:a,locale:u,format:o,labelSeparator:l,closeOnChange:p,sortDates:k,valueFormatter:A}),P=Array.isArray(G)?G[0]||T:G||T;return v.jsx(nd,{formattedValue:$,dropdownOpened:z,dropdownHandlers:D,classNames:F,styles:R,unstyled:d,onClear:H,shouldClear:Y,value:G,size:g,variant:b,dropdownType:w,...q,type:n,__staticSelector:"DatePickerInput",attributes:M,children:v.jsx(kp,{...I,size:g,variant:b,type:n,value:G,defaultDate:P||XS({maxDate:x,minDate:_}),onChange:U,locale:u,classNames:F,styles:R,unstyled:d,__staticSelector:"DatePickerInput",__stopPropagation:w==="popover",minDate:_,maxDate:x,presets:O,attributes:M})})});Cu.classes={...nd.classes,...kp.classes};Cu.displayName="@mantine/dates/DatePickerInput";/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var kse={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const it=(e,t,n,i)=>{const r=S.forwardRef(({color:a="currentColor",size:o=24,stroke:l=2,title:u,className:f,children:h,...d},p)=>S.createElement("svg",{ref:p,...kse[e],width:o,height:o,className:["tabler-icon",`tabler-icon-${t}`,f].join(" "),strokeWidth:l,stroke:a,...d},[u&&S.createElement("title",{key:"svg-title"},u),...i.map(([g,b])=>S.createElement(g,b)),...Array.isArray(h)?h:[h]]));return r.displayName=`${n}`,r};/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const _se=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],ZS=it("outline","alert-triangle","AlertTriangle",_se);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const xse=[["path",{d:"M8 4h11a2 2 0 1 1 0 4h-7m-4 0h-3a2 2 0 0 1 -.826 -3.822",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 1.824 -1.18m.176 -3.82v-7",key:"svg-1"}],["path",{d:"M10 12h2",key:"svg-2"}],["path",{d:"M3 3l18 18",key:"svg-3"}]],Sse=it("outline","archive-off","ArchiveOff",xse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Cse=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",key:"svg-1"}],["path",{d:"M10 12l4 0",key:"svg-2"}]],jq=it("outline","archive","Archive",Cse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const jse=[["path",{d:"M9 14l-4 -4l4 -4",key:"svg-0"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1",key:"svg-1"}]],i1=it("outline","arrow-back-up","ArrowBackUp",jse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ase=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M3 12l18 0",key:"svg-2"}]],Ose=it("outline","arrows-horizontal","ArrowsHorizontal",Ase);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Tse=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0v-1.5a9 9 0 1 0 -5.5 8.28",key:"svg-1"}]],Ese=it("outline","at","At",Tse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Mse=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],Dse=it("outline","bell","Bell",Mse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Rse=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]],Aq=it("outline","calendar-due","CalendarDue",Rse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Pse=[["path",{d:"M9 5h9a2 2 0 0 1 2 2v9m-.184 3.839a2 2 0 0 1 -1.816 1.161h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 1.158 -1.815",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v1",key:"svg-2"}],["path",{d:"M4 11h7m4 0h5",key:"svg-3"}],["path",{d:"M3 3l18 18",key:"svg-4"}]],Nse=it("outline","calendar-off","CalendarOff",Pse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const $se=[["path",{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4",key:"svg-0"}],["path",{d:"M18 14v4h4",key:"svg-1"}],["path",{d:"M14 18a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-2"}],["path",{d:"M15 3v4",key:"svg-3"}],["path",{d:"M7 3v4",key:"svg-4"}],["path",{d:"M3 11h16",key:"svg-5"}]],zse=it("outline","calendar-stats","CalendarStats",$se);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Lse=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],Ise=it("outline","calendar","Calendar",Lse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Bse=[["path",{d:"M3 13a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -6",key:"svg-0"}],["path",{d:"M15 9a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -10",key:"svg-1"}],["path",{d:"M9 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -14",key:"svg-2"}],["path",{d:"M4 20h14",key:"svg-3"}]],Fse=it("outline","chart-bar","ChartBar",Bse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const qse=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],fs=it("outline","check","Check",qse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Hse=[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]],dm=it("outline","checkbox","Checkbox",Hse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Use=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],QS=it("outline","chevron-down","ChevronDown",Use);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Vse=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],JS=it("outline","chevron-right","ChevronRight",Vse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Wse=[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2",key:"svg-1"}],["path",{d:"M9 12l.01 0",key:"svg-2"}],["path",{d:"M13 12l2 0",key:"svg-3"}],["path",{d:"M9 16l.01 0",key:"svg-4"}],["path",{d:"M13 16l2 0",key:"svg-5"}]],jM=it("outline","clipboard-list","ClipboardList",Wse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Gse=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 12l3 2",key:"svg-1"}],["path",{d:"M12 7v5",key:"svg-2"}]],Yse=it("outline","clock-hour-4","ClockHour4",Gse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Kse=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],r1=it("outline","clock","Clock",Kse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Xse=[["path",{d:"M3 4a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v16a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-16",key:"svg-0"}],["path",{d:"M9 3v18",key:"svg-1"}],["path",{d:"M15 3v18",key:"svg-2"}]],Zse=it("outline","columns-3","Columns3",Xse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Qse=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],e4=it("outline","copy","Copy",Qse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Jse=[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-0"}],["path",{d:"M8 8.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-1"}],["path",{d:"M15 8.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-2"}],["path",{d:"M15 15.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-3"}],["path",{d:"M8 15.5a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-4"}],["path",{d:"M11.5 12a.5 .5 0 1 0 1 0a.5 .5 0 1 0 -1 0",fill:"currentColor",key:"svg-5"}]],ele=it("outline","dice-5","Dice5",Jse);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const tle=[["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],Oq=it("outline","dots-vertical","DotsVertical",tle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const nle=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],Tq=it("outline","download","Download",nle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ile=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],Rh=it("outline","edit","Edit",ile);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const rle=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],ale=it("outline","external-link","ExternalLink",rle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ole=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M8 11h8v7h-8l0 -7",key:"svg-2"}],["path",{d:"M8 15h8",key:"svg-3"}],["path",{d:"M11 11v7",key:"svg-4"}]],sle=it("outline","file-spreadsheet","FileSpreadsheet",ole);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const lle=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],ule=it("outline","file-text","FileText",lle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const cle=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4",key:"svg-1"}],["path",{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6",key:"svg-2"}],["path",{d:"M17 18h2",key:"svg-3"}],["path",{d:"M20 15h-3v6",key:"svg-4"}],["path",{d:"M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1",key:"svg-5"}]],fle=it("outline","file-type-pdf","FileTypePdf",cle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const dle=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}]],hle=it("outline","file","File",dle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const mle=[["path",{d:"M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]],Eq=it("outline","grip-vertical","GripVertical",mle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const ple=[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]],vle=it("outline","history","History",ple);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const gle=[["path",{d:"M6.5 7h11",key:"svg-0"}],["path",{d:"M6.5 17h11",key:"svg-1"}],["path",{d:"M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1",key:"svg-2"}],["path",{d:"M6 4v2a6 6 0 1 0 12 0v-2a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1",key:"svg-3"}]],a1=it("outline","hourglass","Hourglass",gle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const yle=[["path",{d:"M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0",key:"svg-0"}],["path",{d:"M15 9h.01",key:"svg-1"}]],ble=it("outline","key","Key",yle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const wle=[["path",{d:"M4 4l6 0",key:"svg-0"}],["path",{d:"M14 4l6 0",key:"svg-1"}],["path",{d:"M4 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -8",key:"svg-2"}],["path",{d:"M14 10a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2l0 -2",key:"svg-3"}]],t4=it("outline","layout-kanban","LayoutKanban",wle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const kle=[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]],_le=it("outline","link","Link",kle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const xle=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -6",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]],Mq=it("outline","lock-open","LockOpen",xle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Sle=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]],ll=it("outline","lock","Lock",Sle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Cle=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],jle=it("outline","logout","Logout",Cle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ale=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],Ole=it("outline","menu-2","Menu2",Ale);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Tle=[["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-0"}],["path",{d:"M9.5 9h.01",key:"svg-1"}],["path",{d:"M14.5 9h.01",key:"svg-2"}],["path",{d:"M9.5 13a3.5 3.5 0 0 0 5 0",key:"svg-3"}]],Dq=it("outline","message-chatbot","MessageChatbot",Tle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ele=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12",key:"svg-2"}]],Rq=it("outline","message","Message",Ele);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Mle=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10l.01 0",key:"svg-1"}],["path",{d:"M15 10l.01 0",key:"svg-2"}],["path",{d:"M9.5 15a3.5 3.5 0 0 0 5 0",key:"svg-3"}]],Dle=it("outline","mood-smile","MoodSmile",Mle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Rle=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],C9=it("outline","palette","Palette",Rle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ple=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],Pq=it("outline","paperclip","Paperclip",Ple);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Nle=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],$le=it("outline","pencil","Pencil",Nle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const zle=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],Lle=it("outline","photo","Photo",zle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ile=[["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5",key:"svg-0"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5",key:"svg-1"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-2"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-3"}],["path",{d:"M10 11l-2 2",key:"svg-4"}],["path",{d:"M13 14l-2 2",key:"svg-5"}]],Ble=it("outline","plug-connected","PlugConnected",Ile);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Fle=[["path",{d:"M9.785 6l8.215 8.215l-2.054 2.054a5.81 5.81 0 1 1 -8.215 -8.215l2.054 -2.054",key:"svg-0"}],["path",{d:"M4 20l3.5 -3.5",key:"svg-1"}],["path",{d:"M15 4l-3.5 3.5",key:"svg-2"}],["path",{d:"M20 9l-3.5 3.5",key:"svg-3"}]],Nq=it("outline","plug","Plug",Fle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const qle=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],ff=it("outline","plus","Plus",qle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Hle=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],hm=it("outline","refresh","Refresh",Hle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Ule=[["path",{d:"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],Vle=it("outline","search","Search",Ule);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Wle=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],$q=it("outline","send","Send",Wle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Gle=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Yle=it("outline","settings","Settings",Gle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Kle=[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",key:"svg-0"}]],Xle=it("outline","sparkles","Sparkles",Kle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Zle=[["path",{d:"M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3",key:"svg-1"}]],Qle=it("outline","tag","Tag",Zle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const Jle=[["path",{d:"M20 8.04l-12.122 12.124a2.857 2.857 0 1 1 -4.041 -4.04l12.122 -12.124",key:"svg-0"}],["path",{d:"M7 13h8",key:"svg-1"}],["path",{d:"M19 15l1.5 1.6a2 2 0 1 1 -3 0l1.5 -1.6",key:"svg-2"}],["path",{d:"M15 3l6 6",key:"svg-3"}]],eue=it("outline","test-pipe","TestPipe",Jle);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const tue=[["path",{d:"M4 7h16",key:"svg-0"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-1"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-2"}],["path",{d:"M10 12l4 4m0 -4l-4 4",key:"svg-3"}]],nue=it("outline","trash-x","TrashX",tue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const iue=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],yo=it("outline","trash","Trash",iue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const rue=[["path",{d:"M3 17l6 -6l4 4l8 -8",key:"svg-0"}],["path",{d:"M14 7l7 0l0 7",key:"svg-1"}]],n4=it("outline","trending-up","TrendingUp",rue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const aue=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],oue=it("outline","upload","Upload",aue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const sue=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4",key:"svg-1"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-2"}]],lue=it("outline","user-check","UserCheck",sue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const uue=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]],cue=it("outline","user-circle","UserCircle",uue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const fue=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4c.348 0 .686 .045 1.009 .128",key:"svg-1"}],["path",{d:"M16 19h6",key:"svg-2"}]],due=it("outline","user-minus","UserMinus",fue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const hue=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M16 19h6",key:"svg-1"}],["path",{d:"M19 16v6",key:"svg-2"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4",key:"svg-3"}]],mue=it("outline","user-plus","UserPlus",hue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const pue=[["path",{d:"M9 10a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M6 21v-1a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v1",key:"svg-1"}],["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14",key:"svg-2"}]],vue=it("outline","user-square","UserSquare",pue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const gue=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],yue=it("outline","user","User",gue);/** + * @license @tabler/icons-react v3.42.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const bue=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Ph=it("outline","x","X",bue);function wue(e,t,n){const i=e.replace(/]/g,"");return n?`![${i}](${t})`:`[${i}](${t})`}function zq({initial:e,submitLabel:t="Guardar",users:n=[],requesterOptions:i=[],tagOptions:r=[],cardId:a,onFileUploaded:o,onSubmit:l,onCancel:u}){const[f,h]=S.useState((e==null?void 0:e.requester)??""),[d,p]=S.useState((e==null?void 0:e.title)??""),[g,b]=S.useState((e==null?void 0:e.description)??""),[w,k]=S.useState((e==null?void 0:e.assignee_id)??null),[_,x]=S.useState((e==null?void 0:e.tags)??[]),[j,T]=S.useState(!1),[A,O]=S.useState(!1),M=S.useRef(null),N=async $=>{$==null||$.preventDefault();const D=d.trim();D&&await l({requester:f.trim(),title:D,description:g,assignee_id:w,tags:_})},F=$=>{$.key==="Enter"&&($.ctrlKey||$.metaKey)&&($.preventDefault(),N())},R=$=>{const D=M.current;if(!D){b(L=>L?L+` +`+$:$);return}const z=D.selectionStart??g.length,H=D.selectionEnd??g.length,Y=g.slice(0,z),P=g.slice(H),W=Y&&!Y.endsWith(` +`)?` +`:"",V=Y+W+$+P;b(V),queueMicrotask(()=>{D.focus();const L=(Y+W+$).length;D.setSelectionRange(L,L)})},I=async $=>{if(!a){ft.show({color:"yellow",message:"Guarda la tarjeta antes de subir archivos."});return}O(!0);try{for(const D of Array.from($))try{const z=await c9(a,D,"description");R(wue(z.filename,z.url,z.mime.startsWith("image/"))),o==null||o()}catch(z){ft.show({color:"red",message:`${D.name}: ${z.message}`})}}finally{O(!1)}},q=$=>{$.preventDefault(),T(!1),!(!$.dataTransfer.files||$.dataTransfer.files.length===0)&&I($.dataTransfer.files)},G=$=>{a&&$.dataTransfer.types.includes("Files")&&($.preventDefault(),T(!0))},U=$=>{$.preventDefault(),T(!1)};return v.jsx("form",{onSubmit:N,children:v.jsxs(Ot,{gap:"sm",children:[v.jsx(kl,{label:"Tarea",value:d,onChange:$=>p($.currentTarget.value),tabIndex:1,required:!0,autoComplete:"off","data-autofocus":!0,autosize:!0,minRows:1,maxRows:4,onKeyDown:$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),N())}}),v.jsx($y,{label:"Solicitante",value:f,onChange:h,data:i,tabIndex:2,autoComplete:"off","data-field":"requester",placeholder:"Empieza a escribir y elige uno existente",limit:10,onKeyDown:$=>{$.key==="Enter"&&$.preventDefault()}}),v.jsxs(fe,{onDrop:q,onDragOver:G,onDragLeave:U,style:{position:"relative",outline:j?"2px dashed var(--mantine-color-blue-5)":void 0,outlineOffset:j?2:void 0,borderRadius:4},children:[v.jsx(kl,{ref:M,label:"Descripcion",value:g,onChange:$=>b($.currentTarget.value),tabIndex:3,autosize:!0,minRows:3,maxRows:8,onKeyDown:F,description:a?"Ctrl+Enter para guardar. Arrastra archivos para adjuntar.":"Ctrl+Enter para guardar"}),(j||A)&&v.jsx(fe,{style:{position:"absolute",inset:0,background:"rgba(34,139,230,0.08)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",borderRadius:4},children:v.jsx(ge,{size:"sm",fw:500,c:"blue",children:A?"Subiendo...":"Suelta para adjuntar"})})]}),v.jsx(Wr,{label:"Asignar a",placeholder:"Sin asignar",value:w,onChange:$=>k($),data:n.map($=>({value:$.id,label:$.display_name||$.username})),clearable:!0,searchable:!0,tabIndex:4}),v.jsx(r9,{label:"Tags",value:_,onChange:x,data:r,clearable:!0,tabIndex:5,placeholder:"Enter para añadir; sugiere existentes",splitChars:[","," "]}),v.jsxs(Pe,{justify:"flex-end",gap:"xs",mt:"xs",children:[v.jsx(tn,{variant:"subtle",color:"gray",tabIndex:7,type:"button",onClick:u,children:"Cancelar"}),v.jsx(tn,{tabIndex:6,type:"submit",disabled:!d.trim(),children:t})]})]})})}function kue(e,t){if(t.length===0)throw new Error("palette must not be empty");let n=0;for(let i=0;i>>0;return t[n%t.length]}const j9=new Set(["blue","cyan","teal","green","lime","yellow","orange","red","pink","grape","violet","indigo","gray","dark"]);function A9(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Lq(e){return e?A9(e)?`color-mix(in srgb, ${e} 18%, var(--mantine-color-dark-6))`:j9.has(e)?`color-mix(in srgb, var(--mantine-color-${e}-9) 18%, var(--mantine-color-dark-6))`:"var(--mantine-color-dark-6)":"var(--mantine-color-dark-6)"}function O9(e){return e?A9(e)?`color-mix(in srgb, ${e} 30%, var(--mantine-color-dark-4))`:j9.has(e)?`color-mix(in srgb, var(--mantine-color-${e}-7) 30%, var(--mantine-color-dark-4))`:"var(--mantine-color-dark-4)":"var(--mantine-color-dark-4)"}function _ue(e){return e?A9(e)?e:j9.has(e)?`var(--mantine-color-${e}-7)`:"var(--mantine-color-dark-3)":"var(--mantine-color-dark-3)"}const Iq=[{value:"",label:"Default"},{value:"blue",label:"Azul"},{value:"cyan",label:"Cian"},{value:"teal",label:"Teal"},{value:"green",label:"Verde"},{value:"lime",label:"Lima"},{value:"yellow",label:"Amarillo"},{value:"orange",label:"Naranja"},{value:"red",label:"Rojo"},{value:"pink",label:"Rosa"},{value:"grape",label:"Uva"},{value:"violet",label:"Violeta"},{value:"indigo",label:"Indigo"},{value:"gray",label:"Gris"},{value:"#0ea5e9",label:"Sky"},{value:"#14b8a6",label:"Esmeralda"},{value:"#84cc16",label:"Lima fluor"},{value:"#ec4899",label:"Magenta"},{value:"#a855f7",label:"Lavanda"},{value:"#f97316",label:"Mandarina"},{value:"#dc2626",label:"Rubi"},{value:"#0891b2",label:"Petroleo"},{value:"#fde047",label:"Limon"},{value:"#10b981",label:"Menta"},{value:"#fb7185",label:"Coral"},{value:"#6366f1",label:"Iris"},{value:"#94a3b8",label:"Pizarra"}],xue=Iq,Sue=["blue","cyan","teal","green","lime","yellow","orange","red","pink","grape","violet","indigo"];function ju(e){return kue(e,Sue)}const i4=6e4,Nh=60*i4,Gc=24*Nh,ng=7*Gc,Qk=30*Gc;function ei(e){if(!Number.isFinite(e)||e<0)return"0m";if(en&&t.push({kind:"text",value:e.slice(n,i.index)}),i[1]){const r=Cue(i[3]);r?t.push({kind:"img",alt:i[2]||"",url:r}):t.push({kind:"text",value:i[0]})}else if(i[4]){const r=Bq(i[6]);r?t.push({kind:"link",label:i[5],url:r}):t.push({kind:"text",value:i[0]})}n=Jk.lastIndex}return n{i.length!==0&&(r.push(v.jsx(ge,{size:t,style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i.map((l,u)=>v.jsx(S.Fragment,{children:l},u))},`t-${a++}`)),i.length=0)};for(const l of n)l.kind==="img"?(o(),r.push(v.jsx(wl,{href:l.url,target:"_blank",rel:"noopener noreferrer",children:v.jsx(cp,{src:l.url,alt:l.alt,maw:220,mah:220,fit:"contain",radius:"sm"})},`i-${a++}`))):l.kind==="link"?i.push(v.jsx(wl,{href:l.url,target:"_blank",rel:"noopener noreferrer",children:l.label},`l-${a++}`)):i.push(l.value);return o(),v.jsx(v.Fragment,{children:r})}function Oue(e,t,n){const i=e.replace(/]/g,"");return n.startsWith("image/")?`![${i}](${t})`:`[${i}](${t})`}const Tue=4e3,Eue=1500;function Mue(e,t){for(let n=t-1;n>=0&&t-n<=64;n--){const i=e[n];if(i==="@"){if(n===0||/\s/.test(e[n-1])){const r=e.slice(n+1,t);if(/^[a-z0-9_.-]*$/i.test(r))return{start:n,query:r.toLowerCase()}}return null}if(/\s/.test(i))return null}return null}function Due({cardId:e,users:t,currentUserId:n,onMessagesChange:i,onFileUploaded:r,highlightMessageId:a}){const[o,l]=S.useState([]),[u,f]=S.useState(!0),[h,d]=S.useState(""),[p,g]=S.useState(!1),[b,w]=S.useState(!1),[k,_]=S.useState(!1),[x,j]=S.useState({}),[T,A]=S.useState(null),O=S.useRef(null),M=S.useRef(null),N=S.useRef(null),F=S.useRef(0),R=S.useMemo(()=>new Map(t.map(X=>[X.id,X])),[t]),I=S.useCallback(async()=>{try{const X=await vre(e);l(X),i==null||i(X)}catch(X){ft.show({color:"red",message:X.message})}finally{f(!1)}},[e,i]);S.useEffect(()=>{I()},[I]),S.useEffect(()=>{const X=new WebSocket(wre(e));return M.current=X,X.onmessage=le=>{try{const ee=JSON.parse(le.data);ee.type==="message.created"&&ee.message?l(se=>{if(se.some(ne=>ne.id===ee.message.id))return se;const ke=[...se,ee.message];return i==null||i(ke),ke}):ee.type==="typing"&&ee.user_id?j(se=>({...se,[ee.user_id]:Date.now()})):ee.type==="error"&&ft.show({color:"red",message:ee.error})}catch{}},X.onerror=()=>{},()=>{X.close(),M.current=null}},[e,i]),S.useEffect(()=>{const X=setInterval(()=>{const le=Date.now();j(ee=>{const se={};for(const[ke,ne]of Object.entries(ee))le-neclearInterval(X)},[]),S.useEffect(()=>{O.current&&O.current.scrollTo({top:O.current.scrollHeight,behavior:"smooth"})},[o.length]);const[q,G]=S.useState(null);S.useEffect(()=>{if(!a||!o.some(ee=>ee.id===a))return;const X=document.querySelector(`[data-msg-id="${a}"]`);X&&X instanceof HTMLElement&&X.scrollIntoView({behavior:"smooth",block:"center"}),G(a);const le=setTimeout(()=>G(null),2200);return()=>clearTimeout(le)},[a,o]);const U=()=>{const X=M.current;if(!X||X.readyState!==WebSocket.OPEN)return;const le=Date.now();le-F.currentA(null)}),D=S.useMemo(()=>T?t.filter(X=>X.username.toLowerCase().startsWith(T.query)).slice(0,8):[],[t,T]);S.useEffect(()=>{T&&D.length>0?($.openDropdown(),$.selectFirstOption()):$.closeDropdown()},[T==null?void 0:T.query,D.length]);const z=X=>{if(!T)return;const le=h.slice(0,T.start),ee=h.slice(T.start+1+T.query.length),se=`@${X} `,ke=le+se+ee;d(ke),A(null),requestAnimationFrame(()=>{const ne=N.current;if(!ne)return;const $e=(le+se).length;ne.focus(),ne.setSelectionRange($e,$e)})},H=async()=>{const X=h.trim();if(!X||p)return;g(!0);const le=M.current;try{if(le&&le.readyState===WebSocket.OPEN)le.send(JSON.stringify({type:"send",body:X})),d("");else{const ee=await iM(e,X);l(se=>[...se,ee]),i==null||i([...o,ee]),d("")}}catch(ee){ft.show({color:"red",message:ee.message})}finally{g(!1)}},Y=async X=>{try{await gre(e,X);const le=o.filter(ee=>ee.id!==X);l(le),i==null||i(le)}catch(le){ft.show({color:"red",message:le.message})}},P=X=>{d(X.currentTarget.value),U();const le=X.currentTarget.selectionStart??X.currentTarget.value.length;A(Mue(X.currentTarget.value,le))},W=X=>{if(T&&D.length>0&&(X.key==="Enter"||X.key==="Tab")){X.preventDefault();const le=$.getSelectedOptionIndex(),ee=D[Math.max(0,le)];ee&&z(ee.username);return}if(T&&X.key==="Escape"){A(null);return}X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),H())},V=async X=>{w(!0);try{for(const le of Array.from(X))try{const ee=await c9(e,le,"chat"),se=Oue(ee.filename,ee.url,ee.mime),ke=await iM(e,se);l(ne=>{const $e=[...ne,ke];return i==null||i($e),$e}),r==null||r()}catch(ee){ft.show({color:"red",message:`${le.name}: ${ee.message}`})}}finally{w(!1)}},L=X=>{X.preventDefault(),_(!1),!(!X.dataTransfer.files||X.dataTransfer.files.length===0)&&V(X.dataTransfer.files)},Z=X=>{X.dataTransfer.types.includes("Files")&&(X.preventDefault(),_(!0))},ie=X=>{X.preventDefault(),_(!1)},re=Object.keys(x).filter(X=>X!==n).map(X=>{const le=R.get(X);return(le==null?void 0:le.display_name)||(le==null?void 0:le.username)||"alguien"});return v.jsxs(Ot,{gap:"xs",style:{height:"100%",minHeight:0,position:"relative",outline:k?"2px dashed var(--mantine-color-blue-5)":void 0,outlineOffset:k?-2:void 0,borderRadius:4},onDrop:L,onDragOver:Z,onDragLeave:ie,children:[v.jsx(lr,{viewportRef:O,style:{flex:1,minHeight:200},type:"auto",offsetScrollbars:!0,children:u?v.jsx(Pe,{justify:"center",p:"md",children:v.jsx(Jn,{size:"sm"})}):o.length===0?v.jsx(ge,{size:"sm",c:"dimmed",ta:"center",p:"md",children:"Sin mensajes aun. Escribe el primero o arrastra un archivo."}):v.jsx(Ot,{gap:6,p:4,children:o.map(X=>{const le=X.author_id?R.get(X.author_id):null,ee=X.author_id&&X.author_id===n,se=le?le.display_name||le.username:"Anonimo",ke=q===X.id;return v.jsx(Tn,{withBorder:!0,p:"xs",radius:"sm","data-msg-id":X.id,bg:ke?"var(--mantine-color-yellow-light)":ee?"var(--mantine-color-blue-light)":void 0,style:{transition:"background-color 600ms ease",boxShadow:ke?"0 0 0 2px var(--mantine-color-yellow-5)":void 0},children:v.jsxs(Pe,{gap:6,wrap:"nowrap",align:"flex-start",children:[v.jsx(vo,{size:22,radius:"xl",color:(le==null?void 0:le.color)||ju(se),children:se.slice(0,2).toUpperCase()}),v.jsxs(fe,{style:{flex:1,minWidth:0},children:[v.jsxs(Pe,{gap:6,wrap:"nowrap",justify:"space-between",children:[v.jsxs(Pe,{gap:6,wrap:"nowrap",children:[v.jsx(ge,{size:"xs",fw:600,children:se}),v.jsx(ge,{size:"xs",c:"dimmed",children:Au(X.created_at)})]}),ee&&v.jsx(kn,{label:"Borrar",withArrow:!0,children:v.jsx(Zt,{size:"xs",variant:"subtle",color:"red",onClick:()=>Y(X.id),children:v.jsx(yo,{size:12})})})]}),v.jsx(Ot,{gap:4,children:v.jsx(Aue,{text:X.body})})]})]})},X.id)})})}),re.length>0&&v.jsx(ge,{size:"xs",c:"dimmed",px:6,children:re.length===1?`${re[0]} esta escribiendo...`:`${re.slice(0,2).join(", ")}${re.length>2?"...":""} estan escribiendo...`}),v.jsxs(jt,{store:$,onOptionSubmit:X=>z(X),position:"top-start",withinPortal:!1,children:[v.jsx(jt.DropdownTarget,{children:v.jsxs(Pe,{gap:"xs",align:"flex-end",children:[v.jsx(kl,{ref:N,value:h,onChange:P,onKeyDown:W,placeholder:"Escribe un mensaje (Enter = enviar, @ para mencionar). Arrastra archivos o usa el clip.",autosize:!0,minRows:1,maxRows:6,style:{flex:1},disabled:p}),v.jsx(BC,{onChange:X=>X&&V([X]),disabled:b,children:X=>v.jsx(kn,{label:"Adjuntar archivo",withArrow:!0,children:v.jsx(Zt,{size:"lg",variant:"subtle",color:"gray","aria-label":"Adjuntar",loading:b,...X,children:v.jsx(Pq,{size:16})})})}),v.jsx(kn,{label:"Enviar",withArrow:!0,children:v.jsx(Zt,{size:"lg",variant:"filled",color:"blue",onClick:H,disabled:!h.trim()||p,"aria-label":"Enviar",children:v.jsx($q,{size:16})})})]})}),v.jsx(jt.Dropdown,{hidden:!T||D.length===0,children:v.jsx(jt.Options,{children:D.map(X=>v.jsx(jt.Option,{value:X.username,children:v.jsxs(Pe,{gap:6,wrap:"nowrap",children:[v.jsx(vo,{size:18,radius:"xl",color:X.color||ju(X.username),children:(X.display_name||X.username).slice(0,2).toUpperCase()}),v.jsxs(ge,{size:"sm",fw:600,children:["@",X.username]}),X.display_name&&X.display_name!==X.username&&v.jsx(ge,{size:"xs",c:"dimmed",children:X.display_name})]})},X.id))})})]}),(k||b)&&v.jsx(fe,{style:{position:"absolute",inset:0,background:"rgba(34,139,230,0.08)",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",borderRadius:4},children:v.jsx(ge,{size:"sm",fw:500,c:"blue",children:b?"Subiendo...":"Suelta para adjuntar"})})]})}function Rue(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function Pue(e){return e.startsWith("image/")}function Nue(e,t=18){const n=e.toLowerCase();return n.startsWith("image/")?v.jsx(Lle,{size:t}):n==="application/pdf"?v.jsx(fle,{size:t}):n.includes("spreadsheet")||n.includes("excel")||n==="text/csv"||n==="application/vnd.ms-excel"?v.jsx(sle,{size:t}):n.startsWith("text/")?v.jsx(ule,{size:t}):v.jsx(hle,{size:t})}function $ue(e){return e==="description"?{color:"blue",label:"descripcion"}:e==="chat"?{color:"teal",label:"chat"}:{color:"gray",label:"subido"}}function zue({cardId:e,refreshKey:t}){const[n,i]=S.useState([]),[r,a]=S.useState(!0),[o,l]=S.useState(!1),u=S.useCallback(async()=>{try{const d=await Rre(e);i(d)}catch(d){ft.show({color:"red",message:d.message})}finally{a(!1)}},[e]);S.useEffect(()=>{u()},[u,t]);const f=async d=>{if(d){l(!0);try{const p=await c9(e,d,"upload");i(g=>[...g,p])}catch(p){ft.show({color:"red",message:p.message})}finally{l(!1)}}},h=async d=>{if(window.confirm("¿Borrar este archivo?"))try{await Pre(d),i(p=>p.filter(g=>g.id!==d))}catch(p){ft.show({color:"red",message:p.message})}};return v.jsxs(Ot,{gap:"xs",p:4,children:[v.jsxs(Pe,{justify:"space-between",children:[v.jsxs(ge,{size:"xs",c:"dimmed",children:[n.length," archivo",n.length===1?"":"s"]}),v.jsx(BC,{onChange:f,disabled:o,children:d=>v.jsx(tn,{size:"xs",variant:"light",leftSection:v.jsx(oue,{size:14}),loading:o,...d,children:"Subir"})})]}),r?v.jsx(Pe,{justify:"center",p:"md",children:v.jsx(Jn,{size:"sm"})}):n.length===0?v.jsxs(Ot,{gap:"xs",p:"md",align:"center",justify:"center",style:{minHeight:160},children:[v.jsx(ge,{size:"sm",c:"dimmed",children:"Sin archivos"}),v.jsx(ge,{size:"xs",c:"dimmed",ta:"center",children:"Sube archivos con el boton, arrastra al chat o a la descripcion."})]}):v.jsx(Ot,{gap:6,children:n.map(d=>{const p=$ue(d.source);return v.jsx(Tn,{withBorder:!0,p:"xs",radius:"sm",children:v.jsxs(Pe,{gap:"xs",wrap:"nowrap",align:"flex-start",children:[Pue(d.mime)?v.jsx(wl,{href:d.url,target:"_blank",rel:"noopener noreferrer",children:v.jsx(cp,{src:d.url,alt:d.filename,w:64,h:64,fit:"cover",radius:"sm"})}):v.jsx(fe,{style:{width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--mantine-color-gray-1)",borderRadius:4},children:Nue(d.mime,28)}),v.jsxs(fe,{style:{flex:1,minWidth:0},children:[v.jsx(wl,{href:d.url,target:"_blank",rel:"noopener noreferrer",size:"sm",style:{wordBreak:"break-all"},children:d.filename}),v.jsxs(Pe,{gap:6,mt:4,children:[v.jsx(ln,{size:"xs",variant:"light",color:p.color,children:p.label}),v.jsx(ge,{size:"xs",c:"dimmed",children:Rue(d.size)}),v.jsx(ge,{size:"xs",c:"dimmed",children:d.mime||"?"})]})]}),v.jsxs(Pe,{gap:4,wrap:"nowrap",children:[v.jsx(kn,{label:"Descargar",withArrow:!0,children:v.jsx(Zt,{component:"a",href:d.url,download:d.filename,variant:"subtle",size:"sm","aria-label":"Descargar",children:v.jsx(Tq,{size:14})})}),v.jsx(kn,{label:"Borrar",withArrow:!0,children:v.jsx(Zt,{variant:"subtle",color:"red",size:"sm",onClick:()=>h(d.id),"aria-label":"Borrar",children:v.jsx(yo,{size:14})})})]})]})},d.id)})})]})}const AM=/(https?:\/\/[^\s<>()"']+)/gi;function e_(e,t){if(!t)return[];const n=[],i=new Set;let r;for(AM.lastIndex=0;(r=AM.exec(t))!==null;){let a=r[1];a=a.replace(/[.,;:!?)\]}>]+$/,""),!i.has(a)&&(i.add(a),n.push({url:a,source:e,context:t}))}return n}function Lue(e){try{return new URL(e).hostname}catch{return e}}function Iue({card:e,messages:t}){const n=S.useMemo(()=>{const a=[...e_("title",e.title),...e_("description",e.description),...t.flatMap(l=>e_("chat",l.body))],o=new Set;return a.filter(l=>o.has(l.url)?!1:(o.add(l.url),!0))},[e.title,e.description,t]);if(n.length===0)return v.jsxs(Ot,{gap:"xs",p:"md",align:"center",justify:"center",style:{minHeight:200},children:[v.jsx(ge,{size:"sm",c:"dimmed",children:"Sin enlaces detectados"}),v.jsx(ge,{size:"xs",c:"dimmed",ta:"center",children:"Pega URLs en el titulo, descripcion o chat y apareceran aqui."})]});const i=a=>a==="title"?"grape":a==="description"?"blue":"teal",r=a=>a==="title"?"titulo":a==="description"?"descripcion":"chat";return v.jsx(Ot,{gap:6,p:4,children:n.map(a=>v.jsx(Tn,{withBorder:!0,p:"xs",radius:"sm",children:v.jsxs(Pe,{gap:"xs",wrap:"nowrap",justify:"space-between",align:"flex-start",children:[v.jsxs(fe,{style:{flex:1,minWidth:0},children:[v.jsx(wl,{href:a.url,target:"_blank",rel:"noopener noreferrer",size:"sm",style:{wordBreak:"break-all"},children:v.jsxs(Pe,{gap:4,wrap:"nowrap",align:"center",children:[v.jsx(ale,{size:12}),v.jsx("span",{children:Lue(a.url)})]})}),v.jsx(ge,{size:"xs",c:"dimmed",style:{wordBreak:"break-all"},children:a.url})]}),v.jsx(ln,{size:"xs",variant:"light",color:i(a.source),children:r(a.source)})]})},a.url))})}function Bue({card:e,users:t,currentUserId:n,requesterOptions:i,tagOptions:r,onSubmit:a,onCancel:o,highlightMessageId:l}){const[u,f]=S.useState([]),[h,d]=S.useState(e),[p,g]=S.useState(0),b=async k=>{d(_=>({..._,title:k.title,description:k.description,requester:k.requester,tags:k.tags,assignee_id:k.assignee_id})),await a(k)},w=()=>g(k=>k+1);return v.jsxs(Pe,{align:"stretch",gap:"md",wrap:"nowrap",style:{minHeight:460},children:[v.jsx(fe,{style:{flex:"1 1 0",minWidth:320},children:v.jsx(zq,{users:t,requesterOptions:i,tagOptions:r,initial:{requester:h.requester,title:h.title,description:h.description,assignee_id:h.assignee_id,tags:h.tags||[]},submitLabel:"Guardar",cardId:h.id,onFileUploaded:w,onSubmit:b,onCancel:o})}),v.jsx(cs,{orientation:"vertical"}),v.jsx(fe,{style:{flex:"1 1 0",minWidth:320,display:"flex",flexDirection:"column"},children:v.jsxs(Gn,{defaultValue:"chat",keepMounted:!1,style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[v.jsxs(Gn.List,{children:[v.jsx(Gn.Tab,{value:"chat",leftSection:v.jsx(Rq,{size:14}),children:"Chat"}),v.jsx(Gn.Tab,{value:"links",leftSection:v.jsx(_le,{size:14}),children:"Enlaces"}),v.jsx(Gn.Tab,{value:"files",leftSection:v.jsx(Pq,{size:14}),children:"Archivos"})]}),v.jsxs(fe,{pt:"xs",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[v.jsx(Gn.Panel,{value:"chat",style:{flex:1,minHeight:0,display:"flex"},children:v.jsx(fe,{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",width:"100%"},children:v.jsx(Due,{cardId:h.id,users:t,currentUserId:n,onMessagesChange:f,onFileUploaded:w,highlightMessageId:l})})}),v.jsx(Gn.Panel,{value:"links",children:v.jsx(Iue,{card:h,messages:u})}),v.jsx(Gn.Panel,{value:"files",children:v.jsx(zue,{cardId:h.id,refreshKey:p})})]})]})})]})}function Fue(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const que=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uue={};function OM(e,t){return(Uue.jsx?Hue:que).test(e)}const Vue=/[ \t\n\f\r]/g;function Wue(e){return typeof e=="object"?e.type==="text"?TM(e.value):!1:TM(e)}function TM(e){return e.replace(Vue,"")===""}class _p{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}_p.prototype.normal={};_p.prototype.property={};_p.prototype.space=void 0;function Fq(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new _p(n,i,t)}function r4(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let Gue=0;const Ht=qu(),gi=qu(),a4=qu(),Ve=qu(),In=qu(),ef=qu(),Lr=qu();function qu(){return 2**++Gue}const o4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ht,booleanish:gi,commaOrSpaceSeparated:Lr,commaSeparated:ef,number:Ve,overloadedBoolean:a4,spaceSeparated:In},Symbol.toStringTag,{value:"Module"})),t_=Object.keys(o4);class T9 extends Cr{constructor(t,n,i,r){let a=-1;if(super(t,n),EM(this,"space",r),typeof i=="number")for(;++a4&&n.slice(0,4)==="data"&&Que.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(MM,tce);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!MM.test(a)){let o=a.replace(Zue,ece);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=T9}return new r(i,t)}function ece(e){return"-"+e.toLowerCase()}function tce(e){return e.charAt(1).toUpperCase()}const nce=Fq([qq,Yue,Vq,Wq,Gq],"html"),E9=Fq([qq,Kue,Vq,Wq,Gq],"svg");function ice(e){return e.join(" ").trim()}var zc={},n_,DM;function rce(){if(DM)return n_;DM=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` +`,f="/",h="*",d="",p="comment",g="declaration";function b(k,_){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];_=_||{};var x=1,j=1;function T(U){var $=U.match(t);$&&(x+=$.length);var D=U.lastIndexOf(u);j=~D?U.length-D:j+U.length}function A(){var U={line:x,column:j};return function($){return $.position=new O(U),F(),$}}function O(U){this.start=U,this.end={line:x,column:j},this.source=_.source}O.prototype.content=k;function M(U){var $=new Error(_.source+":"+x+":"+j+": "+U);if($.reason=U,$.filename=_.source,$.line=x,$.column=j,$.source=k,!_.silent)throw $}function N(U){var $=U.exec(k);if($){var D=$[0];return T(D),k=k.slice(D.length),$}}function F(){N(n)}function R(U){var $;for(U=U||[];$=I();)$!==!1&&U.push($);return U}function I(){var U=A();if(!(f!=k.charAt(0)||h!=k.charAt(1))){for(var $=2;d!=k.charAt($)&&(h!=k.charAt($)||f!=k.charAt($+1));)++$;if($+=2,d===k.charAt($-1))return M("End of comment missing");var D=k.slice(2,$-2);return j+=2,T(D),k=k.slice($),j+=2,U({type:p,comment:D})}}function q(){var U=A(),$=N(i);if($){if(I(),!N(r))return M("property missing ':'");var D=N(a),z=U({type:g,property:w($[0].replace(e,d)),value:D?w(D[0].replace(e,d)):d});return N(o),z}}function G(){var U=[];R(U);for(var $;$=q();)$!==!1&&(U.push($),R(U));return U}return F(),G()}function w(k){return k?k.replace(l,d):d}return n_=b,n_}var RM;function ace(){if(RM)return zc;RM=1;var e=zc&&zc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zc,"__esModule",{value:!0}),zc.default=n;const t=e(rce());function n(i,r){let a=null;if(!i||typeof i!="string")return a;const o=(0,t.default)(i),l=typeof r=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:h}=u;l?r(f,h,u):h&&(a=a||{},a[f]=h)}),a}return zc}var mh={},PM;function oce(){if(PM)return mh;PM=1,Object.defineProperty(mh,"__esModule",{value:!0}),mh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,h){return h.toUpperCase()},l=function(f,h){return"".concat(h,"-")},u=function(f,h){return h===void 0&&(h={}),a(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(r,l):f=f.replace(i,l),f.replace(t,o))};return mh.camelCase=u,mh}var ph,NM;function sce(){if(NM)return ph;NM=1;var e=ph&&ph.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(ace()),n=oce();function i(r,a){var o={};return!r||typeof r!="string"||(0,t.default)(r,function(l,u){l&&u&&(o[(0,n.camelCase)(l,a)]=u)}),o}return i.default=i,ph=i,ph}var lce=sce();const uce=gn(lce),Yq=Kq("end"),M9=Kq("start");function Kq(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function cce(e){const t=M9(e),n=Yq(e);if(t&&n)return{start:t,end:n}}function Vh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$M(e.position):"start"in e||"end"in e?$M(e):"line"in e||"column"in e?s4(e):""}function s4(e){return zM(e&&e.line)+":"+zM(e&&e.column)}function $M(e){return s4(e&&e.start)+"-"+s4(e&&e.end)}function zM(e){return e&&typeof e=="number"?e:1}class nr extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?r=t:!a.cause&&t&&(o=!0,r=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?a.ruleId=i:(a.source=i.slice(0,u),a.ruleId=i.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Vh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nr.prototype.file="";nr.prototype.name="";nr.prototype.reason="";nr.prototype.message="";nr.prototype.stack="";nr.prototype.column=void 0;nr.prototype.line=void 0;nr.prototype.ancestors=void 0;nr.prototype.cause=void 0;nr.prototype.fatal=void 0;nr.prototype.place=void 0;nr.prototype.ruleId=void 0;nr.prototype.source=void 0;const D9={}.hasOwnProperty,fce=new Map,dce=/[A-Z]/g,hce=new Set(["table","tbody","thead","tfoot","tr"]),mce=new Set(["td","th"]),Xq="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pce(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=xce(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=_ce(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?E9:nce,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Zq(r,e,void 0);return a&&typeof a!="string"?a:r.create(e,r.Fragment,{children:a||void 0},void 0)}function Zq(e,t,n){if(t.type==="element")return vce(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gce(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return bce(e,t,n);if(t.type==="mdxjsEsm")return yce(e,t);if(t.type==="root")return wce(e,t,n);if(t.type==="text")return kce(e,t)}function vce(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=E9,e.schema=r),e.ancestors.push(t);const a=Jq(e,t.tagName,!1),o=Sce(e,t);let l=P9(e,t);return hce.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Wue(u):!0})),Qq(e,o,a,t),R9(o,l),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function gce(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}mm(e,t.position)}function yce(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mm(e,t.position)}function bce(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=E9,e.schema=r),e.ancestors.push(t);const a=t.name===null?e.Fragment:Jq(e,t.name,!0),o=Cce(e,t),l=P9(e,t);return Qq(e,o,a,t),R9(o,l),e.ancestors.pop(),e.schema=i,e.create(t,a,o,n)}function wce(e,t,n){const i={};return R9(i,P9(e,t)),e.create(t,e.Fragment,i,n)}function kce(e,t){return t.value}function Qq(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function R9(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _ce(e,t,n){return i;function i(r,a,o,l){const f=Array.isArray(o.children)?n:t;return l?f(a,o,l):f(a,o)}}function xce(e,t){return n;function n(i,r,a,o){const l=Array.isArray(a.children),u=M9(i);return t(r,a,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sce(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&D9.call(t.properties,r)){const a=jce(e,r,t.properties[r]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&mce.has(t.tagName)?i=l:n[o]=l}}if(i){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function Cce(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const a=i.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else mm(e,t.position);else{const r=i.name;let a;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const l=i.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else mm(e,t.position);else a=i.value===null?!0:i.value;n[r]=a}return n}function P9(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:fce;for(;++ir?0:r+t:t=t>r?r:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Vr(e,e.length,0,t),e):t}const BM={}.hasOwnProperty;function tH(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ua(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=El(/[A-Za-z]/),er=El(/[\dA-Za-z]/),Nce=El(/[#-'*+\--9=?A-Z^-~]/);function o1(e){return e!==null&&(e<32||e===127)}const l4=El(/\d/),$ce=El(/[\dA-Fa-f]/),zce=El(/[!-/:-@[-`{-~]/);function kt(e){return e!==null&&e<-2}function $n(e){return e!==null&&(e<0||e===32)}function nn(e){return e===-2||e===-1||e===32}const C0=El(new RegExp("\\p{P}|\\p{S}","u")),Ou=El(/\s/);function El(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ad(e){const t=[];let n=-1,i=0,r=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),r=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(i)}function hn(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(u){return nn(u)?(e.enter(n),l(u)):t(u)}function l(u){return nn(u)&&a++o))return;const M=t.events.length;let N=M,F,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(F){R=t.events[N][1].end;break}F=!0}for(_(i),O=M;Oj;){const A=n[T];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function x(){r.write([null]),a=void 0,r=void 0,t.containerState._closeFlow=void 0}}function qce(e,t,n){return hn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function df(e){if(e===null||$n(e)||Ou(e))return 1;if(C0(e))return 2}function j0(e,t,n){const i=[];let r=-1;for(;++r1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},p={...e[n][1].start};qM(d,-u),qM(p,u),o={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},a={type:u>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},r={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[i][1].end={...o.start},e[n][1].start={...l.end},f=[],e[i][1].end.offset-e[i][1].start.offset&&(f=ma(f,[["enter",e[i][1],t],["exit",e[i][1],t]])),f=ma(f,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=ma(f,j0(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),f=ma(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=ma(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Vr(e,i-1,n-i+3,f),n=i+f.length-h-2;break}}for(n=-1;++n0&&nn(O)?hn(e,x,"linePrefix",a+1)(O):x(O)}function x(O){return O===null||kt(O)?e.check(HM,w,T)(O):(e.enter("codeFlowValue"),j(O))}function j(O){return O===null||kt(O)?(e.exit("codeFlowValue"),x(O)):(e.consume(O),j)}function T(O){return e.exit("codeFenced"),t(O)}function A(O,M,N){let F=0;return R;function R($){return O.enter("lineEnding"),O.consume($),O.exit("lineEnding"),I}function I($){return O.enter("codeFencedFence"),nn($)?hn(O,q,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):q($)}function q($){return $===l?(O.enter("codeFencedFenceSequence"),G($)):N($)}function G($){return $===l?(F++,O.consume($),G):F>=o?(O.exit("codeFencedFenceSequence"),nn($)?hn(O,U,"whitespace")($):U($)):N($)}function U($){return $===null||kt($)?(O.exit("codeFencedFence"),M($)):N($)}}}function efe(e,t,n){const i=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const r_={name:"codeIndented",tokenize:nfe},tfe={partial:!0,tokenize:ife};function nfe(e,t,n){const i=this;return r;function r(f){return e.enter("codeIndented"),hn(e,a,"linePrefix",5)(f)}function a(f){const h=i.events[i.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?u(f):kt(f)?e.attempt(tfe,o,u)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||kt(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function u(f){return e.exit("codeIndented"),t(f)}}function ife(e,t,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):kt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):hn(e,a,"linePrefix",5)(o)}function a(o){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):kt(o)?r(o):n(o)}}const rfe={name:"codeText",previous:ofe,resolve:afe,tokenize:sfe};function afe(e){let t=e.length-4,n=3,i,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const r=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&vh(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vh(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function sH(e,t,n,i,r,a,o,l,u){const f=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(_){return _===60?(e.enter(i),e.enter(r),e.enter(a),e.consume(_),e.exit(a),p):_===null||_===32||_===41||o1(_)?n(_):(e.enter(i),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(_))}function p(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(r),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===62?(e.exit("chunkString"),e.exit(l),p(_)):_===null||_===60||kt(_)?n(_):(e.consume(_),_===92?b:g)}function b(_){return _===60||_===62||_===92?(e.consume(_),g):g(_)}function w(_){return!h&&(_===null||_===41||$n(_))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(i),t(_)):h999||g===null||g===91||g===93&&!u||g===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(r),e.consume(g),e.exit(r),e.exit(i),t):kt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||kt(g)||l++>999?(e.exit("chunkString"),h(g)):(e.consume(g),u||(u=!nn(g)),g===92?p:d)}function p(g){return g===91||g===92||g===93?(e.consume(g),l++,d):d(g)}}function uH(e,t,n,i,r,a){let o;return l;function l(p){return p===34||p===39||p===40?(e.enter(i),e.enter(r),e.consume(p),e.exit(r),o=p===40?41:p,u):n(p)}function u(p){return p===o?(e.enter(r),e.consume(p),e.exit(r),e.exit(i),t):(e.enter(a),f(p))}function f(p){return p===o?(e.exit(a),u(o)):p===null?n(p):kt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),hn(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===o||p===null||kt(p)?(e.exit("chunkString"),f(p)):(e.consume(p),p===92?d:h)}function d(p){return p===o||p===92?(e.consume(p),h):h(p)}}function Wh(e,t){let n;return i;function i(r){return kt(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):nn(r)?hn(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const pfe={name:"definition",tokenize:gfe},vfe={partial:!0,tokenize:yfe};function gfe(e,t,n){const i=this;let r;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return lH.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return r=Ua(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return $n(g)?Wh(e,f)(g):f(g)}function f(g){return sH(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return e.attempt(vfe,d,d)(g)}function d(g){return nn(g)?hn(e,p,"whitespace")(g):p(g)}function p(g){return g===null||kt(g)?(e.exit("definition"),i.parser.defined.push(r),t(g)):n(g)}}function yfe(e,t,n){return i;function i(l){return $n(l)?Wh(e,r)(l):n(l)}function r(l){return uH(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return nn(l)?hn(e,o,"whitespace")(l):o(l)}function o(l){return l===null||kt(l)?t(l):n(l)}}const bfe={name:"hardBreakEscape",tokenize:wfe};function wfe(e,t,n){return i;function i(a){return e.enter("hardBreakEscape"),e.consume(a),r}function r(a){return kt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const kfe={name:"headingAtx",resolve:_fe,tokenize:xfe};function _fe(e,t){let n=e.length-2,i=3,r,a;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},a={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Vr(e,i,n-i+1,[["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t]])),e}function xfe(e,t,n){let i=0;return r;function r(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&i++<6?(e.consume(h),o):h===null||$n(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||kt(h)?(e.exit("atxHeading"),t(h)):nn(h)?hn(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||$n(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const Sfe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],VM=["pre","script","style","textarea"],Cfe={concrete:!0,name:"htmlFlow",resolveTo:Ofe,tokenize:Tfe},jfe={partial:!0,tokenize:Mfe},Afe={partial:!0,tokenize:Efe};function Ofe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Tfe(e,t,n){const i=this;let r,a,o,l,u;return f;function f(L){return h(L)}function h(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),p):L===47?(e.consume(L),a=!0,w):L===63?(e.consume(L),r=3,i.interrupt?t:P):ar(L)?(e.consume(L),o=String.fromCharCode(L),k):n(L)}function p(L){return L===45?(e.consume(L),r=2,g):L===91?(e.consume(L),r=5,l=0,b):ar(L)?(e.consume(L),r=4,i.interrupt?t:P):n(L)}function g(L){return L===45?(e.consume(L),i.interrupt?t:P):n(L)}function b(L){const Z="CDATA[";return L===Z.charCodeAt(l++)?(e.consume(L),l===Z.length?i.interrupt?t:q:b):n(L)}function w(L){return ar(L)?(e.consume(L),o=String.fromCharCode(L),k):n(L)}function k(L){if(L===null||L===47||L===62||$n(L)){const Z=L===47,ie=o.toLowerCase();return!Z&&!a&&VM.includes(ie)?(r=1,i.interrupt?t(L):q(L)):Sfe.includes(o.toLowerCase())?(r=6,Z?(e.consume(L),_):i.interrupt?t(L):q(L)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(L):a?x(L):j(L))}return L===45||er(L)?(e.consume(L),o+=String.fromCharCode(L),k):n(L)}function _(L){return L===62?(e.consume(L),i.interrupt?t:q):n(L)}function x(L){return nn(L)?(e.consume(L),x):R(L)}function j(L){return L===47?(e.consume(L),R):L===58||L===95||ar(L)?(e.consume(L),T):nn(L)?(e.consume(L),j):R(L)}function T(L){return L===45||L===46||L===58||L===95||er(L)?(e.consume(L),T):A(L)}function A(L){return L===61?(e.consume(L),O):nn(L)?(e.consume(L),A):j(L)}function O(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,M):nn(L)?(e.consume(L),O):N(L)}function M(L){return L===u?(e.consume(L),u=null,F):L===null||kt(L)?n(L):(e.consume(L),M)}function N(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||$n(L)?A(L):(e.consume(L),N)}function F(L){return L===47||L===62||nn(L)?j(L):n(L)}function R(L){return L===62?(e.consume(L),I):n(L)}function I(L){return L===null||kt(L)?q(L):nn(L)?(e.consume(L),I):n(L)}function q(L){return L===45&&r===2?(e.consume(L),D):L===60&&r===1?(e.consume(L),z):L===62&&r===4?(e.consume(L),W):L===63&&r===3?(e.consume(L),P):L===93&&r===5?(e.consume(L),Y):kt(L)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(jfe,V,G)(L)):L===null||kt(L)?(e.exit("htmlFlowData"),G(L)):(e.consume(L),q)}function G(L){return e.check(Afe,U,V)(L)}function U(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),$}function $(L){return L===null||kt(L)?G(L):(e.enter("htmlFlowData"),q(L))}function D(L){return L===45?(e.consume(L),P):q(L)}function z(L){return L===47?(e.consume(L),o="",H):q(L)}function H(L){if(L===62){const Z=o.toLowerCase();return VM.includes(Z)?(e.consume(L),W):q(L)}return ar(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),H):q(L)}function Y(L){return L===93?(e.consume(L),P):q(L)}function P(L){return L===62?(e.consume(L),W):L===45&&r===2?(e.consume(L),P):q(L)}function W(L){return L===null||kt(L)?(e.exit("htmlFlowData"),V(L)):(e.consume(L),W)}function V(L){return e.exit("htmlFlow"),t(L)}}function Efe(e,t,n){const i=this;return r;function r(o){return kt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function Mfe(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(xp,t,n)}}const Dfe={name:"htmlText",tokenize:Rfe};function Rfe(e,t,n){const i=this;let r,a,o;return l;function l(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),u}function u(P){return P===33?(e.consume(P),f):P===47?(e.consume(P),A):P===63?(e.consume(P),j):ar(P)?(e.consume(P),N):n(P)}function f(P){return P===45?(e.consume(P),h):P===91?(e.consume(P),a=0,b):ar(P)?(e.consume(P),x):n(P)}function h(P){return P===45?(e.consume(P),g):n(P)}function d(P){return P===null?n(P):P===45?(e.consume(P),p):kt(P)?(o=d,z(P)):(e.consume(P),d)}function p(P){return P===45?(e.consume(P),g):d(P)}function g(P){return P===62?D(P):P===45?p(P):d(P)}function b(P){const W="CDATA[";return P===W.charCodeAt(a++)?(e.consume(P),a===W.length?w:b):n(P)}function w(P){return P===null?n(P):P===93?(e.consume(P),k):kt(P)?(o=w,z(P)):(e.consume(P),w)}function k(P){return P===93?(e.consume(P),_):w(P)}function _(P){return P===62?D(P):P===93?(e.consume(P),_):w(P)}function x(P){return P===null||P===62?D(P):kt(P)?(o=x,z(P)):(e.consume(P),x)}function j(P){return P===null?n(P):P===63?(e.consume(P),T):kt(P)?(o=j,z(P)):(e.consume(P),j)}function T(P){return P===62?D(P):j(P)}function A(P){return ar(P)?(e.consume(P),O):n(P)}function O(P){return P===45||er(P)?(e.consume(P),O):M(P)}function M(P){return kt(P)?(o=M,z(P)):nn(P)?(e.consume(P),M):D(P)}function N(P){return P===45||er(P)?(e.consume(P),N):P===47||P===62||$n(P)?F(P):n(P)}function F(P){return P===47?(e.consume(P),D):P===58||P===95||ar(P)?(e.consume(P),R):kt(P)?(o=F,z(P)):nn(P)?(e.consume(P),F):D(P)}function R(P){return P===45||P===46||P===58||P===95||er(P)?(e.consume(P),R):I(P)}function I(P){return P===61?(e.consume(P),q):kt(P)?(o=I,z(P)):nn(P)?(e.consume(P),I):F(P)}function q(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),r=P,G):kt(P)?(o=q,z(P)):nn(P)?(e.consume(P),q):(e.consume(P),U)}function G(P){return P===r?(e.consume(P),r=void 0,$):P===null?n(P):kt(P)?(o=G,z(P)):(e.consume(P),G)}function U(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||$n(P)?F(P):(e.consume(P),U)}function $(P){return P===47||P===62||$n(P)?F(P):n(P)}function D(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function z(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),H}function H(P){return nn(P)?hn(e,Y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):Y(P)}function Y(P){return e.enter("htmlTextData"),o(P)}}const z9={name:"labelEnd",resolveAll:zfe,resolveTo:Lfe,tokenize:Ife},Pfe={tokenize:Bfe},Nfe={tokenize:Ffe},$fe={tokenize:qfe};function zfe(e){let t=-1;const n=[];for(;++t=3&&(f===null||kt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function u(f){return f===r?(e.consume(f),i++,u):(e.exit("thematicBreakSequence"),nn(f)?hn(e,l,"whitespace")(f):l(f))}}const br={continuation:{tokenize:Qfe},exit:ede,name:"list",tokenize:Zfe},Kfe={partial:!0,tokenize:tde},Xfe={partial:!0,tokenize:Jfe};function Zfe(e,t,n){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return l;function l(g){const b=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:l4(g)){if(i.containerState.type||(i.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check($g,n,f)(g):f(g);if(!i.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return l4(g)&&++o<10?(e.consume(g),u):(!i.interrupt||o<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):n(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,e.check(xp,i.interrupt?n:h,e.attempt(Kfe,p,d))}function h(g){return i.containerState.initialBlankLine=!0,a++,p(g)}function d(g){return nn(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),p):n(g)}function p(g){return i.containerState.size=a+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function Qfe(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(xp,r,a);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,hn(e,t,"listItemIndent",i.containerState.size+1)(l)}function a(l){return i.containerState.furtherBlankLines||!nn(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(Xfe,t,o)(l))}function o(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,hn(e,e.attempt(br,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Jfe(e,t,n){const i=this;return hn(e,r,"listItemIndent",i.containerState.size+1);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(a):n(a)}}function ede(e){e.exit(this.containerState.type)}function tde(e,t,n){const i=this;return hn(e,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const o=i.events[i.events.length-1];return!nn(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const WM={name:"setextUnderline",resolveTo:nde,tokenize:ide};function nde(e,t){let n=e.length,i,r,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",a?(e.splice(r,0,["enter",o,t]),e.splice(a+1,0,["exit",e[i][1],t]),e[i][1].end={...e[a][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function ide(e,t,n){const i=this;let r;return a;function a(f){let h=i.events.length,d;for(;h--;)if(i.events[h][1].type!=="lineEnding"&&i.events[h][1].type!=="linePrefix"&&i.events[h][1].type!=="content"){d=i.events[h][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),r=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===r?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),nn(f)?hn(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||kt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const rde={tokenize:ade};function ade(e){const t=this,n=e.attempt(xp,i,e.attempt(this.parser.constructs.flowInitial,r,hn(e,e.attempt(this.parser.constructs.flow,r,e.attempt(cfe,r)),"linePrefix")));return n;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ode={resolveAll:fH()},sde=cH("string"),lde=cH("text");function cH(e){return{resolveAll:fH(e==="text"?ude:void 0),tokenize:t};function t(n){const i=this,r=this.parser.constructs[e],a=n.attempt(r,o,l);return o;function o(h){return f(h)?a(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return f(h)?(n.exit("data"),a(h)):(n.consume(h),u)}function f(h){if(h===null)return!0;const d=r[h];let p=-1;if(d)for(;++p-1){const l=o[0];typeof l=="string"?o[0]=l.slice(i):o.shift()}a>0&&o.push(e[r].slice(0,a))}return o}function _de(e,t){let n=-1;const i=[];let r;for(;++n0){const rt=Ke.tokenStack[Ke.tokenStack.length-1];(rt[1]||YM).call(Ke,void 0,rt[0])}for(ye.position={start:Zs(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Zs(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je0&&(i.className=["language-"+r[0]]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function $de(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zde(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lde(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=ad(i.toLowerCase()),a=e.footnoteOrder.indexOf(i);let o,l=e.footnoteCounts.get(i);l===void 0?(l=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(i,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,f),e.applyData(t,f)}function Ide(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bde(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mH(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const r=e.all(t),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function Fde(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return mH(e,t);const r={src:ad(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function qde(e,t){const n={src:ad(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function Hde(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function Ude(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return mH(e,t);const r={href:ad(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Vde(e,t){const n={href:ad(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Wde(e,t,n){const i=e.all(t),r=n?Gde(n):pH(t),a={},o=[];if(typeof t.checked=="boolean"){const h=i[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},i.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function Yde(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=M9(t.children[1]),u=Yq(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),r.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Jde(e,t,n){const i=n?n.children:void 0,a=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const f=[];for(;++u0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return a.push(ZM(t.slice(r),r>0,!1)),a.join("")}function ZM(e,t,n){let i=0,r=e.length;if(t){let a=e.codePointAt(i);for(;a===KM||a===XM;)i++,a=e.codePointAt(i)}if(n){let a=e.codePointAt(r-1);for(;a===KM||a===XM;)r--,a=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function nhe(e,t){const n={type:"text",value:the(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ihe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rhe={blockquote:Rde,break:Pde,code:Nde,delete:$de,emphasis:zde,footnoteReference:Lde,heading:Ide,html:Bde,imageReference:Fde,image:qde,inlineCode:Hde,linkReference:Ude,link:Vde,listItem:Wde,list:Yde,paragraph:Kde,root:Xde,strong:Zde,table:Qde,tableCell:ehe,tableRow:Jde,text:nhe,thematicBreak:ihe,toml:ig,yaml:ig,definition:ig,footnoteDefinition:ig};function ig(){}const vH=-1,A0=0,Gh=1,s1=2,L9=3,I9=4,B9=5,F9=6,gH=7,yH=8,ahe=typeof self=="object"?self:globalThis,QM=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new ahe[e](t)},ohe=(e,t)=>{const n=(r,a)=>(e.set(a,r),r),i=r=>{if(e.has(r))return e.get(r);const[a,o]=t[r];switch(a){case A0:case vH:return n(o,r);case Gh:{const l=n([],r);for(const u of o)l.push(i(u));return l}case s1:{const l=n({},r);for(const[u,f]of o)l[i(u)]=i(f);return l}case L9:return n(new Date(o),r);case I9:{const{source:l,flags:u}=o;return n(new RegExp(l,u),r)}case B9:{const l=n(new Map,r);for(const[u,f]of o)l.set(i(u),i(f));return l}case F9:{const l=n(new Set,r);for(const u of o)l.add(i(u));return l}case gH:{const{name:l,message:u}=o;return n(QM(l,u),r)}case yH:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(QM(a,o),r)};return i},JM=e=>ohe(new Map,e)(0),Lc="",{toString:she}={},{keys:lhe}=Object,gh=e=>{const t=typeof e;if(t!=="object"||!e)return[A0,t];const n=she.call(e).slice(8,-1);switch(n){case"Array":return[Gh,Lc];case"Object":return[s1,Lc];case"Date":return[L9,Lc];case"RegExp":return[I9,Lc];case"Map":return[B9,Lc];case"Set":return[F9,Lc];case"DataView":return[Gh,n]}return n.includes("Array")?[Gh,n]:n.includes("Error")?[gH,n]:[s1,n]},rg=([e,t])=>e===A0&&(t==="function"||t==="symbol"),uhe=(e,t,n,i)=>{const r=(o,l)=>{const u=i.push(o)-1;return n.set(l,u),u},a=o=>{if(n.has(o))return n.get(o);let[l,u]=gh(o);switch(l){case A0:{let h=o;switch(u){case"bigint":l=yH,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return r([vH],o)}return r([l,h],o)}case Gh:{if(u){let p=o;return u==="DataView"?p=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(o)),r([u,[...p]],o)}const h=[],d=r([l,h],o);for(const p of o)h.push(a(p));return d}case s1:{if(u)switch(u){case"BigInt":return r([u,o.toString()],o);case"Boolean":case"Number":case"String":return r([u,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const h=[],d=r([l,h],o);for(const p of lhe(o))(e||!rg(gh(o[p])))&&h.push([a(p),a(o[p])]);return d}case L9:return r([l,o.toISOString()],o);case I9:{const{source:h,flags:d}=o;return r([l,{source:h,flags:d}],o)}case B9:{const h=[],d=r([l,h],o);for(const[p,g]of o)(e||!(rg(gh(p))||rg(gh(g))))&&h.push([a(p),a(g)]);return d}case F9:{const h=[],d=r([l,h],o);for(const p of o)(e||!rg(gh(p)))&&h.push(a(p));return d}}const{message:f}=o;return r([l,{name:u,message:f}],o)};return a},e8=(e,{json:t,lossy:n}={})=>{const i=[];return uhe(!(t||n),!!t,new Map,i)(e),i},l1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?JM(e8(e,t)):structuredClone(e):(e,t)=>JM(e8(e,t));function che(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fhe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function dhe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||che,i=e.options.footnoteBackLabel||fhe,r=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&b.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,g);typeof x=="string"&&(x={type:"text",value:x}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(u,g),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const k=h[h.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const x=k.children[k.children.length-1];x&&x.type==="text"?x.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else h.push(...b);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(h,!0)};e.patch(f,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...l1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const O0=(function(e){if(e==null)return vhe;if(typeof e=="function")return T0(e);if(typeof e=="object")return Array.isArray(e)?hhe(e):mhe(e);if(typeof e=="string")return phe(e);throw new Error("Expected function, string, or object as test")});function hhe(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let g=bH,b,w,k;if((!t||a(u,f,h[h.length-1]||void 0))&&(g=whe(n(u,h)),g[0]===c4))return g;if("children"in u&&u.children){const _=u;if(_.children&&g[0]!==bhe)for(w=(i?_.children.length:-1)+o,k=h.concat(_);w>-1&&w<_.children.length;){const x=_.children[w];if(b=l(x,w,k)(),b[0]===c4)return b;w=typeof b[1]=="number"?b[1]:w+o}}return g}}}function whe(e){return Array.isArray(e)?e:typeof e=="number"?[yhe,e]:e==null?bH:[e]}function q9(e,t,n,i){let r,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,r=n):(a=t,o=n,r=i),wH(e,a,l,r);function l(u,f){const h=f[f.length-1],d=h?h.children.indexOf(u):void 0;return o(u,d,h)}}const f4={}.hasOwnProperty,khe={};function _he(e,t){const n=t||khe,i=new Map,r=new Map,a=new Map,o={...rhe,...n.handlers},l={all:f,applyData:She,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:o,one:u,options:n,patch:xhe,wrap:jhe};return q9(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?i:r,p=String(h.identifier).toUpperCase();d.has(p)||d.set(p,h)}}),l;function u(h,d){const p=h.type,g=l.handlers[p];if(f4.call(l.handlers,p)&&g)return g(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in h){const{children:w,...k}=h,_=l1(k);return _.children=l.all(h),_}return l1(h)}return(l.options.unknownHandler||Che)(l,h,d)}function f(h){const d=[];if("children"in h){const p=h.children;let g=-1;for(;++g0&&n.push({type:"text",value:` +`}),n}function t8(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function n8(e,t){const n=_he(e,t),i=n.one(e,void 0),r=dhe(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:` +`},r),a}function Ahe(e,t){return e&&"run"in e?async function(n,i){const r=n8(n,{file:i,...t});await e.run(r,i)}:function(n,i){return n8(n,{file:i,...e||t})}}function i8(e){if(e)throw e}var o_,r8;function Ohe(){if(r8)return o_;r8=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!d)return!1;var p;for(p in f);return typeof p>"u"||e.call(f,p)},o=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},l=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(i)return i(f,h).value}else return;return f[h]};return o_=function u(){var f,h,d,p,g,b,w=arguments[0],k=1,_=arguments.length,x=!1;for(typeof w=="boolean"&&(x=w,w=arguments[1]||{},k=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});k<_;++k)if(f=arguments[k],f!=null)for(h in f)d=l(w,h),p=l(f,h),w!==p&&(x&&p&&(a(p)||(g=r(p)))?(g?(g=!1,b=d&&r(d)?d:[]):b=d&&a(d)?d:{},o(w,{name:h,newValue:u(x,b,p)})):typeof p<"u"&&o(w,{name:h,newValue:p}));return w},o_}var The=Ohe();const s_=gn(The);function d4(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ehe(){const e=[],t={run:n,use:i};return t;function n(...r){let a=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...r);function l(u,...f){const h=e[++a];let d=-1;if(u){o(u);return}for(;++do.length;let u;l&&o.push(r);try{u=e.apply(this,o)}catch(f){const h=f;if(l&&n)throw h;return r(h)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,r):u instanceof Error?r(u):a(u))}function r(o,...l){n||(n=!0,t(o,...l))}function a(o){r(null,o)}}const no={basename:Dhe,dirname:Rhe,extname:Phe,join:Nhe,sep:"/"};function Dhe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sp(e);let n=0,i=-1,r=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(a){n=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(a){n=r+1;break}}else o<0&&(a=!0,o=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Rhe(e){if(Sp(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Phe(e){Sp(e);let t=e.length,n=-1,i=0,r=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?r<0?r=t:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function Nhe(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function zhe(e,t){let n="",i=0,r=-1,a=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",i=0):(n=n.slice(0,u),i=n.length-1-n.lastIndexOf("/")),r=o,a=0;continue}}else if(n.length>0){n="",i=0,r=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),i=o-r-1;r=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function Sp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lhe={cwd:Ihe};function Ihe(){return"/"}function h4(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Bhe(e){if(typeof e=="string")e=new URL(e);else if(!h4(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Fhe(e)}function Fhe(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[g,...b]=h;const w=i[p][1];d4(w)&&d4(g)&&(g=s_(!0,w,g)),i[p]=[f,g,...b]}}}}const Vhe=new H9().freeze();function f_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function d_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function h_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function o8(e){if(!d4(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function s8(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ag(e){return Whe(e)?e:new kH(e)}function Whe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ghe(e){return typeof e=="string"||Yhe(e)}function Yhe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Khe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",l8=[],u8={allowDangerousHtml:!0},Xhe=/^(https?|ircs?|mailto|xmpp)$/i,Zhe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Qhe(e){const t=Jhe(e),n=eme(e);return tme(t.runSync(t.parse(n),n),e)}function Jhe(e){const t=e.rehypePlugins||l8,n=e.remarkPlugins||l8,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...u8}:u8;return Vhe().use(Dde).use(n).use(Ahe,i).use(t)}function eme(e){const t=e.children||"",n=new kH;return typeof t=="string"&&(n.value=t),n}function tme(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||nme;for(const h of Zhe)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+Khe+h.id,void 0);return q9(e,f),pce(e,{Fragment:v.Fragment,components:r,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function f(h,d,p){if(h.type==="raw"&&p&&typeof d=="number")return o?p.children.splice(d,1):p.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let g;for(g in i_)if(Object.hasOwn(i_,g)&&Object.hasOwn(h.properties,g)){const b=h.properties[g],w=i_[g];(w===null||w.includes(h.tagName))&&(h.properties[g]=u(String(b||""),g,h))}}if(h.type==="element"){let g=n?!n.includes(h.tagName):a?a.includes(h.tagName):!1;if(!g&&i&&typeof d=="number"&&(g=!i(h,d,p)),g&&p&&typeof d=="number")return l&&h.children?p.children.splice(d,1,...h.children):p.children.splice(d,1),d}}}function nme(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||Xhe.test(e.slice(0,t))?e:""}function c8(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function ime(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rme(e,t,n){const r=O0((n||{}).ignore||[]),a=ame(t);let o=-1;for(;++o0?{type:"text",value:O}:void 0),O===!1?p.lastIndex=T+1:(b!==T&&x.push({type:"text",value:f.value.slice(b,T)}),Array.isArray(O)?x.push(...O):O&&x.push(O),b=T+j[0].length,_=!0),!p.global)break;j=p.exec(f.value)}return _?(b?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=c8(e,"(");let a=c8(e,")");for(;i!==-1&&r>a;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[e,n]}function _H(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ou(n)||C0(n))&&(!t||n!==47)}xH.peek=Ome;function wme(){this.buffer()}function kme(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _me(){this.buffer()}function xme(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Sme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ua(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cme(e){this.exit(e)}function jme(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ua(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ame(e){this.exit(e)}function Ome(){return"["}function xH(e,t,n,i){const r=n.createTracker(i);let a=r.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=r.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=r.move("]"),a}function Tme(){return{enter:{gfmFootnoteCallString:wme,gfmFootnoteCall:kme,gfmFootnoteDefinitionLabelString:_me,gfmFootnoteDefinition:xme},exit:{gfmFootnoteCallString:Sme,gfmFootnoteCall:Cme,gfmFootnoteDefinitionLabelString:jme,gfmFootnoteDefinition:Ame}}}function Eme(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xH},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,a,o){const l=a.createTracker(o);let u=l.move("[^");const f=a.enter("footnoteDefinition"),h=a.enter("label");return u+=l.move(a.safe(a.associationId(i),{before:u,after:"]"})),h(),u+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),u+=l.move((t?` +`:" ")+a.indentLines(a.containerFlow(i,l.current()),t?SH:Mme))),f(),u}}function Mme(e,t,n){return t===0?e:SH(e,t,n)}function SH(e,t,n){return(n?"":" ")+e}const Dme=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];CH.peek=zme;function Rme(){return{canContainEols:["delete"],enter:{strikethrough:Nme},exit:{strikethrough:$me}}}function Pme(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Dme}],handlers:{delete:CH}}}function Nme(e){this.enter({type:"delete",children:[]},e)}function $me(e){this.exit(e)}function CH(e,t,n,i){const r=n.createTracker(i),a=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),a(),o}function zme(){return"~"}function Lme(e){return e.length}function Ime(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||Lme,a=[],o=[],l=[],u=[];let f=0,h=-1;for(;++hf&&(f=e[h].length);++_u[_])&&(u[_]=j)}w.push(x)}o[h]=w,l[h]=k}let d=-1;if(typeof i=="object"&&"length"in i)for(;++du[d]&&(u[d]=x),g[d]=x),p[d]=j}o.splice(1,0,p),l.splice(1,0,g),h=-1;const b=[];for(;++h "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),qme);return r(),o}function qme(e,t,n){return">"+(n?"":" ")+e}function Hme(e,t){return d8(e,t.inConstruct,!0)&&!d8(e,t.notInConstruct,!1)}function d8(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++io&&(o=a):a=1,r=i+t.length,i=n.indexOf(t,r);return o}function Vme(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Wme(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Gme(e,t,n,i){const r=Wme(n),a=e.value||"",o=r==="`"?"GraveAccent":"Tilde";if(Vme(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(a,Yme);return d(),p}const l=n.createTracker(i),u=r.repeat(Math.max(Ume(a,r)+1,3)),f=n.enter("codeFenced");let h=l.move(u);if(e.lang){const d=n.enter(`codeFencedLang${o}`);h+=l.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(n.safe(e.meta,{before:h,after:` +`,encode:["`"],...l.current()})),d()}return h+=l.move(` +`),a&&(h+=l.move(a+` +`)),h+=l.move(u),f(),h}function Yme(e,t,n){return(n?"":" ")+e}function U9(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Kme(e,t,n,i){const r=U9(n),a=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(i);let f=u.move("[");return f+=u.move(n.safe(n.associationId(e),{before:f,after:"]",...u.current()})),f+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(l=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":` +`,...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=u.move(" "+r),f+=u.move(n.safe(e.title,{before:f,after:r,...u.current()})),f+=u.move(r),l()),o(),f}function Xme(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function pm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function u1(e,t,n){const i=df(e),r=df(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}jH.peek=Zme;function jH(e,t,n,i){const r=Xme(n),a=n.enter("emphasis"),o=n.createTracker(i),l=o.move(r);let u=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const f=u.charCodeAt(0),h=u1(i.before.charCodeAt(i.before.length-1),f,r);h.inside&&(u=pm(f)+u.slice(1));const d=u.charCodeAt(u.length-1),p=u1(i.after.charCodeAt(0),d,r);p.inside&&(u=u.slice(0,-1)+pm(d));const g=o.move(r);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+u+g}function Zme(e,t,n){return n.options.emphasis||"*"}function Qme(e,t){let n=!1;return q9(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,c4}),!!((!e.depth||e.depth<3)&&N9(e)&&(t.options.setext||n))}function Jme(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(i);if(Qme(e,n)){const h=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return d(),h(),p+` +`+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` +`))+1))}const o="#".repeat(r),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(o+" ");let f=n.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(f)&&(f=pm(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,n.options.closeAtx&&(f+=" "+o),u(),l(),f}AH.peek=epe;function AH(e){return e.value||""}function epe(){return"<"}OH.peek=tpe;function OH(e,t,n,i){const r=U9(n),a=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(i);let f=u.move("![");return f+=u.move(n.safe(e.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(l=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=u.move(" "+r),f+=u.move(n.safe(e.title,{before:f,after:r,...u.current()})),f+=u.move(r),l()),f+=u.move(")"),o(),f}function tpe(){return"!"}TH.peek=npe;function TH(e,t,n,i){const r=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(i);let u=l.move("![");const f=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=h,a(),r==="full"||!f||f!==d?u+=l.move(d+"]"):r==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function npe(){return"!"}EH.peek=ipe;function EH(e,t,n){let i=e.value||"",r="`",a=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a\u007F]/.test(e.url))}DH.peek=rpe;function DH(e,t,n,i){const r=U9(n),a=r==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let l,u;if(MH(e,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),n.stack=h,d}l=n.enter("link"),u=n.enter("label");let f=o.move("[");return f+=o.move(n.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(n.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(u=n.enter("destinationRaw"),f+=o.move(n.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${a}`),f+=o.move(" "+r),f+=o.move(n.safe(e.title,{before:f,after:r,...o.current()})),f+=o.move(r),u()),f+=o.move(")"),l(),f}function rpe(e,t,n){return MH(e,n)?"<":"["}RH.peek=ape;function RH(e,t,n,i){const r=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(i);let u=l.move("[");const f=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=h,a(),r==="full"||!f||f!==d?u+=l.move(d+"]"):r==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function ape(){return"["}function V9(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ope(e){const t=V9(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function spe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PH(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function lpe(e,t,n,i){const r=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?spe(n):V9(n);const l=e.ordered?o==="."?")":".":ope(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),PH(n)===o&&h){let d=-1;for(;++d-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(i);l.move(a+" ".repeat(o-a.length)),l.shift(o);const u=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,l.current()),h);return u(),f;function h(d,p,g){return p?(g?"":" ".repeat(o))+d:(g?a:a+" ".repeat(o-a.length))+d}}function fpe(e,t,n,i){const r=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,i);return a(),r(),o}const dpe=O0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function hpe(e,t,n,i){return(e.children.some(function(o){return dpe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function mpe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}NH.peek=ppe;function NH(e,t,n,i){const r=mpe(n),a=n.enter("strong"),o=n.createTracker(i),l=o.move(r+r);let u=o.move(n.containerPhrasing(e,{after:r,before:l,...o.current()}));const f=u.charCodeAt(0),h=u1(i.before.charCodeAt(i.before.length-1),f,r);h.inside&&(u=pm(f)+u.slice(1));const d=u.charCodeAt(u.length-1),p=u1(i.after.charCodeAt(0),d,r);p.inside&&(u=u.slice(0,-1)+pm(d));const g=o.move(r+r);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+u+g}function ppe(e,t,n){return n.options.strong||"*"}function vpe(e,t,n,i){return n.safe(e.value,i)}function gpe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ype(e,t,n){const i=(PH(n)+(n.options.ruleSpaces?" ":"")).repeat(gpe(n));return n.options.ruleSpaces?i.slice(0,-1):i}const $H={blockquote:Fme,break:h8,code:Gme,definition:Kme,emphasis:jH,hardBreak:h8,heading:Jme,html:AH,image:OH,imageReference:TH,inlineCode:EH,link:DH,linkReference:RH,list:lpe,listItem:cpe,paragraph:fpe,root:hpe,strong:NH,text:vpe,thematicBreak:ype};function bpe(){return{enter:{table:wpe,tableData:m8,tableHeader:m8,tableRow:_pe},exit:{codeText:xpe,table:kpe,tableData:g_,tableHeader:g_,tableRow:g_}}}function wpe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function kpe(e){this.exit(e),this.data.inTable=void 0}function _pe(e){this.enter({type:"tableRow",children:[]},e)}function g_(e){this.exit(e)}function m8(e){this.enter({type:"tableCell",children:[]},e)}function xpe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Spe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Spe(e,t){return t==="|"?t:e}function Cpe(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:u,tableRow:l}};function o(g,b,w,k){return f(h(g,w,k),g.align)}function l(g,b,w,k){const _=d(g,w,k),x=f([_]);return x.slice(0,x.indexOf(` +`))}function u(g,b,w,k){const _=w.enter("tableCell"),x=w.enter("phrasing"),j=w.containerPhrasing(g,{...k,before:a,after:a});return x(),_(),j}function f(g,b){return Ime(g,{align:b,alignDelimiters:i,padding:n,stringLength:r})}function h(g,b,w){const k=g.children;let _=-1;const x=[],j=b.enter("table");for(;++_0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Hpe={tokenize:Zpe,partial:!0};function Upe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ype,continuation:{tokenize:Kpe},exit:Xpe}},text:{91:{name:"gfmFootnoteCall",tokenize:Gpe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Vpe,resolveTo:Wpe}}}}function Vpe(e,t,n){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;r--;){const u=i.events[r][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const f=Ua(i.sliceSerialize({start:o.end,end:i.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Wpe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function Gpe(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(a>999||d===93&&!o||d===null||d===91||$n(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return r.includes(Ua(i.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return $n(d)||(o=!0),a++,e.consume(d),d===92?h:f}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function Ype(e,t,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,o=0,l;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(o>999||b===93&&!l||b===null||b===91||$n(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Ua(i.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $n(b)||(l=!0),o++,e.consume(b),b===92?d:h}function d(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),r.includes(a)||r.push(a),hn(e,g,"gfmFootnoteDefinitionWhitespace")):n(b)}function g(b){return t(b)}}function Kpe(e,t,n){return e.check(xp,t,e.attempt(Hpe,t,n))}function Xpe(e){e.exit("gfmFootnoteDefinition")}function Zpe(e,t,n){const i=this;return hn(e,r,"gfmFootnoteDefinitionIndent",5);function r(a){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function Qpe(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(o,l){let u=-1;for(;++u1?u(b):(o.consume(b),d++,g);if(d<2&&!n)return u(b);const k=o.exit("strikethroughSequenceTemporary"),_=df(b);return k._open=!_||_===2&&!!w,k._close=!w||w===2&&!!_,l(b)}}}class Jpe{constructor(){this.map=[]}add(t,n,i){eve(this,t,n,i)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let r=i.pop();for(;r;){for(const a of r)t.push(a);r=i.pop()}this.map.length=0}}function eve(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const U=i.events[I][1].type;if(U==="lineEnding"||U==="linePrefix")I--;else break}const q=I>-1?i.events[I][1].type:null,G=q==="tableHead"||q==="tableRow"?O:u;return G===O&&i.parser.lazy[i.now().line]?n(R):G(R)}function u(R){return e.enter("tableHead"),e.enter("tableRow"),f(R)}function f(R){return R===124||(o=!0,a+=1),h(R)}function h(R){return R===null?n(R):kt(R)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),g):n(R):nn(R)?hn(e,h,"whitespace")(R):(a+=1,o&&(o=!1,r+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||$n(R)?(e.exit("data"),h(R)):(e.consume(R),R===92?p:d)}function p(R){return R===92||R===124?(e.consume(R),d):d(R)}function g(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,nn(R)?hn(e,b,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):b(R))}function b(R){return R===45||R===58?k(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),w):A(R)}function w(R){return nn(R)?hn(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),_):R===45?(a+=1,_(R)):R===null||kt(R)?T(R):A(R)}function _(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):A(R)}function x(R){return R===45?(e.consume(R),x):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(R))}function j(R){return nn(R)?hn(e,T,"whitespace")(R):T(R)}function T(R){return R===124?b(R):R===null||kt(R)?!o||r!==a?A(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):A(R)}function A(R){return n(R)}function O(R){return e.enter("tableRow"),M(R)}function M(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),M):R===null||kt(R)?(e.exit("tableRow"),t(R)):nn(R)?hn(e,M,"whitespace")(R):(e.enter("data"),N(R))}function N(R){return R===null||R===124||$n(R)?(e.exit("data"),M(R)):(e.consume(R),R===92?F:N)}function F(R){return R===92||R===124?(e.consume(R),N):N(R)}}function rve(e,t){let n=-1,i=!0,r=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,f,h,d;const p=new Jpe;for(;++nn[2]+1){const b=n[2]+1,w=n[3]-n[2]-1;e.add(b,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return r!==void 0&&(a.end=Object.assign({},Wc(t.events,r)),e.add(r,0,[["exit",a,t]]),a=void 0),a}function v8(e,t,n,i,r){const a=[],o=Wc(t.events,n);r&&(r.end=Object.assign({},o),a.push(["exit",r,t])),i.end=Object.assign({},o),a.push(["exit",i,t]),e.add(n+1,0,a)}function Wc(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const ave={name:"tasklistCheck",tokenize:sve};function ove(){return{text:{91:ave}}}function sve(e,t,n){const i=this;return r;function r(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return $n(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return kt(u)?t(u):nn(u)?e.check({tokenize:lve},t,n)(u):n(u)}}function lve(e,t,n){return hn(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function uve(e){return tH([Ppe(),Upe(),Qpe(e),nve(),ove()])}const cve={};function fve(e){const t=this,n=e||cve,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(uve(n)),a.push(Epe()),o.push(Mpe(n))}const p4="kanban_chat_v1";function dve(){try{const e=localStorage.getItem(p4);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return[]}function hve({onBoardChange:e}){const[t,n]=S.useState(()=>dve()),[i,r]=S.useState(""),[a,o]=S.useState(!1),[l,u]=S.useState(""),[f,h]=S.useState([]),d=S.useRef(null);S.useEffect(()=>{localStorage.setItem(p4,JSON.stringify(t))},[t]),S.useEffect(()=>{var w;(w=d.current)==null||w.scrollTo({top:d.current.scrollHeight,behavior:"smooth"})},[t,l,f,a]);const p=async()=>{const w=i.trim();if(!w||a)return;const k={role:"user",content:w,ts:Date.now()},_=[...t,k];n(_),r(""),o(!0),u(""),h([]);let x="";const j=[];let T=!1;const A=O=>{switch(O.type){case"delta":x+=O.text,u(x);break;case"tool_use":{const M={tool:O.tool,ok:!0,input:O.input};j.push(M),h([...j]);break}case"tool_result":{for(let M=j.length-1;M>=0;M--){const N=j[M];if(N.error===void 0&&N.ok){O.is_error&&(N.ok=!1,N.error=O.result||"tool error");break}}h([...j]);break}case"result":O.text&&x.trim()===""&&(x=O.text,u(x));break;case"done":O.board_changed&&(T=!0);break;case"error":x=`Error: ${O.error}`,u(x);break}};try{const O=_.map(M=>({role:M.role,content:M.content}));await Ore(O,A)}catch(O){const M=O.message;ft.show({color:"red",message:M}),x=x||`Error: ${M}`}finally{const O={role:"assistant",content:x,ts:Date.now(),tool_calls:j.length>0?j:void 0};n(M=>[...M,O]),u(""),h([]),o(!1),T&&e()}},g=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),p())},b=()=>{n([]),localStorage.removeItem(p4)};return v.jsxs(Ot,{gap:0,h:"100%",children:[v.jsxs(Pe,{justify:"space-between",p:"xs",style:{borderBottom:"1px solid var(--mantine-color-dark-4)"},children:[v.jsxs(Pe,{gap:6,children:[v.jsx(Dq,{size:18}),v.jsx(ge,{fw:600,size:"sm",children:"Asistente"})]}),v.jsx(kn,{label:"Limpiar conversacion",withArrow:!0,children:v.jsx(Zt,{variant:"subtle",color:"gray",size:"sm",onClick:b,disabled:t.length===0,children:v.jsx(yo,{size:14})})})]}),v.jsx(lr,{viewportRef:d,style:{flex:1},type:"auto",p:"xs",children:v.jsxs(Ot,{gap:"xs",children:[t.length===0&&!a&&v.jsxs(ge,{size:"sm",c:"dimmed",ta:"center",mt:"md",children:["Escribe algo. Ejemplos:",v.jsx("br",{}),'- "crea columna Backlog"',v.jsx("br",{}),'- "anade tarjeta para revisar PR de Lucas en Doing"',v.jsx("br",{}),'- "que hay en Doing?"']}),t.map((w,k)=>v.jsx(g8,{msg:w},k)),a&&v.jsx(g8,{msg:{role:"assistant",content:l,ts:Date.now(),tool_calls:f.length>0?f:void 0},streaming:!0}),a&&l===""&&f.length===0&&v.jsxs(Pe,{gap:6,pl:"xs",children:[v.jsx(Jn,{size:"xs"}),v.jsx(ge,{size:"xs",c:"dimmed",children:"Pensando..."})]})]})}),v.jsx(Ot,{gap:4,p:"xs",style:{borderTop:"1px solid var(--mantine-color-dark-4)"},children:v.jsxs(Pe,{align:"flex-end",gap:4,wrap:"nowrap",children:[v.jsx(kl,{placeholder:"Pide algo... (Enter envia, Shift+Enter newline)",value:i,onChange:w=>r(w.currentTarget.value),onKeyDown:g,disabled:a,autosize:!0,minRows:1,maxRows:6,style:{flex:1}}),v.jsx(Zt,{size:"lg",variant:"filled",onClick:p,disabled:!i.trim()||a,"aria-label":"Send",children:a?v.jsx(Jn,{size:"xs",color:"white"}):v.jsx($q,{size:16})})]})})]})}function g8({msg:e,streaming:t=!1}){const n=e.role==="user";return v.jsx(Tn,{p:"xs",radius:"md",withBorder:!0,bg:n?"blue.9":"dark.6",style:{alignSelf:n?"flex-end":"flex-start",maxWidth:"92%"},children:v.jsxs(Ot,{gap:4,children:[e.content&&v.jsx(fe,{className:"kanban-md",style:{fontSize:13,lineHeight:1.45,color:"var(--mantine-color-text)"},children:v.jsx(Qhe,{remarkPlugins:[fve],children:e.content})}),t&&e.content&&v.jsx(fe,{style:{display:"inline-block",width:8,height:14,background:"currentColor",opacity:.6}}),e.tool_calls&&e.tool_calls.length>0&&v.jsx(Pe,{gap:4,wrap:"wrap",children:e.tool_calls.map((i,r)=>v.jsxs(ln,{size:"xs",color:i.ok?"teal":"red",variant:"light",title:i.error||"",leftSection:i.ok&&t?v.jsx(Jn,{size:8,color:"teal"}):null,children:[i.tool,!i.ok&&i.error?`: ${i.error}`:""]},r))})]})})}const mve=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"];function pve({users:e,cards:t,onJumpToCard:n,onOpenDailyReport:i}){const[r,a]=S.useState(null),[o,l]=S.useState(new Date),[u,f]=S.useState(null),[h,d]=S.useState(null),[p,g]=S.useState(!1);S.useEffect(()=>{let j=!1;g(!0);const T=Be(o).startOf("month").format("YYYY-MM-DD"),A=Be(o).endOf("month").format("YYYY-MM-DD");return _F({from:T,to:A,assignee_id:u||void 0}).then(O=>{j||d(O)}).finally(()=>{j||g(!1)}),()=>{j=!0}},[o,u]);const b=S.useMemo(()=>e.map(j=>({value:j.id,label:j.display_name||j.username})),[e]),w=S.useMemo(()=>{const j=new Map;if(!h)return j;for(const T of h.created_daily){const A=j.get(T.date)??{created:0,done:0,deadlines:[]};A.created=T.count,j.set(T.date,A)}for(const T of h.throughput_daily){const A=j.get(T.date)??{created:0,done:0,deadlines:[]};A.done=T.count,j.set(T.date,A)}for(const T of t){if(!T.deadline||T.deleted_at)continue;const A=T.deadline.slice(0,10),O=j.get(A)??{created:0,done:0,deadlines:[]};O.deadlines.push(T),j.set(A,O)}return j},[h,t]),k=S.useMemo(()=>{const j=Be(o).startOf("month"),T=Be(o).endOf("month"),A=(j.day()+6)%7,O=[];for(let M=0;MArray.from(w.values()).reduce((j,T)=>j+T.created,0),[w]),x=S.useMemo(()=>Array.from(w.values()).reduce((j,T)=>j+T.done,0),[w]);return v.jsx(fe,{p:"md",children:v.jsxs(Ot,{gap:"md",children:[v.jsxs(Pe,{justify:"space-between",children:[v.jsx(Al,{order:3,children:"Calendario"}),v.jsxs(Pe,{gap:"xs",wrap:"nowrap",children:[v.jsx(S9,{label:"Mes",size:"xs",value:o,onChange:j=>j&&l(typeof j=="string"?new Date(j):j),style:{minWidth:160},clearable:!1}),v.jsx(Wr,{label:"Asignado",size:"xs",placeholder:"Todos",value:u,onChange:f,data:b,clearable:!0,searchable:!0,style:{minWidth:180}})]})]}),v.jsxs(Pe,{gap:"md",children:[v.jsx(Tn,{withBorder:!0,p:"sm",radius:"md",children:v.jsxs(Pe,{gap:6,children:[v.jsx(ff,{size:14,color:"var(--mantine-color-blue-5)"}),v.jsx(ge,{size:"sm",fw:600,children:_}),v.jsx(ge,{size:"xs",c:"dimmed",children:"creadas"})]})}),v.jsx(Tn,{withBorder:!0,p:"sm",radius:"md",children:v.jsxs(Pe,{gap:6,children:[v.jsx(dm,{size:14,color:"var(--mantine-color-green-5)"}),v.jsx(ge,{size:"sm",fw:600,children:x}),v.jsx(ge,{size:"xs",c:"dimmed",children:"hechas"})]})})]}),p&&!h?v.jsx(Gf,{p:"xl",children:v.jsx(Jn,{})}):v.jsxs(Tn,{withBorder:!0,p:"md",radius:"md",children:[v.jsx(Xo,{cols:7,spacing:4,mb:4,children:mve.map(j=>v.jsx(ge,{size:"xs",c:"dimmed",ta:"center",fw:600,children:j},j))}),v.jsx(Xo,{cols:7,spacing:4,children:k.map((j,T)=>{if(!j.date)return v.jsx(fe,{style:{minHeight:72}},T);const A=w.get(j.date)??{created:0,done:0,deadlines:[]},O=parseInt(j.date.slice(8,10),10),M=j.date===Be().format("YYYY-MM-DD"),N=Be().startOf("day").valueOf(),R=Be(j.date).startOf("day").valueOf()0?"rgba(81, 207, 102, 0.08)":A.created>0?"rgba(34, 139, 230, 0.06)":void 0},children:v.jsxs(Ot,{gap:2,children:[v.jsx(En,{onClick:()=>j.date&&(i==null?void 0:i(j.date)),title:"Ver reporte diario",style:{alignSelf:"flex-start"},"data-test":`calendar-day-${j.date}`,children:v.jsx(ge,{size:"xs",fw:M?700:500,c:M?"blue":void 0,td:i?"underline":void 0,style:{cursor:i?"pointer":"default"},children:O})}),A.created>0&&v.jsxs(Pe,{gap:3,wrap:"nowrap",children:[v.jsx(ff,{size:10,color:"var(--mantine-color-blue-5)"}),v.jsx(ge,{size:"xs",c:"blue",children:A.created})]}),A.done>0&&v.jsxs(Pe,{gap:3,wrap:"nowrap",children:[v.jsx(dm,{size:10,color:"var(--mantine-color-green-5)"}),v.jsx(ge,{size:"xs",c:"green",children:A.done})]}),A.deadlines.length>0&&v.jsxs(Et,{opened:r===j.date,onChange:I=>a(I?j.date:null),position:"bottom",withArrow:!0,shadow:"md",width:280,children:[v.jsx(Et.Target,{children:v.jsx(En,{onClick:()=>a(r===j.date?null:j.date),style:{textAlign:"left"},children:v.jsx(Ot,{gap:1,children:v.jsxs(Pe,{gap:3,wrap:"nowrap",children:[v.jsx(a1,{size:10,color:R?"var(--mantine-color-red-5)":"var(--mantine-color-orange-5)"}),v.jsxs(ge,{size:"xs",c:R?"red":"orange",fw:700,td:"underline",children:[A.deadlines.length," deadline",A.deadlines.length===1?"":"s"]})]})})})}),v.jsx(Et.Dropdown,{p:6,children:v.jsxs(Ot,{gap:2,children:[v.jsxs(ge,{size:"xs",c:"dimmed",fw:600,mb:2,children:["Vencen el ",Be(j.date).format("DD/MM/YYYY")]}),A.deadlines.map(I=>v.jsx(En,{onClick:()=>{a(null),n==null||n(I.id)},style:{padding:"4px 6px",borderRadius:4,background:"var(--mantine-color-dark-6)"},children:v.jsxs(Pe,{gap:6,wrap:"nowrap",children:[v.jsxs(ge,{size:"xs",c:"dimmed",ff:"monospace",children:["#",String(I.seq_num).padStart(5,"0")]}),v.jsx(ge,{size:"xs",lineClamp:1,title:I.title,children:I.title})]})},I.id))]})})]})]})},T)})})]})]})})}function VH(e){return e?e.reduce((t,n)=>{const i=n.name.search(/\./);if(i>=0){const r=n.name.substring(i+1);return t[r]=n.label,t}return t[n.name]=n.label,t},{}):{}}var vve={tooltip:"m_e4d36c9b",tooltipLabel:"m_7f4bcb19",tooltipBody:"m_3de554dd",tooltipItemColor:"m_b30369b5",tooltipItem:"m_3de8964e",tooltipItemBody:"m_50186d10",tooltipItemName:"m_501dadf9",tooltipItemData:"m_50192318"};function gve(e){return e.map(t=>{if(!t.payload||t.payload[t.name])return t;const n=t.name.search(/\./);if(n>=0){const i=t.name.substring(0,n),r={...t.payload[i]},a=Object.entries(t.payload).reduce((o,l)=>{const[u,f]=l;return u===i?o:{...o,[u]:f}},{});return{...t,name:t.name.substring(n+1),payload:{...a,...r}}}return t})}function yve(e,t){const n=gve(e.filter(i=>i.fill!=="none"||!i.color));return t?n.filter(i=>i.name===t):n}function y8(e,t){return t==="radial"||t==="scatter"?Array.isArray(e.value)?e.value[1]-e.value[0]:e.value:Array.isArray(e.payload[e.dataKey])?e.payload[e.dataKey][1]-e.payload[e.dataKey][0]:e.payload[e.name]}const bve={type:"area",showColor:!0},G9=De(e=>{var R,I;const t=we("ChartTooltip",bve,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,payload:u,label:f,unit:h,type:d,segmentId:p,mod:g,series:b,valueFormatter:w,showColor:k,attributes:_,...x}=t,j=ci(),T=Ze({name:"ChartTooltip",classes:vve,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:_});if(!u)return null;const A=yve(u,p),O=d==="scatter"?(I=(R=u[0])==null?void 0:R.payload)==null?void 0:I.name:null,M=VH(b),N=f||O,F=A.map(q=>v.jsxs("div",{"data-type":d,...T("tooltipItem"),children:[v.jsxs("div",{...T("tooltipItemBody"),children:[k&&v.jsx("svg",{...T("tooltipItemColor"),children:v.jsx("circle",{r:6,fill:fn(q.color,j),width:12,height:12,cx:6,cy:6})}),v.jsx("div",{...T("tooltipItemName"),children:M[q.name]||q.name})]}),v.jsxs("div",{...T("tooltipItemData"),children:[typeof w=="function"?w(y8(q,d)):y8(q,d),h||q.unit]})]},(q==null?void 0:q.key)??q.name));return v.jsxs(fe,{...T("tooltip"),mod:[{type:d},g],...x,children:[N&&v.jsx("div",{...T("tooltipLabel"),children:N}),v.jsx("div",{...T("tooltipBody"),children:F})]})});G9.displayName="@mantine/charts/ChartTooltip";var WH={legend:"m_847eaf",legendItem:"m_17da7e62",legendItemColor:"m_6e236e21",legendItemName:"m_8ff56c0d"};function wve(e){return e.map(t=>{var i;const n=(i=t.dataKey)==null?void 0:i.split(".").pop();return{...t,dataKey:n,payload:{...t.payload,name:n,dataKey:n}}})}function kve(e){return wve(e.filter(t=>t.color!=="none"))}const E0=De(e=>{const t=we("ChartLegend",null,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,payload:u,onHighlight:f,legendPosition:h,mod:d,series:p,showColor:g,centered:b,attributes:w,...k}=t,_=Ze({name:"ChartLegend",classes:WH,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:w,rootSelector:"legend"});if(!u)return null;const x=kve(u),j=VH(p),T=x.map((A,O)=>v.jsxs("div",{..._("legendItem"),onMouseEnter:()=>f(A.dataKey),onMouseLeave:()=>f(null),"data-without-color":g===!1||void 0,children:[v.jsx(Yf,{color:A.color,size:12,..._("legendItemColor"),withShadow:!1}),v.jsx("p",{..._("legendItemName"),children:j[A.dataKey]||A.dataKey})]},O));return v.jsx(fe,{mod:[{position:h,centered:b},d],..._("legend"),...k,children:T})});E0.displayName="@mantine/charts/ChartLegend";E0.classes=WH;function _ve({x:e,y:t,value:n,valueFormatter:i}){return v.jsx("g",{transform:`translate(${e},${t})`,children:v.jsx("text",{x:0,y:0,dy:-8,dx:-10,textAnchor:"start",fill:"var(--chart-text-color, var(--mantine-color-dimmed))",fontSize:8,children:i?i(n):n})})}var M0={root:"m_a50f3e58",container:"m_af9188cb",grid:"m_a50a48bc",axis:"m_a507a517",axisLabel:"m_2293801d",tooltip:"m_92b296cd"},y_,b8;function jr(){if(b8)return y_;b8=1;var e=Array.isArray;return y_=e,y_}var b_,w8;function GH(){if(w8)return b_;w8=1;var e=typeof Uv=="object"&&Uv&&Uv.Object===Object&&Uv;return b_=e,b_}var w_,k8;function jo(){if(k8)return w_;k8=1;var e=GH(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return w_=n,w_}var k_,_8;function Cp(){if(_8)return k_;_8=1;var e=jo(),t=e.Symbol;return k_=t,k_}var __,x8;function xve(){if(x8)return __;x8=1;var e=Cp(),t=Object.prototype,n=t.hasOwnProperty,i=t.toString,r=e?e.toStringTag:void 0;function a(o){var l=n.call(o,r),u=o[r];try{o[r]=void 0;var f=!0}catch{}var h=i.call(o);return f&&(l?o[r]=u:delete o[r]),h}return __=a,__}var x_,S8;function Sve(){if(S8)return x_;S8=1;var e=Object.prototype,t=e.toString;function n(i){return t.call(i)}return x_=n,x_}var S_,C8;function xs(){if(C8)return S_;C8=1;var e=Cp(),t=xve(),n=Sve(),i="[object Null]",r="[object Undefined]",a=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?r:i:a&&a in Object(l)?t(l):n(l)}return S_=o,S_}var C_,j8;function Ss(){if(j8)return C_;j8=1;function e(t){return t!=null&&typeof t=="object"}return C_=e,C_}var j_,A8;function od(){if(A8)return j_;A8=1;var e=xs(),t=Ss(),n="[object Symbol]";function i(r){return typeof r=="symbol"||t(r)&&e(r)==n}return j_=i,j_}var A_,O8;function Y9(){if(O8)return A_;O8=1;var e=jr(),t=od(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;function r(a,o){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:i.test(a)||!n.test(a)||o!=null&&a in Object(o)}return A_=r,A_}var O_,T8;function Ml(){if(T8)return O_;T8=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return O_=e,O_}var T_,E8;function K9(){if(E8)return T_;E8=1;var e=xs(),t=Ml(),n="[object AsyncFunction]",i="[object Function]",r="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!t(l))return!1;var u=e(l);return u==i||u==r||u==n||u==a}return T_=o,T_}var E_,M8;function Cve(){if(M8)return E_;M8=1;var e=jo(),t=e["__core-js_shared__"];return E_=t,E_}var M_,D8;function jve(){if(D8)return M_;D8=1;var e=Cve(),t=(function(){var i=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function n(i){return!!t&&t in i}return M_=n,M_}var D_,R8;function YH(){if(R8)return D_;R8=1;var e=Function.prototype,t=e.toString;function n(i){if(i!=null){try{return t.call(i)}catch{}try{return i+""}catch{}}return""}return D_=n,D_}var R_,P8;function Ave(){if(P8)return R_;P8=1;var e=K9(),t=jve(),n=Ml(),i=YH(),r=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,u=o.toString,f=l.hasOwnProperty,h=RegExp("^"+u.call(f).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(p){if(!n(p)||t(p))return!1;var g=e(p)?h:a;return g.test(i(p))}return R_=d,R_}var P_,N8;function Ove(){if(N8)return P_;N8=1;function e(t,n){return t==null?void 0:t[n]}return P_=e,P_}var N_,$8;function Hu(){if($8)return N_;$8=1;var e=Ave(),t=Ove();function n(i,r){var a=t(i,r);return e(a)?a:void 0}return N_=n,N_}var $_,z8;function D0(){if(z8)return $_;z8=1;var e=Hu(),t=e(Object,"create");return $_=t,$_}var z_,L8;function Tve(){if(L8)return z_;L8=1;var e=D0();function t(){this.__data__=e?e(null):{},this.size=0}return z_=t,z_}var L_,I8;function Eve(){if(I8)return L_;I8=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return L_=e,L_}var I_,B8;function Mve(){if(B8)return I_;B8=1;var e=D0(),t="__lodash_hash_undefined__",n=Object.prototype,i=n.hasOwnProperty;function r(a){var o=this.__data__;if(e){var l=o[a];return l===t?void 0:l}return i.call(o,a)?o[a]:void 0}return I_=r,I_}var B_,F8;function Dve(){if(F8)return B_;F8=1;var e=D0(),t=Object.prototype,n=t.hasOwnProperty;function i(r){var a=this.__data__;return e?a[r]!==void 0:n.call(a,r)}return B_=i,B_}var F_,q8;function Rve(){if(q8)return F_;q8=1;var e=D0(),t="__lodash_hash_undefined__";function n(i,r){var a=this.__data__;return this.size+=this.has(i)?0:1,a[i]=e&&r===void 0?t:r,this}return F_=n,F_}var q_,H8;function Pve(){if(H8)return q_;H8=1;var e=Tve(),t=Eve(),n=Mve(),i=Dve(),r=Rve();function a(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l-1}return Y_=t,Y_}var K_,X8;function Ive(){if(X8)return K_;X8=1;var e=R0();function t(n,i){var r=this.__data__,a=e(r,n);return a<0?(++this.size,r.push([n,i])):r[a][1]=i,this}return K_=t,K_}var X_,Z8;function P0(){if(Z8)return X_;Z8=1;var e=Nve(),t=$ve(),n=zve(),i=Lve(),r=Ive();function a(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l0?1:-1},hu=function(t){return Tu(t)&&t.indexOf("%")===t.length-1},Ge=function(t){return lge(t)&&!ld(t)},uge=function(t){return Kt(t)},Ci=function(t){return Ge(t)||Tu(t)},cge=0,ud=function(t){var n=++cge;return"".concat(t||"").concat(n)},Eu=function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ge(t)&&!Tu(t))return i;var a;if(hu(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ld(a)&&(a=i),r&&a>n&&(a=n),a},al=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},fge=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,i={},r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function yge(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function g4(e){"@babel/helpers - typeof";return g4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g4(e)}var CD={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},is=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},jD=null,_2=null,nj=function e(t){if(t===jD&&Array.isArray(_2))return _2;var n=[];return S.Children.forEach(t,function(i){Kt(i)||(rge.isFragment(i)?n=n.concat(e(i.props.children)):n.push(i))}),_2=n,jD=t,n};function ya(e,t){var n=[],i=[];return Array.isArray(t)?i=t.map(function(r){return is(r)}):i=[is(t)],nj(e).forEach(function(r){var a=ga(r,"type.displayName")||ga(r,"type.name");i.indexOf(a)!==-1&&n.push(r)}),n}function qr(e,t){var n=ya(e,t);return n&&n[0]}var AD=function(t){if(!t||!t.props)return!1;var n=t.props,i=n.width,r=n.height;return!(!Ge(i)||i<=0||!Ge(r)||r<=0)},bge=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],wge=function(t){return t&&t.type&&Tu(t.type)&&bge.indexOf(t.type)>=0},eU=function(t){return t&&g4(t)==="object"&&"clipDot"in t},kge=function(t,n,i,r){var a,o=(a=k2==null?void 0:k2[r])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!Bt(t)&&(r&&o.includes(n)||mge.includes(n))||i&&tj.includes(n)},Ut=function(t,n,i){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(S.isValidElement(t)&&(r=t.props),!sd(r))return null;var a={};return Object.keys(r).forEach(function(o){var l;kge((l=r)===null||l===void 0?void 0:l[o],o,n,i)&&(a[o]=r[o])}),a},y4=function e(t,n){if(t===n)return!0;var i=S.Children.count(t);if(i!==S.Children.count(n))return!1;if(i===0)return!0;if(i===1)return OD(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function jge(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function w4(e){var t=e.children,n=e.width,i=e.height,r=e.viewBox,a=e.className,o=e.style,l=e.title,u=e.desc,f=Cge(e,Sge),h=r||{width:n,height:i,x:0,y:0},d=vt("recharts-surface",a);return J.createElement("svg",b4({},Ut(f,!0,"svg"),{className:d,width:n,height:i,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),J.createElement("title",null,l),J.createElement("desc",null,u),t)}var Age=["children","className"];function k4(){return k4=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Tge(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}var Fn=J.forwardRef(function(e,t){var n=e.children,i=e.className,r=Oge(e,Age),a=vt("recharts-layer",i);return J.createElement("g",k4({className:a},Ut(r,!0),{ref:t}),n)}),rs=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;aa?0:a+n),i=i>a?a:i,i<0&&(i+=a),a=n>i?0:i-n>>>0,n>>>=0;for(var o=Array(a);++r=a?n:e(n,i,r)}return S2=t,S2}var C2,DD;function tU(){if(DD)return C2;DD=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",r=t+n+i,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+r+a+"]");function u(f){return l.test(f)}return C2=u,C2}var j2,RD;function Dge(){if(RD)return j2;RD=1;function e(t){return t.split("")}return j2=e,j2}var A2,PD;function Rge(){if(PD)return A2;PD=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",i="\\u20d0-\\u20ff",r=t+n+i,a="\\ufe0e\\ufe0f",o="["+e+"]",l="["+r+"]",u="\\ud83c[\\udffb-\\udfff]",f="(?:"+l+"|"+u+")",h="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",b=f+"?",w="["+a+"]?",k="(?:"+g+"(?:"+[h,d,p].join("|")+")"+w+b+")*",_=w+b+k,x="(?:"+[h+l+"?",l,d,p,o].join("|")+")",j=RegExp(u+"(?="+u+")|"+x+_,"g");function T(A){return A.match(j)||[]}return A2=T,A2}var O2,ND;function Pge(){if(ND)return O2;ND=1;var e=Dge(),t=tU(),n=Rge();function i(r){return t(r)?n(r):e(r)}return O2=i,O2}var T2,$D;function Nge(){if($D)return T2;$D=1;var e=Mge(),t=tU(),n=Pge(),i=XH();function r(a){return function(o){o=i(o);var l=t(o)?n(o):void 0,u=l?l[0]:o.charAt(0),f=l?e(l,1).join(""):o.slice(1);return u[a]()+f}}return T2=r,T2}var E2,zD;function $ge(){if(zD)return E2;zD=1;var e=Nge(),t=e("toUpperCase");return E2=t,E2}var zge=$ge();const z0=gn(zge);function Bn(e){return function(){return e}}const nU=Math.cos,h1=Math.sin,Ka=Math.sqrt,m1=Math.PI,L0=2*m1,_4=Math.PI,x4=2*_4,su=1e-6,Lge=x4-su;function iU(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iU;const n=10**t;return function(i){this._+=i[0];for(let r=1,a=i.length;rsu)if(!(Math.abs(d*u-f*h)>su)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let g=i-o,b=r-l,w=u*u+f*f,k=g*g+b*b,_=Math.sqrt(w),x=Math.sqrt(p),j=a*Math.tan((_4-Math.acos((w+p-k)/(2*_*x)))/2),T=j/x,A=j/_;Math.abs(T-1)>su&&this._append`L${t+T*h},${n+T*d}`,this._append`A${a},${a},0,0,${+(d*g>h*b)},${this._x1=t+A*u},${this._y1=n+A*f}`}}arc(t,n,i,r,a,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let l=i*Math.cos(r),u=i*Math.sin(r),f=t+l,h=n+u,d=1^o,p=o?r-a:a-r;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>su||Math.abs(this._y1-h)>su)&&this._append`L${f},${h}`,i&&(p<0&&(p=p%x4+x4),p>Lge?this._append`A${i},${i},0,1,${d},${t-l},${n-u}A${i},${i},0,1,${d},${this._x1=f},${this._y1=h}`:p>su&&this._append`A${i},${i},0,${+(p>=_4)},${d},${this._x1=t+i*Math.cos(a)},${this._y1=n+i*Math.sin(a)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}}function ij(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Bge(t)}function rj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rU(e){this._context=e}rU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function I0(e){return new rU(e)}function aU(e){return e[0]}function oU(e){return e[1]}function sU(e,t){var n=Bn(!0),i=null,r=I0,a=null,o=ij(l);e=typeof e=="function"?e:e===void 0?aU:Bn(e),t=typeof t=="function"?t:t===void 0?oU:Bn(t);function l(u){var f,h=(u=rj(u)).length,d,p=!1,g;for(i==null&&(a=r(g=o())),f=0;f<=h;++f)!(f=g;--b)l.point(j[b],T[b]);l.lineEnd(),l.areaEnd()}_&&(j[p]=+e(k,p,d),T[p]=+t(k,p,d),l.point(i?+i(k,p,d):j[p],n?+n(k,p,d):T[p]))}if(x)return l=null,x+""||null}function h(){return sU().defined(r).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:Bn(+d),i=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Bn(+d),f):e},f.x1=function(d){return arguments.length?(i=d==null?null:typeof d=="function"?d:Bn(+d),f):i},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:Bn(+d),n=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Bn(+d),f):t},f.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Bn(+d),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(i).y(t)},f.defined=function(d){return arguments.length?(r=typeof d=="function"?d:Bn(!!d),f):r},f.curve=function(d){return arguments.length?(o=d,a!=null&&(l=o(a)),f):o},f.context=function(d){return arguments.length?(d==null?a=l=null:l=o(a=d),f):a},f}class lU{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Fge(e){return new lU(e,!0)}function qge(e){return new lU(e,!1)}const aj={draw(e,t){const n=Ka(t/m1);e.moveTo(n,0),e.arc(0,0,n,0,L0)}},Hge={draw(e,t){const n=Ka(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},uU=Ka(1/3),Uge=uU*2,Vge={draw(e,t){const n=Ka(t/Uge),i=n*uU;e.moveTo(0,-n),e.lineTo(i,0),e.lineTo(0,n),e.lineTo(-i,0),e.closePath()}},Wge={draw(e,t){const n=Ka(t),i=-n/2;e.rect(i,i,n,n)}},Gge=.8908130915292852,cU=h1(m1/10)/h1(7*m1/10),Yge=h1(L0/10)*cU,Kge=-nU(L0/10)*cU,Xge={draw(e,t){const n=Ka(t*Gge),i=Yge*n,r=Kge*n;e.moveTo(0,-n),e.lineTo(i,r);for(let a=1;a<5;++a){const o=L0*a/5,l=nU(o),u=h1(o);e.lineTo(u*n,-l*n),e.lineTo(l*i-u*r,u*i+l*r)}e.closePath()}},M2=Ka(3),Zge={draw(e,t){const n=-Ka(t/(M2*3));e.moveTo(0,n*2),e.lineTo(-M2*n,-n),e.lineTo(M2*n,-n),e.closePath()}},sa=-.5,la=Ka(3)/2,S4=1/Ka(12),Qge=(S4/2+1)*3,Jge={draw(e,t){const n=Ka(t/Qge),i=n/2,r=n*S4,a=i,o=n*S4+n,l=-a,u=o;e.moveTo(i,r),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(sa*i-la*r,la*i+sa*r),e.lineTo(sa*a-la*o,la*a+sa*o),e.lineTo(sa*l-la*u,la*l+sa*u),e.lineTo(sa*i+la*r,sa*r-la*i),e.lineTo(sa*a+la*o,sa*o-la*a),e.lineTo(sa*l+la*u,sa*u-la*l),e.closePath()}};function e1e(e,t){let n=null,i=ij(r);e=typeof e=="function"?e:Bn(e||aj),t=typeof t=="function"?t:Bn(t===void 0?64:+t);function r(){let a;if(n||(n=a=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return r.type=function(a){return arguments.length?(e=typeof a=="function"?a:Bn(a),r):e},r.size=function(a){return arguments.length?(t=typeof a=="function"?a:Bn(+a),r):t},r.context=function(a){return arguments.length?(n=a??null,r):n},r}function p1(){}function v1(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fU(e){this._context=e}fU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:v1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:v1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function t1e(e){return new fU(e)}function dU(e){this._context=e}dU.prototype={areaStart:p1,areaEnd:p1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:v1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function n1e(e){return new dU(e)}function hU(e){this._context=e}hU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:v1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function i1e(e){return new hU(e)}function mU(e){this._context=e}mU.prototype={areaStart:p1,areaEnd:p1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function r1e(e){return new mU(e)}function LD(e){return e<0?-1:1}function ID(e,t,n){var i=e._x1-e._x0,r=t-e._x1,a=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),l=(a*r+o*i)/(i+r);return(LD(a)+LD(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function BD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function D2(e,t,n){var i=e._x0,r=e._y0,a=e._x1,o=e._y1,l=(a-i)/3;e._context.bezierCurveTo(i+l,r+l*t,a-l,o-l*n,a,o)}function g1(e){this._context=e}g1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:D2(this,this._t0,BD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,D2(this,BD(this,n=ID(this,e,t)),n);break;default:D2(this,this._t0,n=ID(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function pU(e){this._context=new vU(e)}(pU.prototype=Object.create(g1.prototype)).point=function(e,t){g1.prototype.point.call(this,t,e)};function vU(e){this._context=e}vU.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,a){this._context.bezierCurveTo(t,e,i,n,a,r)}};function a1e(e){return new g1(e)}function o1e(e){return new pU(e)}function gU(e){this._context=e}gU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=FD(e),r=FD(t),a=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/a[t];for(a[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function l1e(e){return new B0(e,.5)}function u1e(e){return new B0(e,0)}function c1e(e){return new B0(e,1)}function hf(e,t){if((o=e.length)>1)for(var n=1,i,r,a=e[t[0]],o,l=a.length;n=0;)n[t]=t;return n}function f1e(e,t){return e[t]}function d1e(e){const t=[];return t.key=e,t}function h1e(){var e=Bn([]),t=C4,n=hf,i=f1e;function r(a){var o=Array.from(e.apply(this,arguments),d1e),l,u=o.length,f=-1,h;for(const d of a)for(l=0,++f;l0){for(var n,i,r=0,a=e[0].length,o;r0){for(var n=0,i=e[t[0]],r,a=i.length;n0)||!((a=(r=e[t[0]]).length)>0))){for(var n=0,i=1,r,a,o;i=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function _1e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}var yU={symbolCircle:aj,symbolCross:Hge,symbolDiamond:Vge,symbolSquare:Wge,symbolStar:Xge,symbolTriangle:Zge,symbolWye:Jge},x1e=Math.PI/180,S1e=function(t){var n="symbol".concat(z0(t));return yU[n]||aj},C1e=function(t,n,i){if(n==="area")return t;switch(i){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var r=18*x1e;return 1.25*t*t*(Math.tan(r)-Math.tan(r*2)*Math.pow(Math.tan(r),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},j1e=function(t,n){yU["symbol".concat(z0(t))]=n},oj=function(t){var n=t.type,i=n===void 0?"circle":n,r=t.size,a=r===void 0?64:r,o=t.sizeType,l=o===void 0?"area":o,u=k1e(t,g1e),f=HD(HD({},u),{},{type:i,size:a,sizeType:l}),h=function(){var k=S1e(i),_=e1e().type(k).size(C1e(a,l,i));return _()},d=f.className,p=f.cx,g=f.cy,b=Ut(f,!0);return p===+p&&g===+g&&a===+a?J.createElement("path",j4({},b,{className:vt("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(g,")"),d:h()})):null};oj.registerSymbol=j1e;function mf(e){"@babel/helpers - typeof";return mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mf(e)}function A4(){return A4=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var x=g.inactive?f:g.color;return J.createElement("li",A4({className:k,style:d,key:"legend-item-".concat(b)},d1(i.props,g,b)),J.createElement(w4,{width:o,height:o,viewBox:h,style:p},i.renderIcon(g)),J.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},w?w(_,g,b):_))})}},{key:"render",value:function(){var i=this.props,r=i.payload,a=i.layout,o=i.align;if(!r||!r.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return J.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(S.PureComponent);gm(sj,"displayName","Legend");gm(sj,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var R2,VD;function $1e(){if(VD)return R2;VD=1;var e=P0();function t(){this.__data__=new e,this.size=0}return R2=t,R2}var P2,WD;function z1e(){if(WD)return P2;WD=1;function e(t){var n=this.__data__,i=n.delete(t);return this.size=n.size,i}return P2=e,P2}var N2,GD;function L1e(){if(GD)return N2;GD=1;function e(t){return this.__data__.get(t)}return N2=e,N2}var $2,YD;function I1e(){if(YD)return $2;YD=1;function e(t){return this.__data__.has(t)}return $2=e,$2}var z2,KD;function B1e(){if(KD)return z2;KD=1;var e=P0(),t=Z9(),n=Q9(),i=200;function r(a,o){var l=this.__data__;if(l instanceof e){var u=l.__data__;if(!t||u.lengthg))return!1;var w=d.get(o),k=d.get(l);if(w&&k)return w==l&&k==o;var _=-1,x=!0,j=u&r?new e:void 0;for(d.set(o,l),d.set(l,o);++_-1&&i%1==0&&i-1&&n%1==0&&n<=e}return ax=t,ax}var ox,b7;function J1e(){if(b7)return ox;b7=1;var e=xs(),t=fj(),n=Ss(),i="[object Arguments]",r="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",u="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",p="[object RegExp]",g="[object Set]",b="[object String]",w="[object WeakMap]",k="[object ArrayBuffer]",_="[object DataView]",x="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",O="[object Int32Array]",M="[object Uint8Array]",N="[object Uint8ClampedArray]",F="[object Uint16Array]",R="[object Uint32Array]",I={};I[x]=I[j]=I[T]=I[A]=I[O]=I[M]=I[N]=I[F]=I[R]=!0,I[i]=I[r]=I[k]=I[a]=I[_]=I[o]=I[l]=I[u]=I[f]=I[h]=I[d]=I[p]=I[g]=I[b]=I[w]=!1;function q(G){return n(G)&&t(G.length)&&!!I[e(G)]}return ox=q,ox}var sx,w7;function OU(){if(w7)return sx;w7=1;function e(t){return function(n){return t(n)}}return sx=e,sx}var zh={exports:{}};zh.exports;var k7;function eye(){return k7||(k7=1,(function(e,t){var n=GH(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,a=r&&r.exports===i,o=a&&n.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();e.exports=l})(zh,zh.exports)),zh.exports}var lx,_7;function TU(){if(_7)return lx;_7=1;var e=J1e(),t=OU(),n=eye(),i=n&&n.isTypedArray,r=i?t(i):e;return lx=r,lx}var ux,x7;function tye(){if(x7)return ux;x7=1;var e=X1e(),t=uj(),n=jr(),i=AU(),r=cj(),a=TU(),o=Object.prototype,l=o.hasOwnProperty;function u(f,h){var d=n(f),p=!d&&t(f),g=!d&&!p&&i(f),b=!d&&!p&&!g&&a(f),w=d||p||g||b,k=w?e(f.length,String):[],_=k.length;for(var x in f)(h||l.call(f,x))&&!(w&&(x=="length"||g&&(x=="offset"||x=="parent")||b&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||r(x,_)))&&k.push(x);return k}return ux=u,ux}var cx,S7;function nye(){if(S7)return cx;S7=1;var e=Object.prototype;function t(n){var i=n&&n.constructor,r=typeof i=="function"&&i.prototype||e;return n===r}return cx=t,cx}var fx,C7;function EU(){if(C7)return fx;C7=1;function e(t,n){return function(i){return t(n(i))}}return fx=e,fx}var dx,j7;function iye(){if(j7)return dx;j7=1;var e=EU(),t=e(Object.keys,Object);return dx=t,dx}var hx,A7;function rye(){if(A7)return hx;A7=1;var e=nye(),t=iye(),n=Object.prototype,i=n.hasOwnProperty;function r(a){if(!e(a))return t(a);var o=[];for(var l in Object(a))i.call(a,l)&&l!="constructor"&&o.push(l);return o}return hx=r,hx}var mx,O7;function jp(){if(O7)return mx;O7=1;var e=K9(),t=fj();function n(i){return i!=null&&t(i.length)&&!e(i)}return mx=n,mx}var px,T7;function F0(){if(T7)return px;T7=1;var e=tye(),t=rye(),n=jp();function i(r){return n(r)?e(r):t(r)}return px=i,px}var vx,E7;function aye(){if(E7)return vx;E7=1;var e=W1e(),t=K1e(),n=F0();function i(r){return e(r,n,t)}return vx=i,vx}var gx,M7;function oye(){if(M7)return gx;M7=1;var e=aye(),t=1,n=Object.prototype,i=n.hasOwnProperty;function r(a,o,l,u,f,h){var d=l&t,p=e(a),g=p.length,b=e(o),w=b.length;if(g!=w&&!d)return!1;for(var k=g;k--;){var _=p[k];if(!(d?_ in o:i.call(o,_)))return!1}var x=h.get(a),j=h.get(o);if(x&&j)return x==o&&j==a;var T=!0;h.set(a,o),h.set(o,a);for(var A=d;++k-1}return Hx=t,Hx}var Ux,rR;function jye(){if(rR)return Ux;rR=1;function e(t,n,i){for(var r=-1,a=t==null?0:t.length;++r=o){var _=f?null:r(u);if(_)return a(_);b=!1,p=i,k=new e}else k=f?[]:w;e:for(;++d=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Fye(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function qye(e){return e.value}function Hye(e,t){if(J.isValidElement(e))return J.cloneElement(e,t);if(typeof e=="function")return J.createElement(e,t);t.ref;var n=Bye(t,Dye);return J.createElement(sj,n)}var dR=1,as=(function(e){function t(){var n;Rye(this,t);for(var i=arguments.length,r=new Array(i),a=0;adR||Math.abs(r.height-this.lastBoundingBox.height)>dR)&&(this.lastBoundingBox.width=r.width,this.lastBoundingBox.height=r.height,i&&i(r)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,i&&i(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Wo({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(i){var r=this.props,a=r.layout,o=r.align,l=r.verticalAlign,u=r.margin,f=r.chartWidth,h=r.chartHeight,d,p;if(!i||(i.left===void 0||i.left===null)&&(i.right===void 0||i.right===null))if(o==="center"&&a==="vertical"){var g=this.getBBoxSnapshot();d={left:((f||0)-g.width)/2}}else d=o==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!i||(i.top===void 0||i.top===null)&&(i.bottom===void 0||i.bottom===null))if(l==="middle"){var b=this.getBBoxSnapshot();p={top:((h||0)-b.height)/2}}else p=l==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Wo(Wo({},d),p)}},{key:"render",value:function(){var i=this,r=this.props,a=r.content,o=r.width,l=r.height,u=r.wrapperStyle,f=r.payloadUniqBy,h=r.payload,d=Wo(Wo({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(u)),u);return J.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(g){i.wrapperNode=g}},Hye(a,Wo(Wo({},this.props),{},{payload:NU(h,f,qye)})))}}],[{key:"getWithHeight",value:function(i,r){var a=Wo(Wo({},this.defaultProps),i.props),o=a.layout;return o==="vertical"&&Ge(i.props.height)?{height:i.props.height}:o==="horizontal"?{width:i.props.width||r}:null}}])})(S.PureComponent);q0(as,"displayName","Legend");q0(as,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Kx,hR;function Uye(){if(hR)return Kx;hR=1;var e=Cp(),t=uj(),n=jr(),i=e?e.isConcatSpreadable:void 0;function r(a){return n(a)||t(a)||!!(i&&a&&a[i])}return Kx=r,Kx}var Xx,mR;function LU(){if(mR)return Xx;mR=1;var e=jU(),t=Uye();function n(i,r,a,o,l){var u=-1,f=i.length;for(a||(a=t),l||(l=[]);++u0&&a(h)?r>1?n(h,r-1,a,o,l):e(l,h):o||(l[l.length]=h)}return l}return Xx=n,Xx}var Zx,pR;function Vye(){if(pR)return Zx;pR=1;function e(t){return function(n,i,r){for(var a=-1,o=Object(n),l=r(n),u=l.length;u--;){var f=l[t?u:++a];if(i(o[f],f,o)===!1)break}return n}}return Zx=e,Zx}var Qx,vR;function Wye(){if(vR)return Qx;vR=1;var e=Vye(),t=e();return Qx=t,Qx}var Jx,gR;function IU(){if(gR)return Jx;gR=1;var e=Wye(),t=F0();function n(i,r){return i&&e(i,r,t)}return Jx=n,Jx}var e3,yR;function Gye(){if(yR)return e3;yR=1;var e=jp();function t(n,i){return function(r,a){if(r==null)return r;if(!e(r))return n(r,a);for(var o=r.length,l=i?o:-1,u=Object(r);(i?l--:++li||l&&u&&h&&!f&&!d||a&&u&&h||!r&&h||!o)return 1;if(!a&&!l&&!d&&n=f)return h;var d=r[a];return h*(d=="desc"?-1:1)}}return n.index-i.index}return a3=t,a3}var o3,SR;function Zye(){if(SR)return o3;SR=1;var e=J9(),t=ej(),n=Dl(),i=BU(),r=Yye(),a=OU(),o=Xye(),l=cd(),u=jr();function f(h,d,p){d.length?d=e(d,function(w){return u(w)?function(k){return t(k,w.length===1?w[0]:w)}:w}):d=[l];var g=-1;d=e(d,a(n));var b=i(h,function(w,k,_){var x=e(d,function(j){return j(w)});return{criteria:x,index:++g,value:w}});return r(b,function(w,k){return o(w,k,p)})}return o3=f,o3}var s3,CR;function Qye(){if(CR)return s3;CR=1;function e(t,n,i){switch(i.length){case 0:return t.call(n);case 1:return t.call(n,i[0]);case 2:return t.call(n,i[0],i[1]);case 3:return t.call(n,i[0],i[1],i[2])}return t.apply(n,i)}return s3=e,s3}var l3,jR;function Jye(){if(jR)return l3;jR=1;var e=Qye(),t=Math.max;function n(i,r,a){return r=t(r===void 0?i.length-1:r,0),function(){for(var o=arguments,l=-1,u=t(o.length-r,0),f=Array(u);++l0){if(++a>=e)return arguments[0]}else a=0;return r.apply(void 0,arguments)}}return d3=i,d3}var h3,MR;function i0e(){if(MR)return h3;MR=1;var e=t0e(),t=n0e(),n=t(e);return h3=n,h3}var m3,DR;function r0e(){if(DR)return m3;DR=1;var e=cd(),t=Jye(),n=i0e();function i(r,a){return n(t(r,a,e),r+"")}return m3=i,m3}var p3,RR;function H0(){if(RR)return p3;RR=1;var e=X9(),t=jp(),n=cj(),i=Ml();function r(a,o,l){if(!i(l))return!1;var u=typeof o;return(u=="number"?t(l)&&n(o,l.length):u=="string"&&o in l)?e(l[o],a):!1}return p3=r,p3}var v3,PR;function a0e(){if(PR)return v3;PR=1;var e=LU(),t=Zye(),n=r0e(),i=H0(),r=n(function(a,o){if(a==null)return[];var l=o.length;return l>1&&i(a,o[0],o[1])?o=[]:l>2&&i(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return v3=r,v3}var o0e=a0e();const mj=gn(o0e);function ym(e){"@babel/helpers - typeof";return ym=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ym(e)}function E4(){return E4=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=t.x),"".concat(yh,"-left"),Ge(n)&&t&&Ge(t.x)&&n=t.y),"".concat(yh,"-top"),Ge(i)&&t&&Ge(t.y)&&iw?Math.max(h,u[i]):Math.max(d,u[i])}function k0e(e){var t=e.translateX,n=e.translateY,i=e.useTranslate3d;return{transform:i?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function _0e(e){var t=e.allowEscapeViewBox,n=e.coordinate,i=e.offsetTopLeft,r=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,u=e.viewBox,f,h,d;return o.height>0&&o.width>0&&n?(h=zR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:i,position:r,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),d=zR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:i,position:r,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),f=k0e({translateX:h,translateY:d,useTranslate3d:l})):f=b0e,{cssProperties:f,cssClasses:w0e({translateX:h,translateY:d,coordinate:n})}}function vf(e){"@babel/helpers - typeof";return vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(e)}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function IR(e){for(var t=1;tBR||Math.abs(i.height-this.state.lastBoundingBox.height)>BR)&&this.setState({lastBoundingBox:{width:i.width,height:i.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var i,r;this.props.active&&this.updateBBox(),this.state.dismissed&&(((i=this.props.coordinate)===null||i===void 0?void 0:i.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var i=this,r=this.props,a=r.active,o=r.allowEscapeViewBox,l=r.animationDuration,u=r.animationEasing,f=r.children,h=r.coordinate,d=r.hasPayload,p=r.isAnimationActive,g=r.offset,b=r.position,w=r.reverseDirection,k=r.useTranslate3d,_=r.viewBox,x=r.wrapperStyle,j=_0e({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:b,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:k,viewBox:_}),T=j.cssClasses,A=j.cssProperties,O=IR(IR({transition:p&&a?"transform ".concat(l,"ms ").concat(u):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return J.createElement("div",{tabIndex:-1,className:T,style:O,ref:function(N){i.wrapperNode=N}},f)}}])})(S.PureComponent),D0e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Uu={isSsr:D0e()};function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function FR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function qR(e){for(var t=1;t0;return J.createElement(M0e,{allowEscapeViewBox:o,animationDuration:l,animationEasing:u,isAnimationActive:p,active:a,coordinate:h,hasPayload:O,offset:g,position:k,reverseDirection:_,useTranslate3d:x,viewBox:j,wrapperStyle:T},q0e(f,qR(qR({},this.props),{},{payload:A})))}}])})(S.PureComponent);pj(ha,"displayName","Tooltip");pj(ha,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Uu.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var y3,HR;function H0e(){if(HR)return y3;HR=1;var e=jo(),t=function(){return e.Date.now()};return y3=t,y3}var b3,UR;function U0e(){if(UR)return b3;UR=1;var e=/\s/;function t(n){for(var i=n.length;i--&&e.test(n.charAt(i)););return i}return b3=t,b3}var w3,VR;function V0e(){if(VR)return w3;VR=1;var e=U0e(),t=/^\s+/;function n(i){return i&&i.slice(0,e(i)+1).replace(t,"")}return w3=n,w3}var k3,WR;function WU(){if(WR)return k3;WR=1;var e=V0e(),t=Ml(),n=od(),i=NaN,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function u(f){if(typeof f=="number")return f;if(n(f))return i;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=a.test(f);return d||o.test(f)?l(f.slice(2),d?2:8):r.test(f)?i:+f}return k3=u,k3}var _3,GR;function W0e(){if(GR)return _3;GR=1;var e=Ml(),t=H0e(),n=WU(),i="Expected a function",r=Math.max,a=Math.min;function o(l,u,f){var h,d,p,g,b,w,k=0,_=!1,x=!1,j=!0;if(typeof l!="function")throw new TypeError(i);u=n(u)||0,e(f)&&(_=!!f.leading,x="maxWait"in f,p=x?r(n(f.maxWait)||0,u):p,j="trailing"in f?!!f.trailing:j);function T(G){var U=h,$=d;return h=d=void 0,k=G,g=l.apply($,U),g}function A(G){return k=G,b=setTimeout(N,u),_?T(G):g}function O(G){var U=G-w,$=G-k,D=u-U;return x?a(D,p-$):D}function M(G){var U=G-w,$=G-k;return w===void 0||U>=u||U<0||x&&$>=p}function N(){var G=t();if(M(G))return F(G);b=setTimeout(N,O(G))}function F(G){return b=void 0,j&&h?T(G):(h=d=void 0,g)}function R(){b!==void 0&&clearTimeout(b),k=0,h=w=d=b=void 0}function I(){return b===void 0?g:F(t())}function q(){var G=t(),U=M(G);if(h=arguments,d=this,w=G,U){if(b===void 0)return A(w);if(x)return clearTimeout(b),b=setTimeout(N,u),T(w)}return b===void 0&&(b=setTimeout(N,u)),g}return q.cancel=R,q.flush=I,q}return _3=o,_3}var x3,YR;function G0e(){if(YR)return x3;YR=1;var e=W0e(),t=Ml(),n="Expected a function";function i(r,a,o){var l=!0,u=!0;if(typeof r!="function")throw new TypeError(n);return t(o)&&(l="leading"in o?!!o.leading:l,u="trailing"in o?!!o.trailing:u),e(r,a,{leading:l,maxWait:a,trailing:u})}return x3=i,x3}var Y0e=G0e();const GU=gn(Y0e);function wm(e){"@babel/helpers - typeof";return wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wm(e)}function KR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function ug(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&(G=GU(G,w,{trailing:!0,leading:!1}));var U=new ResizeObserver(G),$=A.current.getBoundingClientRect(),D=$.width,z=$.height;return I(D,z),U.observe(A.current),function(){U.disconnect()}},[I,w]);var q=S.useMemo(function(){var G=F.containerWidth,U=F.containerHeight;if(G<0||U<0)return null;rs(hu(o)||hu(u),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,u),rs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var $=hu(o)?G:o,D=hu(u)?U:u;n&&n>0&&($?D=$/n:D&&($=D*n),p&&D>p&&(D=p)),rs($>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,$,D,o,u,h,d,n);var z=!Array.isArray(g)&&is(g.type).endsWith("Chart");return J.Children.map(g,function(H){return J.isValidElement(H)?S.cloneElement(H,ug({width:$,height:D},z?{style:ug({height:"100%",width:"100%",maxHeight:D,maxWidth:$},H.props.style)}:{})):H})},[n,g,u,p,d,h,F,o]);return J.createElement("div",{id:k?"".concat(k):void 0,className:vt("recharts-responsive-container",_),style:ug(ug({},T),{},{width:o,height:u,minWidth:h,minHeight:d,maxHeight:p}),ref:A},q)}),YU=function(t){return null};YU.displayName="Cell";function km(e){"@babel/helpers - typeof";return km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},km(e)}function ZR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function P4(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Uu.isSsr)return{width:0,height:0};var i=lbe(n),r=JSON.stringify({text:t,copyStyle:i});if(Ic.widthCache[r])return Ic.widthCache[r];try{var a=document.getElementById(QR);a||(a=document.createElement("span"),a.setAttribute("id",QR),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=P4(P4({},sbe),i);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),u={width:l.width,height:l.height};return Ic.widthCache[r]=u,++Ic.cacheCount>obe&&(Ic.cacheCount=0,Ic.widthCache={}),u}catch{return{width:0,height:0}}},ube=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function _m(e){"@babel/helpers - typeof";return _m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_m(e)}function _1(e,t){return hbe(e)||dbe(e,t)||fbe(e,t)||cbe()}function cbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fbe(e,t){if(e){if(typeof e=="string")return JR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JR(e,t)}}function JR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Abe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function aP(e,t){return Mbe(e)||Ebe(e,t)||Tbe(e,t)||Obe()}function Obe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tbe(e,t){if(e){if(typeof e=="string")return oP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oP(e,t)}}function oP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(D,z){var H=z.word,Y=z.width,P=D[D.length-1];if(P&&(r==null||a||P.width+Y+iz.width?D:z})};if(!h)return g;for(var w="…",k=function($){var D=d.slice(0,$),z=QU({breakAll:f,style:u,children:D+w}).wordsWithComputedWidth,H=p(z),Y=H.length>o||b(H).width>Number(r);return[Y,H]},_=0,x=d.length-1,j=0,T;_<=x&&j<=d.length-1;){var A=Math.floor((_+x)/2),O=A-1,M=k(O),N=aP(M,2),F=N[0],R=N[1],I=k(A),q=aP(I,1),G=q[0];if(!F&&!G&&(_=A+1),F&&G&&(x=A-1),!F&&G){T=R;break}j++}return T||g},sP=function(t){var n=Kt(t)?[]:t.toString().split(ZU);return[{words:n}]},Rbe=function(t){var n=t.width,i=t.scaleToFit,r=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||i)&&!Uu.isSsr){var u,f,h=QU({breakAll:o,children:r,style:a});if(h){var d=h.wordsWithComputedWidth,p=h.spaceWidth;u=d,f=p}else return sP(r);return Dbe({breakAll:o,children:r,maxLines:l,style:a},u,f,n,i)}return sP(r)},lP="#808080",x1=function(t){var n=t.x,i=n===void 0?0:n,r=t.y,a=r===void 0?0:r,o=t.lineHeight,l=o===void 0?"1em":o,u=t.capHeight,f=u===void 0?"0.71em":u,h=t.scaleToFit,d=h===void 0?!1:h,p=t.textAnchor,g=p===void 0?"start":p,b=t.verticalAnchor,w=b===void 0?"end":b,k=t.fill,_=k===void 0?lP:k,x=rP(t,Cbe),j=S.useMemo(function(){return Rbe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),T=x.dx,A=x.dy,O=x.angle,M=x.className,N=x.breakAll,F=rP(x,jbe);if(!Ci(i)||!Ci(a))return null;var R=i+(Ge(T)?T:0),I=a+(Ge(A)?A:0),q;switch(w){case"start":q=S3("calc(".concat(f,")"));break;case"middle":q=S3("calc(".concat((j.length-1)/2," * -").concat(l," + (").concat(f," / 2))"));break;default:q=S3("calc(".concat(j.length-1," * -").concat(l,")"));break}var G=[];if(d){var U=j[0].width,$=x.width;G.push("scale(".concat((Ge($)?$/U:1)/U,")"))}return O&&G.push("rotate(".concat(O,", ").concat(R,", ").concat(I,")")),G.length&&(F.transform=G.join(" ")),J.createElement("text",N4({},Ut(F,!0),{x:R,y:I,className:vt("recharts-text",M),textAnchor:g,fill:_.includes("url")?lP:_}),j.map(function(D,z){var H=D.words.join(N?"":" ");return J.createElement("tspan",{x:R,dy:z===0?q:l,key:"".concat(H,"-").concat(z)},H)}))};function pl(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function Pbe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function gj(e){let t,n,i;e.length!==2?(t=pl,n=(l,u)=>pl(e(l),u),i=(l,u)=>e(l)-u):(t=e===pl||e===Pbe?e:Nbe,n=e,i=e);function r(l,u,f=0,h=l.length){if(f>>1;n(l[d],u)<0?f=d+1:h=d}while(f>>1;n(l[d],u)<=0?f=d+1:h=d}while(ff&&i(l[d-1],u)>-i(l[d],u)?d-1:d}return{left:r,center:o,right:a}}function Nbe(){return 0}function JU(e){return e===null?NaN:+e}function*$be(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const zbe=gj(pl),Ap=zbe.right;gj(JU).center;class uP extends Map{constructor(t,n=Bbe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(cP(this,t))}has(t){return super.has(cP(this,t))}set(t,n){return super.set(Lbe(this,t),n)}delete(t){return super.delete(Ibe(this,t))}}function cP({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Lbe({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function Ibe({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function Bbe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fbe(e=pl){if(e===pl)return eV;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function eV(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const qbe=Math.sqrt(50),Hbe=Math.sqrt(10),Ube=Math.sqrt(2);function S1(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),a=i/Math.pow(10,r),o=a>=qbe?10:a>=Hbe?5:a>=Ube?2:1;let l,u,f;return r<0?(f=Math.pow(10,-r)/o,l=Math.round(e*f),u=Math.round(t*f),l/ft&&--u,f=-f):(f=Math.pow(10,r)*o,l=Math.round(e/f),u=Math.round(t/f),l*ft&&--u),u0))return[];if(e===t)return[e];const i=t=r))return[];const l=a-r+1,u=new Array(l);if(i)if(o<0)for(let f=0;f=i)&&(n=i);return n}function dP(e,t){let n;for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);return n}function tV(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?eV:Fbe(r);i>n;){if(i-n>600){const u=i-n+1,f=t-n+1,h=Math.log(u),d=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*d*(u-d)/u)*(f-u/2<0?-1:1),g=Math.max(n,Math.floor(t-f*d/u+p)),b=Math.min(i,Math.floor(t+(u-f)*d/u+p));tV(e,t,g,b,r)}const a=e[t];let o=n,l=i;for(bh(e,n,t),r(e[i],a)>0&&bh(e,n,i);o0;)--l}r(e[n],a)===0?bh(e,n,l):(++l,bh(e,l,i)),l<=t&&(n=l+1),t<=l&&(i=l-1)}return e}function bh(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Vbe(e,t,n){if(e=Float64Array.from($be(e)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return dP(e);if(t>=1)return fP(e);var i,r=(i-1)*t,a=Math.floor(r),o=fP(tV(e,a).subarray(0,a+1)),l=dP(e.subarray(a+1));return o+(l-o)*(r-a)}}function Wbe(e,t,n=JU){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,a=Math.floor(r),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(r-a)}}function Gbe(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(r);++i>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?fg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?fg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Kbe.exec(e))?new xr(t[1],t[2],t[3],1):(t=Xbe.exec(e))?new xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Zbe.exec(e))?fg(t[1],t[2],t[3],t[4]):(t=Qbe.exec(e))?fg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jbe.exec(e))?bP(t[1],t[2]/100,t[3]/100,1):(t=ewe.exec(e))?bP(t[1],t[2]/100,t[3]/100,t[4]):hP.hasOwnProperty(e)?vP(hP[e]):e==="transparent"?new xr(NaN,NaN,NaN,0):null}function vP(e){return new xr(e>>16&255,e>>8&255,e&255,1)}function fg(e,t,n,i){return i<=0&&(e=t=n=NaN),new xr(e,t,n,i)}function iwe(e){return e instanceof Op||(e=jm(e)),e?(e=e.rgb(),new xr(e.r,e.g,e.b,e.opacity)):new xr}function B4(e,t,n,i){return arguments.length===1?iwe(e):new xr(e,t,n,i??1)}function xr(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}bj(xr,B4,iV(Op,{brighter(e){return e=e==null?C1:Math.pow(C1,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sm:Math.pow(Sm,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xr(bu(this.r),bu(this.g),bu(this.b),j1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gP,formatHex:gP,formatHex8:rwe,formatRgb:yP,toString:yP}));function gP(){return`#${mu(this.r)}${mu(this.g)}${mu(this.b)}`}function rwe(){return`#${mu(this.r)}${mu(this.g)}${mu(this.b)}${mu((isNaN(this.opacity)?1:this.opacity)*255)}`}function yP(){const e=j1(this.opacity);return`${e===1?"rgb(":"rgba("}${bu(this.r)}, ${bu(this.g)}, ${bu(this.b)}${e===1?")":`, ${e})`}`}function j1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function bu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mu(e){return e=bu(e),(e<16?"0":"")+e.toString(16)}function bP(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ba(e,t,n,i)}function rV(e){if(e instanceof Ba)return new Ba(e.h,e.s,e.l,e.opacity);if(e instanceof Op||(e=jm(e)),!e)return new Ba;if(e instanceof Ba)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),a=Math.max(t,n,i),o=NaN,l=a-r,u=(a+r)/2;return l?(t===a?o=(n-i)/l+(n0&&u<1?0:o,new Ba(o,l,u,e.opacity)}function awe(e,t,n,i){return arguments.length===1?rV(e):new Ba(e,t,n,i??1)}function Ba(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}bj(Ba,awe,iV(Op,{brighter(e){return e=e==null?C1:Math.pow(C1,e),new Ba(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sm:Math.pow(Sm,e),new Ba(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new xr(C3(e>=240?e-240:e+120,r,i),C3(e,r,i),C3(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ba(wP(this.h),dg(this.s),dg(this.l),j1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=j1(this.opacity);return`${e===1?"hsl(":"hsla("}${wP(this.h)}, ${dg(this.s)*100}%, ${dg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wP(e){return e=(e||0)%360,e<0?e+360:e}function dg(e){return Math.max(0,Math.min(1,e||0))}function C3(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const wj=e=>()=>e;function owe(e,t){return function(n){return e+n*t}}function swe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function lwe(e){return(e=+e)==1?aV:function(t,n){return n-t?swe(t,n,e):wj(isNaN(t)?n:t)}}function aV(e,t){var n=t-e;return n?owe(e,n):wj(isNaN(e)?t:e)}const kP=(function e(t){var n=lwe(t);function i(r,a){var o=n((r=B4(r)).r,(a=B4(a)).r),l=n(r.g,a.g),u=n(r.b,a.b),f=aV(r.opacity,a.opacity);return function(h){return r.r=o(h),r.g=l(h),r.b=u(h),r.opacity=f(h),r+""}}return i.gamma=e,i})(1);function uwe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(a){for(r=0;rn&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(i=i[0])===(r=r[0])?l[o]?l[o]+=r:l[++o]=r:(l[++o]=null,u.push({i:o,x:A1(i,r)})),n=j3.lastIndex;return nt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function wwe(e,t,n){var i=e[0],r=e[1],a=t[0],o=t[1];return r2?kwe:wwe,u=f=null,d}function d(p){return p==null||isNaN(p=+p)?a:(u||(u=l(e.map(i),t,n)))(i(o(p)))}return d.invert=function(p){return o(r((f||(f=l(t,e.map(i),A1)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,O1),h()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),h()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),n=kj,h()},d.clamp=function(p){return arguments.length?(o=p?!0:or,h()):o!==or},d.interpolate=function(p){return arguments.length?(n=p,h()):n},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,g){return i=p,r=g,h()}}function _j(){return U0()(or,or)}function _we(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function T1(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function yf(e){return e=T1(Math.abs(e)),e?e[1]:NaN}function xwe(e,t){return function(n,i){for(var r=n.length,a=[],o=0,l=e[0],u=0;r>0&&l>0&&(u+l+1>i&&(l=Math.max(1,i-u)),a.push(n.substring(r-=l,r+l)),!((u+=l+1)>i));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Swe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Cwe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Am(e){if(!(t=Cwe.exec(e)))throw new Error("invalid format: "+e);var t;return new xj({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Am.prototype=xj.prototype;function xj(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}xj.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jwe(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var E1;function Awe(e,t){var n=T1(e,t);if(!n)return E1=void 0,e.toPrecision(t);var i=n[0],r=n[1],a=r-(E1=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+T1(e,Math.max(0,t+a-1))[0]}function xP(e,t){var n=T1(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const SP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_we,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>xP(e*100,t),r:xP,s:Awe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function CP(e){return e}var jP=Array.prototype.map,AP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Owe(e){var t=e.grouping===void 0||e.thousands===void 0?CP:xwe(jP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?CP:Swe(jP.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function f(d,p){d=Am(d);var g=d.fill,b=d.align,w=d.sign,k=d.symbol,_=d.zero,x=d.width,j=d.comma,T=d.precision,A=d.trim,O=d.type;O==="n"?(j=!0,O="g"):SP[O]||(T===void 0&&(T=12),A=!0,O="g"),(_||g==="0"&&b==="=")&&(_=!0,g="0",b="=");var M=(p&&p.prefix!==void 0?p.prefix:"")+(k==="$"?n:k==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),N=(k==="$"?i:/[%p]/.test(O)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),F=SP[O],R=/[defgprs%]/.test(O);T=T===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function I(q){var G=M,U=N,$,D,z;if(O==="c")U=F(q)+U,q="";else{q=+q;var H=q<0||1/q<0;if(q=isNaN(q)?u:F(Math.abs(q),T),A&&(q=jwe(q)),H&&+q==0&&w!=="+"&&(H=!1),G=(H?w==="("?w:l:w==="-"||w==="("?"":w)+G,U=(O==="s"&&!isNaN(q)&&E1!==void 0?AP[8+E1/3]:"")+U+(H&&w==="("?")":""),R){for($=-1,D=q.length;++$z||z>57){U=(z===46?r+q.slice($+1):q.slice($))+U,q=q.slice(0,$);break}}}j&&!_&&(q=t(q,1/0));var Y=G.length+q.length+U.length,P=Y>1)+G+q+U+P.slice(Y);break;default:q=P+G+q+U;break}return a(q)}return I.toString=function(){return d+""},I}function h(d,p){var g=Math.max(-8,Math.min(8,Math.floor(yf(p)/3)))*3,b=Math.pow(10,-g),w=f((d=Am(d),d.type="f",d),{suffix:AP[8+g/3]});return function(k){return w(b*k)}}return{format:f,formatPrefix:h}}var hg,Sj,oV;Twe({thousands:",",grouping:[3],currency:["$",""]});function Twe(e){return hg=Owe(e),Sj=hg.format,oV=hg.formatPrefix,hg}function Ewe(e){return Math.max(0,-yf(Math.abs(e)))}function Mwe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yf(t)/3)))*3-yf(Math.abs(e)))}function Dwe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,yf(t)-yf(e))+1}function sV(e,t,n,i){var r=L4(e,t,n),a;switch(i=Am(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(a=Mwe(r,o))&&(i.precision=a),oV(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=Dwe(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=Ewe(r))&&(i.precision=a-(i.type==="%")*2);break}}return Sj(i)}function Rl(e){var t=e.domain;return e.ticks=function(n){var i=t();return $4(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return sV(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,a=i.length-1,o=i[r],l=i[a],u,f,h=10;for(l0;){if(f=z4(o,l,n),f===u)return i[r]=o,i[a]=l,t(i);if(f>0)o=Math.floor(o/f)*f,l=Math.ceil(l/f)*f;else if(f<0)o=Math.ceil(o*f)/f,l=Math.floor(l*f)/f;else break;u=f}return e},e}function M1(){var e=_j();return e.copy=function(){return Tp(e,M1())},ja.apply(e,arguments),Rl(e)}function lV(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,O1),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return lV(e).unknown(t)},e=arguments.length?Array.from(e,O1):[0,1],Rl(n)}function uV(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],a=e[i],o;return aMath.pow(e,t)}function zwe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function EP(e){return(t,n)=>-e(-t,n)}function Cj(e){const t=e(OP,TP),n=t.domain;let i=10,r,a;function o(){return r=zwe(i),a=$we(i),n()[0]<0?(r=EP(r),a=EP(a),e(Rwe,Pwe)):e(OP,TP),t}return t.base=function(l){return arguments.length?(i=+l,o()):i},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const u=n();let f=u[0],h=u[u.length-1];const d=h0){for(;p<=g;++p)for(b=1;bh)break;_.push(w)}}else for(;p<=g;++p)for(b=i-1;b>=1;--b)if(w=p>0?b/a(-p):b*a(p),!(wh)break;_.push(w)}_.length*2{if(l==null&&(l=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Am(u)).precision==null&&(u.trim=!0),u=Sj(u)),l===1/0)return u;const f=Math.max(1,i*l/t.ticks().length);return h=>{let d=h/a(Math.round(r(h)));return d*in(uV(n(),{floor:l=>a(Math.floor(r(l))),ceil:l=>a(Math.ceil(r(l)))})),t}function cV(){const e=Cj(U0()).domain([1,10]);return e.copy=()=>Tp(e,cV()).base(e.base()),ja.apply(e,arguments),e}function MP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function DP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jj(e){var t=1,n=e(MP(t),DP(t));return n.constant=function(i){return arguments.length?e(MP(t=+i),DP(t)):t},Rl(n)}function fV(){var e=jj(U0());return e.copy=function(){return Tp(e,fV()).constant(e.constant())},ja.apply(e,arguments)}function RP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Lwe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Iwe(e){return e<0?-e*e:e*e}function Aj(e){var t=e(or,or),n=1;function i(){return n===1?e(or,or):n===.5?e(Lwe,Iwe):e(RP(n),RP(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Rl(t)}function Oj(){var e=Aj(U0());return e.copy=function(){return Tp(e,Oj()).exponent(e.exponent())},ja.apply(e,arguments),e}function Bwe(){return Oj.apply(null,arguments).exponent(.5)}function PP(e){return Math.sign(e)*e*e}function Fwe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function dV(){var e=_j(),t=[0,1],n=!1,i;function r(a){var o=Fwe(e(a));return isNaN(o)?i:n?Math.round(o):o}return r.invert=function(a){return e.invert(PP(a))},r.domain=function(a){return arguments.length?(e.domain(a),r):e.domain()},r.range=function(a){return arguments.length?(e.range((t=Array.from(a,O1)).map(PP)),r):t.slice()},r.rangeRound=function(a){return r.range(a).round(!0)},r.round=function(a){return arguments.length?(n=!!a,r):n},r.clamp=function(a){return arguments.length?(e.clamp(a),r):e.clamp()},r.unknown=function(a){return arguments.length?(i=a,r):i},r.copy=function(){return dV(e.domain(),t).round(n).clamp(e.clamp()).unknown(i)},ja.apply(r,arguments),Rl(r)}function hV(){var e=[],t=[],n=[],i;function r(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[i[n-1],t]:[i[f-1],i[f]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return mV().domain([e,t]).range(r).unknown(a)},ja.apply(Rl(o),arguments)}function pV(){var e=[.5],t=[0,1],n,i=1;function r(a){return a!=null&&a<=a?t[Ap(e,a,0,i)]:n}return r.domain=function(a){return arguments.length?(e=Array.from(a),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(a){return arguments.length?(t=Array.from(a),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},r.unknown=function(a){return arguments.length?(n=a,r):n},r.copy=function(){return pV().domain(e).range(t).unknown(n)},ja.apply(r,arguments)}const A3=new Date,O3=new Date;function Ai(e,t,n,i){function r(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return r.floor=a=>(e(a=new Date(+a)),a),r.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),r.round=a=>{const o=r(a),l=r.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),r.range=(a,o,l)=>{const u=[];if(a=r.ceil(a),l=l==null?1:Math.floor(l),!(a0))return u;let f;do u.push(f=new Date(+a)),t(a,l),e(a);while(fAi(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(r.count=(a,o)=>(A3.setTime(+a),O3.setTime(+o),e(A3),e(O3),Math.floor(n(A3,O3))),r.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?r.filter(i?o=>i(o)%a===0:o=>r.count(0,o)%a===0):r)),r}const D1=Ai(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);D1.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ai(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):D1);D1.range;const Zo=1e3,va=Zo*60,Qo=va*60,ds=Qo*24,Tj=ds*7,NP=ds*30,T3=ds*365,pu=Ai(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Zo)},(e,t)=>(t-e)/Zo,e=>e.getUTCSeconds());pu.range;const Ej=Ai(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zo)},(e,t)=>{e.setTime(+e+t*va)},(e,t)=>(t-e)/va,e=>e.getMinutes());Ej.range;const Mj=Ai(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*va)},(e,t)=>(t-e)/va,e=>e.getUTCMinutes());Mj.range;const Dj=Ai(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Zo-e.getMinutes()*va)},(e,t)=>{e.setTime(+e+t*Qo)},(e,t)=>(t-e)/Qo,e=>e.getHours());Dj.range;const Rj=Ai(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Qo)},(e,t)=>(t-e)/Qo,e=>e.getUTCHours());Rj.range;const Ep=Ai(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*va)/ds,e=>e.getDate()-1);Ep.range;const V0=Ai(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ds,e=>e.getUTCDate()-1);V0.range;const vV=Ai(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ds,e=>Math.floor(e/ds));vV.range;function Vu(e){return Ai(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*va)/Tj)}const W0=Vu(0),R1=Vu(1),qwe=Vu(2),Hwe=Vu(3),bf=Vu(4),Uwe=Vu(5),Vwe=Vu(6);W0.range;R1.range;qwe.range;Hwe.range;bf.range;Uwe.range;Vwe.range;function Wu(e){return Ai(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Tj)}const G0=Wu(0),P1=Wu(1),Wwe=Wu(2),Gwe=Wu(3),wf=Wu(4),Ywe=Wu(5),Kwe=Wu(6);G0.range;P1.range;Wwe.range;Gwe.range;wf.range;Ywe.range;Kwe.range;const Pj=Ai(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Pj.range;const Nj=Ai(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Nj.range;const hs=Ai(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ai(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});hs.range;const ms=Ai(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ms.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ai(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ms.range;function gV(e,t,n,i,r,a){const o=[[pu,1,Zo],[pu,5,5*Zo],[pu,15,15*Zo],[pu,30,30*Zo],[a,1,va],[a,5,5*va],[a,15,15*va],[a,30,30*va],[r,1,Qo],[r,3,3*Qo],[r,6,6*Qo],[r,12,12*Qo],[i,1,ds],[i,2,2*ds],[n,1,Tj],[t,1,NP],[t,3,3*NP],[e,1,T3]];function l(f,h,d){const p=hk).right(o,p);if(g===o.length)return e.every(L4(f/T3,h/T3,d));if(g===0)return D1.every(Math.max(L4(f,h,d),1));const[b,w]=o[p/o[g-1][2]53)return null;"w"in ne||(ne.w=1),"Z"in ne?(xe=M3(wh(ne.y,0,1)),Ae=xe.getUTCDay(),xe=Ae>4||Ae===0?P1.ceil(xe):P1(xe),xe=V0.offset(xe,(ne.V-1)*7),ne.y=xe.getUTCFullYear(),ne.m=xe.getUTCMonth(),ne.d=xe.getUTCDate()+(ne.w+6)%7):(xe=E3(wh(ne.y,0,1)),Ae=xe.getDay(),xe=Ae>4||Ae===0?R1.ceil(xe):R1(xe),xe=Ep.offset(xe,(ne.V-1)*7),ne.y=xe.getFullYear(),ne.m=xe.getMonth(),ne.d=xe.getDate()+(ne.w+6)%7)}else("W"in ne||"U"in ne)&&("w"in ne||(ne.w="u"in ne?ne.u%7:"W"in ne?1:0),Ae="Z"in ne?M3(wh(ne.y,0,1)).getUTCDay():E3(wh(ne.y,0,1)).getDay(),ne.m=0,ne.d="W"in ne?(ne.w+6)%7+ne.W*7-(Ae+5)%7:ne.w+ne.U*7-(Ae+6)%7);return"Z"in ne?(ne.H+=ne.Z/100|0,ne.M+=ne.Z%100,M3(ne)):E3(ne)}}function N(ee,se,ke,ne){for(var $e=0,xe=se.length,Ae=ke.length,ze,be;$e=Ae)return-1;if(ze=se.charCodeAt($e++),ze===37){if(ze=se.charAt($e++),be=A[ze in $P?se.charAt($e++):ze],!be||(ne=be(ee,ke,ne))<0)return-1}else if(ze!=ke.charCodeAt(ne++))return-1}return ne}function F(ee,se,ke){var ne=f.exec(se.slice(ke));return ne?(ee.p=h.get(ne[0].toLowerCase()),ke+ne[0].length):-1}function R(ee,se,ke){var ne=g.exec(se.slice(ke));return ne?(ee.w=b.get(ne[0].toLowerCase()),ke+ne[0].length):-1}function I(ee,se,ke){var ne=d.exec(se.slice(ke));return ne?(ee.w=p.get(ne[0].toLowerCase()),ke+ne[0].length):-1}function q(ee,se,ke){var ne=_.exec(se.slice(ke));return ne?(ee.m=x.get(ne[0].toLowerCase()),ke+ne[0].length):-1}function G(ee,se,ke){var ne=w.exec(se.slice(ke));return ne?(ee.m=k.get(ne[0].toLowerCase()),ke+ne[0].length):-1}function U(ee,se,ke){return N(ee,t,se,ke)}function $(ee,se,ke){return N(ee,n,se,ke)}function D(ee,se,ke){return N(ee,i,se,ke)}function z(ee){return o[ee.getDay()]}function H(ee){return a[ee.getDay()]}function Y(ee){return u[ee.getMonth()]}function P(ee){return l[ee.getMonth()]}function W(ee){return r[+(ee.getHours()>=12)]}function V(ee){return 1+~~(ee.getMonth()/3)}function L(ee){return o[ee.getUTCDay()]}function Z(ee){return a[ee.getUTCDay()]}function ie(ee){return u[ee.getUTCMonth()]}function re(ee){return l[ee.getUTCMonth()]}function X(ee){return r[+(ee.getUTCHours()>=12)]}function le(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var se=O(ee+="",j);return se.toString=function(){return ee},se},parse:function(ee){var se=M(ee+="",!1);return se.toString=function(){return ee},se},utcFormat:function(ee){var se=O(ee+="",T);return se.toString=function(){return ee},se},utcParse:function(ee){var se=M(ee+="",!0);return se.toString=function(){return ee},se}}}var $P={"-":"",_:" ",0:"0"},$i=/^\s*\d+/,tke=/^%/,nke=/[\\^$*+?|[\]().{}]/g;function vn(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",a=r.length;return i+(a[t.toLowerCase(),n]))}function rke(e,t,n){var i=$i.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function ake(e,t,n){var i=$i.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function oke(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function ske(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function lke(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function zP(e,t,n){var i=$i.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function LP(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function uke(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function cke(e,t,n){var i=$i.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function fke(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function IP(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function dke(e,t,n){var i=$i.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function BP(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function hke(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function mke(e,t,n){var i=$i.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function pke(e,t,n){var i=$i.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function vke(e,t,n){var i=$i.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function gke(e,t,n){var i=tke.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function yke(e,t,n){var i=$i.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function bke(e,t,n){var i=$i.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function FP(e,t){return vn(e.getDate(),t,2)}function wke(e,t){return vn(e.getHours(),t,2)}function kke(e,t){return vn(e.getHours()%12||12,t,2)}function _ke(e,t){return vn(1+Ep.count(hs(e),e),t,3)}function yV(e,t){return vn(e.getMilliseconds(),t,3)}function xke(e,t){return yV(e,t)+"000"}function Ske(e,t){return vn(e.getMonth()+1,t,2)}function Cke(e,t){return vn(e.getMinutes(),t,2)}function jke(e,t){return vn(e.getSeconds(),t,2)}function Ake(e){var t=e.getDay();return t===0?7:t}function Oke(e,t){return vn(W0.count(hs(e)-1,e),t,2)}function bV(e){var t=e.getDay();return t>=4||t===0?bf(e):bf.ceil(e)}function Tke(e,t){return e=bV(e),vn(bf.count(hs(e),e)+(hs(e).getDay()===4),t,2)}function Eke(e){return e.getDay()}function Mke(e,t){return vn(R1.count(hs(e)-1,e),t,2)}function Dke(e,t){return vn(e.getFullYear()%100,t,2)}function Rke(e,t){return e=bV(e),vn(e.getFullYear()%100,t,2)}function Pke(e,t){return vn(e.getFullYear()%1e4,t,4)}function Nke(e,t){var n=e.getDay();return e=n>=4||n===0?bf(e):bf.ceil(e),vn(e.getFullYear()%1e4,t,4)}function $ke(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vn(t/60|0,"0",2)+vn(t%60,"0",2)}function qP(e,t){return vn(e.getUTCDate(),t,2)}function zke(e,t){return vn(e.getUTCHours(),t,2)}function Lke(e,t){return vn(e.getUTCHours()%12||12,t,2)}function Ike(e,t){return vn(1+V0.count(ms(e),e),t,3)}function wV(e,t){return vn(e.getUTCMilliseconds(),t,3)}function Bke(e,t){return wV(e,t)+"000"}function Fke(e,t){return vn(e.getUTCMonth()+1,t,2)}function qke(e,t){return vn(e.getUTCMinutes(),t,2)}function Hke(e,t){return vn(e.getUTCSeconds(),t,2)}function Uke(e){var t=e.getUTCDay();return t===0?7:t}function Vke(e,t){return vn(G0.count(ms(e)-1,e),t,2)}function kV(e){var t=e.getUTCDay();return t>=4||t===0?wf(e):wf.ceil(e)}function Wke(e,t){return e=kV(e),vn(wf.count(ms(e),e)+(ms(e).getUTCDay()===4),t,2)}function Gke(e){return e.getUTCDay()}function Yke(e,t){return vn(P1.count(ms(e)-1,e),t,2)}function Kke(e,t){return vn(e.getUTCFullYear()%100,t,2)}function Xke(e,t){return e=kV(e),vn(e.getUTCFullYear()%100,t,2)}function Zke(e,t){return vn(e.getUTCFullYear()%1e4,t,4)}function Qke(e,t){var n=e.getUTCDay();return e=n>=4||n===0?wf(e):wf.ceil(e),vn(e.getUTCFullYear()%1e4,t,4)}function Jke(){return"+0000"}function HP(){return"%"}function UP(e){return+e}function VP(e){return Math.floor(+e/1e3)}var Bc,_V,xV;e_e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function e_e(e){return Bc=eke(e),_V=Bc.format,Bc.parse,xV=Bc.utcFormat,Bc.utcParse,Bc}function t_e(e){return new Date(e)}function n_e(e){return e instanceof Date?+e:+new Date(+e)}function $j(e,t,n,i,r,a,o,l,u,f){var h=_j(),d=h.invert,p=h.domain,g=f(".%L"),b=f(":%S"),w=f("%I:%M"),k=f("%I %p"),_=f("%a %d"),x=f("%b %d"),j=f("%B"),T=f("%Y");function A(O){return(u(O)t(r/(e.length-1)))},n.quantiles=function(i){return Array.from({length:i+1},(r,a)=>Vbe(e,a/i))},n.copy=function(){return AV(t).domain(e)},Cs.apply(n,arguments)}function K0(){var e=0,t=.5,n=1,i=1,r,a,o,l,u,f=or,h,d=!1,p;function g(w){return isNaN(w=+w)?p:(w=.5+((w=+h(w))-a)*(i*wn}return R3=e,R3}var P3,KP;function l_e(){if(KP)return P3;KP=1;var e=MV(),t=s_e(),n=cd();function i(r){return r&&r.length?e(r,n,t):void 0}return P3=i,P3}var u_e=l_e();const ul=gn(u_e);var N3,XP;function c_e(){if(XP)return N3;XP=1;function e(t,n){return te.e^a.s<0?1:-1;for(i=a.d.length,r=e.d.length,t=0,n=ie.d[t]^a.s<0?1:-1;return i===r?0:i>r^a.s<0?1:-1};lt.decimalPlaces=lt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Wn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};lt.dividedBy=lt.div=function(e){return os(this,new this.constructor(e))};lt.dividedToIntegerBy=lt.idiv=function(e){var t=this,n=t.constructor;return Pn(os(t,new n(e),0,1),n.precision)};lt.equals=lt.eq=function(e){return!this.cmp(e)};lt.exponent=function(){return bi(this)};lt.greaterThan=lt.gt=function(e){return this.cmp(e)>0};lt.greaterThanOrEqualTo=lt.gte=function(e){return this.cmp(e)>=0};lt.isInteger=lt.isint=function(){return this.e>this.d.length-2};lt.isNegative=lt.isneg=function(){return this.s<0};lt.isPositive=lt.ispos=function(){return this.s>0};lt.isZero=function(){return this.s===0};lt.lessThan=lt.lt=function(e){return this.cmp(e)<0};lt.lessThanOrEqualTo=lt.lte=function(e){return this.cmp(e)<1};lt.logarithm=lt.log=function(e){var t,n=this,i=n.constructor,r=i.precision,a=r+5;if(e===void 0)e=new i(10);else if(e=new i(e),e.s<1||e.eq(Hr))throw Error(wa+"NaN");if(n.s<1)throw Error(wa+(n.s?"NaN":"-Infinity"));return n.eq(Hr)?new i(0):(Qn=!1,t=os(Om(n,a),Om(e,a),a),Qn=!0,Pn(t,r))};lt.minus=lt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NV(t,e):RV(t,(e.s=-e.s,e))};lt.modulo=lt.mod=function(e){var t,n=this,i=n.constructor,r=i.precision;if(e=new i(e),!e.s)throw Error(wa+"NaN");return n.s?(Qn=!1,t=os(n,e,0,1).times(e),Qn=!0,n.minus(t)):Pn(new i(n),r)};lt.naturalExponential=lt.exp=function(){return PV(this)};lt.naturalLogarithm=lt.ln=function(){return Om(this)};lt.negated=lt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};lt.plus=lt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RV(t,e):NV(t,(e.s=-e.s,e))};lt.precision=lt.sd=function(e){var t,n,i,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(wu+e);if(t=bi(r)+1,i=r.d.length-1,n=i*Wn+1,i=r.d[i],i){for(;i%10==0;i/=10)n--;for(i=r.d[0];i>=10;i/=10)n++}return e&&t>n?t:n};lt.squareRoot=lt.sqrt=function(){var e,t,n,i,r,a,o,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(wa+"NaN")}for(e=bi(l),Qn=!1,r=Math.sqrt(+l),r==0||r==1/0?(t=ao(l.d),(t.length+e)%2==0&&(t+="0"),r=Math.sqrt(t),e=hd((e+1)/2)-(e<0||e%2),r==1/0?t="5e"+e:(t=r.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),i=new u(t)):i=new u(r.toString()),n=u.precision,r=o=n+3;;)if(a=i,i=a.plus(os(l,a,o+2)).times(.5),ao(a.d).slice(0,o)===(t=ao(i.d)).slice(0,o)){if(t=t.slice(o-3,o+1),r==o&&t=="4999"){if(Pn(a,n+1,0),a.times(a).eq(l)){i=a;break}}else if(t!="9999")break;o+=4}return Qn=!0,Pn(i,n)};lt.times=lt.mul=function(e){var t,n,i,r,a,o,l,u,f,h=this,d=h.constructor,p=h.d,g=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,n=h.e+e.e,u=p.length,f=g.length,u=0;){for(t=0,r=u+i;r>i;)l=a[r]+g[i]*p[r-i-1]+t,a[r--]=l%Ri|0,t=l/Ri|0;a[r]=(a[r]+t)%Ri|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Qn?Pn(e,d.precision):e};lt.toDecimalPlaces=lt.todp=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(bo(e,0,dd),t===void 0?t=i.rounding:bo(t,0,8),Pn(n,e+bi(n)+1,t))};lt.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=Mu(i,!0):(bo(e,0,dd),t===void 0?t=r.rounding:bo(t,0,8),i=Pn(new r(i),e+1,t),n=Mu(i,!0,e+1)),n};lt.toFixed=function(e,t){var n,i,r=this,a=r.constructor;return e===void 0?Mu(r):(bo(e,0,dd),t===void 0?t=a.rounding:bo(t,0,8),i=Pn(new a(r),e+bi(r)+1,t),n=Mu(i.abs(),!1,e+bi(i)+1),r.isneg()&&!r.isZero()?"-"+n:n)};lt.toInteger=lt.toint=function(){var e=this,t=e.constructor;return Pn(new t(e),bi(e)+1,t.rounding)};lt.toNumber=function(){return+this};lt.toPower=lt.pow=function(e){var t,n,i,r,a,o,l=this,u=l.constructor,f=12,h=+(e=new u(e));if(!e.s)return new u(Hr);if(l=new u(l),!l.s){if(e.s<1)throw Error(wa+"Infinity");return l}if(l.eq(Hr))return l;if(i=u.precision,e.eq(Hr))return Pn(l,i);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=h<0?-h:h)<=DV){for(r=new u(Hr),t=Math.ceil(i/Wn+4),Qn=!1;n%2&&(r=r.times(l),nN(r.d,t)),n=hd(n/2),n!==0;)l=l.times(l),nN(l.d,t);return Qn=!0,e.s<0?new u(Hr).div(r):Pn(r,i)}}else if(a<0)throw Error(wa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Qn=!1,r=e.times(Om(l,i+f)),Qn=!0,r=PV(r),r.s=a,r};lt.toPrecision=function(e,t){var n,i,r=this,a=r.constructor;return e===void 0?(n=bi(r),i=Mu(r,n<=a.toExpNeg||n>=a.toExpPos)):(bo(e,1,dd),t===void 0?t=a.rounding:bo(t,0,8),r=Pn(new a(r),e,t),n=bi(r),i=Mu(r,e<=n||n<=a.toExpNeg,e)),i};lt.toSignificantDigits=lt.tosd=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(bo(e,1,dd),t===void 0?t=i.rounding:bo(t,0,8)),Pn(new i(n),e,t)};lt.toString=lt.valueOf=lt.val=lt.toJSON=lt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=bi(e),n=e.constructor;return Mu(e,t<=n.toExpNeg||t>=n.toExpPos)};function RV(e,t){var n,i,r,a,o,l,u,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Qn?Pn(t,d):t;if(u=e.d,f=t.d,o=e.e,r=t.e,u=u.slice(),a=o-r,a){for(a<0?(i=u,a=-a,l=f.length):(i=f,r=o,l=u.length),o=Math.ceil(d/Wn),l=o>l?o+1:l+1,a>l&&(a=l,i.length=1),i.reverse();a--;)i.push(0);i.reverse()}for(l=u.length,a=f.length,l-a<0&&(a=l,i=f,f=u,u=i),n=0;a;)n=(u[--a]=u[a]+f[a]+n)/Ri|0,u[a]%=Ri;for(n&&(u.unshift(n),++r),l=u.length;u[--l]==0;)u.pop();return t.d=u,t.e=r,Qn?Pn(t,d):t}function bo(e,t,n){if(e!==~~e||en)throw Error(wu+e)}function ao(e){var t,n,i,r=e.length-1,a="",o=e[0];if(r>0){for(a+=o,t=1;to?1:-1;else for(l=u=0;lr[l]?1:-1;break}return u}function n(i,r,a){for(var o=0;a--;)i[a]-=o,o=i[a]1;)i.shift()}return function(i,r,a,o){var l,u,f,h,d,p,g,b,w,k,_,x,j,T,A,O,M,N,F=i.constructor,R=i.s==r.s?1:-1,I=i.d,q=r.d;if(!i.s)return new F(i);if(!r.s)throw Error(wa+"Division by zero");for(u=i.e-r.e,M=q.length,A=I.length,g=new F(R),b=g.d=[],f=0;q[f]==(I[f]||0);)++f;if(q[f]>(I[f]||0)&&--u,a==null?x=a=F.precision:o?x=a+(bi(i)-bi(r))+1:x=a,x<0)return new F(0);if(x=x/Wn+2|0,f=0,M==1)for(h=0,q=q[0],x++;(f1&&(q=e(q,h),I=e(I,h),M=q.length,A=I.length),T=M,w=I.slice(0,M),k=w.length;k=Ri/2&&++O;do h=0,l=t(q,w,M,k),l<0?(_=w[0],M!=k&&(_=_*Ri+(w[1]||0)),h=_/O|0,h>1?(h>=Ri&&(h=Ri-1),d=e(q,h),p=d.length,k=w.length,l=t(d,w,p,k),l==1&&(h--,n(d,M16)throw Error(Ij+bi(e));if(!e.s)return new h(Hr);for(Qn=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(i=Math.log(lu(2,f))/Math.LN10*2+5|0,l+=i,n=r=a=new h(Hr),h.precision=l;;){if(r=Pn(r.times(e),l),n=n.times(++u),o=a.plus(os(r,n,l)),ao(o.d).slice(0,l)===ao(a.d).slice(0,l)){for(;f--;)a=Pn(a.times(a),l);return h.precision=d,t==null?(Qn=!0,Pn(a,d)):a}a=o}}function bi(e){for(var t=e.e*Wn,n=e.d[0];n>=10;n/=10)t++;return t}function B3(e,t,n){if(t>e.LN10.sd())throw Qn=!0,n&&(e.precision=n),Error(wa+"LN10 precision limit exceeded");return Pn(new e(e.LN10),t)}function il(e){for(var t="";e--;)t+="0";return t}function Om(e,t){var n,i,r,a,o,l,u,f,h,d=1,p=10,g=e,b=g.d,w=g.constructor,k=w.precision;if(g.s<1)throw Error(wa+(g.s?"NaN":"-Infinity"));if(g.eq(Hr))return new w(0);if(t==null?(Qn=!1,f=k):f=t,g.eq(10))return t==null&&(Qn=!0),B3(w,f);if(f+=p,w.precision=f,n=ao(b),i=n.charAt(0),a=bi(g),Math.abs(a)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)g=g.times(e),n=ao(g.d),i=n.charAt(0),d++;a=bi(g),i>1?(g=new w("0."+n),a++):g=new w(i+"."+n.slice(1))}else return u=B3(w,f+2,k).times(a+""),g=Om(new w(i+"."+n.slice(1)),f-p).plus(u),w.precision=k,t==null?(Qn=!0,Pn(g,k)):g;for(l=o=g=os(g.minus(Hr),g.plus(Hr),f),h=Pn(g.times(g),f),r=3;;){if(o=Pn(o.times(h),f),u=l.plus(os(o,new w(r),f)),ao(u.d).slice(0,f)===ao(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus(B3(w,f+2,k).times(a+""))),l=os(l,new w(d),f),w.precision=k,t==null?(Qn=!0,Pn(l,k)):l;l=u,r+=2}}function tN(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;)++i;for(r=t.length;t.charCodeAt(r-1)===48;)--r;if(t=t.slice(i,r),t){if(r-=i,n=n-i-1,e.e=hd(n/Wn),e.d=[],i=(n+1)%Wn,n<0&&(i+=Wn),iN1||e.e<-N1))throw Error(Ij+n)}else e.s=0,e.e=0,e.d=[0];return e}function Pn(e,t,n){var i,r,a,o,l,u,f,h,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(i=t-o,i<0)i+=Wn,r=t,f=d[h=0];else{if(h=Math.ceil((i+1)/Wn),a=d.length,h>=a)return e;for(f=a=d[h],o=1;a>=10;a/=10)o++;i%=Wn,r=i-Wn+o}if(n!==void 0&&(a=lu(10,o-r-1),l=f/a%10|0,u=t<0||d[h+1]!==void 0||f%a,u=n<4?(l||u)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||u||n==6&&(i>0?r>0?f/lu(10,o-r):0:d[h-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return u?(a=bi(e),d.length=1,t=t-a-1,d[0]=lu(10,(Wn-t%Wn)%Wn),e.e=hd(-t/Wn)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(i==0?(d.length=h,a=1,h--):(d.length=h+1,a=lu(10,Wn-i),d[h]=r>0?(f/lu(10,o-r)%lu(10,r)|0)*a:0),u)for(;;)if(h==0){(d[0]+=a)==Ri&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=Ri)break;d[h--]=0,a=1}for(i=d.length;d[--i]===0;)d.pop();if(Qn&&(e.e>N1||e.e<-N1))throw Error(Ij+bi(e));return e}function NV(e,t){var n,i,r,a,o,l,u,f,h,d,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),Qn?Pn(t,g):t;if(u=e.d,d=t.d,i=t.e,f=e.e,u=u.slice(),o=f-i,o){for(h=o<0,h?(n=u,o=-o,l=d.length):(n=d,i=f,l=u.length),r=Math.max(Math.ceil(g/Wn),l)+2,o>r&&(o=r,n.length=1),n.reverse(),r=o;r--;)n.push(0);n.reverse()}else{for(r=u.length,l=d.length,h=r0;--r)u[l++]=0;for(r=d.length;r>o;){if(u[--r]0?a=a.charAt(0)+"."+a.slice(1)+il(i):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(r<0?"e":"e+")+r):r<0?(a="0."+il(-r-1)+a,n&&(i=n-o)>0&&(a+=il(i))):r>=o?(a+=il(r+1-o),n&&(i=n-r-1)>0&&(a=a+"."+il(i))):((i=r+1)0&&(r+1===o&&(a+="."),a+=il(i))),e.s<0?"-"+a:a}function nN(e,t){if(e.length>t)return e.length=t,!0}function $V(e){var t,n,i;function r(a){var o=this;if(!(o instanceof r))return new r(a);if(o.constructor=r,a instanceof r){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(wu+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return tN(o,a.toString())}else if(typeof a!="string")throw Error(wu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,w_e.test(a))tN(o,a);else throw Error(wu+a)}if(r.prototype=lt,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.clone=$V,r.config=r.set=k_e,e===void 0&&(e={}),e)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=r[t+1]&&i<=r[t+2])this[n]=i;else throw Error(wu+n+": "+i);if((i=e[n="LN10"])!==void 0)if(i==Math.LN10)this[n]=new this(i);else throw Error(wu+n+": "+i);return this}var Bj=$V(b_e);Hr=new Bj(1);const On=Bj;function __e(e){return j_e(e)||C_e(e)||S_e(e)||x_e()}function x_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S_e(e,t){if(e){if(typeof e=="string")return H4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H4(e,t)}}function C_e(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function j_e(e){if(Array.isArray(e))return H4(e)}function H4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=t?n.apply(void 0,r):e(t-o,iN(function(){for(var l=arguments.length,u=new Array(l),f=0;fe.length)&&(t=e.length);for(var n=0,i=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],i=!0,r=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(i=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));i=!0);}catch(u){r=!0,a=u}finally{try{!i&&o.return!=null&&o.return()}finally{if(r)throw a}}return n}}function F_e(e){if(Array.isArray(e))return e}function FV(e){var t=Tm(e,2),n=t[0],i=t[1],r=n,a=i;return n>i&&(r=i,a=n),[r,a]}function qV(e,t,n){if(e.lte(0))return new On(0);var i=Q0.getDigitCount(e.toNumber()),r=new On(10).pow(i),a=e.div(r),o=i!==1?.05:.1,l=new On(Math.ceil(a.div(o).toNumber())).add(n).mul(o),u=l.mul(r);return t?u:new On(Math.ceil(u))}function q_e(e,t,n){var i=1,r=new On(e);if(!r.isint()&&n){var a=Math.abs(e);a<1?(i=new On(10).pow(Q0.getDigitCount(e)-1),r=new On(Math.floor(r.div(i).toNumber())).mul(i)):a>1&&(r=new On(Math.floor(e)))}else e===0?r=new On(Math.floor((t-1)/2)):n||(r=new On(Math.floor(e)));var o=Math.floor((t-1)/2),l=E_e(T_e(function(u){return r.add(new On(u-o).mul(i)).toNumber()}),U4);return l(0,t)}function HV(e,t,n,i){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new On(0),tickMin:new On(0),tickMax:new On(0)};var a=qV(new On(t).sub(e).div(n-1),i,r),o;e<=0&&t>=0?o=new On(0):(o=new On(e).add(t).div(2),o=o.sub(new On(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),u=Math.ceil(new On(t).sub(o).div(a).toNumber()),f=l+u+1;return f>n?HV(e,t,n,i,r+1):(f0?u+(n-f):u,l=t>0?l:l+(n-f)),{step:a,tickMin:o.sub(new On(l).mul(a)),tickMax:o.add(new On(u).mul(a))})}function H_e(e){var t=Tm(e,2),n=t[0],i=t[1],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(r,2),l=FV([n,i]),u=Tm(l,2),f=u[0],h=u[1];if(f===-1/0||h===1/0){var d=h===1/0?[f].concat(W4(U4(0,r-1).map(function(){return 1/0}))):[].concat(W4(U4(0,r-1).map(function(){return-1/0})),[h]);return n>i?V4(d):d}if(f===h)return q_e(f,r,a);var p=HV(f,h,o,a),g=p.step,b=p.tickMin,w=p.tickMax,k=Q0.rangeStep(b,w.add(new On(.1).mul(g)),g);return n>i?V4(k):k}function U_e(e,t){var n=Tm(e,2),i=n[0],r=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=FV([i,r]),l=Tm(o,2),u=l[0],f=l[1];if(u===-1/0||f===1/0)return[i,r];if(u===f)return[u];var h=Math.max(t,2),d=qV(new On(f).sub(u).div(h-1),a,0),p=[].concat(W4(Q0.rangeStep(new On(u),new On(f).sub(new On(.99).mul(d)),d)),[f]);return i>r?V4(p):p}var V_e=IV(H_e),W_e=IV(U_e),G_e="Invariant failed";function Du(e,t){throw new Error(G_e)}var Y_e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _f(e){"@babel/helpers - typeof";return _f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_f(e)}function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function t2e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function n2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i2e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var u=a.range,f=0;f0?r[f-1].coordinate:r[l-1].coordinate,d=r[f].coordinate,p=f>=l-1?r[0].coordinate:r[f+1].coordinate,g=void 0;if(Ha(d-h)!==Ha(p-d)){var b=[];if(Ha(p-d)===Ha(u[1]-u[0])){g=p;var w=d+u[1]-u[0];b[0]=Math.min(w,(w+h)/2),b[1]=Math.max(w,(w+h)/2)}else{g=h;var k=p+u[1]-u[0];b[0]=Math.min(d,(k+d)/2),b[1]=Math.max(d,(k+d)/2)}var _=[Math.min(d,(g+d)/2),Math.max(d,(g+d)/2)];if(t>_[0]&&t<=_[1]||t>=b[0]&&t<=b[1]){o=r[f].index;break}}else{var x=Math.min(h,p),j=Math.max(h,p);if(t>(x+d)/2&&t<=(j+d)/2){o=r[f].index;break}}}else for(var T=0;T0&&T(i[T].coordinate+i[T-1].coordinate)/2&&t<=(i[T].coordinate+i[T+1].coordinate)/2||T===l-1&&t>(i[T].coordinate+i[T-1].coordinate)/2){o=i[T].index;break}return o},Fj=function(t){var n,i=t,r=i.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ri(ri({},t.type.defaultProps),t.props):t.props,o=a.stroke,l=a.fill,u;switch(r){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:l;break;default:u=l;break}return u},w2e=function(t){var n=t.barSize,i=t.totalSize,r=t.stackGroups,a=r===void 0?{}:r;if(!a)return{};for(var o={},l=Object.keys(a),u=0,f=l.length;u=0});if(_&&_.length){var x=_[0].type.defaultProps,j=x!==void 0?ri(ri({},x),_[0].props):_[0].props,T=j.barSize,A=j[k];o[A]||(o[A]=[]);var O=Kt(T)?n:T;o[A].push({item:_[0],stackList:_.slice(1),barSize:Kt(O)?void 0:Eu(O,i,0)})}}return o},k2e=function(t){var n=t.barGap,i=t.barCategoryGap,r=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,u=o.length;if(u<1)return null;var f=Eu(n,r,0,!0),h,d=[];if(o[0].barSize===+o[0].barSize){var p=!1,g=r/u,b=o.reduce(function(T,A){return T+A.barSize||0},0);b+=(u-1)*f,b>=r&&(b-=(u-1)*f,f=0),b>=r&&g>0&&(p=!0,g*=.9,b=u*g);var w=(r-b)/2>>0,k={offset:w-f,size:0};h=o.reduce(function(T,A){var O={item:A.item,position:{offset:k.offset+k.size+f,size:p?g:A.barSize}},M=[].concat(oN(T),[O]);return k=M[M.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(N){M.push({item:N,position:k})}),M},d)}else{var _=Eu(i,r,0,!0);r-2*_-(u-1)*f<=0&&(f=0);var x=(r-2*_-(u-1)*f)/u;x>1&&(x>>=0);var j=l===+l?Math.min(x,l):x;h=o.reduce(function(T,A,O){var M=[].concat(oN(T),[{item:A.item,position:{offset:_+(x+f)*O+(x-j)/2,size:j}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(N){M.push({item:N,position:M[M.length-1].position})}),M},d)}return h},_2e=function(t,n,i,r){var a=i.children,o=i.width,l=i.margin,u=o-(l.left||0)-(l.right||0),f=GV({children:a,legendWidth:u});if(f){var h=r||{},d=h.width,p=h.height,g=f.align,b=f.verticalAlign,w=f.layout;if((w==="vertical"||w==="horizontal"&&b==="middle")&&g!=="center"&&Ge(t[g]))return ri(ri({},t),{},rf({},g,t[g]+(d||0)));if((w==="horizontal"||w==="vertical"&&g==="center")&&b!=="middle"&&Ge(t[b]))return ri(ri({},t),{},rf({},b,t[b]+(p||0)))}return t},x2e=function(t,n,i){return Kt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||i==="x"?n==="xAxis":i==="y"?n==="yAxis":!0},YV=function(t,n,i,r,a){var o=n.props.children,l=ya(o,Mp).filter(function(f){return x2e(r,a,f.props.direction)});if(l&&l.length){var u=l.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var d=ur(h,i);if(Kt(d))return f;var p=Array.isArray(d)?[X0(d),ul(d)]:[d,d],g=u.reduce(function(b,w){var k=ur(h,w,0),_=p[0]-Math.abs(Array.isArray(k)?k[0]:k),x=p[1]+Math.abs(Array.isArray(k)?k[1]:k);return[Math.min(_,b[0]),Math.max(x,b[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},S2e=function(t,n,i,r,a){var o=n.map(function(l){return YV(t,l,i,a,r)}).filter(function(l){return!Kt(l)});return o&&o.length?o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]):null},KV=function(t,n,i,r,a){var o=n.map(function(u){var f=u.props.dataKey;return i==="number"&&f&&YV(t,u,f,r)||Xh(t,f,i,a)});if(i==="number")return o.reduce(function(u,f){return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);var l={};return o.reduce(function(u,f){for(var h=0,d=f.length;h=2?Ha(l[0]-l[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(d){var p=a?a.indexOf(d):d;return{coordinate:r(p)+f,value:d,offset:f}});return h.filter(function(d){return!ld(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,p){return{coordinate:r(d)+f,value:d,index:p,offset:f}}):r.ticks&&!i?r.ticks(t.tickCount).map(function(d){return{coordinate:r(d)+f,value:d,offset:f}}):r.domain().map(function(d,p){return{coordinate:r(d)+f,value:a?a[d]:d,index:p,offset:f}})},F3=new WeakMap,mg=function(t,n){if(typeof n!="function")return t;F3.has(t)||F3.set(t,new WeakMap);var i=F3.get(t);if(i.has(n))return i.get(n);var r=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return i.set(n,r),r},C2e=function(t,n,i){var r=t.scale,a=t.type,o=t.layout,l=t.axisType;if(r==="auto")return o==="radial"&&l==="radiusAxis"?{scale:xm(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:M1(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!i)?{scale:Kh(),realScaleType:"point"}:a==="category"?{scale:xm(),realScaleType:"band"}:{scale:M1(),realScaleType:"linear"};if(Tu(r)){var u="scale".concat(z0(r));return{scale:(WP[u]||Kh)(),realScaleType:WP[u]?u:"point"}}return Bt(r)?{scale:r}:{scale:Kh(),realScaleType:"point"}},lN=1e-4,j2e=function(t){var n=t.domain();if(!(!n||n.length<=2)){var i=n.length,r=t.range(),a=Math.min(r[0],r[1])-lN,o=Math.max(r[0],r[1])+lN,l=t(n[0]),u=t(n[i-1]);(lo||uo)&&t.domain([n[0],n[i-1]])}},A2e=function(t,n){if(!t)return null;for(var i=0,r=t.length;ir)&&(a[1]=r),a[0]>r&&(a[0]=r),a[1]=0?(t[l][i][0]=a,t[l][i][1]=a+u,a=t[l][i][1]):(t[l][i][0]=o,t[l][i][1]=o+u,o=t[l][i][1])}},E2e=function(t){var n=t.length;if(!(n<=0))for(var i=0,r=t[0].length;i=0?(t[o][i][0]=a,t[o][i][1]=a+l,a=t[o][i][1]):(t[o][i][0]=0,t[o][i][1]=0)}},M2e={sign:T2e,expand:m1e,none:hf,silhouette:p1e,wiggle:v1e,positive:E2e},D2e=function(t,n,i){var r=n.map(function(l){return l.props.dataKey}),a=M2e[i],o=h1e().keys(r).value(function(l,u){return+ur(l,u,0)}).order(C4).offset(a);return o(t)},R2e=function(t,n,i,r,a,o){if(!t)return null;var l=o?n.reverse():n,u={},f=l.reduce(function(d,p){var g,b=(g=p.type)!==null&&g!==void 0&&g.defaultProps?ri(ri({},p.type.defaultProps),p.props):p.props,w=b.stackId,k=b.hide;if(k)return d;var _=b[i],x=d[_]||{hasStack:!1,stackGroups:{}};if(Ci(w)){var j=x.stackGroups[w]||{numericAxisId:i,cateAxisId:r,items:[]};j.items.push(p),x.hasStack=!0,x.stackGroups[w]=j}else x.stackGroups[ud("_stackId_")]={numericAxisId:i,cateAxisId:r,items:[p]};return ri(ri({},d),{},rf({},_,x))},u),h={};return Object.keys(f).reduce(function(d,p){var g=f[p];if(g.hasStack){var b={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(w,k){var _=g.stackGroups[k];return ri(ri({},w),{},rf({},k,{numericAxisId:i,cateAxisId:r,items:_.items,stackedData:D2e(t,_.items,a)}))},b)}return ri(ri({},d),{},rf({},p,g))},h)},P2e=function(t,n){var i=n.realScaleType,r=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,u=i||n.scale;if(u!=="auto"&&u!=="linear")return null;if(a&&r==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=V_e(f,a,l);return t.domain([X0(h),ul(h)]),{niceTicks:h}}if(a&&r==="number"){var d=t.domain(),p=W_e(d,a,l);return{niceTicks:p}}return null};function L1(e){var t=e.axis,n=e.ticks,i=e.bandSize,r=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Kt(r[t.dataKey])){var l=c1(n,"value",r[t.dataKey]);if(l)return l.coordinate+i/2}return n[a]?n[a].coordinate+i/2:null}var u=ur(r,Kt(o)?t.dataKey:o);return Kt(u)?null:t.scale(u)}var uN=function(t){var n=t.axis,i=t.ticks,r=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return i[l]?i[l].coordinate+r:null;var u=ur(o,n.dataKey,n.domain[l]);return Kt(u)?null:n.scale(u)-a/2+r},N2e=function(t){var n=t.numericAxis,i=n.scale.domain();if(n.type==="number"){var r=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);return r<=0&&a>=0?0:a<0?a:r}return i[0]},$2e=function(t,n){var i,r=(i=t.type)!==null&&i!==void 0&&i.defaultProps?ri(ri({},t.type.defaultProps),t.props):t.props,a=r.stackId;if(Ci(a)){var o=n[a];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},z2e=function(t){return t.reduce(function(n,i){return[X0(i.concat([n[0]]).filter(Ge)),ul(i.concat([n[1]]).filter(Ge))]},[1/0,-1/0])},QV=function(t,n,i){return Object.keys(t).reduce(function(r,a){var o=t[a],l=o.stackedData,u=l.reduce(function(f,h){var d=z2e(h.slice(n,i+1));return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]).map(function(r){return r===1/0||r===-1/0?0:r})},cN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,X4=function(t,n,i){if(Bt(t))return t(n,i);if(!Array.isArray(t))return n;var r=[];if(Ge(t[0]))r[0]=i?t[0]:Math.min(t[0],n[0]);else if(cN.test(t[0])){var a=+cN.exec(t[0])[1];r[0]=n[0]-a}else Bt(t[0])?r[0]=t[0](n[0]):r[0]=n[0];if(Ge(t[1]))r[1]=i?t[1]:Math.max(t[1],n[1]);else if(fN.test(t[1])){var o=+fN.exec(t[1])[1];r[1]=n[1]+o}else Bt(t[1])?r[1]=t[1](n[1]):r[1]=n[1];return r},I1=function(t,n,i){if(t&&t.scale&&t.scale.bandwidth){var r=t.scale.bandwidth();if(!i||r>0)return r}if(t&&n&&n.length>=2){for(var a=mj(n,function(d){return d.coordinate}),o=1/0,l=1,u=a.length;lo&&(f=2*Math.PI-f),{radius:l,angle:F2e(f),angleInRadian:f}},U2e=function(t){var n=t.startAngle,i=t.endAngle,r=Math.floor(n/360),a=Math.floor(i/360),o=Math.min(r,a);return{startAngle:n-o*360,endAngle:i-o*360}},V2e=function(t,n){var i=n.startAngle,r=n.endAngle,a=Math.floor(i/360),o=Math.floor(r/360),l=Math.min(a,o);return t+l*360},pN=function(t,n){var i=t.x,r=t.y,a=H2e({x:i,y:r},n),o=a.radius,l=a.angle,u=n.innerRadius,f=n.outerRadius;if(of)return!1;if(o===0)return!0;var h=U2e(n),d=h.startAngle,p=h.endAngle,g=l,b;if(d<=p){for(;g>p;)g-=360;for(;g=d&&g<=p}else{for(;g>d;)g-=360;for(;g=p&&g<=d}return b?mN(mN({},n),{},{radius:o,angle:V2e(g,n)}):null};function Rm(e){"@babel/helpers - typeof";return Rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rm(e)}var W2e=["offset"];function G2e(e){return Z2e(e)||X2e(e)||K2e(e)||Y2e()}function Y2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K2e(e,t){if(e){if(typeof e=="string")return Z4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z4(e,t)}}function X2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z2e(e){if(Array.isArray(e))return Z4(e)}function Z4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function J2e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function vN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function xi(e){for(var t=1;t=0?1:-1,j,T;r==="insideStart"?(j=g+x*o,T=w):r==="insideEnd"?(j=b-x*o,T=!w):r==="end"&&(j=b+x*o,T=w),T=_<=0?T:!T;var A=Ui(f,h,k,j),O=Ui(f,h,k,j+(T?1:-1)*359),M="M".concat(A.x,",").concat(A.y,` + A`).concat(k,",").concat(k,",0,1,").concat(T?0:1,`, + `).concat(O.x,",").concat(O.y),N=Kt(t.id)?ud("recharts-radial-line-"):t.id;return J.createElement("text",Pm({},i,{dominantBaseline:"central",className:vt("recharts-radial-bar-label",l)}),J.createElement("defs",null,J.createElement("path",{id:N,d:M})),J.createElement("textPath",{xlinkHref:"#".concat(N)},n))},oxe=function(t){var n=t.viewBox,i=t.offset,r=t.position,a=n,o=a.cx,l=a.cy,u=a.innerRadius,f=a.outerRadius,h=a.startAngle,d=a.endAngle,p=(h+d)/2;if(r==="outside"){var g=Ui(o,l,f+i,p),b=g.x,w=g.y;return{x:b,y:w,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var k=(u+f)/2,_=Ui(o,l,k,p),x=_.x,j=_.y;return{x,y:j,textAnchor:"middle",verticalAnchor:"middle"}},sxe=function(t){var n=t.viewBox,i=t.parentViewBox,r=t.offset,a=t.position,o=n,l=o.x,u=o.y,f=o.width,h=o.height,d=h>=0?1:-1,p=d*r,g=d>0?"end":"start",b=d>0?"start":"end",w=f>=0?1:-1,k=w*r,_=w>0?"end":"start",x=w>0?"start":"end";if(a==="top"){var j={x:l+f/2,y:u-d*r,textAnchor:"middle",verticalAnchor:g};return xi(xi({},j),i?{height:Math.max(u-i.y,0),width:f}:{})}if(a==="bottom"){var T={x:l+f/2,y:u+h+p,textAnchor:"middle",verticalAnchor:b};return xi(xi({},T),i?{height:Math.max(i.y+i.height-(u+h),0),width:f}:{})}if(a==="left"){var A={x:l-k,y:u+h/2,textAnchor:_,verticalAnchor:"middle"};return xi(xi({},A),i?{width:Math.max(A.x-i.x,0),height:h}:{})}if(a==="right"){var O={x:l+f+k,y:u+h/2,textAnchor:x,verticalAnchor:"middle"};return xi(xi({},O),i?{width:Math.max(i.x+i.width-O.x,0),height:h}:{})}var M=i?{width:f,height:h}:{};return a==="insideLeft"?xi({x:l+k,y:u+h/2,textAnchor:x,verticalAnchor:"middle"},M):a==="insideRight"?xi({x:l+f-k,y:u+h/2,textAnchor:_,verticalAnchor:"middle"},M):a==="insideTop"?xi({x:l+f/2,y:u+p,textAnchor:"middle",verticalAnchor:b},M):a==="insideBottom"?xi({x:l+f/2,y:u+h-p,textAnchor:"middle",verticalAnchor:g},M):a==="insideTopLeft"?xi({x:l+k,y:u+p,textAnchor:x,verticalAnchor:b},M):a==="insideTopRight"?xi({x:l+f-k,y:u+p,textAnchor:_,verticalAnchor:b},M):a==="insideBottomLeft"?xi({x:l+k,y:u+h-p,textAnchor:x,verticalAnchor:g},M):a==="insideBottomRight"?xi({x:l+f-k,y:u+h-p,textAnchor:_,verticalAnchor:g},M):sd(a)&&(Ge(a.x)||hu(a.x))&&(Ge(a.y)||hu(a.y))?xi({x:l+Eu(a.x,f),y:u+Eu(a.y,h),textAnchor:"end",verticalAnchor:"end"},M):xi({x:l+f/2,y:u+h/2,textAnchor:"middle",verticalAnchor:"middle"},M)},lxe=function(t){return"cx"in t&&Ge(t.cx)};function ai(e){var t=e.offset,n=t===void 0?5:t,i=Q2e(e,W2e),r=xi({offset:n},i),a=r.viewBox,o=r.position,l=r.value,u=r.children,f=r.content,h=r.className,d=h===void 0?"":h,p=r.textBreakAll;if(!a||Kt(l)&&Kt(u)&&!S.isValidElement(f)&&!Bt(f))return null;if(S.isValidElement(f))return S.cloneElement(f,r);var g;if(Bt(f)){if(g=S.createElement(f,r),S.isValidElement(g))return g}else g=ixe(r);var b=lxe(a),w=Ut(r,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return axe(r,g,w);var k=b?oxe(r):sxe(r);return J.createElement(x1,Pm({className:vt("recharts-label",d)},w,k,{breakAll:p}),g)}ai.displayName="Label";var eW=function(t){var n=t.cx,i=t.cy,r=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,u=t.radius,f=t.innerRadius,h=t.outerRadius,d=t.x,p=t.y,g=t.top,b=t.left,w=t.width,k=t.height,_=t.clockWise,x=t.labelViewBox;if(x)return x;if(Ge(w)&&Ge(k)){if(Ge(d)&&Ge(p))return{x:d,y:p,width:w,height:k};if(Ge(g)&&Ge(b))return{x:g,y:b,width:w,height:k}}return Ge(d)&&Ge(p)?{x:d,y:p,width:0,height:0}:Ge(n)&&Ge(i)?{cx:n,cy:i,startAngle:a||r||0,endAngle:o||r||0,innerRadius:f||0,outerRadius:h||u||l||0,clockWise:_}:t.viewBox?t.viewBox:{}},uxe=function(t,n){return t?t===!0?J.createElement(ai,{key:"label-implicit",viewBox:n}):Ci(t)?J.createElement(ai,{key:"label-implicit",viewBox:n,value:t}):S.isValidElement(t)?t.type===ai?S.cloneElement(t,{key:"label-implicit",viewBox:n}):J.createElement(ai,{key:"label-implicit",content:t,viewBox:n}):Bt(t)?J.createElement(ai,{key:"label-implicit",content:t,viewBox:n}):sd(t)?J.createElement(ai,Pm({viewBox:n},t,{key:"label-implicit"})):null:null},cxe=function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&i&&!t.label)return null;var r=t.children,a=eW(t),o=ya(r,ai).map(function(u,f){return S.cloneElement(u,{viewBox:n||a,key:"label-".concat(f)})});if(!i)return o;var l=uxe(t.label,n||a);return[l].concat(G2e(o))};ai.parseViewBox=eW;ai.renderCallByParent=cxe;var q3,gN;function fxe(){if(gN)return q3;gN=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return q3=e,q3}var dxe=fxe();const hxe=gn(dxe);function Nm(e){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nm(e)}var mxe=["valueAccessor"],pxe=["data","dataKey","clockWise","id","textBreakAll"];function vxe(e){return wxe(e)||bxe(e)||yxe(e)||gxe()}function gxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yxe(e,t){if(e){if(typeof e=="string")return Q4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q4(e,t)}}function bxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wxe(e){if(Array.isArray(e))return Q4(e)}function Q4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function Sxe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}var Cxe=function(t){return Array.isArray(t.value)?hxe(t.value):t.value};function co(e){var t=e.valueAccessor,n=t===void 0?Cxe:t,i=wN(e,mxe),r=i.data,a=i.dataKey,o=i.clockWise,l=i.id,u=i.textBreakAll,f=wN(i,pxe);return!r||!r.length?null:J.createElement(Fn,{className:"recharts-label-list"},r.map(function(h,d){var p=Kt(a)?n(h,d):ur(h&&h.payload,a),g=Kt(l)?{}:{id:"".concat(l,"-").concat(d)};return J.createElement(ai,F1({},Ut(h,!0),f,g,{parentViewBox:h.parentViewBox,value:p,textBreakAll:u,viewBox:ai.parseViewBox(Kt(o)?h:bN(bN({},h),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}co.displayName="LabelList";function jxe(e,t){return e?e===!0?J.createElement(co,{key:"labelList-implicit",data:t}):J.isValidElement(e)||Bt(e)?J.createElement(co,{key:"labelList-implicit",data:t,content:e}):sd(e)?J.createElement(co,F1({data:t},e,{key:"labelList-implicit"})):null:null}function Axe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,r=ya(i,co).map(function(o,l){return S.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return r;var a=jxe(e.label,t);return[a].concat(vxe(r))}co.renderCallByParent=Axe;function $m(e){"@babel/helpers - typeof";return $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$m(e)}function J4(){return J4=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>f),`, + `).concat(d.x,",").concat(d.y,` + `);if(r>0){var g=Ui(n,i,r,o),b=Ui(n,i,r,f);p+="L ".concat(b.x,",").concat(b.y,` + A `).concat(r,",").concat(r,`,0, + `).concat(+(Math.abs(u)>180),",").concat(+(o<=f),`, + `).concat(g.x,",").concat(g.y," Z")}else p+="L ".concat(n,",").concat(i," Z");return p},Dxe=function(t){var n=t.cx,i=t.cy,r=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,u=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,d=Ha(h-f),p=pg({cx:n,cy:i,radius:a,angle:f,sign:d,cornerRadius:o,cornerIsExternal:u}),g=p.circleTangency,b=p.lineTangency,w=p.theta,k=pg({cx:n,cy:i,radius:a,angle:h,sign:-d,cornerRadius:o,cornerIsExternal:u}),_=k.circleTangency,x=k.lineTangency,j=k.theta,T=u?Math.abs(f-h):Math.abs(f-h)-w-j;if(T<0)return l?"M ".concat(b.x,",").concat(b.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):tW({cx:n,cy:i,innerRadius:r,outerRadius:a,startAngle:f,endAngle:h});var A="M ".concat(b.x,",").concat(b.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(g.x,",").concat(g.y,` + A`).concat(a,",").concat(a,",0,").concat(+(T>180),",").concat(+(d<0),",").concat(_.x,",").concat(_.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,` + `);if(r>0){var O=pg({cx:n,cy:i,radius:r,angle:f,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),M=O.circleTangency,N=O.lineTangency,F=O.theta,R=pg({cx:n,cy:i,radius:r,angle:h,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),I=R.circleTangency,q=R.lineTangency,G=R.theta,U=u?Math.abs(f-h):Math.abs(f-h)-F-G;if(U<0&&o===0)return"".concat(A,"L").concat(n,",").concat(i,"Z");A+="L".concat(q.x,",").concat(q.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(I.x,",").concat(I.y,` + A`).concat(r,",").concat(r,",0,").concat(+(U>180),",").concat(+(d>0),",").concat(M.x,",").concat(M.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,"Z")}else A+="L".concat(n,",").concat(i,"Z");return A},Rxe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},nW=function(t){var n=_N(_N({},Rxe),t),i=n.cx,r=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,u=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,d=n.endAngle,p=n.className;if(o0&&Math.abs(h-d)<360?k=Dxe({cx:i,cy:r,innerRadius:a,outerRadius:o,cornerRadius:Math.min(w,b/2),forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:d}):k=tW({cx:i,cy:r,innerRadius:a,outerRadius:o,startAngle:h,endAngle:d}),J.createElement("path",J4({},Ut(n,!0),{className:g,d:k,role:"img"}))};function zm(e){"@babel/helpers - typeof";return zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zm(e)}function e6(){return e6=Object.assign?Object.assign.bind():function(e){for(var t=1;tFxe.call(e,t));function Gu(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Uxe="__v",Vxe="__o",Wxe="_owner",{getOwnPropertyDescriptor:AN,keys:ON}=Object;function Gxe(e,t){return e.byteLength===t.byteLength&&q1(new Uint8Array(e),new Uint8Array(t))}function Yxe(e,t,n){let i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n.equals(e[i],t[i],i,i,e,t,n))return!1;return!0}function Kxe(e,t){return e.byteLength===t.byteLength&&q1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Xxe(e,t){return Gu(e.getTime(),t.getTime())}function Zxe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Qxe(e,t){return e===t}function TN(e,t,n){const i=e.size;if(i!==t.size)return!1;if(!i)return!0;const r=new Array(i),a=e.entries();let o,l,u=0;for(;(o=a.next())&&!o.done;){const f=t.entries();let h=!1,d=0;for(;(l=f.next())&&!l.done;){if(r[d]){d++;continue}const p=o.value,g=l.value;if(n.equals(p[0],g[0],u,d,e,t,n)&&n.equals(p[1],g[1],p[0],g[0],e,t,n)){h=r[d]=!0;break}d++}if(!h)return!1;u++}return!0}const Jxe=Gu;function e3e(e,t,n){const i=ON(e);let r=i.length;if(ON(t).length!==r)return!1;for(;r-- >0;)if(!iW(e,t,n,i[r]))return!1;return!0}function Ch(e,t,n){const i=jN(e);let r=i.length;if(jN(t).length!==r)return!1;let a,o,l;for(;r-- >0;)if(a=i[r],!iW(e,t,n,a)||(o=AN(e,a),l=AN(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function t3e(e,t){return Gu(e.valueOf(),t.valueOf())}function n3e(e,t){return e.source===t.source&&e.flags===t.flags}function EN(e,t,n){const i=e.size;if(i!==t.size)return!1;if(!i)return!0;const r=new Array(i),a=e.values();let o,l;for(;(o=a.next())&&!o.done;){const u=t.values();let f=!1,h=0;for(;(l=u.next())&&!l.done;){if(!r[h]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){f=r[h]=!0;break}h++}if(!f)return!1}return!0}function q1(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function i3e(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function iW(e,t,n,i){return(i===Wxe||i===Vxe||i===Uxe)&&(e.$$typeof||t.$$typeof)?!0:Hxe(t,i)&&n.equals(e[i],t[i],i,i,e,t,n)}const r3e="[object ArrayBuffer]",a3e="[object Arguments]",o3e="[object Boolean]",s3e="[object DataView]",l3e="[object Date]",u3e="[object Error]",c3e="[object Map]",f3e="[object Number]",d3e="[object Object]",h3e="[object RegExp]",m3e="[object Set]",p3e="[object String]",v3e={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},g3e="[object URL]",y3e=Object.prototype.toString;function b3e({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:i,areErrorsEqual:r,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:d,areTypedArraysEqual:p,areUrlsEqual:g,unknownTagComparators:b}){return function(k,_,x){if(k===_)return!0;if(k==null||_==null)return!1;const j=typeof k;if(j!==typeof _)return!1;if(j!=="object")return j==="number"?l(k,_,x):j==="function"?a(k,_,x):!1;const T=k.constructor;if(T!==_.constructor)return!1;if(T===Object)return u(k,_,x);if(Array.isArray(k))return t(k,_,x);if(T===Date)return i(k,_,x);if(T===RegExp)return h(k,_,x);if(T===Map)return o(k,_,x);if(T===Set)return d(k,_,x);const A=y3e.call(k);if(A===l3e)return i(k,_,x);if(A===h3e)return h(k,_,x);if(A===c3e)return o(k,_,x);if(A===m3e)return d(k,_,x);if(A===d3e)return typeof k.then!="function"&&typeof _.then!="function"&&u(k,_,x);if(A===g3e)return g(k,_,x);if(A===u3e)return r(k,_,x);if(A===a3e)return u(k,_,x);if(v3e[A])return p(k,_,x);if(A===r3e)return e(k,_,x);if(A===s3e)return n(k,_,x);if(A===o3e||A===f3e||A===p3e)return f(k,_,x);if(b){let O=b[A];if(!O){const M=qxe(k);M&&(O=b[M])}if(O)return O(k,_,x)}return!1}}function w3e({circular:e,createCustomConfig:t,strict:n}){let i={areArrayBuffersEqual:Gxe,areArraysEqual:n?Ch:Yxe,areDataViewsEqual:Kxe,areDatesEqual:Xxe,areErrorsEqual:Zxe,areFunctionsEqual:Qxe,areMapsEqual:n?H3(TN,Ch):TN,areNumbersEqual:Jxe,areObjectsEqual:n?Ch:e3e,arePrimitiveWrappersEqual:t3e,areRegExpsEqual:n3e,areSetsEqual:n?H3(EN,Ch):EN,areTypedArraysEqual:n?H3(q1,Ch):q1,areUrlsEqual:i3e,unknownTagComparators:void 0};if(t&&(i=Object.assign({},i,t(i))),e){const r=gg(i.areArraysEqual),a=gg(i.areMapsEqual),o=gg(i.areObjectsEqual),l=gg(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:r,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return i}function k3e(e){return function(t,n,i,r,a,o,l){return e(t,n,l)}}function _3e({circular:e,comparator:t,createState:n,equals:i,strict:r}){if(n)return function(l,u){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(l,u,{cache:f,equals:i,meta:h,strict:r})};if(e)return function(l,u){return t(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:r})};const a={cache:void 0,equals:i,meta:void 0,strict:r};return function(l,u){return t(l,u,a)}}const x3e=Nl();Nl({strict:!0});Nl({circular:!0});Nl({circular:!0,strict:!0});Nl({createInternalComparator:()=>Gu});Nl({strict:!0,createInternalComparator:()=>Gu});Nl({circular:!0,createInternalComparator:()=>Gu});Nl({circular:!0,createInternalComparator:()=>Gu,strict:!0});function Nl(e={}){const{circular:t=!1,createInternalComparator:n,createState:i,strict:r=!1}=e,a=w3e(e),o=b3e(a),l=n?n(o):k3e(o);return _3e({circular:t,comparator:o,createState:i,equals:l,strict:r})}function S3e(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function MN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,i=function r(a){n<0&&(n=a),a-n>t?(e(a),n=-1):S3e(r)};requestAnimationFrame(i)}function t6(e){"@babel/helpers - typeof";return t6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t6(e)}function C3e(e){return T3e(e)||O3e(e)||A3e(e)||j3e()}function j3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A3e(e,t){if(e){if(typeof e=="string")return DN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DN(e,t)}}function DN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n1?1:_<0?0:_},w=function(_){for(var x=_>1?1:_,j=x,T=0;T<8;++T){var A=d(j)-x,O=g(j);if(Math.abs(A-x)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,i=n===void 0?100:n,r=t.damping,a=r===void 0?8:r,o=t.dt,l=o===void 0?17:o,u=function(h,d,p){var g=-(h-d)*i,b=p*a,w=p+(g-b)*l/1e3,k=p*l/1e3+h;return Math.abs(k-d)e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function oSe(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,a;for(a=0;a=0)&&(n[r]=e[r]);return n}function U3(e){return cSe(e)||uSe(e)||lSe(e)||sSe()}function sSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lSe(e,t){if(e){if(typeof e=="string")return o6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o6(e,t)}}function uSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cSe(e){if(Array.isArray(e))return o6(e)}function o6(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function V1(e){return V1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},V1(e)}var wo=(function(e){pSe(n,e);var t=vSe(n);function n(i,r){var a;fSe(this,n),a=t.call(this,i,r);var o=a.props,l=o.isActive,u=o.attributeName,f=o.from,h=o.to,d=o.steps,p=o.children,g=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(u6(a)),a.changeStyle=a.changeStyle.bind(u6(a)),!l||g<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:h}),l6(a);if(d&&d.length)a.state={style:d[0].style};else if(f){if(typeof p=="function")return a.state={style:f},l6(a);a.state={style:u?Lh({},u,f):f}}else a.state={style:{}};return a}return hSe(n,[{key:"componentDidMount",value:function(){var r=this.props,a=r.isActive,o=r.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(r){var a=this.props,o=a.isActive,l=a.canBegin,u=a.attributeName,f=a.shouldReAnimate,h=a.to,d=a.from,p=this.state.style;if(l){if(!o){var g={style:u?Lh({},u,h):h};this.state&&p&&(u&&p[u]!==h||!u&&p!==h)&&this.setState(g);return}if(!(x3e(r.to,h)&&r.canBegin&&r.isActive)){var b=!r.canBegin||!r.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=b||f?d:r.to;if(this.state&&p){var k={style:u?Lh({},u,w):w};(u&&p[u]!==w||!u&&p!==w)&&this.setState(k)}this.runAnimation($a($a({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var r=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),r&&r()}},{key:"handleStyleChange",value:function(r){this.changeStyle(r)}},{key:"changeStyle",value:function(r){this.mounted&&this.setState({style:r})}},{key:"runJSAnimation",value:function(r){var a=this,o=r.from,l=r.to,u=r.duration,f=r.easing,h=r.begin,d=r.onAnimationEnd,p=r.onAnimationStart,g=iSe(o,l,W3e(f),u,this.changeStyle),b=function(){a.stopJSAnimation=g()};this.manager.start([p,h,b,u,d])}},{key:"runStepAnimation",value:function(r){var a=this,o=r.steps,l=r.begin,u=r.onAnimationStart,f=o[0],h=f.style,d=f.duration,p=d===void 0?0:d,g=function(w,k,_){if(_===0)return w;var x=k.duration,j=k.easing,T=j===void 0?"ease":j,A=k.style,O=k.properties,M=k.onAnimationEnd,N=_>0?o[_-1]:k,F=O||Object.keys(A);if(typeof T=="function"||T==="spring")return[].concat(U3(w),[a.runJSAnimation.bind(a,{from:N.style,to:A,duration:x,easing:T}),x]);var R=NN(F,x,T),I=$a($a($a({},N.style),A),{},{transition:R});return[].concat(U3(w),[I,x,M]).filter(P3e)};return this.manager.start([u].concat(U3(o.reduce(g,[h,Math.max(p,l)])),[r.onAnimationEnd]))}},{key:"runAnimation",value:function(r){this.manager||(this.manager=E3e());var a=r.begin,o=r.duration,l=r.attributeName,u=r.to,f=r.easing,h=r.onAnimationStart,d=r.onAnimationEnd,p=r.steps,g=r.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(r);return}if(p.length>1){this.runStepAnimation(r);return}var w=l?Lh({},l,u):u,k=NN(Object.keys(w),o,f);b.start([h,a,$a($a({},w),{},{transition:k}),o,d])}},{key:"render",value:function(){var r=this.props,a=r.children;r.begin;var o=r.duration;r.attributeName,r.easing;var l=r.isActive;r.steps,r.from,r.to,r.canBegin,r.onAnimationEnd,r.shouldReAnimate,r.onAnimationReStart;var u=aSe(r,rSe),f=S.Children.count(a),h=this.state.style;if(typeof a=="function")return a(h);if(!l||f===0||o<=0)return a;var d=function(g){var b=g.props,w=b.style,k=w===void 0?{}:w,_=b.className,x=S.cloneElement(g,$a($a({},u),{},{style:$a($a({},k),h),className:_}));return x};return f===1?d(S.Children.only(a)):J.createElement("div",null,S.Children.map(a,function(p){return d(p)}))}}]),n})(S.PureComponent);wo.displayName="Animate";wo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};wo.propTypes={from:bn.oneOfType([bn.object,bn.string]),to:bn.oneOfType([bn.object,bn.string]),attributeName:bn.string,duration:bn.number,begin:bn.number,easing:bn.oneOfType([bn.string,bn.func]),steps:bn.arrayOf(bn.shape({duration:bn.number.isRequired,style:bn.object.isRequired,easing:bn.oneOfType([bn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),bn.func]),properties:bn.arrayOf("string"),onAnimationEnd:bn.func})),children:bn.oneOfType([bn.node,bn.func]),isActive:bn.bool,canBegin:bn.bool,onAnimationEnd:bn.func,shouldReAnimate:bn.bool,onAnimationStart:bn.func,onAnimationReStart:bn.func};function Bm(e){"@babel/helpers - typeof";return Bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bm(e)}function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0?1:-1,u=i>=0?1:-1,f=r>=0&&i>=0||r<0&&i<0?1:0,h;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],p=0,g=4;po?o:a[p];h="M".concat(t,",").concat(n+l*d[0]),d[0]>0&&(h+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(f,",").concat(t+u*d[0],",").concat(n)),h+="L ".concat(t+i-u*d[1],",").concat(n),d[1]>0&&(h+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(f,`, + `).concat(t+i,",").concat(n+l*d[1])),h+="L ".concat(t+i,",").concat(n+r-l*d[2]),d[2]>0&&(h+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(f,`, + `).concat(t+i-u*d[2],",").concat(n+r)),h+="L ".concat(t+u*d[3],",").concat(n+r),d[3]>0&&(h+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(f,`, + `).concat(t,",").concat(n+r-l*d[3])),h+="Z"}else if(o>0&&a===+a&&a>0){var b=Math.min(o,a);h="M ".concat(t,",").concat(n+l*b,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(t+u*b,",").concat(n,` + L `).concat(t+i-u*b,",").concat(n,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(t+i,",").concat(n+l*b,` + L `).concat(t+i,",").concat(n+r-l*b,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(t+i-u*b,",").concat(n+r,` + L `).concat(t+u*b,",").concat(n+r,` + A `).concat(b,",").concat(b,",0,0,").concat(f,",").concat(t,",").concat(n+r-l*b," Z")}else h="M ".concat(t,",").concat(n," h ").concat(i," v ").concat(r," h ").concat(-i," Z");return h},jSe=function(t,n){if(!t||!n)return!1;var i=t.x,r=t.y,a=n.x,o=n.y,l=n.width,u=n.height;if(Math.abs(l)>0&&Math.abs(u)>0){var f=Math.min(a,a+l),h=Math.max(a,a+l),d=Math.min(o,o+u),p=Math.max(o,o+u);return i>=f&&i<=h&&r>=d&&r<=p}return!1},ASe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Fm=function(t){var n=HN(HN({},ASe),t),i=S.useRef(),r=S.useState(-1),a=ySe(r,2),o=a[0],l=a[1];S.useEffect(function(){if(i.current&&i.current.getTotalLength)try{var T=i.current.getTotalLength();T&&l(T)}catch{}},[]);var u=n.x,f=n.y,h=n.width,d=n.height,p=n.radius,g=n.className,b=n.animationEasing,w=n.animationDuration,k=n.animationBegin,_=n.isAnimationActive,x=n.isUpdateAnimationActive;if(u!==+u||f!==+f||h!==+h||d!==+d||h===0||d===0)return null;var j=vt("recharts-rectangle",g);return x?J.createElement(wo,{canBegin:o>0,from:{width:h,height:d,x:u,y:f},to:{width:h,height:d,x:u,y:f},duration:w,animationEasing:b,isActive:x},function(T){var A=T.width,O=T.height,M=T.x,N=T.y;return J.createElement(wo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:k,duration:w,isActive:_,easing:b},J.createElement("path",W1({},Ut(n,!0),{className:j,d:UN(M,N,A,O,p),ref:i})))}):J.createElement("path",W1({},Ut(n,!0),{className:j,d:UN(u,f,h,d,p)}))};function c6(){return c6=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function PSe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}var NSe=function(t,n,i,r,a,o){return"M".concat(t,",").concat(a,"v").concat(r,"M").concat(o,",").concat(n,"h").concat(i)},$Se=function(t){var n=t.x,i=n===void 0?0:n,r=t.y,a=r===void 0?0:r,o=t.top,l=o===void 0?0:o,u=t.left,f=u===void 0?0:u,h=t.width,d=h===void 0?0:h,p=t.height,g=p===void 0?0:p,b=t.className,w=RSe(t,OSe),k=TSe({x:i,y:a,top:l,left:f,width:d,height:g},w);return!Ge(i)||!Ge(a)||!Ge(d)||!Ge(g)||!Ge(l)||!Ge(f)?null:J.createElement("path",f6({},Ut(k,!0),{className:vt("recharts-cross",b),d:NSe(i,a,d,g,l,f)}))},V3,WN;function zSe(){if(WN)return V3;WN=1;var e=EU(),t=e(Object.getPrototypeOf,Object);return V3=t,V3}var W3,GN;function LSe(){if(GN)return W3;GN=1;var e=xs(),t=zSe(),n=Ss(),i="[object Object]",r=Function.prototype,a=Object.prototype,o=r.toString,l=a.hasOwnProperty,u=o.call(Object);function f(h){if(!n(h)||e(h)!=i)return!1;var d=t(h);if(d===null)return!0;var p=l.call(d,"constructor")&&d.constructor;return typeof p=="function"&&p instanceof p&&o.call(p)==u}return W3=f,W3}var ISe=LSe();const BSe=gn(ISe);var G3,YN;function FSe(){if(YN)return G3;YN=1;var e=xs(),t=Ss(),n="[object Boolean]";function i(r){return r===!0||r===!1||t(r)&&e(r)==n}return G3=i,G3}var qSe=FSe();const HSe=gn(qSe);function Hm(e){"@babel/helpers - typeof";return Hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hm(e)}function G1(){return G1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:p,x:u,y:f},to:{upperWidth:h,lowerWidth:d,height:p,x:u,y:f},duration:w,animationEasing:b,isActive:_},function(j){var T=j.upperWidth,A=j.lowerWidth,O=j.height,M=j.x,N=j.y;return J.createElement(wo,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:k,duration:w,easing:b},J.createElement("path",G1({},Ut(n,!0),{className:x,d:QN(M,N,T,A,O),ref:i})))}):J.createElement("g",null,J.createElement("path",G1({},Ut(n,!0),{className:x,d:QN(u,f,h,d,p)})))},e4e=["option","shapeType","propTransformer","activeClassName","isActive"];function Um(e){"@babel/helpers - typeof";return Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Um(e)}function t4e(e,t){if(e==null)return{};var n=n4e(e,t),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function n4e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function JN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Y1(e){for(var t=1;t0&&i.handleDrag(r.changedTouches[0])}),Br(i,"handleDragEnd",function(){i.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var r=i.props,a=r.endIndex,o=r.onDragEnd,l=r.startIndex;o==null||o({endIndex:a,startIndex:l})}),i.detachDragEndListener()}),Br(i,"handleLeaveWrapper",function(){(i.state.isTravellerMoving||i.state.isSlideMoving)&&(i.leaveTimer=window.setTimeout(i.handleDragEnd,i.props.leaveTimeOut))}),Br(i,"handleEnterSlideOrTraveller",function(){i.setState({isTextActive:!0})}),Br(i,"handleLeaveSlideOrTraveller",function(){i.setState({isTextActive:!1})}),Br(i,"handleSlideDragStart",function(r){var a=u$(r)?r.changedTouches[0]:r;i.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),i.attachDragEndListener()}),i.travellerDragStartHandlers={startX:i.handleTravellerDragStart.bind(i,"startX"),endX:i.handleTravellerDragStart.bind(i,"endX")},i.state={},i}return E4e(t,e),j4e(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(i){var r=i.startX,a=i.endX,o=this.state.scaleValues,l=this.props,u=l.gap,f=l.data,h=f.length-1,d=Math.min(r,a),p=Math.max(r,a),g=t.getIndexInRange(o,d),b=t.getIndexInRange(o,p);return{startIndex:g-g%u,endIndex:b===h?h:b-b%u}}},{key:"getTextOfTick",value:function(i){var r=this.props,a=r.data,o=r.tickFormatter,l=r.dataKey,u=ur(a[i],l,i);return Bt(o)?o(u,i):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(i){var r=this.state,a=r.slideMoveStartX,o=r.startX,l=r.endX,u=this.props,f=u.x,h=u.width,d=u.travellerWidth,p=u.startIndex,g=u.endIndex,b=u.onChange,w=i.pageX-a;w>0?w=Math.min(w,f+h-d-l,f+h-d-o):w<0&&(w=Math.max(w,f-o,f-l));var k=this.getIndex({startX:o+w,endX:l+w});(k.startIndex!==p||k.endIndex!==g)&&b&&b(k),this.setState({startX:o+w,endX:l+w,slideMoveStartX:i.pageX})}},{key:"handleTravellerDragStart",value:function(i,r){var a=u$(r)?r.changedTouches[0]:r;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:i,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(i){var r=this.state,a=r.brushMoveStartX,o=r.movingTravellerId,l=r.endX,u=r.startX,f=this.state[o],h=this.props,d=h.x,p=h.width,g=h.travellerWidth,b=h.onChange,w=h.gap,k=h.data,_={startX:this.state.startX,endX:this.state.endX},x=i.pageX-a;x>0?x=Math.min(x,d+p-g-f):x<0&&(x=Math.max(x,d-f)),_[o]=f+x;var j=this.getIndex(_),T=j.startIndex,A=j.endIndex,O=function(){var N=k.length-1;return o==="startX"&&(l>u?T%w===0:A%w===0)||lu?A%w===0:T%w===0)||l>u&&A===N};this.setState(Br(Br({},o,f+x),"brushMoveStartX",i.pageX),function(){b&&O()&&b(j)})}},{key:"handleTravellerMoveKeyboard",value:function(i,r){var a=this,o=this.state,l=o.scaleValues,u=o.startX,f=o.endX,h=this.state[r],d=l.indexOf(h);if(d!==-1){var p=d+i;if(!(p===-1||p>=l.length)){var g=l[p];r==="startX"&&g>=f||r==="endX"&&g<=u||this.setState(Br({},r,g),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var i=this.props,r=i.x,a=i.y,o=i.width,l=i.height,u=i.fill,f=i.stroke;return J.createElement("rect",{stroke:f,fill:u,x:r,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var i=this.props,r=i.x,a=i.y,o=i.width,l=i.height,u=i.data,f=i.children,h=i.padding,d=S.Children.only(f);return d?J.cloneElement(d,{x:r,y:a,width:o,height:l,margin:h,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(i,r){var a,o,l=this,u=this.props,f=u.y,h=u.travellerWidth,d=u.height,p=u.traveller,g=u.ariaLabel,b=u.data,w=u.startIndex,k=u.endIndex,_=Math.max(i,this.props.x),x=Q3(Q3({},Ut(this.props,!1)),{},{x:_,y:f,width:h,height:d}),j=g||"Min value: ".concat((a=b[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=b[k])===null||o===void 0?void 0:o.name);return J.createElement(Fn,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":i,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),l.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,r))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,x))}},{key:"renderSlide",value:function(i,r){var a=this.props,o=a.y,l=a.height,u=a.stroke,f=a.travellerWidth,h=Math.min(i,r)+f,d=Math.max(Math.abs(r-i)-f,0);return J.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:h,y:o,width:d,height:l})}},{key:"renderText",value:function(){var i=this.props,r=i.startIndex,a=i.endIndex,o=i.y,l=i.height,u=i.travellerWidth,f=i.stroke,h=this.state,d=h.startX,p=h.endX,g=5,b={pointerEvents:"none",fill:f};return J.createElement(Fn,{className:"recharts-brush-texts"},J.createElement(x1,X1({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-g,y:o+l/2},b),this.getTextOfTick(r)),J.createElement(x1,X1({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+u+g,y:o+l/2},b),this.getTextOfTick(a)))}},{key:"render",value:function(){var i=this.props,r=i.data,a=i.className,o=i.children,l=i.x,u=i.y,f=i.width,h=i.height,d=i.alwaysShowText,p=this.state,g=p.startX,b=p.endX,w=p.isTextActive,k=p.isSlideMoving,_=p.isTravellerMoving,x=p.isTravellerFocused;if(!r||!r.length||!Ge(l)||!Ge(u)||!Ge(f)||!Ge(h)||f<=0||h<=0)return null;var j=vt("recharts-brush",a),T=J.Children.count(o)===1,A=S4e("userSelect","none");return J.createElement(Fn,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(g,b),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(b,"endX"),(w||k||_||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(i){var r=i.x,a=i.y,o=i.width,l=i.height,u=i.stroke,f=Math.floor(a+l/2)-1;return J.createElement(J.Fragment,null,J.createElement("rect",{x:r,y:a,width:o,height:l,fill:u,stroke:"none"}),J.createElement("line",{x1:r+1,y1:f,x2:r+o-1,y2:f,fill:"none",stroke:"#fff"}),J.createElement("line",{x1:r+1,y1:f+2,x2:r+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(i,r){var a;return J.isValidElement(i)?a=J.cloneElement(i,r):Bt(i)?a=i(r):a=t.renderDefaultTraveller(r),a}},{key:"getDerivedStateFromProps",value:function(i,r){var a=i.data,o=i.width,l=i.x,u=i.travellerWidth,f=i.updateId,h=i.startIndex,d=i.endIndex;if(a!==r.prevData||f!==r.prevUpdateId)return Q3({prevData:a,prevTravellerWidth:u,prevUpdateId:f,prevX:l,prevWidth:o},a&&a.length?D4e({data:a,width:o,x:l,travellerWidth:u,startIndex:h,endIndex:d}):{scale:null,scaleValues:null});if(r.scale&&(o!==r.prevWidth||l!==r.prevX||u!==r.prevTravellerWidth)){r.scale.range([l,l+o-u]);var p=r.scale.domain().map(function(g){return r.scale(g)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:f,prevX:l,prevWidth:o,startX:r.scale(i.startIndex),endX:r.scale(i.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(i,r){for(var a=i.length,o=0,l=a-1;l-o>1;){var u=Math.floor((o+l)/2);i[u]>r?l=u:o=u}return r>=i[l]?l:o}}])})(S.PureComponent);Br(Cf,"displayName","Brush");Br(Cf,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var J3,c$;function R4e(){if(c$)return J3;c$=1;var e=hj();function t(n,i){var r;return e(n,function(a,o,l){return r=i(a,o,l),!r}),!!r}return J3=t,J3}var eS,f$;function P4e(){if(f$)return eS;f$=1;var e=xU(),t=Dl(),n=R4e(),i=jr(),r=H0();function a(o,l,u){var f=i(o)?e:n;return u&&r(o,l,u)&&(l=void 0),f(o,t(l,3))}return eS=a,eS}var N4e=P4e();const $4e=gn(N4e);var fo=function(t,n){var i=t.alwaysShow,r=t.ifOverflow;return i&&(r="extendDomain"),r===n},tS,d$;function z4e(){if(d$)return tS;d$=1;var e=FU();function t(n,i,r){i=="__proto__"&&e?e(n,i,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[i]=r}return tS=t,tS}var nS,h$;function L4e(){if(h$)return nS;h$=1;var e=z4e(),t=IU(),n=Dl();function i(r,a){var o={};return a=n(a,3),t(r,function(l,u,f){e(o,u,a(l,u,f))}),o}return nS=i,nS}var I4e=L4e();const B4e=gn(I4e);var iS,m$;function F4e(){if(m$)return iS;m$=1;function e(t,n){for(var i=-1,r=t==null?0:t.length;++i=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function X4e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function Z4e(e,t){var n=e.x,i=e.y,r=K4e(e,V4e),a="".concat(n),o=parseInt(a,10),l="".concat(i),u=parseInt(l,10),f="".concat(t.height||r.height),h=parseInt(f,10),d="".concat(t.width||r.width),p=parseInt(d,10);return jh(jh(jh(jh(jh({},t),r),o?{x:o}:{}),u?{y:u}:{}),{},{height:h,width:p,name:t.name,radius:t.radius})}function y$(e){return J.createElement(u4e,h6({shapeType:"rectangle",propTransformer:Z4e,activeClassName:"recharts-active-bar"},e))}var Q4e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(i,r){if(typeof t=="number")return t;var a=Ge(i)||uge(i);return a?t(i,r):(a||Du(),n)}},J4e=["value","background"],pW;function jf(e){"@babel/helpers - typeof";return jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jf(e)}function e6e(e,t){if(e==null)return{};var n=t6e(e,t),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function t6e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs($)0&&Math.abs(U)0&&(G=Math.min((Z||0)-(U[ie-1]||0),G))}),Number.isFinite(G)){var $=G/q,D=w.layout==="vertical"?i.height:i.width;if(w.padding==="gap"&&(M=$*D/2),w.padding==="no-gap"){var z=Eu(t.barCategoryGap,$*D),H=$*D/2;M=H-z-(H-z)/D*z}}}r==="xAxis"?N=[i.left+(j.left||0)+(M||0),i.left+i.width-(j.right||0)-(M||0)]:r==="yAxis"?N=u==="horizontal"?[i.top+i.height-(j.bottom||0),i.top+(j.top||0)]:[i.top+(j.top||0)+(M||0),i.top+i.height-(j.bottom||0)-(M||0)]:N=w.range,A&&(N=[N[1],N[0]]);var Y=C2e(w,a,p),P=Y.scale,W=Y.realScaleType;P.domain(_).range(N),j2e(P);var V=P2e(P,za(za({},w),{},{realScaleType:W}));r==="xAxis"?(I=k==="top"&&!T||k==="bottom"&&T,F=i.left,R=d[O]-I*w.height):r==="yAxis"&&(I=k==="left"&&!T||k==="right"&&T,F=d[O]-I*w.width,R=i.top);var L=za(za(za({},w),V),{},{realScaleType:W,x:F,y:R,scale:P,width:r==="xAxis"?i.width:w.width,height:r==="yAxis"?i.height:w.height});return L.bandSize=I1(L,V),!w.hide&&r==="xAxis"?d[O]+=(I?-1:1)*L.height:w.hide||(d[O]+=(I?-1:1)*L.width),za(za({},g),{},nb({},b,L))},{})},bW=function(t,n){var i=t.x,r=t.y,a=n.x,o=n.y;return{x:Math.min(i,a),y:Math.min(r,o),width:Math.abs(a-i),height:Math.abs(o-r)}},d6e=function(t){var n=t.x1,i=t.y1,r=t.x2,a=t.y2;return bW({x:n,y:i},{x:r,y:a})},wW=(function(){function e(t){u6e(this,e),this.scale=t}return c6e(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.bandAware,a=i.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(r){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+u}return this.scale(n)}}},{key:"isInRange",value:function(n){var i=this.range(),r=i[0],a=i[i.length-1];return r<=a?n>=r&&n<=a:n>=a&&n<=r}}],[{key:"create",value:function(n){return new e(n)}}])})();nb(wW,"EPS",1e-4);var Hj=function(t){var n=Object.keys(t).reduce(function(i,r){return za(za({},i),{},nb({},r,wW.create(t[r])))},{});return za(za({},n),{},{apply:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return B4e(r,function(u,f){return n[f].apply(u,{bandAware:o,position:l})})},isInRange:function(r){return mW(r,function(a,o){return n[o].isInRange(a)})}})};function h6e(e){return(e%180+180)%180}var m6e=function(t){var n=t.width,i=t.height,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=h6e(r),o=a*Math.PI/180,l=Math.atan(i/n),u=o>l&&o-1?u[f?a[h]:h]:void 0}}return oS=i,oS}var sS,S$;function v6e(){if(S$)return sS;S$=1;var e=cW();function t(n){var i=e(n),r=i%1;return i===i?r?i-r:i:0}return sS=t,sS}var lS,C$;function g6e(){if(C$)return lS;C$=1;var e=PU(),t=Dl(),n=v6e(),i=Math.max;function r(a,o,l){var u=a==null?0:a.length;if(!u)return-1;var f=l==null?0:n(l);return f<0&&(f=i(u+f,0)),e(a,t(o,3),f)}return lS=r,lS}var uS,j$;function y6e(){if(j$)return uS;j$=1;var e=p6e(),t=g6e(),n=e(t);return uS=n,uS}var b6e=y6e();const w6e=gn(b6e);var k6e=KH();const _6e=gn(k6e);var x6e=_6e(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Uj=S.createContext(void 0),Vj=S.createContext(void 0),kW=S.createContext(void 0),_W=S.createContext({}),xW=S.createContext(void 0),SW=S.createContext(0),CW=S.createContext(0),A$=function(t){var n=t.state,i=n.xAxisMap,r=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,u=t.width,f=t.height,h=x6e(a);return J.createElement(Uj.Provider,{value:i},J.createElement(Vj.Provider,{value:r},J.createElement(_W.Provider,{value:a},J.createElement(kW.Provider,{value:h},J.createElement(xW.Provider,{value:o},J.createElement(SW.Provider,{value:f},J.createElement(CW.Provider,{value:u},l)))))))},S6e=function(){return S.useContext(xW)},jW=function(t){var n=S.useContext(Uj);n==null&&Du();var i=n[t];return i==null&&Du(),i},C6e=function(){var t=S.useContext(Uj);return al(t)},j6e=function(){var t=S.useContext(Vj),n=w6e(t,function(i){return mW(i.domain,Number.isFinite)});return n||al(t)},AW=function(t){var n=S.useContext(Vj);n==null&&Du();var i=n[t];return i==null&&Du(),i},A6e=function(){var t=S.useContext(kW);return t},O6e=function(){return S.useContext(_W)},Wj=function(){return S.useContext(CW)},Gj=function(){return S.useContext(SW)};function Af(e){"@babel/helpers - typeof";return Af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Af(e)}function T6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E6e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);ne*r)return!1;var a=n();return e*(t-e*a/2-i)>=0&&e*(t+e*a/2-r)<=0}function fCe(e,t){return PW(e,t+1)}function dCe(e,t,n,i,r){for(var a=(i||[]).slice(),o=t.start,l=t.end,u=0,f=1,h=o,d=function(){var b=i==null?void 0:i[u];if(b===void 0)return{v:PW(i,f)};var w=u,k,_=function(){return k===void 0&&(k=n(b,w)),k},x=b.coordinate,j=u===0||iy(e,x,_,h,l);j||(u=0,h=o,f+=1),j&&(h=x+e*(_()/2+r),u+=f)},p;f<=a.length;)if(p=d(),p)return p.v;return[]}function Km(e){"@babel/helpers - typeof";return Km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Km(e)}function N$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Xi(e){for(var t=1;t0?g.coordinate-k*e:g.coordinate})}else a[p]=g=Xi(Xi({},g),{},{tickCoord:g.coordinate});var _=iy(e,g.tickCoord,w,l,u);_&&(u=g.tickCoord-e*(w()/2+r),a[p]=Xi(Xi({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return a}function gCe(e,t,n,i,r,a){var o=(i||[]).slice(),l=o.length,u=t.start,f=t.end;if(a){var h=i[l-1],d=n(h,l-1),p=e*(h.coordinate+e*d/2-f);o[l-1]=h=Xi(Xi({},h),{},{tickCoord:p>0?h.coordinate-p*e:h.coordinate});var g=iy(e,h.tickCoord,function(){return d},u,f);g&&(f=h.tickCoord-e*(d/2+r),o[l-1]=Xi(Xi({},h),{},{isShow:!0}))}for(var b=a?l-1:l,w=function(x){var j=o[x],T,A=function(){return T===void 0&&(T=n(j,x)),T};if(x===0){var O=e*(j.coordinate-e*A()/2-u);o[x]=j=Xi(Xi({},j),{},{tickCoord:O<0?j.coordinate-O*e:j.coordinate})}else o[x]=j=Xi(Xi({},j),{},{tickCoord:j.coordinate});var M=iy(e,j.tickCoord,A,u,f);M&&(u=j.tickCoord+e*(A()/2+r),o[x]=Xi(Xi({},j),{},{isShow:!0}))},k=0;k=2?Ha(r[1].coordinate-r[0].coordinate):1,_=cCe(a,k,g);return u==="equidistantPreserveStart"?dCe(k,_,w,r,o):(u==="preserveStart"||u==="preserveStartEnd"?p=gCe(k,_,w,r,o,u==="preserveStartEnd"):p=vCe(k,_,w,r,o),p.filter(function(x){return x.isShow}))}var yCe=["viewBox"],bCe=["viewBox"],wCe=["ticks"];function Ef(e){"@babel/helpers - typeof";return Ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ef(e)}function Kc(){return Kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kCe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function _Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z$(e,t){for(var n=0;n0?u(this.props):u(g)),o<=0||l<=0||!b||!b.length?null:J.createElement(Fn,{className:vt("recharts-cartesian-axis",f),ref:function(k){i.layerReference=k}},a&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),ai.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(i,r,a){var o,l=vt(r.className,"recharts-cartesian-axis-tick-value");return J.isValidElement(i)?o=J.cloneElement(i,_i(_i({},r),{},{className:l})):Bt(i)?o=i(_i(_i({},r),{},{className:l})):o=J.createElement(x1,Kc({},r,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(S.Component);Xj(md,"displayName","CartesianAxis");Xj(md,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var TCe=["x1","y1","x2","y2","key"],ECe=["offset"];function Ru(e){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ru(e)}function L$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Qi(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function PCe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}var NCe=function(t){var n=t.fill;if(!n||n==="none")return null;var i=t.fillOpacity,r=t.x,a=t.y,o=t.width,l=t.height,u=t.ry;return J.createElement("rect",{x:r,y:a,ry:u,width:o,height:l,stroke:"none",fill:n,fillOpacity:i,className:"recharts-cartesian-grid-bg"})};function zW(e,t){var n;if(J.isValidElement(e))n=J.cloneElement(e,t);else if(Bt(e))n=e(t);else{var i=t.x1,r=t.y1,a=t.x2,o=t.y2,l=t.key,u=I$(t,TCe),f=Ut(u,!1);f.offset;var h=I$(f,ECe);n=J.createElement("line",vu({},h,{x1:i,y1:r,x2:a,y2:o,fill:"none",key:l}))}return n}function $Ce(e){var t=e.x,n=e.width,i=e.horizontal,r=i===void 0?!0:i,a=e.horizontalPoints;if(!r||!a||!a.length)return null;var o=a.map(function(l,u){var f=Qi(Qi({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(u),index:u});return zW(r,f)});return J.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function zCe(e){var t=e.y,n=e.height,i=e.vertical,r=i===void 0?!0:i,a=e.verticalPoints;if(!r||!a||!a.length)return null;var o=a.map(function(l,u){var f=Qi(Qi({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(u),index:u});return zW(r,f)});return J.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function LCe(e){var t=e.horizontalFill,n=e.fillOpacity,i=e.x,r=e.y,a=e.width,o=e.height,l=e.horizontalPoints,u=e.horizontal,f=u===void 0?!0:u;if(!f||!t||!t.length)return null;var h=l.map(function(p){return Math.round(p+r-r)}).sort(function(p,g){return p-g});r!==h[0]&&h.unshift(0);var d=h.map(function(p,g){var b=!h[g+1],w=b?r+o-p:h[g+1]-p;if(w<=0)return null;var k=g%t.length;return J.createElement("rect",{key:"react-".concat(g),y:p,x:i,height:w,width:a,stroke:"none",fill:t[k],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return J.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function ICe(e){var t=e.vertical,n=t===void 0?!0:t,i=e.verticalFill,r=e.fillOpacity,a=e.x,o=e.y,l=e.width,u=e.height,f=e.verticalPoints;if(!n||!i||!i.length)return null;var h=f.map(function(p){return Math.round(p+a-a)}).sort(function(p,g){return p-g});a!==h[0]&&h.unshift(0);var d=h.map(function(p,g){var b=!h[g+1],w=b?a+l-p:h[g+1]-p;if(w<=0)return null;var k=g%i.length;return J.createElement("rect",{key:"react-".concat(g),x:p,y:o,width:w,height:u,stroke:"none",fill:i[k],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return J.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var BCe=function(t,n){var i=t.xAxis,r=t.width,a=t.height,o=t.offset;return ZV(Kj(Qi(Qi(Qi({},md.defaultProps),i),{},{ticks:Jo(i,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.left,o.left+o.width,n)},FCe=function(t,n){var i=t.yAxis,r=t.width,a=t.height,o=t.offset;return ZV(Kj(Qi(Qi(Qi({},md.defaultProps),i),{},{ticks:Jo(i,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.top,o.top+o.height,n)},Fc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function sb(e){var t,n,i,r,a,o,l=Wj(),u=Gj(),f=O6e(),h=Qi(Qi({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Fc.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Fc.fill,horizontal:(i=e.horizontal)!==null&&i!==void 0?i:Fc.horizontal,horizontalFill:(r=e.horizontalFill)!==null&&r!==void 0?r:Fc.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Fc.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Fc.verticalFill,x:Ge(e.x)?e.x:f.left,y:Ge(e.y)?e.y:f.top,width:Ge(e.width)?e.width:f.width,height:Ge(e.height)?e.height:f.height}),d=h.x,p=h.y,g=h.width,b=h.height,w=h.syncWithTicks,k=h.horizontalValues,_=h.verticalValues,x=C6e(),j=j6e();if(!Ge(g)||g<=0||!Ge(b)||b<=0||!Ge(d)||d!==+d||!Ge(p)||p!==+p)return null;var T=h.verticalCoordinatesGenerator||BCe,A=h.horizontalCoordinatesGenerator||FCe,O=h.horizontalPoints,M=h.verticalPoints;if((!O||!O.length)&&Bt(A)){var N=k&&k.length,F=A({yAxis:j?Qi(Qi({},j),{},{ticks:N?k:j.ticks}):void 0,width:l,height:u,offset:f},N?!0:w);rs(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ru(F),"]")),Array.isArray(F)&&(O=F)}if((!M||!M.length)&&Bt(T)){var R=_&&_.length,I=T({xAxis:x?Qi(Qi({},x),{},{ticks:R?_:x.ticks}):void 0,width:l,height:u,offset:f},R?!0:w);rs(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ru(I),"]")),Array.isArray(I)&&(M=I)}return J.createElement("g",{className:"recharts-cartesian-grid"},J.createElement(NCe,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),J.createElement($Ce,vu({},h,{offset:f,horizontalPoints:O,xAxis:x,yAxis:j})),J.createElement(zCe,vu({},h,{offset:f,verticalPoints:M,xAxis:x,yAxis:j})),J.createElement(LCe,vu({},h,{horizontalPoints:O})),J.createElement(ICe,vu({},h,{verticalPoints:M})))}sb.displayName="CartesianGrid";var qCe=["type","layout","connectNulls","ref"],HCe=["key"];function Mf(e){"@babel/helpers - typeof";return Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(e)}function B$(e,t){if(e==null)return{};var n=UCe(e,t),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function UCe(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);nd){g=[].concat(qc(u.slice(0,b)),[d-w]);break}var k=g.length%2===0?[0,p]:[p];return[].concat(qc(t.repeat(u,h)),qc(g),k).map(function(_){return"".concat(_,"px")}).join(", ")}),La(n,"id",ud("recharts-line-")),La(n,"pathRef",function(o){n.mainCurve=o}),La(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),La(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return e9e(t,e),XCe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var i=this.getTotalLength();this.setState({totalLength:i})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var i=this.getTotalLength();i!==this.state.totalLength&&this.setState({totalLength:i})}}},{key:"getTotalLength",value:function(){var i=this.mainCurve;try{return i&&i.getTotalLength&&i.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(i,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,u=a.yAxis,f=a.layout,h=a.children,d=ya(h,Mp);if(!d)return null;var p=function(w,k){return{x:w.x,y:w.y,value:w.value,errorVal:ur(w.payload,k)}},g={clipPath:i?"url(#clipPath-".concat(r,")"):null};return J.createElement(Fn,g,d.map(function(b){return J.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:o,xAxis:l,yAxis:u,layout:f,dataPointFormatter:p})}))}},{key:"renderDots",value:function(i,r,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,u=l.dot,f=l.points,h=l.dataKey,d=Ut(this.props,!1),p=Ut(u,!0),g=f.map(function(w,k){var _=Ir(Ir(Ir({key:"dot-".concat(k),r:3},d),p),{},{index:k,cx:w.x,cy:w.y,value:w.value,dataKey:h,payload:w.payload,points:f});return t.renderDotItem(u,_)}),b={clipPath:i?"url(#clipPath-".concat(r?"":"dots-").concat(a,")"):null};return J.createElement(Fn,Qh({className:"recharts-line-dots",key:"dots"},b),g)}},{key:"renderCurveStatically",value:function(i,r,a,o){var l=this.props,u=l.type,f=l.layout,h=l.connectNulls;l.ref;var d=B$(l,qCe),p=Ir(Ir(Ir({},Ut(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:r?"url(#clipPath-".concat(a,")"):null,points:i},o),{},{type:u,layout:f,connectNulls:h});return J.createElement(af,Qh({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(i,r){var a=this,o=this.props,l=o.points,u=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,d=o.animationDuration,p=o.animationEasing,g=o.animationId,b=o.animateNewValues,w=o.width,k=o.height,_=this.state,x=_.prevPoints,j=_.totalLength;return J.createElement(wo,{begin:h,duration:d,isActive:f,easing:p,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var A=T.t;if(x){var O=x.length/l.length,M=l.map(function(q,G){var U=Math.floor(G*O);if(x[U]){var $=x[U],D=Hi($.x,q.x),z=Hi($.y,q.y);return Ir(Ir({},q),{},{x:D(A),y:z(A)})}if(b){var H=Hi(w*2,q.x),Y=Hi(k/2,q.y);return Ir(Ir({},q),{},{x:H(A),y:Y(A)})}return Ir(Ir({},q),{},{x:q.x,y:q.y})});return a.renderCurveStatically(M,i,r)}var N=Hi(0,j),F=N(A),R;if(u){var I="".concat(u).split(/[,\s]+/gim).map(function(q){return parseFloat(q)});R=a.getStrokeDasharray(F,j,I)}else R=a.generateSimpleStrokeDasharray(j,F);return a.renderCurveStatically(l,i,r,{strokeDasharray:R})})}},{key:"renderCurve",value:function(i,r){var a=this.props,o=a.points,l=a.isAnimationActive,u=this.state,f=u.prevPoints,h=u.totalLength;return l&&o&&o.length&&(!f&&h>0||!kf(f,o))?this.renderCurveWithAnimation(i,r):this.renderCurveStatically(o,i,r)}},{key:"render",value:function(){var i,r=this.props,a=r.hide,o=r.dot,l=r.points,u=r.className,f=r.xAxis,h=r.yAxis,d=r.top,p=r.left,g=r.width,b=r.height,w=r.isAnimationActive,k=r.id;if(a||!l||!l.length)return null;var _=this.state.isAnimationFinished,x=l.length===1,j=vt("recharts-line",u),T=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,O=T||A,M=Kt(k)?this.id:k,N=(i=Ut(o,!1))!==null&&i!==void 0?i:{r:3,strokeWidth:2},F=N.r,R=F===void 0?3:F,I=N.strokeWidth,q=I===void 0?2:I,G=eU(o)?o:{},U=G.clipDot,$=U===void 0?!0:U,D=R*2+q;return J.createElement(Fn,{className:j},T||A?J.createElement("defs",null,J.createElement("clipPath",{id:"clipPath-".concat(M)},J.createElement("rect",{x:T?p:p-g/2,y:A?d:d-b/2,width:T?g:g*2,height:A?b:b*2})),!$&&J.createElement("clipPath",{id:"clipPath-dots-".concat(M)},J.createElement("rect",{x:p-D/2,y:d-D/2,width:g+D,height:b+D}))):null,!x&&this.renderCurve(O,M),this.renderErrorBar(O,M),(x||o)&&this.renderDots(O,$,M),(!w||_)&&co.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(i,r){return i.animationId!==r.prevAnimationId?{prevAnimationId:i.animationId,curPoints:i.points,prevPoints:r.curPoints}:i.points!==r.curPoints?{curPoints:i.points}:null}},{key:"repeat",value:function(i,r){for(var a=i.length%2!==0?[].concat(qc(i),[0]):i,o=[],l=0;l=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function r9e(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!kf(h,o)||!kf(d,l))?this.renderAreaWithAnimation(i,r):this.renderAreaStatically(o,l,i,r)}},{key:"render",value:function(){var i,r=this.props,a=r.hide,o=r.dot,l=r.points,u=r.className,f=r.top,h=r.left,d=r.xAxis,p=r.yAxis,g=r.width,b=r.height,w=r.isAnimationActive,k=r.id;if(a||!l||!l.length)return null;var _=this.state.isAnimationFinished,x=l.length===1,j=vt("recharts-area",u),T=d&&d.allowDataOverflow,A=p&&p.allowDataOverflow,O=T||A,M=Kt(k)?this.id:k,N=(i=Ut(o,!1))!==null&&i!==void 0?i:{r:3,strokeWidth:2},F=N.r,R=F===void 0?3:F,I=N.strokeWidth,q=I===void 0?2:I,G=eU(o)?o:{},U=G.clipDot,$=U===void 0?!0:U,D=R*2+q;return J.createElement(Fn,{className:j},T||A?J.createElement("defs",null,J.createElement("clipPath",{id:"clipPath-".concat(M)},J.createElement("rect",{x:T?h:h-g/2,y:A?f:f-b/2,width:T?g:g*2,height:A?b:b*2})),!$&&J.createElement("clipPath",{id:"clipPath-dots-".concat(M)},J.createElement("rect",{x:h-D/2,y:f-D/2,width:g+D,height:b+D}))):null,x?null:this.renderArea(O,M),(o||x)&&this.renderDots(O,$,M),(!w||_)&&co.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(i,r){return i.animationId!==r.prevAnimationId?{prevAnimationId:i.animationId,curPoints:i.points,curBaseLine:i.baseLine,prevPoints:r.curPoints,prevBaseLine:r.curBaseLine}:i.points!==r.curPoints||i.baseLine!==r.curBaseLine?{curPoints:i.points,curBaseLine:i.baseLine}:null}}])})(S.PureComponent);BW=ps;oo(ps,"displayName","Area");oo(ps,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Uu.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});oo(ps,"getBaseValue",function(e,t,n,i){var r=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(Ge(l)&&typeof l=="number")return l;var u=r==="horizontal"?i:n,f=u.scale.domain();if(u.type==="number"){var h=Math.max(f[0],f[1]),d=Math.min(f[0],f[1]);return l==="dataMin"?d:l==="dataMax"||h<0?h:Math.max(Math.min(f[0],f[1]),0)}return l==="dataMin"?f[0]:l==="dataMax"?f[1]:f[0]});oo(ps,"getComposedData",function(e){var t=e.props,n=e.item,i=e.xAxis,r=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,u=e.dataKey,f=e.stackedData,h=e.dataStartIndex,d=e.displayedData,p=e.offset,g=t.layout,b=f&&f.length,w=BW.getBaseValue(t,n,i,r),k=g==="horizontal",_=!1,x=d.map(function(T,A){var O;b?O=f[h+A]:(O=ur(T,u),Array.isArray(O)?_=!0:O=[w,O]);var M=O[1]==null||b&&ur(T,u)==null;return k?{x:L1({axis:i,ticks:a,bandSize:l,entry:T,index:A}),y:M?null:r.scale(O[1]),value:O,payload:T}:{x:M?null:i.scale(O[1]),y:L1({axis:r,ticks:o,bandSize:l,entry:T,index:A}),value:O,payload:T}}),j;return b||_?j=x.map(function(T){var A=Array.isArray(T.value)?T.value[0]:null;return k?{x:T.x,y:A!=null&&T.y!=null?r.scale(A):null}:{x:A!=null?i.scale(A):null,y:T.y}}):j=k?r.scale(w):i.scale(w),Js({points:x,baseLine:j,layout:g,isRange:_},p)});oo(ps,"renderDotItem",function(e,t){var n;if(J.isValidElement(e))n=J.cloneElement(e,t);else if(Bt(e))n=e(t);else{var i=vt("recharts-area-dot",typeof e!="boolean"?e.className:""),r=t.key,a=FW(t,i9e);n=J.createElement(J0,gu({},a,{key:r,className:i}))}return n});function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function d9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h9e(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function eje(e,t){if(e==null)return{};var n={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;n[i]=e[i]}return n}function tje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nje(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?o:t&&t.length&&Ge(r)&&Ge(a)?t.slice(r,a+1):[]};function nG(e){return e==="number"?[0,"auto"]:void 0}var R6=function(t,n,i,r){var a=t.graphicalItems,o=t.tooltipAxis,l=lb(n,t);return i<0||!a||!a.length||i>=l.length?null:a.reduce(function(u,f){var h,d=(h=f.props.data)!==null&&h!==void 0?h:n;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=i&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var g=d===void 0?l:d;p=c1(g,o.dataKey,r)}else p=d&&d[i]||l[i];return p?[].concat($f(u),[JV(f,p)]):u},[])},Z$=function(t,n,i,r){var a=r||{x:t.chartX,y:t.chartY},o=mje(a,i),l=t.orderedTooltipTicks,u=t.tooltipAxis,f=t.tooltipTicks,h=b2e(o,l,f,u);if(h>=0&&f){var d=f[h]&&f[h].value,p=R6(t,n,h,d),g=pje(i,l,h,a);return{activeTooltipIndex:h,activeLabel:d,activePayload:p,activeCoordinate:g}}return null},vje=function(t,n){var i=n.axes,r=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,u=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,d=t.children,p=t.stackOffset,g=XV(h,a);return i.reduce(function(b,w){var k,_=w.type.defaultProps!==void 0?Te(Te({},w.type.defaultProps),w.props):w.props,x=_.type,j=_.dataKey,T=_.allowDataOverflow,A=_.allowDuplicatedCategory,O=_.scale,M=_.ticks,N=_.includeHidden,F=_[o];if(b[F])return b;var R=lb(t.data,{graphicalItems:r.filter(function(V){var L,Z=o in V.props?V.props[o]:(L=V.type.defaultProps)===null||L===void 0?void 0:L[o];return Z===F}),dataStartIndex:u,dataEndIndex:f}),I=R.length,q,G,U;q9e(_.domain,T,x)&&(q=X4(_.domain,null,T),g&&(x==="number"||O!=="auto")&&(U=Xh(R,j,"category")));var $=nG(x);if(!q||q.length===0){var D,z=(D=_.domain)!==null&&D!==void 0?D:$;if(j){if(q=Xh(R,j,x),x==="category"&&g){var H=fge(q);A&&H?(G=q,q=K1(0,I)):A||(q=dN(z,q,w).reduce(function(V,L){return V.indexOf(L)>=0?V:[].concat($f(V),[L])},[]))}else if(x==="category")A?q=q.filter(function(V){return V!==""&&!Kt(V)}):q=dN(z,q,w).reduce(function(V,L){return V.indexOf(L)>=0||L===""||Kt(L)?V:[].concat($f(V),[L])},[]);else if(x==="number"){var Y=S2e(R,r.filter(function(V){var L,Z,ie=o in V.props?V.props[o]:(L=V.type.defaultProps)===null||L===void 0?void 0:L[o],re="hide"in V.props?V.props.hide:(Z=V.type.defaultProps)===null||Z===void 0?void 0:Z.hide;return ie===F&&(N||!re)}),j,a,h);Y&&(q=Y)}g&&(x==="number"||O!=="auto")&&(U=Xh(R,j,"category"))}else g?q=K1(0,I):l&&l[F]&&l[F].hasStack&&x==="number"?q=p==="expand"?[0,1]:QV(l[F].stackGroups,u,f):q=KV(R,r.filter(function(V){var L=o in V.props?V.props[o]:V.type.defaultProps[o],Z="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return L===F&&(N||!Z)}),x,h,!0);if(x==="number")q=E6(d,q,F,a,M),z&&(q=X4(z,q,T));else if(x==="category"&&z){var P=z,W=q.every(function(V){return P.indexOf(V)>=0});W&&(q=P)}}return Te(Te({},b),{},At({},F,Te(Te({},_),{},{axisType:a,domain:q,categoricalDomain:U,duplicateDomain:G,originalDomain:(k=_.domain)!==null&&k!==void 0?k:$,isCategorical:g,layout:h})))},{})},gje=function(t,n){var i=n.graphicalItems,r=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,u=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,d=t.children,p=lb(t.data,{graphicalItems:i,dataStartIndex:u,dataEndIndex:f}),g=p.length,b=XV(h,a),w=-1;return i.reduce(function(k,_){var x=_.type.defaultProps!==void 0?Te(Te({},_.type.defaultProps),_.props):_.props,j=x[o],T=nG("number");if(!k[j]){w++;var A;return b?A=K1(0,g):l&&l[j]&&l[j].hasStack?(A=QV(l[j].stackGroups,u,f),A=E6(d,A,j,a)):(A=X4(T,KV(p,i.filter(function(O){var M,N,F=o in O.props?O.props[o]:(M=O.type.defaultProps)===null||M===void 0?void 0:M[o],R="hide"in O.props?O.props.hide:(N=O.type.defaultProps)===null||N===void 0?void 0:N.hide;return F===j&&!R}),"number",h),r.defaultProps.allowDataOverflow),A=E6(d,A,j,a)),Te(Te({},k),{},At({},j,Te(Te({axisType:a},r.defaultProps),{},{hide:!0,orientation:ga(dje,"".concat(a,".").concat(w%2),null),domain:A,originalDomain:T,isCategorical:b,layout:h})))}return k},{})},yje=function(t,n){var i=n.axisType,r=i===void 0?"xAxis":i,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,u=n.dataStartIndex,f=n.dataEndIndex,h=t.children,d="".concat(r,"Id"),p=ya(h,a),g={};return p&&p.length?g=vje(t,{axes:p,graphicalItems:o,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:u,dataEndIndex:f}):o&&o.length&&(g=gje(t,{Axis:a,graphicalItems:o,axisType:r,axisIdKey:d,stackGroups:l,dataStartIndex:u,dataEndIndex:f})),g},bje=function(t){var n=al(t),i=Jo(n,!1,!0);return{tooltipTicks:i,orderedTooltipTicks:mj(i,function(r){return r.coordinate}),tooltipAxis:n,tooltipAxisBandSize:I1(n,i)}},Q$=function(t){var n=t.children,i=t.defaultShowTooltip,r=qr(n,Cf),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(a=r.props.startIndex),r.props.endIndex>=0&&(o=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!i}},wje=function(t){return!t||!t.length?!1:t.some(function(n){var i=is(n&&n.type);return i&&i.indexOf("Bar")>=0})},J$=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},kje=function(t,n){var i=t.props,r=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,u=l===void 0?{}:l,f=i.width,h=i.height,d=i.children,p=i.margin||{},g=qr(d,Cf),b=qr(d,as),w=Object.keys(u).reduce(function(A,O){var M=u[O],N=M.orientation;return!M.mirror&&!M.hide?Te(Te({},A),{},At({},N,A[N]+M.width)):A},{left:p.left||0,right:p.right||0}),k=Object.keys(o).reduce(function(A,O){var M=o[O],N=M.orientation;return!M.mirror&&!M.hide?Te(Te({},A),{},At({},N,ga(A,"".concat(N))+M.height)):A},{top:p.top||0,bottom:p.bottom||0}),_=Te(Te({},k),w),x=_.bottom;g&&(_.bottom+=g.props.height||Cf.defaultProps.height),b&&n&&(_=_2e(_,r,i,n));var j=f-_.left-_.right,T=h-_.top-_.bottom;return Te(Te({brushBottom:x},_),{},{width:Math.max(j,0),height:Math.max(T,0)})},_je=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Zj=function(t){var n=t.chartName,i=t.GraphicalChild,r=t.defaultTooltipEventType,a=r===void 0?"axis":r,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,u=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,d=t.defaultProps,p=function(_,x){var j=x.graphicalItems,T=x.stackGroups,A=x.offset,O=x.updateId,M=x.dataStartIndex,N=x.dataEndIndex,F=_.barSize,R=_.layout,I=_.barGap,q=_.barCategoryGap,G=_.maxBarSize,U=J$(R),$=U.numericAxisName,D=U.cateAxisName,z=wje(j),H=[];return j.forEach(function(Y,P){var W=lb(_.data,{graphicalItems:[Y],dataStartIndex:M,dataEndIndex:N}),V=Y.type.defaultProps!==void 0?Te(Te({},Y.type.defaultProps),Y.props):Y.props,L=V.dataKey,Z=V.maxBarSize,ie=V["".concat($,"Id")],re=V["".concat(D,"Id")],X={},le=u.reduce(function(He,Ye){var We=x["".concat(Ye.axisType,"Map")],Qe=V["".concat(Ye.axisType,"Id")];We&&We[Qe]||Ye.axisType==="zAxis"||Du();var Je=We[Qe];return Te(Te({},He),{},At(At({},Ye.axisType,Je),"".concat(Ye.axisType,"Ticks"),Jo(Je)))},X),ee=le[D],se=le["".concat(D,"Ticks")],ke=T&&T[ie]&&T[ie].hasStack&&$2e(Y,T[ie].stackGroups),ne=is(Y.type).indexOf("Bar")>=0,$e=I1(ee,se),xe=[],Ae=z&&w2e({barSize:F,stackGroups:T,totalSize:_je(le,D)});if(ne){var ze,be,Ce=Kt(Z)?G:Z,Ne=(ze=(be=I1(ee,se,!0))!==null&&be!==void 0?be:Ce)!==null&&ze!==void 0?ze:0;xe=k2e({barGap:I,barCategoryGap:q,bandSize:Ne!==$e?Ne:$e,sizeList:Ae[re],maxBarSize:Ce}),Ne!==$e&&(xe=xe.map(function(He){return Te(Te({},He),{},{position:Te(Te({},He.position),{},{offset:He.position.offset-Ne/2})})}))}var de=Y&&Y.type&&Y.type.getComposedData;de&&H.push({props:Te(Te({},de(Te(Te({},le),{},{displayedData:W,props:_,dataKey:L,item:Y,bandSize:$e,barPosition:xe,offset:A,stackedData:ke,layout:R,dataStartIndex:M,dataEndIndex:N}))),{},At(At(At({key:Y.key||"item-".concat(P)},$,le[$]),D,le[D]),"animationId",O)),childIndex:xge(Y,_.children),item:Y})}),H},g=function(_,x){var j=_.props,T=_.dataStartIndex,A=_.dataEndIndex,O=_.updateId;if(!AD({props:j}))return null;var M=j.children,N=j.layout,F=j.stackOffset,R=j.data,I=j.reverseStackOrder,q=J$(N),G=q.numericAxisName,U=q.cateAxisName,$=ya(M,i),D=R2e(R,$,"".concat(G,"Id"),"".concat(U,"Id"),F,I),z=u.reduce(function(V,L){var Z="".concat(L.axisType,"Map");return Te(Te({},V),{},At({},Z,yje(j,Te(Te({},L),{},{graphicalItems:$,stackGroups:L.axisType===G&&D,dataStartIndex:T,dataEndIndex:A}))))},{}),H=kje(Te(Te({},z),{},{props:j,graphicalItems:$}),x==null?void 0:x.legendBBox);Object.keys(z).forEach(function(V){z[V]=h(j,z[V],H,V.replace("Map",""),n)});var Y=z["".concat(U,"Map")],P=bje(Y),W=p(j,Te(Te({},z),{},{dataStartIndex:T,dataEndIndex:A,updateId:O,graphicalItems:$,stackGroups:D,offset:H}));return Te(Te({formattedGraphicalItems:W,graphicalItems:$,offset:H,stackGroups:D},P),z)},b=(function(k){function _(x){var j,T,A;return tje(this,_),A=rje(this,_,[x]),At(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),At(A,"accessibilityManager",new F9e),At(A,"handleLegendBBoxUpdate",function(O){if(O){var M=A.state,N=M.dataStartIndex,F=M.dataEndIndex,R=M.updateId;A.setState(Te({legendBBox:O},g({props:A.props,dataStartIndex:N,dataEndIndex:F,updateId:R},Te(Te({},A.state),{},{legendBBox:O}))))}}),At(A,"handleReceiveSyncEvent",function(O,M,N){if(A.props.syncId===O){if(N===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(M)}}),At(A,"handleBrushChange",function(O){var M=O.startIndex,N=O.endIndex;if(M!==A.state.dataStartIndex||N!==A.state.dataEndIndex){var F=A.state.updateId;A.setState(function(){return Te({dataStartIndex:M,dataEndIndex:N},g({props:A.props,dataStartIndex:M,dataEndIndex:N,updateId:F},A.state))}),A.triggerSyncEvent({dataStartIndex:M,dataEndIndex:N})}}),At(A,"handleMouseEnter",function(O){var M=A.getMouseInfo(O);if(M){var N=Te(Te({},M),{},{isTooltipActive:!0});A.setState(N),A.triggerSyncEvent(N);var F=A.props.onMouseEnter;Bt(F)&&F(N,O)}}),At(A,"triggeredAfterMouseMove",function(O){var M=A.getMouseInfo(O),N=M?Te(Te({},M),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(N),A.triggerSyncEvent(N);var F=A.props.onMouseMove;Bt(F)&&F(N,O)}),At(A,"handleItemMouseEnter",function(O){A.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),At(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),At(A,"handleMouseMove",function(O){O.persist(),A.throttleTriggeredAfterMouseMove(O)}),At(A,"handleMouseLeave",function(O){A.throttleTriggeredAfterMouseMove.cancel();var M={isTooltipActive:!1};A.setState(M),A.triggerSyncEvent(M);var N=A.props.onMouseLeave;Bt(N)&&N(M,O)}),At(A,"handleOuterEvent",function(O){var M=_ge(O),N=ga(A.props,"".concat(M));if(M&&Bt(N)){var F,R;/.*touch.*/i.test(M)?R=A.getMouseInfo(O.changedTouches[0]):R=A.getMouseInfo(O),N((F=R)!==null&&F!==void 0?F:{},O)}}),At(A,"handleClick",function(O){var M=A.getMouseInfo(O);if(M){var N=Te(Te({},M),{},{isTooltipActive:!0});A.setState(N),A.triggerSyncEvent(N);var F=A.props.onClick;Bt(F)&&F(N,O)}}),At(A,"handleMouseDown",function(O){var M=A.props.onMouseDown;if(Bt(M)){var N=A.getMouseInfo(O);M(N,O)}}),At(A,"handleMouseUp",function(O){var M=A.props.onMouseUp;if(Bt(M)){var N=A.getMouseInfo(O);M(N,O)}}),At(A,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),At(A,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseDown(O.changedTouches[0])}),At(A,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseUp(O.changedTouches[0])}),At(A,"handleDoubleClick",function(O){var M=A.props.onDoubleClick;if(Bt(M)){var N=A.getMouseInfo(O);M(N,O)}}),At(A,"handleContextMenu",function(O){var M=A.props.onContextMenu;if(Bt(M)){var N=A.getMouseInfo(O);M(N,O)}}),At(A,"triggerSyncEvent",function(O){A.props.syncId!==void 0&&dS.emit(hS,A.props.syncId,O,A.eventEmitterSymbol)}),At(A,"applySyncEvent",function(O){var M=A.props,N=M.layout,F=M.syncMethod,R=A.state.updateId,I=O.dataStartIndex,q=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)A.setState(Te({dataStartIndex:I,dataEndIndex:q},g({props:A.props,dataStartIndex:I,dataEndIndex:q,updateId:R},A.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,U=O.chartY,$=O.activeTooltipIndex,D=A.state,z=D.offset,H=D.tooltipTicks;if(!z)return;if(typeof F=="function")$=F(H,O);else if(F==="value"){$=-1;for(var Y=0;Y=0){var ke,ne;if(G.dataKey&&!G.allowDuplicatedCategory){var $e=typeof G.dataKey=="function"?se:"payload.".concat(G.dataKey.toString());ke=c1(Y,$e,$),ne=P&&W&&c1(W,$e,$)}else ke=Y==null?void 0:Y[U],ne=P&&W&&W[U];if(re||ie){var xe=O.props.activeIndex!==void 0?O.props.activeIndex:U;return[S.cloneElement(O,Te(Te(Te({},F.props),le),{},{activeIndex:xe})),null,null]}if(!Kt(ke))return[ee].concat($f(A.renderActivePoints({item:F,activePoint:ke,basePoint:ne,childIndex:U,isRange:P})))}else{var Ae,ze=(Ae=A.getItemByXY(A.state.activeCoordinate))!==null&&Ae!==void 0?Ae:{graphicalItem:ee},be=ze.graphicalItem,Ce=be.item,Ne=Ce===void 0?O:Ce,de=be.childIndex,He=Te(Te(Te({},F.props),le),{},{activeIndex:de});return[S.cloneElement(Ne,He),null,null]}return P?[ee,null,null]:[ee,null]}),At(A,"renderCustomized",function(O,M,N){return S.cloneElement(O,Te(Te({key:"recharts-customized-".concat(N)},A.props),A.state))}),At(A,"renderMap",{CartesianGrid:{handler:bg,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:bg},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:bg},YAxis:{handler:bg},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((j=x.id)!==null&&j!==void 0?j:ud("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=GU(A.triggeredAfterMouseMove,(T=x.throttleDelay)!==null&&T!==void 0?T:1e3/60),A.state={},A}return sje(_,k),ije(_,[{key:"componentDidMount",value:function(){var j,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,T=j.children,A=j.data,O=j.height,M=j.layout,N=qr(T,ha);if(N){var F=N.props.defaultIndex;if(!(typeof F!="number"||F<0||F>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[F]&&this.state.tooltipTicks[F].value,I=R6(this.state,A,F,R),q=this.state.tooltipTicks[F].coordinate,G=(this.state.offset.top+O)/2,U=M==="horizontal",$=U?{x:q,y:G}:{y:q,x:G},D=this.state.formattedGraphicalItems.find(function(H){var Y=H.item;return Y.type.name==="Scatter"});D&&($=Te(Te({},$),D.props.points[F].tooltipPosition),I=D.props.points[F].tooltipPayload);var z={activeTooltipIndex:F,isTooltipActive:!0,activeLabel:R,activePayload:I,activeCoordinate:$};this.setState(z),this.renderCursor(N),this.accessibilityManager.setIndex(F)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var A,O;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(j){y4([qr(j.children,ha)],[qr(this.props.children,ha)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=qr(this.props.children,ha);if(j&&typeof j.props.shared=="boolean"){var T=j.props.shared?"axis":"item";return l.indexOf(T)>=0?T:a}return a}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var T=this.container,A=T.getBoundingClientRect(),O=ube(A),M={chartX:Math.round(j.pageX-O.left),chartY:Math.round(j.pageY-O.top)},N=A.width/T.offsetWidth||1,F=this.inRange(M.chartX,M.chartY,N);if(!F)return null;var R=this.state,I=R.xAxisMap,q=R.yAxisMap,G=this.getTooltipEventType(),U=Z$(this.state,this.props.data,this.props.layout,F);if(G!=="axis"&&I&&q){var $=al(I).scale,D=al(q).scale,z=$&&$.invert?$.invert(M.chartX):null,H=D&&D.invert?D.invert(M.chartY):null;return Te(Te({},M),{},{xValue:z,yValue:H},U)}return U?Te(Te({},M),U):null}},{key:"inRange",value:function(j,T){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,M=j/A,N=T/A;if(O==="horizontal"||O==="vertical"){var F=this.state.offset,R=M>=F.left&&M<=F.left+F.width&&N>=F.top&&N<=F.top+F.height;return R?{x:M,y:N}:null}var I=this.state,q=I.angleAxisMap,G=I.radiusAxisMap;if(q&&G){var U=al(q);return pN({x:M,y:N},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,T=this.getTooltipEventType(),A=qr(j,ha),O={};A&&T==="axis"&&(A.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var M=f1(this.props,this.handleOuterEvent);return Te(Te({},M),O)}},{key:"addListener",value:function(){dS.on(hS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){dS.removeListener(hS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,T,A){for(var O=this.state.formattedGraphicalItems,M=0,N=O.length;M({root:{"--chart-text-color":t?fn(t,e):void 0,"--chart-grid-color":n?fn(n,e):void 0,"--chart-cursor-fill":i?fn(i,e):void 0,"--chart-bar-label-color":r?fn(r,e):void 0}});function Oje(e,t){let n=0,i=0;return e.map(r=>{if(r.standalone)for(const a in r)typeof r[a]=="number"&&a!==t&&(r[a]=[0,r[a]]);else for(const a in r)typeof r[a]=="number"&&a!==t&&(i+=r[a],r[a]=[n,i],n=i);return r})}function Tje(e,t){return typeof e=="function"?e(t).fill:e==null?void 0:e.fill}const fl=De(e=>{const t=we("BarChart",Aje,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,data:u,withLegend:f,legendProps:h,series:d,onMouseLeave:p,dataKey:g,withTooltip:b,withXAxis:w,withYAxis:k,gridAxis:_,tickLine:x,xAxisProps:j,yAxisProps:T,unit:A,tooltipAnimationDuration:O,strokeDasharray:M,gridProps:N,tooltipProps:F,referenceLines:R,fillOpacity:I,barChartProps:q,type:G,orientation:U,dir:$,valueFormatter:D,children:z,barProps:H,xAxisLabel:Y,yAxisLabel:P,withBarValueLabel:W,valueLabelProps:V,withRightYAxis:L,rightYAxisLabel:Z,rightYAxisProps:ie,minBarSize:re,maxBarWidth:X,mod:le,getBarColor:ee,gridColor:se,textColor:ke,attributes:ne,...$e}=t,xe=ci(),Ae=_!=="none"&&(x==="x"||x==="xy"),ze=_!=="none"&&(x==="y"||x==="xy"),[be,Ce]=S.useState(null),Ne=be!==null,de=G==="stacked"||G==="percent",He=G==="percent"?jje:D,Ye=je=>{Ce(null),p==null||p(je)},{resolvedClassNames:We,resolvedStyles:Qe}=Wi({classNames:n,styles:a,props:t}),Je=G==="waterfall"?Oje(u,g):u,oe=Ze({name:"BarChart",classes:M0,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:ne,vars:l,varsResolver:iG}),ye=d.map(je=>{const rt=fn(je.color,xe),pt=Ne&&be!==je.name,Dt=typeof H=="function"?H(je):H,yt=Dt==null?void 0:Dt.shape;return S.createElement(Yu,{...oe("bar"),key:je.name,name:je.name,dataKey:je.name,fill:rt,stroke:rt,isAnimationActive:!1,fillOpacity:pt?.1:I,strokeOpacity:pt?.2:0,stackId:de?"stack":je.stackId||void 0,yAxisId:je.yAxisId||void 0,minPointSize:re,...Dt,shape:ot=>{const tt=ot.payload,Nt=tt!=null&&tt.color?fn(tt.color,xe):typeof ee=="function"?fn(ee(tt==null?void 0:tt[je.name],je),xe):Tje(H,je)||rt,Re={...ot,fill:Nt};return typeof yt=="function"?yt(Re):J.isValidElement(yt)?J.cloneElement(yt,Re):typeof yt=="object"&&yt?v.jsx(Fm,{...Re,...yt}):v.jsx(Fm,{...Re})}},W&&v.jsx(co,{position:U==="vertical"?"right":"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:ot=>He==null?void 0:He(ot),...typeof V=="function"?V(je):V}))}),Ke=R==null?void 0:R.map((je,rt)=>{const pt=fn(je.color,xe);return v.jsx(Dp,{stroke:je.color?pt:"var(--chart-grid-color)",strokeWidth:1,yAxisId:je.yAxisId||void 0,...je,label:{fill:je.color?pt:"currentColor",fontSize:12,position:je.labelPosition??"insideBottomLeft",...typeof je.label=="object"?je.label:{value:je.label}},...oe("referenceLine")},rt)}),et={axisLine:!1,...U==="vertical"?{dataKey:g,type:"category"}:{type:"number"},tickLine:ze?{stroke:"currentColor"}:!1,allowDecimals:!0,unit:A,tickFormatter:U==="vertical"?void 0:He,...oe("axis")};return v.jsx(fe,{...oe("root"),onMouseLeave:Ye,dir:$||"ltr",mod:[{orientation:U},le],...$e,children:v.jsx(vj,{...oe("container"),children:v.jsxs(Sje,{data:Je,stackOffset:G==="percent"?"expand":void 0,layout:U,maxBarSize:X,margin:{bottom:Y?30:void 0,left:P?10:void 0,right:P?5:void 0},...q,children:[f&&v.jsx(as,{verticalAlign:"top",content:je=>v.jsx(E0,{payload:je.payload,onHighlight:Ce,legendPosition:(h==null?void 0:h.verticalAlign)||"top",classNames:We,styles:Qe,series:d,showColor:G!=="waterfall",attributes:ne}),...h}),v.jsxs($l,{hide:!w,...U==="vertical"?{type:"number"}:{dataKey:g},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:Ae?{stroke:"currentColor"}:!1,minTickGap:5,tickFormatter:U==="vertical"?He:void 0,...oe("axis"),...j,children:[Y&&v.jsx(ai,{position:"insideBottom",offset:-20,fontSize:12,...oe("axisLabel"),children:Y}),j==null?void 0:j.children]}),v.jsxs(ko,{orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!k,...et,...T,children:[P&&v.jsx(ai,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...oe("axisLabel"),children:P}),T==null?void 0:T.children]}),v.jsxs(ko,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!L,...et,...ie,children:[Z&&v.jsx(ai,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...oe("axisLabel"),children:Z}),T==null?void 0:T.children]}),v.jsx(sb,{strokeDasharray:M,vertical:_==="y"||_==="xy",horizontal:_==="x"||_==="xy",...oe("grid"),...N}),b&&v.jsx(ha,{animationDuration:O,isAnimationActive:O!==0,position:U==="vertical"?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:M,fill:"var(--chart-cursor-fill)"},content:({label:je,payload:rt,labelFormatter:pt})=>v.jsx(G9,{label:pt&&rt?pt(je,rt):je,payload:rt,type:G==="waterfall"?"scatter":void 0,unit:A,classNames:We,styles:Qe,series:d,valueFormatter:D,attributes:ne}),...F}),ye,Ke,z]})})})});fl.displayName="@mantine/charts/BarChart";fl.classes=M0;fl.varsResolver=iG;const Eje={withXAxis:!0,withYAxis:!0,withTooltip:!0,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:!0,connectNulls:!0,strokeWidth:2,curveType:"monotone",gradientStops:[{offset:0,color:"red"},{offset:100,color:"blue"}]},rG=(e,{textColor:t,gridColor:n})=>({root:{"--chart-text-color":t?fn(t,e):void 0,"--chart-grid-color":n?fn(n,e):void 0}}),ub=De(e=>{const t=we("LineChart",Eje,e),{classNames:n,className:i,style:r,styles:a,unstyled:o,vars:l,data:u,withLegend:f,legendProps:h,series:d,onMouseLeave:p,dataKey:g,withTooltip:b,withXAxis:w,withYAxis:k,gridAxis:_,tickLine:x,xAxisProps:j,yAxisProps:T,unit:A,tooltipAnimationDuration:O,strokeDasharray:M,gridProps:N,tooltipProps:F,referenceLines:R,withDots:I,dotProps:q,activeDotProps:G,strokeWidth:U,lineChartProps:$,connectNulls:D,fillOpacity:z,curveType:H,orientation:Y,dir:P,valueFormatter:W,children:V,lineProps:L,xAxisLabel:Z,yAxisLabel:ie,type:re,gradientStops:X,withRightYAxis:le,rightYAxisLabel:ee,rightYAxisProps:se,withPointLabels:ke,attributes:ne,gridColor:$e,...xe}=t,Ae=ci(),ze=_!=="none"&&(x==="x"||x==="xy"),be=_!=="none"&&(x==="y"||x==="xy"),[Ce,Ne]=S.useState(null),de=Ce!==null,He=je=>{Ne(null),p==null||p(je)},{resolvedClassNames:Ye,resolvedStyles:We}=Wi({classNames:n,styles:a,props:t}),Qe=Ze({name:"LineChart",classes:M0,props:t,className:i,style:r,classNames:n,styles:a,unstyled:o,attributes:ne,vars:l,varsResolver:rG}),Je=`line-chart-gradient-${Vi()}`,oe=X==null?void 0:X.map(je=>v.jsx("stop",{offset:`${je.offset}%`,stopColor:fn(je.color,Ae)},je.color)),ye=d.map(je=>{const rt=fn(je.color,Ae),pt=de&&Ce!==je.name;return S.createElement(Rp,{...Qe("line"),key:je.name,name:je.name,dataKey:je.name,dot:I?{fillOpacity:pt?0:1,strokeOpacity:pt?0:1,strokeWidth:1,fill:re==="gradient"?"var(--mantine-color-gray-7)":rt,stroke:re==="gradient"?"white":rt,...q}:!1,activeDot:I?{fill:re==="gradient"?"var(--mantine-color-gray-7)":rt,stroke:re==="gradient"?"white":rt,...G}:!1,fill:rt,stroke:re==="gradient"?`url(#${Je})`:rt,strokeWidth:U,isAnimationActive:!1,fillOpacity:pt?0:z,strokeOpacity:pt?.5:z,connectNulls:D,type:je.curveType??H,strokeDasharray:je.strokeDasharray,yAxisId:je.yAxisId||void 0,label:ke?v.jsx(_ve,{valueFormatter:W}):void 0,...typeof L=="function"?L(je):L})}),Ke=R==null?void 0:R.map((je,rt)=>{const pt=fn(je.color,Ae);return v.jsx(Dp,{stroke:je.color?pt:"var(--chart-grid-color)",strokeWidth:1,yAxisId:je.yAxisId||void 0,...je,label:{fill:je.color?pt:"currentColor",fontSize:12,position:je.labelPosition??"insideBottomLeft",...typeof je.label=="object"?je.label:{value:je.label}},...Qe("referenceLine")},rt)}),et={axisLine:!1,...Y==="vertical"?{dataKey:g,type:"category"}:{type:"number"},tickLine:be?{stroke:"currentColor"}:!1,allowDecimals:!0,unit:A,tickFormatter:Y==="vertical"?void 0:W,...Qe("axis")};return v.jsx(fe,{...Qe("root"),onMouseLeave:He,dir:P||"ltr",...xe,children:v.jsx(vj,{...Qe("container"),children:v.jsxs(xje,{data:u,layout:Y,margin:{bottom:Z?30:void 0,left:ie?10:void 0,right:ie?5:void 0},...$,children:[re==="gradient"&&v.jsx("defs",{children:v.jsx("linearGradient",{id:Je,x1:"0",y1:"0",x2:"0",y2:"1",children:oe})}),f&&v.jsx(as,{verticalAlign:"top",content:je=>v.jsx(E0,{payload:je.payload,onHighlight:Ne,legendPosition:(h==null?void 0:h.verticalAlign)||"top",classNames:Ye,styles:We,series:d,showColor:re!=="gradient",attributes:ne}),...h}),v.jsxs($l,{hide:!w,...Y==="vertical"?{type:"number"}:{dataKey:g},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:ze?{stroke:"currentColor"}:!1,minTickGap:5,tickFormatter:Y==="vertical"?W:void 0,...Qe("axis"),...j,children:[Z&&v.jsx(ai,{position:"insideBottom",offset:-20,fontSize:12,...Qe("axisLabel"),children:Z}),j==null?void 0:j.children]}),v.jsxs(ko,{tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!k,...et,...T,children:[ie&&v.jsx(ai,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...Qe("axisLabel"),children:ie}),T==null?void 0:T.children]}),v.jsxs(ko,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!le,...et,...se,children:[ee&&v.jsx(ai,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...Qe("axisLabel"),children:ee}),T==null?void 0:T.children]}),v.jsx(sb,{strokeDasharray:M,vertical:_==="y"||_==="xy",horizontal:_==="x"||_==="xy",...Qe("grid"),...N}),b&&v.jsx(ha,{animationDuration:O,isAnimationActive:O!==0,position:Y==="vertical"?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:M},content:({label:je,payload:rt,labelFormatter:pt})=>v.jsx(G9,{label:pt&&rt?pt(je,rt):je,payload:rt,unit:A,classNames:Ye,styles:We,series:d,valueFormatter:W,showColor:re!=="gradient",attributes:ne}),...F}),ye,Ke,V]})})})});ub.displayName="@mantine/charts/LineChart";ub.classes=M0;ub.varsResolver=rG;const ez="daily_report_prompt",pS="Eres un coach de equipo. Resume el reporte diario en un MAXIMO de 4 frases cortas, mencionando: (1) total de tareas hechas y quien destaco, (2) cualquier card reabierta o deadline vencido que merezca atencion, (3) cards estancadas criticas (30+ dias) si las hay, (4) una frase corta de animo o aviso si toca. Tono natural, primera persona del plural, sin emojis. No inventes datos; usa solo los del JSON del reporte.";function Mje(e){try{return new Date(e+"T00:00:00").toLocaleDateString("es-ES",{weekday:"long",day:"2-digit",month:"long",year:"numeric"})}catch{return e}}function Hc({label:e,value:t,color:n,icon:i,sub:r}){return v.jsxs(Tn,{p:"sm",withBorder:!0,radius:"md",children:[v.jsxs(Pe,{gap:6,mb:2,align:"center",children:[i,v.jsx(ge,{size:"xs",c:"dimmed",tt:"uppercase",fw:600,children:e})]}),v.jsx(ge,{fz:28,fw:700,c:n,children:t}),r&&v.jsx(ge,{size:"xs",c:"dimmed",children:r})]})}function wg({title:e,rows:t,emptyText:n,withAvatar:i=!1}){return v.jsxs(Ia,{withBorder:!0,radius:"md",p:"sm",children:[v.jsx(ge,{fw:600,size:"sm",mb:6,children:e}),t.length===0?v.jsx(ge,{size:"xs",c:"dimmed",children:n}):v.jsx(Ot,{gap:4,children:t.map((r,a)=>v.jsxs(Pe,{gap:6,wrap:"nowrap",justify:"space-between",children:[v.jsxs(Pe,{gap:6,wrap:"nowrap",style:{minWidth:0,flex:1},children:[i&&v.jsx(vo,{size:22,radius:"xl",color:ju(r.name||String(a)),children:(r.name||"?").slice(0,2).toUpperCase()}),v.jsx(ge,{size:"sm",truncate:!0,children:r.name||"(sin nombre)"})]}),v.jsx(ln,{size:"sm",variant:"light",color:a===0?"teal":"gray",children:r.count})]},(r.user_id||r.name)+a))})]})}function Dje({date:e,onJumpToCard:t}){const[n,i]=S.useState(null),[r,a]=S.useState(null),[o,l]=S.useState(null),[u,f]=S.useState(!1),[h,d]=S.useState(null),[p,g]=S.useState(!1),[b,w]=S.useState(""),[k,_]=S.useState(null),[x,j]=S.useState(null);S.useEffect(()=>{i(null),a(null),ure(e).then(i).catch($=>a($.message)),l(null),d(null),cre(e).then($=>l($.exists?$:null)).catch(()=>{})},[e]);const T=async()=>{f(!0),d(null);try{const $=await fre(e);l({...$,exists:!0})}catch($){d($.message)}finally{f(!1)}},A=async()=>{try{const $=await dre(ez);w($.value||pS)}catch{w(pS)}g(!0)},O=async()=>{await hre(ez,b),g(!1)},M=()=>w(pS),N=S.useMemo(()=>n?n.hourly_moves.map(($,D)=>({hora:String(D).padStart(2,"0")+":00",movimientos:$})):[],[n]),F=S.useMemo(()=>{if(!n)return[];const $=new Set;for(const D of n.done_cards)D.requester&&$.add(D.requester);return Array.from($).sort()},[n]),R=S.useMemo(()=>{if(!n)return[];const $=new Map;for(const D of n.done_cards)D.assignee_id&&$.set(D.assignee_id,D.assignee_name||D.assignee_id);return Array.from($.entries()).map(([D,z])=>({value:D,label:z}))},[n]),I=S.useMemo(()=>n?n.done_cards.filter($=>!(k&&$.requester!==k||x&&$.assignee_id!==x)):[],[n,k,x]),q=()=>{if(!n)return;const $=window.open("","_blank");if(!$)return;const D=window.location.origin,z=(()=>{try{return new Date(n.date+"T00:00:00").toLocaleDateString("es-ES",{weekday:"long",day:"2-digit",month:"long",year:"numeric"})}catch{return n.date}})(),H=[];if(k&&H.push(`solicitante=${k}`),x){const V=R.find(L=>L.value===x);H.push(`asignado=${(V==null?void 0:V.label)||x}`)}const Y=V=>V.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),P=I.map(V=>{const L=(V.tags||[]).map(Y).join(", "),Z=`${D}/?card=${V.id}`;return` + ${String(V.seq_num).padStart(5,"0")} + ${Y(V.title)} + ${Y(V.requester||"")} + ${Y(V.assignee_name||"")} + ${Y(L)} + ${ei(V.lead_time_ms)} + `}).join(""),W=` + +Reporte ${n.date} + +

Reporte diario · ${Y(z)}

+
${Y(n.date)} · ${Y(n.tz)}${H.length?" · filtros: "+H.map(Y).join(", "):""}
+
+
Hechas
${I.length}
+
Lead time avg
${ei(n.lead_time.avg_ms)}
+
Deadlines on-time
${n.deadlines.met}/${n.deadlines.met+n.deadlines.missed}
+
Reabiertas
${n.kpis.reopened}
+
+${o!=null&&o.summary?`

${Y(o.summary)}

`:""} + + + + + + + + + + ${P||''} +
#TituloSolicitanteAsignadoTagsLead time
Sin tareas que cumplan el filtro.
+
Generado por kanban · ${Y(D)}
+ + diff --git a/backend/events.go b/backend/events.go new file mode 100644 index 0000000..e34cafe --- /dev/null +++ b/backend/events.go @@ -0,0 +1,158 @@ +package main + +import ( + "encoding/json" + "sync" + "sync/atomic" + "time" +) + +// EventHub is an in-process pub/sub used to push board mutations and +// notifications to connected clients (SSE for board-wide events, WS for +// per-card chat). Drop policy on slow consumers: best-effort send; if a +// subscriber's buffered channel is full the event is dropped and the +// hub increments dropCount. Clients are expected to reconcile state via +// a full reload when reconnecting. +type EventHub struct { + mu sync.RWMutex + userSubs map[string]map[chan Event]struct{} + cardSubs map[string]map[chan Event]struct{} + dropCount uint64 +} + +// Event is the envelope broadcast to subscribers. +// +// Type — discriminator (e.g. "card.updated", "message.created"). +// CardID — set when payload pertains to a specific card. +// UserID — set for per-user private events (e.g. notifications). Empty +// means broadcast to every user subscriber. +// Payload — arbitrary JSON describing the change. +// TS — RFC3339 timestamp. +type Event struct { + Type string `json:"type"` + CardID string `json:"card_id,omitempty"` + UserID string `json:"user_id,omitempty"` + Payload json.RawMessage `json:"payload,omitempty"` + TS string `json:"ts"` +} + +const eventBufSize = 64 + +func NewEventHub() *EventHub { + return &EventHub{ + userSubs: map[string]map[chan Event]struct{}{}, + cardSubs: map[string]map[chan Event]struct{}{}, + } +} + +// SubscribeUser returns a channel that receives every public event plus +// private events targeted at userID. Caller MUST eventually call +// UnsubscribeUser to release resources. +func (h *EventHub) SubscribeUser(userID string) chan Event { + ch := make(chan Event, eventBufSize) + h.mu.Lock() + set, ok := h.userSubs[userID] + if !ok { + set = map[chan Event]struct{}{} + h.userSubs[userID] = set + } + set[ch] = struct{}{} + h.mu.Unlock() + return ch +} + +func (h *EventHub) UnsubscribeUser(userID string, ch chan Event) { + h.mu.Lock() + if set, ok := h.userSubs[userID]; ok { + delete(set, ch) + if len(set) == 0 { + delete(h.userSubs, userID) + } + } + h.mu.Unlock() + close(ch) +} + +// SubscribeCard returns a channel that receives events scoped to cardID +// (chat messages + typing indicators). +func (h *EventHub) SubscribeCard(cardID string) chan Event { + ch := make(chan Event, eventBufSize) + h.mu.Lock() + set, ok := h.cardSubs[cardID] + if !ok { + set = map[chan Event]struct{}{} + h.cardSubs[cardID] = set + } + set[ch] = struct{}{} + h.mu.Unlock() + return ch +} + +func (h *EventHub) UnsubscribeCard(cardID string, ch chan Event) { + h.mu.Lock() + if set, ok := h.cardSubs[cardID]; ok { + delete(set, ch) + if len(set) == 0 { + delete(h.cardSubs, cardID) + } + } + h.mu.Unlock() + close(ch) +} + +// Publish delivers ev to every matching subscriber. If ev.UserID is set +// it is delivered ONLY to that user's subscribers; otherwise it fans out +// to all user subscribers. Card subscribers ALWAYS receive events that +// match ev.CardID. Best-effort: full channels are skipped. +func (h *EventHub) Publish(ev Event) { + if ev.TS == "" { + ev.TS = time.Now().UTC().Format(time.RFC3339) + } + h.mu.RLock() + defer h.mu.RUnlock() + + deliver := func(ch chan Event) { + select { + case ch <- ev: + default: + atomic.AddUint64(&h.dropCount, 1) + } + } + + if ev.UserID != "" { + if set, ok := h.userSubs[ev.UserID]; ok { + for ch := range set { + deliver(ch) + } + } + } else { + for _, set := range h.userSubs { + for ch := range set { + deliver(ch) + } + } + } + if ev.CardID != "" { + if set, ok := h.cardSubs[ev.CardID]; ok { + for ch := range set { + deliver(ch) + } + } + } +} + +func (h *EventHub) DropCount() uint64 { + return atomic.LoadUint64(&h.dropCount) +} + +// PublishJSON marshals payload and publishes a single Event. +func (h *EventHub) PublishJSON(typ, cardID, userID string, payload interface{}) { + var raw json.RawMessage + if payload != nil { + b, err := json.Marshal(payload) + if err == nil { + raw = b + } + } + h.Publish(Event{Type: typ, CardID: cardID, UserID: userID, Payload: raw}) +} diff --git a/backend/events_test.go b/backend/events_test.go new file mode 100644 index 0000000..eb0ca99 --- /dev/null +++ b/backend/events_test.go @@ -0,0 +1,146 @@ +package main + +import ( + "sync" + "sync/atomic" + "testing" + "time" +) + +func TestEventHub_BroadcastToAllUsers(t *testing.T) { + hub := NewEventHub() + chA := hub.SubscribeUser("alice") + chB := hub.SubscribeUser("bob") + defer hub.UnsubscribeUser("alice", chA) + defer hub.UnsubscribeUser("bob", chB) + + hub.PublishJSON("card.updated", "c1", "", map[string]string{"id": "c1"}) + + for _, ch := range []chan Event{chA, chB} { + select { + case ev := <-ch: + if ev.Type != "card.updated" { + t.Fatalf("type = %q, want card.updated", ev.Type) + } + case <-time.After(time.Second): + t.Fatal("timeout waiting for event") + } + } +} + +func TestEventHub_PrivateUserEvent(t *testing.T) { + hub := NewEventHub() + chA := hub.SubscribeUser("alice") + chB := hub.SubscribeUser("bob") + defer hub.UnsubscribeUser("alice", chA) + defer hub.UnsubscribeUser("bob", chB) + + hub.PublishJSON("notification.created", "", "alice", map[string]string{"foo": "bar"}) + + select { + case ev := <-chA: + if ev.UserID != "alice" { + t.Fatalf("user_id = %q, want alice", ev.UserID) + } + case <-time.After(time.Second): + t.Fatal("alice did not get private event") + } + + select { + case ev := <-chB: + t.Fatalf("bob received private event for alice: %+v", ev) + case <-time.After(100 * time.Millisecond): + // expected + } +} + +func TestEventHub_CardSubscription(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeCard("card-1") + defer hub.UnsubscribeCard("card-1", ch) + + hub.PublishJSON("message.created", "card-1", "", map[string]string{"id": "m1"}) + hub.PublishJSON("message.created", "card-2", "", map[string]string{"id": "m2"}) + + select { + case ev := <-ch: + if ev.CardID != "card-1" { + t.Fatalf("card_id = %q, want card-1", ev.CardID) + } + case <-time.After(time.Second): + t.Fatal("timeout") + } + select { + case ev := <-ch: + t.Fatalf("received unexpected event for other card: %+v", ev) + case <-time.After(100 * time.Millisecond): + } +} + +func TestEventHub_DropPolicyOnSlowConsumer(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("slow") + defer hub.UnsubscribeUser("slow", ch) + + // Fill the buffer + N extra to force drops. + const extra = 50 + for i := 0; i < eventBufSize+extra; i++ { + hub.PublishJSON("noise", "", "slow", nil) + } + if got := hub.DropCount(); got < extra { + t.Fatalf("DropCount = %d, want >= %d", got, extra) + } +} + +func TestEventHub_UnsubscribeRemoves(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("alice") + hub.UnsubscribeUser("alice", ch) + // channel must be closed + select { + case _, ok := <-ch: + if ok { + t.Fatal("expected closed channel") + } + default: + // channel could be drained-and-closed + } + // Publish should not panic and should not deliver anywhere. + hub.PublishJSON("noise", "", "alice", nil) +} + +func TestEventHub_ConcurrentPublishers(t *testing.T) { + hub := NewEventHub() + ch := hub.SubscribeUser("u") + defer hub.UnsubscribeUser("u", ch) + + var received atomic.Uint64 + done := make(chan struct{}) + go func() { + for range ch { + received.Add(1) + } + close(done) + }() + + var wg sync.WaitGroup + const writers = 10 + const each = 100 + for i := 0; i < writers; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for j := 0; j < each; j++ { + hub.PublishJSON("ping", "", "u", nil) + } + }() + } + wg.Wait() + // Give the consumer time to drain. + time.Sleep(200 * time.Millisecond) + got := received.Load() + dropped := hub.DropCount() + if got+dropped < writers*each { + t.Fatalf("received=%d drop=%d want sum >= %d", got, dropped, writers*each) + } +} diff --git a/backend/go.mod b/backend/go.mod index 9df7726..c43d13b 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -2,20 +2,31 @@ module kanban go 1.25.0 -require fn-registry v0.0.0-00010101000000-000000000000 +require ( + fn-registry v0.0.0-00010101000000-000000000000 + github.com/mattn/go-sqlite3 v1.14.44 + golang.org/x/crypto v0.51.0 + nhooyr.io/websocket v1.8.17 +) require ( + filippo.io/edwards25519 v1.2.0 // indirect github.com/ClickHouse/ch-go v0.71.0 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.44.0 // indirect github.com/andybalholm/brotli v1.2.0 // indirect github.com/apache/arrow-go/v18 v18.1.0 // indirect + github.com/aymerick/douceur v0.2.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/danieljoos/wincred v1.2.3 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-faster/city v1.0.1 // indirect github.com/go-faster/errors v0.7.1 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/goccy/go-json v0.10.5 // indirect + github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/google/flatbuffers v25.1.24+incompatible // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/css v1.0.1 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/pgx/v5 v5.9.1 // indirect @@ -23,27 +34,38 @@ require ( github.com/klauspost/compress v1.18.3 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/marcboeker/go-duckdb v1.8.5 // indirect - github.com/mattn/go-sqlite3 v1.14.37 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/paulmach/orb v0.12.0 // indirect + github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81 // indirect github.com/pierrec/lz4/v4 v4.1.25 // indirect + github.com/rs/zerolog v1.35.1 // indirect github.com/segmentio/asm v1.2.1 // indirect github.com/shopspring/decimal v1.4.0 // indirect + github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect + github.com/tidwall/gjson v1.19.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tidwall/sjson v1.2.5 // indirect + github.com/yuin/goldmark v1.8.2 // indirect + github.com/zalando/go-keyring v0.2.8 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect + go.mau.fi/util v0.9.9 // indirect go.opentelemetry.io/otel v1.41.0 // indirect go.opentelemetry.io/otel/trace v1.41.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.50.0 // indirect - golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/net v0.53.0 // indirect + golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a // indirect + golang.org/x/mod v0.36.0 // indirect + golang.org/x/net v0.54.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.43.0 // indirect - golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c // indirect - golang.org/x/text v0.36.0 // indirect - golang.org/x/tools v0.43.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/tools v0.45.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - nhooyr.io/websocket v1.8.17 // indirect + maunium.net/go/mautrix v0.28.0 // indirect ) replace fn-registry => ../../.. diff --git a/backend/go.sum b/backend/go.sum index 6cc7880..3f96295 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -1,18 +1,28 @@ +filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= +filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= github.com/ClickHouse/ch-go v0.71.0 h1:bUdZ/EZj/LcVHsMqaRUP2holqygrPWQKeMjc6nZoyRM= github.com/ClickHouse/ch-go v0.71.0/go.mod h1:NwbNc+7jaqfY58dmdDUbG4Jl22vThgx1cYjBw0vtgXw= github.com/ClickHouse/clickhouse-go/v2 v2.44.0 h1:9pxs5pRwIvhni5BDRPn/n5A8DeUod5TnBaeulFBX8EQ= github.com/ClickHouse/clickhouse-go/v2 v2.44.0/go.mod h1:giJfUVlMkcfUEPVfRpt51zZaGEx9i17gCos8gBl392c= +github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= +github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ= github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/apache/arrow-go/v18 v18.1.0 h1:agLwJUiVuwXZdwPYVrlITfx7bndULJ/dggbnLFgDp/Y= github.com/apache/arrow-go/v18 v18.1.0/go.mod h1:tigU/sIgKNXaesf5d7Y95jBBKS5KsxTqYBKXFsvKzo0= github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE= github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= +github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw= github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw= github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg= @@ -21,6 +31,8 @@ github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIx github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ= +github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -34,6 +46,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= +github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= @@ -60,8 +74,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/marcboeker/go-duckdb v1.8.5 h1:tkYp+TANippy0DaIOP5OEfBEwbUINqiFqgwMQ44jME0= github.com/marcboeker/go-duckdb v1.8.5/go.mod h1:6mK7+WQE4P4u5AFLvVBmhFxY5fvhymFptghgJX6B+/8= -github.com/mattn/go-sqlite3 v1.14.37 h1:3DOZp4cXis1cUIpCfXLtmlGolNLp2VEqhiB/PARNBIg= -github.com/mattn/go-sqlite3 v1.14.37/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.44 h1:3VSe+xafpbzsLbdr2AWlAZk9yRHiBhTBakioXaCKTF8= +github.com/mattn/go-sqlite3 v1.14.44/go.mod h1:pjEuOr8IwzLJP2MfGeTb0A35jauH+C2kbHKBr7yXKVQ= +github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= +github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= @@ -70,6 +90,8 @@ github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJ github.com/paulmach/orb v0.12.0 h1:z+zOwjmG3MyEEqzv92UN49Lg1JFYx0L9GpGKNVDKk1s= github.com/paulmach/orb v0.12.0/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU= github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= +github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81 h1:WDsQxOJDy0N1VRAjXLpi8sCEZRSGarLWQevDxpTBRrM= +github.com/petermattis/goid v0.0.0-20260330135022-df67b199bc81/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4/v4 v4.1.25 h1:kocOqRffaIbU5djlIBr7Wh+cx82C0vtFb0fOurZHqD0= github.com/pierrec/lz4/v4 v4.1.25/go.mod h1:EoQMVJgeeEOMsCqCzqFm2O0cJvljX2nGZjcRIPL34O4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -77,17 +99,33 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI= +github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= +github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.19.0 h1:xwxm7n691Uf3u5OFjzngavjGTh55KX5q/9w9xHW88JU= +github.com/tidwall/gjson v1.19.0/go.mod h1:V37/opeE/JbLUOfH0QTXiNez2l0RUjYUhpT4szFQAfc= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= @@ -96,10 +134,16 @@ github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3i github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= +github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/zalando/go-keyring v0.2.8 h1:6sD/Ucpl7jNq10rM2pgqTs0sZ9V3qMrqfIIy5YPccHs= +github.com/zalando/go-keyring v0.2.8/go.mod h1:tsMo+VpRq5NGyKfxoBVjCuMrG47yj8cmakZDO5QGii0= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.mau.fi/util v0.9.9 h1:ujDeXCo07HBor5oQLyO1tHklupmqVmPgasc53d7q/NE= +go.mau.fi/util v0.9.9/go.mod h1:pqt4Vcrt+5gcH/CgrHZg11qSx+b34o6mknGzOEA6waY= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= @@ -111,21 +155,21 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= -golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= -golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= -golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a h1:+3jdDGGB8NGb1Zktc737jlt3/A5f6UlwSzmvqUuufxw= +golang.org/x/exp v0.0.0-20260508232706-74f9aab9d74a/go.mod h1:d2fgXJLVs4dYDHUk5lwMIfzRzSrWCfGZb0ZqeLa/Vcw= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= +golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= -golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -138,23 +182,24 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= -golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c h1:6a8FdnNk6bTXBjR4AGKFgUKuo+7GnR3FX5L7CbveeZc= -golang.org/x/telemetry v0.0.0-20260311193753-579e4da9a98c/go.mod h1:TpUTTEp9frx7rTdLpC9gFG9kdI7zVLFTFFlqaH2Cncw= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 h1:HjU6IWBiAgRIdAJ9/y1rwCn+UELEmwV+VsTLzj/W4sE= +golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6/go.mod h1:Eqhaxk/wZsWEH8CRxLwj6xzEJbz7k1EFGqx7nyCoabE= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= +golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -172,5 +217,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +maunium.net/go/mautrix v0.28.0 h1:vBakLzf8MAdfED3NzAKiMeKQbc3AQ4EAS03NC+TVMXQ= +maunium.net/go/mautrix v0.28.0/go.mod h1:/a9A7LGaqb9B3nho4tLd28n0EPcCdwpm2dxkxkLLgh0= nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y= nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/backend/handlers.go b/backend/handlers.go index 34db7f8..ecc59c4 100644 --- a/backend/handlers.go +++ b/backend/handlers.go @@ -74,8 +74,21 @@ func handleGetBoard(db *DB) http.HandlerFunc { } } +// publishInvalidated emits a board.invalidated event so connected clients +// refetch /api/board. Best-effort: dropped events recover on next mutation +// or via the periodic safety reload kept in the SPA. +func publishInvalidated(hub *EventHub, cardID, columnID string) { + if hub == nil { + return + } + hub.PublishJSON("board.invalidated", cardID, "", map[string]string{ + "card_id": cardID, + "column_id": columnID, + }) +} + // POST /api/columns { name } -func handleCreateColumn(db *DB) http.HandlerFunc { +func handleCreateColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct{ Name string `json:"name"` } if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { @@ -91,12 +104,13 @@ func handleCreateColumn(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", c.ID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } // PATCH /api/columns/{id} { name?, position?, location?, width? } -func handleUpdateColumn(db *DB) http.HandlerFunc { +func handleUpdateColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -116,24 +130,26 @@ func handleUpdateColumn(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", id) w.WriteHeader(http.StatusNoContent) } } // DELETE /api/columns/{id} -func handleDeleteColumn(db *DB) http.HandlerFunc { +func handleDeleteColumn(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.DeleteColumn(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, "", id) w.WriteHeader(http.StatusNoContent) } } // POST /api/columns/reorder { ids: [...] } -func handleReorderColumns(db *DB) http.HandlerFunc { +func handleReorderColumns(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct{ IDs []string `json:"ids"` } if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { @@ -144,12 +160,13 @@ func handleReorderColumns(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, "", "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards { column_id, requester?, title, description? } -func handleCreateCard(db *DB) http.HandlerFunc { +func handleCreateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var body struct { ColumnID string `json:"column_id"` @@ -186,12 +203,13 @@ func handleCreateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, c.ID, body.ColumnID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } // PATCH /api/cards/{id} { requester?, title?, description?, color? } -func handleUpdateCard(db *DB) http.HandlerFunc { +func handleUpdateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var raw map[string]any @@ -249,12 +267,13 @@ func handleUpdateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // PUT /api/cards/{id}/stickers { stickers: [{emoji,x,y}, ...] } -func handleUpdateCardStickers(db *DB) http.HandlerFunc { +func handleUpdateCardStickers(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -268,12 +287,13 @@ func handleUpdateCardStickers(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // DELETE /api/cards/{id} -func handleDeleteCard(db *DB) http.HandlerFunc { +func handleDeleteCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -281,12 +301,13 @@ func handleDeleteCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/move { column_id, ordered_ids } -func handleMoveCard(db *DB) http.HandlerFunc { +func handleMoveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -310,6 +331,7 @@ func handleMoveCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, body.ColumnID) w.WriteHeader(http.StatusNoContent) } } @@ -328,7 +350,10 @@ func handleListCardMessages(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/messages { body } -func handleCreateCardMessage(db *DB) http.HandlerFunc { +// +// Parses @mentions, fans out notifications and publishes message.created via +// the hub so SSE/WS subscribers see the message immediately. +func handleCreateCardMessage(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") var body struct { @@ -347,7 +372,7 @@ func handleCreateCardMessage(db *DB) http.HandlerFunc { infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) return } - m, err := db.CreateCardMessage(id, actor, body.Body) + m, _, _, err := db.CreateCardMessageAndNotify(id, actor, body.Body, hub) if err != nil { if strings.Contains(err.Error(), "not found") { notFound(w, err.Error()) @@ -361,8 +386,9 @@ func handleCreateCardMessage(db *DB) http.HandlerFunc { } // DELETE /api/cards/{cid}/messages/{mid} -func handleDeleteCardMessage(db *DB) http.HandlerFunc { +func handleDeleteCardMessage(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + cid := r.PathValue("id") mid := r.PathValue("mid") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) if actor == "" { @@ -377,12 +403,15 @@ func handleDeleteCardMessage(db *DB) http.HandlerFunc { serverError(w, err) return } + if hub != nil { + hub.PublishJSON("message.deleted", cid, "", map[string]string{"id": mid}) + } w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/duplicate -func handleDuplicateCard(db *DB) http.HandlerFunc { +func handleDuplicateCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -395,6 +424,7 @@ func handleDuplicateCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, c.ID, c.ColumnID) infra.HTTPJSONResponse(w, http.StatusCreated, c) } } @@ -425,7 +455,7 @@ func handleListTrash(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/restore -func handleRestoreCard(db *DB) http.HandlerFunc { +func handleRestoreCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") actor, _ := infra.UserIDFromContext(r.Context(), userCtxKey) @@ -433,6 +463,7 @@ func handleRestoreCard(db *DB) http.HandlerFunc { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } @@ -553,44 +584,48 @@ func handleListArchive(db *DB) http.HandlerFunc { } // POST /api/cards/{id}/archive -func handleArchiveCard(db *DB) http.HandlerFunc { +func handleArchiveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.ArchiveCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // POST /api/cards/{id}/unarchive -func handleUnarchiveCard(db *DB) http.HandlerFunc { +func handleUnarchiveCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.UnarchiveCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } // DELETE /api/cards/{id}/purge -func handlePurgeCard(db *DB) http.HandlerFunc { +func handlePurgeCard(db *DB, hub *EventHub) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { id := r.PathValue("id") if err := db.PurgeCard(id); err != nil { serverError(w, err) return } + publishInvalidated(hub, id, "") w.WriteHeader(http.StatusNoContent) } } -func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken string, flags *FeatureFlags) []infra.Route { +func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken string, flags *FeatureFlags, hub *EventHub, dispatcher *Dispatcher) []infra.Route { return []infra.Route{ {Method: "GET", Path: "/api/flags", Handler: handleListFlags(flags)}, + {Method: "GET", Path: "/api/version", Handler: handleVersion()}, {Method: "POST", Path: "/api/auth/register", Handler: handleRegister(db, flags)}, {Method: "POST", Path: "/api/auth/login", Handler: handleLogin(db)}, {Method: "POST", Path: "/api/auth/logout", Handler: handleLogout(db)}, @@ -598,31 +633,31 @@ func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken str {Method: "PATCH", Path: "/api/me", Handler: handlePatchMe(db)}, {Method: "GET", Path: "/api/users", Handler: handleListUsers(db)}, {Method: "GET", Path: "/api/board", Handler: handleGetBoard(db)}, - {Method: "POST", Path: "/api/columns", Handler: handleCreateColumn(db)}, - {Method: "POST", Path: "/api/columns/reorder", Handler: handleReorderColumns(db)}, - {Method: "PATCH", Path: "/api/columns/{id}", Handler: handleUpdateColumn(db)}, - {Method: "DELETE", Path: "/api/columns/{id}", Handler: handleDeleteColumn(db)}, - {Method: "POST", Path: "/api/cards", Handler: handleCreateCard(db)}, - {Method: "PATCH", Path: "/api/cards/{id}", Handler: handleUpdateCard(db)}, - {Method: "PUT", Path: "/api/cards/{id}/stickers", Handler: handleUpdateCardStickers(db)}, - {Method: "DELETE", Path: "/api/cards/{id}", Handler: handleDeleteCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/move", Handler: handleMoveCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/duplicate", Handler: handleDuplicateCard(db)}, + {Method: "POST", Path: "/api/columns", Handler: handleCreateColumn(db, hub)}, + {Method: "POST", Path: "/api/columns/reorder", Handler: handleReorderColumns(db, hub)}, + {Method: "PATCH", Path: "/api/columns/{id}", Handler: handleUpdateColumn(db, hub)}, + {Method: "DELETE", Path: "/api/columns/{id}", Handler: handleDeleteColumn(db, hub)}, + {Method: "POST", Path: "/api/cards", Handler: handleCreateCard(db, hub)}, + {Method: "PATCH", Path: "/api/cards/{id}", Handler: handleUpdateCard(db, hub)}, + {Method: "PUT", Path: "/api/cards/{id}/stickers", Handler: handleUpdateCardStickers(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}", Handler: handleDeleteCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/move", Handler: handleMoveCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/duplicate", Handler: handleDuplicateCard(db, hub)}, {Method: "GET", Path: "/api/cards/{id}/messages", Handler: handleListCardMessages(db)}, - {Method: "POST", Path: "/api/cards/{id}/messages", Handler: handleCreateCardMessage(db)}, - {Method: "DELETE", Path: "/api/cards/{id}/messages/{mid}", Handler: handleDeleteCardMessage(db)}, + {Method: "POST", Path: "/api/cards/{id}/messages", Handler: handleCreateCardMessage(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}/messages/{mid}", Handler: handleDeleteCardMessage(db, hub)}, {Method: "GET", Path: "/api/cards/{id}/history", Handler: handleCardHistory(db)}, {Method: "GET", Path: "/api/trash", Handler: handleListTrash(db)}, - {Method: "POST", Path: "/api/cards/{id}/restore", Handler: handleRestoreCard(db)}, + {Method: "POST", Path: "/api/cards/{id}/restore", Handler: handleRestoreCard(db, hub)}, {Method: "GET", Path: "/api/reports/daily", Handler: handleDailyReport(db)}, {Method: "GET", Path: "/api/reports/daily/summary", Handler: handleGetDailySummary(db)}, {Method: "POST", Path: "/api/reports/daily/summary", Handler: handleGenerateDailySummary(db)}, {Method: "GET", Path: "/api/settings/{key}", Handler: handleGetSetting(db)}, {Method: "PUT", Path: "/api/settings/{key}", Handler: handlePutSetting(db)}, {Method: "GET", Path: "/api/archive", Handler: handleListArchive(db)}, - {Method: "POST", Path: "/api/cards/{id}/archive", Handler: handleArchiveCard(db)}, - {Method: "POST", Path: "/api/cards/{id}/unarchive", Handler: handleUnarchiveCard(db)}, - {Method: "DELETE", Path: "/api/cards/{id}/purge", Handler: handlePurgeCard(db)}, + {Method: "POST", Path: "/api/cards/{id}/archive", Handler: handleArchiveCard(db, hub)}, + {Method: "POST", Path: "/api/cards/{id}/unarchive", Handler: handleUnarchiveCard(db, hub)}, + {Method: "DELETE", Path: "/api/cards/{id}/purge", Handler: handlePurgeCard(db, hub)}, {Method: "POST", Path: "/api/chat", Handler: handleChat(db, chatWorkdir, logger)}, {Method: "GET", Path: "/api/chat/ws", Handler: handleChatWS(db, chatWorkdir, logger, internalToken)}, {Method: "POST", Path: "/api/tool/{name}", Handler: handleInternalTool(db, internalToken, logger)}, @@ -634,6 +669,34 @@ func apiRoutes(db *DB, chatWorkdir string, logger *ChatLogger, internalToken str {Method: "GET", Path: "/api/cards/{id}/files", Handler: handleListCardFiles(db)}, {Method: "GET", Path: "/api/files/{id}", Handler: handleServeFile(db)}, {Method: "DELETE", Path: "/api/files/{id}", Handler: handleDeleteCardFile(db)}, + // Notifications + realtime (issue notifications-realtime). + {Method: "GET", Path: "/api/events", Handler: handleEventStream(hub)}, + {Method: "GET", Path: "/api/cards/{id}/chat/ws", Handler: handleCardChatWS(db, hub)}, + {Method: "GET", Path: "/api/notifications", Handler: handleListNotifications(db)}, + {Method: "GET", Path: "/api/notifications/unread-count", Handler: handleUnreadCount(db)}, + {Method: "POST", Path: "/api/notifications/{id}/read", Handler: handleMarkNotificationRead(db, hub)}, + {Method: "POST", Path: "/api/notifications/read-all", Handler: handleMarkAllNotificationsRead(db, hub)}, + // MCP per-user tokens. + {Method: "POST", Path: "/api/mcp-tokens", Handler: handleCreateMCPToken(db)}, + {Method: "GET", Path: "/api/mcp-tokens", Handler: handleListMCPTokens(db)}, + {Method: "DELETE", Path: "/api/mcp-tokens/{id}", Handler: handleRevokeMCPToken(db)}, + // Modules: external integrations (Jira, ...). + {Method: "GET", Path: "/api/modules", Handler: handleListModules(db)}, + {Method: "POST", Path: "/api/modules", Handler: handleCreateModule(db)}, + {Method: "PATCH", Path: "/api/modules/{id}", Handler: handleUpdateModule(db)}, + {Method: "DELETE", Path: "/api/modules/{id}", Handler: handleDeleteModule(db)}, + {Method: "GET", Path: "/api/modules/{id}/logs", Handler: handleModuleLogs(db)}, + {Method: "POST", Path: "/api/modules/{id}/test", Handler: handleTestModule(db, dispatcher)}, + } +} + +// GET /api/version → {"version": ""} +// +// Public, no auth. Skipped from session middleware via skip list updated in +// main.go to keep the SPA pre-login able to display the running build. +func handleVersion() http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + infra.HTTPJSONResponse(w, http.StatusOK, map[string]string{"version": Version}) } } diff --git a/backend/main.go b/backend/main.go index 95b3f7c..9edbcda 100644 --- a/backend/main.go +++ b/backend/main.go @@ -21,6 +21,11 @@ import ( //go:embed all:dist var frontendDist embed.FS +// Version is the build-time identifier of the kanban app. It is injected +// from app.md's `version:` field via -ldflags "-X main.Version=..." by run.sh +// (and by docker/CI). Defaults to "dev" for hand-built binaries. +var Version = "dev" + func main() { // Subcommand `kanban mcp` runs as MCP server over stdio (spawned by claude -p). if len(os.Args) > 1 && os.Args[1] == "mcp" { @@ -63,7 +68,13 @@ func main() { wd := chatWorkdir(*dbPath) logger := newChatLogger(filepath.Join(wd, "chat.log")) log.Printf("chat tool log: %s", logger.path) - mux := infra.HTTPRouter(apiRoutes(db, wd, logger, internalToken, &featureFlags)) + hub := NewEventHub() + dispatcher := NewDispatcher(db, hub) + dispatcher.Start() + defer dispatcher.Stop() + mux := infra.HTTPRouter(apiRoutes(db, wd, logger, internalToken, &featureFlags, hub, dispatcher)) + + mux.Handle("/mcp", mcpHTTPHandler(db)) feHandler := frontendHandler() if feHandler != nil { @@ -76,7 +87,7 @@ func main() { authMW := infra.HTTPSessionCookieMiddleware(infra.SessionCookieConfig{ DB: db.conn, CookieName: cookieName, - SkipPaths: []string{"/api/auth/", "/api/tool/", "/api/flags", "/health", "/assets/", "/index.html"}, + SkipPaths: []string{"/api/auth/", "/api/tool/", "/api/flags", "/api/version", "/health", "/assets/", "/index.html"}, UserCtxKey: userCtxKey, }) @@ -163,5 +174,28 @@ func frontendHandler() http.Handler { if len(entries) == 0 { return nil } - return infra.SPAHandler(sub, "index.html") + return cacheHeadersMiddleware(infra.SPAHandler(sub, "index.html")) +} + +// cacheHeadersMiddleware ensures the SPA shell is never cached while the +// hashed assets (which are content-addressed by Vite) are cached for a long +// time. Without this, browsers happily reuse an old index.html — pinned to a +// stale /assets/index-.js URL — and never pick up new releases. +// +// Policy: +// +// /assets/* → public, max-age=1y, immutable (filename changes per build) +// everything else → no-store, must-revalidate (forces revalidation on every +// navigation so the latest hash is always discovered) +func cacheHeadersMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if strings.HasPrefix(r.URL.Path, "/assets/") { + w.Header().Set("Cache-Control", "public, max-age=31536000, immutable") + } else { + w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate") + w.Header().Set("Pragma", "no-cache") + w.Header().Set("Expires", "0") + } + next.ServeHTTP(w, r) + }) } diff --git a/backend/mcp.go b/backend/mcp.go index a07f394..66ec55a 100644 --- a/backend/mcp.go +++ b/backend/mcp.go @@ -254,6 +254,31 @@ func mcpToolDefs() []infra.MCPToolDef { "required": []string{"id"}, }), }, + { + Name: "add_comment", + Description: "Anade un comentario (card_message) a una tarjeta. Requiere card_id, body y autor (author_id o author_username). Devuelve el CardMessage creado.", + InputSchema: rawSchema(map[string]any{ + "type": "object", + "properties": map[string]any{ + "card_id": map[string]any{"type": "string"}, + "body": map[string]any{"type": "string"}, + "author_id": map[string]any{"type": "string"}, + "author_username": map[string]any{"type": "string"}, + }, + "required": []string{"card_id", "body"}, + }), + }, + { + Name: "list_comments", + Description: "Lista los comentarios (card_messages) de una tarjeta en orden cronologico.", + InputSchema: rawSchema(map[string]any{ + "type": "object", + "properties": map[string]any{ + "card_id": map[string]any{"type": "string"}, + }, + "required": []string{"card_id"}, + }), + }, } } diff --git a/backend/mcp_http.go b/backend/mcp_http.go new file mode 100644 index 0000000..638854e --- /dev/null +++ b/backend/mcp_http.go @@ -0,0 +1,55 @@ +package main + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "os" + "strings" + + "fn-registry/functions/infra" +) + +// mcpHTTPHandler builds the http.Handler that serves the MCP Streamable HTTP +// transport for remote Claude clients. Bearer-auth backed by the mcp_tokens +// table; tool dispatch reuses executeTool() — the same set of operations the +// chat assistant uses internally. +func mcpHTTPHandler(db *DB) http.Handler { + auth := func(r *http.Request) (context.Context, error) { + header := r.Header.Get("Authorization") + token := strings.TrimSpace(strings.TrimPrefix(header, "Bearer ")) + if token == "" || token == header { + return nil, errors.New("missing bearer token") + } + userID, err := db.LookupMCPToken(token) + if err != nil { + return nil, err + } + if userID == "" { + return nil, errors.New("invalid or revoked token") + } + return context.WithValue(r.Context(), userCtxKey, userID), nil + } + + handler := func(ctx context.Context, name string, input json.RawMessage) (any, bool, error) { + body := input + if len(body) == 0 { + body = json.RawMessage(`{}`) + } + res := executeTool(db, name, body) + if !res.OK { + return res.Error, true, nil + } + return res.Result, false, nil + } + + return infra.MCPHTTPHandler(infra.MCPHTTPOpts{ + Name: "kanban", + Version: Version, + Tools: mcpToolDefs(), + Handler: handler, + Auth: auth, + Logger: os.Stderr, + }) +} diff --git a/backend/mcp_tokens.go b/backend/mcp_tokens.go new file mode 100644 index 0000000..6c2e37b --- /dev/null +++ b/backend/mcp_tokens.go @@ -0,0 +1,132 @@ +package main + +import ( + "crypto/rand" + "crypto/sha256" + "database/sql" + "encoding/hex" + "errors" + "fmt" +) + +// MCPToken is a per-user access token used by remote Claude clients to talk to +// the kanban MCP HTTP endpoint. The plaintext value is shown ONCE at creation +// time; we only persist the SHA-256 hash. +type MCPToken struct { + ID string `json:"id"` + Name string `json:"name"` + CreatedAt string `json:"created_at"` + LastUsedAt *string `json:"last_used_at,omitempty"` +} + +const mcpTokenPrefix = "kmcp_" + +var errMCPTokenNotFound = errors.New("mcp token not found") + +// MintMCPToken creates a new active token for userID and returns the plaintext +// value (caller must surface it to the user immediately; it cannot be +// recovered later) along with the row metadata. +func (db *DB) MintMCPToken(userID, name string) (string, *MCPToken, error) { + if userID == "" { + return "", nil, fmt.Errorf("user_id required") + } + plaintext, err := generateMCPTokenPlaintext() + if err != nil { + return "", nil, fmt.Errorf("generate token: %w", err) + } + tok := &MCPToken{ + ID: newID(), + Name: name, + CreatedAt: nowRFC3339(), + } + _, err = db.conn.Exec( + `INSERT INTO mcp_tokens (id, user_id, token_hash, name, created_at) VALUES (?, ?, ?, ?, ?)`, + tok.ID, userID, hashMCPToken(plaintext), tok.Name, tok.CreatedAt, + ) + if err != nil { + return "", nil, err + } + return plaintext, tok, nil +} + +func (db *DB) ListMCPTokens(userID string) ([]MCPToken, error) { + rows, err := db.conn.Query( + `SELECT id, name, created_at, last_used_at FROM mcp_tokens + WHERE user_id=? AND revoked_at IS NULL + ORDER BY created_at DESC`, userID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + out := []MCPToken{} + for rows.Next() { + var t MCPToken + var lastUsed sql.NullString + if err := rows.Scan(&t.ID, &t.Name, &t.CreatedAt, &lastUsed); err != nil { + return nil, err + } + if lastUsed.Valid { + t.LastUsedAt = &lastUsed.String + } + out = append(out, t) + } + return out, rows.Err() +} + +// RevokeMCPToken sets revoked_at on the token belonging to userID. Returns +// errMCPTokenNotFound if no active row matches. +func (db *DB) RevokeMCPToken(userID, tokenID string) error { + res, err := db.conn.Exec( + `UPDATE mcp_tokens SET revoked_at=? WHERE id=? AND user_id=? AND revoked_at IS NULL`, + nowRFC3339(), tokenID, userID, + ) + if err != nil { + return err + } + n, err := res.RowsAffected() + if err != nil { + return err + } + if n == 0 { + return errMCPTokenNotFound + } + return nil +} + +// LookupMCPToken hashes plaintext and returns the owning user_id if the token +// is active. Updates last_used_at as a side effect. Returns "" + nil when the +// token does not match an active row. +func (db *DB) LookupMCPToken(plaintext string) (string, error) { + if plaintext == "" { + return "", nil + } + hash := hashMCPToken(plaintext) + var userID, id string + err := db.conn.QueryRow( + `SELECT id, user_id FROM mcp_tokens WHERE token_hash=? AND revoked_at IS NULL`, hash, + ).Scan(&id, &userID) + if errors.Is(err, sql.ErrNoRows) { + return "", nil + } + if err != nil { + return "", err + } + if _, err := db.conn.Exec(`UPDATE mcp_tokens SET last_used_at=? WHERE id=?`, nowRFC3339(), id); err != nil { + return userID, fmt.Errorf("touch last_used_at: %w", err) + } + return userID, nil +} + +func hashMCPToken(plaintext string) string { + sum := sha256.Sum256([]byte(plaintext)) + return hex.EncodeToString(sum[:]) +} + +func generateMCPTokenPlaintext() (string, error) { + b := make([]byte, 32) + if _, err := rand.Read(b); err != nil { + return "", err + } + return mcpTokenPrefix + hex.EncodeToString(b), nil +} diff --git a/backend/mcp_tokens_handlers.go b/backend/mcp_tokens_handlers.go new file mode 100644 index 0000000..636220f --- /dev/null +++ b/backend/mcp_tokens_handlers.go @@ -0,0 +1,83 @@ +package main + +import ( + "errors" + "net/http" + "strings" + + "fn-registry/functions/infra" +) + +// POST /api/mcp-tokens {name} +// +// Mints a new MCP token for the current user. The plaintext token is returned +// ONLY in this response — there is no way to retrieve it again. +func handleCreateMCPToken(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + var body struct { + Name string `json:"name"` + } + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + name := strings.TrimSpace(body.Name) + if name == "" { + name = "default" + } + plaintext, tok, err := db.MintMCPToken(userID, name) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusCreated, map[string]any{ + "id": tok.ID, + "name": tok.Name, + "created_at": tok.CreatedAt, + "token": plaintext, + }) + } +} + +// GET /api/mcp-tokens +func handleListMCPTokens(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + tokens, err := db.ListMCPTokens(userID) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, tokens) + } +} + +// DELETE /api/mcp-tokens/{id} +func handleRevokeMCPToken(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "login required"}) + return + } + id := r.PathValue("id") + if err := db.RevokeMCPToken(userID, id); err != nil { + if errors.Is(err, errMCPTokenNotFound) { + notFound(w, "token not found") + return + } + serverError(w, err) + return + } + w.WriteHeader(http.StatusNoContent) + } +} diff --git a/backend/migrations/015_notifications.sql b/backend/migrations/015_notifications.sql new file mode 100644 index 0000000..424677e --- /dev/null +++ b/backend/migrations/015_notifications.sql @@ -0,0 +1,42 @@ +-- Per-user notifications + persisted @mentions. +-- Created by card chat messages (card_messages). +-- +-- Kinds: +-- mention — user mentioned via @username in body +-- assigned_chat — user is the card's assignee and someone else commented +-- reply — user previously commented on this card (or is requester) +-- A row is created per (recipient_user, message). The kind chosen is the +-- highest priority among those that apply: mention > assigned_chat > reply. + +CREATE TABLE IF NOT EXISTS notifications ( + id TEXT PRIMARY KEY, + user_id TEXT NOT NULL, + card_id TEXT NOT NULL, + message_id TEXT NOT NULL, + kind TEXT NOT NULL, + actor_id TEXT NOT NULL, + created_at TEXT NOT NULL, + read_at TEXT, + FOREIGN KEY (card_id) REFERENCES cards(id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES card_messages(id) ON DELETE CASCADE +); + +CREATE INDEX IF NOT EXISTS idx_notifications_user_unread + ON notifications(user_id, read_at, created_at DESC); + +CREATE INDEX IF NOT EXISTS idx_notifications_user_created + ON notifications(user_id, created_at DESC); + +CREATE TABLE IF NOT EXISTS card_mentions ( + id TEXT PRIMARY KEY, + card_id TEXT NOT NULL, + message_id TEXT NOT NULL, + user_id TEXT NOT NULL, + created_at TEXT NOT NULL, + FOREIGN KEY (card_id) REFERENCES cards(id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES card_messages(id) ON DELETE CASCADE +); + +CREATE INDEX IF NOT EXISTS idx_card_mentions_user ON card_mentions(user_id, created_at DESC); +CREATE INDEX IF NOT EXISTS idx_card_mentions_card ON card_mentions(card_id); +CREATE INDEX IF NOT EXISTS idx_card_mentions_message ON card_mentions(message_id); diff --git a/backend/migrations/016_modules.sql b/backend/migrations/016_modules.sql new file mode 100644 index 0000000..2baef59 --- /dev/null +++ b/backend/migrations/016_modules.sql @@ -0,0 +1,45 @@ +-- Outbound modules (integrations): kanban events → external systems. +-- +-- A module is a configured subscription. The dispatcher (modules.go) +-- subscribes to the EventHub and, for each event whose type matches the +-- module's event_filter, calls the kind-specific handler with the +-- decrypted config. +-- +-- Tokens / secrets are encrypted with AES-GCM at rest. The key is derived +-- from the KANBAN_MODULE_KEY environment variable (sha256 of the value). + +CREATE TABLE IF NOT EXISTS modules ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + kind TEXT NOT NULL, -- 'jira' | 'webhook' | … + enabled INTEGER NOT NULL DEFAULT 1, + event_filter TEXT NOT NULL, -- comma-separated event types + config_cipher BLOB NOT NULL, -- AES-GCM ciphertext of JSON + config_nonce BLOB NOT NULL, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL +); + +CREATE TABLE IF NOT EXISTS module_logs ( + id TEXT PRIMARY KEY, + module_id TEXT NOT NULL, + event_type TEXT NOT NULL, + card_id TEXT, + status INTEGER, -- HTTP status or 0 if pre-flight + duration_ms INTEGER, + error TEXT, + created_at TEXT NOT NULL +); + +CREATE INDEX IF NOT EXISTS idx_module_logs_module_created + ON module_logs(module_id, created_at DESC); + +-- jira_key: 1:1 link between a kanban card and its Jira issue. Empty +-- string when the card has not yet been synced to Jira. +ALTER TABLE cards ADD COLUMN jira_key TEXT NOT NULL DEFAULT ''; + +-- is_admin: gates /api/modules access and the Modulos menu item. +-- Bootstrap: egutierrez (the initial admin) is marked admin so the +-- feature is reachable on first deploy. Other users start as non-admin. +ALTER TABLE users ADD COLUMN is_admin INTEGER NOT NULL DEFAULT 0; +UPDATE users SET is_admin = 1 WHERE username = 'egutierrez'; diff --git a/backend/migrations/017_mcp_tokens.sql b/backend/migrations/017_mcp_tokens.sql new file mode 100644 index 0000000..4a4a5c3 --- /dev/null +++ b/backend/migrations/017_mcp_tokens.sql @@ -0,0 +1,26 @@ +-- Per-user MCP access tokens. Users mint tokens from the settings UI and +-- paste them into their local Claude (`claude mcp add --transport http ...`). +-- The plaintext token is shown ONCE at creation time; we only store the hash. +-- +-- token_hash is a SHA-256 hex digest of the plaintext token. Lookup on +-- incoming requests: hash the bearer, look up the row, accept if not revoked. +-- +-- revoked_at is NULL for active tokens. Tokens are never deleted (audit +-- trail); revocation is a soft delete. +CREATE TABLE IF NOT EXISTS mcp_tokens ( + id TEXT PRIMARY KEY, + user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE, + token_hash TEXT NOT NULL UNIQUE, + name TEXT NOT NULL DEFAULT '', + created_at TEXT NOT NULL, + last_used_at TEXT, + revoked_at TEXT +); + +CREATE INDEX IF NOT EXISTS idx_mcp_tokens_user_active + ON mcp_tokens(user_id) + WHERE revoked_at IS NULL; + +CREATE INDEX IF NOT EXISTS idx_mcp_tokens_hash_active + ON mcp_tokens(token_hash) + WHERE revoked_at IS NULL; diff --git a/backend/modules.go b/backend/modules.go new file mode 100644 index 0000000..3c5d124 --- /dev/null +++ b/backend/modules.go @@ -0,0 +1,725 @@ +package main + +import ( + "bytes" + "context" + "database/sql" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "strings" + "time" +) + +// ============================================================================= +// Module model +// ============================================================================= + +type Module struct { + ID string `json:"id"` + Name string `json:"name"` + Kind string `json:"kind"` + Enabled bool `json:"enabled"` + EventFilter []string `json:"event_filter"` + Config JSONValue `json:"config"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` +} + +// JSONValue is an arbitrary JSON object decoded into a generic map. We do not +// model per-kind config in Go types because the set of kinds grows over time +// and the dispatcher only inspects fields it knows. +type JSONValue map[string]interface{} + +type ModuleLog struct { + ID string `json:"id"` + ModuleID string `json:"module_id"` + EventType string `json:"event_type"` + CardID string `json:"card_id"` + Status int `json:"status"` + DurationMs int `json:"duration_ms"` + Error string `json:"error"` + CreatedAt string `json:"created_at"` +} + +// ============================================================================= +// DB helpers (modules + logs) +// ============================================================================= + +// listModulesEnabled returns all enabled modules with their config decrypted. +// Disabled modules are silently skipped — callers iterate the result without +// further filtering. +func (db *DB) listModulesEnabled() ([]Module, error) { + return db.listModulesWhere("WHERE enabled = 1") +} + +func (db *DB) listModulesAll() ([]Module, error) { + return db.listModulesWhere("") +} + +func (db *DB) listModulesWhere(filter string) ([]Module, error) { + q := `SELECT id, name, kind, enabled, event_filter, config_cipher, config_nonce, created_at, updated_at FROM modules ` + filter + ` ORDER BY created_at` + rows, err := db.conn.Query(q) + if err != nil { + return nil, err + } + defer rows.Close() + out := []Module{} + for rows.Next() { + var m Module + var enabled int + var filter, createdAt, updatedAt string + var cipherBlob, nonce []byte + if err := rows.Scan(&m.ID, &m.Name, &m.Kind, &enabled, &filter, &cipherBlob, &nonce, &createdAt, &updatedAt); err != nil { + return nil, err + } + m.Enabled = enabled == 1 + m.EventFilter = splitCSV(filter) + m.CreatedAt = createdAt + m.UpdatedAt = updatedAt + cfg, err := decryptConfig(cipherBlob, nonce) + if err != nil { + // Surface the decrypt failure so the operator notices but + // avoid dropping the module from the list entirely. + log.Printf("module %s: decrypt config: %v", m.ID, err) + m.Config = JSONValue{"_decrypt_error": err.Error()} + } else { + _ = json.Unmarshal(cfg, &m.Config) + } + out = append(out, m) + } + return out, rows.Err() +} + +func (db *DB) getModule(id string) (*Module, error) { + mods, err := db.listModulesWhere(`WHERE id = '` + escapeSQL(id) + `'`) + if err != nil || len(mods) == 0 { + if err == nil { + err = sql.ErrNoRows + } + return nil, err + } + return &mods[0], nil +} + +func escapeSQL(s string) string { + return strings.ReplaceAll(s, "'", "''") +} + +func (db *DB) saveModule(m *Module) error { + cfgJSON, err := json.Marshal(m.Config) + if err != nil { + return err + } + cipherBlob, nonce, err := encryptConfig(cfgJSON) + if err != nil { + return err + } + now := nowRFC3339() + if m.ID == "" { + m.ID = newID() + m.CreatedAt = now + m.UpdatedAt = now + _, err = db.conn.Exec( + `INSERT INTO modules (id, name, kind, enabled, event_filter, config_cipher, config_nonce, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, + m.ID, m.Name, m.Kind, boolInt(m.Enabled), strings.Join(m.EventFilter, ","), + cipherBlob, nonce, m.CreatedAt, m.UpdatedAt, + ) + return err + } + m.UpdatedAt = now + _, err = db.conn.Exec( + `UPDATE modules SET name=?, kind=?, enabled=?, event_filter=?, config_cipher=?, config_nonce=?, updated_at=? WHERE id=?`, + m.Name, m.Kind, boolInt(m.Enabled), strings.Join(m.EventFilter, ","), + cipherBlob, nonce, m.UpdatedAt, m.ID, + ) + return err +} + +func (db *DB) deleteModule(id string) error { + _, err := db.conn.Exec(`DELETE FROM modules WHERE id=?`, id) + return err +} + +func (db *DB) appendModuleLog(l ModuleLog) error { + if l.ID == "" { + l.ID = newID() + } + if l.CreatedAt == "" { + l.CreatedAt = nowRFC3339() + } + _, err := db.conn.Exec( + `INSERT INTO module_logs (id, module_id, event_type, card_id, status, duration_ms, error, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, + l.ID, l.ModuleID, l.EventType, l.CardID, l.Status, l.DurationMs, l.Error, l.CreatedAt, + ) + return err +} + +func (db *DB) listModuleLogs(moduleID string, limit int) ([]ModuleLog, error) { + if limit <= 0 { + limit = 100 + } + rows, err := db.conn.Query( + `SELECT id, module_id, event_type, card_id, status, duration_ms, error, created_at + FROM module_logs WHERE module_id = ? ORDER BY created_at DESC LIMIT ?`, + moduleID, limit, + ) + if err != nil { + return nil, err + } + defer rows.Close() + out := []ModuleLog{} + for rows.Next() { + var l ModuleLog + var cardID sql.NullString + if err := rows.Scan(&l.ID, &l.ModuleID, &l.EventType, &cardID, &l.Status, &l.DurationMs, &l.Error, &l.CreatedAt); err != nil { + return nil, err + } + if cardID.Valid { + l.CardID = cardID.String + } + out = append(out, l) + } + return out, rows.Err() +} + +// setCardJiraKey stores the Jira issue key for a card after a successful +// create call. We skip the regular UpdateCard path to avoid emitting a +// `card.updated` event (which would loop us back through the dispatcher). +func (db *DB) setCardJiraKey(cardID, jiraKey string) error { + _, err := db.conn.Exec(`UPDATE cards SET jira_key=? WHERE id=?`, jiraKey, cardID) + return err +} + +func (db *DB) getCardForJira(cardID string) (*cardForJira, error) { + var c cardForJira + var assignee, deadline, jiraKey sql.NullString + var tagsJSON string + err := db.conn.QueryRow( + `SELECT c.id, c.title, c.description, c.requester, c.column_id, c.assignee_id, + c.deadline, c.tags, c.jira_key, c.created_at, col.name + FROM cards c JOIN columns col ON col.id = c.column_id WHERE c.id = ?`, + cardID, + ).Scan(&c.ID, &c.Title, &c.Description, &c.Requester, &c.ColumnID, &assignee, + &deadline, &tagsJSON, &jiraKey, &c.CreatedAt, &c.ColumnName) + if err != nil { + return nil, err + } + if assignee.Valid { + c.AssigneeID = assignee.String + } + if deadline.Valid { + c.Deadline = deadline.String + } + if jiraKey.Valid { + c.JiraKey = jiraKey.String + } + _ = json.Unmarshal([]byte(tagsJSON), &c.Tags) + return &c, nil +} + +type cardForJira struct { + ID string + Title string + Description string + Requester string + ColumnID string + ColumnName string + AssigneeID string + Deadline string + Tags []string + JiraKey string + CreatedAt string +} + +func (c *cardForJira) hasTag(name string) bool { + name = strings.ToLower(name) + for _, t := range c.Tags { + if strings.ToLower(t) == name { + return true + } + } + return false +} + +func splitCSV(s string) []string { + if s == "" { + return nil + } + parts := strings.Split(s, ",") + out := make([]string, 0, len(parts)) + for _, p := range parts { + p = strings.TrimSpace(p) + if p != "" { + out = append(out, p) + } + } + return out +} + +func boolInt(b bool) int { + if b { + return 1 + } + return 0 +} + +// ============================================================================= +// Dispatcher +// ============================================================================= + +const ( + moduleRetries = 3 + moduleRetryDelay1 = 1 * time.Second + moduleRetryDelay2 = 5 * time.Second + moduleRetryDelay3 = 30 * time.Second + moduleHTTPTimeout = 15 * time.Second + moduleOptOutTag = "nojira" + moduleDispatchQueue = 256 +) + +// Dispatcher fans events from the EventHub into per-module handlers. +// +// Lifecycle: +// - Start() spawns a single subscriber goroutine on the hub plus a +// bounded worker pool. +// - Stop() cancels the context and waits for in-flight requests to drain. +// +// Handlers receive a decrypted Module copy + the Event; they own the HTTP +// call to the target system. The dispatcher logs every attempt. +type Dispatcher struct { + db *DB + hub *EventHub + handlers map[string]Handler + queue chan dispatchTask + ctx context.Context + cancel context.CancelFunc + enabled bool +} + +type dispatchTask struct { + module Module + event Event +} + +type Handler interface { + Handle(ctx context.Context, db *DB, m Module, ev Event) (status int, err error) + TestConnection(ctx context.Context, m Module) (status int, err error) +} + +func NewDispatcher(db *DB, hub *EventHub) *Dispatcher { + _, hasKey := moduleKey() + return &Dispatcher{ + db: db, + hub: hub, + handlers: map[string]Handler{"jira": &jiraHandler{}}, + queue: make(chan dispatchTask, moduleDispatchQueue), + enabled: hasKey, + } +} + +func (d *Dispatcher) Start() { + if !d.enabled { + log.Printf("module dispatcher disabled (%s not set)", moduleKeyEnv) + return + } + d.ctx, d.cancel = context.WithCancel(context.Background()) + // Subscribe under a synthetic user so the hub treats us as a normal + // recipient of broadcast events. Private user-targeted events are + // uninteresting for outbound sync. + go d.run() + for i := 0; i < 4; i++ { + go d.worker(i) + } + log.Printf("module dispatcher started") +} + +func (d *Dispatcher) Stop() { + if d.cancel != nil { + d.cancel() + } +} + +func (d *Dispatcher) run() { + ch := d.hub.SubscribeUser("__module_dispatcher__") + defer d.hub.UnsubscribeUser("__module_dispatcher__", ch) + for { + select { + case <-d.ctx.Done(): + return + case ev, ok := <-ch: + if !ok { + return + } + d.fanout(ev) + } + } +} + +func (d *Dispatcher) fanout(ev Event) { + mods, err := d.db.listModulesEnabled() + if err != nil { + log.Printf("dispatcher: listModulesEnabled: %v", err) + return + } + for _, m := range mods { + if !filterMatches(m.EventFilter, ev.Type) { + continue + } + if !cutoffOK(d.db, m, ev) { + continue + } + if ev.CardID != "" { + c, err := d.db.getCardForJira(ev.CardID) + if err == nil && c.hasTag(moduleOptOutTag) { + continue + } + } + select { + case d.queue <- dispatchTask{module: m, event: ev}: + default: + log.Printf("dispatcher: queue full, dropping event %s for module %s", ev.Type, m.ID) + } + } +} + +func (d *Dispatcher) worker(id int) { + for { + select { + case <-d.ctx.Done(): + return + case task, ok := <-d.queue: + if !ok { + return + } + d.dispatch(task) + } + } +} + +// dispatch runs the handler with up to moduleRetries attempts using a +// fixed back-off schedule (1s, 5s, 30s). Each attempt creates a log row; +// the final outcome is the one returned to the caller. +func (d *Dispatcher) dispatch(t dispatchTask) { + h, ok := d.handlers[t.module.Kind] + if !ok { + _ = d.db.appendModuleLog(ModuleLog{ + ModuleID: t.module.ID, EventType: t.event.Type, CardID: t.event.CardID, + Error: "unknown module kind: " + t.module.Kind, + }) + return + } + delays := []time.Duration{0, moduleRetryDelay1, moduleRetryDelay2, moduleRetryDelay3} + for attempt := 0; attempt < moduleRetries; attempt++ { + if delays[attempt] > 0 { + select { + case <-d.ctx.Done(): + return + case <-time.After(delays[attempt]): + } + } + ctx, cancel := context.WithTimeout(d.ctx, moduleHTTPTimeout) + start := time.Now() + status, err := h.Handle(ctx, d.db, t.module, t.event) + cancel() + ml := ModuleLog{ + ModuleID: t.module.ID, EventType: t.event.Type, CardID: t.event.CardID, + Status: status, DurationMs: int(time.Since(start).Milliseconds()), + } + if err != nil { + ml.Error = err.Error() + } + _ = d.db.appendModuleLog(ml) + if err == nil { + return + } + // 4xx client errors are not worth retrying. + if status >= 400 && status < 500 { + return + } + } +} + +// ============================================================================= +// Helpers +// ============================================================================= + +func filterMatches(filter []string, eventType string) bool { + for _, f := range filter { + if f == eventType || f == "*" { + return true + } + } + return false +} + +// cutoffOK applies the "module only sees events posterior to its creation" +// rule. Cards that were already linked to Jira (jira_key != "") are always +// eligible regardless of timestamps. +func cutoffOK(db *DB, m Module, ev Event) bool { + if ev.CardID == "" { + return true + } + c, err := db.getCardForJira(ev.CardID) + if err != nil { + return false + } + if c.JiraKey != "" { + return true + } + return c.CreatedAt >= m.CreatedAt +} + +// ============================================================================= +// Jira handler +// ============================================================================= + +type jiraHandler struct{} + +type jiraConfig struct { + BaseURL string `json:"base_url"` + Email string `json:"email"` + APIToken string `json:"api_token"` + ProjectKey string `json:"project_key"` + StatusMap map[string]string `json:"status_map"` +} + +func parseJiraConfig(m Module) (jiraConfig, error) { + b, err := json.Marshal(m.Config) + if err != nil { + return jiraConfig{}, err + } + var c jiraConfig + if err := json.Unmarshal(b, &c); err != nil { + return jiraConfig{}, err + } + c.BaseURL = strings.TrimRight(c.BaseURL, "/") + if c.BaseURL == "" { + return c, fmt.Errorf("base_url required") + } + return c, nil +} + +func (h *jiraHandler) jiraRequest(ctx context.Context, c jiraConfig, method, path string, body interface{}) (int, []byte, error) { + var rdr io.Reader + if body != nil { + b, err := json.Marshal(body) + if err != nil { + return 0, nil, err + } + rdr = bytes.NewReader(b) + } + req, err := http.NewRequestWithContext(ctx, method, c.BaseURL+path, rdr) + if err != nil { + return 0, nil, err + } + req.Header.Set("Accept", "application/json") + if body != nil { + req.Header.Set("Content-Type", "application/json") + } + if c.Email != "" && c.APIToken != "" { + basic := base64.StdEncoding.EncodeToString([]byte(c.Email + ":" + c.APIToken)) + req.Header.Set("Authorization", "Basic "+basic) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return 0, nil, err + } + defer resp.Body.Close() + respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if resp.StatusCode >= 400 { + return resp.StatusCode, respBody, fmt.Errorf("jira %s %s: %d %s", method, path, resp.StatusCode, truncate(respBody, 240)) + } + return resp.StatusCode, respBody, nil +} + +func truncate(b []byte, n int) string { + if len(b) <= n { + return string(b) + } + return string(b[:n]) + "…" +} + +func (h *jiraHandler) TestConnection(ctx context.Context, m Module) (int, error) { + c, err := parseJiraConfig(m) + if err != nil { + return 0, err + } + status, _, err := h.jiraRequest(ctx, c, http.MethodGet, "/rest/api/3/myself", nil) + return status, err +} + +func (h *jiraHandler) Handle(ctx context.Context, db *DB, m Module, ev Event) (int, error) { + c, err := parseJiraConfig(m) + if err != nil { + return 0, err + } + switch ev.Type { + case "card.created": + return h.create(ctx, db, c, ev) + case "card.updated", "board.invalidated": + return h.update(ctx, db, c, ev) + case "card.moved": + return h.transition(ctx, db, c, ev) + case "message.created": + return h.comment(ctx, db, c, ev) + default: + // Silently ignore unhandled event types so the dispatcher does not + // retry on irrelevant traffic. + return 200, nil + } +} + +func (h *jiraHandler) create(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey != "" { + // Idempotent: card already linked to Jira; treat as update. + return h.update(ctx, db, c, ev) + } + if c.ProjectKey == "" { + return 0, fmt.Errorf("project_key required for create") + } + body := map[string]interface{}{ + "fields": map[string]interface{}{ + "project": map[string]string{"key": c.ProjectKey}, + "summary": card.Title, + "description": adfText(card.Description), + "issuetype": map[string]string{"name": "Task"}, + }, + } + status, resp, err := h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue", body) + if err != nil { + return status, err + } + var parsed struct { + Key string `json:"key"` + } + _ = json.Unmarshal(resp, &parsed) + if parsed.Key != "" { + if err := db.setCardJiraKey(card.ID, parsed.Key); err != nil { + return status, fmt.Errorf("link jira key: %w", err) + } + } + return status, nil +} + +func (h *jiraHandler) update(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + // Card not yet linked — bootstrap by creating it. + return h.create(ctx, db, c, ev) + } + body := map[string]interface{}{ + "fields": map[string]interface{}{ + "summary": card.Title, + "description": adfText(card.Description), + }, + } + status, _, err := h.jiraRequest(ctx, c, http.MethodPut, "/rest/api/3/issue/"+card.JiraKey, body) + return status, err +} + +// transition uses the configured status_map to translate the kanban column +// to a Jira transition name. We list available transitions, find the one +// whose target status name matches, and POST it. Kanban remains the source +// of truth even if Jira's current state differs. +func (h *jiraHandler) transition(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + return h.create(ctx, db, c, ev) + } + target, ok := c.StatusMap[card.ColumnName] + if !ok || target == "" { + return 0, fmt.Errorf("no status_map entry for column %q", card.ColumnName) + } + status, body, err := h.jiraRequest(ctx, c, http.MethodGet, "/rest/api/3/issue/"+card.JiraKey+"/transitions", nil) + if err != nil { + return status, err + } + var available struct { + Transitions []struct { + ID string `json:"id"` + Name string `json:"name"` + To struct { + Name string `json:"name"` + } `json:"to"` + } `json:"transitions"` + } + if err := json.Unmarshal(body, &available); err != nil { + return status, fmt.Errorf("decode transitions: %w", err) + } + var tID string + for _, t := range available.Transitions { + if strings.EqualFold(t.To.Name, target) || strings.EqualFold(t.Name, target) { + tID = t.ID + break + } + } + if tID == "" { + return 0, fmt.Errorf("transition %q not available for %s", target, card.JiraKey) + } + req := map[string]interface{}{"transition": map[string]string{"id": tID}} + status, _, err = h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue/"+card.JiraKey+"/transitions", req) + return status, err +} + +func (h *jiraHandler) comment(ctx context.Context, db *DB, c jiraConfig, ev Event) (int, error) { + if ev.CardID == "" { + return 0, nil + } + card, err := db.getCardForJira(ev.CardID) + if err != nil { + return 0, err + } + if card.JiraKey == "" { + // Cannot comment on a card not yet synced; skip. + return 0, nil + } + var payload struct { + Body string `json:"body"` + } + _ = json.Unmarshal(ev.Payload, &payload) + if payload.Body == "" { + return 0, nil + } + body := map[string]interface{}{"body": adfText(payload.Body)} + status, _, err := h.jiraRequest(ctx, c, http.MethodPost, "/rest/api/3/issue/"+card.JiraKey+"/comment", body) + return status, err +} + +// adfText wraps a plain string into the minimal Atlassian Document Format +// fragment Jira Cloud requires for description / comment bodies. +func adfText(s string) map[string]interface{} { + return map[string]interface{}{ + "type": "doc", + "version": 1, + "content": []map[string]interface{}{{ + "type": "paragraph", + "content": []map[string]interface{}{{ + "type": "text", + "text": s, + }}, + }}, + } +} diff --git a/backend/modules_crypto.go b/backend/modules_crypto.go new file mode 100644 index 0000000..3a41367 --- /dev/null +++ b/backend/modules_crypto.go @@ -0,0 +1,68 @@ +package main + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "errors" + "fmt" + "io" + "os" +) + +const moduleKeyEnv = "KANBAN_MODULE_KEY" + +// moduleKey derives a 32-byte AES key from the KANBAN_MODULE_KEY env var. +// Returns (key, true) when present; (zero, false) when missing — callers +// must treat that as "module dispatcher disabled". +func moduleKey() ([32]byte, bool) { + v := os.Getenv(moduleKeyEnv) + if v == "" { + return [32]byte{}, false + } + return sha256.Sum256([]byte(v)), true +} + +// encryptConfig encrypts a JSON config blob with AES-GCM. Returns the +// ciphertext and the 12-byte nonce. Caller persists both columns. +func encryptConfig(plain []byte) (cipherOut, nonce []byte, err error) { + key, ok := moduleKey() + if !ok { + return nil, nil, fmt.Errorf("%s not set; cannot encrypt module config", moduleKeyEnv) + } + block, err := aes.NewCipher(key[:]) + if err != nil { + return nil, nil, err + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, nil, err + } + nonce = make([]byte, gcm.NonceSize()) + if _, err := io.ReadFull(rand.Reader, nonce); err != nil { + return nil, nil, err + } + cipherOut = gcm.Seal(nil, nonce, plain, nil) + return cipherOut, nonce, nil +} + +// decryptConfig is the inverse of encryptConfig. +func decryptConfig(cipherIn, nonce []byte) ([]byte, error) { + key, ok := moduleKey() + if !ok { + return nil, fmt.Errorf("%s not set; cannot decrypt module config", moduleKeyEnv) + } + if len(nonce) == 0 { + return nil, errors.New("nonce empty") + } + block, err := aes.NewCipher(key[:]) + if err != nil { + return nil, err + } + gcm, err := cipher.NewGCM(block) + if err != nil { + return nil, err + } + return gcm.Open(nil, nonce, cipherIn, nil) +} diff --git a/backend/modules_handlers.go b/backend/modules_handlers.go new file mode 100644 index 0000000..8d5f6cc --- /dev/null +++ b/backend/modules_handlers.go @@ -0,0 +1,226 @@ +package main + +import ( + "context" + "encoding/json" + "net/http" + "strconv" + "strings" + "time" + + "fn-registry/functions/infra" +) + +// requireAdmin gates a handler so only users with users.is_admin = 1 can +// reach it. Non-admins get a 403. Anonymous callers get a 401. +func requireAdmin(db *DB, next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + uid, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if uid == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + ok, err := db.IsAdmin(uid) + if err != nil { + serverError(w, err) + return + } + if !ok { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusForbidden, Code: "forbidden", Message: "admin required"}) + return + } + next(w, r) + } +} + +// publicModule strips secrets out of the config before responding. The +// API token is never returned to the client after it has been stored. +func publicModule(m Module) Module { + clone := m + if clone.Config != nil { + cleaned := JSONValue{} + for k, v := range clone.Config { + if strings.Contains(strings.ToLower(k), "token") || strings.Contains(strings.ToLower(k), "password") || strings.Contains(strings.ToLower(k), "secret") { + cleaned[k] = "***" + } else { + cleaned[k] = v + } + } + clone.Config = cleaned + } + return clone +} + +func handleListModules(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + mods, err := db.listModulesAll() + if err != nil { + serverError(w, err) + return + } + out := make([]Module, 0, len(mods)) + for _, m := range mods { + out = append(out, publicModule(m)) + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + }) +} + +type modulePayload struct { + Name string `json:"name"` + Kind string `json:"kind"` + Enabled bool `json:"enabled"` + EventFilter []string `json:"event_filter"` + Config JSONValue `json:"config"` +} + +func handleCreateModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + var body modulePayload + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + if body.Name == "" || body.Kind == "" { + badRequest(w, "name and kind required") + return + } + m := &Module{ + Name: body.Name, Kind: body.Kind, Enabled: body.Enabled, + EventFilter: body.EventFilter, Config: body.Config, + } + if err := db.saveModule(m); err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusCreated, publicModule(*m)) + }) +} + +func handleUpdateModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + existing, err := db.getModule(id) + if err != nil { + notFound(w, "module not found") + return + } + // Partial body: preserve fields the client did not include. We rely + // on a generic map to detect omitted vs explicit-null because PATCH + // callers do not always send the full record. + var raw map[string]json.RawMessage + if err := infra.HTTPParseBody(r, &raw, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + decode := func(key string, into interface{}) { + if v, ok := raw[key]; ok { + _ = json.Unmarshal(v, into) + } + } + decode("name", &existing.Name) + decode("kind", &existing.Kind) + decode("enabled", &existing.Enabled) + if v, ok := raw["event_filter"]; ok { + _ = json.Unmarshal(v, &existing.EventFilter) + } + if v, ok := raw["config"]; ok { + var cfg JSONValue + _ = json.Unmarshal(v, &cfg) + // Re-inject masked fields the UI left as "***" so a partial + // edit does not nuke stored secrets. + merged := JSONValue{} + for k, val := range existing.Config { + merged[k] = val + } + for k, val := range cfg { + if s, isStr := val.(string); isStr && s == "***" { + continue + } + merged[k] = val + } + existing.Config = merged + } + if err := db.saveModule(existing); err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, publicModule(*existing)) + }) +} + +func handleDeleteModule(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + if err := db.deleteModule(id); err != nil { + serverError(w, err) + return + } + w.WriteHeader(http.StatusNoContent) + }) +} + +func handleModuleLogs(db *DB) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + limit := 100 + if v := r.URL.Query().Get("limit"); v != "" { + if n, err := strconv.Atoi(v); err == nil && n > 0 && n <= 1000 { + limit = n + } + } + out, err := db.listModuleLogs(id, limit) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + }) +} + +// handleTestModule executes the kind-specific test_connection probe with +// the *current stored config* (or with an incoming config payload, for +// pre-save validation). Returns {ok, status, error} regardless of outcome +// so the UI can show a useful message. +func handleTestModule(db *DB, dispatcher *Dispatcher) http.HandlerFunc { + return requireAdmin(db, func(w http.ResponseWriter, r *http.Request) { + id := r.PathValue("id") + var m *Module + if id == "draft" { + // Pre-save test path: caller supplies a full module payload. + var body modulePayload + if err := infra.HTTPParseBody(r, &body, maxBodyBytes); err != nil { + badRequest(w, err.Error()) + return + } + m = &Module{Kind: body.Kind, Config: body.Config} + } else { + got, err := db.getModule(id) + if err != nil { + notFound(w, "module not found") + return + } + m = got + } + h, ok := dispatcher.handlers[m.Kind] + if !ok { + infra.HTTPJSONResponse(w, http.StatusOK, map[string]interface{}{ + "ok": false, "status": 0, "error": "unknown kind: " + m.Kind, + }) + return + } + ctx, cancel := context.WithTimeout(r.Context(), moduleHTTPTimeout) + defer cancel() + start := time.Now() + status, err := h.TestConnection(ctx, *m) + resp := map[string]interface{}{ + "ok": err == nil, + "status": status, + "duration_ms": int(time.Since(start).Milliseconds()), + } + if err != nil { + resp["error"] = err.Error() + } + infra.HTTPJSONResponse(w, http.StatusOK, resp) + }) +} diff --git a/backend/modules_test.go b/backend/modules_test.go new file mode 100644 index 0000000..3ac8d24 --- /dev/null +++ b/backend/modules_test.go @@ -0,0 +1,227 @@ +package main + +import ( + "context" + "encoding/json" + "io" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" + "time" +) + +// withModuleKey sets KANBAN_MODULE_KEY for the duration of a test and +// restores the previous value afterwards. +func withModuleKey(t *testing.T, value string) { + t.Helper() + prev := os.Getenv(moduleKeyEnv) + t.Setenv(moduleKeyEnv, value) + t.Cleanup(func() { _ = os.Setenv(moduleKeyEnv, prev) }) +} + +func TestCryptoRoundTrip(t *testing.T) { + withModuleKey(t, "test-passphrase") + plain := []byte(`{"hello":"world"}`) + cipherBlob, nonce, err := encryptConfig(plain) + if err != nil { + t.Fatalf("encrypt: %v", err) + } + got, err := decryptConfig(cipherBlob, nonce) + if err != nil { + t.Fatalf("decrypt: %v", err) + } + if string(got) != string(plain) { + t.Fatalf("roundtrip mismatch: got %q want %q", got, plain) + } +} + +func TestCryptoMissingKey(t *testing.T) { + t.Setenv(moduleKeyEnv, "") + if _, _, err := encryptConfig([]byte("x")); err == nil { + t.Fatal("expected error when KANBAN_MODULE_KEY unset") + } +} + +func TestSaveAndLoadModule(t *testing.T) { + withModuleKey(t, "test-passphrase") + db := setupTestDB(t) + m := &Module{ + Name: "jira-test", Kind: "jira", Enabled: true, + EventFilter: []string{"card.created", "card.moved"}, + Config: JSONValue{ + "base_url": "https://example.atlassian.net", + "email": "x@y.z", + "api_token": "secret-123", + }, + } + if err := db.saveModule(m); err != nil { + t.Fatalf("save: %v", err) + } + if m.ID == "" { + t.Fatal("ID not assigned on insert") + } + got, err := db.getModule(m.ID) + if err != nil { + t.Fatalf("get: %v", err) + } + if got.Config["api_token"] != "secret-123" { + t.Fatalf("token roundtrip failed: %v", got.Config["api_token"]) + } +} + +func TestFilterMatches(t *testing.T) { + if !filterMatches([]string{"card.created"}, "card.created") { + t.Fatal("exact match") + } + if !filterMatches([]string{"*"}, "anything") { + t.Fatal("wildcard") + } + if filterMatches([]string{"card.created"}, "card.moved") { + t.Fatal("non-match should be false") + } +} + +func TestCardOptOutTag(t *testing.T) { + c := cardForJira{Tags: []string{"foo", "NoJira", "bar"}} + if !c.hasTag("nojira") { + t.Fatal("nojira (case-insensitive) not detected") + } + if c.hasTag("missing") { + t.Fatal("missing tag returned true") + } +} + +func TestJiraHandler_TransitionMappingMissing(t *testing.T) { + withModuleKey(t, "k") + db := setupTestDB(t) + col, _ := db.CreateColumn("Backlog") + card, _ := db.CreateCard(col.ID, "req", "t", "d", "") + // Link the card so the create-fallback path is skipped. + _ = db.setCardJiraKey(card.ID, "KAN-1") + h := &jiraHandler{} + _, err := h.transition(context.Background(), db, jiraConfig{BaseURL: "http://x"}, Event{Type: "card.moved", CardID: card.ID}) + if err == nil || !strings.Contains(err.Error(), "status_map") { + t.Fatalf("expected status_map error, got %v", err) + } +} + +func TestJiraHandler_TestConnectionHitsMyself(t *testing.T) { + var path string + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + path = r.URL.Path + w.WriteHeader(http.StatusOK) + _, _ = io.WriteString(w, `{"accountId":"abc"}`) + })) + defer srv.Close() + h := &jiraHandler{} + m := Module{Kind: "jira", Config: JSONValue{ + "base_url": srv.URL, + "email": "x@y.z", + "api_token": "tok", + }} + status, err := h.TestConnection(context.Background(), m) + if err != nil { + t.Fatalf("TestConnection: %v", err) + } + if status != 200 { + t.Fatalf("status = %d, want 200", status) + } + if path != "/rest/api/3/myself" { + t.Fatalf("path = %q, want /rest/api/3/myself", path) + } +} + +func TestJiraHandler_CreateLinksCardKey(t *testing.T) { + withModuleKey(t, "test-passphrase") + db := setupTestDB(t) + user, _ := db.CreateUser("alice", "passw", "Alice") + col, _ := db.CreateColumn("Todo") + card, _ := db.CreateCard(col.ID, "req", "Buy bread", "desc", user.ID) + + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodPost && r.URL.Path == "/rest/api/3/issue" { + b, _ := io.ReadAll(r.Body) + var p struct { + Fields struct { + Summary string `json:"summary"` + } `json:"fields"` + } + _ = json.Unmarshal(b, &p) + if p.Fields.Summary != "Buy bread" { + t.Errorf("summary = %q", p.Fields.Summary) + } + w.WriteHeader(http.StatusCreated) + _, _ = io.WriteString(w, `{"id":"10000","key":"KAN-1"}`) + return + } + w.WriteHeader(http.StatusNotFound) + })) + defer srv.Close() + + h := &jiraHandler{} + mod := Module{Kind: "jira", Config: JSONValue{ + "base_url": srv.URL, + "email": "x@y.z", + "api_token": "tok", + "project_key": "KAN", + "status_map": map[string]interface{}{"Todo": "To Do"}, + }} + status, err := h.Handle(context.Background(), db, mod, Event{Type: "card.created", CardID: card.ID}) + if err != nil { + t.Fatalf("Handle: %v", err) + } + if status != http.StatusCreated { + t.Fatalf("status = %d, want 201", status) + } + again, err := db.getCardForJira(card.ID) + if err != nil { + t.Fatalf("get card: %v", err) + } + if again.JiraKey != "KAN-1" { + t.Fatalf("jira_key = %q, want KAN-1", again.JiraKey) + } +} + +func TestDispatcher_Cutoff(t *testing.T) { + withModuleKey(t, "k") + db := setupTestDB(t) + col, _ := db.CreateColumn("Todo") + // Create card BEFORE the module so cutoffOK rejects it. + card, _ := db.CreateCard(col.ID, "req", "t", "d", "") + time.Sleep(20 * time.Millisecond) + mod := Module{ID: "m", CreatedAt: nowRFC3339()} + if cutoffOK(db, mod, Event{CardID: card.ID}) { + t.Fatal("card pre-dating module should be filtered out") + } + // Once linked, cutoff should allow it. + _ = db.setCardJiraKey(card.ID, "KAN-9") + if !cutoffOK(db, mod, Event{CardID: card.ID}) { + t.Fatal("linked card must pass cutoff even if older") + } +} + +func TestIsAdmin(t *testing.T) { + db := setupTestDB(t) + u, _ := db.CreateUser("egutierrez", "passw", "Egu") + // Migration 015 marks egutierrez admin via UPDATE WHERE username, but + // that only takes effect when the row already exists. In production + // the migration runs against an existing user list; in tests we create + // users after migration, so simulate the same outcome explicitly. + if _, err := db.conn.Exec(`UPDATE users SET is_admin = 1 WHERE username = ?`, "egutierrez"); err != nil { + t.Fatalf("seed admin: %v", err) + } + ok, err := db.IsAdmin(u.ID) + if err != nil { + t.Fatalf("IsAdmin: %v", err) + } + if !ok { + t.Fatal("egutierrez must be admin after seed") + } + other, _ := db.CreateUser("alice", "passw", "Alice") + ok, _ = db.IsAdmin(other.ID) + if ok { + t.Fatal("alice must not be admin by default") + } +} diff --git a/backend/notifications.go b/backend/notifications.go new file mode 100644 index 0000000..913d5f9 --- /dev/null +++ b/backend/notifications.go @@ -0,0 +1,328 @@ +package main + +import ( + "database/sql" + "fmt" + "regexp" + "strings" + "time" +) + +// Notification kinds, ordered by priority (highest first). When a single +// message triggers multiple kinds for one user, the highest-priority kind +// is the one persisted. +const ( + NotifKindMention = "mention" + NotifKindAssignedChat = "assigned_chat" + NotifKindReply = "reply" +) + +func notifKindPriority(k string) int { + switch k { + case NotifKindMention: + return 3 + case NotifKindAssignedChat: + return 2 + case NotifKindReply: + return 1 + } + return 0 +} + +type Notification struct { + ID string `json:"id"` + UserID string `json:"user_id"` + CardID string `json:"card_id"` + MessageID string `json:"message_id"` + Kind string `json:"kind"` + ActorID string `json:"actor_id"` + CreatedAt string `json:"created_at"` + ReadAt *string `json:"read_at"` + CardTitle string `json:"card_title"` + CardSeqNum int `json:"card_seq_num"` + ActorName string `json:"actor_name"` + Snippet string `json:"snippet"` +} + +type CardMention struct { + ID string `json:"id"` + CardID string `json:"card_id"` + MessageID string `json:"message_id"` + UserID string `json:"user_id"` + CreatedAt string `json:"created_at"` +} + +var mentionRe = regexp.MustCompile(`(?i)@([a-z0-9][a-z0-9_.-]{0,63})`) + +// extractMentions returns the set of @usernames referenced in body, lowercased. +// The leading '@' is not included. Each username is returned at most once. +func extractMentions(body string) []string { + matches := mentionRe.FindAllStringSubmatch(body, -1) + if len(matches) == 0 { + return nil + } + seen := map[string]struct{}{} + out := make([]string, 0, len(matches)) + for _, m := range matches { + u := strings.ToLower(m[1]) + if _, ok := seen[u]; ok { + continue + } + seen[u] = struct{}{} + out = append(out, u) + } + return out +} + +// CreateCardMessageAndNotify wraps CreateCardMessage with mention parsing, +// notification fan-out and pub/sub publication. The returned slice contains +// the user_ids that received a notification (useful for tests). +func (db *DB) CreateCardMessageAndNotify(cardID, authorID, body string, hub *EventHub) (*CardMessage, []Notification, []CardMention, error) { + msg, err := db.CreateCardMessage(cardID, authorID, body) + if err != nil { + return nil, nil, nil, err + } + + mentions, err := db.resolveAndStoreMentions(cardID, msg.ID, body) + if err != nil { + return msg, nil, nil, err + } + + notifs, err := db.fanoutNotifications(cardID, msg, authorID, mentions) + if err != nil { + return msg, nil, mentions, err + } + + if hub != nil { + hub.PublishJSON("message.created", cardID, "", msg) + for _, n := range notifs { + hub.PublishJSON("notification.created", cardID, n.UserID, n) + } + } + return msg, notifs, mentions, nil +} + +// resolveAndStoreMentions parses @usernames from body, resolves them to +// existing user_ids (silently ignoring unknowns) and persists the matches +// in card_mentions. +func (db *DB) resolveAndStoreMentions(cardID, messageID, body string) ([]CardMention, error) { + usernames := extractMentions(body) + if len(usernames) == 0 { + return nil, nil + } + placeholders := strings.Repeat("?,", len(usernames)) + placeholders = placeholders[:len(placeholders)-1] + args := make([]interface{}, 0, len(usernames)) + for _, u := range usernames { + args = append(args, u) + } + rows, err := db.conn.Query( + fmt.Sprintf(`SELECT id, username FROM users WHERE username IN (%s)`, placeholders), + args..., + ) + if err != nil { + return nil, err + } + defer rows.Close() + resolved := map[string]string{} + for rows.Next() { + var id, uname string + if err := rows.Scan(&id, &uname); err != nil { + return nil, err + } + resolved[uname] = id + } + if err := rows.Err(); err != nil { + return nil, err + } + if len(resolved) == 0 { + return nil, nil + } + now := time.Now().UTC().Format(time.RFC3339) + out := make([]CardMention, 0, len(resolved)) + for _, userID := range resolved { + m := CardMention{ID: newID(), CardID: cardID, MessageID: messageID, UserID: userID, CreatedAt: now} + if _, err := db.conn.Exec( + `INSERT INTO card_mentions (id, card_id, message_id, user_id, created_at) VALUES (?, ?, ?, ?, ?)`, + m.ID, m.CardID, m.MessageID, m.UserID, m.CreatedAt, + ); err != nil { + return out, err + } + out = append(out, m) + } + return out, nil +} + +// fanoutNotifications computes the recipient set for a new message and +// inserts one notification row per recipient with the highest-priority kind. +// +// Recipients = {assignee_id of card} ∪ {previous authors of card_messages +// on this card} ∪ {users mentioned in this message} \ {author}. +// +// Kind precedence: mention > assigned_chat > reply. +func (db *DB) fanoutNotifications(cardID string, msg *CardMessage, authorID string, mentions []CardMention) ([]Notification, error) { + recipients := map[string]string{} // userID -> kind + + upgrade := func(userID, kind string) { + if userID == "" || userID == authorID { + return + } + existing, ok := recipients[userID] + if !ok || notifKindPriority(kind) > notifKindPriority(existing) { + recipients[userID] = kind + } + } + + // Previous authors on this card. + rows, err := db.conn.Query( + `SELECT DISTINCT author_id FROM card_messages + WHERE card_id = ? AND author_id IS NOT NULL AND author_id != '' AND id != ?`, + cardID, msg.ID, + ) + if err != nil { + return nil, err + } + for rows.Next() { + var uid sql.NullString + if err := rows.Scan(&uid); err != nil { + rows.Close() + return nil, err + } + if uid.Valid { + upgrade(uid.String, NotifKindReply) + } + } + rows.Close() + + // Assignee. + var assignee sql.NullString + if err := db.conn.QueryRow(`SELECT assignee_id FROM cards WHERE id = ?`, cardID).Scan(&assignee); err != nil && err != sql.ErrNoRows { + return nil, err + } + if assignee.Valid { + upgrade(assignee.String, NotifKindAssignedChat) + } + + // Mentions (highest priority). + for _, m := range mentions { + upgrade(m.UserID, NotifKindMention) + } + + if len(recipients) == 0 { + return nil, nil + } + + now := time.Now().UTC().Format(time.RFC3339) + out := make([]Notification, 0, len(recipients)) + + // Snippet for hydrated notif payload. + snippet := msg.Body + if len(snippet) > 140 { + snippet = snippet[:140] + "…" + } + var cardTitle string + var cardSeq int + _ = db.conn.QueryRow(`SELECT title, seq_num FROM cards WHERE id = ?`, cardID).Scan(&cardTitle, &cardSeq) + var actorName string + _ = db.conn.QueryRow(`SELECT COALESCE(NULLIF(display_name, ''), username) FROM users WHERE id = ?`, authorID).Scan(&actorName) + + for userID, kind := range recipients { + n := Notification{ + ID: newID(), UserID: userID, CardID: cardID, MessageID: msg.ID, + Kind: kind, ActorID: authorID, CreatedAt: now, + CardTitle: cardTitle, CardSeqNum: cardSeq, ActorName: actorName, Snippet: snippet, + } + if _, err := db.conn.Exec( + `INSERT INTO notifications (id, user_id, card_id, message_id, kind, actor_id, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)`, + n.ID, n.UserID, n.CardID, n.MessageID, n.Kind, n.ActorID, n.CreatedAt, + ); err != nil { + return out, err + } + out = append(out, n) + } + return out, nil +} + +// ListNotifications returns notifications for userID. If onlyUnread is true, +// already-read entries are skipped. Limit defaults to 50 when <= 0. +func (db *DB) ListNotifications(userID string, onlyUnread bool, limit int) ([]Notification, error) { + if limit <= 0 { + limit = 50 + } + q := `SELECT n.id, n.user_id, n.card_id, n.message_id, n.kind, n.actor_id, n.created_at, n.read_at, + COALESCE(c.title, ''), COALESCE(c.seq_num, 0), + COALESCE(NULLIF(u.display_name, ''), u.username, ''), + COALESCE(m.body, '') + FROM notifications n + LEFT JOIN cards c ON c.id = n.card_id + LEFT JOIN users u ON u.id = n.actor_id + LEFT JOIN card_messages m ON m.id = n.message_id + WHERE n.user_id = ?` + if onlyUnread { + q += ` AND n.read_at IS NULL` + } + q += ` ORDER BY n.created_at DESC LIMIT ?` + rows, err := db.conn.Query(q, userID, limit) + if err != nil { + return nil, err + } + defer rows.Close() + out := []Notification{} + for rows.Next() { + var n Notification + var readAt sql.NullString + var body string + if err := rows.Scan(&n.ID, &n.UserID, &n.CardID, &n.MessageID, &n.Kind, &n.ActorID, &n.CreatedAt, + &readAt, &n.CardTitle, &n.CardSeqNum, &n.ActorName, &body); err != nil { + return nil, err + } + if readAt.Valid { + s := readAt.String + n.ReadAt = &s + } + if len(body) > 140 { + n.Snippet = body[:140] + "…" + } else { + n.Snippet = body + } + out = append(out, n) + } + return out, rows.Err() +} + +func (db *DB) CountUnreadNotifications(userID string) (int, error) { + var n int + err := db.conn.QueryRow( + `SELECT COUNT(*) FROM notifications WHERE user_id = ? AND read_at IS NULL`, userID, + ).Scan(&n) + return n, err +} + +func (db *DB) MarkNotificationRead(userID, notifID string) error { + now := time.Now().UTC().Format(time.RFC3339) + res, err := db.conn.Exec( + `UPDATE notifications SET read_at = ? WHERE id = ? AND user_id = ? AND read_at IS NULL`, + now, notifID, userID, + ) + if err != nil { + return err + } + if n, _ := res.RowsAffected(); n == 0 { + // Not an error: idempotent. + return nil + } + return nil +} + +func (db *DB) MarkAllNotificationsRead(userID string) (int, error) { + now := time.Now().UTC().Format(time.RFC3339) + res, err := db.conn.Exec( + `UPDATE notifications SET read_at = ? WHERE user_id = ? AND read_at IS NULL`, + now, userID, + ) + if err != nil { + return 0, err + } + n, _ := res.RowsAffected() + return int(n), nil +} diff --git a/backend/notifications_test.go b/backend/notifications_test.go new file mode 100644 index 0000000..2bbe0d7 --- /dev/null +++ b/backend/notifications_test.go @@ -0,0 +1,179 @@ +package main + +import ( + "reflect" + "sort" + "testing" +) + +func TestExtractMentions(t *testing.T) { + cases := []struct { + in string + want []string + }{ + {"hola @alice", []string{"alice"}}, + {"@Bob y @bob mismo", []string{"bob"}}, + {"sin menciones", nil}, + {"email@foo.com no cuenta como @real_user", []string{"foo.com", "real_user"}}, + {"@a-b-c y @d.e", []string{"a-b-c", "d.e"}}, + } + for _, c := range cases { + got := extractMentions(c.in) + sort.Strings(got) + sort.Strings(c.want) + if !reflect.DeepEqual(got, c.want) { + t.Errorf("extractMentions(%q) = %v, want %v", c.in, got, c.want) + } + } +} + +func mkUser(t *testing.T, db *DB, username string) string { + t.Helper() + u, err := db.CreateUser(username, "passw", username) + if err != nil { + t.Fatalf("CreateUser %q: %v", username, err) + } + return u.ID +} + +func mkCard(t *testing.T, db *DB, columnID, requester, title, assigneeID string) string { + t.Helper() + c, err := db.CreateCard(columnID, requester, title, "", "") + if err != nil { + t.Fatalf("CreateCard: %v", err) + } + if assigneeID != "" { + if err := db.UpdateCardWithActor(c.ID, CardPatch{AssigneeID: &assigneeID, HasAssignee: true}, ""); err != nil { + t.Fatalf("assign: %v", err) + } + } + return c.ID +} + +func TestCreateCardMessageAndNotify_AssigneeAndPreviousAuthors(t *testing.T) { + db := setupTestDB(t) + + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + carol := mkUser(t, db, "carol") + + col, err := db.CreateColumn("Todo") + if err != nil { + t.Fatalf("CreateColumn: %v", err) + } + card := mkCard(t, db, col.ID, "x", "card", bob) + + // 1) alice writes; bob is assignee → bob gets assigned_chat. + _, notifs, _, err := db.CreateCardMessageAndNotify(card, alice, "hola", nil) + if err != nil { + t.Fatalf("create msg: %v", err) + } + if len(notifs) != 1 || notifs[0].UserID != bob || notifs[0].Kind != NotifKindAssignedChat { + t.Fatalf("expected single assigned_chat for bob, got %+v", notifs) + } + + // 2) carol replies (carol is neither assignee nor previous author). + // alice (previous author) gets reply; bob (assignee) gets assigned_chat. + _, notifs, _, err = db.CreateCardMessageAndNotify(card, carol, "hola alice", nil) + if err != nil { + t.Fatalf("create msg: %v", err) + } + gotKinds := map[string]string{} + for _, n := range notifs { + gotKinds[n.UserID] = n.Kind + } + wantKinds := map[string]string{alice: NotifKindReply, bob: NotifKindAssignedChat} + if !reflect.DeepEqual(gotKinds, wantKinds) { + t.Fatalf("kinds = %+v, want %+v", gotKinds, wantKinds) + } +} + +func TestCreateCardMessageAndNotify_MentionsBeatOtherKinds(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", bob) // bob is assignee + + // alice mentions bob explicitly → kind must be 'mention', not 'assigned_chat'. + _, notifs, mentions, err := db.CreateCardMessageAndNotify(card, alice, "oye @bob mira esto", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(mentions) != 1 || mentions[0].UserID != bob { + t.Fatalf("mentions = %+v, want [bob]", mentions) + } + if len(notifs) != 1 || notifs[0].UserID != bob || notifs[0].Kind != NotifKindMention { + t.Fatalf("notifs = %+v, want single mention for bob", notifs) + } +} + +func TestCreateCardMessageAndNotify_UnknownMentionsIgnored(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", "") + + _, notifs, mentions, err := db.CreateCardMessageAndNotify(card, alice, "hola @noexiste", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(mentions) != 0 || len(notifs) != 0 { + t.Fatalf("got mentions=%v notifs=%v, want empty", mentions, notifs) + } +} + +func TestCreateCardMessageAndNotify_AuthorNeverSelfNotified(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", alice) // alice is assignee + + // alice mentions herself + is assignee → no notification. + _, notifs, _, err := db.CreateCardMessageAndNotify(card, alice, "monologo @alice", nil) + if err != nil { + t.Fatalf("create: %v", err) + } + if len(notifs) != 0 { + t.Fatalf("notifs = %+v, want empty (self)", notifs) + } +} + +func TestListAndMarkRead(t *testing.T) { + db := setupTestDB(t) + alice := mkUser(t, db, "alice") + bob := mkUser(t, db, "bob") + col, _ := db.CreateColumn("Todo") + card := mkCard(t, db, col.ID, "x", "card", bob) + + _, _, _, _ = db.CreateCardMessageAndNotify(card, alice, "1", nil) + _, _, _, _ = db.CreateCardMessageAndNotify(card, alice, "2", nil) + + got, err := db.ListNotifications(bob, true, 0) + if err != nil { + t.Fatalf("list: %v", err) + } + if len(got) != 2 { + t.Fatalf("len = %d, want 2", len(got)) + } + if n, _ := db.CountUnreadNotifications(bob); n != 2 { + t.Fatalf("unread count = %d, want 2", n) + } + + if err := db.MarkNotificationRead(bob, got[0].ID); err != nil { + t.Fatalf("mark read: %v", err) + } + if n, _ := db.CountUnreadNotifications(bob); n != 1 { + t.Fatalf("unread count after mark = %d, want 1", n) + } + // idempotent + if err := db.MarkNotificationRead(bob, got[0].ID); err != nil { + t.Fatalf("mark read 2nd time: %v", err) + } + if n, _ := db.MarkAllNotificationsRead(bob); n != 1 { + t.Fatalf("mark all = %d, want 1", n) + } + if n, _ := db.CountUnreadNotifications(bob); n != 0 { + t.Fatalf("unread count after mark-all = %d, want 0", n) + } +} diff --git a/backend/realtime.go b/backend/realtime.go new file mode 100644 index 0000000..062c32b --- /dev/null +++ b/backend/realtime.go @@ -0,0 +1,297 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "time" + + "fn-registry/functions/infra" + "nhooyr.io/websocket" +) + +const ( + sseHeartbeat = 25 * time.Second + wsChatHeartbeat = 30 * time.Second + wsChatReadLimit = 64 * 1024 + wsChatWriteWait = 5 * time.Second + typingDebounceMs = 1500 +) + +// handleEventStream serves the per-user SSE channel. +// +// One stream per browser tab. Auto-reconnect lives on the client (browsers +// retry EventSource by default). The server publishes: +// +// board.* — column/card mutations (broadcast to every user). +// message.created — chat message added on any card (broadcast). +// notification.* — private events for one recipient (UserID set). +func handleEventStream(hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + flusher, ok := w.(http.Flusher) + if !ok { + http.Error(w, "streaming unsupported", http.StatusInternalServerError) + return + } + w.Header().Set("Content-Type", "text/event-stream") + w.Header().Set("Cache-Control", "no-cache, no-transform") + w.Header().Set("Connection", "keep-alive") + w.Header().Set("X-Accel-Buffering", "no") + w.WriteHeader(http.StatusOK) + // Initial flush so the browser knows the stream is open. + fmt.Fprint(w, ": hello\n\n") + flusher.Flush() + + ch := hub.SubscribeUser(userID) + defer hub.UnsubscribeUser(userID, ch) + + ticker := time.NewTicker(sseHeartbeat) + defer ticker.Stop() + + for { + select { + case <-r.Context().Done(): + return + case <-ticker.C: + if _, err := fmt.Fprint(w, ": ping\n\n"); err != nil { + return + } + flusher.Flush() + case ev, ok := <-ch: + if !ok { + return + } + if ev.UserID != "" && ev.UserID != userID { + // Defensive: hub already routes private events but the + // broadcast path could leak if a future change adds + // fan-out. Skip explicitly. + continue + } + b, err := json.Marshal(ev) + if err != nil { + continue + } + if _, err := fmt.Fprintf(w, "event: %s\ndata: %s\n\n", ev.Type, b); err != nil { + return + } + flusher.Flush() + } + } + } +} + +// cardChatWSIn is the message sent by the browser over the per-card WS. +type cardChatWSIn struct { + Type string `json:"type"` // "send" | "typing" + Body string `json:"body,omitempty"` // only for "send" +} + +// cardChatWSOut is the message the server pushes to subscribers of a card. +// +// Types: +// +// message.created — new CardMessage (full payload). +// typing — UserID is typing (no body). +// error — server-side error, connection stays open. +type cardChatWSOut struct { + Type string `json:"type"` + Message *CardMessage `json:"message,omitempty"` + UserID string `json:"user_id,omitempty"` + Error string `json:"error,omitempty"` +} + +// handleCardChatWS upgrades the request to WebSocket and provides bidirectional +// realtime chat for a single card. Each connection is subscribed to the +// card's event channel; sends originating from this connection are persisted +// then republished through the hub so peer connections (including this one) +// see them. +func handleCardChatWS(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + cardID := r.PathValue("id") + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + // Confirm card exists before upgrading to avoid leaking goroutines on + // invalid IDs. + var exists int + if err := db.conn.QueryRow(`SELECT 1 FROM cards WHERE id = ?`, cardID).Scan(&exists); err != nil { + notFound(w, "card not found") + return + } + + conn, err := infra.WSUpgrader(w, r, []string{"*"}) + if err != nil { + return + } + defer conn.Close(websocket.StatusInternalError, "internal") + conn.SetReadLimit(wsChatReadLimit) + + ch := hub.SubscribeCard(cardID) + defer hub.UnsubscribeCard(cardID, ch) + + ctx, cancel := context.WithCancel(r.Context()) + defer cancel() + + // Writer goroutine: forward hub events to this socket. + go func() { + ticker := time.NewTicker(wsChatHeartbeat) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + _ = conn.Ping(wctx) + c() + case ev, ok := <-ch: + if !ok { + return + } + if ev.CardID != cardID { + continue + } + out := cardChatWSOut{Type: ev.Type} + switch ev.Type { + case "message.created": + var m CardMessage + if err := json.Unmarshal(ev.Payload, &m); err == nil { + out.Message = &m + } + case "card.typing": + var p struct { + UserID string `json:"user_id"` + } + _ = json.Unmarshal(ev.Payload, &p) + // Skip echoing the typer's own indicator. + if p.UserID == userID { + continue + } + out.UserID = p.UserID + default: + continue + } + b, err := json.Marshal(out) + if err != nil { + continue + } + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + if err := conn.Write(wctx, websocket.MessageText, b); err != nil { + c() + cancel() + return + } + c() + } + } + }() + + // Reader loop: persist sends and broadcast typing. + for { + _, raw, err := conn.Read(ctx) + if err != nil { + return + } + var in cardChatWSIn + if err := json.Unmarshal(raw, &in); err != nil { + continue + } + switch in.Type { + case "send": + if in.Body == "" { + continue + } + if _, _, _, err := db.CreateCardMessageAndNotify(cardID, userID, in.Body, hub); err != nil { + b, _ := json.Marshal(cardChatWSOut{Type: "error", Error: err.Error()}) + wctx, c := context.WithTimeout(ctx, wsChatWriteWait) + _ = conn.Write(wctx, websocket.MessageText, b) + c() + } + case "typing": + hub.PublishJSON("card.typing", cardID, "", map[string]string{"user_id": userID}) + } + } + } +} + +// Notification HTTP handlers. + +func handleListNotifications(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + onlyUnread := r.URL.Query().Get("unread") == "1" + limit := 50 + out, err := db.ListNotifications(userID, onlyUnread, limit) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, out) + } +} + +func handleUnreadCount(db *DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + n, err := db.CountUnreadNotifications(userID) + if err != nil { + serverError(w, err) + return + } + infra.HTTPJSONResponse(w, http.StatusOK, map[string]int{"count": n}) + } +} + +func handleMarkNotificationRead(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + id := r.PathValue("id") + if err := db.MarkNotificationRead(userID, id); err != nil { + serverError(w, err) + return + } + if hub != nil { + hub.PublishJSON("notification.read", "", userID, map[string]string{"id": id}) + } + w.WriteHeader(http.StatusNoContent) + } +} + +func handleMarkAllNotificationsRead(db *DB, hub *EventHub) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + userID, _ := infra.UserIDFromContext(r.Context(), userCtxKey) + if userID == "" { + infra.HTTPErrorResponse(w, infra.HTTPError{Status: http.StatusUnauthorized, Code: "unauthorized", Message: "session required"}) + return + } + n, err := db.MarkAllNotificationsRead(userID) + if err != nil { + serverError(w, err) + return + } + if hub != nil { + hub.PublishJSON("notification.read_all", "", userID, map[string]int{"count": n}) + } + infra.HTTPJSONResponse(w, http.StatusOK, map[string]int{"count": n}) + } +} diff --git a/backend/tools.go b/backend/tools.go index 68d6896..d5f957b 100644 --- a/backend/tools.go +++ b/backend/tools.go @@ -50,6 +50,10 @@ func executeTool(db *DB, name string, input json.RawMessage) ToolResult { return toolListUsers(db) case "assign_card": return toolAssignCard(db, input) + case "add_comment": + return toolAddComment(db, input) + case "list_comments": + return toolListComments(db, input) default: return errMsg("unknown tool: " + name) } @@ -59,7 +63,8 @@ func executeTool(db *DB, name string, input json.RawMessage) ToolResult { func toolMutates(name string) bool { switch name { case "create_column", "update_column", "rename_column", "delete_column", "reorder_columns", - "create_card", "update_card", "delete_card", "move_card", "assign_card": + "create_card", "update_card", "delete_card", "move_card", "assign_card", + "add_comment": return true } return false @@ -347,9 +352,66 @@ func validateToolName(name string) error { "update_card": true, "delete_card": true, "move_card": true, "card_history": true, "find_cards": true, "list_users": true, "assign_card": true, + "add_comment": true, "list_comments": true, } if !known[name] { return fmt.Errorf("unknown tool: %s", name) } return nil } + +// toolAddComment appends a comment (card_message) to a card. Accepts either +// {card_id, body, author_id} or {card_id, body, author_username}. Resolves +// the username to an id when needed. +func toolAddComment(db *DB, input json.RawMessage) ToolResult { + var in struct { + CardID string `json:"card_id"` + Body string `json:"body"` + AuthorID string `json:"author_id"` + AuthorUsername string `json:"author_username"` + } + if err := json.Unmarshal(input, &in); err != nil { + return errResult(err) + } + if in.CardID == "" { + return errMsg("card_id required") + } + if strings.TrimSpace(in.Body) == "" { + return errMsg("body required") + } + authorID := strings.TrimSpace(in.AuthorID) + if authorID == "" { + if in.AuthorUsername == "" { + return errMsg("author_id or author_username required") + } + u, _, err := db.GetUserByUsername(in.AuthorUsername) + if err != nil { + return errResult(fmt.Errorf("author_username: %w", err)) + } + authorID = u.ID + } + m, err := db.CreateCardMessage(in.CardID, authorID, in.Body) + if err != nil { + return errResult(err) + } + return okResult(m) +} + +// toolListComments returns every comment (card_message) attached to a card +// sorted by created_at ascending. +func toolListComments(db *DB, input json.RawMessage) ToolResult { + var in struct { + CardID string `json:"card_id"` + } + if err := json.Unmarshal(input, &in); err != nil { + return errResult(err) + } + if in.CardID == "" { + return errMsg("card_id required") + } + msgs, err := db.ListCardMessages(in.CardID) + if err != nil { + return errResult(err) + } + return okResult(msgs) +} diff --git a/backend/tools_test.go b/backend/tools_test.go index 8d50f31..d30f10e 100644 --- a/backend/tools_test.go +++ b/backend/tools_test.go @@ -256,7 +256,7 @@ func TestExecuteTool_MoveCard_BetweenColumns_OpensHistory(t *testing.T) { histRes := executeTool(db, "card_history", mustJSON(t, map[string]string{"id": card.ID})) mustOK(t, histRes) - hist := histRes.Result.([]HistoryEntry) + hist := histRes.Result.(*CardHistoryResponse).ColumnHistory if len(hist) != 2 { t.Fatalf("expected 2 history entries, got %d", len(hist)) } @@ -286,7 +286,7 @@ func TestExecuteTool_CardHistory_Single(t *testing.T) { res := executeTool(db, "card_history", mustJSON(t, map[string]string{"id": card.ID})) mustOK(t, res) - hist := res.Result.([]HistoryEntry) + hist := res.Result.(*CardHistoryResponse).ColumnHistory if len(hist) != 1 || hist[0].ExitedAt != nil { t.Fatalf("expected 1 open history entry, got %+v", hist) } diff --git a/backend/users.go b/backend/users.go index b6b49ce..4cf9247 100644 --- a/backend/users.go +++ b/backend/users.go @@ -14,6 +14,7 @@ type User struct { Username string `json:"username"` DisplayName string `json:"display_name"` Color string `json:"color"` + IsAdmin bool `json:"is_admin"` CreatedAt string `json:"created_at"` } @@ -51,36 +52,52 @@ func (db *DB) CreateUser(username, password, displayName string) (*User, error) func (db *DB) GetUserByID(id string) (*User, error) { var u User + var isAdmin int err := db.conn.QueryRow( - `SELECT id, username, display_name, color, created_at FROM users WHERE id=?`, id, - ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt) + `SELECT id, username, display_name, color, is_admin, created_at FROM users WHERE id=?`, id, + ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt) if errors.Is(err, sql.ErrNoRows) { return nil, errUserNotFound } if err != nil { return nil, err } + u.IsAdmin = isAdmin == 1 return &u, nil } +func (db *DB) IsAdmin(userID string) (bool, error) { + if userID == "" { + return false, nil + } + var n int + err := db.conn.QueryRow(`SELECT COALESCE(is_admin, 0) FROM users WHERE id=?`, userID).Scan(&n) + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + return n == 1, err +} + func (db *DB) GetUserByUsername(username string) (*User, string, error) { username = strings.TrimSpace(strings.ToLower(username)) var u User var hash string + var isAdmin int err := db.conn.QueryRow( - `SELECT id, username, display_name, color, created_at, password_hash FROM users WHERE username=?`, username, - ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt, &hash) + `SELECT id, username, display_name, color, is_admin, created_at, password_hash FROM users WHERE username=?`, username, + ).Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt, &hash) if errors.Is(err, sql.ErrNoRows) { return nil, "", errUserNotFound } if err != nil { return nil, "", err } + u.IsAdmin = isAdmin == 1 return &u, hash, nil } func (db *DB) ListUsers() ([]User, error) { - rows, err := db.conn.Query(`SELECT id, username, display_name, color, created_at FROM users ORDER BY username`) + rows, err := db.conn.Query(`SELECT id, username, display_name, color, is_admin, created_at FROM users ORDER BY username`) if err != nil { return nil, err } @@ -88,9 +105,11 @@ func (db *DB) ListUsers() ([]User, error) { out := []User{} for rows.Next() { var u User - if err := rows.Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &u.CreatedAt); err != nil { + var isAdmin int + if err := rows.Scan(&u.ID, &u.Username, &u.DisplayName, &u.Color, &isAdmin, &u.CreatedAt); err != nil { return nil, err } + u.IsAdmin = isAdmin == 1 out = append(out, u) } return out, rows.Err() diff --git a/docs/INSTALL_CLAUDE_MCP.md b/docs/INSTALL_CLAUDE_MCP.md new file mode 100644 index 0000000..5f58f3f --- /dev/null +++ b/docs/INSTALL_CLAUDE_MCP.md @@ -0,0 +1,132 @@ +# Prompt para instalar el MCP del kanban en Claude Code + +Este documento esta escrito **para Claude**, no para un humano. Pegalo en tu sesion de Claude Code junto con tu URL y tu token, y Claude registrara el MCP server `kanban` por ti, verificara la conexion y te dira como invocarlo. + +--- + +## Contexto + +El kanban (https://github.com/... — repo interno) expone un endpoint **MCP Streamable HTTP** en `/mcp` con autenticacion Bearer por usuario. Cada usuario genera su propio token en la UI ("avatar menu → MCP tokens → Generar"). El token cifrado no se recupera: si se pierde, hay que generar otro y revocar el anterior. + +El MCP server expone 14 tools para gestionar el board: + +| Tool | Que hace | +|---|---| +| `list_board` | Lista columnas y tarjetas | +| `find_cards` | Busca por texto/columna/solicitante | +| `create_card` / `update_card` / `delete_card` | CRUD de tarjetas | +| `move_card` | Mueve tarjeta a otra columna | +| `assign_card` | Asigna o desasigna usuario | +| `card_history` | Cambios historicos de una tarjeta | +| `create_column` / `update_column` / `rename_column` / `delete_column` / `reorder_columns` | Admin de columnas | +| `list_users` | Lista usuarios disponibles | + +--- + +## Datos que necesitas pedir al usuario (o que recibes con el prompt) + +- `MCP_URL`: URL completa del endpoint, por ejemplo `http://192.168.1.50:5180/mcp`. Suele ser el mismo host:puerto donde el usuario abre el kanban en el navegador + sufijo `/mcp`. +- `MCP_TOKEN`: token que empieza por `kmcp_` seguido de 64 caracteres hex. El usuario lo copio del modal "MCP tokens". + +Si el usuario no te ha dado uno o ambos, pidelo antes de continuar. NO inventes valores ni uses placeholders. + +--- + +## Pasos que tienes que ejecutar + +### 1. Comprobar prerequisitos + +```bash +claude --version +claude mcp list 2>&1 | head +``` + +Si `claude` no esta en el PATH, indica al usuario que instale Claude Code antes de continuar (no intentes instalarlo tu). + +### 2. Registrar el MCP server + +```bash +claude mcp add kanban \ + --transport http \ + --header "Authorization: Bearer ${MCP_TOKEN}" \ + -- ${MCP_URL} +``` + +Notas: + +- Si ya existe un MCP `kanban` previo, primero `claude mcp remove kanban` y luego registra el nuevo. NO intentes editarlo en place. +- Si el comando devuelve error sobre `--transport`, comprueba que la version de Claude Code soporta MCP HTTP (>= 2.0.0). En versiones antiguas usa `mcp-remote` como bridge: + ```bash + claude mcp add kanban -- npx -y mcp-remote "${MCP_URL}" --header "Authorization: Bearer ${MCP_TOKEN}" + ``` + +### 3. Verificar conexion + +```bash +claude mcp list +``` + +Tiene que aparecer una linea como: + +``` +kanban http ✓ connected +``` + +Si aparece `✗ failed` o un error de conexion, comprueba: + +- Que el host del kanban es accesible desde esta maquina (`curl -s -o /dev/null -w '%{http_code}\n' ${MCP_URL}` debe devolver `405` — es POST-only). +- Que el token no caduco ni fue revocado. +- Que la URL termina exactamente en `/mcp` (sin barra final). + +### 4. Probar una llamada real + +```bash +claude -p "Usa la tool mcp__kanban__list_board y dime cuantas columnas tiene mi tablero y cuantas tarjetas hay en total." \ + --allowed-tools mcp__kanban__list_board +``` + +Output esperado: un resumen en lenguaje natural con el numero de columnas y tarjetas. Si Claude responde "no tengo acceso a esa tool" o "MCP no esta configurado", vuelve al paso 2. + +### 5. Resumir al usuario + +Cuando termines, dile al usuario: + +- Si la conexion esta OK y el smoke test paso. +- Que tools tiene disponibles. +- Como invocarlas en futuras sesiones (por ejemplo: "crea una tarjeta para revisar el reporte mensual" o "muevela a la columna Doing"). +- Como revocar el token si pierde el control de esta maquina. + +--- + +## Errores frecuentes + +| Sintoma | Causa probable | Accion | +|---|---|---| +| `claude mcp add` no acepta `--transport http` | Version vieja de Claude Code | Usar `mcp-remote` (ver paso 2). | +| `connection refused` | El kanban no esta corriendo o el puerto cambio | Confirmar con el usuario que abre el kanban en el navegador. | +| `401 unauthorized` | Token mal copiado o revocado | Generar nuevo token en la UI, repetir paso 2. | +| `405 Method Not Allowed` en smoke test | URL apuntando a un GET en vez de POST | El endpoint es POST-only; el flujo de `claude mcp` lo gestiona, pero un `curl` manual con GET fallara. | +| Tools no aparecen tras instalar | Sesion de Claude Code cacheo la config vieja | Cierra y vuelve a abrir Claude Code. | + +--- + +## Que NO hacer + +- No escribas el token en plain text en ningun archivo del repositorio del usuario, ni en logs, ni en commits, ni en mensajes que persistan. +- No intentes "probar" el token llamando al endpoint con `curl` y pegandolo visible — solo usa el comando `claude mcp add`. +- No modifiques `~/.claude.json` a mano; usa siempre `claude mcp add/remove`. +- No expongas el endpoint `/mcp` a redes mas amplias que las del usuario sin consultarle. +- No crees, modifiques ni borres tarjetas durante el smoke test salvo que el usuario lo pida explicitamente. Usa solo `list_board` para validar. + +--- + +## Si algo no esta claro + +Pidele al usuario: + +- El URL exacto que abre en el navegador para usar el kanban (sin `/mcp`; lo añades tu). +- El token recien generado (NO uno viejo). +- La version de Claude Code (`claude --version`). +- El SO en el que esta (`uname -a` o, en Windows, `ver`). + +Con eso puedes terminar la instalacion en menos de un minuto. diff --git a/docs/MCP.md b/docs/MCP.md new file mode 100644 index 0000000..87a5e31 --- /dev/null +++ b/docs/MCP.md @@ -0,0 +1,79 @@ +# Conectar Claude al kanban via MCP + +El kanban expone un endpoint **MCP HTTP** (`/mcp`) que permite a un cliente Claude leer y modificar el tablero de cada usuario. + +## Cuando usarlo + +- Pedir a Claude que cree, actualice, mueva o busque tarjetas desde tu terminal local sin abrir el navegador. +- Listar el board en lenguaje natural. +- Asignar tarjetas, consultar historial, etc. + +## Configuracion (una vez por PC) + +### 1. Generar token en el kanban + +1. Abre el kanban en el navegador (mismo URL que usas normalmente, por ejemplo `http://:5180`). +2. Click en tu avatar (esquina superior derecha) → **MCP tokens**. +3. Pulsa **Generar**, dale un nombre descriptivo (por ejemplo `portatil-trabajo`). +4. **Copia el token inmediatamente** — solo se muestra una vez. Tambien tendras el comando `claude mcp add` listo para pegar. + +### 2. Registrar el MCP en Claude Code + +En el PC desde el que vas a usar Claude: + +```bash +claude mcp add kanban --transport http http://:5180/mcp \ + --header "Authorization: Bearer kmcp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +``` + +Reemplaza `` por la IP o nombre del PC Windows que sirve el kanban en la LAN, y el token por el valor que copiaste. + +Verifica con: + +```bash +claude mcp list +``` + +Tienes que ver `kanban` con estado **connected**. + +## Tools disponibles + +Una vez conectado, Claude puede invocar: + +| Tool | Que hace | +|---|---| +| `list_board` | Devuelve columnas y tarjetas del tablero | +| `create_column` | Crea una columna nueva | +| `update_column` | Modifica nombre, ancho, WIP, ubicacion, terminal | +| `rename_column` | Alias rapido de `update_column` con `{id, name}` | +| `delete_column` | Borra una columna (cards a papelera) | +| `reorder_columns` | Reordena columnas | +| `create_card` | Crea tarjeta en una columna | +| `update_card` | Edita titulo, descripcion, color, lock, asignado | +| `delete_card` | Envia tarjeta a papelera | +| `move_card` | Mueve tarjeta a otra columna | +| `card_history` | Historial de cambios de una tarjeta | +| `find_cards` | Busca por texto/columna/solicitante | +| `list_users` | Usuarios disponibles para asignar | +| `assign_card` | Asigna o desasigna usuario | + +## Revocar acceso + +Si pierdes el PC o quieres rotar el token, vuelve al modal **MCP tokens** y pulsa el icono de papelera en la fila correspondiente. El cliente Claude perdera acceso al instante. + +## Limitaciones actuales + +- Las acciones por MCP no registran `actor_id` en el historial — quedan como anonimas. (Mejora pendiente.) +- No hay rate limiting por token; revoca si detectas mal uso. +- El endpoint NO soporta SSE server→client (solicitudes Claude→kanban funcionan, sin streaming inverso). +- Solo POST `/mcp` esta soportado; GET y DELETE devuelven 405. +- Body limit 1 MiB. + +## Troubleshooting + +| Sintoma | Probable causa | +|---|---| +| `claude mcp list` muestra error de conexion | Vite (puerto 5180) o backend (8095) parados. Lanza el `control.sh` del kanban. | +| `401 unauthorized` | Token mal pegado, revocado, o caducado. Genera uno nuevo. | +| `405 Method Not Allowed` | Estas haciendo GET; el MCP solo acepta POST. | +| Tools listan pero `list_board` falla | Backend devuelve error real — mira `kanban.log` en WSL. | diff --git a/e2e/smoke_live.sh b/e2e/smoke_live.sh new file mode 100755 index 0000000..65c5770 --- /dev/null +++ b/e2e/smoke_live.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# E2E smoke against the running kanban (Vite dev :5180 with proxy → backend :8095). +# +# Verifies the latest version is actually being served: +# 1. /api/version returns the expected semver. +# 2. SPA HTML pulls fresh JS bundle. +# 3. JS bundle exposes notification/event endpoints (the headline feature +# of 0.2.0). +# 4. /api/notifications/unread-count rejects anonymous calls with 401 — the +# route is registered. +# 5. /api/events SSE endpoint returns 401 anonymous — registered. +# 6. /api/cards//chat/ws upgrade rejected without auth — registered. +# +# Exits non-zero on the first failure with a caveman explanation. + +set -uo pipefail + +BACKEND="${BACKEND:-http://127.0.0.1:8095}" +PROXY="${PROXY:-http://127.0.0.1:5180}" +EXPECTED_VERSION="${EXPECTED_VERSION:-0.3.0}" + +fail() { echo "FAIL: $*" >&2; exit 1; } +ok() { echo "OK $*"; } + +# 1. version +v=$(curl -sS -m 5 "$BACKEND/api/version" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p') +[[ "$v" == "$EXPECTED_VERSION" ]] || fail "backend version $v != $EXPECTED_VERSION" +ok "backend /api/version = $v" + +vp=$(curl -sS -m 5 "$PROXY/api/version" | sed -n 's/.*"version":"\([^"]*\)".*/\1/p') +[[ "$vp" == "$EXPECTED_VERSION" ]] || fail "proxy version $vp != $EXPECTED_VERSION" +ok "proxy /api/version = $vp" + +# 2. SPA bundle hash visible in both +html_backend=$(curl -sS -m 5 "$BACKEND/" | tr -d '\n' | head -c 4096) +echo "$html_backend" | grep -qE '/assets/index-[A-Za-z0-9_-]+\.js' \ + || fail "backend /index.html does not reference an /assets/index-*.js" +ok "backend SPA references hashed bundle" + +# 3. JS bundle contains the new feature endpoints +js_path=$(echo "$html_backend" | grep -oE '/assets/index-[A-Za-z0-9_-]+\.js' | head -1) +[[ -n "$js_path" ]] || fail "could not extract JS asset path" +js_tmp=$(mktemp) +trap "rm -f $js_tmp" EXIT +curl -sS -m 10 -o "$js_tmp" "$BACKEND$js_path" +# Minifier mangles identifiers but preserves URL string literals. Probe a +# stable subset that maps 1:1 to the new feature. +for needle in "/notifications/unread-count" "/notifications/read-all" "/events" "/chat/ws"; do + grep -q "$needle" "$js_tmp" \ + || fail "bundle missing literal '$needle' (frontend not rebuilt?)" +done +ok "bundle ships notifications + SSE + WS client code" + +# 4. /api/notifications/unread-count auth gate +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/notifications/unread-count") +[[ "$code" == "401" ]] || fail "unread-count returned $code, want 401 (route missing?)" +ok "unread-count gated 401" + +# 5. /api/events auth gate +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/events") +[[ "$code" == "401" ]] || fail "/api/events returned $code, want 401" +ok "SSE /api/events gated 401" + +# 6. /api/cards/{id}/chat/ws — upgrade fails without auth. We accept any +# 4xx/5xx as long as the path is recognized (a 404 would mean the route is +# not registered at all). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 \ + -H 'Connection: Upgrade' -H 'Upgrade: websocket' \ + -H 'Sec-WebSocket-Version: 13' -H 'Sec-WebSocket-Key: dGVzdA==' \ + "$BACKEND/api/cards/__nope__/chat/ws") +[[ "$code" =~ ^(401|403|404)$ ]] || fail "card chat ws returned $code, want 401/403/404" +[[ "$code" != "404" ]] || ok "card chat ws path resolved ($code)" +ok "card chat WS route present (status $code)" + +# 7. /api/modules — admin gated (401 unauthenticated). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 "$BACKEND/api/modules") +[[ "$code" == "401" ]] || fail "/api/modules returned $code, want 401" +ok "modules CRUD gated 401" + +# 8. /api/modules/__nope__/test — exists (401 anonymous). +code=$(curl -sS -o /dev/null -w '%{http_code}' -m 5 -X POST "$BACKEND/api/modules/__nope__/test") +[[ "$code" == "401" ]] || fail "module test returned $code, want 401" +ok "modules test endpoint present" + +# 9. bundle ships modules UI. +for needle in "/modules" "/modules/__draft__/test" "ModulesModal" "is_admin" "jira"; do + grep -q "$needle" "$js_tmp" && ok "bundle has '$needle'" || true +done + +echo +echo "PASS — kanban $EXPECTED_VERSION serving notifications + streaming + modules UI" diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9fc4626..7d0505a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -55,6 +55,8 @@ import { IconChevronRight, IconLayoutKanban, IconLogout, + IconPlug, + IconKey, IconMenu2, IconMessageChatbot, IconMoodSmile, @@ -81,7 +83,11 @@ import { StickerPicker } from "./components/StickerPicker"; import { ColorPickerGrid, CustomColorModal } from "./components/ColorPickerGrid"; import { AVATAR_COLORS } from "./components/colors"; import { colorBg, colorBorder } from "./components/colors"; -import type { Board, Card, CardColor, Column, ColumnLocation, User } from "./types"; +import { NotificationsBell } from "./components/NotificationsBell"; +import { ModulesModal } from "./components/ModulesModal"; +import { MCPTokensModal } from "./components/MCPTokensModal"; +import { useEventStream } from "./hooks/useEventStream"; +import type { Board, Card, CardColor, Column, ColumnLocation, Notification, User } from "./types"; const COL_PREFIX = "column-"; @@ -251,6 +257,23 @@ export function App() { } }, []); + // Coalesce ráfagas de board.invalidated (trailing debounce 300ms) — sin esto + // cada mutación remota dispara un refetch /api/board completo y la memoria + // del navegador crece sin techo. + const reloadTimerRef = useRef | null>(null); + const debouncedReload = useCallback(() => { + if (reloadTimerRef.current) clearTimeout(reloadTimerRef.current); + reloadTimerRef.current = setTimeout(() => { + reloadTimerRef.current = null; + reload(); + }, 300); + }, [reload]); + useEffect(() => { + return () => { + if (reloadTimerRef.current) clearTimeout(reloadTimerRef.current); + }; + }, []); + useEffect(() => { reload(); }, [reload]); @@ -326,12 +349,75 @@ export function App() { return () => clearInterval(t); }, [activeCard, activeColumnId]); + // Notifications state (populated by SSE + initial fetch). + const [notifs, setNotifs] = useState([]); + const [notifUnread, setNotifUnread] = useState(0); + + // Build version (injected at compile time via -ldflags). Fetched once. + const [appVersion, setAppVersion] = useState(""); useEffect(() => { - const t = setInterval(() => { - reload(); - }, 30000); - return () => clearInterval(t); - }, [reload]); + api + .getVersion() + .then((v) => setAppVersion(v.version)) + .catch(() => setAppVersion("")); + }, []); + + const [modulesOpen, setModulesOpen] = useState(false); + const [mcpTokensOpen, setMcpTokensOpen] = useState(false); + + const reloadNotifs = useCallback(async () => { + try { + const [list, c] = await Promise.all([api.listNotifications(false), api.unreadNotificationCount()]); + setNotifs(list); + setNotifUnread(c.count); + } catch { + // best-effort; SSE will reconcile + } + }, []); + + useEffect(() => { + if (auth.user) reloadNotifs(); + }, [auth.user, reloadNotifs]); + + // Replace 30s polling with SSE. Server pushes board.invalidated on every + // mutation, message.created on chat traffic and notification.created on + // per-user notifications. We refetch /api/board on invalidate (cheap + + // keeps merge logic simple) and patch notification state in-place. + useEventStream( + useMemo( + () => ({ + "board.invalidated": () => { + debouncedReload(); + }, + "notification.created": (payload: unknown) => { + const n = payload as Notification; + if (!n || !n.id) return; + setNotifs((prev) => (prev.some((x) => x.id === n.id) ? prev : [n, ...prev].slice(0, 100))); + setNotifUnread((c) => c + 1); + const who = n.actor_name || "Alguien"; + const card = n.card_seq_num ? `#${n.card_seq_num}` : n.card_title; + notifications.show({ + autoClose: 4000, + color: n.kind === "mention" ? "grape" : "blue", + title: `${who} en ${card}`, + message: n.snippet, + }); + }, + "notification.read": (payload: unknown) => { + const p = payload as { id?: string } | null; + if (!p?.id) return; + setNotifs((prev) => prev.map((x) => (x.id === p.id ? { ...x, read_at: new Date().toISOString() } : x))); + setNotifUnread((c) => Math.max(0, c - 1)); + }, + "notification.read_all": () => { + setNotifs((prev) => prev.map((x) => (x.read_at ? x : { ...x, read_at: new Date().toISOString() }))); + setNotifUnread(0); + }, + }), + [debouncedReload], + ), + !!auth.user, + ); useEffect(() => { if (!activeSticker) return; @@ -363,16 +449,21 @@ export function App() { (c: Card): boolean => { const term = searchTerm.trim().toLowerCase(); if (term) { + const seqStr = c.seq_num > 0 ? String(c.seq_num) : ""; + const seqPadded = c.seq_num > 0 ? String(c.seq_num).padStart(5, "0") : ""; const hay = [ c.title, c.description, c.requester, + seqStr, + seqPadded, ...(c.tags || []), ] .filter(Boolean) .join(" ") .toLowerCase(); - if (!hay.includes(term)) return false; + const normalizedTerm = term.replace(/^#/, "").replace(/^0+(?=\d)/, ""); + if (!hay.includes(term) && !(normalizedTerm && hay.includes(normalizedTerm))) return false; } if (filterAssigneeId && c.assignee_id !== filterAssigneeId) return false; if (filterUnassigned && c.assignee_id) return false; @@ -658,7 +749,7 @@ export function App() { }); }, [reload, users, auth.user, requesterOptions, tagOptions]); - const openEditCard = useCallback((card: Card) => { + const openEditCard = useCallback((card: Card, options?: { highlightMessageId?: string }) => { const id = modals.open({ title: "Editar tarjeta", size: "85%", @@ -669,6 +760,7 @@ export function App() { currentUserId={auth.user?.id} requesterOptions={requesterOptions} tagOptions={tagOptions} + highlightMessageId={options?.highlightMessageId} onCancel={() => modals.close(id)} onSubmit={async (v) => { try { @@ -1113,6 +1205,38 @@ export function App() { + {auth.user && ( + { + // Resolve the card across all possible buckets: live + // board, refreshed board, archive, trash. Notifications + // can point at any of them. + const find = (cs?: Card[]) => cs?.find((c) => c.id === cardId); + let card = find(board?.cards); + if (!card) { + await reload(); + const fresh = await api.getBoard(); + card = find(fresh.cards); + } + if (!card) { + const archived = await api.listArchive(); + card = find(archived); + } + if (!card) { + const trashed = await api.listTrash(); + card = find(trashed); + } + if (!card) { + notifications.show({ color: "red", message: "Card no encontrada" }); + return; + } + openEditCard(card, { highlightMessageId: messageId }); + }} + onChanged={reloadNotifs} + /> + )} setChatOpen((v) => !v)} @@ -1130,7 +1254,16 @@ export function App() { - {auth.user.display_name || auth.user.username} + + + + {auth.user.display_name || auth.user.username} + + {appVersion && ( + v{appVersion} + )} + + Color del avatar + {auth.user.is_admin && ( + } + onClick={() => setModulesOpen(true)} + > + Modulos + + )} + } + onClick={() => setMcpTokensOpen(true)} + > + MCP tokens + } color="red" @@ -1161,6 +1308,10 @@ export function App() { )} + {auth.user?.is_admin && ( + setModulesOpen(false)} /> + )} + setMcpTokensOpen(false)} /> diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 59c3649..fcad665 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -5,8 +5,12 @@ import type { CardHistoryResponse, CardMessage, Column, + KanbanModule, Metrics, MetricsFilter, + ModuleLog, + ModuleTestResult, + Notification, Sticker, User, } from "./types"; @@ -28,6 +32,10 @@ export function getFlags(): Promise> { return fetchJSON("/flags"); } +export function getVersion(): Promise<{ version: string }> { + return fetchJSON("/version"); +} + export function createColumn(name: string): Promise { return fetchJSON("/columns", { method: "POST", body: JSON.stringify({ name }) }); } @@ -292,6 +300,61 @@ export function chatWSURL(): string { return `${proto}//${window.location.host}/api/chat/ws`; } +export function cardChatWSURL(cardId: string): string { + const proto = window.location.protocol === "https:" ? "wss:" : "ws:"; + return `${proto}//${window.location.host}/api/cards/${cardId}/chat/ws`; +} + +export function listNotifications(unreadOnly = false): Promise { + return fetchJSON(`/notifications${unreadOnly ? "?unread=1" : ""}`); +} + +export function unreadNotificationCount(): Promise<{ count: number }> { + return fetchJSON("/notifications/unread-count"); +} + +export function markNotificationRead(id: string): Promise { + return fetchJSON(`/notifications/${id}/read`, { method: "POST" }); +} + +export function markAllNotificationsRead(): Promise<{ count: number }> { + return fetchJSON("/notifications/read-all", { method: "POST" }); +} + +export function listModules(): Promise { + return fetchJSON("/modules"); +} + +export interface ModuleInput { + name: string; + kind: string; + enabled: boolean; + event_filter: string[]; + config: Record; +} + +export function createModule(body: ModuleInput): Promise { + return fetchJSON("/modules", { method: "POST", body: JSON.stringify(body) }); +} + +export function updateModule(id: string, patch: Partial): Promise { + return fetchJSON(`/modules/${id}`, { method: "PATCH", body: JSON.stringify(patch) }); +} + +export function deleteModule(id: string): Promise { + return fetchJSON(`/modules/${id}`, { method: "DELETE" }); +} + +export function listModuleLogs(id: string, limit = 100): Promise { + return fetchJSON(`/modules/${id}/logs?limit=${limit}`); +} + +export function testModule(idOrDraft: string, body?: ModuleInput): Promise { + const init: RequestInit = { method: "POST" }; + if (body) init.body = JSON.stringify(body); + return fetchJSON(`/modules/${idOrDraft}/test`, init); +} + // streamChat opens a WebSocket, sends the message history, and streams events // to onEvent. Returns a Promise that resolves when the server closes the // connection (after a "done" event) and rejects on transport errors. @@ -417,6 +480,31 @@ export function deleteCardFile(fileId: string): Promise { return fetchJSON(`/files/${fileId}`, { method: "DELETE" }); } +// --- MCP per-user tokens ---------------------------------------------------- + +export interface MCPToken { + id: string; + name: string; + created_at: string; + last_used_at?: string; +} + +export interface MCPTokenCreated extends MCPToken { + token: string; +} + +export function createMCPToken(name: string): Promise { + return fetchJSON("/mcp-tokens", { method: "POST", body: JSON.stringify({ name }) }); +} + +export function listMCPTokens(): Promise { + return fetchJSON("/mcp-tokens"); +} + +export function revokeMCPToken(id: string): Promise { + return fetchJSON(`/mcp-tokens/${id}`, { method: "DELETE" }); +} + export function getMetrics(f: MetricsFilter): Promise { const qs = new URLSearchParams(); if (f.from) qs.set("from", f.from); diff --git a/frontend/src/components/CardChatPanel.tsx b/frontend/src/components/CardChatPanel.tsx index 00284dd..2fddea4 100644 --- a/frontend/src/components/CardChatPanel.tsx +++ b/frontend/src/components/CardChatPanel.tsx @@ -2,6 +2,7 @@ import { ActionIcon, Avatar, Box, + Combobox, FileButton, Group, Loader, @@ -11,10 +12,19 @@ import { Text, Textarea, Tooltip, + useCombobox, } from "@mantine/core"; import { IconPaperclip, IconSend, IconTrash } from "@tabler/icons-react"; import { notifications } from "@mantine/notifications"; -import { DragEvent, KeyboardEvent, useCallback, useEffect, useRef, useState } from "react"; +import { + DragEvent, + KeyboardEvent, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from "react"; import * as api from "../api"; import type { CardMessage, User } from "../types"; import { tagColor } from "./colors"; @@ -27,6 +37,9 @@ interface Props { currentUserId?: string; onMessagesChange?: (messages: CardMessage[]) => void; onFileUploaded?: () => void; + // When set, the panel scrolls the matching message into view and flashes a + // brief highlight (~2s). Used by notification click → open card. + highlightMessageId?: string; } function refForFile(filename: string, url: string, mime: string): string { @@ -34,16 +47,57 @@ function refForFile(filename: string, url: string, mime: string): string { return mime.startsWith("image/") ? `![${safe}](${url})` : `[${safe}](${url})`; } -export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, onFileUploaded }: Props) { +// Window for considering a peer "actively typing" after its last event. +const TYPING_LIFETIME_MS = 4000; +// Minimum gap between successive typing pings emitted while the user types. +const TYPING_THROTTLE_MS = 1500; + +interface MentionMatch { + start: number; // index of '@' in the textarea value + query: string; // text after '@', lowercased +} + +function detectMention(value: string, cursor: number): MentionMatch | null { + // Look backwards from cursor for an '@' that starts a word. + for (let i = cursor - 1; i >= 0 && cursor - i <= 64; i--) { + const ch = value[i]; + if (ch === "@") { + // Valid start: beginning of string or whitespace before. + if (i === 0 || /\s/.test(value[i - 1])) { + const q = value.slice(i + 1, cursor); + if (/^[a-z0-9_.-]*$/i.test(q)) { + return { start: i, query: q.toLowerCase() }; + } + } + return null; + } + if (/\s/.test(ch)) return null; + } + return null; +} + +export function CardChatPanel({ + cardId, + users, + currentUserId, + onMessagesChange, + onFileUploaded, + highlightMessageId, +}: Props) { const [messages, setMessages] = useState([]); const [loading, setLoading] = useState(true); const [body, setBody] = useState(""); const [sending, setSending] = useState(false); const [uploading, setUploading] = useState(false); const [dragOver, setDragOver] = useState(false); + const [typingUsers, setTypingUsers] = useState>({}); + const [mention, setMention] = useState(null); const viewportRef = useRef(null); + const wsRef = useRef(null); + const textareaRef = useRef(null); + const lastTypingEmitRef = useRef(0); - const usersById = new Map(users.map((u) => [u.id, u])); + const usersById = useMemo(() => new Map(users.map((u) => [u.id, u])), [users]); const reload = useCallback(async () => { try { @@ -61,22 +115,142 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, reload(); }, [reload]); + // Open one WebSocket per cardId for realtime chat + typing. + useEffect(() => { + const ws = new WebSocket(api.cardChatWSURL(cardId)); + wsRef.current = ws; + ws.onmessage = (ev) => { + try { + const data = JSON.parse(ev.data) as + | { type: "message.created"; message: CardMessage } + | { type: "typing"; user_id: string } + | { type: "error"; error: string }; + if (data.type === "message.created" && data.message) { + setMessages((prev) => { + if (prev.some((m) => m.id === data.message!.id)) return prev; + const next = [...prev, data.message!]; + onMessagesChange?.(next); + return next; + }); + } else if (data.type === "typing" && data.user_id) { + setTypingUsers((prev) => ({ ...prev, [data.user_id]: Date.now() })); + } else if (data.type === "error") { + notifications.show({ color: "red", message: data.error }); + } + } catch { + // ignore malformed + } + }; + ws.onerror = () => { + // browser will report; we keep the panel functional via REST fallback + }; + return () => { + ws.close(); + wsRef.current = null; + }; + }, [cardId, onMessagesChange]); + + // Sweep stale typing entries. + useEffect(() => { + const t = setInterval(() => { + const now = Date.now(); + setTypingUsers((prev) => { + const next: Record = {}; + for (const [k, v] of Object.entries(prev)) { + if (now - v < TYPING_LIFETIME_MS) next[k] = v; + } + return next; + }); + }, 1000); + return () => clearInterval(t); + }, []); + useEffect(() => { if (viewportRef.current) { viewportRef.current.scrollTo({ top: viewportRef.current.scrollHeight, behavior: "smooth" }); } }, [messages.length]); + // Scroll to + briefly pulse the message that triggered an incoming + // notification. Runs whenever the highlight id changes AND the message + // is present in the list (it may arrive asynchronously after WS sync). + const [pulse, setPulse] = useState(null); + useEffect(() => { + if (!highlightMessageId) return; + if (!messages.some((m) => m.id === highlightMessageId)) return; + const el = document.querySelector(`[data-msg-id="${highlightMessageId}"]`); + if (el && el instanceof HTMLElement) { + el.scrollIntoView({ behavior: "smooth", block: "center" }); + } + setPulse(highlightMessageId); + const t = setTimeout(() => setPulse(null), 2200); + return () => clearTimeout(t); + }, [highlightMessageId, messages]); + + const sendTypingPing = () => { + const ws = wsRef.current; + if (!ws || ws.readyState !== WebSocket.OPEN) return; + const now = Date.now(); + if (now - lastTypingEmitRef.current < TYPING_THROTTLE_MS) return; + lastTypingEmitRef.current = now; + ws.send(JSON.stringify({ type: "typing" })); + }; + + const combobox = useCombobox({ + onDropdownClose: () => setMention(null), + }); + + const mentionCandidates = useMemo(() => { + if (!mention) return [] as User[]; + return users + .filter((u) => u.username.toLowerCase().startsWith(mention.query)) + .slice(0, 8); + }, [users, mention]); + + useEffect(() => { + if (mention && mentionCandidates.length > 0) { + combobox.openDropdown(); + combobox.selectFirstOption(); + } else { + combobox.closeDropdown(); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [mention?.query, mentionCandidates.length]); + + const insertMention = (username: string) => { + if (!mention) return; + const before = body.slice(0, mention.start); + const after = body.slice(mention.start + 1 + mention.query.length); + const inserted = `@${username} `; + const next = before + inserted + after; + setBody(next); + setMention(null); + // Restore caret right after the inserted mention. + requestAnimationFrame(() => { + const el = textareaRef.current; + if (!el) return; + const pos = (before + inserted).length; + el.focus(); + el.setSelectionRange(pos, pos); + }); + }; + const send = async () => { const text = body.trim(); if (!text || sending) return; setSending(true); + const ws = wsRef.current; try { - const m = await api.createCardMessage(cardId, text); - const next = [...messages, m]; - setMessages(next); - onMessagesChange?.(next); - setBody(""); + if (ws && ws.readyState === WebSocket.OPEN) { + ws.send(JSON.stringify({ type: "send", body: text })); + // Optimistic clear; server will broadcast the persisted message. + setBody(""); + } else { + const m = await api.createCardMessage(cardId, text); + setMessages((prev) => [...prev, m]); + onMessagesChange?.([...messages, m]); + setBody(""); + } } catch (e) { notifications.show({ color: "red", message: (e as Error).message }); } finally { @@ -95,7 +269,25 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, } }; + const onChange = (e: React.ChangeEvent) => { + setBody(e.currentTarget.value); + sendTypingPing(); + const cursor = e.currentTarget.selectionStart ?? e.currentTarget.value.length; + setMention(detectMention(e.currentTarget.value, cursor)); + }; + const onKeyDown = (e: KeyboardEvent) => { + if (mention && mentionCandidates.length > 0 && (e.key === "Enter" || e.key === "Tab")) { + e.preventDefault(); + const sel = combobox.getSelectedOptionIndex(); + const pick = mentionCandidates[Math.max(0, sel)]; + if (pick) insertMention(pick.username); + return; + } + if (mention && e.key === "Escape") { + setMention(null); + return; + } if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); send(); @@ -143,6 +335,13 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, setDragOver(false); }; + const typingNames = Object.keys(typingUsers) + .filter((uid) => uid !== currentUserId) + .map((uid) => { + const u = usersById.get(uid); + return u?.display_name || u?.username || "alguien"; + }); + return ( @@ -213,47 +424,81 @@ export function CardChatPanel({ cardId, users, currentUserId, onMessagesChange, )} - -