@meridianjs/admin-dashboard 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ProjectTimelinePage-oqySkZ6R.js → ProjectTimelinePage-5sYFj4UJ.js} +1 -1
- package/dist/assets/{WorkspaceReportingPage-D1qMIJKD.js → WorkspaceReportingPage-O-m_dFIA.js} +1 -1
- package/dist/assets/index-9nouokxr.css +1 -0
- package/dist/assets/index-DtooOXiQ.js +590 -0
- package/dist/assets/{vendor-editor-Ba0DY8XI.js → vendor-editor-BmhD0BxF.js} +3 -3
- package/dist/index.html +3 -3
- package/package.json +3 -1
- package/dist/assets/index-BXa3XWQh.css +0 -1
- package/dist/assets/index-Dgo8ue8R.js +0 -590
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-5sYFj4UJ.js","assets/vendor-query-DtBTlSlq.js","assets/vendor-react-aoclG454.js","assets/vendor-radix-Bj-t5iGX.js","assets/vendor-dnd-6EGxH1Lf.js","assets/vendor-editor-BmhD0BxF.js","assets/WorkspaceReportingPage-O-m_dFIA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var TM=Object.defineProperty;var IM=(e,t,r)=>t in e?TM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Zf=(e,t,r)=>IM(e,typeof t!="symbol"?t+"":t,r);import{j as a,u as Be,a as we,b as ye,R as RM,Q as $M,c as zM}from"./vendor-query-DtBTlSlq.js";import{a as bp,c as T,r as p,b as LM,u as Ht,d as uu,N as aa,e as Ct,L as Za,O as Ol,f as fu,g as Sa,R as FM,h as xc,i as BM,j as Ye,k as Ka,B as WM}from"./vendor-react-aoclG454.js";import{C as ij,R as UM,T as qM,P as HM,S as wp,a as oj,O as ni,b as Ml,c as ai,d as mu,e as Gi,D as Vi,f as Pl,g as lj,h as cj,i as KM,j as dj,I as uj,k as fj,l as mj,m as hj,L as pj,n as gj,o as YM,p as GM,q as xj,r as vj,F as yj,u as Si,t as as,s as VM,v as bj,w as wj,x as XM,y as jj,z as Nj,A as QM,B as kj,V as ZM,E as Sj,G as Cj,H as JM,J as eP,K as _j,M as tP,N as rP,Q as nP,U as Oj,W as aP,X as sP,Y as Mj,Z as hu,_ as iP,$ as Ns,a0 as oP,a1 as lP,a2 as Pj,a3 as cP,a4 as dP,a5 as Aj,a6 as uP,a7 as fP,a8 as Ej,a9 as mP,aa as hP,ab as pP,ac as gP,ad as xP,ae as vP,af as yP,ag as bP,ah as wP,ai as jP,aj as NP,ak as Dj,al as kP,am as SP,an as CP,ao as _P,ap as OP,aq as MP}from"./vendor-radix-Bj-t5iGX.js";import{u as Tj,a as jp,P as Ij,D as el,S as Np,h as Rj,b as Vc,c as kp,C as Sp,d as PP,v as AP,r as EP,e as DP,f as TP,M as IP,g as $j}from"./vendor-dnd-6EGxH1Lf.js";import{P as zj,a as RP,D as $P,b as zP,e as LP,N as FP,c as BP,d as WP,m as vc,E as UP,u as Lj,i as Fj,f as Bj,g as Wj,h as Uj,j as qP,k as HP,w as KP}from"./vendor-editor-BmhD0BxF.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var qj,xv=bp;qj=xv.createRoot,xv.hydrateRoot;const YP="modulepreload",GP=function(e){return"/"+e},vv={},Hj=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=GP(c),c in vv)return;vv[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":YP,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,h)=>{f.addEventListener("load",m),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var VP=function(){return null},XP=e=>{switch(e){case"success":return JP;case"info":return tA;case"warning":return eA;case"error":return rA;default:return null}},QP=Array(12).fill(0),ZP=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},QP.map((r,n)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),JP=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eA=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tA=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),rA=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nA=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aA=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},th=1,sA=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:th++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],T.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(oA(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||th++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_r=new sA,iA=(e,t)=>{let r=(t==null?void 0:t.id)||th++;return _r.addToast({title:e,...t,id:r}),r},oA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lA=iA,cA=()=>_r.toasts,dA=()=>_r.getActiveToasts(),F=Object.assign(lA,{success:_r.success,info:_r.info,warning:_r.warning,error:_r.error,custom:_r.custom,message:_r.message,promise:_r.promise,dismiss:_r.dismiss,loading:_r.loading},{getHistory:cA,getToasts:dA});function uA(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}uA(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
3
|
+
`);function yc(e){return e.label!==void 0}var fA=3,mA="32px",hA="16px",yv=4e3,pA=356,gA=14,xA=20,vA=200;function fn(...e){return e.filter(Boolean).join(" ")}function yA(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var bA=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:m,toast:h,unstyled:g,interacting:x,setHeights:v,visibleToasts:y,heights:w,index:j,toasts:N,expanded:k,removeToast:b,defaultRichColors:S,closeButton:_,style:C,cancelButtonStyle:E,actionButtonStyle:P,className:O="",descriptionClassName:$="",duration:D,position:B,gap:A,loadingIcon:W,expandByDefault:Q,classNames:K,icons:ie,closeButtonAriaLabel:ne="Close toast",pauseWhenPageIsHidden:U}=e,[Y,Z]=T.useState(null),[G,M]=T.useState(null),[z,se]=T.useState(!1),[L,q]=T.useState(!1),[de,X]=T.useState(!1),[Me,ae]=T.useState(!1),[Ce,_e]=T.useState(!1),[Pe,De]=T.useState(0),[V,Oe]=T.useState(0),Te=T.useRef(h.duration||D||yv),xt=T.useRef(null),Ge=T.useRef(null),Ot=j===0,Sr=j+1<=y,ut=h.type,jt=h.dismissible!==!1,Xr=h.className||"",za=h.descriptionClassName||"",Qr=T.useMemo(()=>w.findIndex(re=>re.toastId===h.id)||0,[w,h.id]),Qn=T.useMemo(()=>{var re;return(re=h.closeButton)!=null?re:_},[h.closeButton,_]),zr=T.useMemo(()=>h.duration||D||yv,[h.duration,D]),Lr=T.useRef(0),fr=T.useRef(0),sr=T.useRef(0),Xt=T.useRef(null),[_n,Zn]=B.split("-"),Ne=T.useMemo(()=>w.reduce((re,be,Ee)=>Ee>=Qr?re:re+be.height,0),[w,Qr]),ue=aA(),pe=h.invert||m,ce=ut==="loading";fr.current=T.useMemo(()=>Qr*A+Ne,[Qr,Ne]),T.useEffect(()=>{Te.current=zr},[zr]),T.useEffect(()=>{se(!0)},[]),T.useEffect(()=>{let re=Ge.current;if(re){let be=re.getBoundingClientRect().height;return Oe(be),v(Ee=>[{toastId:h.id,height:be,position:h.position},...Ee]),()=>v(Ee=>Ee.filter(ft=>ft.toastId!==h.id))}},[v,h.id]),T.useLayoutEffect(()=>{if(!z)return;let re=Ge.current,be=re.style.height;re.style.height="auto";let Ee=re.getBoundingClientRect().height;re.style.height=be,Oe(Ee),v(ft=>ft.find(Qe=>Qe.toastId===h.id)?ft.map(Qe=>Qe.toastId===h.id?{...Qe,height:Ee}:Qe):[{toastId:h.id,height:Ee,position:h.position},...ft])},[z,h.title,h.description,v,h.id]);let me=T.useCallback(()=>{q(!0),De(fr.current),v(re=>re.filter(be=>be.toastId!==h.id)),setTimeout(()=>{b(h)},vA)},[h,b,v,fr]);T.useEffect(()=>{if(h.promise&&ut==="loading"||h.duration===1/0||h.type==="loading")return;let re;return k||x||U&&ue?(()=>{if(sr.current<Lr.current){let be=new Date().getTime()-Lr.current;Te.current=Te.current-be}sr.current=new Date().getTime()})():Te.current!==1/0&&(Lr.current=new Date().getTime(),re=setTimeout(()=>{var be;(be=h.onAutoClose)==null||be.call(h,h),me()},Te.current)),()=>clearTimeout(re)},[k,x,h,ut,U,ue,me]),T.useEffect(()=>{h.delete&&me()},[me,h.delete]);function He(){var re,be,Ee;return ie!=null&&ie.loading?T.createElement("div",{className:fn(K==null?void 0:K.loader,(re=h==null?void 0:h.classNames)==null?void 0:re.loader,"sonner-loader"),"data-visible":ut==="loading"},ie.loading):W?T.createElement("div",{className:fn(K==null?void 0:K.loader,(be=h==null?void 0:h.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":ut==="loading"},W):T.createElement(ZP,{className:fn(K==null?void 0:K.loader,(Ee=h==null?void 0:h.classNames)==null?void 0:Ee.loader),visible:ut==="loading"})}return T.createElement("li",{tabIndex:0,ref:Ge,className:fn(O,Xr,K==null?void 0:K.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[ut],(r=h==null?void 0:h.classNames)==null?void 0:r[ut]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:S,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":z,"data-promise":!!h.promise,"data-swiped":Ce,"data-removed":L,"data-visible":Sr,"data-y-position":_n,"data-x-position":Zn,"data-index":j,"data-front":Ot,"data-swiping":de,"data-dismissible":jt,"data-type":ut,"data-invert":pe,"data-swipe-out":Me,"data-swipe-direction":G,"data-expanded":!!(k||Q&&z),style:{"--index":j,"--toasts-before":j,"--z-index":N.length-j,"--offset":`${L?Pe:fr.current}px`,"--initial-height":Q?"auto":`${V}px`,...C,...h.style},onDragEnd:()=>{X(!1),Z(null),Xt.current=null},onPointerDown:re=>{ce||!jt||(xt.current=new Date,De(fr.current),re.target.setPointerCapture(re.pointerId),re.target.tagName!=="BUTTON"&&(X(!0),Xt.current={x:re.clientX,y:re.clientY}))},onPointerUp:()=>{var re,be,Ee,ft;if(Me||!jt)return;Xt.current=null;let Qe=Number(((re=Ge.current)==null?void 0:re.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ze=Number(((be=Ge.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mr=new Date().getTime()-((Ee=xt.current)==null?void 0:Ee.getTime()),Qt=Y==="x"?Qe:Ze,On=Math.abs(Qt)/mr;if(Math.abs(Qt)>=xA||On>.11){De(fr.current),(ft=h.onDismiss)==null||ft.call(h,h),M(Y==="x"?Qe>0?"right":"left":Ze>0?"down":"up"),me(),ae(!0),_e(!1);return}X(!1),Z(null)},onPointerMove:re=>{var be,Ee,ft,Qe;if(!Xt.current||!jt||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;let Ze=re.clientY-Xt.current.y,mr=re.clientX-Xt.current.x,Qt=(Ee=e.swipeDirections)!=null?Ee:yA(B);!Y&&(Math.abs(mr)>1||Math.abs(Ze)>1)&&Z(Math.abs(mr)>Math.abs(Ze)?"x":"y");let On={x:0,y:0};Y==="y"?(Qt.includes("top")||Qt.includes("bottom"))&&(Qt.includes("top")&&Ze<0||Qt.includes("bottom")&&Ze>0)&&(On.y=Ze):Y==="x"&&(Qt.includes("left")||Qt.includes("right"))&&(Qt.includes("left")&&mr<0||Qt.includes("right")&&mr>0)&&(On.x=mr),(Math.abs(On.x)>0||Math.abs(On.y)>0)&&_e(!0),(ft=Ge.current)==null||ft.style.setProperty("--swipe-amount-x",`${On.x}px`),(Qe=Ge.current)==null||Qe.style.setProperty("--swipe-amount-y",`${On.y}px`)}},Qn&&!h.jsx?T.createElement("button",{"aria-label":ne,"data-disabled":ce,"data-close-button":!0,onClick:ce||!jt?()=>{}:()=>{var re;me(),(re=h.onDismiss)==null||re.call(h,h)},className:fn(K==null?void 0:K.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=ie==null?void 0:ie.close)!=null?i:nA):null,h.jsx||p.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,ut||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:fn(K==null?void 0:K.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||He():null,h.type!=="loading"?h.icon||(ie==null?void 0:ie[ut])||XP(ut):null):null,T.createElement("div",{"data-content":"",className:fn(K==null?void 0:K.content,(l=h==null?void 0:h.classNames)==null?void 0:l.content)},T.createElement("div",{"data-title":"",className:fn(K==null?void 0:K.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:fn($,za,K==null?void 0:K.description,(d=h==null?void 0:h.classNames)==null?void 0:d.description)},typeof h.description=="function"?h.description():h.description):null),p.isValidElement(h.cancel)?h.cancel:h.cancel&&yc(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||E,onClick:re=>{var be,Ee;yc(h.cancel)&&jt&&((Ee=(be=h.cancel).onClick)==null||Ee.call(be,re),me())},className:fn(K==null?void 0:K.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,p.isValidElement(h.action)?h.action:h.action&&yc(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||P,onClick:re=>{var be,Ee;yc(h.action)&&((Ee=(be=h.action).onClick)==null||Ee.call(be,re),!re.defaultPrevented&&me())},className:fn(K==null?void 0:K.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function bv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wA(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?hA:mA;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}var jA=p.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:h,visibleToasts:g=fA,toastOptions:x,dir:v=bv(),gap:y=gA,loadingIcon:w,icons:j,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:k}=e,[b,S]=T.useState([]),_=T.useMemo(()=>Array.from(new Set([n].concat(b.filter(U=>U.position).map(U=>U.position)))),[b,n]),[C,E]=T.useState([]),[P,O]=T.useState(!1),[$,D]=T.useState(!1),[B,A]=T.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=T.useRef(null),Q=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=T.useRef(null),ie=T.useRef(!1),ne=T.useCallback(U=>{S(Y=>{var Z;return(Z=Y.find(G=>G.id===U.id))!=null&&Z.delete||_r.dismiss(U.id),Y.filter(({id:G})=>G!==U.id)})},[]);return T.useEffect(()=>_r.subscribe(U=>{if(U.dismiss){S(Y=>Y.map(Z=>Z.id===U.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{LM.flushSync(()=>{S(Y=>{let Z=Y.findIndex(G=>G.id===U.id);return Z!==-1?[...Y.slice(0,Z),{...Y[Z],...U},...Y.slice(Z+1)]:[U,...Y]})})})}),[]),T.useEffect(()=>{if(u!=="system"){A(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:Y})=>{A(Y?"dark":"light")})}catch{U.addListener(({matches:Z})=>{try{A(Z?"dark":"light")}catch(G){console.error(G)}})}},[u]),T.useEffect(()=>{b.length<=1&&O(!1)},[b]),T.useEffect(()=>{let U=Y=>{var Z,G;s.every(M=>Y[M]||Y.code===M)&&(O(!0),(Z=W.current)==null||Z.focus()),Y.code==="Escape"&&(document.activeElement===W.current||(G=W.current)!=null&&G.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[s]),T.useEffect(()=>{if(W.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,ie.current=!1)}},[W.current]),T.createElement("section",{ref:t,"aria-label":`${N} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((U,Y)=>{var Z;let[G,M]=U.split("-");return b.length?T.createElement("ol",{key:U,dir:v==="auto"?bv():v,tabIndex:-1,ref:W,className:l,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":G,"data-lifted":P&&b.length>1&&!i,"data-x-position":M,style:{"--front-toast-height":`${((Z=C[0])==null?void 0:Z.height)||0}px`,"--width":`${pA}px`,"--gap":`${y}px`,...h,...wA(c,d)},onBlur:z=>{ie.current&&!z.currentTarget.contains(z.relatedTarget)&&(ie.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||ie.current||(ie.current=!0,K.current=z.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{$||O(!1)},onDragEnd:()=>O(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},b.filter(z=>!z.position&&Y===0||z.position===U).map((z,se)=>{var L,q;return T.createElement(bA,{key:z.id,icons:j,index:se,toast:z,defaultRichColors:f,duration:(L=x==null?void 0:x.duration)!=null?L:m,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:g,closeButton:(q=x==null?void 0:x.closeButton)!=null?q:o,interacting:$,position:U,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:ne,toasts:b.filter(de=>de.position==z.position),heights:C.filter(de=>de.position==z.position),setHeights:E,expandByDefault:i,gap:y,loadingIcon:w,expanded:P,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),NA=(e,t,r,n,s,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(g=>{let x=g==="class",v=x&&i?s.map(y=>i[y]||y):s;x?(c.classList.remove(...v),c.classList.add(i&&i[h]?i[h]:h)):c.setAttribute(g,h)}),f(h)}function f(h){l&&d.includes(h)&&(c.style.colorScheme=h)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)u(n);else try{let h=localStorage.getItem(t)||r,g=o&&h==="system"?m():h;u(g)}catch{}},wv=["light","dark"],Kj="(prefers-color-scheme: dark)",kA=typeof window>"u",Cp=p.createContext(void 0),SA={setTheme:e=>{},themes:[]},CA=()=>{var e;return(e=p.useContext(Cp))!=null?e:SA},_A=e=>p.useContext(Cp)?p.createElement(p.Fragment,null,e.children):p.createElement(MA,{...e}),OA=["light","dark"],MA=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=OA,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,h]=p.useState(()=>AA(s,o)),[g,x]=p.useState(()=>m==="system"?Jf():m),v=c?Object.values(c):i,y=p.useCallback(k=>{let b=k;if(!b)return;k==="system"&&r&&(b=Jf());let S=c?c[b]:b,_=t?EA(u):null,C=document.documentElement,E=P=>{P==="class"?(C.classList.remove(...v),S&&C.classList.add(S)):P.startsWith("data-")&&(S?C.setAttribute(P,S):C.removeAttribute(P))};if(Array.isArray(l)?l.forEach(E):E(l),n){let P=wv.includes(o)?o:null,O=wv.includes(b)?b:P;C.style.colorScheme=O}_==null||_()},[u]),w=p.useCallback(k=>{let b=typeof k=="function"?k(m):k;h(b);try{localStorage.setItem(s,b)}catch{}},[m]),j=p.useCallback(k=>{let b=Jf(k);x(b),m==="system"&&r&&!e&&y("system")},[m,e]);p.useEffect(()=>{let k=window.matchMedia(Kj);return k.addListener(j),j(k),()=>k.removeListener(j)},[j]),p.useEffect(()=>{let k=b=>{b.key===s&&(b.newValue?h(b.newValue):w(o))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[w]),p.useEffect(()=>{y(e??m)},[e,m]);let N=p.useMemo(()=>({theme:m,setTheme:w,forcedTheme:e,resolvedTheme:m==="system"?g:m,themes:r?[...i,"system"]:i,systemTheme:r?g:void 0}),[m,w,e,g,r,i]);return p.createElement(Cp.Provider,{value:N},p.createElement(PA,{forcedTheme:e,storageKey:s,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},PA=p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([r,t,i,e,l,o,n,s]).slice(1,-1);return p.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${NA.toString()})(${u})`}})}),AA=(e,t)=>{if(kA)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},EA=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Jf=e=>(e||(e=window.matchMedia(Kj)),e.matches?"dark":"light");function DA({children:e}){return a.jsx(_A,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const Yj=p.createContext(null),ps="meridian_token",No="meridian_user",bc="meridian_workspace";function jv(e){try{const t=e.split(".")[1],r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return{roles:Array.isArray(n.roles)?n.roles:[],permissions:Array.isArray(n.permissions)?n.permissions:[]}}catch{return{roles:[],permissions:[]}}}function TA({children:e}){const[t,r]=p.useState(()=>{try{const f=localStorage.getItem(No),m=localStorage.getItem(ps);if(!f)return null;const h=JSON.parse(f),{roles:g,permissions:x}=m?jv(m):{roles:[],permissions:[]};return h.roles=g,h.permissions=x,h}catch{return null}}),[n,s]=p.useState(()=>{const f=localStorage.getItem(ps),m=localStorage.getItem(No);return f&&!m?(localStorage.removeItem(ps),null):f}),[i,o]=p.useState(()=>{try{const f=localStorage.getItem(bc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const{roles:h,permissions:g}=jv(m),x={...f,roles:h,permissions:g};r(x),s(m),localStorage.setItem(ps,m),localStorage.setItem(No,JSON.stringify(x))},c=()=>{const f=localStorage.getItem(ps);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),s(null),o(null),localStorage.removeItem(ps),localStorage.removeItem(No),localStorage.removeItem(bc)};p.useEffect(()=>{const f=()=>{localStorage.getItem(ps)&&c()};return window.addEventListener("meridian:unauthorized",f),()=>window.removeEventListener("meridian:unauthorized",f)},[]);const d=f=>{o(f),f?localStorage.setItem(bc,JSON.stringify(f)):localStorage.removeItem(bc)},u=f=>{r(m=>{if(!m)return m;const h={...m,...f};return localStorage.setItem(No,JSON.stringify(h)),h})};return a.jsx(Yj.Provider,{value:{user:t,token:n,workspace:i,isAuthenticated:!!n&&!!t,login:l,logout:c,setWorkspace:d,updateLocalUser:u},children:e})}function Ie(){const e=p.useContext(Yj);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const Gj=p.createContext(null);function IA({children:e}){const[t,r]=p.useState(!1);return p.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),r(i=>!i))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),a.jsx(Gj.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function Vj(){const e=p.useContext(Gj);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function Xj(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Xj(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function tt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Xj(e))&&(n&&(n+=" "),n+=t);return n}const _p="-",RA=e=>{const t=zA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(_p);return l[0]===""&&l.length!==1&&l.shift(),Qj(l,t)||$A(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},Qj=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?Qj(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(_p);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Nv=/^\[(.+)\]$/,$A=e=>{if(Nv.test(e)){const t=Nv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},zA=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return FA(Object.entries(e.classGroups),r).forEach(([i,o])=>{rh(o,n,i,t)}),n},rh=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:kv(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(LA(s)){rh(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{rh(o,kv(t,i),r,n)})})},kv=(e,t)=>{let r=e;return t.split(_p).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},LA=e=>e.isThemeGetter,FA=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,s]}):e,BA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Zj="!",WA=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,f;for(let v=0;v<l.length;v++){let y=l[v];if(d===0){if(y===s&&(n||l.slice(v,v+i)===t)){c.push(l.slice(u,v)),u=v+i;continue}if(y==="/"){f=v;continue}}y==="["?d++:y==="]"&&d--}const m=c.length===0?l:l.substring(u),h=m.startsWith(Zj),g=h?m.substring(1):m,x=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:x}};return r?l=>r({className:l,parseClassName:o}):o},UA=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},qA=e=>({cache:BA(e.cacheSize),parseClassName:WA(e),...RA(e)}),HA=/\s+/,KA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(HA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:h}=r(d);let g=!!h,x=n(g?m.substring(0,h):m);if(!x){if(!g){l=d+(l.length>0?" "+l:l);continue}if(x=n(m),!x){l=d+(l.length>0?" "+l:l);continue}g=!1}const v=UA(u).join(":"),y=f?v+Zj:v,w=y+x;if(i.includes(w))continue;i.push(w);const j=s(x,g);for(let N=0;N<j.length;++N){const k=j[N];i.push(y+k)}l=d+(l.length>0?" "+l:l)}return l};function YA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Jj(t))&&(n&&(n+=" "),n+=r);return n}const Jj=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Jj(e[n]))&&(r&&(r+=" "),r+=t);return r};function GA(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=qA(d),n=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=KA(c,r);return s(c,u),u}return function(){return i(YA.apply(null,arguments))}}const it=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},e1=/^\[(?:([a-z-]+):)?(.+)\]$/i,VA=/^\d+\/\d+$/,XA=new Set(["px","full","screen"]),QA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,JA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ta=e=>Ci(e)||XA.has(e)||VA.test(e),La=e=>Xi(e,"length",cE),Ci=e=>!!e&&!Number.isNaN(Number(e)),em=e=>Xi(e,"number",Ci),ko=e=>!!e&&Number.isInteger(Number(e)),rE=e=>e.endsWith("%")&&Ci(e.slice(0,-1)),Re=e=>e1.test(e),Fa=e=>QA.test(e),nE=new Set(["length","size","percentage"]),aE=e=>Xi(e,nE,t1),sE=e=>Xi(e,"position",t1),iE=new Set(["image","url"]),oE=e=>Xi(e,iE,uE),lE=e=>Xi(e,"",dE),So=()=>!0,Xi=(e,t,r)=>{const n=e1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},cE=e=>ZA.test(e)&&!JA.test(e),t1=()=>!1,dE=e=>eE.test(e),uE=e=>tE.test(e),fE=()=>{const e=it("colors"),t=it("spacing"),r=it("blur"),n=it("brightness"),s=it("borderColor"),i=it("borderRadius"),o=it("borderSpacing"),l=it("borderWidth"),c=it("contrast"),d=it("grayscale"),u=it("hueRotate"),f=it("invert"),m=it("gap"),h=it("gradientColorStops"),g=it("gradientColorStopPositions"),x=it("inset"),v=it("margin"),y=it("opacity"),w=it("padding"),j=it("saturate"),N=it("scale"),k=it("sepia"),b=it("skew"),S=it("space"),_=it("translate"),C=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Re,t],O=()=>[Re,t],$=()=>["",ta,La],D=()=>["auto",Ci,Re],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Re],ie=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ne=()=>[Ci,Re];return{cacheSize:500,separator:":",theme:{colors:[So],spacing:[ta,La],blur:["none","",Fa,Re],brightness:ne(),borderColor:[e],borderRadius:["none","","full",Fa,Re],borderSpacing:O(),borderWidth:$(),contrast:ne(),grayscale:K(),hueRotate:ne(),invert:K(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[rE,La],inset:P(),margin:P(),opacity:ne(),padding:O(),saturate:ne(),scale:ne(),sepia:K(),skew:ne(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[Fa]}],"break-after":[{"break-after":ie()}],"break-before":[{"break-before":ie()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),Re]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ko,Re]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",ko,Re]}],"grid-cols":[{"grid-cols":[So]}],"col-start-end":[{col:["auto",{span:["full",ko,Re]},Re]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[So]}],"row-start-end":[{row:["auto",{span:[ko,Re]},Re]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[Fa]},Fa]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Fa,La]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",em]}],"font-family":[{font:[So]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Re]}],"line-clamp":[{"line-clamp":["none",Ci,em]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ta,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ta,La]}],"underline-offset":[{"underline-offset":["auto",ta,Re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),sE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",aE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oE]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:A()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[ta,Re]}],"outline-w":[{outline:[ta,La]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ta,La]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Fa,lE]}],"shadow-color":[{shadow:[So]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Fa,Re]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[j]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[ko,Re]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ta,La,em]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mE=GA(fE);function I(...e){return mE(tt(e))}const pu=HM,Ya=UM,Ga=qM,fa=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(ij,{ref:n,sideOffset:t,className:I("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));fa.displayName=ij.displayName;const r1=p.createContext([]);function hE({widgets:e,children:t}){return T.createElement(r1.Provider,{value:e},t)}function pE(e){return p.useContext(r1).filter(r=>r.zone===e).map(r=>r.component)}var aj;const Ai=((aj=window.__MERIDIAN_CONFIG__)==null?void 0:aj.apiUrl)??void 0??"";class Op extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function n1(){return localStorage.getItem("meridian_token")}async function Co(e,t={}){var i;const r=n1(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ai}${e}`,{...t,headers:n});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new Op(s.status,l,o)}if(s.status!==204)return s.json()}const te={get:e=>Co(e,{method:"GET"}),post:(e,t)=>Co(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Co(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Co(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Co(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=n1(),n={};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ai}${e}`,{method:"POST",headers:n,body:t});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new Op(s.status,l,o)}if(s.status!==204)return s.json()}},Et={all:["issues"],byProject:(e,t)=>[...Et.all,"project",e,...t?[t]:[]],detail:e=>[...Et.all,e],comments:e=>[...Et.all,e,"comments"],activities:e=>[...Et.all,e,"activities"]};function Al(e,t){return Be({queryKey:e?Et.byProject(e,t):Et.all,queryFn:()=>{var n,s,i;const r=new URLSearchParams;return e&&r.set("project_id",e),(n=t==null?void 0:t.priority)!=null&&n.length&&r.set("priority",t.priority.join(",")),t!=null&&t.assignee_id&&r.set("assignee_id",t.assignee_id),(s=t==null?void 0:t.type)!=null&&s.length&&r.set("type",t.type.join(",")),(i=t==null?void 0:t.status)!=null&&i.length&&r.set("status",t.status.join(",")),te.get(`/admin/issues?${r}`)},select:r=>r.issues,enabled:e!==void 0?!!e:!0})}function a1(e){return Be({queryKey:Et.detail(e),queryFn:()=>te.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function gE(e){return Be({queryKey:Et.comments(e),queryFn:()=>te.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function s1(){const e=we();return ye({mutationFn:t=>te.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Et.byProject(r.project_id)})}})}function gu(e,t){const r=we();return ye({mutationFn:n=>te.put(`/admin/issues/${e}`,n),onMutate:async n=>{await r.cancelQueries({queryKey:Et.byProject(t)});const s=r.getQueryData(Et.byProject(t));return r.setQueryData(Et.byProject(t),i=>i&&{...i,issues:i.issues.map(o=>o.id===e?{...o,...n}:o)}),{previous:s}},onError:(n,s,i)=>{i!=null&&i.previous&&r.setQueryData(Et.byProject(t),i.previous)},onSettled:()=>{r.invalidateQueries({queryKey:Et.byProject(t)}),r.invalidateQueries({queryKey:Et.detail(e)})}})}function xE(e){return Be({queryKey:Et.activities(e),queryFn:()=>te.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function vE(e){const t=we();return ye({mutationFn:({body:r,metadata:n})=>te.post(`/admin/issues/${e}/comments`,{body:r,metadata:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Et.comments(e)})}})}const Sv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Cv=tt,El=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Cv(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],f=i==null?void 0:i[d];if(u===null)return null;const m=Sv(u)||Sv(f);return s[d][m]}),l=r&&Object.entries(r).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(g=>{let[x,v]=g;return Array.isArray(v)?v.includes({...i,...l}[x]):{...i,...l}[x]===v})?[...d,f,m]:d},[]);return Cv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},_i=El("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",indigo:"bg-indigo text-indigo-foreground hover:opacity-90"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),J=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?wp:"button";return a.jsx(o,{className:I(_i({variant:t,size:r,className:e})),ref:i,...s})});J.displayName="Button";const Ae=p.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:I("flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm shadow-none transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[#9ca3af] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Ae.displayName="Input";/**
|
|
4
|
+
* @license lucide-react v0.468.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the ISC license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/const yE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i1=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
9
|
+
* @license lucide-react v0.468.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/var bE={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"};/**
|
|
14
|
+
* @license lucide-react v0.468.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/const wE=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>p.createElement("svg",{ref:c,...bE,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:i1("lucide",s),...l},[...o.map(([d,u])=>p.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
19
|
+
* @license lucide-react v0.468.0 - ISC
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the ISC license.
|
|
22
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/const ee=(e,t)=>{const r=p.forwardRef(({className:n,...s},i)=>p.createElement(wE,{ref:i,iconNode:t,className:i1(`lucide-${yE(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
24
|
+
* @license lucide-react v0.468.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/const xu=ee("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
29
|
+
* @license lucide-react v0.468.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/const Dl=ee("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
34
|
+
* @license lucide-react v0.468.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/const Mp=ee("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
39
|
+
* @license lucide-react v0.468.0 - ISC
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the ISC license.
|
|
42
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/const Pp=ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
44
|
+
* @license lucide-react v0.468.0 - ISC
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the ISC license.
|
|
47
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/const Tl=ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
49
|
+
* @license lucide-react v0.468.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const Ei=ee("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
54
|
+
* @license lucide-react v0.468.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/const o1=ee("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
|
|
59
|
+
* @license lucide-react v0.468.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const l1=ee("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
64
|
+
* @license lucide-react v0.468.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const jE=ee("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
69
|
+
* @license lucide-react v0.468.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const c1=ee("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
|
|
74
|
+
* @license lucide-react v0.468.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const Qi=ee("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
|
|
79
|
+
* @license lucide-react v0.468.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const dr=ee("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
84
|
+
* @license lucide-react v0.468.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const NE=ee("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
|
|
89
|
+
* @license lucide-react v0.468.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const Ja=ee("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
94
|
+
* @license lucide-react v0.468.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const kE=ee("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
99
|
+
* @license lucide-react v0.468.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const rr=ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
104
|
+
* @license lucide-react v0.468.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const Kn=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
109
|
+
* @license lucide-react v0.468.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const vu=ee("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
114
|
+
* @license lucide-react v0.468.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const kn=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
119
|
+
* @license lucide-react v0.468.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const Ap=ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
124
|
+
* @license lucide-react v0.468.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const Zi=ee("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
129
|
+
* @license lucide-react v0.468.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const ss=ee("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
134
|
+
* @license lucide-react v0.468.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const d1=ee("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
139
|
+
* @license lucide-react v0.468.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const Ep=ee("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
144
|
+
* @license lucide-react v0.468.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const an=ee("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
149
|
+
* @license lucide-react v0.468.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const SE=ee("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
|
|
154
|
+
* @license lucide-react v0.468.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const Yn=ee("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
159
|
+
* @license lucide-react v0.468.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const u1=ee("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
164
|
+
* @license lucide-react v0.468.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const f1=ee("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
169
|
+
* @license lucide-react v0.468.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const Dp=ee("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
174
|
+
* @license lucide-react v0.468.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const CE=ee("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
179
|
+
* @license lucide-react v0.468.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const Tp=ee("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
184
|
+
* @license lucide-react v0.468.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const is=ee("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
189
|
+
* @license lucide-react v0.468.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const m1=ee("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
194
|
+
* @license lucide-react v0.468.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const Ip=ee("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
199
|
+
* @license lucide-react v0.468.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const Il=ee("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
204
|
+
* @license lucide-react v0.468.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const _E=ee("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
|
|
209
|
+
* @license lucide-react v0.468.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const OE=ee("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
214
|
+
* @license lucide-react v0.468.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const ME=ee("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
|
|
219
|
+
* @license lucide-react v0.468.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const PE=ee("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
224
|
+
* @license lucide-react v0.468.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const AE=ee("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
229
|
+
* @license lucide-react v0.468.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const Rp=ee("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
234
|
+
* @license lucide-react v0.468.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const ma=ee("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
239
|
+
* @license lucide-react v0.468.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const nh=ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
244
|
+
* @license lucide-react v0.468.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const h1=ee("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
249
|
+
* @license lucide-react v0.468.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const EE=ee("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
|
|
254
|
+
* @license lucide-react v0.468.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const DE=ee("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
|
|
259
|
+
* @license lucide-react v0.468.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const TE=ee("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
|
|
264
|
+
* @license lucide-react v0.468.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const p1=ee("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
|
|
269
|
+
* @license lucide-react v0.468.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const Er=ee("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
274
|
+
* @license lucide-react v0.468.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const sd=ee("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
279
|
+
* @license lucide-react v0.468.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const IE=ee("Link2Off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
284
|
+
* @license lucide-react v0.468.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const Rl=ee("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
289
|
+
* @license lucide-react v0.468.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const RE=ee("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
294
|
+
* @license lucide-react v0.468.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const g1=ee("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
299
|
+
* @license lucide-react v0.468.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const yn=ee("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
|
|
304
|
+
* @license lucide-react v0.468.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const x1=ee("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
309
|
+
* @license lucide-react v0.468.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const Ji=ee("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
314
|
+
* @license lucide-react v0.468.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const yu=ee("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
|
319
|
+
* @license lucide-react v0.468.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const $E=ee("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
324
|
+
* @license lucide-react v0.468.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const v1=ee("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
329
|
+
* @license lucide-react v0.468.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const eo=ee("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
334
|
+
* @license lucide-react v0.468.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const zE=ee("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
339
|
+
* @license lucide-react v0.468.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const LE=ee("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
344
|
+
* @license lucide-react v0.468.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const FE=ee("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
349
|
+
* @license lucide-react v0.468.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const $p=ee("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
354
|
+
* @license lucide-react v0.468.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const zs=ee("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
359
|
+
* @license lucide-react v0.468.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const bu=ee("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
364
|
+
* @license lucide-react v0.468.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const st=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
369
|
+
* @license lucide-react v0.468.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const BE=ee("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
374
|
+
* @license lucide-react v0.468.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const WE=ee("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
|
|
379
|
+
* @license lucide-react v0.468.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const nl=ee("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
384
|
+
* @license lucide-react v0.468.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const $l=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
389
|
+
* @license lucide-react v0.468.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const UE=ee("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
394
|
+
* @license lucide-react v0.468.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const zp=ee("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
399
|
+
* @license lucide-react v0.468.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const Lp=ee("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
404
|
+
* @license lucide-react v0.468.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const qE=ee("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
409
|
+
* @license lucide-react v0.468.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const HE=ee("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
414
|
+
* @license lucide-react v0.468.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const ah=ee("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
419
|
+
* @license lucide-react v0.468.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const y1=ee("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
424
|
+
* @license lucide-react v0.468.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const b1=ee("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
429
|
+
* @license lucide-react v0.468.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const KE=ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
434
|
+
* @license lucide-react v0.468.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const w1=ee("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
|
|
439
|
+
* @license lucide-react v0.468.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const YE=ee("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
444
|
+
* @license lucide-react v0.468.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const GE=ee("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
449
|
+
* @license lucide-react v0.468.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const VE=ee("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
454
|
+
* @license lucide-react v0.468.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const XE=ee("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
|
459
|
+
* @license lucide-react v0.468.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const QE=ee("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
464
|
+
* @license lucide-react v0.468.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const Dr=ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
469
|
+
* @license lucide-react v0.468.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const ZE=ee("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
474
|
+
* @license lucide-react v0.468.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const JE=ee("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
479
|
+
* @license lucide-react v0.468.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const eD=ee("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
484
|
+
* @license lucide-react v0.468.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const tD=ee("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
489
|
+
* @license lucide-react v0.468.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const j1=ee("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
494
|
+
* @license lucide-react v0.468.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const to=ee("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
499
|
+
* @license lucide-react v0.468.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const rD=ee("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
504
|
+
* @license lucide-react v0.468.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const nD=ee("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
|
|
509
|
+
* @license lucide-react v0.468.0 - ISC
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the ISC license.
|
|
512
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/const wu=ee("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
514
|
+
* @license lucide-react v0.468.0 - ISC
|
|
515
|
+
*
|
|
516
|
+
* This source code is licensed under the ISC license.
|
|
517
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
+
*/const Ls=ee("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
|
|
519
|
+
* @license lucide-react v0.468.0 - ISC
|
|
520
|
+
*
|
|
521
|
+
* This source code is licensed under the ISC license.
|
|
522
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
+
*/const oa=ee("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
524
|
+
* @license lucide-react v0.468.0 - ISC
|
|
525
|
+
*
|
|
526
|
+
* This source code is licensed under the ISC license.
|
|
527
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
528
|
+
*/const et=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
529
|
+
* @license lucide-react v0.468.0 - ISC
|
|
530
|
+
*
|
|
531
|
+
* This source code is licensed under the ISC license.
|
|
532
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
+
*/const os=ee("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function aD({issue:e}){const t=gu(e.id,e.project_id),[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(!1),c=e.metadata??{},d=Object.entries(c),u=()=>{if(!r.trim())return;const m={...c,[r.trim()]:s};t.mutate({metadata:m},{onSuccess:()=>{F.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>F.error("Failed to save metadata")})},f=m=>{const h={...c};delete h[m],t.mutate({metadata:Object.keys(h).length?h:null},{onSuccess:()=>F.success("Entry removed"),onError:()=>F.error("Failed to update metadata")})};return a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(CE,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Metadata"})]}),!o&&a.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Add field"]})]}),a.jsxs("div",{className:"px-5 py-3 space-y-2",children:[d.length===0&&!o&&a.jsx("p",{className:"text-xs text-muted-foreground/50 italic",children:"No metadata fields yet"}),d.map(([m,h])=>a.jsxs("div",{className:"flex items-center gap-2 group",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground w-28 shrink-0 truncate",children:m}),a.jsx("span",{className:"text-xs text-foreground flex-1 truncate",children:String(h)}),a.jsx("button",{onClick:()=>f(m),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Dr,{className:"h-3 w-3"})})]},m)),o&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Ae,{autoFocus:!0,placeholder:"key",value:r,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs font-mono w-28 shrink-0"}),a.jsx(Ae,{placeholder:"value",value:s,onChange:m=>i(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs flex-1"}),a.jsx(J,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const sD=[{zone:"issue.details.after",component:aD}];function ju(e=!0){return Be({queryKey:["workspaces"],queryFn:()=>te.get("/admin/workspaces"),select:t=>t.workspaces,enabled:e})}function iD(){const e=we();return ye({mutationFn:t=>te.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function oD(e){const t=we();return ye({mutationFn:r=>te.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function lD(e){const t=we();return ye({mutationFn:r=>{const n=new FormData;return n.append("logo",r),te.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function cD(e){const t=we();return ye({mutationFn:()=>te.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const Fp={list:e=>["workspaces",e,"invitations"]};function dD(e){return Be({queryKey:Fp.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e})}function uD(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Fp.list(e)})}})}function fD(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Fp.list(e)})}})}const Bp={list:e=>["workspaces",e,"members"]};function zl(e){return Be({queryKey:Bp.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e})}function mD(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/workspaces/${e}/members`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Bp.list(e)})}})}function hD(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Bp.list(e)})}})}const es={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function Nu(e){return Be({queryKey:es.list(e),queryFn:()=>te.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e})}function pD(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:es.list(e)})}})}function gD(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:es.list(e)})}})}function xD(e,t){return Be({queryKey:es.members(e,t),queryFn:()=>te.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function vD(e,t){const r=we();return ye({mutationFn:n=>te.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:es.members(e,t)}),r.invalidateQueries({queryKey:es.list(e)})}})}function yD(e,t){const r=we();return ye({mutationFn:n=>te.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:es.members(e,t)}),r.invalidateQueries({queryKey:es.list(e)})}})}function ku(){return Be({queryKey:["setup-status"],queryFn:()=>te.get("/auth/setup"),staleTime:6e4,retry:!1})}function bD(){const{login:e}=Ie();return ye({mutationFn:t=>te.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function wD(){const{login:e}=Ie();return ye({mutationFn:t=>te.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function jD(e){const{login:t}=Ie();return ye({mutationFn:r=>te.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var sj;const ND=((sj=window.__MERIDIAN_CONFIG__)==null?void 0:sj.apiUrl)??void 0??"";function kD(e,t){const r=`${ND}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function SD(){const{token:e,workspace:t}=Ie(),r=we(),n=p.useRef(null);p.useEffect(()=>{if(!e||!t)return;const s=kD(e,t.id);n.current=s;const i=o=>{o.forEach(l=>r.invalidateQueries({queryKey:l}))};return s.addEventListener("issue.created",()=>{i([["issues"],["notifications"]])}),s.addEventListener("issue.status_changed",()=>{i([["issues"]])}),s.addEventListener("issue.assigned",()=>{i([["issues"],["notifications"]])}),s.addEventListener("comment.created",()=>{i([["issues"],["notifications"]])}),s.addEventListener("project.member_added",()=>{i([["notifications"]])}),s.onerror=()=>{},()=>{s.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const tm=768;function CD(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const r=window.matchMedia(`(max-width: ${tm-1}px)`),n=()=>{t(window.innerWidth<tm)};return r.addEventListener("change",n),t(window.innerWidth<tm),()=>r.removeEventListener("change",n)},[]),!!e}const ro=p.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(oj,{ref:s,decorative:r,orientation:t,className:I("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));ro.displayName=oj.displayName;const _D=Pl,OD=Ml,N1=p.forwardRef(({className:e,...t},r)=>a.jsx(ni,{className:I("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));N1.displayName=ni.displayName;const MD=El("fixed z-50 gap-4 bg-background border-border transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-300",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-xl"}},defaultVariants:{side:"right"}}),k1=p.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(OD,{children:[a.jsx(N1,{}),a.jsxs(ai,{ref:s,className:I(MD({side:e}),t),...n,children:[r,a.jsxs(mu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsx(et,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));k1.displayName=ai.displayName;const S1=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});S1.displayName="SheetHeader";const C1=p.forwardRef(({className:e,...t},r)=>a.jsx(Gi,{ref:r,className:I("text-base font-semibold text-foreground",e),...t}));C1.displayName=Gi.displayName;const _1=p.forwardRef(({className:e,...t},r)=>a.jsx(Vi,{ref:r,className:I("text-sm text-muted-foreground",e),...t}));_1.displayName=Vi.displayName;function le({className:e,...t}){return a.jsx("div",{className:I("animate-pulse rounded-md bg-muted",e),...t})}const PD="sidebar_state",AD=60*60*24*7,ED="16rem",DD="18rem",TD="3rem",ID="b",O1=p.createContext(null);function Wp(){const e=p.useContext(O1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Su({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:i,...o}){const l=CD(),[c,d]=p.useState(!1),[u,f]=p.useState(e),m=t??u,h=p.useCallback(y=>{const w=typeof y=="function"?y(m):y;r?r(w):f(w),document.cookie=`${PD}=${w}; path=/; max-age=${AD}`},[r,m]),g=p.useCallback(()=>l?d(y=>!y):h(y=>!y),[l,h,d]);p.useEffect(()=>{const y=w=>{w.key===ID&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",v=p.useMemo(()=>({state:x,open:m,setOpen:h,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,h,l,c,d,g]);return a.jsx(O1.Provider,{value:v,children:a.jsx(pu,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ED,"--sidebar-width-icon":TD,...s},className:I("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function Cu({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=Wp();return r==="none"?a.jsx("div",{"data-slot":"sidebar",className:I("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:s}):o?a.jsx(_D,{open:c,onOpenChange:d,...i,children:a.jsxs(k1,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden",style:{"--sidebar-width":DD},side:e,children:[a.jsxs(S1,{className:"sr-only",children:[a.jsx(C1,{children:"Sidebar"}),a.jsx(_1,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:I("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),a.jsx("div",{"data-slot":"sidebar-container",className:I("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:a.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function _u({className:e,onClick:t,...r}){const{toggleSidebar:n}=Wp();return a.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:I("size-7",e),onClick:s=>{t==null||t(s),n()},...r,children:[a.jsx(LE,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ou({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:I("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function Mu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:I("flex flex-col gap-2 p-2",e),...t})}function Pu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:I("flex flex-col gap-2 p-2",e),...t})}function _v({className:e,...t}){return a.jsx(ro,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:I("bg-sidebar-border mx-2 w-auto",e),...t})}function Au({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:I("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Cs({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:I("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Ov({className:e,asChild:t=!1,...r}){const n=t?wp:"div";return a.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:I("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function _s({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:I("w-full text-sm",e),...t})}function gr({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:I("flex w-full min-w-0 flex-col gap-1",e),...t})}function At({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:I("group/menu-item relative",e),...t})}const RD=El("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),Nt=p.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:s="default",tooltip:i,className:o,...l},c){const d=t?wp:"button",{isMobile:u,state:f}=Wp(),m=a.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:I(RD({variant:n,size:s}),o),...l});return i?(typeof i=="string"&&(i={children:i}),a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:m}),a.jsx(fa,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});Nt.displayName="SidebarMenuButton";const $D=250,zD=300,Wr={all:["projects"],list:()=>[...Wr.all,"list"],detail:e=>[...Wr.all,e],byKey:e=>[...Wr.all,"key",e],activities:e=>[...Wr.all,e,"activities"]};function no(){const{workspace:e}=Ie();return Be({queryKey:[...Wr.list(),e==null?void 0:e.id],queryFn:()=>{const t=e!=null&&e.id?`?workspace_id=${e.id}`:"";return te.get(`/admin/projects${t}`)},select:t=>t.projects,enabled:!!(e!=null&&e.id)})}function Ca(e){return Be({queryKey:Wr.byKey(e),queryFn:()=>te.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function LD(e,t={}){const[r,n]=p.useState(e),s=t.enabled!==!1;return p.useEffect(()=>{if(!s)return;const l=setTimeout(()=>n(e),$D);return()=>clearTimeout(l)},[e,s]),{...Be({queryKey:["projects","suggest-identifier",r],queryFn:()=>te.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:s&&r.trim().length>0}),flush:()=>n(e)}}function FD(e,t={}){const r=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[n,s]=p.useState(r),i=t.enabled!==!1&&r.length>=3;p.useEffect(()=>{if(!r){s("");return}const l=setTimeout(()=>s(r),zD);return()=>clearTimeout(l)},[r]);const o=Be({queryKey:["projects","check-identifier",n],queryFn:()=>te.get(`/admin/projects/check-identifier/${encodeURIComponent(n)}`),select:l=>l.available,enabled:i&&n.length>=3});return{available:o.data,isLoading:o.isLoading,isFetching:o.isFetching}}function BD(){const e=we();return ye({mutationFn:t=>te.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:Wr.list()})}})}function WD(){const e=we();return ye({mutationFn:t=>te.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Wr.list()})}})}function UD(e){const t=we();return ye({mutationFn:()=>te.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:Wr.detail(e)}),t.invalidateQueries({queryKey:Wr.list()})}})}function qD(e){const t=we();return ye({mutationFn:()=>te.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:Wr.detail(e)}),t.invalidateQueries({queryKey:Wr.list()})}})}function HD(e){return Be({queryKey:Wr.activities(e),queryFn:()=>te.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}const Yr=YM,Gr=GM,KD=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(lj,{ref:s,className:I("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,a.jsx(kn,{className:"ml-auto"})]}));KD.displayName=lj.displayName;const YD=p.forwardRef(({className:e,...t},r)=>a.jsx(cj,{ref:r,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));YD.displayName=cj.displayName;const Tr=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(KM,{children:a.jsx(dj,{ref:n,sideOffset:t,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Tr.displayName=dj.displayName;const pt=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(uj,{ref:n,className:I("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));pt.displayName=uj.displayName;const GD=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(fj,{ref:s,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(mj,{children:a.jsx(rr,{className:"h-4 w-4"})})}),t]}));GD.displayName=fj.displayName;const VD=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(hj,{ref:n,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(mj,{children:a.jsx(an,{className:"h-2 w-2 fill-current"})})}),t]}));VD.displayName=hj.displayName;const Up=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(pj,{ref:n,className:I("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));Up.displayName=pj.displayName;const Bn=p.forwardRef(({className:e,...t},r)=>a.jsx(gj,{ref:r,className:I("-mx-1 my-1 h-px bg-border",e),...t}));Bn.displayName=gj.displayName;const $t=p.forwardRef(({className:e,...t},r)=>a.jsx(xj,{ref:r,className:I("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));$t.displayName=xj.displayName;const al=p.forwardRef(({className:e,...t},r)=>a.jsx(vj,{ref:r,className:I("aspect-square h-full w-full",e),...t}));al.displayName=vj.displayName;const zt=p.forwardRef(({className:e,...t},r)=>a.jsx(yj,{ref:r,className:I("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));zt.displayName=yj.displayName;function XD(){var s;const{workspace:e,setWorkspace:t}=Ie(),{data:r}=ju(),n=Ct();return a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[e!=null&&e.logo_url?a.jsx("img",{src:e.logo_url,alt:e.name,className:"size-8 rounded-lg object-cover shrink-0"}):a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[13px] font-bold",children:(((s=e==null?void 0:e.name)==null?void 0:s[0])??"M").toUpperCase()})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:(e==null?void 0:e.name)??"Meridian"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.slug)??""})]}),a.jsx(Zi,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Tr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[a.jsx(Up,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),r==null?void 0:r.map(i=>a.jsxs(pt,{className:"cursor-pointer gap-2 p-2",onClick:()=>{t({id:i.id,name:i.name,slug:i.slug,logo_url:i.logo_url}),n(`/${i.slug}/projects`)},children:[i.logo_url?a.jsx("img",{src:i.logo_url,alt:i.name,className:"size-6 rounded-sm object-cover shrink-0"}):a.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[10px] font-bold",children:i.name[0].toUpperCase()})}),a.jsx("span",{className:"flex-1 truncate",children:i.name}),i.id===(e==null?void 0:e.id)&&a.jsx(rr,{className:"size-3.5 text-muted-foreground shrink-0"})]},i.id)),a.jsx(Bn,{}),a.jsxs(pt,{className:"cursor-pointer gap-2 p-2 text-muted-foreground",onClick:()=>n("/setup"),children:[a.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:a.jsx("span",{className:"text-xs font-semibold",children:"+"})}),a.jsx("span",{children:"Create workspace"})]})]})]})})})}function QD(){var i,o,l,c;const{user:e,logout:t}=Ie(),r=Ct(),n=e&&(`${((i=e.first_name)==null?void 0:i[0])??""}${((o=e.last_name)==null?void 0:o[0])??""}`.toUpperCase()||((c=(l=e.email)==null?void 0:l[0])==null?void 0:c.toUpperCase()))||"?",s=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs($t,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(al,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(zt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Zi,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Tr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Up,{className:"p-0 font-normal",children:a.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[a.jsxs($t,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&a.jsx(al,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(zt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:(e==null?void 0:e.email)??""})]})]})}),a.jsx(Bn,{}),a.jsxs(pt,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[a.jsx(wu,{className:"size-4"}),"Profile"]}),a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(yu,{className:"size-4"}),"Sign out"]})]})]})})})}function ZD({...e}){var j,N,k;const{workspace:t,projectKey:r}=Ht(),{data:n}=no(),{toggle:s}=Vj(),{user:i}=Ie(),o=uu(),l=t??"",c=o.pathname===`/${l}/projects`,d=o.pathname.includes("/notifications"),u=o.pathname.includes("/settings"),f=o.pathname.includes("/roles"),m=o.pathname===`/${l}/reporting`,h=o.pathname.startsWith("/reporting"),g=o.pathname.startsWith("/org/settings"),x=((j=i==null?void 0:i.roles)==null?void 0:j.includes("super-admin"))??!1,v=x||(((N=i==null?void 0:i.roles)==null?void 0:N.includes("admin"))??!1),y=((k=i==null?void 0:i.permissions)==null?void 0:k.includes("workspace:admin"))??!1,w=v||y;return a.jsxs(Cu,{collapsible:"offcanvas",...e,children:[a.jsx(Mu,{children:a.jsx(XD,{})}),a.jsxs(Au,{children:[a.jsx(Cs,{children:a.jsx(_s,{children:a.jsxs(gr,{children:[a.jsx(At,{children:a.jsxs(Nt,{onClick:s,tooltip:"Search",children:[a.jsx($l,{}),a.jsx("span",{children:"Search"}),a.jsx("kbd",{className:"ml-auto hidden text-[10px] text-sidebar-foreground/40 font-mono sm:inline-flex",children:"⌘K"})]})}),a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:c,tooltip:"Projects",children:a.jsxs(aa,{to:`/${l}/projects`,end:!0,children:[a.jsx(Er,{}),a.jsx("span",{children:"Projects"})]})})}),a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:d,tooltip:"Notifications",children:a.jsxs(aa,{to:`/${l}/notifications`,children:[a.jsx(Ei,{}),a.jsx("span",{children:"Notifications"})]})})}),a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:m,tooltip:"Reports",children:a.jsxs(aa,{to:`/${l}/reporting`,children:[a.jsx(Ja,{}),a.jsx("span",{children:"Reports"})]})})}),a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:u,tooltip:"Settings",children:a.jsxs(aa,{to:`/${l}/settings`,children:[a.jsx(Lp,{}),a.jsx("span",{children:"Workspace settings"})]})})})]})})}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(_v,{}),a.jsxs(Cs,{children:[a.jsx(Ov,{children:"Recent"}),a.jsx(_s,{children:a.jsx(gr,{children:n.slice(0,5).map(b=>a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:b.identifier===r,tooltip:b.name,className:"data-[active=true]:bg-indigo-50 dark:data-[active=true]:bg-indigo-950/50 data-[active=true]:text-indigo-700 dark:data-[active=true]:text-indigo-300",children:a.jsxs(aa,{to:`/${l}/projects/${b.identifier}/board`,children:[a.jsx("span",{className:"font-mono text-[10px] text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:b.identifier}),a.jsx("span",{className:"truncate",children:b.name})]})})},b.id))})})]})]}),w&&a.jsxs(a.Fragment,{children:[a.jsx(_v,{}),a.jsxs(Cs,{children:[a.jsx(Ov,{children:"Global"}),a.jsx(_s,{children:a.jsxs(gr,{children:[a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:h,tooltip:"Global Reports",children:a.jsxs(aa,{to:"/reporting",children:[a.jsx(Ja,{}),a.jsx("span",{children:"Global Reports"})]})})}),a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:g,tooltip:"Org Settings",children:a.jsxs(aa,{to:"/org/settings",children:[a.jsx(zp,{}),a.jsx("span",{children:"Org Settings"})]})})})]})})]})]}),a.jsx(Cs,{className:"mt-auto",children:a.jsx(_s,{children:a.jsx(gr,{children:x&&a.jsx(At,{children:a.jsx(Nt,{asChild:!0,isActive:f,tooltip:"Roles & Permissions",children:a.jsxs(aa,{to:`/${l}/roles`,children:[a.jsx(ah,{}),a.jsx("span",{children:"Custom Roles"})]})})})})})})]}),a.jsx(Pu,{children:a.jsx(QD,{})})]})}function Eu(){const{theme:e,setTheme:t}=CA();return a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsxs(J,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[a.jsx(YE,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(zE,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsx(fa,{children:"Toggle theme"})]})}const Ll={all:["notifications"],list:()=>[...Ll.all,"list"]};function JD(){return Be({queryKey:Ll.list(),queryFn:()=>te.get("/admin/notifications"),select:e=>e.notifications})}function eT(){return Be({queryKey:[...Ll.list(),"unread"],queryFn:()=>te.get("/admin/notifications?unread=true"),select:e=>e.count,refetchInterval:3e4})}function tT(){const e=we();return ye({mutationFn:t=>te.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:Ll.all})}})}function rT(){const e=we();return ye({mutationFn:()=>te.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:Ll.all})}})}function nT(){const e=uu(),{projectKey:t}=Ht(),{data:r}=no(),n=r==null?void 0:r.find(i=>i.identifier===t),s=e.pathname;return s.includes("/board")?{icon:Er,label:n?`${n.name} / Board`:"Board"}:s.includes("/issues")?{icon:ma,label:n?`${n.name} / Issues`:"Issues"}:s.includes("/sprints")?{icon:os,label:n?`${n.name} / Sprints`:"Sprints"}:s.includes("/timeline")?{icon:Qi,label:n?`${n.name} / Timeline`:"Timeline"}:s.includes("/access")?{icon:Ji,label:n?`${n.name} / Access`:"Access"}:s.includes("/reports")?{icon:Ja,label:n?`${n.name} / Reports`:"Reports"}:s.includes("/activity")?{icon:xu,label:n?`${n.name} / Activity`:"Activity"}:s.endsWith("/projects")?{icon:sd,label:"Projects"}:s.includes("/notifications")?{icon:Ei,label:"Notifications"}:s.includes("/settings")?{icon:Lp,label:"Settings"}:{icon:sd,label:"Meridian"}}function aT(){const{data:e=0}=eT(),{icon:t,label:r}=nT(),{workspace:n}=Ie(),s=(n==null?void 0:n.slug)??"";return a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(_u,{className:"-ml-1"}),a.jsx(ro,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(t,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:r})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[a.jsx(Eu,{}),a.jsx(J,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:a.jsxs(Za,{to:`/${s}/notifications`,children:[a.jsx(Ei,{className:"h-4 w-4",strokeWidth:1.5}),e>0&&a.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-indigo text-[9px] font-bold text-white flex items-center justify-center leading-none",children:e>9?"9+":e})]})})]})]})})}function sT(){const{user:e,token:t,login:r}=Ie();p.useEffect(()=>{!e||!t||!e.email||fetch("/admin/users/me",{headers:{Authorization:`Bearer ${t}`}}).then(n=>n.ok?n.json():null).then(n=>{n&&r({id:n.id,email:n.email,first_name:n.first_name??"",last_name:n.last_name??""},t)}).catch(()=>{})},[e==null?void 0:e.id])}function iT(){return sT(),a.jsxs(Su,{children:[a.jsx(ZD,{variant:"inset"}),a.jsxs(Ou,{className:"flex flex-col min-w-0",children:[a.jsx(aT,{}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Ol,{})})]})]})}const Fl={project:e=>["projects",e,"access"]};function Gn(e){return Be({queryKey:Fl.project(e),queryFn:()=>te.get(`/admin/projects/${e}/access`),enabled:!!e})}function M1(e){const t=we();return ye({mutationFn:({userId:r,role:n})=>te.post(`/admin/projects/${e}/members`,{user_id:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Fl.project(e)})}})}function P1(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Fl.project(e)})}})}function A1(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/projects/${e}/teams`,{team_id:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Fl.project(e)})}})}function E1(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Fl.project(e)})}})}const ls=Pl,oT=Ml,D1=p.forwardRef(({className:e,...t},r)=>a.jsx(ni,{ref:r,className:I("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));D1.displayName=ni.displayName;const _a=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(oT,{children:[a.jsx(D1,{}),a.jsxs(ai,{ref:n,className:I("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...r,children:[t,a.jsxs(mu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(et,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_a.displayName=ai.displayName;const cs=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col space-y-1.5",e),...t});cs.displayName="DialogHeader";const T1=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});T1.displayName="DialogFooter";const ds=p.forwardRef(({className:e,...t},r)=>a.jsx(Gi,{ref:r,className:I("text-base font-semibold leading-none tracking-tight",e),...t}));ds.displayName=Gi.displayName;const Bl=p.forwardRef(({className:e,...t},r)=>a.jsx(Vi,{ref:r,className:I("text-sm text-muted-foreground",e),...t}));Bl.displayName=Vi.displayName;function lT({open:e,onClose:t,project:r}){const[n,s]=p.useState(null),i=UD(r.id),o=qD(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:h=>{const g=`${window.location.origin}/share/${h.project.share_token}`;s(g),F.success("Public link enabled")},onError:()=>F.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{s(null),F.success("Public link revoked")},onError:()=>F.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{F.success("Link copied to clipboard")})},m=!!c;return a.jsx(ls,{open:e,onOpenChange:h=>!h&&t(),children:a.jsxs(_a,{className:"sm:max-w-md overflow-hidden",children:[a.jsxs(cs,{children:[a.jsxs(ds,{className:"flex items-center gap-2",children:[a.jsx(Rl,{className:"h-4 w-4"}),"Share project"]}),a.jsx(Bl,{children:"Allow anyone with the link to view this project without logging in."})]}),a.jsx("div",{className:"space-y-4 pt-2",children:m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 overflow-hidden",children:[a.jsx(nh,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),a.jsx("span",{className:"text-xs text-muted-foreground min-w-0 flex-1 break-all",children:c})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(J,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[a.jsx(Dp,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),a.jsxs(J,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[a.jsx(Dr,{className:"h-3.5 w-3.5 mr-1.5"}),"Revoke"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone with this link can view the board, issues, and timeline. No account required."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed border-border px-3 py-4 text-center justify-center",children:[a.jsx(Ji,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),a.jsxs(J,{className:"w-full",onClick:d,disabled:i.isPending,children:[a.jsx(nh,{className:"h-4 w-4 mr-2"}),"Enable public link"]}),a.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Generates a secret link for read-only access. No write permissions granted."})]})})]})})}const Mv=["board","issues","sprints","timeline","access","reports","activity"];function cT(){const{projectKey:e,workspace:t}=Ht(),{data:r,error:n}=Ca(e??""),{user:s}=Ie(),{data:i}=Gn((r==null?void 0:r.id)??""),[o,l]=p.useState(!1),c=Ct(),d=uu(),[u]=fu(),f=(s==null?void 0:s.roles)??[],m=f.includes("super-admin")||f.includes("admin"),h=i==null?void 0:i.members.some(y=>y.user_id===(s==null?void 0:s.id)&&y.role==="manager"),g=m||h;p.useEffect(()=>{n&&n instanceof Op&&(n.status===403||n.status===404)&&c(`/${t}/projects`,{replace:!0})},[n,t,c]),p.useEffect(()=>{const y=u.get("tab");if(!y||!Mv.includes(y))return;Mv.every(j=>!d.pathname.endsWith(`/${j}`))&&c(`/${t}/projects/${e}/${y}`,{replace:!0})},[]);const x=`/${t}/projects/${e}`,v=[{to:`${x}/board`,label:"Board",icon:sd,end:!0},{to:`${x}/issues`,label:"Issues",icon:ma,end:!1},{to:`${x}/sprints`,label:"Sprints",icon:os,end:!0},{to:`${x}/timeline`,label:"Timeline",icon:Qi,end:!0},{to:`${x}/access`,label:"Access",icon:Ji,end:!0},{to:`${x}/reports`,label:"Reports",icon:Ja,end:!0},{to:`${x}/activity`,label:"Activity",icon:xu,end:!0}];return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-6 pt-5 border-b border-border bg-white dark:bg-card shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[r&&a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:r.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:(r==null?void 0:r.name)??""})]}),a.jsxs("div",{className:"flex items-center -mb-px",children:[a.jsx("div",{className:"flex flex-1",children:v.map(({to:y,label:w,icon:j,end:N})=>a.jsxs(aa,{to:y,end:N,className:({isActive:k})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${k?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(j,{className:"h-3.5 w-3.5",strokeWidth:1.5}),w]},y))}),g&&r&&a.jsx("div",{className:"pb-px pr-1",children:a.jsxs(J,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[a.jsx(qE,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]})]}),a.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:a.jsx(Ol,{})}),r&&a.jsx(lT,{open:o,onClose:()=>l(!1),project:r})]})}function dT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx($t,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(zt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Zi,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Tr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(yu,{className:"size-4"}),"Sign out"]})]})]})})})}function uT(){const{workspace:e}=Ie(),t=Ct(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Cu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Mu,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(Ja,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Reporting"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Time analytics"})]})]})})})}),a.jsx(Au,{children:a.jsx(Cs,{children:a.jsx(_s,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Mp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Pu,{children:a.jsx(dT,{})})]})}function fT(){return a.jsxs(Su,{children:[a.jsx(uT,{}),a.jsxs(Ou,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(_u,{className:"-ml-1"}),a.jsx(ro,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Ja,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Reporting"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Eu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Ol,{})})]})]})}function mT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx($t,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(zt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Zi,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Tr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(yu,{className:"size-4"}),"Sign out"]})]})]})})})}function hT(){const{workspace:e}=Ie(),t=Ct(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Cu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Mu,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(zp,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Org Settings"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Global configuration"})]})]})})})}),a.jsx(Au,{children:a.jsx(Cs,{children:a.jsx(_s,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Mp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Pu,{children:a.jsx(mT,{})})]})}function pT(){return a.jsxs(Su,{children:[a.jsx(hT,{}),a.jsxs(Ou,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(_u,{className:"-ml-1"}),a.jsx(ro,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(zp,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Org Settings"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Eu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Ol,{})})]})]})}function gT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs($t,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(al,{src:e.avatar_url,alt:n??"",className:"object-cover"}),a.jsx(zt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(Zi,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Tr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(yu,{className:"size-4"}),"Sign out"]})]})]})})})}function xT(){const{workspace:e}=Ie(),t=Ct(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Cu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Mu,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(wu,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Profile"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Personal settings"})]})]})})})}),a.jsx(Au,{children:a.jsx(Cs,{children:a.jsx(_s,{children:a.jsx(gr,{children:a.jsx(At,{children:a.jsxs(Nt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Mp,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Pu,{children:a.jsx(gT,{})})]})}function vT(){return a.jsxs(Su,{children:[a.jsx(xT,{}),a.jsxs(Ou,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(_u,{className:"-ml-1"}),a.jsx(ro,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(wu,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Profile"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Eu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Ol,{})})]})]})}var Pv=1,yT=.9,bT=.8,wT=.17,rm=.1,nm=.999,jT=.9999,NT=.99,kT=/[\\\/_+.#"@\[\(\{&]/,ST=/[\\\/_+.#"@\[\(\{&]/g,CT=/[\s-]/,I1=/[\s-]/g;function sh(e,t,r,n,s,i,o){if(i===t.length)return s===e.length?Pv:NT;var l=`${s},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),d=r.indexOf(c,s),u=0,f,m,h,g;d>=0;)f=sh(e,t,r,n,d+1,i+1,o),f>u&&(d===s?f*=Pv:kT.test(e.charAt(d-1))?(f*=bT,h=e.slice(s,d-1).match(ST),h&&s>0&&(f*=Math.pow(nm,h.length))):CT.test(e.charAt(d-1))?(f*=yT,g=e.slice(s,d-1).match(I1),g&&s>0&&(f*=Math.pow(nm,g.length))):(f*=wT,s>0&&(f*=Math.pow(nm,d-s))),e.charAt(d)!==t.charAt(i)&&(f*=jT)),(f<rm&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=sh(e,t,r,n,d+1,i+2,o),m*rm>f&&(f=m*rm)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function Av(e){return e.toLowerCase().replace(I1," ")}function _T(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,sh(e,t,Av(e),Av(t),0,0,{})}var _o='[cmdk-group=""]',am='[cmdk-group-items=""]',OT='[cmdk-group-heading=""]',qp='[cmdk-item=""]',Ev=`${qp}:not([aria-disabled="true"])`,ih="cmdk-item-select",ks="data-value",MT=(e,t,r)=>_T(e,t,r),R1=p.createContext(void 0),Wl=()=>p.useContext(R1),$1=p.createContext(void 0),Hp=()=>p.useContext($1),z1=p.createContext(void 0),L1=p.forwardRef((e,t)=>{let r=bi(()=>{var U,Y;return{search:"",value:(Y=(U=e.value)!=null?U:e.defaultValue)!=null?Y:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=bi(()=>new Set),s=bi(()=>new Map),i=bi(()=>new Map),o=bi(()=>new Set),l=F1(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:h,loop:g,disablePointerSelection:x=!1,vimBindings:v=!0,...y}=e,w=Si(),j=Si(),N=Si(),k=p.useRef(null),b=FT();Fs(()=>{if(u!==void 0){let U=u.trim();r.current.value=U,S.emit()}},[u]),Fs(()=>{b(6,$)},[]);let S=p.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>r.current,setState:(U,Y,Z)=>{var G,M,z;if(!Object.is(r.current[U],Y)){if(r.current[U]=Y,U==="search")O(),E(),b(1,P);else if(U==="value"&&(Z||b(5,$),((G=l.current)==null?void 0:G.value)!==void 0)){let se=Y??"";(z=(M=l.current).onValueChange)==null||z.call(M,se);return}S.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),_=p.useMemo(()=>({value:(U,Y,Z)=>{var G;Y!==((G=i.current.get(U))==null?void 0:G.value)&&(i.current.set(U,{value:Y,keywords:Z}),r.current.filtered.items.set(U,C(Y,Z)),b(2,()=>{E(),S.emit()}))},item:(U,Y)=>(n.current.add(U),Y&&(s.current.has(Y)?s.current.get(Y).add(U):s.current.set(Y,new Set([U]))),b(3,()=>{O(),E(),r.current.value||P(),S.emit()}),()=>{i.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let Z=D();b(4,()=>{O(),(Z==null?void 0:Z.getAttribute("id"))===U&&P(),S.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{i.current.delete(U),s.current.delete(U)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:w,inputId:N,labelId:j,listInnerRef:k}),[]);function C(U,Y){var Z,G;let M=(G=(Z=l.current)==null?void 0:Z.filter)!=null?G:MT;return U?M(U,r.current.search,Y):0}function E(){if(!r.current.search||l.current.shouldFilter===!1)return;let U=r.current.filtered.items,Y=[];r.current.filtered.groups.forEach(G=>{let M=s.current.get(G),z=0;M.forEach(se=>{let L=U.get(se);z=Math.max(L,z)}),Y.push([G,z])});let Z=k.current;B().sort((G,M)=>{var z,se;let L=G.getAttribute("id"),q=M.getAttribute("id");return((z=U.get(q))!=null?z:0)-((se=U.get(L))!=null?se:0)}).forEach(G=>{let M=G.closest(am);M?M.appendChild(G.parentElement===M?G:G.closest(`${am} > *`)):Z.appendChild(G.parentElement===Z?G:G.closest(`${am} > *`))}),Y.sort((G,M)=>M[1]-G[1]).forEach(G=>{var M;let z=(M=k.current)==null?void 0:M.querySelector(`${_o}[${ks}="${encodeURIComponent(G[0])}"]`);z==null||z.parentElement.appendChild(z)})}function P(){let U=B().find(Z=>Z.getAttribute("aria-disabled")!=="true"),Y=U==null?void 0:U.getAttribute(ks);S.setState("value",Y||void 0)}function O(){var U,Y,Z,G;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let M=0;for(let z of n.current){let se=(Y=(U=i.current.get(z))==null?void 0:U.value)!=null?Y:"",L=(G=(Z=i.current.get(z))==null?void 0:Z.keywords)!=null?G:[],q=C(se,L);r.current.filtered.items.set(z,q),q>0&&M++}for(let[z,se]of s.current)for(let L of se)if(r.current.filtered.items.get(L)>0){r.current.filtered.groups.add(z);break}r.current.filtered.count=M}function $(){var U,Y,Z;let G=D();G&&(((U=G.parentElement)==null?void 0:U.firstChild)===G&&((Z=(Y=G.closest(_o))==null?void 0:Y.querySelector(OT))==null||Z.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function D(){var U;return(U=k.current)==null?void 0:U.querySelector(`${qp}[aria-selected="true"]`)}function B(){var U;return Array.from(((U=k.current)==null?void 0:U.querySelectorAll(Ev))||[])}function A(U){let Y=B()[U];Y&&S.setState("value",Y.getAttribute(ks))}function W(U){var Y;let Z=D(),G=B(),M=G.findIndex(se=>se===Z),z=G[M+U];(Y=l.current)!=null&&Y.loop&&(z=M+U<0?G[G.length-1]:M+U===G.length?G[0]:G[M+U]),z&&S.setState("value",z.getAttribute(ks))}function Q(U){let Y=D(),Z=Y==null?void 0:Y.closest(_o),G;for(;Z&&!G;)Z=U>0?zT(Z,_o):LT(Z,_o),G=Z==null?void 0:Z.querySelector(Ev);G?S.setState("value",G.getAttribute(ks)):W(U)}let K=()=>A(B().length-1),ie=U=>{U.preventDefault(),U.metaKey?K():U.altKey?Q(1):W(1)},ne=U=>{U.preventDefault(),U.metaKey?A(0):U.altKey?Q(-1):W(-1)};return p.createElement(as.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:U=>{var Y;if((Y=y.onKeyDown)==null||Y.call(y,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{v&&U.ctrlKey&&ie(U);break}case"ArrowDown":{ie(U);break}case"p":case"k":{v&&U.ctrlKey&&ne(U);break}case"ArrowUp":{ne(U);break}case"Home":{U.preventDefault(),A(0);break}case"End":{U.preventDefault(),K();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let Z=D();if(Z){let G=new Event(ih);Z.dispatchEvent(G)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:WT},c),Du(e,U=>p.createElement($1.Provider,{value:S},p.createElement(R1.Provider,{value:_},U))))}),PT=p.forwardRef((e,t)=>{var r,n;let s=Si(),i=p.useRef(null),o=p.useContext(z1),l=Wl(),c=F1(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;Fs(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=B1(s,i,[e.value,e.children,i],e.keywords),f=Hp(),m=Bs(b=>b.value&&b.value===u.current),h=Bs(b=>d||l.filter()===!1?!0:b.search?b.filtered.items.get(s)>0:!0);p.useEffect(()=>{let b=i.current;if(!(!b||e.disabled))return b.addEventListener(ih,g),()=>b.removeEventListener(ih,g)},[h,e.onSelect,e.disabled]);function g(){var b,S;x(),(S=(b=c.current).onSelect)==null||S.call(b,u.current)}function x(){f.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:w,forceMount:j,keywords:N,...k}=e;return p.createElement(as.div,{ref:sl([i,t]),...k,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:x,onClick:v?void 0:g},e.children)}),AT=p.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Si(),l=p.useRef(null),c=p.useRef(null),d=Si(),u=Wl(),f=Bs(h=>s||u.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);Fs(()=>u.group(o),[]),B1(o,l,[e.value,e.heading,c]);let m=p.useMemo(()=>({id:o,forceMount:s}),[s]);return p.createElement(as.div,{ref:sl([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&p.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Du(e,h=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},p.createElement(z1.Provider,{value:m},h))))}),ET=p.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=p.useRef(null),i=Bs(o=>!o.search);return!r&&!i?null:p.createElement(as.div,{ref:sl([s,t]),...n,"cmdk-separator":"",role:"separator"})}),DT=p.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,i=Hp(),o=Bs(u=>u.search),l=Bs(u=>u.value),c=Wl(),d=p.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${qp}[${ks}="${encodeURIComponent(l)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return p.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),p.createElement(as.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||i.setState("search",u.target.value),r==null||r(u.target.value)}})}),TT=p.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=p.useRef(null),o=p.useRef(null),l=Wl();return p.useEffect(()=>{if(o.current&&i.current){let c=o.current,d=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=c.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(u),f.unobserve(c)}}},[]),p.createElement(as.div,{ref:sl([i,t]),...s,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},Du(e,c=>p.createElement("div",{ref:sl([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),IT=p.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...l}=e;return p.createElement(Pl,{open:r,onOpenChange:n},p.createElement(Ml,{container:o},p.createElement(ni,{"cmdk-overlay":"",className:s}),p.createElement(ai,{"aria-label":e.label,"cmdk-dialog":"",className:i},p.createElement(L1,{ref:t,...l}))))}),RT=p.forwardRef((e,t)=>Bs(r=>r.filtered.count===0)?p.createElement(as.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),$T=p.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return p.createElement(as.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Du(e,o=>p.createElement("div",{"aria-hidden":!0},o)))}),Ir=Object.assign(L1,{List:TT,Item:PT,Input:DT,Group:AT,Separator:ET,Dialog:IT,Empty:RT,Loading:$T});function zT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function LT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function F1(e){let t=p.useRef(e);return Fs(()=>{t.current=e}),t}var Fs=typeof window>"u"?p.useEffect:p.useLayoutEffect;function bi(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function sl(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function Bs(e){let t=Hp(),r=()=>e(t.snapshot());return VM.useSyncExternalStore(t.subscribe,r,r)}function B1(e,t,r,n=[]){let s=p.useRef(),i=Wl();return Fs(()=>{var o;let l=(()=>{var d;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(d=u.current.textContent)==null?void 0:d.trim():s.current}})(),c=n.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(ks,l),s.current=l}),s}var FT=()=>{let[e,t]=p.useState(),r=bi(()=>new Map);return Fs(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function BT(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Du({asChild:e,children:t},r){return e&&p.isValidElement(t)?p.cloneElement(BT(t),{ref:t.ref},r(t.props.children)):r(t)}var WT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ds=p.forwardRef(({className:e,...t},r)=>a.jsx(Ir,{ref:r,className:I("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ds.displayName=Ir.displayName;const UT=({children:e,open:t,onOpenChange:r})=>a.jsx(ls,{open:t,onOpenChange:r,children:a.jsx(_a,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:a.jsx(Ds,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Tu=p.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx($l,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Ir.Input,{ref:r,className:I("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Tu.displayName=Ir.Input.displayName;const Ts=p.forwardRef(({className:e,...t},r)=>a.jsx(Ir.List,{ref:r,className:I("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));Ts.displayName=Ir.List.displayName;const Iu=p.forwardRef((e,t)=>a.jsx(Ir.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));Iu.displayName=Ir.Empty.displayName;const Va=p.forwardRef(({className:e,...t},r)=>a.jsx(Ir.Group,{ref:r,className:I("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Va.displayName=Ir.Group.displayName;const W1=p.forwardRef(({className:e,...t},r)=>a.jsx(Ir.Separator,{ref:r,className:I("-mx-1 h-px bg-border",e),...t}));W1.displayName=Ir.Separator.displayName;const rn=p.forwardRef(({className:e,...t},r)=>a.jsx(Ir.Item,{ref:r,className:I("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));rn.displayName=Ir.Item.displayName;function qT(){const{open:e,setOpen:t}=Vj(),r=Ct(),{data:n}=no(),{workspace:s}=Ie(),i=(s==null?void 0:s.slug)??"",o=l=>{t(!1),l()};return a.jsxs(UT,{open:e,onOpenChange:t,children:[a.jsx(Tu,{placeholder:"Search or jump to..."}),a.jsxs(Ts,{children:[a.jsx(Iu,{children:"No results found."}),a.jsxs(Va,{heading:"Navigation",children:[a.jsxs(rn,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[a.jsx(sd,{className:"text-muted-foreground"}),a.jsx("span",{children:"Projects"})]}),a.jsxs(rn,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[a.jsx(Ei,{className:"text-muted-foreground"}),a.jsx("span",{children:"Notifications"})]}),a.jsxs(rn,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[a.jsx(Lp,{className:"text-muted-foreground"}),a.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(W1,{}),a.jsxs(Va,{heading:"Projects",children:[n.map(l=>a.jsxs(rn,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[a.jsx(Er,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Board"})]})]},`${l.id}-board`)),n.map(l=>a.jsxs(rn,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[a.jsx(ma,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Issues"})]})]},`${l.id}-issues`))]})]})]})]})}function yr({zone:e,props:t}){const r=pE(e);return r.length?a.jsx(a.Fragment,{children:r.map((n,s)=>a.jsx(n,{...t},n.displayName??n.name??s))}):null}function Kp({flow:e,inviteToken:t,label:r,disabled:n}){const s=()=>{const i=`${Ai}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return a.jsxs(J,{type:"button",variant:"outline",className:"w-full gap-2",onClick:s,disabled:n,children:[a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[a.jsx("path",{d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4"}),a.jsx("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z",fill:"#34A853"}),a.jsx("path",{d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05"}),a.jsx("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",fill:"#EA4335"})]}),r??"Continue with Google"]})}function HT(){const[e,t]=p.useState(""),[r,n]=p.useState(""),[s,i]=p.useState(!1),o=Ct(),l=bD(),{data:c}=ku(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>F.error(f.message??"Invalid email or password")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsx(yr,{zone:"login.before",props:{}}),a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Welcome to Meridian"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Sign in to access the admin area"})]})]}),a.jsxs("form",{onSubmit:d,className:"space-y-2",children:[a.jsx(Ae,{type:"email",placeholder:"Email",value:e,onChange:u=>t(u.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:s?"text":"password",placeholder:"Password",value:r,onChange:u=>n(u.target.value),autoComplete:"current-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>i(!s),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:s?a.jsx(Ip,{className:"h-4 w-4"}):a.jsx(Il,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{type:"submit",className:"w-full h-10 font-medium",disabled:l.isPending,children:l.isPending?"Signing in...":"Continue with Email"})})]}),(c==null?void 0:c.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Kp,{flow:"login"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",a.jsx(Za,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),a.jsx(yr,{zone:"login.after",props:{}})]})})}function KT(){const[e,t]=p.useState(""),[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState(!1),u=Ct(),f=wD(),{data:m}=ku(),h=(m==null?void 0:m.needsSetup)===!0,g=x=>{x.preventDefault(),f.mutate({email:s,password:o,first_name:e,last_name:r},{onSuccess:()=>u("/"),onError:v=>F.error(v.message??"Registration failed")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:h?"Set up your account":"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:h?"You're the first user — you'll be the super admin.":"Get started with Meridian"})]})]}),a.jsxs("form",{onSubmit:g,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ae,{placeholder:"First name",value:e,onChange:x=>t(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx(Ae,{placeholder:"Last name",value:r,onChange:x=>n(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),a.jsx(Ae,{type:"email",placeholder:"Email",value:s,onChange:x=>i(x.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:c?"text":"password",placeholder:"Password",value:o,onChange:x=>l(x.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>d(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?a.jsx(Ip,{className:"h-4 w-4"}):a.jsx(Il,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{type:"submit",className:"w-full h-10 font-medium",disabled:f.isPending,children:f.isPending?"Creating account...":"Create Account"})})]}),(m==null?void 0:m.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Kp,{flow:"register",label:h?"Set up with Google":"Continue with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Already have an account?"," ",a.jsx(Za,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function YT(){const[e,t]=p.useState(""),r=Ct(),{setWorkspace:n}=Ie(),s=iD(),i=o=>{o.preventDefault(),e.trim()&&s.mutate({name:e.trim()},{onSuccess:l=>{const c={id:l.workspace.id,name:l.workspace.name,slug:l.workspace.slug};n(c),r(`/${c.slug}/projects`,{replace:!0})},onError:l=>F.error(l.message??"Failed to create workspace")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Create your workspace"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"A workspace is where your team's projects and issues live."})]})]}),a.jsxs("form",{onSubmit:i,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Ae,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:o=>t(o.target.value),autoFocus:!0,required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx("p",{className:"text-xs text-muted-foreground px-0.5",children:"You can rename it later from settings."})]}),a.jsx(J,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||s.isPending,children:s.isPending?"Creating workspace...":"Create workspace"})]})]})})}function GT(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const U1=T.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Ul=()=>{const e=T.useContext(U1);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};GT(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
534
|
+
[data-state=closed]
|
|
535
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function VT(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function XT(){return Yp(/^Mac/)}function QT(){return Yp(/^iPhone/)}function Dv(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ZT(){return Yp(/^iPad/)||XT()&&navigator.maxTouchPoints>1}function q1(){return QT()||ZT()}function Yp(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const JT=24,e5=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Tv(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const sm=typeof document<"u"&&window.visualViewport;function Iv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function H1(e){for(Iv(e)&&(e=e.parentElement);e&&!Iv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const t5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let wc=0,im;function r5(e={}){let{isDisabled:t}=e;e5(()=>{if(!t)return wc++,wc===1&&q1()&&(im=n5()),()=>{wc--,wc===0&&(im==null||im())}},[t])}function n5(){let e,t=0,r=f=>{e=H1(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},n=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let m=f.changedTouches[0].pageY,h=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((h<=0&&m>t||h>=g&&m<t)&&f.preventDefault(),t=m)},s=f=>{let m=f.target;oh(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;oh(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",sm&&(sm.height<window.innerHeight?requestAnimationFrame(()=>{Rv(m)}):sm.addEventListener("resize",()=>Rv(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=Tv(a5(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Tv(Oo(document,"touchstart",r,{passive:!1,capture:!0}),Oo(document,"touchmove",n,{passive:!1,capture:!0}),Oo(document,"touchend",s,{passive:!1,capture:!0}),Oo(document,"focus",i,!0),Oo(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function a5(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Oo(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Rv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=H1(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=r.getBoundingClientRect().bottom+JT;i>o&&(r.scrollTop+=s-n)}e=r.parentElement}}function oh(e){return e instanceof HTMLInputElement&&!t5.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function s5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function i5(...e){return t=>e.forEach(r=>s5(r,t))}function K1(...e){return p.useCallback(i5(...e),e)}const Y1=new WeakMap;function Tt(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}n[s]=e.style[s],e.style[s]=i}),!r&&Y1.set(e,n)}function o5(e,t){if(!e||!(e instanceof HTMLElement))return;let r=Y1.get(e);r&&(e.style[t]=r[t])}const Pt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function jc(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let s=n.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Pt(t)?13:12]):(s=n.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Pt(t)?5:4]):null)}function l5(e){return 8*(Math.log(e+1)-2)}function om(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function c5(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const mt={DURATION:.5,EASE:[.32,.72,0,1]},G1=.4,d5=.25,u5=100,V1=8,gs=16,lh=26,lm="vaul-dragging";function X1(e){const t=T.useRef(e);return T.useEffect(()=>{t.current=e}),T.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function f5({defaultProp:e,onChange:t}){const r=T.useState(e),[n]=r,s=T.useRef(n),i=X1(t);return T.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}function Q1({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=f5({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=X1(r),c=T.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&l(f)}else s(d)},[i,e,s,l]);return[o,c]}function m5({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=Q1({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,h]=T.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);T.useEffect(()=>{function S(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const g=T.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),x=T.useMemo(()=>{var S;return(S=r==null?void 0:r.findIndex(_=>_===u))!=null?S:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=T.useMemo(()=>{const S=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var _;return(_=r==null?void 0:r.map(C=>{const E=typeof C=="string";let P=0;if(E&&(P=parseInt(C,10)),Pt(l)){const $=E?P:m?C*S.height:0;return m?l==="bottom"?S.height-$:-S.height+$:$}const O=E?P:m?C*S.width:0;return m?l==="right"?S.width-O:-S.width+O:O}))!=null?_:[]},[r,m,c]),w=T.useMemo(()=>x!==null?y==null?void 0:y[x]:null,[y,x]),j=T.useCallback(S=>{var _;const C=(_=y==null?void 0:y.findIndex(E=>E===S))!=null?_:null;o(C),Tt(n.current,{transition:`transform ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,transform:Pt(l)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),y&&C!==y.length-1&&i!==void 0&&C!==i&&C<i?Tt(s.current,{transition:`opacity ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,opacity:"0"}):Tt(s.current,{transition:`opacity ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(C,0)])},[n.current,r,y,i,s,f]);T.useEffect(()=>{if(u||e){var S;const _=(S=r==null?void 0:r.findIndex(C=>C===e||C===u))!=null?S:-1;y&&_!==-1&&typeof y[_]=="number"&&j(y[_])}},[u,e,r,y,j]);function N({draggedDistance:S,closeDrawer:_,velocity:C,dismissible:E}){if(i===void 0)return;const P=l==="bottom"||l==="right"?(w??0)-S:(w??0)+S,O=x===i-1,$=x===0,D=S>0;if(O&&Tt(s.current,{transition:`opacity ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`}),!d&&C>2&&!D){E?_():j(y[0]);return}if(!d&&C>2&&D&&y&&r){j(y[r.length-1]);return}const B=y==null?void 0:y.reduce((W,Q)=>typeof W!="number"||typeof Q!="number"?W:Math.abs(Q-P)<Math.abs(W-P)?Q:W),A=Pt(l)?window.innerHeight:window.innerWidth;if(C>G1&&Math.abs(S)<A*.4){const W=D?1:-1;if(W>0&&g&&r){j(y[r.length-1]);return}if($&&W<0&&E&&_(),x===null)return;j(y[x+W]);return}j(B)}function k({draggedDistance:S}){if(w===null)return;const _=l==="bottom"||l==="right"?w-S:w+S;(l==="bottom"||l==="right")&&_<y[y.length-1]||(l==="top"||l==="left")&&_>y[y.length-1]||Tt(n.current,{transform:Pt(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function b(S,_){if(!r||typeof x!="number"||!y||i===void 0)return null;const C=x===i-1;if(x>=i&&_)return 0;if(C&&!_)return 1;if(!v&&!C)return null;const P=C?x+1:x-1,O=C?y[P]-y[P-1]:y[P+1]-y[P],$=S/Math.abs(O);return C?1-$:$}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:v,getPercentageDragged:b,setActiveSnapPoint:f,activeSnapPointIndex:x,onRelease:N,onDrag:k,snapPointsOffset:y}}const h5=()=>()=>{};function p5(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:s}=Ul(),i=T.useRef(null),o=p.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-lh)/window.innerWidth}T.useEffect(()=>{if(t&&r){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;c5(n&&!s?om(document.body,{background:"black"}):h5,om(c,{transformOrigin:Pt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${mt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${mt.EASE.join(",")})`}));const d=om(c,{borderRadius:`${V1}px`,overflow:"hidden",...Pt(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},mt.DURATION*1e3)}}},[t,r,o])}let Mo=null;function g5({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:i}){const[o,l]=T.useState(()=>typeof window<"u"?window.location.href:""),c=T.useRef(0),d=T.useCallback(()=>{if(Dv()&&Mo===null&&e&&!i){Mo={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:m}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=m-window.innerHeight;h&&c.current>=m&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),u=T.useCallback(()=>{if(Dv()&&Mo!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Mo),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),Mo=null}},[o]);return T.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),T.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),T.useEffect(()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{u()},500)):u())},[e,n,o,t,r,d,u]),{restorePositionSetting:u}}function x5({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=d5,scrollLockTimeout:d=u5,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:g,fixed:x,modal:v=!0,onClose:y,nested:w,noBodyStyles:j=!1,direction:N="bottom",defaultOpen:k=!1,disablePreventScroll:b=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:_=!1,repositionInputs:C=!0,onAnimationEnd:E,container:P,autoFocus:O=!1}){var $,D;const[B=!1,A]=Q1({defaultProp:k,prop:e,onChange:Ne=>{t==null||t(Ne),!Ne&&!w&&jt(),setTimeout(()=>{E==null||E(Ne)},mt.DURATION*1e3),Ne&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ne||(document.body.style.pointerEvents="auto")}}),[W,Q]=T.useState(!1),[K,ie]=T.useState(!1),[ne,U]=T.useState(!1),Y=T.useRef(null),Z=T.useRef(null),G=T.useRef(null),M=T.useRef(null),z=T.useRef(null),se=T.useRef(!1),L=T.useRef(null),q=T.useRef(0),de=T.useRef(!1),X=T.useRef(!k),Me=T.useRef(0),ae=T.useRef(null),Ce=T.useRef((($=ae.current)==null?void 0:$.getBoundingClientRect().height)||0),_e=T.useRef(((D=ae.current)==null?void 0:D.getBoundingClientRect().width)||0),Pe=T.useRef(0),De=T.useCallback(Ne=>{i&&Ne===Ge.length-1&&(Z.current=new Date)},[]),{activeSnapPoint:V,activeSnapPointIndex:Oe,setActiveSnapPoint:Te,onRelease:xt,snapPointsOffset:Ge,onDrag:Ot,shouldFade:Sr,getPercentageDragged:ut}=m5({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:g,drawerRef:ae,fadeFromIndex:m,overlayRef:Y,onSnapPointChange:De,direction:N,container:P,snapToSequentialPoint:S});r5({isDisabled:!B||K||!v||ne||!W||!C||!b});const{restorePositionSetting:jt}=g5({isOpen:B,modal:v,nested:w??!1,hasBeenOpened:W,preventScrollRestoration:_,noBodyStyles:j});function Xr(){return(window.innerWidth-lh)/window.innerWidth}function za(Ne){var ue,pe;!u&&!i||ae.current&&!ae.current.contains(Ne.target)||(Ce.current=((ue=ae.current)==null?void 0:ue.getBoundingClientRect().height)||0,_e.current=((pe=ae.current)==null?void 0:pe.getBoundingClientRect().width)||0,ie(!0),G.current=new Date,q1()&&window.addEventListener("touchend",()=>se.current=!1,{once:!0}),Ne.target.setPointerCapture(Ne.pointerId),q.current=Pt(N)?Ne.pageY:Ne.pageX)}function Qr(Ne,ue){var pe;let ce=Ne;const me=(pe=window.getSelection())==null?void 0:pe.toString(),He=ae.current?jc(ae.current,N):null,re=new Date;if(ce.tagName==="SELECT"||ce.hasAttribute("data-vaul-no-drag")||ce.closest("[data-vaul-no-drag]"))return!1;if(N==="right"||N==="left")return!0;if(Z.current&&re.getTime()-Z.current.getTime()<500)return!1;if(He!==null&&(N==="bottom"?He>0:He<0))return!0;if(me&&me.length>0)return!1;if(z.current&&re.getTime()-z.current.getTime()<d&&He===0||ue)return z.current=re,!1;for(;ce;){if(ce.scrollHeight>ce.clientHeight){if(ce.scrollTop!==0)return z.current=new Date,!1;if(ce.getAttribute("role")==="dialog")return!0}ce=ce.parentNode}return!0}function Qn(Ne){if(ae.current&&K){const ue=N==="bottom"||N==="right"?1:-1,pe=(q.current-(Pt(N)?Ne.pageY:Ne.pageX))*ue,ce=pe>0,me=i&&!u&&!ce;if(me&&Oe===0)return;const He=Math.abs(pe),re=document.querySelector("[data-vaul-drawer-wrapper]"),be=N==="bottom"||N==="top"?Ce.current:_e.current;let Ee=He/be;const ft=ut(He,ce);if(ft!==null&&(Ee=ft),me&&Ee>=1||!se.current&&!Qr(Ne.target,ce))return;if(ae.current.classList.add(lm),se.current=!0,Tt(ae.current,{transition:"none"}),Tt(Y.current,{transition:"none"}),i&&Ot({draggedDistance:pe}),ce&&!i){const Ze=l5(pe),mr=Math.min(Ze*-1,0)*ue;Tt(ae.current,{transform:Pt(N)?`translate3d(0, ${mr}px, 0)`:`translate3d(${mr}px, 0, 0)`});return}const Qe=1-Ee;if((Sr||m&&Oe===m-1)&&(n==null||n(Ne,Ee),Tt(Y.current,{opacity:`${Qe}`,transition:"none"},!0)),re&&Y.current&&o){const Ze=Math.min(Xr()+Ee*(1-Xr()),1),mr=8-Ee*8,Qt=Math.max(0,14-Ee*14);Tt(re,{borderRadius:`${mr}px`,transform:Pt(N)?`scale(${Ze}) translate3d(0, ${Qt}px, 0)`:`scale(${Ze}) translate3d(${Qt}px, 0, 0)`,transition:"none"},!0)}if(!i){const Ze=He*ue;Tt(ae.current,{transform:Pt(N)?`translate3d(0, ${Ze}px, 0)`:`translate3d(${Ze}px, 0, 0)`})}}}T.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),T.useEffect(()=>{var Ne;function ue(){if(!ae.current||!C)return;const pe=document.activeElement;if(oh(pe)||de.current){var ce;const me=((ce=window.visualViewport)==null?void 0:ce.height)||0,He=window.innerHeight;let re=He-me;const be=ae.current.getBoundingClientRect().height||0,Ee=be>He*.8;Pe.current||(Pe.current=be);const ft=ae.current.getBoundingClientRect().top;if(Math.abs(Me.current-re)>60&&(de.current=!de.current),i&&i.length>0&&Ge&&Oe){const Qe=Ge[Oe]||0;re+=Qe}if(Me.current=re,be>me||de.current){const Qe=ae.current.getBoundingClientRect().height;let Ze=Qe;Qe>me&&(Ze=me-(Ee?ft:lh)),x?ae.current.style.height=`${Qe-Math.max(re,0)}px`:ae.current.style.height=`${Math.max(Ze,me-ft)}px`}else VT()||(ae.current.style.height=`${Pe.current}px`);i&&i.length>0&&!de.current?ae.current.style.bottom="0px":ae.current.style.bottom=`${Math.max(re,0)}px`}}return(Ne=window.visualViewport)==null||Ne.addEventListener("resize",ue),()=>{var pe;return(pe=window.visualViewport)==null?void 0:pe.removeEventListener("resize",ue)}},[Oe,i,Ge]);function zr(Ne){fr(),y==null||y(),Ne||A(!1),setTimeout(()=>{i&&Te(i[0])},mt.DURATION*1e3)}function Lr(){if(!ae.current)return;const Ne=document.querySelector("[data-vaul-drawer-wrapper]"),ue=jc(ae.current,N);Tt(ae.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`}),Tt(Y.current,{transition:`opacity ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,opacity:"1"}),o&&ue&&ue>0&&B&&Tt(Ne,{borderRadius:`${V1}px`,overflow:"hidden",...Pt(N)?{transform:`scale(${Xr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Xr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${mt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${mt.EASE.join(",")})`},!0)}function fr(){!K||!ae.current||(ae.current.classList.remove(lm),se.current=!1,ie(!1),M.current=new Date)}function sr(Ne){if(!K||!ae.current)return;ae.current.classList.remove(lm),se.current=!1,ie(!1),M.current=new Date;const ue=jc(ae.current,N);if(!Ne||!Qr(Ne.target,!1)||!ue||Number.isNaN(ue)||G.current===null)return;const pe=M.current.getTime()-G.current.getTime(),ce=q.current-(Pt(N)?Ne.pageY:Ne.pageX),me=Math.abs(ce)/pe;if(me>.05&&(U(!0),setTimeout(()=>{U(!1)},200)),i){xt({draggedDistance:ce*(N==="bottom"||N==="right"?1:-1),closeDrawer:zr,velocity:me,dismissible:u}),s==null||s(Ne,!0);return}if(N==="bottom"||N==="right"?ce>0:ce<0){Lr(),s==null||s(Ne,!0);return}if(me>G1){zr(),s==null||s(Ne,!1);return}var He;const re=Math.min((He=ae.current.getBoundingClientRect().height)!=null?He:0,window.innerHeight);var be;const Ee=Math.min((be=ae.current.getBoundingClientRect().width)!=null?be:0,window.innerWidth),ft=N==="left"||N==="right";if(Math.abs(ue)>=(ft?Ee:re)*c){zr(),s==null||s(Ne,!1);return}s==null||s(Ne,!0),Lr()}T.useEffect(()=>(B&&(Tt(document.documentElement,{scrollBehavior:"auto"}),Z.current=new Date),()=>{o5(document.documentElement,"scrollBehavior")}),[B]);function Xt(Ne){const ue=Ne?(window.innerWidth-gs)/window.innerWidth:1,pe=Ne?-gs:0;L.current&&window.clearTimeout(L.current),Tt(ae.current,{transition:`transform ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,transform:Pt(N)?`scale(${ue}) translate3d(0, ${pe}px, 0)`:`scale(${ue}) translate3d(${pe}px, 0, 0)`}),!Ne&&ae.current&&(L.current=setTimeout(()=>{const ce=jc(ae.current,N);Tt(ae.current,{transition:"none",transform:Pt(N)?`translate3d(0, ${ce}px, 0)`:`translate3d(${ce}px, 0, 0)`})},500))}function _n(Ne,ue){if(ue<0)return;const pe=(window.innerWidth-gs)/window.innerWidth,ce=pe+ue*(1-pe),me=-gs+ue*gs;Tt(ae.current,{transform:Pt(N)?`scale(${ce}) translate3d(0, ${me}px, 0)`:`scale(${ce}) translate3d(${me}px, 0, 0)`,transition:"none"})}function Zn(Ne,ue){const pe=Pt(N)?window.innerHeight:window.innerWidth,ce=ue?(pe-gs)/pe:1,me=ue?-gs:0;ue&&Tt(ae.current,{transition:`transform ${mt.DURATION}s cubic-bezier(${mt.EASE.join(",")})`,transform:Pt(N)?`scale(${ce}) translate3d(0, ${me}px, 0)`:`scale(${ce}) translate3d(${me}px, 0, 0)`})}return T.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),T.createElement(Pl,{defaultOpen:k,onOpenChange:Ne=>{!u&&!Ne||(Ne?Q(!0):zr(!0),A(Ne))},open:B},T.createElement(U1.Provider,{value:{activeSnapPoint:V,snapPoints:i,setActiveSnapPoint:Te,drawerRef:ae,overlayRef:Y,onOpenChange:t,onPress:za,onRelease:sr,onDrag:Qn,dismissible:u,shouldAnimate:X,handleOnly:f,isOpen:B,isDragging:K,shouldFade:Sr,closeDrawer:zr,onNestedDrag:_n,onNestedOpenChange:Xt,onNestedRelease:Zn,keyboardIsOpen:de,modal:v,snapPointsOffset:Ge,activeSnapPointIndex:Oe,direction:N,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:j,container:P,autoFocus:O}},r))}const Z1=T.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:s,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=Ul(),d=K1(t,r),u=n&&n.length>0;if(!l)return null;const f=T.useCallback(m=>s(m),[s]);return T.createElement(ni,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":o&&u?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false","data-vaul-animate":c!=null&&c.current?"true":"false",...e})});Z1.displayName="Drawer.Overlay";const J1=T.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},s){const{drawerRef:i,onPress:o,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,activeSnapPointIndex:f,modal:m,isOpen:h,direction:g,snapPoints:x,container:v,handleOnly:y,shouldAnimate:w,autoFocus:j}=Ul(),[N,k]=T.useState(!1),b=K1(s,i),S=T.useRef(null),_=T.useRef(null),C=T.useRef(!1),E=x&&x.length>0;p5();const P=($,D,B=0)=>{if(C.current)return!0;const A=Math.abs($.y),W=Math.abs($.x),Q=W>A,K=["bottom","right"].includes(D)?1:-1;if(D==="left"||D==="right"){if(!($.x*K<0)&&W>=0&&W<=B)return Q}else if(!($.y*K<0)&&A>=0&&A<=B)return!Q;return C.current=!0,!0};T.useEffect(()=>{E&&window.requestAnimationFrame(()=>{k(!0)})},[]);function O($){S.current=null,C.current=!1,l($)}return T.createElement(ai,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":N?"true":"false","data-vaul-snap-points":h&&E?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":w!=null&&w.current?"true":"false",...n,ref:b,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:$=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,$),S.current={x:$.pageX,y:$.pageY},o($))},onOpenAutoFocus:$=>{r==null||r($),j||$.preventDefault()},onPointerDownOutside:$=>{if(e==null||e($),!m||$.defaultPrevented){$.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:$=>{if(!m){$.preventDefault();return}},onPointerMove:$=>{if(_.current=$,y||(n.onPointerMove==null||n.onPointerMove.call(n,$),!S.current))return;const D=$.pageY-S.current.y,B=$.pageX-S.current.x,A=$.pointerType==="touch"?10:2;P({x:B,y:D},g,A)?c($):(Math.abs(B)>A||Math.abs(D)>A)&&(S.current=null)},onPointerUp:$=>{n.onPointerUp==null||n.onPointerUp.call(n,$),S.current=null,C.current=!1,l($)},onPointerOut:$=>{n.onPointerOut==null||n.onPointerOut.call(n,$),O(_.current)},onContextMenu:$=>{n.onContextMenu==null||n.onContextMenu.call(n,$),_.current&&O(_.current)}})});J1.displayName="Drawer.Content";const v5=250,y5=120,b5=T.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:f,onPress:m,onDrag:h}=Ul(),g=T.useRef(null),x=T.useRef(!1);function v(){if(x.current){j();return}window.setTimeout(()=>{y()},y5)}function y(){if(i||e||x.current){j();return}if(j(),!o||o.length===0){d||s();return}if(l===o[o.length-1]&&d){s();return}const k=o.findIndex(S=>S===l);if(k===-1)return;const b=o[k+1];c(b)}function w(){g.current=window.setTimeout(()=>{x.current=!0},v5)}function j(){g.current&&window.clearTimeout(g.current),x.current=!1}return T.createElement("div",{onClick:v,onPointerCancel:j,onPointerDown:N=>{u&&m(N),w()},onPointerMove:N=>{u&&h(N)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},T.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});b5.displayName="Drawer.Handle";function w5(e){const t=Ul(),{container:r=t.container,...n}=e;return T.createElement(Ml,{container:r,...n})}const Oa={Root:x5,Content:J1,Overlay:Z1,Portal:w5,Title:Gi,Description:Vi},si=({shouldScaleBackground:e=!1,direction:t="right",...r})=>a.jsx(Oa.Root,{shouldScaleBackground:e,direction:t,...r});si.displayName="Drawer";const j5=Oa.Portal,eN=p.forwardRef(({className:e,...t},r)=>a.jsx(Oa.Overlay,{ref:r,className:I("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));eN.displayName=Oa.Overlay.displayName;const ii=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(j5,{children:[a.jsx(eN,{}),a.jsx(Oa.Content,{ref:n,className:I("fixed inset-y-0 right-0 z-50 flex h-full flex-col border-l border-border bg-background shadow-xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right","w-full max-w-lg",e),...r,children:t})]}));ii.displayName="DrawerContent";const ao=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...t});ao.displayName="DrawerHeader";const so=({className:e,...t})=>a.jsx("div",{className:I("flex-1 overflow-y-auto px-6 py-4",e),...t});so.displayName="DrawerBody";const ql=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 px-6 py-4 border-t border-border shrink-0",e),...t});ql.displayName="DrawerFooter";const io=p.forwardRef(({className:e,...t},r)=>a.jsx(Oa.Title,{ref:r,className:I("text-base font-semibold text-foreground",e),...t}));io.displayName=Oa.Title.displayName;const N5=p.forwardRef(({className:e,...t},r)=>a.jsx(Oa.Description,{ref:r,className:I("text-sm text-muted-foreground",e),...t}));N5.displayName=Oa.Description.displayName;const k5=El("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),vt=p.forwardRef(({className:e,...t},r)=>a.jsx(bj,{ref:r,className:I(k5(),e),...t}));vt.displayName=bj.displayName;const Ru=p.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:I("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-none placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none",e),ref:r,...t}));Ru.displayName="Textarea";const $v=[{name:"Backlog",key:"backlog",color:"#94a3b8",category:"backlog",position:0},{name:"Todo",key:"todo",color:"#64748b",category:"unstarted",position:1},{name:"In Progress",key:"in_progress",color:"#6366f1",category:"started",position:2},{name:"In Review",key:"in_review",color:"#f59e0b",category:"started",position:3},{name:"Done",key:"done",color:"#10b981",category:"completed",position:4},{name:"Cancelled",key:"cancelled",color:"#9ca3af",category:"cancelled",position:5}],cm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function S5(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function C5({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:i,transition:o,isDragging:l}=kp({id:e.key});return a.jsxs("div",{ref:s,style:{transform:Sp.Transform.toString(i),transition:o},className:I("flex items-center gap-1 pl-1 pr-1.5 py-0.5 rounded-full border text-xs font-medium transition-opacity",l?"opacity-50":"opacity-100"),children:[a.jsx("span",{...r,...n,className:"text-muted-foreground/50 hover:text-muted-foreground cursor-grab touch-none",children:a.jsx(h1,{className:"h-3 w-3"})}),a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),a.jsx("span",{className:"text-[11px]",children:e.name}),a.jsx("button",{type:"button",onClick:t,className:"ml-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:a.jsx(et,{className:"h-3 w-3"})})]})}const _5=3;function O5({open:e,onClose:t}){var B;const[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[m,h]=p.useState($v),[g,x]=p.useState(""),[v,y]=p.useState(cm[2]),{workspace:w}=Ie(),j=BD(),N=LD(r,{enabled:e}),k=FD(s,{enabled:e});p.useEffect(()=>{e&&N.data&&!c&&i(N.data)},[e,N.data,c]);const b=k.available===!1||j.isError&&((B=j.error)==null?void 0:B.status)===409,S=s.trim().length>=_5&&/^[A-Z0-9]+$/i.test(s.trim()),_=Tj(jp(Ij,{activationConstraint:{distance:5}})),C=A=>{n(A)},E=()=>{r.trim()&&!c&&N.flush()},P=()=>{n(""),i(""),l(""),d(!1),f(!1),h($v),x(""),y(cm[2]),j.reset(),t()},O=()=>{if(!g.trim())return;const A=S5(g.trim());if(m.some(W=>W.key===A)){F.error("A status with this name already exists");return}h(W=>[...W,{name:g.trim(),key:A,color:v,category:"started",position:W.length}]),x("")},$=A=>{const{active:W,over:Q}=A;!Q||W.id===Q.id||h(K=>{const ie=K.findIndex(U=>U.key===W.id),ne=K.findIndex(U=>U.key===Q.id);return Vc(K,ie,ne).map((U,Y)=>({...U,position:Y}))})},D=A=>{A.preventDefault(),!(!r.trim()||!s.trim()||!S||b)&&j.mutate({name:r.trim(),identifier:s.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:w.id,initial_statuses:m},{onSuccess:()=>{F.success("Project created"),P()},onError:W=>{(W==null?void 0:W.status)===409?F.error("This project key is already in use."):F.error(W.message??"Failed to create project")}})};return a.jsx(si,{open:e,onOpenChange:A=>!A&&P(),dismissible:!1,children:a.jsxs(ii,{className:"max-w-md",children:[a.jsx(ao,{children:a.jsx(io,{children:"New project"})}),a.jsxs("form",{onSubmit:D,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(so,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{htmlFor:"project-name",children:"Name"}),a.jsx(Ae,{id:"project-name",placeholder:"My Project",value:r,onChange:A=>C(A.target.value),onBlur:E,autoFocus:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Project key below will auto-fill when you finish typing; you can change it."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{htmlFor:"project-id",children:["Identifier",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Used as issue prefix (e.g. PROJ-1)"})]}),a.jsx(Ae,{id:"project-id",placeholder:"PROJ",value:s,onChange:A=>{i(A.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:I("font-mono",b&&"border-destructive"),"aria-invalid":b}),b&&a.jsx("p",{className:"text-xs text-destructive",children:"This project key is already in use."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{htmlFor:"project-desc",children:["Description",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Ru,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:A=>l(A.target.value),className:"min-h-[80px]"})]}),a.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[a.jsx("button",{type:"button",onClick:()=>f(!u),className:"w-full flex items-center justify-between px-3 py-2.5 text-xs font-medium hover:bg-muted/40 transition-colors",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[u?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"}),"Statuses",a.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",m.length,")"]})]})}),u&&a.jsxs("div",{className:"px-3 pb-3 border-t border-border space-y-3 pt-3",children:[a.jsx(el,{sensors:_,onDragEnd:$,children:a.jsx(Np,{items:m.map(A=>A.key),strategy:Rj,children:a.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(A=>a.jsx(C5,{chip:A,onRemove:()=>h(W=>W.filter(Q=>Q.key!==A.key).map((Q,K)=>({...Q,position:K})))},A.key))})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:cm.map(A=>a.jsx("button",{type:"button",onClick:()=>y(A),className:I("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===A?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:A}},A))}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[a.jsx(Ae,{placeholder:"Status name…",value:g,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),O())},className:"h-7 text-xs flex-1"}),a.jsx(J,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:O,disabled:!g.trim(),children:a.jsx(st,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),a.jsxs(ql,{children:[a.jsx(J,{type:"button",variant:"ghost",onClick:P,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!r.trim()||!s.trim()||!S||b||j.isPending,children:j.isPending?"Creating...":"Create project"})]})]})]})})}const Fe=tP,qe=rP,ze=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(wj,{ref:n,className:I("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-none ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(XM,{asChild:!0,children:a.jsx(Kn,{className:"h-4 w-4 opacity-50"})})]}));ze.displayName=wj.displayName;const tN=p.forwardRef(({className:e,...t},r)=>a.jsx(jj,{ref:r,className:I("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ap,{className:"h-4 w-4"})}));tN.displayName=jj.displayName;const rN=p.forwardRef(({className:e,...t},r)=>a.jsx(Nj,{ref:r,className:I("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Kn,{className:"h-4 w-4"})}));rN.displayName=Nj.displayName;const Le=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(QM,{children:a.jsxs(kj,{ref:s,className:I("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(tN,{}),a.jsx(ZM,{className:I("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(rN,{})]})}));Le.displayName=kj.displayName;const M5=p.forwardRef(({className:e,...t},r)=>a.jsx(Sj,{ref:r,className:I("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));M5.displayName=Sj.displayName;const xe=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Cj,{ref:n,className:I("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(JM,{children:a.jsx(rr,{className:"h-4 w-4"})})}),a.jsx(eP,{children:t})]}));xe.displayName=Cj.displayName;const P5=p.forwardRef(({className:e,...t},r)=>a.jsx(_j,{ref:r,className:I("-mx-1 my-1 h-px bg-border",e),...t}));P5.displayName=_j.displayName;function A5({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:s}=Ie(),i=(s==null?void 0:s.id)??"",{data:o,isLoading:l}=Gn(r),{data:c}=zl(i),{data:d}=Nu(i),u=M1(r),f=P1(r),m=A1(r),h=E1(r),[g,x]=p.useState(""),[v,y]=p.useState(""),w=new Set((o==null?void 0:o.members.map(b=>b.user_id))??[]),j=new Set((o==null?void 0:o.teams.map(b=>b.team_id))??[]),N=(c??[]).filter(b=>!w.has(b.user_id)),k=(d??[]).filter(b=>!j.has(b.id));return a.jsx(ls,{open:e,onOpenChange:b=>!b&&t(),children:a.jsxs(_a,{className:"sm:max-w-[480px]",children:[a.jsx(cs,{children:a.jsxs(ds,{children:["Access — ",n]})}),a.jsxs("div",{className:"space-y-5 pt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),l?a.jsx("div",{className:"space-y-2",children:[1,2].map(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-3.5 w-32"})]},b))}):(o==null?void 0:o.members.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.members.map(b=>{var O;const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"",E=`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown",P=(_[0]??C[0]??((O=S==null?void 0:S.email)==null?void 0:O[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx($t,{className:"h-7 w-7 shrink-0",children:a.jsx(zt,{className:"text-[11px] font-medium",children:P})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:E}),a.jsx("span",{className:I("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",b.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:b.role}),a.jsx("button",{onClick:()=>f.mutate(b.user_id,{onSuccess:()=>F.success("Access removed"),onError:()=>F.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]},b.id)})}),N.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(to,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(qe,{placeholder:"Add person…"})}),a.jsx(Le,{children:N.map(b=>{const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"",E=`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown";return a.jsx(xe,{value:b.user_id,children:E},b.user_id)})})]}),g&&a.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:g},{onSuccess:()=>{F.success("Access granted"),x("")},onError:()=>F.error("Failed to grant access")}),children:"Add"})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),l?a.jsx("div",{className:"space-y-2",children:[1].map(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg"}),a.jsx(le,{className:"h-3.5 w-28"})]},b))}):(o==null?void 0:o.teams.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.teams.map(b=>{const S=b.team;return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ls,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:(S==null?void 0:S.name)??"Unknown team"}),S&&a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[S.member_count," ",S.member_count===1?"member":"members"]}),a.jsx("button",{onClick:()=>h.mutate(b.team_id,{onSuccess:()=>F.success("Team access removed"),onError:()=>F.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]},b.id)})}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(Ls,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(qe,{placeholder:"Add team…"})}),a.jsx(Le,{children:k.map(b=>a.jsx(xe,{value:b.id,children:b.name},b.id))})]}),v&&a.jsx(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{F.success("Team access granted"),y("")},onError:()=>F.error("Failed to add team")}),children:"Add"})]})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx(J,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const nN=6048e5,E5=864e5,D5=36e5,Nc=43200,zv=1440,Lv=Symbol.for("constructDateFrom");function gt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Lv in e?e[Lv](t):e instanceof Date?new e.constructor(t):new Date(t)}function We(e,t){return gt(t||e,e)}function Ar(e,t,r){const n=We(e,r==null?void 0:r.in);return isNaN(t)?gt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Gp(e,t,r){const n=We(e,r==null?void 0:r.in);if(isNaN(t))return gt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const s=n.getDate(),i=gt((r==null?void 0:r.in)||e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return s>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),s),n)}let T5={};function oo(){return T5}function Di(e,t){var l,c,d,u;const r=oo(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=We(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?7:0)+i-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function il(e,t){return Di(e,{...t,weekStartsOn:1})}function aN(e,t){const r=We(e,t==null?void 0:t.in),n=r.getFullYear(),s=gt(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=il(s),o=gt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=il(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function id(e){const t=We(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Vn(e,...t){const r=gt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Ti(e,t){const r=We(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function $u(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t),i=Ti(n),o=Ti(s),l=+i-id(i),c=+o-id(o);return Math.round((l-c)/E5)}function I5(e,t){const r=aN(e,t),n=gt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),il(n)}function R5(e,t,r){return Ar(e,t*7,r)}function $5(e,t,r){return Gp(e,t*12,r)}function z5(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=gt.bind(null,s));const i=We(s,n);(!r||r<i||isNaN(+i))&&(r=i)}),gt(n,r||NaN)}function L5(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=gt.bind(null,s));const i=We(s,n);(!r||r>i||isNaN(+i))&&(r=i)}),gt(n,r||NaN)}function Xc(e,t){const r=+We(e)-+We(t);return r<0?-1:r>0?1:r}function Vp(e){return gt(e,Date.now())}function Ii(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t);return+Ti(n)==+Ti(s)}function sN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function F5(e){return!(!sN(e)&&typeof e!="number"||isNaN(+We(e)))}function Xp(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t),i=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return i*12+o}function iN(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t),i=Fv(n,s),o=Math.abs($u(n,s));n.setDate(n.getDate()-i*o);const l=+(Fv(n,s)===-i),c=i*(o-l);return c===0?0:c}function Fv(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function oN(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function B5(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t),i=(+n-+s)/D5;return oN(r==null?void 0:r.roundingMethod)(i)}function W5(e,t){return+We(e)-+We(t)}function lN(e,t){const r=We(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function Qp(e,t){const r=We(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function U5(e,t){const r=We(e,t==null?void 0:t.in);return+lN(r,t)==+Qp(r,t)}function cN(e,t,r){const[n,s,i]=Vn(r==null?void 0:r.in,e,e,t),o=Xc(s,i),l=Math.abs(Xp(s,i));if(l<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=Xc(s,i)===-o;U5(n)&&l===1&&Xc(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function q5(e,t,r){const n=W5(e,t)/1e3;return oN(r==null?void 0:r.roundingMethod)(n)}function dN(e,t){const[r,n]=Vn(e,t.start,t.end);return{start:r,end:n}}function H5(e,t){const{start:r,end:n}=dN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(gt(r,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function uN(e,t){const r=We(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function K5(e,t){const r=We(e,t==null?void 0:t.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function fN(e,t){const r=We(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Y5(e,t){const{start:r,end:n}=dN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(gt(r,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function mN(e,t){var l,c,d,u;const r=oo(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=We(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?-7:0)+6-(i-n);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function G5(e,t){return mN(e,{...t,weekStartsOn:1})}const V5={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},X5=(e,t,r)=>{let n;const s=V5[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function dm(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Q5={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Z5={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},J5={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e3={date:dm({formats:Q5,defaultWidth:"full"}),time:dm({formats:Z5,defaultWidth:"full"}),dateTime:dm({formats:J5,defaultWidth:"full"})},t3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},r3=(e,t,r,n)=>t3[e];function Po(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const n3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s3={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},i3={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},o3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},l3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},c3=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},d3={ordinalNumber:c3,era:Po({values:n3,defaultWidth:"wide"}),quarter:Po({values:a3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Po({values:s3,defaultWidth:"wide"}),day:Po({values:i3,defaultWidth:"wide"}),dayPeriod:Po({values:o3,defaultWidth:"wide",formattingValues:l3,defaultFormattingWidth:"wide"})};function Ao(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?f3(l,f=>f.test(o)):u3(l,f=>f.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function u3(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function f3(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function m3(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const h3=/^(\d+)(th|st|nd|rd)?/i,p3=/\d+/i,g3={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},x3={any:[/^b/i,/^(a|c)/i]},v3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},y3={any:[/1/i,/2/i,/3/i,/4/i]},b3={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},w3={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},j3={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},N3={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},k3={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},S3={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},C3={ordinalNumber:m3({matchPattern:h3,parsePattern:p3,valueCallback:e=>parseInt(e,10)}),era:Ao({matchPatterns:g3,defaultMatchWidth:"wide",parsePatterns:x3,defaultParseWidth:"any"}),quarter:Ao({matchPatterns:v3,defaultMatchWidth:"wide",parsePatterns:y3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ao({matchPatterns:b3,defaultMatchWidth:"wide",parsePatterns:w3,defaultParseWidth:"any"}),day:Ao({matchPatterns:j3,defaultMatchWidth:"wide",parsePatterns:N3,defaultParseWidth:"any"}),dayPeriod:Ao({matchPatterns:k3,defaultMatchWidth:"any",parsePatterns:S3,defaultParseWidth:"any"})},Ss={code:"en-US",formatDistance:X5,formatLong:e3,formatRelative:r3,localize:d3,match:C3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _3(e,t){const r=We(e,t==null?void 0:t.in);return $u(r,fN(r))+1}function Zp(e,t){const r=We(e,t==null?void 0:t.in),n=+il(r)-+I5(r);return Math.round(n/nN)+1}function hN(e,t){var u,f,m,h;const r=We(e,t==null?void 0:t.in),n=r.getFullYear(),s=oo(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((h=(m=s.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=gt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Di(o,t),c=gt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Di(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function O3(e,t){var l,c,d,u;const r=oo(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=hN(e,t),i=gt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Di(i,t)}function Jp(e,t){const r=We(e,t==null?void 0:t.in),n=+Di(r,t)-+O3(r,t);return Math.round(n/nN)+1}function Ve(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Ba={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Ve(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Ve(r+1,2)},d(e,t){return Ve(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Ve(e.getHours()%12||12,t.length)},H(e,t){return Ve(e.getHours(),t.length)},m(e,t){return Ve(e.getMinutes(),t.length)},s(e,t){return Ve(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Ve(s,t.length)}},mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bv={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Ba.y(e,t)},Y:function(e,t,r,n){const s=hN(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Ve(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Ve(i,t.length)},R:function(e,t){const r=aN(e);return Ve(r,t.length)},u:function(e,t){const r=e.getFullYear();return Ve(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ve(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ve(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Ba.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ve(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Jp(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Ve(s,t.length)},I:function(e,t,r){const n=Zp(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Ve(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ba.d(e,t)},D:function(e,t,r){const n=_3(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Ve(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ve(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ve(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return Ve(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=mi.noon:n===0?s=mi.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=mi.evening:n>=12?s=mi.afternoon:n>=4?s=mi.morning:s=mi.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ba.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ba.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Ve(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Ve(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ba.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ba.s(e,t)},S:function(e,t){return Ba.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Uv(n);case"XXXX":case"XX":return ys(n);case"XXXXX":case"XXX":default:return ys(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Uv(n);case"xxxx":case"xx":return ys(n);case"xxxxx":case"xxx":default:return ys(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Wv(n,":");case"OOOO":default:return"GMT"+ys(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Wv(n,":");case"zzzz":default:return"GMT"+ys(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Ve(n,t.length)},T:function(e,t,r){return Ve(+e,t.length)}};function Wv(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),i=n%60;return i===0?r+String(s):r+String(s)+t+Ve(i,2)}function Uv(e,t){return e%60===0?(e>0?"-":"+")+Ve(Math.abs(e)/60,2):ys(e,t)}function ys(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Ve(Math.trunc(n/60),2),i=Ve(n%60,2);return r+s+t+i}const qv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},pN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},M3=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return qv(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",qv(n,t)).replace("{{time}}",pN(s,t))},P3={p:pN,P:M3},A3=/^D+$/,E3=/^Y+$/,D3=["D","DD","YY","YYYY"];function T3(e){return A3.test(e)}function I3(e){return E3.test(e)}function R3(e,t,r){const n=$3(e,t,r);if(console.warn(n),D3.includes(e))throw new RangeError(n)}function $3(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const z3=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L3=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,F3=/^'([^]*?)'?$/,B3=/''/g,W3=/[a-zA-Z]/;function fe(e,t,r){var u,f,m,h,g,x,v,y;const n=oo(),s=(r==null?void 0:r.locale)??n.locale??Ss,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(m=n.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((x=(g=r==null?void 0:r.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=We(e,r==null?void 0:r.in);if(!F5(l))throw new RangeError("Invalid time value");let c=t.match(L3).map(w=>{const j=w[0];if(j==="p"||j==="P"){const N=P3[j];return N(w,s.formatLong)}return w}).join("").match(z3).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const j=w[0];if(j==="'")return{isToken:!1,value:U3(w)};if(Bv[j])return{isToken:!0,value:w};if(j.match(W3))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(w=>{if(!w.isToken)return w.value;const j=w.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&I3(j)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&T3(j))&&R3(j,t,String(e));const N=Bv[j[0]];return N(l,j,s.localize,d)}).join("")}function U3(e){const t=e.match(F3);return t?t[1].replace(B3,"'"):e}function ch(e,t,r){const n=oo(),s=(r==null?void 0:r.locale)??n.locale??Ss,i=2520,o=Xc(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o}),[c,d]=Vn(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=q5(d,c),f=(id(d)-id(c))/1e3,m=Math.round((u-f)/60);let h;if(m<2)return r!=null&&r.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,l):u<10?s.formatDistance("lessThanXSeconds",10,l):u<20?s.formatDistance("lessThanXSeconds",20,l):u<40?s.formatDistance("halfAMinute",0,l):u<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):m===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",m,l);if(m<45)return s.formatDistance("xMinutes",m,l);if(m<90)return s.formatDistance("aboutXHours",1,l);if(m<zv){const g=Math.round(m/60);return s.formatDistance("aboutXHours",g,l)}else{if(m<i)return s.formatDistance("xDays",1,l);if(m<Nc){const g=Math.round(m/zv);return s.formatDistance("xDays",g,l)}else if(m<Nc*2)return h=Math.round(m/Nc),s.formatDistance("aboutXMonths",h,l)}if(h=cN(d,c),h<12){const g=Math.round(m/Nc);return s.formatDistance("xMonths",g,l)}else{const g=h%12,x=Math.trunc(h/12);return g<3?s.formatDistance("aboutXYears",x,l):g<9?s.formatDistance("overXYears",x,l):s.formatDistance("almostXYears",x+1,l)}}function q3(e,t){return ch(e,Vp(e),t)}function tl(e,t){return We(e,t==null?void 0:t.in).getDate()}function H3(e,t){return We(e,t==null?void 0:t.in).getDay()}function ts(e,t){const r=We(e,t==null?void 0:t.in),n=r.getFullYear(),s=r.getMonth(),i=gt(r,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function Qc(e,t){return We(e,t==null?void 0:t.in).getMonth()}function K3(e,t){return We(e,t==null?void 0:t.in).getFullYear()}function Y3(e,t){return+We(e)>+We(t)}function G3(e,t){return+We(e)<+We(t)}function V3(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function X3(e,t,r){const[n,s]=Vn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()}function Q3(e,t){return Ii(gt(e,e),Vp(e))}function gN(e,t,r){return Ar(e,-1,r)}function Z3(e,t){return Ii(gt(e,e),gN(Vp(e)))}function J3(e,t,r){const n=We(e,r==null?void 0:r.in),s=n.getFullYear(),i=n.getDate(),o=gt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=ts(o);return n.setMonth(t,Math.min(i,l)),n}function eI(e,t,r){const n=We(e,r==null?void 0:r.in);return isNaN(+n)?gt(e,NaN):(n.setFullYear(t),n)}function tI(){const[e,t]=p.useState(!1),[r,n]=p.useState(null),[s,i]=p.useState(""),[o,l]=p.useState("all"),{workspace:c}=Ht(),{data:d,isLoading:u}=no(),f=WD(),m=Ct(),h=(d??[]).filter(g=>(o==="all"||g.status===o)&&(!s||g.name.toLowerCase().includes(s.toLowerCase())||g.identifier.toLowerCase().includes(s.toLowerCase())));return a.jsxs("div",{className:"p-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),a.jsxs(J,{size:"sm",onClick:()=>t(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"Create"]})]}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("div",{className:"flex items-center gap-1",children:["all","active","paused","archived"].map(g=>a.jsx("button",{onClick:()=>l(g),className:I("px-3 h-7 rounded-md text-xs font-medium transition-colors",o===g?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:g==="all"?"All":g.charAt(0).toUpperCase()+g.slice(1)},g))}),a.jsxs("div",{className:"relative",children:[a.jsx($l,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:s,onChange:g=>i(g.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Identifier"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Created"}),a.jsx("span",{})]}),u?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(g=>a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-4 w-12"}),a.jsx(le,{className:"h-5 w-16 rounded-full"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx("div",{})]},g))}):h.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Er,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:s||o!=="all"?"No projects match":"No projects yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s||o!=="all"?"Try adjusting your filters.":"Create your first project to get started."}),!s&&o==="all"&&a.jsxs(J,{size:"sm",onClick:()=>t(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"Create project"]})]}):a.jsx("div",{className:"divide-y divide-border",children:h.map(g=>a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors group",onClick:()=>m(`/${c}/projects/${g.identifier}/board`),children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.name}),g.description&&a.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:g.description})]}),a.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:g.identifier}),a.jsx("div",{children:a.jsxs("span",{className:I("inline-flex items-center gap-1.5 text-xs",g.status==="active"&&"text-emerald-600",g.status==="paused"&&"text-amber-600",g.status==="archived"&&"text-muted-foreground"),children:[a.jsx("span",{className:I("h-1.5 w-1.5 rounded-full shrink-0",g.status==="active"&&"bg-emerald-500",g.status==="paused"&&"bg-amber-500",g.status==="archived"&&"bg-zinc-400")}),g.status.charAt(0).toUpperCase()+g.status.slice(1)]})}),a.jsx("span",{className:"text-sm text-muted-foreground",children:fe(new Date(g.created_at),"MMM d, yyyy")}),a.jsx("div",{className:"flex justify-end",onClick:x=>x.stopPropagation(),children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx(J,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(is,{className:"h-4 w-4"})})}),a.jsxs(Tr,{align:"end",children:[a.jsxs(pt,{onClick:()=>m(`/${c}/projects/${g.identifier}/board`),children:[a.jsx(Er,{className:"h-4 w-4"}),"Open board"]}),a.jsxs(pt,{onClick:()=>m(`/${c}/projects/${g.identifier}/issues`),children:[a.jsx(ma,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(pt,{onClick:()=>n({id:g.id,name:g.name}),children:[a.jsx(Ji,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${g.name}"? This cannot be undone.`)&&f.mutate(g.id,{onSuccess:()=>F.success("Project deleted"),onError:()=>F.error("Failed to delete project")})},children:[a.jsx(Dr,{className:"h-4 w-4"}),"Delete"]})]})]})})]},g.id))}),!u&&h.length>0&&a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:["1 — ",h.length," of ",h.length," result",h.length!==1?"s":""]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx("span",{children:"1 of 1 pages"}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),a.jsx(O5,{open:e,onClose:()=>t(!1)}),r&&a.jsx(A5,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name})]})}const Hl={byProject:e=>["projects",e,"statuses"]};function lo(e){return Be({queryKey:Hl.byProject(e??""),queryFn:()=>te.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function rI(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Hl.byProject(e)})}})}function nI(e,t){const r=we();return ye({mutationFn:n=>te.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Hl.byProject(e)})}})}function aI(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Hl.byProject(e)})}})}function sI(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Hl.byProject(e)})}})}const Kl={all:["users"],list:()=>[...Kl.all,"list"]};function Yl(){return Be({queryKey:Kl.list(),queryFn:()=>te.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}const zu={all:["org-invitations"],list:()=>[...zu.all,"list"]};function iI(){return Be({queryKey:zu.list(),queryFn:()=>te.get("/admin/users/invitations"),select:e=>e.invitations,staleTime:1e3*30})}function oI(){const e=we();return ye({mutationFn:t=>te.delete(`/admin/users/invitations/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:zu.list()})})}function lI(){const e=we();return ye({mutationFn:({email:t,role:r})=>te.post("/admin/users/invite",{email:t,role:r}),onSuccess:()=>e.invalidateQueries({queryKey:zu.list()})})}function cI(){const e=we();return ye({mutationFn:({userId:t,role:r})=>te.patch(`/admin/users/${t}`,{role:r}),onSuccess:()=>e.invalidateQueries({queryKey:Kl.list()})})}function dI(){const e=we();return ye({mutationFn:t=>te.delete(`/admin/users/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:Kl.list()})})}function oi(){return Be({queryKey:[...Kl.list(),"map"],queryFn:()=>te.get("/admin/users"),select:e=>new Map(e.users.map(t=>{var o;const r=t.first_name??"",n=t.last_name??"",s=`${r} ${n}`.trim()||t.email,i=(r[0]??n[0]??((o=t.email)==null?void 0:o[0])??"U").toUpperCase();return[t.id,{name:s,initials:i}]})),staleTime:1e3*60*5})}const Ws={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},wn={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},eg={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},rs={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},uI=({priority:e})=>{const t=I("h-3 w-3 shrink-0",eg[e]);switch(e){case"urgent":return a.jsx(os,{className:t});case"high":return a.jsx(Tl,{className:t});case"medium":return a.jsx(eo,{className:t});case"low":return a.jsx(Dl,{className:t});default:return a.jsx(an,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function xN({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=oi(),{attributes:s,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=kp({id:e.id}),u={transform:Sp.Transform.toString(l),transition:c};return a.jsxs("div",{ref:o,style:u,...s,...i,onClick:r,className:I("bg-white dark:bg-card border border-border rounded-lg px-3 py-2.5 cursor-pointer select-none","hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors",d&&"opacity-40 shadow-lg ring-2 ring-indigo/30"),children:[a.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-[11px] font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:e.identifier}),e.parent_id&&a.jsx("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500 shrink-0",title:"Child issue",children:a.jsx(yn,{className:"h-3 w-3"})}),t>0&&a.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),t]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&a.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(h=>{const g=n==null?void 0:n.get(h);return a.jsx($t,{className:"h-4 w-4 border border-background",children:a.jsx(zt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(g==null?void 0:g.initials)??"?"})},h)}),(((f=e.assignee_ids)==null?void 0:f.length)??0)>2&&a.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((m=e.assignee_ids)==null?void 0:m.length)??0)-2]})]}),a.jsx(uI,{priority:e.priority})]})]})]})}function kc(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),s=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(s)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${s},${i},${t})`}const fI=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(ss,{className:r,style:n});case"started":return a.jsx(Yn,{className:r,style:n});default:return a.jsx(an,{className:r,style:n})}};function mI({id:e,label:t,color:r,category:n,issues:s,childCounts:i,sortable:o,onIssueClick:l,onRename:c,onDelete:d,isRenaming:u,renameValue:f,onRenameChange:m,onRenameSubmit:h,onRenameCancel:g}){const{setNodeRef:x,isOver:v}=PP({id:e}),{attributes:y,listeners:w,setNodeRef:j,transform:N,transition:k,isDragging:b}=kp({id:e,disabled:!o}),S=p.useRef(null),_=p.useRef(!1);p.useEffect(()=>{u&&(_.current=!1,setTimeout(()=>{var D;return(D=S.current)==null?void 0:D.focus()},0))},[u]);const C=o?{transform:Sp.Transform.toString(N),transition:k}:void 0,E=kc(r,.08),P=kc(r,.16),O=kc(r,.35),$=!!(c||d);return a.jsxs("div",{ref:j,style:C,className:I("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",b&&"opacity-50"),children:[a.jsxs("div",{className:I("flex items-center gap-2 mb-2 px-1",o&&"cursor-grab"),children:[o&&a.jsx("span",{...y,...w,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:a.jsx(h1,{className:"h-3.5 w-3.5"})}),a.jsx(fI,{category:n,color:r}),u?a.jsx("input",{ref:S,value:f??"",onChange:D=>m==null?void 0:m(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),h==null||h()),D.key==="Escape"&&(D.preventDefault(),_.current=!0,g==null||g())},onBlur:()=>{_.current||h==null||h()},className:"flex-1 text-xs font-medium bg-transparent border-b border-foreground/30 outline-none py-0.5 min-w-0"}):a.jsx("span",{className:"text-xs font-medium text-foreground",children:t}),a.jsx("span",{className:"ml-1 text-[11px] font-medium rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",style:{backgroundColor:kc(r,.12),color:r},children:s.length}),$&&!u&&a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"ml-auto h-5 w-5 flex items-center justify-center rounded opacity-0 group-hover/col:opacity-100 hover:bg-muted transition-opacity text-muted-foreground hover:text-foreground",onClick:D=>D.stopPropagation(),children:a.jsx(is,{className:"h-3.5 w-3.5"})})}),a.jsxs(Tr,{align:"end",className:"w-40",children:[c&&a.jsx(pt,{onClick:c,children:"Rename"}),c&&d&&a.jsx(Bn,{}),d&&a.jsx(pt,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),a.jsxs("div",{ref:x,className:I("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?P:E,boxShadow:v?`inset 0 0 0 1px ${O}`:void 0},children:[a.jsx(Np,{items:s.map(D=>D.id),strategy:AP,children:s.map(D=>a.jsx(xN,{issue:D,childCount:(i==null?void 0:i.get(D.id))??0,onClick:()=>l==null?void 0:l(D)},D.id))}),s.length===0&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:a.jsx("p",{className:"text-xs text-muted-foreground/40",children:"Drop here"})})]})]})}const um=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],hI=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function pI({open:e,onClose:t,projectId:r}){const[n,s]=p.useState(""),[i,o]=p.useState(um[0]),[l,c]=p.useState(""),[d,u]=p.useState("started"),f=rI(r),m=l||i,h=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{F.success("Status created"),s(""),o(um[0]),c(""),u("started"),t()},onError:()=>F.error("Failed to create status")})};return a.jsx(si,{open:e,onOpenChange:g=>!g&&t(),children:a.jsxs(ii,{className:"sm:max-w-sm",children:[a.jsx(ao,{children:a.jsx(io,{className:"text-sm font-medium",children:"New Status"})}),a.jsx(so,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Name"}),a.jsx(Ae,{placeholder:"e.g. In Review",value:n,onChange:g=>s(g.target.value),onKeyDown:g=>g.key==="Enter"&&h(),autoFocus:!0,className:"h-8 text-sm"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Color"}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[um.map(g=>a.jsx("button",{onClick:()=>{o(g),c("")},className:I("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===g&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:g}},g)),a.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[a.jsx("div",{className:"h-6 w-6 rounded-full border border-border shrink-0",style:{backgroundColor:l||"#e5e7eb"}}),a.jsx(Ae,{placeholder:"#hex",value:l,onChange:g=>c(g.target.value),className:"h-6 w-20 text-xs px-1.5"})]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Category"}),a.jsxs(Fe,{value:d,onValueChange:g=>u(g),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{})}),a.jsx(Le,{children:hI.map(g=>a.jsx(xe,{value:g.value,className:"text-xs",children:g.label},g.value))})]})]})]})}),a.jsxs(ql,{className:"mt-2",children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),a.jsx(J,{size:"sm",onClick:h,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function gI({projectId:e}){const[t,r]=p.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:a.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-2 px-3 py-2 rounded-xl border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted/30 transition-colors text-xs font-medium h-9",children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Add status"]})}),a.jsx(pI,{open:t,onClose:()=>r(!1),projectId:e})]})}function xI({open:e,statusName:t,issueCount:r,otherStatuses:n,onConfirm:s,onCancel:i,isLoading:o}){const[l,c]=p.useState(""),d=()=>{r>0&&!l||s(r>0?l:null)};return a.jsx(ls,{open:e,onOpenChange:u=>{u||i()},children:a.jsxs(_a,{className:"sm:max-w-md",children:[a.jsxs(cs,{children:[a.jsx(ds,{children:"Delete status"}),a.jsx(Bl,{children:r>0?`${r} issue${r!==1?"s":""} in "${t}" will be moved to another status.`:`Delete the "${t}" status. This cannot be undone.`})]}),r>0&&a.jsxs("div",{className:"py-2",children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Move issues to"}),a.jsxs(Fe,{value:l,onValueChange:c,children:[a.jsx(ze,{children:a.jsx(qe,{placeholder:"Select a status..."})}),a.jsx(Le,{children:n.map(u=>a.jsx(xe,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),u.name]})},u.id))})]})]}),a.jsxs(T1,{children:[a.jsx(J,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),a.jsx(J,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}function fm(e,t){var n;const r={};for(const s of t)r[s.key]=[];for(const s of e)if(r[s.status]!==void 0)r[s.status].push(s);else{const i=((n=t[0])==null?void 0:n.key)??"backlog";r[i]=[...r[i]??[],s]}return r}function vI(e,t,r){var i;const n=new Map(t.map(o=>[o.id,o])),s={};for(const o of r)s[o.key]=[];for(const o of r)for(const l of e[o.key]??[]){const c=n.get(l.id);c&&c.status===o.key&&(s[o.key].push(c),n.delete(l.id))}for(const o of n.values()){const l=s[o.status];if(l)l.push(o);else{const c=(i=r[0])==null?void 0:i.key;c&&s[c].push(o)}}return s}function vN({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:s,readOnly:i=!1,filters:o}){var G;const[l,c]=p.useState(()=>r.map(M=>M.id)),[d,u]=p.useState(()=>fm(e,r)),[f,m]=p.useState(null),[h,g]=p.useState(null),[x,v]=p.useState(null),[y,w]=p.useState(null),[j,N]=p.useState(""),k=p.useRef(null),b=p.useRef(!1),S=we(),_=Et.byProject(t,o),C=aI(t),E=nI(t,y??""),P=p.useMemo(()=>{const M=new Map;for(const z of e)z.parent_id&&M.set(z.parent_id,(M.get(z.parent_id)??0)+1);return M},[e]);p.useEffect(()=>{c(M=>{const z=new Set(r.map(q=>q.id)),se=M.filter(q=>z.has(q)),L=r.map(q=>q.id).filter(q=>!M.includes(q));return se.length===M.length&&L.length===0?M:[...se,...L]})},[r]),p.useEffect(()=>{b.current||u(M=>vI(M,e,r))},[e,r]);const O=[...r].sort((M,z)=>{const se=l.indexOf(M.id),L=l.indexOf(z.id);return se===-1&&L===-1?M.position-z.position:se===-1?1:L===-1?-1:se-L}),$=Tj(jp(Ij,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),D=p.useCallback(M=>{if(h){const z=M.droppableContainers.filter(se=>l.includes(se.id));return EP({...M,droppableContainers:z})}return DP(M)},[h,l]),B=p.useCallback(M=>{for(const[z,se]of Object.entries(d))if(se.some(L=>L.id===M))return z;return null},[d]),A=p.useCallback(M=>r.some(z=>z.id===M),[r]),W=M=>{const z=M.active.id;if(b.current=!0,A(z)){g(z);return}for(const[se,L]of Object.entries(d)){const q=L.find(de=>de.id===z);if(q){m(q),k.current=se;return}}},Q=M=>{const{active:z,over:se}=M;if(!se||h)return;const L=z.id,q=se.id;if(A(L))return;const de=B(L),X=r.find(ae=>ae.key===q||ae.id===q),Me=(X==null?void 0:X.key)??B(q);!de||!Me||de===Me||u(ae=>{const Ce=[...ae[de]??[]],_e=[...ae[Me]??[]],Pe=Ce.findIndex(Oe=>Oe.id===L);if(Pe===-1)return ae;const[De]=Ce.splice(Pe,1),V={...De,status:Me};if(X)_e.push(V);else{const Oe=_e.findIndex(Te=>Te.id===q);if(Oe===-1)_e.push(V);else{const Te=z.rect.current.translated!=null&&z.rect.current.translated.top>se.rect.top+se.rect.height/2;_e.splice(Te?Oe+1:Oe,0,V)}}return{...ae,[de]:Ce,[Me]:_e}})},K=M=>{var ae;const{active:z,over:se}=M;if(m(null),b.current=!1,h){if(g(null),!se||z.id===se.id)return;const Ce=l.indexOf(z.id),_e=l.indexOf(se.id);if(Ce===-1||_e===-1||Ce===_e)return;const Pe=Vc(l,Ce,_e);c(Pe),s==null||s(Pe);return}if(!se){const Ce=k.current;k.current=null,Ce&&u(fm(e,r));return}const L=z.id,q=se.id,de=k.current;k.current=null;const X=r.find(Ce=>Ce.key===q||Ce.id===q),Me=(X==null?void 0:X.key)??B(q);if(!(!de||!Me))if(de===Me)u(Ce=>{const _e=Ce[de]??[],Pe=_e.findIndex(V=>V.id===L),De=_e.findIndex(V=>V.id===q);return Pe===-1||De===-1||Pe===De?Ce:{...Ce,[de]:Vc(_e,Pe,De)}});else{if(!r.find(Pe=>Pe.key===q||Pe.id===q))u(Pe=>{const De=[...Pe[Me]??[]],V=De.findIndex(Ot=>Ot.id===L);if(V===-1)return Pe;const Oe=M.active.rect.current.translated!=null&&M.active.rect.current.translated.top>M.over.rect.top+M.over.rect.height/2,[Te]=De.splice(V,1),xt=De.findIndex(Ot=>Ot.id===q);if(xt===-1)return De.splice(V,0,Te),Pe;const Ge=Oe?xt+1:xt;return De.splice(Ge,0,Te),{...Pe,[Me]:De}});else{const Pe=((ae=M.active.rect.current.translated)==null?void 0:ae.top)??1/0,De=M.over.rect.top+M.over.rect.height/2;Pe<De&&u(V=>{const Oe=V[Me]??[],Te=Oe.findIndex(xt=>xt.id===L);return Te<=0?V:{...V,[Me]:Vc(Oe,Te,0)}})}const _e=S.getQueryData(_);S.setQueryData(_,Pe=>Pe&&{...Pe,issues:Pe.issues.map(De=>De.id===L?{...De,status:Me}:De)}),te.put(`/admin/issues/${L}`,{status:Me}).then(()=>{S.invalidateQueries({queryKey:_})}).catch(()=>{_e&&S.setQueryData(_,_e),u(fm((_e==null?void 0:_e.issues)??e,r)),F.error("Failed to update issue status")})}},ie=M=>{v(M)},ne=async M=>{if(!x)return;const z=d[x.key]??[];if(z.length>0){const se=r.find(L=>L.id===M);if(!se)return;try{await Promise.all(z.map(L=>te.put(`/admin/issues/${L.id}`,{status:se.key}))),S.invalidateQueries({queryKey:Et.byProject(t)})}catch{F.error("Failed to move issues");return}}C.mutate(x.id,{onSuccess:()=>{F.success(`Status "${x.name}" deleted`),v(null)},onError:()=>F.error("Failed to delete status")})},U=()=>{const M=j.trim();!M||!y||E.mutate({name:M},{onSuccess:()=>{F.success("Status renamed"),w(null)},onError:()=>F.error("Failed to rename status")})},Y=()=>{w(null)},Z=h?r.find(M=>M.id===h):null;return a.jsxs(el,{sensors:$,collisionDetection:D,onDragStart:W,onDragOver:Q,onDragEnd:K,children:[a.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[a.jsx(Np,{items:l,strategy:Rj,children:O.map(M=>a.jsx(mI,{id:M.id,label:M.name,color:M.color,category:M.category,issues:d[M.key]??[],childCounts:P,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{w(M.id),N(M.name)},onDelete:i?void 0:()=>ie(M),isRenaming:y===M.id,renameValue:y===M.id?j:"",onRenameChange:N,onRenameSubmit:U,onRenameCancel:Y},M.id))}),!i&&a.jsx(gI,{projectId:t})]}),a.jsxs(TP,{children:[f&&a.jsx(xN,{issue:f}),Z&&a.jsx("div",{className:"opacity-80 min-w-[260px] max-w-[280px]",children:a.jsxs("div",{className:"h-9 flex items-center gap-2 px-3 rounded-xl border border-border bg-background text-xs font-medium text-foreground",children:[a.jsx("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:Z.color}}),Z.name]})})]}),x&&a.jsx(xI,{open:!!x,statusName:x.name,issueCount:((G=d[x.key])==null?void 0:G.length)??0,otherStatuses:r.filter(M=>M.id!==x.id),onConfirm:ne,onCancel:()=>v(null),isLoading:C.isPending})]})}const kt=aP,St=sP,wt=p.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(nP,{children:a.jsx(Oj,{ref:s,align:t,sideOffset:r,className:I("z-50 w-72 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));wt.displayName=Oj.displayName;const yI=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],bI=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function Sc({label:e,activeCount:t,children:r}){const[n,s]=p.useState(!1);return a.jsxs(kt,{open:n,onOpenChange:s,children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:I("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border text-xs font-medium transition-colors",t>0?"border-foreground/30 bg-foreground/5 text-foreground":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[e,t>0&&a.jsx("span",{className:"flex items-center justify-center h-4 w-4 rounded-full bg-foreground text-background text-[10px] font-semibold",children:t}),a.jsx(Kn,{className:"h-3 w-3 opacity-60"})]})}),a.jsx(wt,{className:"w-48 p-1",align:"start",children:r})]})}function mm({options:e,selected:t,onToggle:r}){return a.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(n=>{const s=t.includes(n.value);return a.jsxs("button",{onClick:()=>r(n.value),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:I("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",s?"bg-foreground border-foreground":"border-border"),children:s&&a.jsx(rr,{className:"h-2.5 w-2.5 text-background"})}),n.color&&a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:n.color}}),a.jsx("span",{className:"truncate",children:n.label})]},n.value)})})}function wI({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,h,g;const s=(((c=r.priority)==null?void 0:c.length)??0)>0||!!r.assignee_id||(((d=r.type)==null?void 0:d.length)??0)>0||(((u=r.status)==null?void 0:u.length)??0)>0,i=(x,v)=>{const y=r[x]??[],w=y.includes(v)?y.filter(j=>j!==v):[...y,v];n({...r,[x]:w.length?w:void 0})},o=x=>{n({...r,assignee_id:r.assignee_id===x?void 0:x})},l=r.assignee_id?((f=t.find(x=>x.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Sc,{label:r.assignee_id?l:"Assignee",activeCount:r.assignee_id?1:0,children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground px-2 py-1.5",children:"No members"}),t.map(x=>{const v=r.assignee_id===x.userId;return a.jsxs("button",{onClick:()=>o(x.userId),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:I("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",v?"bg-foreground border-foreground":"border-border"),children:v&&a.jsx(rr,{className:"h-2.5 w-2.5 text-background"})}),a.jsx("span",{className:"h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium shrink-0",children:x.initials}),a.jsx("span",{className:"truncate",children:x.name})]},x.userId)})]})}),a.jsx(Sc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:a.jsx(mm,{options:yI,selected:r.priority??[],onToggle:x=>i("priority",x)})}),a.jsx(Sc,{label:"Type",activeCount:((h=r.type)==null?void 0:h.length)??0,children:a.jsx(mm,{options:bI,selected:r.type??[],onToggle:x=>i("type",x)})}),a.jsx(Sc,{label:"Status",activeCount:((g=r.status)==null?void 0:g.length)??0,children:a.jsx(mm,{options:e.map(x=>({value:x.key,label:x.name,color:x.color})),selected:r.status??[],onToggle:x=>i("status",x)})}),s&&a.jsxs("button",{onClick:()=>n({}),className:"inline-flex items-center gap-1 h-7 px-2 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear"]})]})}const jI={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function tg(){return Be({queryKey:["org","calendar"],queryFn:()=>te.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??jI,timezone:e.timezone})})}function NI(){const e=we();return ye({mutationFn:t=>te.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function rg(e){const t=e??new Date().getFullYear();return Be({queryKey:["org","holidays",t],queryFn:()=>te.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function kI(){const e=we();return ye({mutationFn:t=>te.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function SI(){const e=we();return ye({mutationFn:({id:t,...r})=>te.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function CI(){const e=we();return ye({mutationFn:t=>te.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function _I(){return Be({queryKey:["app-config"],queryFn:()=>te.get("/admin/config"),staleTime:1/0})}const OI=["sun","mon","tue","wed","thu","fri","sat"];function MI(e,t,r){const n=OI[H3(e)];if(!t[n])return!1;const s=Qc(e),i=tl(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(Qc(l)===s&&tl(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&Qc(l)===s&&tl(l)===i)return!1}return!0}function yN(e,t,r,n){let s=0,i=new Date(e);i.setHours(0,0,0,0);const o=new Date(t);for(o.setHours(0,0,0,0);i<=o;)MI(i,r,n)&&s++,i=Ar(i,1);return s}const Ri={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function co(e){return Be({queryKey:e?Ri.byProject(e):Ri.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return te.get(t)},select:t=>t.sprints,enabled:!!e})}function PI(e){const t=we();return ye({mutationFn:r=>te.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:Ri.byProject(e)})}})}function AI(e,t){const r=we();return ye({mutationFn:n=>te.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Ri.byProject(t)}),r.invalidateQueries({queryKey:Ri.detail(e)})}})}function EI(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ri.byProject(e)})}})}const Lu={byProject:e=>["task-lists","project",e]};function Gl(e){return Be({queryKey:e?Lu.byProject(e):["task-lists"],queryFn:()=>te.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function DI(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Lu.byProject(e)})}})}function TI(e){const t=we();return ye({mutationFn:({id:r,...n})=>te.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Lu.byProject(e)})}})}function II(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Lu.byProject(e)}),t.invalidateQueries({queryKey:Et.byProject(e)})}})}function Hv(e,t,r){const n=(e==null?void 0:e[0])??"",s=(t==null?void 0:t[0])??"";return(n+s).toUpperCase()||((r==null?void 0:r[0])??"U").toUpperCase()}function Kv(e,t,r){return`${e??""} ${t??""}`.trim()||r}function Vl({value:e,onChange:t,disabled:r,users:n}){const[s,i]=p.useState(!1),[o,l]=p.useState(e),{data:c}=Yl(),d=n??c??[],u=e.slice().sort().join(",");p.useEffect(()=>{l(e)},[u]);const f=h=>{const g=o.includes(h)?o.filter(x=>x!==h):[...o,h];l(g),t(g)},m=d.filter(h=>o.includes(h.id));return a.jsxs(kt,{open:s,onOpenChange:i,children:[a.jsx(St,{asChild:!0,disabled:r,children:a.jsx("button",{type:"button",className:I("flex items-center gap-1 min-h-[28px] rounded-md px-1.5 py-1","hover:bg-accent transition-colors text-left","focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",r&&"pointer-events-none opacity-50"),children:m.length===0?a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx(to,{className:"h-3.5 w-3.5"}),"Assign"]}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex -space-x-1.5",children:m.slice(0,3).map(h=>a.jsx($t,{className:"h-5 w-5 border border-background ring-0",children:a.jsx(zt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:Hv(h.first_name,h.last_name,h.email)})},h.id))}),m.length>3&&a.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",m.length-3]}),a.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:m.length===1?Kv(m[0].first_name,m[0].last_name,m[0].email):`${m.length} assignees`})]})})}),a.jsx(wt,{className:"w-60 p-0",align:"start",children:a.jsxs(Ds,{children:[a.jsx(Tu,{placeholder:"Search users...",className:"h-8 text-xs"}),a.jsxs(Ts,{children:[a.jsx(Iu,{className:"text-xs py-4",children:"No users found."}),a.jsx(Va,{children:d.map(h=>{const g=o.includes(h.id),x=Kv(h.first_name,h.last_name,h.email),v=Hv(h.first_name,h.last_name,h.email);return a.jsxs(rn,{value:x,onSelect:()=>f(h.id),className:"gap-2 py-1.5",children:[a.jsx($t,{className:"h-5 w-5 shrink-0",children:a.jsx(zt,{className:"text-[9px] bg-muted text-muted-foreground",children:v})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs font-medium truncate",children:x}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:h.email})]}),a.jsx(rr,{className:I("h-3.5 w-3.5 shrink-0",g?"opacity-100 text-indigo-500":"opacity-0")})]},h.id)})})]})]})})]})}function RI(e,t,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:r}).format(t).split(/\s/g).slice(2).join(" ")}const hm={},Go={};function Os(e,t){try{const n=(hm[e]||(hm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in Go?Go[n]:Yv(n,n.split(":"))}catch{if(e in Go)return Go[e];const r=e==null?void 0:e.match($I);return r?Yv(e,r.slice(1)):NaN}}const $I=/([+-]\d\d):?(\d\d)?/;function Yv(e,t){const r=+(t[0]||0),n=+(t[1]||0),s=+(t[2]||0)/60;return Go[e]=r*60+n>0?r*60+n+s:r*60-n-s}class $n extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Os(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),bN(this),dh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new $n(...r,t):new $n(Date.now(),t)}withTimeZone(t){return new $n(+this,t)}getTimezoneOffset(){const t=-Os(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),dh(this),+this}[Symbol.for("constructDateFrom")](t){return new $n(+new Date(t),this.timeZone)}}const Gv=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Gv.test(e))return;const t=e.replace(Gv,"$1UTC");$n.prototype[t]&&(e.startsWith("get")?$n.prototype[e]=function(){return this.internal[t]()}:($n.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),zI(this),+this},$n.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),dh(this),+this}))});function dh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Os(e.timeZone,e)*60))}function zI(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),bN(e)}function bN(e){const t=Os(e.timeZone,e),r=t>0?Math.floor(t):Math.ceil(t),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=s-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=s-r;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const u=s>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(Os(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const m=Os(e.timeZone,e),h=m>0?Math.floor(m):Math.ceil(m),x=-new Date(+e).getTimezoneOffset()-h,v=h!==r,y=x-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const w=Os(e.timeZone,e),j=w>0?Math.floor(w):Math.ceil(w),N=h-j;N&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+N))}}class lr extends $n{static tz(t,...r){return r.length?new lr(...r,t):new lr(Date.now(),t)}toISOString(){const[t,r,n]=this.tzComponents(),s=`${t}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,r,n,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${r} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[r,n,s]=this.tzComponents();return`${t} GMT${r}${n}${s} (${RI(this.timeZone,this)})`}toLocaleString(t,r){return Date.prototype.toLocaleString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleDateString(t,r){return Date.prototype.toLocaleDateString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleTimeString(t,r){return Date.prototype.toLocaleTimeString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),r=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[r,n,s]}withTimeZone(t){return new lr(+this,t)}[Symbol.for("constructDateFrom")](t){return new lr(+new Date(t),this.timeZone)}}const Vv=5,LI=4;function FI(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,s=t.addDays(e,-n+1),i=t.addDays(s,Vv*7-1);return t.getMonth(e)===t.getMonth(i)?Vv:LI}function wN(e,t){const r=t.startOfMonth(e),n=r.getDay();return n===1?r:n===0?t.addDays(r,-1*6):t.addDays(r,-1*(n-1))}function BI(e,t){const r=wN(e,t),n=FI(e,t);return t.addDays(r,n*7-1)}const jN={...Ss,labels:{labelDayButton:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>fe(o,l,{locale:Ss,...r});let i=s(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>fe(s,i,{locale:Ss,...t}),n(e,"LLLL yyyy")},labelGridcell:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>fe(o,l,{locale:Ss,...r});let i=s(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>fe(s,i,{locale:Ss,...t}),n(e,"cccc")}}};class Hr{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?lr.tz(this.options.timeZone):new this.Date},this.newDate=(n,s,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(n,s,i):this.options.timeZone?new lr(n,s,i,this.options.timeZone):new Date(n,s,i)},this.addDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(n,s):Ar(n,s)},this.addMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,s):Gp(n,s)},this.addWeeks=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,s):R5(n,s)},this.addYears=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,s):$5(n,s)},this.differenceInCalendarDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,s):$u(n,s)},this.differenceInCalendarMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,s):Xp(n,s)},this.eachMonthOfInterval=n=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):H5(n)},this.eachYearOfInterval=n=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):Y5(n),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):BI(n,this)},this.endOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(n):G5(n)},this.endOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(n):Qp(n)},this.endOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,s):mN(n,this.options)},this.endOfYear=n=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(n):K5(n)},this.format=(n,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,s,this.options):fe(n,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(n):Zp(n)},this.getMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):Qc(n,this.options)},this.getYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):K3(n,this.options)},this.getWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):Jp(n,this.options)},this.isAfter=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,s):Y3(n,s)},this.isBefore=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,s):G3(n,s)},this.isDate=n=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(n):sN(n)},this.isSameDay=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,s):Ii(n,s)},this.isSameMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,s):V3(n,s)},this.isSameYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,s):X3(n,s)},this.max=n=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(n):z5(n)},this.min=n=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(n):L5(n)},this.setMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,s):J3(n,s)},this.setYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,s):eI(n,s)},this.startOfBroadcastWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):wN(n,this)},this.startOfDay=n=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(n):Ti(n)},this.startOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(n):il(n)},this.startOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(n):uN(n)},this.startOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):Di(n,this.options)},this.startOfYear=n=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(n):fN(n)},this.options={locale:jN,...t},this.overrides=r}getDigitMap(){const{numerals:t="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let s=0;s<10;s++)n[s.toString()]=r.format(s);return n}replaceDigits(t){const r=this.getDigitMap();return t.replace(/\d/g,n=>r[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var r;const t=(r=this.options.locale)==null?void 0:r.code;return t&&Hr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:r,timeZone:n,numerals:s}=this.options,i=r==null?void 0:r.code;if(i&&Hr.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:s}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}Hr.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Xn=new Hr;class NN{constructor(t,r,n=Xn){this.date=t,this.displayMonth=r,this.outside=!!(r&&!n.isSameMonth(t,r)),this.dateLib=n,this.isoDate=n.format(t,"yyyy-MM-dd"),this.displayMonthId=n.format(r,"yyyy-MM"),this.dateMonthId=n.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class WI{constructor(t,r){this.date=t,this.weeks=r}}class UI{constructor(t,r){this.days=r,this.weekNumber=t}}function qI(e){return T.createElement("button",{...e})}function HI(e){return T.createElement("span",{...e})}function KI(e){const{size:t=24,orientation:r="left",className:n}=e;return T.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&T.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&T.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&T.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&T.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function YI(e){const{day:t,modifiers:r,...n}=e;return T.createElement("td",{...n})}function GI(e){const{day:t,modifiers:r,...n}=e,s=T.useRef(null);return T.useEffect(()=>{var i;r.focused&&((i=s.current)==null||i.focus())},[r.focused]),T.createElement("button",{ref:s,...n})}var je;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(je||(je={}));var ht;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(ht||(ht={}));var vn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(vn||(vn={}));var Fr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Fr||(Fr={}));function VI(e){const{options:t,className:r,components:n,classNames:s,...i}=e,o=[s[je.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return T.createElement("span",{"data-disabled":i.disabled,className:s[je.DropdownRoot]},T.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>T.createElement(n.Option,{key:c,value:c,disabled:u},d))),T.createElement("span",{className:s[je.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,T.createElement(n.Chevron,{orientation:"down",size:18,className:s[je.Chevron]})))}function XI(e){return T.createElement("div",{...e})}function QI(e){return T.createElement("div",{...e})}function ZI(e){const{calendarMonth:t,displayIndex:r,...n}=e;return T.createElement("div",{...n},e.children)}function JI(e){const{calendarMonth:t,displayIndex:r,...n}=e;return T.createElement("div",{...n})}function e4(e){return T.createElement("table",{...e})}function t4(e){return T.createElement("div",{...e})}const kN=p.createContext(void 0);function Xl(){const e=p.useContext(kN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function r4(e){const{components:t}=Xl();return T.createElement(t.Dropdown,{...e})}function n4(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Xl(),u=p.useCallback(m=>{s&&(r==null||r(m))},[s,r]),f=p.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return T.createElement("nav",{...i},T.createElement(o.PreviousMonthButton,{type:"button",className:l[je.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},T.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[je.Chevron],orientation:"left"})),T.createElement(o.NextMonthButton,{type:"button",className:l[je.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:u},T.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[je.Chevron]})))}function a4(e){const{components:t}=Xl();return T.createElement(t.Button,{...e})}function s4(e){return T.createElement("option",{...e})}function i4(e){const{components:t}=Xl();return T.createElement(t.Button,{...e})}function o4(e){const{rootRef:t,...r}=e;return T.createElement("div",{...r,ref:t})}function l4(e){return T.createElement("select",{...e})}function c4(e){const{week:t,...r}=e;return T.createElement("tr",{...r})}function d4(e){return T.createElement("th",{...e})}function u4(e){return T.createElement("thead",{"aria-hidden":!0},T.createElement("tr",{...e}))}function f4(e){const{week:t,...r}=e;return T.createElement("th",{...r})}function m4(e){return T.createElement("th",{...e})}function h4(e){return T.createElement("tbody",{...e})}function p4(e){const{components:t}=Xl();return T.createElement(t.Dropdown,{...e})}const g4=Object.freeze(Object.defineProperty({__proto__:null,Button:qI,CaptionLabel:HI,Chevron:KI,Day:YI,DayButton:GI,Dropdown:VI,DropdownNav:XI,Footer:QI,Month:ZI,MonthCaption:JI,MonthGrid:e4,Months:t4,MonthsDropdown:r4,Nav:n4,NextMonthButton:a4,Option:s4,PreviousMonthButton:i4,Root:o4,Select:l4,Week:c4,WeekNumber:f4,WeekNumberHeader:m4,Weekday:d4,Weekdays:u4,Weeks:h4,YearsDropdown:p4},Symbol.toStringTag,{value:"Module"}));function la(e,t,r=!1,n=Xn){let{from:s,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=n;return s&&i?(o(i,s)<0&&([s,i]=[i,s]),o(t,s)>=(r?1:0)&&o(i,t)>=(r?1:0)):!r&&i?l(i,t):!r&&s?l(s,t):!1}function ng(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Fu(e){return!!(e&&typeof e=="object"&&"from"in e)}function ag(e){return!!(e&&typeof e=="object"&&"after"in e)}function sg(e){return!!(e&&typeof e=="object"&&"before"in e)}function SN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function CN(e,t){return Array.isArray(e)&&e.every(t.isDate)}function ca(e,t,r=Xn){const n=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:o}=r;return n.some(l=>{if(typeof l=="boolean")return l;if(r.isDate(l))return s(e,l);if(CN(l,r))return l.some(c=>s(e,c));if(Fu(l))return la(l,e,!1,r);if(SN(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(ng(l)){const c=i(l.before,e),d=i(l.after,e),u=c>0,f=d<0;return o(l.before,l.after)?f&&u:u||f}return ag(l)?i(e,l.after)>0:sg(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function x4(e,t,r,n,s){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:u=s.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:h,isBefore:g,endOfMonth:x,isAfter:v}=s,y=r&&h(r),w=n&&x(n),j={[ht.focused]:[],[ht.outside]:[],[ht.disabled]:[],[ht.hidden]:[],[ht.today]:[]},N={};for(const k of e){const{date:b,displayMonth:S}=k,_=!!(S&&!m(b,S)),C=!!(y&&g(b,y)),E=!!(w&&v(b,w)),P=!!(i&&ca(b,i,s)),O=!!(o&&ca(b,o,s))||C||E||!d&&!c&&_||d&&c===!1&&_,$=f(b,u);_&&j.outside.push(k),P&&j.disabled.push(k),O&&j.hidden.push(k),$&&j.today.push(k),l&&Object.keys(l).forEach(D=>{const B=l==null?void 0:l[D];B&&ca(b,B,s)&&(N[D]?N[D].push(k):N[D]=[k])})}return k=>{const b={[ht.focused]:!1,[ht.disabled]:!1,[ht.hidden]:!1,[ht.outside]:!1,[ht.today]:!1},S={};for(const _ in j){const C=j[_];b[_]=C.some(E=>E===k)}for(const _ in N)S[_]=N[_].some(C=>C===k);return{...b,...S}}}function v4(e,t,r={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(r[i]?s.push(r[i]):t[ht[i]]?s.push(t[ht[i]]):t[vn[i]]&&s.push(t[vn[i]]),s),[t[je.Day]])}function y4(e){return{...g4,...e}}function b4(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([r,n])=>{r.startsWith("data-")&&(t[r]=n)}),t}function w4(){const e={};for(const t in je)e[je[t]]=`rdp-${je[t]}`;for(const t in ht)e[ht[t]]=`rdp-${ht[t]}`;for(const t in vn)e[vn[t]]=`rdp-${vn[t]}`;for(const t in Fr)e[Fr[t]]=`rdp-${Fr[t]}`;return e}function _N(e,t,r){return(r??new Hr(t)).formatMonthYear(e)}const j4=_N;function N4(e,t,r){return(r??new Hr(t)).format(e,"d")}function k4(e,t=Xn){return t.format(e,"LLLL")}function S4(e,t,r){return(r??new Hr(t)).format(e,"cccccc")}function C4(e,t=Xn){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _4(){return""}function ON(e,t=Xn){return t.format(e,"yyyy")}const O4=ON,M4=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:_N,formatDay:N4,formatMonthCaption:j4,formatMonthDropdown:k4,formatWeekNumber:C4,formatWeekNumberHeader:_4,formatWeekdayName:S4,formatYearCaption:O4,formatYearDropdown:ON},Symbol.toStringTag,{value:"Module"}));function P4(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...M4,...e}}function ig(e,t,r,n){let s=(n??new Hr(r)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const A4=ig;function og(e,t,r){return(r??new Hr(t)).formatMonthYear(e)}const E4=og;function MN(e,t,r,n){let s=(n??new Hr(r)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function PN(e){return"Choose the Month"}function AN(){return""}const D4="Go to the Next Month";function EN(e,t){return D4}function DN(e){return"Go to the Previous Month"}function TN(e,t,r){return(r??new Hr(t)).format(e,"cccc")}function IN(e,t){return`Week ${e}`}function RN(e){return"Week Number"}function $N(e){return"Choose the Year"}const T4=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:E4,labelDay:A4,labelDayButton:ig,labelGrid:og,labelGridcell:MN,labelMonthDropdown:PN,labelNav:AN,labelNext:EN,labelPrevious:DN,labelWeekNumber:IN,labelWeekNumberHeader:RN,labelWeekday:TN,labelYearDropdown:$N},Symbol.toStringTag,{value:"Module"})),mn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function I4(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...T4,...e??{},labelDayButton:mn(ig,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:mn(PN,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:mn(EN,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:mn(DN,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:mn(IN,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:mn($N,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:mn(og,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:mn(MN,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:mn(AN,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:mn(RN,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:mn(TN,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function R4(e,t,r,n,s){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:o(e),end:l(e)}).map(m=>{const h=n.formatMonthDropdown(m,s),g=d(m),x=t&&m<i(t)||r&&m>i(r)||!1;return{value:g,label:h,disabled:x}})}function $4(e,t={},r={}){let n={...t==null?void 0:t[je.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{n={...n,...r==null?void 0:r[s]}}),n}function z4(e,t,r,n){const s=n??e.today(),i=r?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),o=[];for(let l=0;l<7;l++){const c=e.addDays(i,l);o.push(c)}return o}function L4(e,t,r,n,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=n,d=i(e),u=o(t),f=l({start:d,end:u});return s&&f.reverse(),f.map(m=>{const h=r.formatYearDropdown(m,n);return{value:c(m),label:h,disabled:!1}})}function F4(e,t={}){var l;const{weekStartsOn:r,locale:n}=t,s=r??((l=n==null?void 0:n.options)==null?void 0:l.weekStartsOn)??0,i=c=>{const d=typeof c=="number"||typeof c=="string"?new Date(c):c;return new lr(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},o=c=>{const d=i(c);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(lr.tz(e)),newDate:(c,d,u)=>new lr(c,d,u,12,0,0,e),startOfDay:c=>i(c),startOfWeek:(c,d)=>{const u=i(c),f=(d==null?void 0:d.weekStartsOn)??s,m=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-m),u},startOfISOWeek:c=>{const d=i(c),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:c=>{const d=i(c);return d.setDate(1),d},startOfYear:c=>{const d=i(c);return d.setMonth(0,1),d},endOfWeek:(c,d)=>{const u=i(c),h=((((d==null?void 0:d.weekStartsOn)??s)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+h),u},endOfISOWeek:c=>{const d=i(c),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:c=>{const d=i(c);return d.setMonth(d.getMonth()+1,0),d},endOfYear:c=>{const d=i(c);return d.setMonth(11,31),d},eachMonthOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new lr(d.getFullYear(),d.getMonth(),1,12,0,0,e),h=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=h;)f.push(new lr(m,e)),m.setMonth(m.getMonth()+1,1);return f},addDays:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d),u},addWeeks:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d*7),u},addMonths:(c,d)=>{const u=i(c);return u.setMonth(u.getMonth()+d),u},addYears:(c,d)=>{const u=i(c);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new lr(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new lr(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return Jp(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??s,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((f=n==null?void 0:n.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:c=>{const d=o(c);return Zp(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return $u(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return Xp(u,f)}}}const Ql=e=>e instanceof HTMLElement?e:null,pm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],B4=e=>Ql(e.querySelector("[data-animated-month]")),gm=e=>Ql(e.querySelector("[data-animated-caption]")),xm=e=>Ql(e.querySelector("[data-animated-weeks]")),W4=e=>Ql(e.querySelector("[data-animated-nav]")),U4=e=>Ql(e.querySelector("[data-animated-weekdays]"));function q4(e,t,{classNames:r,months:n,focused:s,dateLib:i}){const o=p.useRef(null),l=p.useRef(n),c=p.useRef(!1);p.useLayoutEffect(()=>{const d=l.current;if(l.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||d.length===0||n.length!==d.length)return;const u=i.isSameMonth(n[0].date,d[0].date),f=i.isAfter(n[0].date,d[0].date),m=f?r[Fr.caption_after_enter]:r[Fr.caption_before_enter],h=f?r[Fr.weeks_after_enter]:r[Fr.weeks_before_enter],g=o.current,x=e.current.cloneNode(!0);if(x instanceof HTMLElement?(pm(x).forEach(j=>{if(!(j instanceof HTMLElement))return;const N=B4(j);N&&j.contains(N)&&j.removeChild(N);const k=gm(j);k&&k.classList.remove(m);const b=xm(j);b&&b.classList.remove(h)}),o.current=x):o.current=null,c.current||u||s)return;const v=g instanceof HTMLElement?pm(g):[],y=pm(e.current);if(y!=null&&y.every(w=>w instanceof HTMLElement)&&v&&v.every(w=>w instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const w=W4(e.current);w&&(w.style.zIndex="1"),y.forEach((j,N)=>{const k=v[N];if(!k)return;j.style.position="relative",j.style.overflow="hidden";const b=gm(j);b&&b.classList.add(m);const S=xm(j);S&&S.classList.add(h);const _=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),w&&(w.style.zIndex=""),b&&b.classList.remove(m),S&&S.classList.remove(h),j.style.position="",j.style.overflow="",j.contains(k)&&j.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const C=U4(k);C&&(C.style.opacity="0");const E=gm(k);E&&(E.classList.add(f?r[Fr.caption_before_exit]:r[Fr.caption_after_exit]),E.addEventListener("animationend",_));const P=xm(k);P&&P.classList.add(f?r[Fr.weeks_before_exit]:r[Fr.weeks_after_exit]),j.insertBefore(k,j.firstChild)})}})}function H4(e,t,r,n){const s=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=r??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:h,endOfMonth:g,endOfWeek:x,isAfter:v,startOfBroadcastWeek:y,startOfISOWeek:w,startOfWeek:j}=n,N=c?y(s,n):o?w(s):j(s),k=c?m(i):o?h(g(i)):x(g(i)),b=t&&(c?m(t):o?h(t):x(t)),S=b&&v(k,b)?b:k,_=u(S,N),C=f(i,s)+1,E=[];for(let $=0;$<=_;$++){const D=d(N,$);E.push(D)}const O=(c?35:42)*C;if(l&&E.length<O){const $=O-E.length;for(let D=0;D<$;D++){const B=d(E[E.length-1],1);E.push(B)}}return E}function K4(e){const t=[];return e.reduce((r,n)=>{const s=n.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return r.concat(s.slice())},t.slice())}function Y4(e,t,r,n){const{numberOfMonths:s=1}=r,i=[];for(let o=0;o<s;o++){const l=n.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function Xv(e,t,r,n){const{month:s,defaultMonth:i,today:o=n.today(),numberOfMonths:l=1}=e;let c=s||i||o;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:f}=n;if(r&&d(r,c)<l-1){const m=-1*(l-1);c=u(r,m)}return t&&d(c,t)<0&&(c=t),f(c)}function G4(e,t,r,n){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:h}=n,g=e.reduce((x,v)=>{const y=r.broadcastCalendar?f(v,n):r.ISOWeek?m(v):h(v),w=r.broadcastCalendar?i(v):r.ISOWeek?o(l(v)):c(l(v)),j=t.filter(S=>S>=y&&S<=w),N=r.broadcastCalendar?35:42;if(r.fixedWeeks&&j.length<N){const S=t.filter(_=>{const C=N-j.length;return _>w&&_<=s(w,C)});j.push(...S)}const k=j.reduce((S,_)=>{const C=r.ISOWeek?d(_):u(_),E=S.find(O=>O.weekNumber===C),P=new NN(_,v,n);return E?E.days.push(P):S.push(new UI(C,[P])),S},[]),b=new WI(v,k);return x.push(b),x},[]);return r.reverseMonths?g.reverse():g}function V4(e,t){let{startMonth:r,endMonth:n}=e;const{startOfYear:s,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:h,fromMonth:g,toMonth:x}=e;!r&&g&&(r=g),!r&&m&&(r=t.newDate(m,0,1)),!n&&x&&(n=x),!n&&h&&(n=u(h,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return r?r=o(r):m?r=u(m,0,1):!r&&v&&(r=s(c(e.today??f(),-100))),n?n=l(n):h?n=u(h,11,31):!n&&v&&(n=d(e.today??f())),[r&&i(r),n&&i(n)]}function X4(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i:1,u=o(e);if(!t)return l(u,d);if(!(c(t,e)<i))return l(u,d)}function Q4(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i??1:1,u=o(e);if(!t)return l(u,-d);if(!(c(u,t)<=0))return l(u,-d)}function Z4(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function Bu(e,t){const[r,n]=p.useState(e);return[t===void 0?r:t,n]}function J4(e,t){var N;const[r,n]=V4(e,t),{startOfMonth:s,endOfMonth:i}=t,o=Xv(e,r,n,t),[l,c]=Bu(o,e.month?o:void 0);p.useEffect(()=>{const k=Xv(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:h}=p.useMemo(()=>{const k=Y4(l,n,{numberOfMonths:e.numberOfMonths},t),b=H4(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=G4(k,b,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),_=Z4(S),C=K4(S),E=Q4(l,r,e,t),P=X4(l,n,e,t);return{months:S,weeks:_,days:C,previousMonth:E,nextMonth:P}},[t,l.getTime(),n==null?void 0:n.getTime(),r==null?void 0:r.getTime(),e.disableNavigation,e.broadcastCalendar,(N=e.endMonth)==null?void 0:N.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:x}=e,v=k=>u.some(b=>b.days.some(S=>S.isEqualTo(k))),y=k=>{if(g)return;let b=s(k);r&&b<s(r)&&(b=s(r)),n&&b>s(n)&&(b=s(n)),c(b),x==null||x(b)};return{months:d,weeks:u,days:f,navStart:r,navEnd:n,previousMonth:m,nextMonth:h,goToMonth:y,goToDay:k=>{v(k)||y(k.date)}}}var In;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(In||(In={}));function Qv(e){return!e[ht.disabled]&&!e[ht.hidden]&&!e[ht.outside]}function eR(e,t,r,n){let s,i=-1;for(const o of e){const l=t(o);Qv(l)&&(l[ht.focused]&&i<In.FocusedModifier?(s=o,i=In.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<In.LastFocused?(s=o,i=In.LastFocused):r(o.date)&&i<In.Selected?(s=o,i=In.Selected):l[ht.today]&&i<In.Today&&(s=o,i=In.Today))}return s||(s=e.find(o=>Qv(t(o)))),s}function tR(e,t,r,n,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:h,endOfISOWeek:g,endOfWeek:x,max:v,min:y,startOfBroadcastWeek:w,startOfISOWeek:j,startOfWeek:N}=o;let b={day:d,week:f,month:u,year:m,startOfWeek:S=>c?w(S,o):l?j(S):N(S),endOfWeek:S=>c?h(S):l?g(S):x(S)}[e](r,t==="after"?1:-1);return t==="before"&&n?b=v([n,b]):t==="after"&&s&&(b=y([s,b])),b}function zN(e,t,r,n,s,i,o,l=0){if(l>365)return;const c=tR(e,t,r.date,n,s,i,o),d=!!(i.disabled&&ca(c,i.disabled,o)),u=!!(i.hidden&&ca(c,i.hidden,o)),f=c,m=new NN(c,f,o);return!d&&!u?m:zN(e,t,m,n,s,i,o,l+1)}function rR(e,t,r,n,s){const{autoFocus:i}=e,[o,l]=p.useState(),c=eR(t.days,r,n||(()=>!1),o),[d,u]=p.useState(i?c:void 0);return{isFocusTarget:x=>!!(c!=null&&c.isEqualTo(x)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(x,v)=>{if(!d)return;const y=zN(x,v,d,t.navStart,t.navEnd,e,s);y&&(e.disableNavigation&&!t.days.some(j=>j.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function nR(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Bu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t,d=h=>(l==null?void 0:l.some(g=>c(g,h)))??!1,{min:u,max:f}=e;return{selected:l,select:(h,g,x)=>{let v=[...l??[]];if(d(h)){if((l==null?void 0:l.length)===u||n&&(l==null?void 0:l.length)===1)return;v=l==null?void 0:l.filter(y=>!c(y,h))}else(l==null?void 0:l.length)===f?v=[h]:v=[...v,h];return s||o(v),s==null||s(v,h,g,x),v},isSelected:d}}function aR(e,t,r=0,n=0,s=!1,i=Xn){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:u}=i;let f;if(!o&&!l)f={from:e,to:r>0?void 0:e};else if(o&&!l)c(o,e)?r===0?f={from:o,to:e}:s?f={from:o,to:void 0}:f=void 0:u(e,o)?f={from:e,to:o}:f={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))s?f={from:o,to:l}:f=void 0;else if(c(o,e))f={from:o,to:r>0?void 0:e};else if(c(l,e))f={from:e,to:r>0?void 0:e};else if(u(e,o))f={from:e,to:l};else if(d(e,o))f={from:o,to:e};else if(d(e,l))f={from:o,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const m=i.differenceInCalendarDays(f.to,f.from);n>0&&m>n?f={from:e,to:void 0}:r>1&&m<r&&(f={from:e,to:void 0})}return f}function sR(e,t,r=Xn){const n=Array.isArray(t)?t:[t];let s=e.from;const i=r.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(n.includes(s.getDay()))return!0;s=r.addDays(s,1)}return!1}function Zv(e,t,r=Xn){return la(e,t.from,!1,r)||la(e,t.to,!1,r)||la(t,e.from,!1,r)||la(t,e.to,!1,r)}function iR(e,t,r=Xn){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?la(e,l,!1,r):CN(l,r)?l.some(c=>la(e,c,!1,r)):Fu(l)?l.from&&l.to?Zv(e,{from:l.from,to:l.to},r):!1:SN(l)?sR(e,l.dayOfWeek,r):ng(l)?r.isAfter(l.before,l.after)?Zv(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):ca(e.from,l,r)||ca(e.to,l,r):ag(l)||sg(l)?ca(e.from,l,r)||ca(e.to,l,r):!1))return!0;const o=n.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=r.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(u=>u(l)))return!0;l=r.addDays(l,1)}}return!1}function oR(e,t){const{disabled:r,excludeDisabled:n,selected:s,required:i,onSelect:o}=e,[l,c]=Bu(s,o?s:void 0),d=o?s:l;return{selected:d,select:(m,h,g)=>{const{min:x,max:v}=e,y=m?aR(m,d,x,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&iR({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,h,g),y},isSelected:m=>d&&la(d,m,!1,t)}}function lR(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Bu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,h)=>{let g=f;return!n&&l&&l&&c(f,l)&&(g=void 0),s||o(g),s==null||s(g,f,m,h),g},isSelected:f=>l?c(l,f):!1}}function cR(e,t){const r=lR(e,t),n=nR(e,t),s=oR(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return s;default:return}}function tn(e,t){return e instanceof lr&&e.timeZone===t?e:new lr(e,t)}function hi(e,t,r){return tn(e,t)}function Jv(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?hi(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?hi(n,t):n):Fu(e)?{...e,from:e.from?tn(e.from,t):e.from,to:e.to?tn(e.to,t):e.to}:ng(e)?{before:hi(e.before,t),after:hi(e.after,t)}:ag(e)?{after:hi(e.after,t)}:sg(e)?{before:hi(e.before,t)}:e}function vm(e,t,r){return e&&(Array.isArray(e)?e.map(n=>Jv(n,t)):Jv(e,t))}function dR(e){var Ne;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=tn(t.today,r)),t.month&&(t.month=tn(t.month,r)),t.defaultMonth&&(t.defaultMonth=tn(t.defaultMonth,r)),t.startMonth&&(t.startMonth=tn(t.startMonth,r)),t.endMonth&&(t.endMonth=tn(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=tn(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(Ne=t.selected)==null?void 0:Ne.map(ue=>tn(ue,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?tn(t.selected.from,r):t.selected.from,to:t.selected.to?tn(t.selected.to,r):t.selected.to}),t.disabled!==void 0&&(t.disabled=vm(t.disabled,r)),t.hidden!==void 0&&(t.hidden=vm(t.hidden,r)),t.modifiers)){const ue={};Object.keys(t.modifiers).forEach(pe=>{var ce;ue[pe]=vm((ce=t.modifiers)==null?void 0:ce[pe],r)}),t.modifiers=ue}const{components:n,formatters:s,labels:i,dateLib:o,locale:l,classNames:c}=p.useMemo(()=>{const ue={...jN,...t.locale},pe=t.broadcastCalendar?1:t.weekStartsOn,ce=t.noonSafe&&t.timeZone?F4(t.timeZone,{weekStartsOn:pe,locale:ue}):void 0,me=t.dateLib&&ce?{...ce,...t.dateLib}:t.dateLib??ce,He=new Hr({locale:ue,weekStartsOn:pe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},me);return{dateLib:He,components:y4(t.components),formatters:P4(t.formatters),labels:I4(t.labels,He.options),locale:ue,classNames:{...w4(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});const{captionLayout:d,mode:u,navLayout:f,numberOfMonths:m=1,onDayBlur:h,onDayClick:g,onDayFocus:x,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:w,onNextClick:j,onPrevClick:N,showWeekNumber:k,styles:b}=t,{formatCaption:S,formatDay:_,formatMonthDropdown:C,formatWeekNumber:E,formatWeekNumberHeader:P,formatWeekdayName:O,formatYearDropdown:$}=s,D=J4(t,o),{days:B,months:A,navStart:W,navEnd:Q,previousMonth:K,nextMonth:ie,goToMonth:ne}=D,U=x4(B,t,W,Q,o),{isSelected:Y,select:Z,selected:G}=cR(t,o)??{},{blur:M,focused:z,isFocusTarget:se,moveFocus:L,setFocused:q}=rR(t,D,U,Y??(()=>!1),o),{labelDayButton:de,labelGridcell:X,labelGrid:Me,labelMonthDropdown:ae,labelNav:Ce,labelPrevious:_e,labelNext:Pe,labelWeekday:De,labelWeekNumber:V,labelWeekNumberHeader:Oe,labelYearDropdown:Te}=i,xt=p.useMemo(()=>z4(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Ge=u!==void 0||g!==void 0,Ot=p.useCallback(()=>{K&&(ne(K),N==null||N(K))},[K,ne,N]),Sr=p.useCallback(()=>{ie&&(ne(ie),j==null||j(ie))},[ne,ie,j]),ut=p.useCallback((ue,pe)=>ce=>{ce.preventDefault(),ce.stopPropagation(),q(ue),!pe.disabled&&(Z==null||Z(ue.date,pe,ce),g==null||g(ue.date,pe,ce))},[Z,g,q]),jt=p.useCallback((ue,pe)=>ce=>{q(ue),x==null||x(ue.date,pe,ce)},[x,q]),Xr=p.useCallback((ue,pe)=>ce=>{M(),h==null||h(ue.date,pe,ce)},[M,h]),za=p.useCallback((ue,pe)=>ce=>{const me={ArrowLeft:[ce.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[ce.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[ce.shiftKey?"year":"week","after"],ArrowUp:[ce.shiftKey?"year":"week","before"],PageUp:[ce.shiftKey?"year":"month","before"],PageDown:[ce.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(me[ce.key]){ce.preventDefault(),ce.stopPropagation();const[He,re]=me[ce.key];L(He,re)}v==null||v(ue.date,pe,ce)},[L,v,t.dir]),Qr=p.useCallback((ue,pe)=>ce=>{y==null||y(ue.date,pe,ce)},[y]),Qn=p.useCallback((ue,pe)=>ce=>{w==null||w(ue.date,pe,ce)},[w]),zr=p.useCallback(ue=>pe=>{const ce=Number(pe.target.value),me=o.setMonth(o.startOfMonth(ue),ce);ne(me)},[o,ne]),Lr=p.useCallback(ue=>pe=>{const ce=Number(pe.target.value),me=o.setYear(o.startOfMonth(ue),ce);ne(me)},[o,ne]),{className:fr,style:sr}=p.useMemo(()=>({className:[c[je.Root],t.className].filter(Boolean).join(" "),style:{...b==null?void 0:b[je.Root],...t.style}}),[c,t.className,t.style,b]),Xt=b4(t),_n=p.useRef(null);q4(_n,!!t.animate,{classNames:c,months:A,focused:z,dateLib:o});const Zn={dayPickerProps:t,selected:G,select:Z,isSelected:Y,months:A,nextMonth:ie,previousMonth:K,goToMonth:ne,getModifiers:U,components:n,classNames:c,styles:b,labels:i,formatters:s};return T.createElement(kN.Provider,{value:Zn},T.createElement(n.Root,{rootRef:t.animate?_n:void 0,className:fr,style:sr,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Xt},T.createElement(n.Months,{className:c[je.Months],style:b==null?void 0:b[je.Months]},!t.hideNavigation&&!f&&T.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[je.Nav],style:b==null?void 0:b[je.Nav],"aria-label":Ce(),onPreviousClick:Ot,onNextClick:Sr,previousMonth:K,nextMonth:ie}),A.map((ue,pe)=>T.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[je.Month],style:b==null?void 0:b[je.Month],key:pe,displayIndex:pe,calendarMonth:ue},f==="around"&&!t.hideNavigation&&pe===0&&T.createElement(n.PreviousMonthButton,{type:"button",className:c[je.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":_e(K),onClick:Ot,"data-animated-button":t.animate?"true":void 0},T.createElement(n.Chevron,{disabled:K?void 0:!0,className:c[je.Chevron],orientation:t.dir==="rtl"?"right":"left"})),T.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[je.MonthCaption],style:b==null?void 0:b[je.MonthCaption],calendarMonth:ue,displayIndex:pe},d!=null&&d.startsWith("dropdown")?T.createElement(n.DropdownNav,{className:c[je.Dropdowns],style:b==null?void 0:b[je.Dropdowns]},(()=>{const ce=d==="dropdown"||d==="dropdown-months"?T.createElement(n.MonthsDropdown,{key:"month",className:c[je.MonthsDropdown],"aria-label":ae(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:zr(ue.date),options:R4(ue.date,W,Q,s,o),style:b==null?void 0:b[je.Dropdown],value:o.getMonth(ue.date)}):T.createElement("span",{key:"month"},C(ue.date,o)),me=d==="dropdown"||d==="dropdown-years"?T.createElement(n.YearsDropdown,{key:"year",className:c[je.YearsDropdown],"aria-label":Te(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:Lr(ue.date),options:L4(W,Q,s,o,!!t.reverseYears),style:b==null?void 0:b[je.Dropdown],value:o.getYear(ue.date)}):T.createElement("span",{key:"year"},$(ue.date,o));return o.getMonthYearOrder()==="year-first"?[me,ce]:[ce,me]})(),T.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(ue.date,o.options,o))):T.createElement(n.CaptionLabel,{className:c[je.CaptionLabel],role:"status","aria-live":"polite"},S(ue.date,o.options,o))),f==="around"&&!t.hideNavigation&&pe===m-1&&T.createElement(n.NextMonthButton,{type:"button",className:c[je.NextMonthButton],tabIndex:ie?void 0:-1,"aria-disabled":ie?void 0:!0,"aria-label":Pe(ie),onClick:Sr,"data-animated-button":t.animate?"true":void 0},T.createElement(n.Chevron,{disabled:ie?void 0:!0,className:c[je.Chevron],orientation:t.dir==="rtl"?"left":"right"})),pe===m-1&&f==="after"&&!t.hideNavigation&&T.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[je.Nav],style:b==null?void 0:b[je.Nav],"aria-label":Ce(),onPreviousClick:Ot,onNextClick:Sr,previousMonth:K,nextMonth:ie}),T.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":Me(ue.date,o.options,o)||void 0,className:c[je.MonthGrid],style:b==null?void 0:b[je.MonthGrid]},!t.hideWeekdays&&T.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[je.Weekdays],style:b==null?void 0:b[je.Weekdays]},k&&T.createElement(n.WeekNumberHeader,{"aria-label":Oe(o.options),className:c[je.WeekNumberHeader],style:b==null?void 0:b[je.WeekNumberHeader],scope:"col"},P()),xt.map(ce=>T.createElement(n.Weekday,{"aria-label":De(ce,o.options,o),className:c[je.Weekday],key:String(ce),style:b==null?void 0:b[je.Weekday],scope:"col"},O(ce,o.options,o)))),T.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[je.Weeks],style:b==null?void 0:b[je.Weeks]},ue.weeks.map(ce=>T.createElement(n.Week,{className:c[je.Week],key:ce.weekNumber,style:b==null?void 0:b[je.Week],week:ce},k&&T.createElement(n.WeekNumber,{week:ce,style:b==null?void 0:b[je.WeekNumber],"aria-label":V(ce.weekNumber,{locale:l}),className:c[je.WeekNumber],scope:"row",role:"rowheader"},E(ce.weekNumber,o)),ce.days.map(me=>{const{date:He}=me,re=U(me);if(re[ht.focused]=!re.hidden&&!!(z!=null&&z.isEqualTo(me)),re[vn.selected]=(Y==null?void 0:Y(He))||re.selected,Fu(G)){const{from:Qe,to:Ze}=G;re[vn.range_start]=!!(Qe&&Ze&&o.isSameDay(He,Qe)),re[vn.range_end]=!!(Qe&&Ze&&o.isSameDay(He,Ze)),re[vn.range_middle]=la(G,He,!0,o)}const be=$4(re,b,t.modifiersStyles),Ee=v4(re,c,t.modifiersClassNames),ft=!Ge&&!re.hidden?X(He,re,o.options,o):void 0;return T.createElement(n.Day,{key:`${me.isoDate}_${me.displayMonthId}`,day:me,modifiers:re,className:Ee.join(" "),style:be,role:"gridcell","aria-selected":re.selected||void 0,"aria-label":ft,"data-day":me.isoDate,"data-month":me.outside?me.dateMonthId:void 0,"data-selected":re.selected||void 0,"data-disabled":re.disabled||void 0,"data-hidden":re.hidden||void 0,"data-outside":me.outside||void 0,"data-focused":re.focused||void 0,"data-today":re.today||void 0},!re.hidden&&Ge?T.createElement(n.DayButton,{className:c[je.DayButton],style:b==null?void 0:b[je.DayButton],type:"button",day:me,modifiers:re,disabled:!re.focused&&re.disabled||void 0,"aria-disabled":re.focused&&re.disabled||void 0,tabIndex:se(me)?0:-1,"aria-label":de(He,re,o.options,o),onClick:ut(me,re),onBlur:Xr(me,re),onFocus:jt(me,re),onKeyDown:za(me,re),onMouseEnter:Qr(me,re),onMouseLeave:Qn(me,re)},_(He,o.options,o)):!re.hidden&&_(me.date,o.options,o))})))))))),t.footer&&T.createElement(n.Footer,{className:c[je.Footer],style:b==null?void 0:b[je.Footer],role:"status","aria-live":"polite"},t.footer)))}function ur({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(dR,{showOutsideDays:r,className:I("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",month_caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium pointer-events-none",nav:"flex items-center gap-1",button_previous:I(_i({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:I(_i({variant:"outline"}),"absolute right-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem] text-center",week:"flex w-full mt-2",day:"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 rounded-md",day_button:I(_i({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),selected:"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:focus:bg-primary [&>button]:focus:text-primary-foreground",today:"[&>button]:bg-accent [&>button]:text-accent-foreground",outside:"day-outside text-muted-foreground [&>button]:text-muted-foreground aria-selected:text-muted-foreground",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...t},components:{Chevron:({orientation:s})=>s==="left"?a.jsx(vu,{className:"h-4 w-4"}):a.jsx(kn,{className:"h-4 w-4"})},...n})}ur.displayName="Calendar";function uR(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,fR(s,...t)]}function fR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function mR(e){const t=hR(e),r=p.forwardRef((n,s)=>{const{children:i,...o}=n,l=p.Children.toArray(i),c=l.find(gR);if(c){const d=c.props.children,u=l.map(f=>f===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function hR(e){const t=p.forwardRef((r,n)=>{const{children:s,...i}=r;if(p.isValidElement(s)){const o=vR(s),l=xR(i,s.props);return s.type!==p.Fragment&&(l.ref=n?Mj(n,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pR=Symbol("radix.slottable");function gR(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pR}function xR(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function vR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var yR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],LN=yR.reduce((e,t)=>{const r=mR(`Primitive.${t}`),n=p.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Wu="Switch",[bR]=uR(Wu),[wR,jR]=bR(Wu),FN=p.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,h]=p.useState(null),g=hu(t,j=>h(j)),x=p.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,w]=iP({prop:s,defaultProp:i??!1,onChange:d,caller:Wu});return a.jsxs(wR,{scope:r,checked:y,disabled:l,children:[a.jsx(LN.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":qN(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:Ns(e.onClick,j=>{w(N=>!N),v&&(x.current=j.isPropagationStopped(),x.current||j.stopPropagation())})}),v&&a.jsx(UN,{control:m,bubbles:!x.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});FN.displayName=Wu;var BN="SwitchThumb",WN=p.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=jR(BN,r);return a.jsx(LN.span,{"data-state":qN(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});WN.displayName=BN;var NR="SwitchBubbleInput",UN=p.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=p.useRef(null),l=hu(o,i),c=oP(r),d=lP(t);return p.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&h){const g=new Event("click",{bubbles:n});h.call(u,r),u.dispatchEvent(g)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});UN.displayName=NR;function qN(e){return e?"checked":"unchecked"}var HN=FN,kR=WN;const uo=p.forwardRef(({className:e,...t},r)=>a.jsx(HN,{className:I("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(kR,{className:I("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));uo.displayName=HN.displayName;function SR(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function Uu({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:s,defaultParentId:i}){const o=Ct(),{workspace:l,projectKey:c}=Ht(),{workspace:d}=Ie(),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(n),[v,y]=p.useState("medium"),[w,j]=p.useState("task"),[N,k]=p.useState([]),[b,S]=p.useState(""),[_,C]=p.useState(s??""),[E,P]=p.useState(void 0),[O,$]=p.useState(void 0),[D,B]=p.useState(!1),[A,W]=p.useState("weekly"),[Q,K]=p.useState(void 0),ie=s1(),{data:ne}=Gn(r),U=p.useMemo(()=>ne?ne.members.filter(q=>q.user).map(q=>q.user):void 0,[ne]),{data:Y}=lo(r),{data:Z}=co(r||void 0),{data:G}=Gl(r||void 0),M=(Z??[]).filter(q=>q.status!=="completed"),z=Y&&Y.length>0?Object.fromEntries(Y.map(q=>[q.key,q.name])):Ws,se=()=>{f(""),h(""),x(n),y("medium"),j("task"),k([]),S(""),C(s??""),P(void 0),$(void 0),B(!1),W("weekly"),K(void 0),t()},L=q=>{q.preventDefault(),u.trim()&&ie.mutate({title:u.trim(),description:m.trim()||void 0,status:g,priority:v,type:w,project_id:r,workspace_id:d.id,assignee_ids:N.length>0?N:void 0,sprint_id:b||null,task_list_id:_||null,parent_id:i||null,start_date:E?fe(E,"yyyy-MM-dd"):null,due_date:O?fe(O,"yyyy-MM-dd"):null,recurrence_frequency:D?A:void 0,recurrence_end_date:D&&Q?fe(Q,"yyyy-MM-dd"):void 0},{onSuccess:()=>{F.success("Issue created"),se()},onError:de=>F.error(de.message??"Failed to create issue")})};return a.jsx(si,{open:e,onOpenChange:q=>!q&&se(),children:a.jsxs(ii,{className:"max-w-md",children:[a.jsx(ao,{children:a.jsx(io,{children:"New issue"})}),a.jsxs("form",{onSubmit:L,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(so,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{htmlFor:"issue-title",children:"Title"}),a.jsx(Ae,{id:"issue-title",placeholder:"Issue title",value:u,onChange:q=>f(q.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{htmlFor:"issue-desc",children:["Description ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Ru,{id:"issue-desc",placeholder:"Add more context...",value:m,onChange:q=>h(q.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"Status"}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(z).map(([q,de])=>a.jsx(xe,{value:q,className:"text-xs",children:de},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"Priority"}),a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(wn).map(([q,de])=>a.jsx(xe,{value:q,className:"text-xs",children:de},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"Type"}),a.jsxs(Fe,{value:w,onValueChange:j,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(rs).map(([q,de])=>a.jsx(xe,{value:q,className:"text-xs",children:de},q))})]})]})]}),i&&a.jsx("div",{className:"rounded-md bg-muted/50 border border-border px-3 py-2 text-xs text-muted-foreground",children:"Will be created as a child issue"}),(G??[]).length>0&&!i&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["List ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Fe,{value:_||"none",onValueChange:q=>C(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{placeholder:"No list"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(G??[]).map(q=>a.jsx(xe,{value:q.id,className:"text-xs",children:q.name},q.id))]})]})]}),M.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["Sprint ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Fe,{value:b||"none",onValueChange:q=>S(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{placeholder:"No sprint"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),M.map(q=>{const de=SR(q);return a.jsx(xe,{value:q.id,className:"text-xs",children:a.jsxs("div",{children:[a.jsx("span",{children:q.name}),de&&a.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:de})]})},q.id)})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["Assignees ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Vl,{value:N,onChange:k,users:U})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["Start Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(dr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?fe(E,"MMM d, yyyy"):"No start date"}),E&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),P(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:E,onSelect:P,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["Due Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(dr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:O?"text-foreground":"text-muted-foreground",children:O?fe(O,"MMM d, yyyy"):"No due date"}),O&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),$(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:O,onSelect:$,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(uo,{id:"recurring",checked:D,onCheckedChange:B}),a.jsxs(vt,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[a.jsx(nl,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),D&&a.jsx("div",{className:"space-y-3 pl-4 border-l-2 border-indigo-200 dark:border-indigo-800",children:a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"Frequency"}),a.jsxs(Fe,{value:A,onValueChange:q=>W(q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(qe,{})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(xe,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{children:["Until ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-8 w-full rounded-md border border-input px-3 text-xs bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(dr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:Q?"text-foreground":"text-muted-foreground",children:Q?fe(Q,"MMM d, yyyy"):"No end date"}),Q&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),K(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:Q,onSelect:K,initialFocus:!0})})]})]})]})})]})]}),a.jsxs(ql,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs(J,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{se(),o(`/${l}/projects/${c}/issues/new`)},children:[a.jsx(m1,{className:"h-3.5 w-3.5"}),"Open full form"]}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx(J,{type:"button",variant:"ghost",onClick:se,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!u.trim()||ie.isPending,children:ie.isPending?"Creating...":"Create issue"})]})]})]})]})})}const lg={byIssue:e=>["attachments",e]};function KN(e){return Be({queryKey:lg.byIssue(e),queryFn:()=>te.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function YN(e){const t=we();return ye({mutationFn:({file:r,commentId:n})=>{const s=new FormData;return s.append("file",r),n&&s.append("comment_id",n),te.upload(`/admin/issues/${e}/attachments`,s)},onSuccess:()=>{t.invalidateQueries({queryKey:lg.byIssue(e)})}})}function CR(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:lg.byIssue(e)})}})}function ol(e){return e.startsWith("image/")}function qu(e){return e.startsWith("video/")}function Hu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function od(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function cg(e,t){if(!od(e)){console.error("downloadFile: blocked unsafe URL",e);return}const r=document.createElement("a");r.href=e,r.download=t,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}function dg({mimeType:e,className:t}){return ol(e)?a.jsx(ME,{className:t}):qu(e)?a.jsx(bu,{className:t}):e.startsWith("text/")||e.includes("json")?a.jsx(OE,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?a.jsx(_E,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?a.jsx(PE,{className:t}):a.jsx(AE,{className:t})}function GN({attachment:e,onClose:t}){return e?a.jsx(si,{open:!0,onOpenChange:r=>!r&&t(),children:a.jsxs(ii,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[a.jsxs(ao,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[a.jsx(io,{className:"text-sm font-medium truncate",children:e.original_name}),a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>cg(e.url,e.original_name),children:[a.jsx(Tp,{className:"h-3.5 w-3.5"}),"Download"]})]}),a.jsxs(so,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[ol(e.mime_type)&&od(e.url)&&a.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),qu(e.mime_type)&&od(e.url)&&a.jsx("video",{src:e.url,controls:!0,className:"max-w-full max-h-[75vh]"})]}),a.jsxs("div",{className:"px-4 py-2 border-t border-border text-[11px] text-muted-foreground flex items-center gap-3 shrink-0",children:[a.jsx("span",{children:Hu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:e.mime_type}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:["Uploaded ",fe(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function _R({attachment:e}){const[t,r]=p.useState(null),n=ol(e.mime_type)||qu(e.mime_type),s=()=>{n?r(e):cg(e.url,e.original_name)};return a.jsxs(a.Fragment,{children:[ol(e.mime_type)?a.jsx("button",{type:"button",onClick:s,className:"block rounded-md overflow-hidden border border-border hover:opacity-90 transition-opacity",title:e.original_name,children:a.jsx("img",{src:od(e.url)?e.url:"",alt:e.original_name,className:"max-h-48 max-w-xs object-cover"})}):a.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg border border-border bg-muted/40 hover:bg-muted transition-colors text-left max-w-xs",title:n?"View":"Download",children:[a.jsx(dg,{mimeType:e.mime_type,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-foreground truncate",children:e.original_name}),a.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:Hu(e.size)}),!n&&a.jsx(Tp,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&a.jsx(GN,{attachment:t,onClose:()=>r(null)})]})}function OR({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const s=ol(e.mime_type)||qu(e.mime_type),i=()=>{s?t(e):cg(e.url,e.original_name)};return a.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("button",{type:"button",onClick:i,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary transition-colors",title:s?"View":"Download",children:a.jsx(dg,{mimeType:e.mime_type,className:"h-4 w-4"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("button",{type:"button",onClick:i,className:"text-xs font-medium text-foreground truncate block text-left w-full hover:underline",children:e.original_name}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[a.jsx("span",{children:Hu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:fe(new Date(e.created_at),"MMM d, yyyy")}),e.comment_id&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsx("span",{className:"italic",children:"from comment"})]}),!s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{className:"flex items-center gap-0.5",children:[a.jsx(Tp,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),a.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",onClick:()=>r(e.id),disabled:n,children:a.jsx(Dr,{className:"h-3.5 w-3.5"})})]})}function MR({onFiles:e,isUploading:t}){const[r,n]=p.useState(!1),s=p.useRef(null),i=p.useCallback(o=>{o.preventDefault(),n(!1);const l=Array.from(o.dataTransfer.files);l.length>0&&e(l)},[e]);return a.jsxs("div",{onDragOver:o=>{o.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:i,onClick:()=>{var o;return!t&&((o=s.current)==null?void 0:o.click())},className:I("flex flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6","cursor-pointer transition-colors",r?"border-primary/60 bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30",t&&"opacity-60 cursor-wait"),children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted",children:a.jsx(tD,{className:"h-4 w-4 text-muted-foreground"})}),a.jsx("p",{className:"text-xs font-medium text-foreground",children:t?"Uploading…":"Drop files or click to browse"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to 50 MB per file"}),a.jsx("input",{ref:s,type:"file",multiple:!0,className:"hidden",onChange:o=>{const l=Array.from(o.target.files??[]);l.length>0&&e(l),o.target.value=""}})]})}function PR({issueId:e,className:t}){const[r,n]=p.useState(null),{data:s,isLoading:i}=KN(e),o=YN(e),l=CR(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>F.success(`${f.name} uploaded`),onError:()=>F.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>F.success("Attachment removed"),onError:()=>F.error("Failed to remove attachment")})};return a.jsxs("div",{className:I("px-6 py-4 space-y-4",t),children:[a.jsx(MR,{onFiles:c,isUploading:o.isPending}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(u=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-8 w-8 rounded-md shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-2/3"}),a.jsx(le,{className:"h-2.5 w-1/3"})]})]},u))}):s&&s.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx($p,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[s.length," ",s.length===1?"file":"files"]})]}),a.jsx("div",{children:s.map(u=>a.jsx(OR,{attachment:u,onOpen:n,onDelete:d,isDeleting:l.isPending},u.id))})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No attachments yet."}),a.jsx(GN,{attachment:r,onClose:()=>n(null)})]})}const ns={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function AR(e){return Be({queryKey:ns.byIssue(e),queryFn:()=>te.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function ER(e){return Be({queryKey:ns.activeTimer(e),queryFn:()=>te.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e,refetchInterval:1e4})}function DR(e){const t=we();return ye({mutationFn:r=>te.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ns.byIssue(e)})}})}function TR(e){const t=we();return ye({mutationFn:()=>te.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{t.invalidateQueries({queryKey:ns.activeTimer(e)}),t.invalidateQueries({queryKey:ns.byIssue(e)})}})}function IR(e){const t=we();return ye({mutationFn:()=>te.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:ns.activeTimer(e)}),t.invalidateQueries({queryKey:ns.byIssue(e)})}})}function RR(e){const t=we();return ye({mutationFn:r=>te.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ns.byIssue(e)})}})}const $R=El("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function Ku({className:e,variant:t,...r}){return a.jsx("div",{className:I($R({variant:t}),e),...r})}function uh(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function ey(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3),n=Math.floor(r/3600),s=Math.floor(r%3600/60),i=r%60,o=String(s).padStart(2,"0"),l=String(i).padStart(2,"0");return n>0?`${n}:${o}:${l}`:`${o}:${l}`}function zR({startedAt:e}){const[t,r]=p.useState(()=>ey(e));return p.useEffect(()=>{const n=setInterval(()=>r(ey(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function LR({onSubmit:e,isPending:t,onCancel:r}){const[n,s]=p.useState(""),[i,o]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(new Date().toISOString().split("T")[0]),f=m=>{m.preventDefault();const h=parseInt(n||"0",10),g=parseInt(i||"0",10),x=h*60+g;if(x<=0){F.error("Please enter a duration greater than 0.");return}e({duration_minutes:x,description:l.trim()||void 0,logged_date:d||void 0})};return a.jsxs("form",{onSubmit:f,className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Log time manually"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Hours"}),a.jsx(Ae,{type:"number",min:"0",max:"999",placeholder:"0",value:n,onChange:m=>s(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Minutes"}),a.jsx(Ae,{type:"number",min:"0",max:"59",placeholder:"0",value:i,onChange:m=>o(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Date"}),a.jsx(Ae,{type:"date",value:d,onChange:m=>u(m.target.value),className:"h-8 text-sm"})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:["Description ",a.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),a.jsx(Ae,{placeholder:"What did you work on?",value:l,onChange:m=>c(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function FR({entry:e,userName:t,onDelete:r,isDeleting:n}){const s=e.started_at!=null&&e.stopped_at==null;return a.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("div",{className:I("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",s?"bg-emerald-50 dark:bg-emerald-950/40":"bg-muted"),children:s?a.jsx(QE,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?a.jsx(Yn,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(SE,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s?a.jsx(zR,{startedAt:e.started_at}):a.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:uh(e.duration_minutes??0)}),a.jsx(Ku,{variant:"muted",className:I("text-[10px] px-1.5 py-0",s?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":""),children:s?"Running":e.source==="timer"?"Timer":"Manual"}),t&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:t})]}),e.description&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!s&&a.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:fe(new Date(e.logged_date),"MMM d, yyyy")})]}),!s&&a.jsx(J,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all mt-0.5",onClick:()=>r(e.id),disabled:n,children:a.jsx(Dr,{className:"h-3.5 w-3.5"})})]})}function BR({issueId:e,className:t}){const[r,n]=p.useState(!1),{data:s,isLoading:i}=AR(e),{data:o}=ER(e),{data:l}=oi(),c=DR(e),d=TR(e),u=IR(e),f=RR(e),m=(s==null?void 0:s.time_logs)??[],h=(s==null?void 0:s.total_minutes)??0,g=o!=null,x=j=>{c.mutate(j,{onSuccess:()=>{n(!1),F.success("Time logged")},onError:()=>F.error("Failed to log time")})},v=()=>{d.mutate(void 0,{onSuccess:()=>F.success("Timer started"),onError:j=>F.error(j.message??"Failed to start timer")})},y=()=>{u.mutate(void 0,{onSuccess:j=>{const N=j.time_log.duration_minutes??0;F.success(`Timer stopped — ${uh(N)} logged`)},onError:()=>F.error("Failed to stop timer")})},w=j=>{f.mutate(j,{onSuccess:()=>F.success("Time entry removed"),onError:()=>F.error("Failed to remove entry")})};return a.jsxs("div",{className:I("px-6 py-4 space-y-4",t),children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Total logged"}),a.jsx("p",{className:"text-xl font-bold text-foreground tabular-nums",children:h>0?uh(h):"—"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a.jsxs(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Log time"]}),g?a.jsxs(J,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:y,disabled:u.isPending,children:[a.jsx(KE,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):a.jsxs(J,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:v,disabled:d.isPending,children:[a.jsx(bu,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&a.jsx(LR,{onSubmit:x,isPending:c.isPending,onCancel:()=>n(!1)}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(j=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-1/3"}),a.jsx(le,{className:"h-2.5 w-1/4"})]})]},j))}):m.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(Yn,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[m.length," ",m.length===1?"entry":"entries"]})]}),a.jsx("div",{children:m.map(j=>{var N;return a.jsx(FR,{entry:j,userName:(N=l==null?void 0:l.get(j.user_id))==null?void 0:N.name,onDelete:w,isDeleting:f.isPending},j.id)})})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function WR(e){var t;const{char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=e,c=n&&!s,d=LP(r),u=new RegExp(`\\s${d}$`),f=o?"^":"",m=s?"":d,h=c?new RegExp(`${f}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${m}]*`,"gm"),g=((t=l.nodeBefore)==null?void 0:t.isText)&&l.nodeBefore.text;if(!g)return null;const x=l.pos-g.length,v=Array.from(g.matchAll(h)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const y=v.input.slice(Math.max(0,v.index-1),v.index),w=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!w)return null;const j=x+v.index;let N=j+v[0].length;return c&&u.test(g.slice(N-1,N+1))&&(v[0]+=" ",N+=1),j<l.pos&&N>=l.pos?{range:{from:j,to:N},query:v[0].slice(r.length),text:v[0]}:null}var UR=new zj("suggestion");function qR({pluginKey:e=UR,editor:t,char:r="@",allowSpaces:n=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:c="suggestion",decorationContent:d="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:m=()=>[],render:h=()=>({}),allow:g=()=>!0,findSuggestionMatch:x=WR,shouldShow:v}){let y;const w=h==null?void 0:h(),j=()=>{const S=t.state.selection.$anchor.pos,_=t.view.coordsAtPos(S),{top:C,right:E,bottom:P,left:O}=_;try{return new DOMRect(O,C,E-O,P-C)}catch{return null}},N=(S,_)=>_?()=>{const C=e.getState(t.state),E=C==null?void 0:C.decorationId,P=S.dom.querySelector(`[data-decoration-id="${E}"]`);return(P==null?void 0:P.getBoundingClientRect())||null}:j;function k(S,_){var C;try{const P=e.getState(S.state),O=P!=null&&P.decorationId?S.dom.querySelector(`[data-decoration-id="${P.decorationId}"]`):null,$={editor:t,range:(P==null?void 0:P.range)||{from:0,to:0},query:(P==null?void 0:P.query)||null,text:(P==null?void 0:P.text)||null,items:[],command:D=>f({editor:t,range:(P==null?void 0:P.range)||{from:0,to:0},props:D}),decorationNode:O,clientRect:N(S,O)};(C=w==null?void 0:w.onExit)==null||C.call(w,$)}catch{}const E=S.state.tr.setMeta(_,{exit:!0});S.dispatch(E)}const b=new RP({key:e,view(){return{update:async(S,_)=>{var C,E,P,O,$,D,B;const A=(C=this.key)==null?void 0:C.getState(_),W=(E=this.key)==null?void 0:E.getState(S.state),Q=A.active&&W.active&&A.range.from!==W.range.from,K=!A.active&&W.active,ie=A.active&&!W.active,ne=!K&&!ie&&A.query!==W.query,U=K||Q&&ne,Y=ne||Q,Z=ie||Q&≠if(!U&&!Y&&!Z)return;const G=Z&&!U?A:W,M=S.dom.querySelector(`[data-decoration-id="${G.decorationId}"]`);y={editor:t,range:G.range,query:G.query,text:G.text,items:[],command:z=>f({editor:t,range:G.range,props:z}),decorationNode:M,clientRect:N(S,M)},U&&((P=w==null?void 0:w.onBeforeStart)==null||P.call(w,y)),Y&&((O=w==null?void 0:w.onBeforeUpdate)==null||O.call(w,y)),(Y||U)&&(y.items=await m({editor:t,query:G.query})),Z&&(($=w==null?void 0:w.onExit)==null||$.call(w,y)),Y&&((D=w==null?void 0:w.onUpdate)==null||D.call(w,y)),U&&((B=w==null?void 0:w.onStart)==null||B.call(w,y))},destroy:()=>{var S;y&&((S=w==null?void 0:w.onExit)==null||S.call(w,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,_,C,E){const{isEditable:P}=t,{composing:O}=t.view,{selection:$}=S,{empty:D,from:B}=$,A={..._},W=S.getMeta(e);if(W&&W.exit)return A.active=!1,A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null,A;if(A.composing=O,P&&(D||t.view.composing)){(B<_.range.from||B>_.range.to)&&!O&&!_.composing&&(A.active=!1);const Q=x({char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:$.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;Q&&g({editor:t,state:E,range:Q.range,isActive:_.active})&&(!v||v({editor:t,range:Q.range,query:Q.query,text:Q.text,transaction:S}))?(A.active=!0,A.decorationId=_.decorationId?_.decorationId:K,A.range=Q.range,A.query=Q.query,A.text=Q.text):A.active=!1}else A.active=!1;return A.active||(A.decorationId=null,A.range={from:0,to:0},A.query=null,A.text=null),A}},props:{handleKeyDown(S,_){var C,E,P,O;const{active:$,range:D}=b.getState(S.state);if(!$)return!1;if(_.key==="Escape"||_.key==="Esc"){const A=b.getState(S.state),W=(C=y==null?void 0:y.decorationNode)!=null?C:null,Q=W??(A!=null&&A.decorationId?S.dom.querySelector(`[data-decoration-id="${A.decorationId}"]`):null);if(((E=w==null?void 0:w.onKeyDown)==null?void 0:E.call(w,{view:S,event:_,range:A.range}))||!1)return!0;const ie={editor:t,range:A.range,query:A.query,text:A.text,items:[],command:ne=>f({editor:t,range:A.range,props:ne}),decorationNode:Q,clientRect:Q?()=>Q.getBoundingClientRect()||null:null};return(P=w==null?void 0:w.onExit)==null||P.call(w,ie),k(S,e),!0}return((O=w==null?void 0:w.onKeyDown)==null?void 0:O.call(w,{view:S,event:_,range:D}))||!1},decorations(S){const{active:_,range:C,decorationId:E,query:P}=b.getState(S);if(!_)return null;const O=!(P!=null&&P.length),$=[c];return O&&$.push(u),$P.create(S.doc,[zP.inline(C.from,C.to,{nodeName:l,class:$.join(" "),"data-decoration-id":E,"data-decoration-content":d})])}}});return b}function HR({editor:e,overrideSuggestionOptions:t,extensionName:r,char:n="@"}){const s=new zj;return{editor:e,char:n,pluginKey:s,command:({editor:i,range:o,props:l})=>{var c,d,u;const f=i.view.state.selection.$to.nodeAfter;((c=f==null?void 0:f.text)==null?void 0:c.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:r,attrs:{...l,mentionSuggestionChar:n}},{type:"text",text:" "}]).run(),(u=(d=i.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),c=i.schema.nodes[r];return!!l.parent.type.contentMatch.matchType(c)},...t}}function VN(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>HR({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function ty(e,t){const r=VN(e),n=r.find(s=>s.char===t);return n||(r.length?r[0]:null)}var KR=FP.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){var r,n;return`${(r=t==null?void 0:t.char)!=null?r:"@"}${(n=e.attrs.label)!=null?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:r}){var n,s;return["span",vc(this.HTMLAttributes,e.HTMLAttributes),`${(n=r==null?void 0:r.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:e=>e.getAttribute("data-mention-suggestion-char"),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){const r=ty(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",vc({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:r})];const n={...this.options};n.HTMLAttributes=vc({"data-type":this.name},this.options.HTMLAttributes,t);const s=this.options.renderHTML({options:n,node:e,suggestion:r});return typeof s=="string"?["span",vc({"data-type":this.name},this.options.HTMLAttributes,t),s]:s},...WP({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:e=>{const t={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(e);for(;n!==null;){const[,s,i,o]=n,l=i??o;t[s==="char"?"mentionSuggestionChar":s]=l,n=r.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t==="mentionSuggestionChar"?"char":t}="${r}"`).join(" ")}),renderText({node:e}){const t={options:this.options,node:e,suggestion:ty(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(t)):this.options.renderText(t)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:s,anchor:i}=n;if(!s)return!1;let o=new BP,l=0;return t.doc.nodesBetween(i-1,i,(c,d)=>{if(c.type.name===this.name)return r=!0,o=c,l=d,!1}),r&&e.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),r})}},addProseMirrorPlugins(){return VN(this).map(qR)}}),YR=KR;function GR({items:e,selectedIndex:t,onSelect:r}){const n=p.useRef(null);return p.useEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.querySelector(`[data-index="${t}"]`);s==null||s.scrollIntoView({block:"nearest"})},[t]),e.length===0?null:a.jsx("div",{className:I("z-50 min-w-[220px] max-w-[280px] rounded-md border border-border","bg-popover shadow-md overflow-hidden","animate-in fade-in-0 zoom-in-95"),children:a.jsx("div",{ref:n,className:"max-h-[200px] overflow-y-auto p-1",role:"listbox",children:e.map((s,i)=>{const o=s.label.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2)||"?",l=mg(s.label);return a.jsxs("button",{"data-index":i,role:"option","aria-selected":i===t,onMouseDown:c=>{c.preventDefault(),r(s)},className:I("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs cursor-pointer","transition-colors",i===t?"bg-accent text-accent-foreground":"hover:bg-accent/60"),children:[a.jsx($t,{className:"h-5 w-5 shrink-0",children:a.jsx(zt,{className:I("text-[9px] font-semibold",l.bg,l.text),children:o})}),a.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[a.jsx("span",{className:"font-medium text-foreground truncate leading-tight",children:s.label}),a.jsx("span",{className:"text-[10px] text-muted-foreground truncate leading-tight",children:s.email})]})]},s.id)})})})}function xs({onClick:e,active:t,title:r,children:n}){return a.jsx("button",{type:"button",title:r,onMouseDown:s=>{s.preventDefault(),e()},className:I("flex h-6 w-6 items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted",t&&"bg-muted text-foreground"),children:n})}function ry(){return a.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}const Cc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function XN({issueId:e,projectId:t,compact:r,className:n,onSuccess:s}){const[i,o]=p.useState(!0),[l,c]=p.useState([]),[d,u]=p.useState(!1),[f,m]=p.useState(Cc),h=p.useRef(null),g=p.useRef(async()=>{}),x=p.useRef(null),{user:v}=Ie(),y=vE(e),w=YN(e),{data:j}=Gn(t??""),N=p.useMemo(()=>j!=null&&j.members?j.members.filter(M=>M.user).map(M=>{const z=M.user,se=`${z.first_name??""} ${z.last_name??""}`.trim()||z.email;return{id:z.id,label:se,email:z.email}}):[],[j]),k=p.useRef([]);k.current=N;const b=p.useRef(m);b.current=m;const S=p.useRef([]),_=p.useRef(null),C=p.useRef(0),E=(v==null?void 0:v.first_name)??"",P=(v==null?void 0:v.last_name)??"",O=`${E} ${P}`.trim()||(v==null?void 0:v.email)||"?",$=v&&`${E[0]??""}${P[0]??""}`.toUpperCase()||"?",D=mg(O),B=p.useMemo(()=>UP.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(g.current(),!0)}}}),[]),A=p.useMemo(()=>YR.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:M})=>{const z=k.current;if(!z.length)return[];const se=M.toLowerCase();return z.filter(L=>!se||L.label.toLowerCase().includes(se)||L.email.toLowerCase().includes(se)).slice(0,8)},render:()=>({onStart:M=>{var z;S.current=M.items,_.current=M.command,C.current=0,b.current({active:!0,items:M.items,selectedIndex:0,rect:((z=M.clientRect)==null?void 0:z.call(M))??null,command:M.command})},onUpdate:M=>{var z;S.current=M.items,_.current=M.command,C.current=0,b.current({active:!0,items:M.items,selectedIndex:0,rect:((z=M.clientRect)==null?void 0:z.call(M))??null,command:M.command})},onKeyDown:({event:M})=>{var se;const z=S.current;if(!z.length)return!1;if(M.key==="Escape")return b.current(Cc),!0;if(M.key==="ArrowDown"){const L=(C.current+1)%z.length;return C.current=L,b.current(q=>({...q,selectedIndex:L})),!0}if(M.key==="ArrowUp"){const L=(C.current-1+z.length)%z.length;return C.current=L,b.current(q=>({...q,selectedIndex:L})),!0}if(M.key==="Enter"){const L=z[C.current];return L&&((se=_.current)==null||se.call(_,L)),!0}return!1},onExit:()=>{b.current(Cc),_.current=null}})}}),[]),W=Lj({extensions:[Fj,Bj,Wj.configure({placeholder:"Leave a comment… (type @ to mention)"}),B,A],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:M}){o(M.isEmpty)}}),Q=!i||l.length>0,K=25*1024*1024,ie=M=>{const z=M.filter(L=>L.size>K);z.length>0&&F.error(`Files must be under 25 MB: ${z.map(L=>L.name).join(", ")}`);const se=M.filter(L=>L.size<=K);c(L=>{const q=new Set(L.map(de=>`${de.name}-${de.size}`));return[...L,...se.filter(de=>!q.has(`${de.name}-${de.size}`))]})},ne=M=>{c(z=>z.filter((se,L)=>L!==M))},U=p.useCallback(M=>{var z;(z=_.current)==null||z.call(_,M),m(Cc)},[]),Y=async()=>{if(!(!Q||d)){u(!0);try{const M=W!=null&&W.isEmpty?"":(W==null?void 0:W.getHTML())??"",z=[];M&&new DOMParser().parseFromString(M,"text/html").querySelectorAll("[data-type='mention']").forEach(Me=>{const ae=Me.getAttribute("data-id");ae&&!z.includes(ae)&&z.push(ae)});const se=z.length>0?{mentioned_user_ids:z}:void 0,q=(await y.mutateAsync({body:M||" ",metadata:se})).comment.id;for(const de of l)await w.mutateAsync({file:de,commentId:q});W==null||W.commands.clearContent(),o(!0),c([]),F.success("Comment added"),s==null||s()}catch{F.error("Failed to add comment")}finally{u(!1)}}};g.current=Y;const Z="h-3 w-3",G=p.useMemo(()=>{if(!f.rect||!x.current)return{bottom:"105%",left:0};const M=x.current.getBoundingClientRect(),z=Math.max(0,f.rect.left-M.left);return{top:f.rect.bottom-M.top+4,left:z}},[f.rect]);return a.jsxs("div",{className:I("flex gap-3 items-start",n),children:[a.jsx($t,{className:"h-7 w-7 shrink-0 mt-1",children:a.jsx(zt,{className:I("text-[11px] font-semibold",D.bg,D.text),children:$})}),a.jsxs("div",{className:"flex-1 min-w-0 relative",ref:x,children:[a.jsxs("div",{className:I("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[W&&a.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border/70 bg-muted/30",children:[a.jsx(xs,{title:"Bold (⌘B)",active:W.isActive("bold"),onClick:()=>W.chain().focus().toggleBold().run(),children:a.jsx(o1,{className:Z})}),a.jsx(xs,{title:"Italic (⌘I)",active:W.isActive("italic"),onClick:()=>W.chain().focus().toggleItalic().run(),children:a.jsx(p1,{className:Z})}),a.jsx(xs,{title:"Strikethrough",active:W.isActive("strike"),onClick:()=>W.chain().focus().toggleStrike().run(),children:a.jsx(w1,{className:Z})}),a.jsx(xs,{title:"Inline code",active:W.isActive("code"),onClick:()=>W.chain().focus().toggleCode().run(),children:a.jsx(f1,{className:Z})}),a.jsx(ry,{}),a.jsx(xs,{title:"Bullet list",active:W.isActive("bulletList"),onClick:()=>W.chain().focus().toggleBulletList().run(),children:a.jsx(x1,{className:Z})}),a.jsx(xs,{title:"Ordered list",active:W.isActive("orderedList"),onClick:()=>W.chain().focus().toggleOrderedList().run(),children:a.jsx(g1,{className:Z})}),a.jsx(ry,{}),a.jsx(xs,{title:"Code block",active:W.isActive("codeBlock"),onClick:()=>W.chain().focus().toggleCodeBlock().run(),children:a.jsx(u1,{className:Z})})]}),a.jsx(Uj,{editor:W,className:I("px-3 py-2.5 text-sm",r?"min-h-[68px]":"min-h-[80px]")})]}),l.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:l.map((M,z)=>a.jsxs("span",{className:"inline-flex items-center gap-1 pl-1.5 pr-1 py-0.5 rounded-md bg-muted border border-border text-[11px] text-foreground max-w-[180px]",children:[a.jsx(dg,{mimeType:M.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:M.name}),a.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",Hu(M.size),")"]}),a.jsx("button",{type:"button",onClick:()=>ne(z),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:a.jsx(et,{className:"h-3 w-3"})})]},z))}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var M;return(M=h.current)==null?void 0:M.click()},disabled:d,title:"Attach files",children:a.jsx($p,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/50 hidden sm:block",children:[a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})]}),a.jsx(J,{size:"icon",className:"h-8 w-8",onClick:Y,disabled:!Q||d,children:a.jsx(UE,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{ref:h,type:"file",multiple:!0,className:"hidden",onChange:M=>{const z=Array.from(M.target.files??[]);z.length>0&&ie(z),M.target.value=""}}),f.active&&f.items.length>0&&a.jsx("div",{className:"absolute z-[9999]",style:G,children:a.jsx(GR,{items:f.items,selectedIndex:f.selectedIndex,onSelect:U})})]})]})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:QN,setPrototypeOf:ny,isFrozen:VR,getPrototypeOf:XR,getOwnPropertyDescriptor:QR}=Object;let{freeze:br,seal:sn,create:fh}=Object,{apply:mh,construct:hh}=typeof Reflect<"u"&&Reflect;br||(br=function(t){return t});sn||(sn=function(t){return t});mh||(mh=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(r,s)});hh||(hh=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return new t(...n)});const _c=wr(Array.prototype.forEach),ZR=wr(Array.prototype.lastIndexOf),ay=wr(Array.prototype.pop),Eo=wr(Array.prototype.push),JR=wr(Array.prototype.splice),Zc=wr(String.prototype.toLowerCase),ym=wr(String.prototype.toString),bm=wr(String.prototype.match),Do=wr(String.prototype.replace),e$=wr(String.prototype.indexOf),t$=wr(String.prototype.trim),hn=wr(Object.prototype.hasOwnProperty),hr=wr(RegExp.prototype.test),To=r$(TypeError);function wr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return mh(e,t,n)}}function r$(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return hh(e,r)}}function $e(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zc;ny&&ny(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=r(s);i!==s&&(VR(t)||(t[n]=i),s=i)}e[s]=!0}return e}function n$(e){for(let t=0;t<e.length;t++)hn(e,t)||(e[t]=null);return e}function Tn(e){const t=fh(null);for(const[r,n]of QN(e))hn(e,r)&&(Array.isArray(n)?t[r]=n$(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Tn(n):t[r]=n);return t}function Io(e,t){for(;e!==null;){const n=QR(e,t);if(n){if(n.get)return wr(n.get);if(typeof n.value=="function")return wr(n.value)}e=XR(e)}function r(){return null}return r}const sy=br(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wm=br(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),jm=br(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),a$=br(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Nm=br(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),s$=br(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),iy=br(["#text"]),oy=br(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),km=br(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ly=br(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Oc=br(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),i$=sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),o$=sn(/<%[\w\W]*|[\w\W]*%>/gm),l$=sn(/\$\{[\w\W]*/gm),c$=sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),d$=sn(/^aria-[\-\w]+$/),ZN=sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),u$=sn(/^(?:\w+script|data):/i),f$=sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),JN=sn(/^html$/i),m$=sn(/^[a-z][.\w]*(-[.\w]+)+$/i);var cy=Object.freeze({__proto__:null,ARIA_ATTR:d$,ATTR_WHITESPACE:f$,CUSTOM_ELEMENT:m$,DATA_ATTR:c$,DOCTYPE_NAME:JN,ERB_EXPR:o$,IS_ALLOWED_URI:ZN,IS_SCRIPT_OR_DATA:u$,MUSTACHE_EXPR:i$,TMPLIT_EXPR:l$});const Ro={element:1,text:3,progressingInstruction:7,comment:8,document:9},h$=function(){return typeof window>"u"?null:window},p$=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(n=r.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},dy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ek(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h$();const t=ke=>ek(ke);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Ro.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:h}=e,g=c.prototype,x=Io(g,"cloneNode"),v=Io(g,"remove"),y=Io(g,"nextSibling"),w=Io(g,"childNodes"),j=Io(g,"parentNode");if(typeof o=="function"){const ke=r.createElement("template");ke.content&&ke.content.ownerDocument&&(r=ke.content.ownerDocument)}let N,k="";const{implementation:b,createNodeIterator:S,createDocumentFragment:_,getElementsByTagName:C}=r,{importNode:E}=n;let P=dy();t.isSupported=typeof QN=="function"&&typeof j=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:$,TMPLIT_EXPR:D,DATA_ATTR:B,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:K}=cy;let{IS_ALLOWED_URI:ie}=cy,ne=null;const U=$e({},[...sy,...wm,...jm,...Nm,...iy]);let Y=null;const Z=$e({},[...oy,...km,...ly,...Oc]);let G=Object.seal(fh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),M=null,z=null;const se=Object.seal(fh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let L=!0,q=!0,de=!1,X=!0,Me=!1,ae=!0,Ce=!1,_e=!1,Pe=!1,De=!1,V=!1,Oe=!1,Te=!0,xt=!1;const Ge="user-content-";let Ot=!0,Sr=!1,ut={},jt=null;const Xr=$e({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let za=null;const Qr=$e({},["audio","video","img","source","image","track"]);let Qn=null;const zr=$e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lr="http://www.w3.org/1998/Math/MathML",fr="http://www.w3.org/2000/svg",sr="http://www.w3.org/1999/xhtml";let Xt=sr,_n=!1,Zn=null;const Ne=$e({},[Lr,fr,sr],ym);let ue=$e({},["mi","mo","mn","ms","mtext"]),pe=$e({},["annotation-xml"]);const ce=$e({},["title","style","font","a","script"]);let me=null;const He=["application/xhtml+xml","text/html"],re="text/html";let be=null,Ee=null;const ft=r.createElement("form"),Qe=function(R){return R instanceof RegExp||R instanceof Function},Ze=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ee&&Ee===R)){if((!R||typeof R!="object")&&(R={}),R=Tn(R),me=He.indexOf(R.PARSER_MEDIA_TYPE)===-1?re:R.PARSER_MEDIA_TYPE,be=me==="application/xhtml+xml"?ym:Zc,ne=hn(R,"ALLOWED_TAGS")?$e({},R.ALLOWED_TAGS,be):U,Y=hn(R,"ALLOWED_ATTR")?$e({},R.ALLOWED_ATTR,be):Z,Zn=hn(R,"ALLOWED_NAMESPACES")?$e({},R.ALLOWED_NAMESPACES,ym):Ne,Qn=hn(R,"ADD_URI_SAFE_ATTR")?$e(Tn(zr),R.ADD_URI_SAFE_ATTR,be):zr,za=hn(R,"ADD_DATA_URI_TAGS")?$e(Tn(Qr),R.ADD_DATA_URI_TAGS,be):Qr,jt=hn(R,"FORBID_CONTENTS")?$e({},R.FORBID_CONTENTS,be):Xr,M=hn(R,"FORBID_TAGS")?$e({},R.FORBID_TAGS,be):Tn({}),z=hn(R,"FORBID_ATTR")?$e({},R.FORBID_ATTR,be):Tn({}),ut=hn(R,"USE_PROFILES")?R.USE_PROFILES:!1,L=R.ALLOW_ARIA_ATTR!==!1,q=R.ALLOW_DATA_ATTR!==!1,de=R.ALLOW_UNKNOWN_PROTOCOLS||!1,X=R.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=R.SAFE_FOR_TEMPLATES||!1,ae=R.SAFE_FOR_XML!==!1,Ce=R.WHOLE_DOCUMENT||!1,De=R.RETURN_DOM||!1,V=R.RETURN_DOM_FRAGMENT||!1,Oe=R.RETURN_TRUSTED_TYPE||!1,Pe=R.FORCE_BODY||!1,Te=R.SANITIZE_DOM!==!1,xt=R.SANITIZE_NAMED_PROPS||!1,Ot=R.KEEP_CONTENT!==!1,Sr=R.IN_PLACE||!1,ie=R.ALLOWED_URI_REGEXP||ZN,Xt=R.NAMESPACE||sr,ue=R.MATHML_TEXT_INTEGRATION_POINTS||ue,pe=R.HTML_INTEGRATION_POINTS||pe,G=R.CUSTOM_ELEMENT_HANDLING||{},R.CUSTOM_ELEMENT_HANDLING&&Qe(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=R.CUSTOM_ELEMENT_HANDLING.tagNameCheck),R.CUSTOM_ELEMENT_HANDLING&&Qe(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),R.CUSTOM_ELEMENT_HANDLING&&typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(q=!1),V&&(De=!0),ut&&(ne=$e({},iy),Y=[],ut.html===!0&&($e(ne,sy),$e(Y,oy)),ut.svg===!0&&($e(ne,wm),$e(Y,km),$e(Y,Oc)),ut.svgFilters===!0&&($e(ne,jm),$e(Y,km),$e(Y,Oc)),ut.mathMl===!0&&($e(ne,Nm),$e(Y,ly),$e(Y,Oc))),R.ADD_TAGS&&(typeof R.ADD_TAGS=="function"?se.tagCheck=R.ADD_TAGS:(ne===U&&(ne=Tn(ne)),$e(ne,R.ADD_TAGS,be))),R.ADD_ATTR&&(typeof R.ADD_ATTR=="function"?se.attributeCheck=R.ADD_ATTR:(Y===Z&&(Y=Tn(Y)),$e(Y,R.ADD_ATTR,be))),R.ADD_URI_SAFE_ATTR&&$e(Qn,R.ADD_URI_SAFE_ATTR,be),R.FORBID_CONTENTS&&(jt===Xr&&(jt=Tn(jt)),$e(jt,R.FORBID_CONTENTS,be)),R.ADD_FORBID_CONTENTS&&(jt===Xr&&(jt=Tn(jt)),$e(jt,R.ADD_FORBID_CONTENTS,be)),Ot&&(ne["#text"]=!0),Ce&&$e(ne,["html","head","body"]),ne.table&&($e(ne,["tbody"]),delete M.tbody),R.TRUSTED_TYPES_POLICY){if(typeof R.TRUSTED_TYPES_POLICY.createHTML!="function")throw To('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof R.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw To('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=R.TRUSTED_TYPES_POLICY,k=N.createHTML("")}else N===void 0&&(N=p$(h,s)),N!==null&&typeof k=="string"&&(k=N.createHTML(""));br&&br(R),Ee=R}},mr=$e({},[...wm,...jm,...a$]),Qt=$e({},[...Nm,...s$]),On=function(R){let oe=j(R);(!oe||!oe.tagName)&&(oe={namespaceURI:Xt,tagName:"template"});const ge=Zc(R.tagName),lt=Zc(oe.tagName);return Zn[R.namespaceURI]?R.namespaceURI===fr?oe.namespaceURI===sr?ge==="svg":oe.namespaceURI===Lr?ge==="svg"&&(lt==="annotation-xml"||ue[lt]):!!mr[ge]:R.namespaceURI===Lr?oe.namespaceURI===sr?ge==="math":oe.namespaceURI===fr?ge==="math"&&pe[lt]:!!Qt[ge]:R.namespaceURI===sr?oe.namespaceURI===fr&&!pe[lt]||oe.namespaceURI===Lr&&!ue[lt]?!1:!Qt[ge]&&(ce[ge]||!mr[ge]):!!(me==="application/xhtml+xml"&&Zn[R.namespaceURI]):!1},Mn=function(R){Eo(t.removed,{element:R});try{j(R).removeChild(R)}catch{v(R)}},hs=function(R,oe){try{Eo(t.removed,{attribute:oe.getAttributeNode(R),from:oe})}catch{Eo(t.removed,{attribute:null,from:oe})}if(oe.removeAttribute(R),R==="is")if(De||V)try{Mn(oe)}catch{}else try{oe.setAttribute(R,"")}catch{}},lv=function(R){let oe=null,ge=null;if(Pe)R="<remove></remove>"+R;else{const Mt=bm(R,/^[\r\n\t ]+/);ge=Mt&&Mt[0]}me==="application/xhtml+xml"&&Xt===sr&&(R='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+R+"</body></html>");const lt=N?N.createHTML(R):R;if(Xt===sr)try{oe=new m().parseFromString(lt,me)}catch{}if(!oe||!oe.documentElement){oe=b.createDocument(Xt,"template",null);try{oe.documentElement.innerHTML=_n?k:lt}catch{}}const ir=oe.body||oe.documentElement;return R&&ge&&ir.insertBefore(r.createTextNode(ge),ir.childNodes[0]||null),Xt===sr?C.call(oe,Ce?"html":"body")[0]:Ce?oe.documentElement:ir},cv=function(R){return S.call(R.ownerDocument||R,R,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Xf=function(R){return R instanceof f&&(typeof R.nodeName!="string"||typeof R.textContent!="string"||typeof R.removeChild!="function"||!(R.attributes instanceof u)||typeof R.removeAttribute!="function"||typeof R.setAttribute!="function"||typeof R.namespaceURI!="string"||typeof R.insertBefore!="function"||typeof R.hasChildNodes!="function")},dv=function(R){return typeof l=="function"&&R instanceof l};function Jn(ke,R,oe){_c(ke,ge=>{ge.call(t,R,oe,Ee)})}const uv=function(R){let oe=null;if(Jn(P.beforeSanitizeElements,R,null),Xf(R))return Mn(R),!0;const ge=be(R.nodeName);if(Jn(P.uponSanitizeElement,R,{tagName:ge,allowedTags:ne}),ae&&R.hasChildNodes()&&!dv(R.firstElementChild)&&hr(/<[/\w!]/g,R.innerHTML)&&hr(/<[/\w!]/g,R.textContent)||R.nodeType===Ro.progressingInstruction||ae&&R.nodeType===Ro.comment&&hr(/<[/\w]/g,R.data))return Mn(R),!0;if(!(se.tagCheck instanceof Function&&se.tagCheck(ge))&&(!ne[ge]||M[ge])){if(!M[ge]&&mv(ge)&&(G.tagNameCheck instanceof RegExp&&hr(G.tagNameCheck,ge)||G.tagNameCheck instanceof Function&&G.tagNameCheck(ge)))return!1;if(Ot&&!jt[ge]){const lt=j(R)||R.parentNode,ir=w(R)||R.childNodes;if(ir&<){const Mt=ir.length;for(let Cr=Mt-1;Cr>=0;--Cr){const ea=x(ir[Cr],!0);ea.__removalCount=(R.__removalCount||0)+1,lt.insertBefore(ea,y(R))}}}return Mn(R),!0}return R instanceof c&&!On(R)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&hr(/<\/no(script|embed|frames)/i,R.innerHTML)?(Mn(R),!0):(Me&&R.nodeType===Ro.text&&(oe=R.textContent,_c([O,$,D],lt=>{oe=Do(oe,lt," ")}),R.textContent!==oe&&(Eo(t.removed,{element:R.cloneNode()}),R.textContent=oe)),Jn(P.afterSanitizeElements,R,null),!1)},fv=function(R,oe,ge){if(Te&&(oe==="id"||oe==="name")&&(ge in r||ge in ft))return!1;if(!(q&&!z[oe]&&hr(B,oe))){if(!(L&&hr(A,oe))){if(!(se.attributeCheck instanceof Function&&se.attributeCheck(oe,R))){if(!Y[oe]||z[oe]){if(!(mv(R)&&(G.tagNameCheck instanceof RegExp&&hr(G.tagNameCheck,R)||G.tagNameCheck instanceof Function&&G.tagNameCheck(R))&&(G.attributeNameCheck instanceof RegExp&&hr(G.attributeNameCheck,oe)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(oe,R))||oe==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&hr(G.tagNameCheck,ge)||G.tagNameCheck instanceof Function&&G.tagNameCheck(ge))))return!1}else if(!Qn[oe]){if(!hr(ie,Do(ge,Q,""))){if(!((oe==="src"||oe==="xlink:href"||oe==="href")&&R!=="script"&&e$(ge,"data:")===0&&za[R])){if(!(de&&!hr(W,Do(ge,Q,"")))){if(ge)return!1}}}}}}}return!0},mv=function(R){return R!=="annotation-xml"&&bm(R,K)},hv=function(R){Jn(P.beforeSanitizeAttributes,R,null);const{attributes:oe}=R;if(!oe||Xf(R))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let lt=oe.length;for(;lt--;){const ir=oe[lt],{name:Mt,namespaceURI:Cr,value:ea}=ir,fi=be(Mt),Qf=ea;let Zt=Mt==="value"?Qf:t$(Qf);if(ge.attrName=fi,ge.attrValue=Zt,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Jn(P.uponSanitizeAttribute,R,ge),Zt=ge.attrValue,xt&&(fi==="id"||fi==="name")&&(hs(Mt,R),Zt=Ge+Zt),ae&&hr(/((--!?|])>)|<\/(style|title|textarea)/i,Zt)){hs(Mt,R);continue}if(fi==="attributename"&&bm(Zt,"href")){hs(Mt,R);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){hs(Mt,R);continue}if(!X&&hr(/\/>/i,Zt)){hs(Mt,R);continue}Me&&_c([O,$,D],gv=>{Zt=Do(Zt,gv," ")});const pv=be(R.nodeName);if(!fv(pv,fi,Zt)){hs(Mt,R);continue}if(N&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Cr)switch(h.getAttributeType(pv,fi)){case"TrustedHTML":{Zt=N.createHTML(Zt);break}case"TrustedScriptURL":{Zt=N.createScriptURL(Zt);break}}if(Zt!==Qf)try{Cr?R.setAttributeNS(Cr,Mt,Zt):R.setAttribute(Mt,Zt),Xf(R)?Mn(R):ay(t.removed)}catch{hs(Mt,R)}}Jn(P.afterSanitizeAttributes,R,null)},DM=function ke(R){let oe=null;const ge=cv(R);for(Jn(P.beforeSanitizeShadowDOM,R,null);oe=ge.nextNode();)Jn(P.uponSanitizeShadowNode,oe,null),uv(oe),hv(oe),oe.content instanceof i&&ke(oe.content);Jn(P.afterSanitizeShadowDOM,R,null)};return t.sanitize=function(ke){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,ge=null,lt=null,ir=null;if(_n=!ke,_n&&(ke="<!-->"),typeof ke!="string"&&!dv(ke))if(typeof ke.toString=="function"){if(ke=ke.toString(),typeof ke!="string")throw To("dirty is not a string, aborting")}else throw To("toString is not a function");if(!t.isSupported)return ke;if(_e||Ze(R),t.removed=[],typeof ke=="string"&&(Sr=!1),Sr){if(ke.nodeName){const ea=be(ke.nodeName);if(!ne[ea]||M[ea])throw To("root node is forbidden and cannot be sanitized in-place")}}else if(ke instanceof l)oe=lv("<!---->"),ge=oe.ownerDocument.importNode(ke,!0),ge.nodeType===Ro.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?oe=ge:oe.appendChild(ge);else{if(!De&&!Me&&!Ce&&ke.indexOf("<")===-1)return N&&Oe?N.createHTML(ke):ke;if(oe=lv(ke),!oe)return De?null:Oe?k:""}oe&&Pe&&Mn(oe.firstChild);const Mt=cv(Sr?ke:oe);for(;lt=Mt.nextNode();)uv(lt),hv(lt),lt.content instanceof i&&DM(lt.content);if(Sr)return ke;if(De){if(V)for(ir=_.call(oe.ownerDocument);oe.firstChild;)ir.appendChild(oe.firstChild);else ir=oe;return(Y.shadowroot||Y.shadowrootmode)&&(ir=E.call(n,ir,!0)),ir}let Cr=Ce?oe.outerHTML:oe.innerHTML;return Ce&&ne["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&hr(JN,oe.ownerDocument.doctype.name)&&(Cr="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
|
|
536
|
+
`+Cr),Me&&_c([O,$,D],ea=>{Cr=Do(Cr,ea," ")}),N&&Oe?N.createHTML(Cr):Cr},t.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ze(ke),_e=!0},t.clearConfig=function(){Ee=null,_e=!1},t.isValidAttribute=function(ke,R,oe){Ee||Ze({});const ge=be(ke),lt=be(R);return fv(ge,lt,oe)},t.addHook=function(ke,R){typeof R=="function"&&Eo(P[ke],R)},t.removeHook=function(ke,R){if(R!==void 0){const oe=ZR(P[ke],R);return oe===-1?void 0:JR(P[ke],oe,1)[0]}return ay(P[ke])},t.removeHooks=function(ke){P[ke]=[]},t.removeAllHooks=function(){P=dy()},t}var g$=ek();function x$({onClick:e,active:t,disabled:r,title:n,children:s}){return a.jsx("button",{type:"button",title:n,disabled:r,onMouseDown:i=>{i.preventDefault(),e()},className:I("flex h-[26px] w-[26px] items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted","disabled:opacity-30 disabled:cursor-not-allowed",t&&"bg-muted text-foreground"),children:s})}function Mc(){return a.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function ug({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:s,editorClassName:i}){const o=Lj({extensions:[Fj.configure({heading:{levels:[1,2,3]}}),Bj,qP,HP.configure({nested:!0}),Wj.configure({placeholder:r})],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:d}){t&&t(d.isEmpty?"":d.getHTML())}});if(!o)return null;const l=(d,u,f,m,h)=>a.jsx(x$,{title:d,onClick:f,active:m,disabled:h,children:u},d),c="h-3.5 w-3.5";return a.jsxs("div",{className:I("flex flex-col overflow-hidden",n),children:[a.jsxs("div",{className:I("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",s),children:[l("Undo",a.jsx(eD,{className:c}),()=>o.chain().focus().undo().run(),!1,!o.can().undo()),l("Redo",a.jsx(WE,{className:c}),()=>o.chain().focus().redo().run(),!1,!o.can().redo()),a.jsx(Mc,{}),l("Bold (⌘B)",a.jsx(o1,{className:c}),()=>o.chain().focus().toggleBold().run(),o.isActive("bold")),l("Italic (⌘I)",a.jsx(p1,{className:c}),()=>o.chain().focus().toggleItalic().run(),o.isActive("italic")),l("Underline (⌘U)",a.jsx(JE,{className:c}),()=>o.chain().focus().toggleUnderline().run(),o.isActive("underline")),l("Strikethrough",a.jsx(w1,{className:c}),()=>o.chain().focus().toggleStrike().run(),o.isActive("strike")),l("Inline code",a.jsx(f1,{className:c}),()=>o.chain().focus().toggleCode().run(),o.isActive("code")),a.jsx(Mc,{}),l("Heading 1",a.jsx(EE,{className:c}),()=>o.chain().focus().toggleHeading({level:1}).run(),o.isActive("heading",{level:1})),l("Heading 2",a.jsx(DE,{className:c}),()=>o.chain().focus().toggleHeading({level:2}).run(),o.isActive("heading",{level:2})),l("Heading 3",a.jsx(TE,{className:c}),()=>o.chain().focus().toggleHeading({level:3}).run(),o.isActive("heading",{level:3})),a.jsx(Mc,{}),l("Bullet list",a.jsx(x1,{className:c}),()=>o.chain().focus().toggleBulletList().run(),o.isActive("bulletList")),l("Ordered list",a.jsx(g1,{className:c}),()=>o.chain().focus().toggleOrderedList().run(),o.isActive("orderedList")),l("Task list",a.jsx(RE,{className:c}),()=>o.chain().focus().toggleTaskList().run(),o.isActive("taskList")),a.jsx(Mc,{}),l("Blockquote",a.jsx(BE,{className:c}),()=>o.chain().focus().toggleBlockquote().run(),o.isActive("blockquote")),l("Code block",a.jsx(u1,{className:c}),()=>o.chain().focus().toggleCodeBlock().run(),o.isActive("codeBlock")),l("Divider line",a.jsx(eo,{className:c}),()=>o.chain().focus().setHorizontalRule().run())]}),a.jsx(Uj,{editor:o,className:I("flex-1 px-5 py-4",i)})]})}function fg({html:e,className:t}){return e?a.jsx("div",{className:I("meridian-editor",t),dangerouslySetInnerHTML:{__html:g$.sanitize(e,{ADD_ATTR:["data-type","data-id","data-label"]})}}):null}const uy=[{bg:"bg-indigo-100 dark:bg-indigo-900/50",text:"text-indigo-700 dark:text-indigo-300"},{bg:"bg-violet-100 dark:bg-violet-900/50",text:"text-violet-700 dark:text-violet-300"},{bg:"bg-emerald-100 dark:bg-emerald-900/50",text:"text-emerald-700 dark:text-emerald-300"},{bg:"bg-amber-100 dark:bg-amber-900/50",text:"text-amber-700 dark:text-amber-300"},{bg:"bg-rose-100 dark:bg-rose-900/50",text:"text-rose-700 dark:text-rose-300"},{bg:"bg-sky-100 dark:bg-sky-900/50",text:"text-sky-700 dark:text-sky-300"},{bg:"bg-teal-100 dark:bg-teal-900/50",text:"text-teal-700 dark:text-teal-300"},{bg:"bg-orange-100 dark:bg-orange-900/50",text:"text-orange-700 dark:text-orange-300"}];function mg(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return uy[t%uy.length]}function v$({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?a.jsx(fg,{html:t,className:"text-xs"}):a.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const fy={created:{icon:st,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:Pp,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:to,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:j1,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:zs,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function y$(e,t){var s,i,o,l;const{action:r,changes:n}=e;if(r==="created")return"created this issue";if(r==="status_changed"){const c=(s=n==null?void 0:n.status)==null?void 0:s.from,d=(i=n==null?void 0:n.status)==null?void 0:i.to;return a.jsxs(a.Fragment,{children:["changed status",c&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:Ws[c]??c})]}),d&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:Ws[d]??d})]})]})}if(r==="assigned"||r==="unassigned"){const c=((o=n==null?void 0:n.assignee_ids)==null?void 0:o.to)??[],d=((l=n==null?void 0:n.assignee_ids)==null?void 0:l.from)??[],u=c.filter(h=>!d.includes(h)),f=d.filter(h=>!c.includes(h)),m=h=>{var g;return((g=t==null?void 0:t.get(h))==null?void 0:g.name)??h.slice(0,8)+"…"};return u.length>0&&f.length>0?a.jsx(a.Fragment,{children:"updated assignees"}):u.length>0?a.jsxs(a.Fragment,{children:["assigned ",a.jsx("strong",{className:"font-medium text-foreground",children:u.map(m).join(", ")})]}):f.length>0?a.jsxs(a.Fragment,{children:["unassigned ",a.jsx("strong",{className:"font-medium text-foreground",children:f.map(m).join(", ")})]}):"updated assignees"}if(r==="updated"&&n){const c=[];for(const[d,u]of Object.entries(n)){const{from:f,to:m}=u;d==="title"||d==="description"?c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d})]},d)):d==="priority"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"priority"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:wn[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:wn[m]??String(m)})]})]},d)):d==="type"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"type"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:rs[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:rs[m]??String(m)})]})]},d)):c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d.replace(/_/g," ")})]},d))}return c.length===0?"made changes":a.jsx(a.Fragment,{children:c.reduce((d,u,f)=>f===0?[u]:[...d,a.jsx("span",{children:" and "},`sep-${f}`),u],[])})}return r.replace(/_/g," ")}function tk({issueId:e,projectId:t,className:r,compact:n,onViewMore:s,onTabChange:i,hideCommentInput:o}){const[l,c]=p.useState("comments"),d=w=>{c(w),i==null||i(w)},{user:u}=Ie(),{data:f}=oi(),{data:m,isLoading:h}=gE(e),{data:g,isLoading:x}=xE(e),{data:v}=KN(e),y=w=>{var j;if(u&&w===u.id){const N=u.first_name??"",k=u.last_name??"",b=`${N} ${k}`.trim()||u.email,S=(N[0]??k[0]??((j=u.email)==null?void 0:j[0])??"U").toUpperCase();return{name:b,initials:S}}return(f==null?void 0:f.get(w))??{name:"Unknown",initials:"?"}};return a.jsxs("div",{className:r,children:[a.jsx("div",{className:"flex items-center gap-0 px-6 pt-3 border-b border-zinc-100 dark:border-zinc-800",children:["comments","activity","attachments","time"].map(w=>{const j=w==="comments"?(m==null?void 0:m.length)??0:w==="activity"?(g==null?void 0:g.length)??0:void 0,N=w==="comments"?"Comments":w==="activity"?"Activity":w==="attachments"?"Attachments":"Time",k=l===w;return a.jsxs("button",{onClick:()=>d(w),className:I("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",k?"text-indigo-700 dark:text-indigo-300 border-indigo-500 dark:border-indigo-400":"border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[N,j!=null&&j>0&&a.jsx("span",{className:I("ml-1.5 text-[10px] tabular-nums font-normal",k?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:j})]},w)})}),l==="comments"&&a.jsxs("div",{className:"px-6 pb-5 pt-4",children:[a.jsx("div",{className:"space-y-5 mb-5",children:h?a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsx(le,{className:"h-16 flex-1"})]}):m&&m.length>0?(n?m.slice(-5):m).map(w=>{const j=y(w.author_id),N=mg(j.name),k=(v??[]).filter(b=>b.comment_id===w.id);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx($t,{className:"h-7 w-7 mt-0.5 shrink-0",children:a.jsx(zt,{className:I("text-[11px] font-semibold",N.bg,N.text),children:j.initials})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-zinc-900 dark:text-zinc-100",children:j.name}),a.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:fe(new Date(w.created_at),"MMM d, h:mm a")})]}),a.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900 border border-zinc-100 dark:border-zinc-800 px-3 py-2.5",children:a.jsx(v$,{body:w.body})}),k.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:k.map(b=>a.jsx(_R,{attachment:b},b.id))})]})]},w.id)}):a.jsxs("div",{className:"flex flex-col items-center py-6 gap-2",children:[a.jsx("div",{className:"h-9 w-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:a.jsx(v1,{className:"h-4 w-4 text-zinc-400 dark:text-zinc-500"})}),a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"})]})}),n&&m&&m.length>5&&s&&a.jsxs("button",{onClick:s,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mb-4 font-medium transition-colors",children:["View all ",m.length," comments →"]}),!o&&a.jsx(XN,{issueId:e,projectId:t})]}),l==="activity"&&a.jsx("div",{className:"px-6 pb-6 pt-4",children:x?a.jsx("div",{className:"space-y-4",children:[1,2,3].map(w=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),a.jsx(le,{className:"h-4 flex-1 mt-1"})]},w))}):g&&g.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-zinc-100 dark:bg-zinc-800"}),a.jsx("div",{className:"space-y-0",children:(n?g.slice(-5):g).map((w,j,N)=>{var C;const k=fy[w.action]??fy.updated,b=k.icon,S=((C=f==null?void 0:f.get(w.actor_id))==null?void 0:C.name)??"System",_=j===N.length-1;return a.jsxs("div",{className:I("relative flex gap-3",_?"pb-0":"pb-4"),children:[a.jsx("div",{className:I("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",k.bg),children:a.jsx(b,{className:I("h-3 w-3",k.color)})}),a.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[a.jsxs("p",{className:"text-xs text-foreground leading-relaxed",children:[a.jsx("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:S})," ",a.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:y$(w,f)})]}),a.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:fe(new Date(w.created_at),"MMM d, yyyy · h:mm a")})]})]},w.id)})})]}),n&&g.length>5&&s&&a.jsxs("button",{onClick:s,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mt-3 font-medium transition-colors",children:["View all ",g.length," events →"]})]}):a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),l==="attachments"&&a.jsx(PR,{issueId:e}),l==="time"&&a.jsx(BR,{issueId:e})]})}const rk=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Pj,{ref:n,className:I("relative overflow-hidden",e),...r,children:[a.jsx(cP,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(nk,{}),a.jsx(dP,{})]}));rk.displayName=Pj.displayName;const nk=p.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Aj,{ref:n,orientation:t,className:I("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(uP,{className:"relative flex-1 rounded-full bg-border"})}));nk.displayName=Aj.displayName;function b$(e,t){let r=0,n=e;for(;n!=null&&n.parent_id;)n=t.find(s=>s.id===n.parent_id),r++;return r}function w$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const j$={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function N$(e,t){return e==="completed"?"bg-emerald-500":e==="in_progress"?"bg-indigo-500":e==="cancelled"?"bg-red-400":t!=null&&t.includes("block")?"bg-red-500":"bg-zinc-400"}const Pn=({children:e})=>a.jsx("p",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100 mb-1.5",children:e}),$o=()=>a.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function ak({issue:e,projectId:t,open:r,onClose:n}){const s=Ct(),{workspace:i,projectKey:o}=Ht(),{data:l}=a1((e==null?void 0:e.id)??""),c=l??e,[d,u]=p.useState(!1),[f,m]=p.useState(""),[h,g]=p.useState(""),[x,v]=p.useState("comments"),[y,w]=p.useState(!1),[j,N]=p.useState(new Set),k=gu((c==null?void 0:c.id)??"",t),{data:b}=Gn(t),S=p.useMemo(()=>b?b.members.filter(V=>V.user).map(V=>V.user):void 0,[b]),{data:_}=lo(t),{data:C}=co(t||void 0),{data:E}=Gl(t||void 0),{data:P}=Al(t||void 0),{data:O}=tg(),{data:$=[]}=rg(new Date().getFullYear()),D=(C??[]).filter(V=>V.status!=="completed"),{data:B}=_I(),A=(B==null?void 0:B.maxChildIssueDepth)??1,Q=(c?b$(c,P??[]):0)<A,K=c!=null&&c.parent_id?P==null?void 0:P.find(V=>V.id===c.parent_id):null,ie=(P==null?void 0:P.filter(V=>V.parent_id===(c==null?void 0:c.id)))??[],ne=c!=null&&c.task_list_id?E==null?void 0:E.find(V=>V.id===c.task_list_id):null,U=_&&_.length>0?Object.fromEntries(_.map(V=>[V.key,V.name])):Ws;if(p.useEffect(()=>{c&&(m(c.title),g(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const Y=()=>{f.trim()&&k.mutate({title:f.trim(),description:h.trim()||void 0},{onSuccess:()=>{u(!1),F.success("Issue updated")},onError:()=>F.error("Failed to update issue")})},Z=()=>{m(c.title),g(c.description??""),u(!1)},G=V=>{k.mutate({status:V},{onSuccess:()=>F.success("Status updated"),onError:()=>F.error("Failed to update status")})},M=V=>{k.mutate({priority:V},{onSuccess:()=>F.success("Priority updated"),onError:()=>F.error("Failed to update priority")})},z=V=>{k.mutate({type:V},{onSuccess:()=>F.success("Type updated"),onError:()=>F.error("Failed to update type")})},se=V=>{k.mutate({assignee_ids:V},{onSuccess:()=>F.success("Assignees updated"),onError:()=>F.error("Failed to update assignees")})},L=V=>{k.mutate({sprint_id:V},{onSuccess:()=>F.success(V?"Sprint assigned":"Removed from sprint"),onError:()=>F.error("Failed to update sprint")})},q=V=>{k.mutate({task_list_id:V},{onSuccess:()=>F.success(V?"Moved to list":"Removed from list"),onError:()=>F.error("Failed to update list")})},de=V=>{k.mutate({start_date:V?fe(V,"yyyy-MM-dd"):null},{onSuccess:()=>F.success(V?"Start date set":"Start date cleared"),onError:()=>F.error("Failed to update start date")})},X=V=>{k.mutate({due_date:V?fe(V,"yyyy-MM-dd"):null},{onSuccess:()=>F.success(V?"Due date set":"Due date cleared"),onError:()=>F.error("Failed to update due date")})},Me=V=>{if(V){const Oe=c.start_date?new Date(c.start_date):new Date,Te=new Date(Oe);Te.setDate(Te.getDate()+7),k.mutate({recurrence_frequency:"weekly",next_occurrence_date:fe(Te,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>F.success("Recurrence enabled"),onError:()=>F.error("Failed to enable recurrence")})}else k.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>F.success("Recurrence stopped"),onError:()=>F.error("Failed to stop recurrence")})},ae=V=>{const Oe=c.start_date?new Date(c.start_date):new Date,Te=new Date(Oe);V==="weekly"?Te.setDate(Te.getDate()+7):Te.setMonth(Te.getMonth()+1),k.mutate({recurrence_frequency:V,next_occurrence_date:fe(Te,"yyyy-MM-dd")},{onSuccess:()=>F.success("Frequency updated"),onError:()=>F.error("Failed to update frequency")})},Ce=V=>{k.mutate({recurrence_end_date:V?fe(V,"yyyy-MM-dd"):null},{onSuccess:()=>F.success(V?"End date set":"End date cleared"),onError:()=>F.error("Failed to update end date")})},_e=_==null?void 0:_.find(V=>V.category==="completed"),Pe=!!_e&&c.status===_e.key,De=(V,Oe,Te)=>{const xt=V;return a.jsx("button",{title:Oe,onClick:Te,className:"h-8 w-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(xt,{className:"h-4 w-4"})},Oe)};return a.jsxs(a.Fragment,{children:[a.jsx(si,{open:r,onOpenChange:V=>!V&&n(),children:a.jsxs(ii,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden bg-white dark:bg-zinc-950",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[a.jsxs("button",{onClick:()=>{var V;_e&&G(Pe?((V=_==null?void 0:_.find(Oe=>Oe.category==="unstarted"||Oe.category==="backlog"))==null?void 0:V.key)??c.status:_e.key)},className:I("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",Pe?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/30":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/40"),children:[a.jsx(rr,{className:"h-3.5 w-3.5"}),Pe?"Completed":"Mark complete"]}),a.jsxs("div",{className:"flex items-center",children:[De(XE,"Upvote"),De($p,"Attachments"),Q&&De(ma,"Add sub-issue",()=>w(!0)),De(Rl,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),F.success("Link copied")}),De($E,"Open full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}),d?a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:Z,children:"Cancel"}),a.jsxs(J,{size:"sm",className:"h-7 text-xs",onClick:Y,disabled:!f.trim()||k.isPending,children:[a.jsx(rr,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:De(is,"More options")}),a.jsx(Tr,{align:"end",className:"w-40",children:a.jsxs(pt,{onClick:()=>u(!0),children:[a.jsx(zs,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),De(FE,"Open in full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)})]})]}),a.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?a.jsx(Ae,{value:f,onChange:V=>m(V.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[a.jsx("span",{className:"text-[11px] font-mono font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/60 px-1.5 py-0.5 rounded",children:c.identifier}),a.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase text-violet-500 dark:text-violet-400",children:rs[c.type]??c.type}),c.recurrence_frequency&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/50 border border-emerald-200 dark:border-emerald-800 px-1.5 py-0.5 rounded",children:[a.jsx(nl,{className:"h-2.5 w-2.5"}),"Repeats ",c.recurrence_frequency==="weekly"?"Weekly":"Monthly"]}),c.recurrence_source_id&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded",children:[a.jsx(nl,{className:"h-2.5 w-2.5"}),"Recurring instance"]})]}),a.jsx("h2",{className:"text-[17px] font-semibold leading-snug text-zinc-900 dark:text-zinc-50",children:c.title})]})}),a.jsxs(rk,{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[a.jsx(yr,{zone:"issue.details.before",props:{issue:c}}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(Pn,{children:"Status"}),a.jsxs(Fe,{value:c.status,onValueChange:G,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(U).map(([V,Oe])=>{const Te=_==null?void 0:_.find(xt=>xt.key===V);return a.jsx(xe,{value:V,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:I("h-2 w-2 rounded-full shrink-0 flex-none",N$(Te==null?void 0:Te.category,V))}),a.jsx("span",{children:Oe})]})},V)})})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Pn,{children:"Priority"}),a.jsxs(Fe,{value:c.priority,onValueChange:M,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(wn).map(([V,Oe])=>a.jsx(xe,{value:V,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:I("h-2 w-2 rounded-full shrink-0 flex-none",j$[V]??"bg-zinc-400")}),a.jsx("span",{children:Oe})]})},V))})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Pn,{children:"Type"}),a.jsxs(Fe,{value:c.type,onValueChange:z,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(qe,{})}),a.jsx(Le,{children:Object.entries(rs).map(([V,Oe])=>a.jsx(xe,{value:V,className:"text-xs",children:Oe},V))})]})]})]}),a.jsx($o,{}),a.jsxs("div",{children:[a.jsx(Pn,{children:"Assignees"}),a.jsx(Vl,{value:c.assignee_ids??[],onChange:se,disabled:k.isPending,users:S})]}),a.jsx($o,{}),a.jsxs("div",{className:"flex gap-3 items-start min-w-0",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Pn,{children:"Sprint"}),a.jsxs(Fe,{value:c.sprint_id??"none",onValueChange:V=>L(V==="none"?null:V),children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(qe,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),D.map(V=>{const Oe=w$(V);return a.jsx(xe,{value:V.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:V.name}),Oe&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:Oe})]})},V.id)})]})]})]}),(E??[]).length>0&&a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Pn,{children:"List"}),a.jsxs(Fe,{value:c.task_list_id??"none",onValueChange:V=>q(V==="none"?null:V),children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Rp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(qe,{placeholder:"No list",children:ne?ne.name:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(E??[]).map(V=>a.jsx(xe,{value:V.id,className:"text-xs",children:V.name},V.id))]})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Pn,{children:"Start Date"}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.start_date?"text-foreground":"text-muted-foreground"}`,children:c.start_date?fe(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",children:[a.jsx(ur,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:de,initialFocus:!0}),c.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>de(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(O==null?void 0:O.working_days)&&(()=>{const V=yN(new Date(c.start_date),new Date(c.due_date),O.working_days,$);return a.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[V," biz day",V!==1?"s":""]})})(),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Pn,{children:"Due Date"}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.due_date?"text-foreground":"text-muted-foreground"}`,children:c.due_date?fe(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",children:[a.jsx(ur,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:X,initialFocus:!0}),c.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>X(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),a.jsx($o,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pn,{children:"Recurring"}),a.jsx(uo,{checked:!!c.recurrence_frequency,onCheckedChange:Me,disabled:k.isPending})]}),c.recurrence_frequency&&a.jsxs("div",{className:"space-y-2 pl-3 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:"Frequency"}),a.jsxs(Fe,{value:c.recurrence_frequency,onValueChange:V=>ae(V),children:[a.jsx(ze,{className:"h-7 text-xs",children:a.jsx(qe,{})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(xe,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:["Until ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-7 w-full px-2 rounded border border-input text-xs hover:bg-accent transition-colors text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:c.recurrence_end_date?"text-foreground":"text-muted-foreground",children:c.recurrence_end_date?fe(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",children:[a.jsx(ur,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:Ce,initialFocus:!0}),c.recurrence_end_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>Ce(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),a.jsx($o,{}),Q&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100",children:"Child Issues"}),a.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded-md bg-indigo-50 dark:bg-indigo-950/50 text-indigo-700 dark:text-indigo-300 text-[11px] font-medium hover:bg-indigo-100 dark:hover:bg-indigo-900/60 transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Add"]})]}),K&&a.jsxs("button",{onClick:()=>s(`/${i}/projects/${o}/issues/${K.id}`),className:"flex items-center gap-2 w-full px-3 py-1.5 rounded-md bg-zinc-100 dark:bg-zinc-800/60 border border-zinc-200 dark:border-zinc-700 hover:border-indigo-300 dark:hover:border-indigo-700 transition-colors text-left",children:[a.jsx(Ap,{className:"h-3.5 w-3.5 text-zinc-400 shrink-0"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-400 shrink-0",children:"Parent:"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:K.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:K.title})]}),ie.length===0?a.jsxs("button",{onClick:()=>w(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Create child issue"]}):a.jsx("div",{className:"space-y-1",children:ie.map(V=>{const Oe=(P??[]).filter(Ge=>Ge.parent_id===V.id),Te=Oe.length>0,xt=j.has(V.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/40 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all group",children:[Te?a.jsx("button",{onClick:()=>N(Ge=>{const Ot=new Set(Ge);return Ot.has(V.id)?Ot.delete(V.id):Ot.add(V.id),Ot}),className:"shrink-0 text-indigo-400 dark:text-indigo-500 hover:text-indigo-600 dark:hover:text-indigo-300 transition-colors",children:xt?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})}):a.jsx(yn,{className:"h-3.5 w-3.5 text-indigo-400 dark:text-indigo-500 shrink-0"}),a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${V.id}`)},className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:V.identifier}),a.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:V.title}),Te&&a.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),Oe.length]})]})]}),Te&&xt&&a.jsx("div",{className:"mt-1 ml-6 space-y-1",children:Oe.map(Ge=>a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${Ge.id}`)},className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/20 dark:bg-indigo-950/20 border border-indigo-100 dark:border-indigo-900 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all text-left group",children:[a.jsx(yn,{className:"h-3.5 w-3.5 text-indigo-300 dark:text-indigo-600 shrink-0"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-600 dark:text-indigo-400 shrink-0",children:Ge.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-400 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:Ge.title})]},Ge.id))})]},V.id)})})]}),a.jsx($o,{}),a.jsxs("div",{children:[a.jsx(Pn,{children:"Description"}),d?a.jsx(ug,{content:h,onChange:g,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input"},`${c.id}-edit`):c.description?a.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900/60 border border-zinc-100 dark:border-zinc-800 px-3.5 py-3",children:a.jsx(fg,{html:c.description,className:"text-sm"})}):a.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(zs,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),a.jsx("div",{className:"px-6 py-4",children:a.jsx(yr,{zone:"issue.details.after",props:{issue:c}})}),a.jsx(tk,{issueId:c.id,projectId:t,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:v,onViewMore:()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}})]}),x==="comments"&&a.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:a.jsx(XN,{issueId:c.id,projectId:t,compact:!0})})]})}),a.jsx(Uu,{open:y,onClose:()=>w(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function k$(){const{projectKey:e}=Ht(),[t,r]=p.useState(null),[n,s]=p.useState(!1),[i,o]=p.useState({}),{data:l}=Ca(e??""),c=(l==null?void 0:l.id)??"",{data:d,isLoading:u}=Al(c||void 0,i),{data:f,isLoading:m}=lo(c||void 0),{data:h}=Gn(c),{data:g}=oi(),x=sI(c);if(!e)return null;const v=u||m||!l,y=j=>{x.mutate(j)},w=p.useMemo(()=>!(h!=null&&h.members)||!g?[]:h.members.map(j=>{const N=g.get(j.user_id);return N?{userId:j.user_id,name:N.name,initials:N.initials}:null}).filter(j=>j!==null),[h,g]);return a.jsxs("div",{className:"flex flex-col h-full gap-0",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0",children:[a.jsx(wI,{statuses:f??[],members:w,filters:i,onChange:o}),a.jsxs(J,{size:"sm",onClick:()=>s(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"Create"]})]}),a.jsx(yr,{zone:"project.board.before",props:{projectId:c}}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:v?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(j=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(le,{className:"h-[82px] w-full rounded-lg"}),a.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},j))}):a.jsx(vN,{issues:d??[],projectId:c,statuses:f??[],onIssueClick:r,onColumnsReorder:y,filters:i})})]}),a.jsx(yr,{zone:"project.board.after",props:{projectId:c}}),a.jsx(ak,{issue:t,projectId:c,open:!!t,onClose:()=>r(null)}),a.jsx(Uu,{open:n,onClose:()=>s(!1),projectId:c})]})}const my=({priority:e,className:t})=>{const r=I("h-3.5 w-3.5 shrink-0",eg[e],t);switch(e){case"urgent":return a.jsx(os,{className:r});case"high":return a.jsx(Tl,{className:r});case"medium":return a.jsx(eo,{className:r});case"low":return a.jsx(Dl,{className:r});default:return a.jsx(an,{className:I("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},ph="grid-cols-[70px_250px_150px_120px_130px_140px_130px_32px]";function sk({issue:e,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:d=!1,children:u=[],childrenMap:f,onAddChild:m}){const h=Ct(),[g,x]=p.useState(null),[v,y]=p.useState(!1),w=gu(e.id,t),{data:j}=Gn(t),N=p.useMemo(()=>j?j.members.filter(C=>C.user).map(C=>C.user):void 0,[j]);function k(C){w.mutate(C),x(null)}const b=(s==null?void 0:s[e.status])??"#94a3b8",S=i.find(C=>C.id===e.sprint_id),_=u.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>c(e),className:I(`group grid ${ph} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-muted/10",w.isPending&&"opacity-70"),children:[a.jsx("span",{className:I("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"text-muted-foreground"),children:e.identifier}),a.jsxs("div",{className:I("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",d&&"bg-white dark:bg-muted/20"),children:[_?a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx("button",{onClick:C=>{C.stopPropagation(),y(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})})}),a.jsx(fa,{side:"top",children:v?"Collapse":"Expand"})]}):d?a.jsx(yn,{className:"h-3 w-3 text-muted-foreground shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:I("text-sm text-foreground truncate",d&&"text-primary"),children:e.title}),_&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),u.length]})]}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(kt,{open:g==="status",onOpenChange:C=>x(C?"status":null),children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 max-w-full px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:b}}),a.jsx("span",{className:"text-xs text-primary truncate",children:n[e.status]??e.status})]})}),a.jsx(wt,{className:"w-52 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ds,{children:a.jsx(Ts,{children:a.jsx(Va,{children:r.map(C=>a.jsxs(rn,{value:C.name,onSelect:()=>k({status:C.key}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:C.color}}),a.jsx("span",{className:"text-xs flex-1",children:C.name}),e.status===C.key&&a.jsx(rr,{className:"h-3.5 w-3.5 text-indigo-500"})]},C.key))})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(kt,{open:g==="priority",onOpenChange:C=>x(C?"priority":null),children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(my,{priority:e.priority}),a.jsx("span",{className:"text-xs text-primary",children:wn[e.priority]??e.priority})]})}),a.jsx(wt,{className:"w-44 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ds,{children:a.jsx(Ts,{children:a.jsx(Va,{children:Object.entries(wn).map(([C,E])=>a.jsxs(rn,{value:E,onSelect:()=>k({priority:C}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(my,{priority:C}),a.jsx("span",{className:"text-xs flex-1",children:E}),e.priority===C&&a.jsx(rr,{className:"h-3.5 w-3.5 text-indigo-500"})]},C))})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(kt,{open:g==="sprint",onOpenChange:C=>x(C?"sprint":null),children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring max-w-full",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:I("text-xs truncate",S?"text-foreground":"text-muted-foreground"),children:(S==null?void 0:S.name)??"No sprint"})]})}),a.jsx(wt,{className:"w-56 p-1",align:"start",onClick:C=>C.stopPropagation(),children:a.jsx(Ds,{children:a.jsx(Ts,{children:a.jsxs(Va,{children:[a.jsxs(rn,{value:"no-sprint",onSelect:()=>k({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(et,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs flex-1 text-muted-foreground",children:"No sprint"}),!e.sprint_id&&a.jsx(rr,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(C=>C.status!=="completed").map(C=>a.jsxs(rn,{value:C.name,onSelect:()=>k({sprint_id:C.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs truncate",children:C.name}),(C.start_date||C.end_date)&&a.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[C.start_date?fe(new Date(C.start_date),"MMM d"):"—"," → ",C.end_date?fe(new Date(C.end_date),"MMM d"):"—"]})]}),e.sprint_id===C.id&&a.jsx(rr,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},C.id))]})})})})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsxs(kt,{open:g==="due",onOpenChange:C=>x(C?"due":null),children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(dr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:I("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?fe(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",onClick:C=>C.stopPropagation(),children:[a.jsx(ur,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:C=>k({due_date:C?fe(C,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>k({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx("div",{onClick:C=>C.stopPropagation(),children:a.jsx(Vl,{value:e.assignee_ids??[],onChange:C=>w.mutate({assignee_ids:C}),users:N})}),a.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:C=>C.stopPropagation(),children:[!d&&m&&a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx("button",{onClick:()=>m(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(yn,{className:"h-3.5 w-3.5"})})}),a.jsx(fa,{side:"top",children:"Add child issue"})]}),a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx("button",{onClick:()=>h(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(m1,{className:"h-3.5 w-3.5"})})}),a.jsx(fa,{side:"top",children:"Open full page"})]})]})]}),v&&u.map(C=>a.jsx(sk,{issue:C,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,children:(f==null?void 0:f[C.id])??[],childrenMap:f,onAddChild:m},C.id))]})}function hy({taskList:e,issues:t,childrenMap:r,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,onAddIssue:f,onAddChild:m,onRenameList:h,onDeleteList:g}){const[x,v]=p.useState(!1),[y,w]=p.useState(!1),[j,N]=p.useState((e==null?void 0:e.name)??""),k=t.reduce((_,C)=>{var E;return _+(((E=r[C.id])==null?void 0:E.length)??0)},0),b=t.length+k,S=()=>{e&&j.trim()&&h&&h(e.id,j.trim()),w(!1)};return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border group/header",children:[a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx("button",{onClick:()=>v(!x),className:"text-muted-foreground hover:text-foreground transition-colors",children:x?a.jsx(kn,{className:"h-3.5 w-3.5"}):a.jsx(Kn,{className:"h-3.5 w-3.5"})})}),a.jsx(fa,{side:"right",children:x?"Expand":"Collapse"})]}),e?y?a.jsx("input",{autoFocus:!0,value:j,onChange:_=>N(_.target.value),onBlur:S,onKeyDown:_=>{_.key==="Enter"&&S(),_.key==="Escape"&&(w(!1),N(e.name))},className:"text-xs font-semibold text-foreground bg-transparent border-b border-indigo-400 outline-none px-0.5"}):a.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.name}):a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"No List"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:b}),a.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[a.jsxs("button",{onClick:()=>f((e==null?void 0:e.id)??null),className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:[a.jsx(st,{className:"h-3 w-3"}),"Add issue"]}),e&&a.jsxs(Yr,{children:[a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(is,{className:"h-3.5 w-3.5"})})})}),a.jsx(fa,{side:"top",children:"More options"})]}),a.jsxs(Tr,{align:"end",className:"w-36",children:[a.jsxs(pt,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{w(!0),N(e.name)},children:[a.jsx(zs,{className:"h-3.5 w-3.5"}),"Rename"]}),a.jsxs(pt,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g==null?void 0:g(e.id),children:[a.jsx(Dr,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!x&&a.jsx("div",{className:"divide-y divide-border/60",children:t.length===0?a.jsx("div",{className:"px-14 py-3 text-xs text-muted-foreground/50 italic",children:"No issues in this list"}):t.map(_=>a.jsx(sk,{issue:_,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[_.id]??[],childrenMap:r,onAddChild:m},_.id))})]})}function S$(){var G;const{workspace:e,projectKey:t}=Ht(),[r,n]=p.useState(null),[s,i]=p.useState({open:!1}),[o,l]=p.useState(""),[c,d]=p.useState(!1),[u,f]=p.useState(""),[m,h]=p.useState("all"),[g,x]=p.useState("all"),[v,y]=p.useState("all"),{data:w}=Ca(t??""),j=(w==null?void 0:w.id)??"",{data:N,isLoading:k}=Al(j||void 0),{data:b}=lo(j||void 0),{data:S}=co(j||void 0),{data:_}=Gl(j||void 0),C=DI(j),E=TI(j),P=II(j),O=b&&b.length>0?b:Object.entries(Ws).map(([M,z],se)=>({id:M,project_id:j,key:M,name:z,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[M]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[M]??"backlog",position:se})),$=Object.fromEntries(O.map(M=>[M.key,M.name])),D=Object.fromEntries(O.map(M=>[M.key,M.color])),B=S??[];if(!t||!e)return null;const A=(N??[]).filter(M=>{const z=!u||M.title.toLowerCase().includes(u.toLowerCase())||M.identifier.toLowerCase().includes(u.toLowerCase()),se=m==="all"||M.status===m,L=g==="all"||M.priority===g,q=v==="all"||(v==="none"?!M.sprint_id:M.sprint_id===v);return z&&se&&L&&q}).sort((M,z)=>{const se=parseInt(M.identifier.split("-")[1]??"0",10),L=parseInt(z.identifier.split("-")[1]??"0",10);return se-L}),W={};for(const M of N??[])M.parent_id&&(W[M.parent_id]||(W[M.parent_id]=[]),W[M.parent_id].push(M));const Q=A.filter(M=>!M.parent_id),K=A.length,ie=new Set((_??[]).map(M=>M.id)),ne={__none__:[]};for(const M of _??[])ne[M.id]=[];for(const M of Q){const z=M.task_list_id&&ie.has(M.task_list_id)?M.task_list_id:"__none__";ne[z].push(M)}function U(){o.trim()&&C.mutate({name:o.trim()},{onSuccess:()=>{l(""),d(!1),F.success("List created")},onError:()=>F.error("Failed to create list")})}function Y(M,z){E.mutate({id:M,name:z},{onError:()=>F.error("Failed to rename list")})}function Z(M){const z=_==null?void 0:_.find(se=>se.id===M);confirm(`Delete list "${z==null?void 0:z.name}"? Issues in this list will be moved to No List.`)&&P.mutate(M,{onSuccess:()=>F.success("List deleted"),onError:()=>F.error("Failed to delete list")})}return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"project.issues.before",props:{projectId:j}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs("div",{className:"flex items-center gap-2",children:[c?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ae,{autoFocus:!0,placeholder:"List name...",value:o,onChange:M=>l(M.target.value),onKeyDown:M=>{M.key==="Enter"&&U(),M.key==="Escape"&&(d(!1),l(""))},className:"h-8 text-xs w-36"}),a.jsx(J,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:U,disabled:!o.trim()||C.isPending,children:"Add"}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{d(!1),l("")},children:"Cancel"})]}):a.jsxs(J,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"New List"]}),a.jsxs(J,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(st,{className:"h-4 w-4"}),"Create"]})]})}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(Fe,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(qe,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),B.map(M=>a.jsx(xe,{value:M.id,className:"text-xs",children:M.name},M.id))]})]}),a.jsxs(Fe,{value:m,onValueChange:h,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(qe,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All statuses"}),O.map(({key:M,name:z})=>a.jsx(xe,{value:M,className:"text-xs",children:z},M))]})]}),a.jsxs(Fe,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(qe,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(wn).map(([M,z])=>a.jsx(xe,{value:M,className:"text-xs",children:z},M))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx($l,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:u,onChange:M=>f(M.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[1025px]",children:[a.jsxs("div",{className:I("grid items-center py-2.5 border-b border-border",ph),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"}),a.jsx("span",{className:"pr-6"})]}),k?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(M=>a.jsxs("div",{className:I("grid items-center px-6 py-3 gap-4",ph),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"}),a.jsx("span",{})]},M))}):K===0&&(N??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first issue to start tracking work."}),a.jsxs(J,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(st,{className:"h-4 w-4"}),"Create issue"]})]}):Q.length===0&&(N??[]).length>0?a.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No issues match your filters."})}):a.jsx(pu,{delayDuration:200,children:a.jsxs("div",{className:"divide-y divide-border",children:[(_??[]).map(M=>a.jsx(hy,{taskList:M,issues:ne[M.id]??[],childrenMap:W,projectId:j,statuses:O,statusLabels:$,statusColorMap:D,sprints:B,workspace:e,projectKey:t,onOpen:n,onAddIssue:z=>i({open:!0,defaultTaskListId:z}),onAddChild:z=>i({open:!0,defaultParentId:z}),onRenameList:Y,onDeleteList:Z},M.id)),(((G=ne.__none__)==null?void 0:G.length)>0||(_??[]).length===0)&&a.jsx(hy,{taskList:null,issues:ne.__none__??[],childrenMap:W,projectId:j,statuses:O,statusLabels:$,statusColorMap:D,sprints:B,workspace:e,projectKey:t,onOpen:n,onAddIssue:M=>i({open:!0,defaultTaskListId:M}),onAddChild:M=>i({open:!0,defaultParentId:M})})]})})]})}),!k&&K>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[K," issue",K!==1?"s":""]})})]}),a.jsx(yr,{zone:"project.issues.after",props:{projectId:j}}),a.jsx(ak,{issue:r,projectId:j,open:!!r,onClose:()=>n(null)}),a.jsx(Uu,{open:s.open,onClose:()=>i({open:!1}),projectId:j,defaultTaskListId:s.defaultTaskListId,defaultParentId:s.defaultParentId})]})}function C$(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,_$(s,...t)]}function _$(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var O$=Symbol("radix.slottable");function M$(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=O$,t}var ik="AlertDialog",[P$]=C$(ik,[Ej]),Ma=Ej(),ok=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ma(t);return a.jsx(Pl,{...n,...r,modal:!0})};ok.displayName=ik;var A$="AlertDialogTrigger",E$=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ma(r);return a.jsx(mP,{...s,...n,ref:t})});E$.displayName=A$;var D$="AlertDialogPortal",lk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ma(t);return a.jsx(Ml,{...n,...r})};lk.displayName=D$;var T$="AlertDialogOverlay",ck=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ma(r);return a.jsx(ni,{...s,...n,ref:t})});ck.displayName=T$;var Oi="AlertDialogContent",[I$,R$]=P$(Oi),$$=M$("AlertDialogContent"),dk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Ma(r),o=p.useRef(null),l=hu(t,o),c=p.useRef(null);return a.jsx(fP,{contentName:Oi,titleName:uk,docsSlug:"alert-dialog",children:a.jsx(I$,{scope:r,cancelRef:c,children:a.jsxs(ai,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:Ns(s.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[a.jsx($$,{children:n}),a.jsx(L$,{contentRef:o})]})})})});dk.displayName=Oi;var uk="AlertDialogTitle",fk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ma(r);return a.jsx(Gi,{...s,...n,ref:t})});fk.displayName=uk;var mk="AlertDialogDescription",hk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ma(r);return a.jsx(Vi,{...s,...n,ref:t})});hk.displayName=mk;var z$="AlertDialogAction",pk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ma(r);return a.jsx(mu,{...s,...n,ref:t})});pk.displayName=z$;var gk="AlertDialogCancel",xk=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=R$(gk,r),i=Ma(r),o=hu(t,s);return a.jsx(mu,{...i,...n,ref:o})});xk.displayName=gk;var L$=({contentRef:e})=>{const t=`\`${Oi}\` requires a description for the component to be accessible for screen reader users.
|
|
537
|
+
|
|
538
|
+
You can add a description to the \`${Oi}\` by passing a \`${mk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
539
|
+
|
|
540
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Oi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
541
|
+
|
|
542
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},F$=ok,B$=lk,vk=ck,yk=dk,bk=pk,wk=xk,jk=fk,Nk=hk;const $i=F$,W$=B$,kk=p.forwardRef(({className:e,...t},r)=>a.jsx(vk,{className:I("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));kk.displayName=vk.displayName;const Us=p.forwardRef(({className:e,...t},r)=>a.jsxs(W$,{children:[a.jsx(kk,{}),a.jsx(yk,{ref:r,className:I("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",e),...t})]}));Us.displayName=yk.displayName;const qs=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col space-y-2 text-center sm:text-left",e),...t});qs.displayName="AlertDialogHeader";const Hs=({className:e,...t})=>a.jsx("div",{className:I("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Hs.displayName="AlertDialogFooter";const Ks=p.forwardRef(({className:e,...t},r)=>a.jsx(jk,{ref:r,className:I("text-base font-semibold",e),...t}));Ks.displayName=jk.displayName;const Ys=p.forwardRef(({className:e,...t},r)=>a.jsx(Nk,{ref:r,className:I("text-sm text-muted-foreground",e),...t}));Ys.displayName=Nk.displayName;const Gs=p.forwardRef(({className:e,...t},r)=>a.jsx(bk,{ref:r,className:I(_i(),e),...t}));Gs.displayName=bk.displayName;const Vs=p.forwardRef(({className:e,...t},r)=>a.jsx(wk,{ref:r,className:I(_i({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Vs.displayName=wk.displayName;function U$({member:e,onRequestRemove:t}){var l;const r=e.user,n=(r==null?void 0:r.first_name)??"",s=(r==null?void 0:r.last_name)??"",i=`${n} ${s}`.trim()||(r==null?void 0:r.email)||"Unknown",o=(n[0]??s[0]??((l=r==null?void 0:r.email)==null?void 0:l[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx($t,{className:"h-8 w-8 shrink-0",children:a.jsx(zt,{className:"text-xs font-medium",children:o})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:i}),(r==null?void 0:r.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:r.email})]}),a.jsx(Ku,{className:I("shrink-0 text-[11px] border-0 w-20 justify-center",e.role==="manager"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:e.role}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})}function q$({teamEntry:e,onRemove:t}){const r=e.team;return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ls,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:(r==null?void 0:r.name)??"Unknown team"}),r&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[r.member_count," ",r.member_count===1?"member":"members"]})]}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})}function H$(){const{projectKey:e}=Ht(),{workspace:t}=Ie(),r=(t==null?void 0:t.id)??"",{data:n}=Ca(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=Gn(s),{data:l}=zl(r),{data:c}=Nu(r),d=M1(s),u=P1(s),f=A1(s),m=E1(s),[h,g]=p.useState(""),[x,v]=p.useState(""),[y,w]=p.useState(null),j=new Set((i==null?void 0:i.members.map(E=>E.user_id))??[]),N=new Set((i==null?void 0:i.teams.map(E=>E.team_id))??[]),k=(l??[]).filter(E=>!j.has(E.user_id)),b=(c??[]).filter(E=>!N.has(E.id)),S=(i==null?void 0:i.members.length)??0,_=(i==null?void 0:i.teams.length)??0;function C(){y&&u.mutate(y.userId,{onSuccess:()=>{F.success("Access removed"),w(null)},onError:()=>F.error("Failed to remove")})}return a.jsxs("div",{className:"p-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Access"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Manage who has access to this project."})]}),!o&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[S," member",S!==1?"s":""," • ",_," team",_!==1?"s":""]})]}),o?a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(E=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full"}),a.jsx(le,{className:"h-4 w-44"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-5 w-20"})]},E))}),a.jsx("div",{className:"px-6 py-2 border-y border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),a.jsx("div",{className:"divide-y divide-border",children:[1].map(E=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-lg"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},E))})]}):a.jsxs("div",{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Fe,{value:h,onValueChange:g,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(qe,{placeholder:"Add person…"})}),a.jsx(Le,{children:k.map(E=>{const P=E.user,O=(P==null?void 0:P.first_name)??"",$=(P==null?void 0:P.last_name)??"",D=`${O} ${$}`.trim()||(P==null?void 0:P.email)||"Unknown";return a.jsx(xe,{value:E.user_id,children:D},E.user_id)})})]}),a.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!h||d.isPending,onClick:()=>d.mutate({userId:h},{onSuccess:()=>{F.success("Access granted"),g("")},onError:()=>F.error("Failed to grant access")}),children:[a.jsx(to,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),S===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.members.map(E=>a.jsx(U$,{member:E,onRequestRemove:(P,O)=>w({userId:P,displayName:O})},E.id))})]}),a.jsxs("div",{className:"border-t border-border",children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"}),b.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Fe,{value:x,onValueChange:v,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(qe,{placeholder:"Add team…"})}),a.jsx(Le,{children:b.map(E=>a.jsx(xe,{value:E.id,children:E.name},E.id))})]}),a.jsxs(J,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!x||f.isPending,onClick:()=>f.mutate(x,{onSuccess:()=>{F.success("Team access granted"),v("")},onError:()=>F.error("Failed to add team")}),children:[a.jsx(Ls,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),_===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.teams.map(E=>a.jsx(q$,{teamEntry:E,onRemove:P=>m.mutate(P,{onSuccess:()=>F.success("Team access removed"),onError:()=>F.error("Failed to remove team")})},E.id))})]}),S===0&&_===0&&k.length===0&&b.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center border-t border-border",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ls,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No access entries yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add workspace people or teams first to grant project access."})]})]})]}),a.jsx($i,{open:!!y,onOpenChange:E=>{E||w(null)},children:a.jsxs(Us,{className:"sm:max-w-md",children:[a.jsxs(qs,{children:[a.jsx(Ks,{children:"Remove member access?"}),a.jsx(Ys,{children:y?`${y.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{disabled:u.isPending,children:"Cancel"}),a.jsx(Gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:E=>{E.preventDefault(),C()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function py(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function ra({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const K$={backlog:a.jsx(an,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(an,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Yn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(Il,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(ss,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Ep,{className:"h-3 w-3 text-zinc-400"})},Y$={urgent:a.jsx(os,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Tl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(eo,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Dl,{className:"h-3 w-3 text-blue-400"})},G$={bug:a.jsx(l1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(y1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(b1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Pp,{className:"h-3 w-3 text-zinc-500"})};function Sm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Fe,{value:e,onValueChange:t,children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(d1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(xe,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function V$(){const{workspace:e,projectKey:t,issueId:r}=Ht(),n=Ct(),[s,i]=p.useState(!1),[o,l]=p.useState(""),[c,d]=p.useState(""),[u,f]=p.useState(!1),{data:m}=Ca(t??""),h=(m==null?void 0:m.id)??"",{data:g,isLoading:x}=a1(r??""),v=gu(r??"",h),{data:y}=Gn(h),w=p.useMemo(()=>y?y.members.filter(A=>A.user).map(A=>A.user):void 0,[y]),{data:j}=lo(h||void 0),{data:N}=co(h||void 0),{data:k}=Gl(h||void 0),{data:b}=Al(h||void 0),S=(N??[]).filter(A=>A.status!=="completed"),_=g!=null&&g.parent_id?b==null?void 0:b.find(A=>A.id===g.parent_id):null,C=(b==null?void 0:b.filter(A=>A.parent_id===r))??[],E=g!=null&&g.task_list_id?k==null?void 0:k.find(A=>A.id===g.task_list_id):null,P=j&&j.length>0?Object.fromEntries(j.map(A=>[A.key,A.name])):Ws,O=j&&j.length>0?Object.fromEntries(j.map(A=>[A.key,A.category==="completed"?a.jsx(ss,{className:"h-3 w-3",style:{color:A.color}}):A.category==="started"?a.jsx(Yn,{className:"h-3 w-3",style:{color:A.color}}):a.jsx(an,{className:"h-3 w-3",style:{color:A.color}})])):K$;if(p.useEffect(()=>{g&&(l(g.title),d(g.description??"")),i(!1)},[g==null?void 0:g.id]),!t||!r)return null;const $=()=>{o.trim()&&v.mutate({title:o.trim(),description:c.trim()||void 0},{onSuccess:()=>{i(!1),F.success("Issue updated")},onError:()=>F.error("Failed to update issue")})},D=()=>{g&&(l(g.title),d(g.description??"")),i(!1)},B=(A,W)=>{v.mutate(A,{onSuccess:()=>F.success(`${W} updated`),onError:()=>F.error(`Failed to update ${W.toLowerCase()}`)})};return x||!g?a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsx("div",{className:"sticky top-0 z-10 h-[57px] bg-white dark:bg-card border-b border-border"}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 space-y-4 shadow-sm",children:[a.jsx(le,{className:"h-7 w-3/4"}),a.jsx(le,{className:"h-32 w-full"})]}),a.jsx(le,{className:"h-24 w-full rounded-xl"}),a.jsx(le,{className:"h-48 w-full rounded-xl"})]}),a.jsx(le,{className:"h-[280px] w-full rounded-xl"})]})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>n(`/${e}/projects/${t}/issues`),children:[a.jsx(vu,{className:"h-3.5 w-3.5"}),(m==null?void 0:m.name)??"Issues"]}),a.jsx("span",{className:"text-border",children:"/"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g.identifier}),a.jsx(Ku,{variant:"muted",className:"text-[10px] ml-1",children:rs[g.type]??g.type})]}),a.jsx("div",{className:"flex items-center gap-2",children:s?a.jsxs(a.Fragment,{children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:D,children:"Discard"}),a.jsx(J,{size:"sm",onClick:$,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[a.jsx(zs,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(yr,{zone:"issue.details.before",props:{issue:g}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:s?a.jsx("input",{autoFocus:!0,value:o,onChange:A=>l(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.preventDefault()},className:I("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")}):a.jsx("h1",{className:"text-xl font-semibold text-foreground leading-snug",children:g.title})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),s?a.jsx(ug,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]"}):g.description?a.jsx("div",{className:"border-t border-border/50",children:a.jsx(fg,{html:g.description,className:"px-5 py-4"})}):a.jsx("div",{className:"border-t border-border/50 px-6 py-4",children:a.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})})]}),!g.parent_id&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Child Issues"}),a.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),C.length===0?a.jsx("div",{className:"px-5 py-4 text-xs text-muted-foreground/50 italic",children:"No child issues yet"}):a.jsx("div",{className:"px-5 py-2 divide-y divide-border/40",children:C.map(A=>a.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[a.jsx(yn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${A.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:A.identifier}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${A.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:A.title})]},A.id))})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:a.jsx(tk,{issueId:r,projectId:h})}),a.jsx(yr,{zone:"issue.details.after",props:{issue:g}})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(yr,{zone:"issue.details.sidebar",props:{issue:g}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(ra,{label:"Status",children:a.jsx(Sm,{value:g.status,onValueChange:A=>B({status:A},"Status"),options:P,icons:O})}),a.jsx(ra,{label:"Priority",children:a.jsx(Sm,{value:g.priority,onValueChange:A=>B({priority:A},"Priority"),options:wn,icons:Y$})}),a.jsx(ra,{label:"Type",children:a.jsx(Sm,{value:g.type,onValueChange:A=>B({type:A},"Type"),options:rs,icons:G$})}),a.jsx(ra,{label:"Assignees",children:a.jsx(Vl,{value:g.assignee_ids??[],onChange:A=>B({assignee_ids:A},"Assignees"),disabled:v.isPending,users:w})}),a.jsx(ra,{label:"Sprint",children:a.jsxs(Fe,{value:g.sprint_id??"none",onValueChange:A=>B({sprint_id:A==="none"?null:A},"Sprint"),children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),g.sprint_id?(()=>{const A=S.find(Q=>Q.id===g.sprint_id)??(N==null?void 0:N.find(Q=>Q.id===g.sprint_id));if(!A)return a.jsxs("span",{className:"truncate",children:[g.sprint_id.slice(0,8),"…"]});const W=py(A);return a.jsxs("span",{className:"truncate",children:[A.name,W&&a.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",W]})]})})():a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),S.map(A=>{const W=py(A);return a.jsx(xe,{value:A.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:A.name}),W&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:W})]})},A.id)})]})]})}),(k??[]).length>0&&a.jsx(ra,{label:"List",children:a.jsxs(Fe,{value:g.task_list_id??"none",onValueChange:A=>B({task_list_id:A==="none"?null:A},"List"),children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Rp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:E?"truncate":"text-muted-foreground",children:(E==null?void 0:E.name)??"No list"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(k??[]).map(A=>a.jsx(xe,{value:A.id,className:"text-xs",children:A.name},A.id))]})]})}),a.jsx(ra,{label:"Start Date",children:a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.start_date?"text-foreground":"text-muted-foreground",children:g.start_date?fe(new Date(g.start_date),"MMM d, yyyy"):"No start date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",children:[a.jsx(ur,{mode:"single",selected:g.start_date?new Date(g.start_date):void 0,onSelect:A=>B({start_date:A?fe(A,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),g.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>B({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx(ra,{label:"Due Date",children:a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.due_date?"text-foreground":"text-muted-foreground",children:g.due_date?fe(new Date(g.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(wt,{className:"w-auto p-0",align:"start",children:[a.jsx(ur,{mode:"single",selected:g.due_date?new Date(g.due_date):void 0,onSelect:A=>B({due_date:A?fe(A,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),g.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>B({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(et,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),_&&a.jsx(ra,{label:"Parent",children:a.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${_.id}`),className:"flex items-center gap-1.5 text-xs hover:text-foreground transition-colors text-left w-full min-w-0",children:[a.jsx(Ap,{className:"h-3 w-3 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:_.identifier}),a.jsx("span",{className:"text-foreground truncate",children:_.title})]})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Details"})}),a.jsxs("div",{className:"px-4 pt-3 pb-4 space-y-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Created"}),a.jsx("span",{className:"text-foreground",children:fe(new Date(g.created_at),"MMM d, yyyy")})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Updated"}),a.jsx("span",{className:"text-foreground",children:fe(new Date(g.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),a.jsx(Uu,{open:u,onClose:()=>f(!1),projectId:h,defaultParentId:r,defaultTaskListId:g.task_list_id})]})}function na({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const X$={backlog:a.jsx(an,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(an,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Yn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(Il,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(ss,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Ep,{className:"h-3 w-3 text-zinc-400"})},Q$={urgent:a.jsx(os,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Tl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(eo,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(Dl,{className:"h-3 w-3 text-blue-400"})},Z$={bug:a.jsx(l1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(y1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(b1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Pp,{className:"h-3 w-3 text-zinc-500"})};function Cm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Fe,{value:e,onValueChange:t,children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(d1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(xe,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function J$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function ez(){const{workspace:e,projectKey:t}=Ht(),r=Ct(),{workspace:n}=Ie(),[s,i]=p.useState(""),[o,l]=p.useState(""),[c,d]=p.useState("backlog"),[u,f]=p.useState("medium"),[m,h]=p.useState("task"),[g,x]=p.useState([]),[v,y]=p.useState(""),[w,j]=p.useState(""),[N,k]=p.useState(void 0),[b,S]=p.useState(void 0),[_,C]=p.useState(!1),[E,P]=p.useState("weekly"),[O,$]=p.useState(void 0),{data:D}=Ca(t??""),B=(D==null?void 0:D.id)??"",A=s1(),{data:W}=Gn(B),Q=p.useMemo(()=>W?W.members.filter(M=>M.user).map(M=>M.user):void 0,[W]),{data:K}=lo(B||void 0),{data:ie}=co(B||void 0),{data:ne}=Gl(B||void 0),U=(ie??[]).filter(M=>M.status!=="completed"),Y=K&&K.length>0?Object.fromEntries(K.map(M=>[M.key,M.name])):Ws,Z=K&&K.length>0?Object.fromEntries(K.map(M=>[M.key,M.category==="completed"?a.jsx(ss,{className:"h-3 w-3",style:{color:M.color}}):M.category==="started"?a.jsx(Yn,{className:"h-3 w-3",style:{color:M.color}}):a.jsx(an,{className:"h-3 w-3",style:{color:M.color}})])):X$;if(!t||!B)return null;const G=()=>{if(!s.trim()){F.error("Title is required");return}A.mutate({title:s.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:B,workspace_id:n.id,assignee_ids:g.length>0?g:void 0,sprint_id:v||null,task_list_id:w||null,start_date:N?fe(N,"yyyy-MM-dd"):null,due_date:b?fe(b,"yyyy-MM-dd"):null,recurrence_frequency:_?E:void 0,recurrence_end_date:_&&O?fe(O,"yyyy-MM-dd"):void 0},{onSuccess:M=>{F.success("Issue created"),r(`/${e}/projects/${t}/issues/${M.issue.id}`,{replace:!0})},onError:M=>F.error(M.message??"Failed to create issue")})};return a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>r(`/${e}/projects/${t}/issues`),children:[a.jsx(vu,{className:"h-3.5 w-3.5"}),(D==null?void 0:D.name)??"Issues"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(J,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),a.jsx(J,{size:"sm",onClick:G,disabled:!s.trim()||A.isPending,className:"px-4",children:A.isPending?"Creating…":"Create issue"})]})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:a.jsx("input",{autoFocus:!0,value:s,onChange:M=>i(M.target.value),onKeyDown:M=>{M.key==="Enter"&&M.preventDefault()},placeholder:"Issue title…",className:I("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),a.jsx(ug,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]"})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(na,{label:"Status",children:a.jsx(Cm,{value:c,onValueChange:d,options:Y,icons:Z})}),a.jsx(na,{label:"Priority",children:a.jsx(Cm,{value:u,onValueChange:f,options:wn,icons:Q$})}),a.jsx(na,{label:"Type",children:a.jsx(Cm,{value:m,onValueChange:h,options:rs,icons:Z$})}),a.jsx(na,{label:"Assignees",children:a.jsx(Vl,{value:g,onChange:x,users:Q})}),U.length>0&&a.jsx(na,{label:"Sprint",children:a.jsxs(Fe,{value:v||"none",onValueChange:M=>y(M==="none"?"":M),children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Er,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(qe,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),U.map(M=>{const z=J$(M);return a.jsx(xe,{value:M.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:M.name}),z&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:z})]})},M.id)})]})]})}),(ne??[]).length>0&&a.jsx(na,{label:"List",children:a.jsxs(Fe,{value:w||"none",onValueChange:M=>j(M==="none"?"":M),children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Rp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(qe,{placeholder:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(ne??[]).map(M=>a.jsx(xe,{value:M.id,className:"text-xs",children:M.name},M.id))]})]})}),a.jsx(na,{label:"Start Date",children:a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:N?"text-foreground":"text-muted-foreground",children:N?fe(N,"MMM d, yyyy"):"No start date"}),N&&a.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),k(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3 w-3"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:N,onSelect:k,initialFocus:!0})})]})}),a.jsx(na,{label:"Due Date",children:a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:b?"text-foreground":"text-muted-foreground",children:b?fe(b,"MMM d, yyyy"):"No due date"}),b&&a.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),S(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3 w-3"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:b,onSelect:S,initialFocus:!0})})]})}),a.jsx(na,{label:"Recurring",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 pl-1",children:[a.jsx(uo,{id:"new-recurring",checked:_,onCheckedChange:C}),a.jsxs(vt,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[a.jsx(nl,{className:"h-3 w-3 text-muted-foreground"}),_?E.charAt(0).toUpperCase()+E.slice(1):"Off"]})]}),_&&a.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs(Fe,{value:E,onValueChange:M=>P(M),children:[a.jsx(ze,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsx(qe,{})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(xe,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(dr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:O?"text-foreground":"text-muted-foreground",children:O?fe(O,"MMM d, yyyy"):"No end date"}),O&&a.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),$(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(et,{className:"h-3 w-3"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:O,onSelect:$,initialFocus:!0})})]})]})]})})]}),a.jsx("div",{className:"px-4 pt-2 pb-3 mt-1 border-t border-border/60",children:a.jsxs("p",{className:"text-[11px] text-muted-foreground/50 leading-relaxed",children:["Press ",a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})})]})]})})]})}const tz={issue:{icon:ma,label:"Issue"},project:{icon:Er,label:"Project"},comment:{icon:v1,label:"Comment"},sprint:{icon:os,label:"Sprint"}};function rz(e){const t=new Date(e);return Q3(t)?q3(t,{addSuffix:!0}):Z3(t)?`Yesterday ${fe(t,"h:mm a")}`:fe(t,"MMM d, yyyy")}function nz(){const{workspace:e}=Ht(),t=Ct(),{data:r,isLoading:n}=JD(),{data:s=[]}=no(),i=tT(),o=rT(),l=(r==null?void 0:r.filter(u=>!u.read).length)??0,c=Object.fromEntries(s.map(u=>[u.id,u]));function d(u){var f;if(u.entity_type==="issue"&&((f=u.metadata)!=null&&f.project_id)){const m=c[u.metadata.project_id];if(m)return`/${e}/projects/${m.identifier}/issues/${u.entity_id}`}if(u.entity_type==="project"){const m=c[u.entity_id];if(m)return`/${e}/projects/${m.identifier}/board`}return null}return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Notifications"}),l>0&&a.jsxs(J,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>o.mutate(void 0,{onSuccess:()=>F.success("All marked as read"),onError:()=>F.error("Failed")}),disabled:o.isPending,children:[a.jsx(kE,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),a.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Type"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Message"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Time"}),a.jsx("span",{})]}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(u=>a.jsxs("div",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[a.jsx("div",{}),a.jsx(le,{className:"h-5 w-20 rounded-full"}),a.jsx(le,{className:"h-4 w-3/4"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx("div",{})]},u))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(u=>{const f=tz[u.entity_type]??{icon:Ei,label:u.entity_type},m=f.icon,h=d(u);return a.jsxs("div",{className:I("grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",h&&"cursor-pointer"),onClick:()=>{h&&(u.read||i.mutate(u.id),t(h))},children:[a.jsx("div",{className:"flex items-center justify-center",children:!u.read&&a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500 shrink-0"})}),a.jsx("div",{children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[a.jsx(m,{className:"h-3 w-3"}),f.label]})}),a.jsx("p",{className:I("text-sm truncate",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message}),a.jsx("span",{className:"text-xs text-muted-foreground",children:rz(u.created_at)}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&a.jsx(J,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>i.mutate(u.id,{onError:()=>F.error("Failed")}),children:"Mark read"})})]},u.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ei,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"You're all caught up."})]}),!n&&!!(r!=null&&r.length)&&a.jsx("div",{className:"px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," notification",r.length!==1?"s":"",l>0?` · ${l} unread`:""]})})]})})}function az({open:e,onClose:t,projectId:r}){const[n,s]=p.useState(""),[i,o]=p.useState(""),[l,c]=p.useState(),[d,u]=p.useState(),[f,m]=p.useState(!1),[h,g]=p.useState(!1),x=PI(r);function v(){s(""),o(""),c(void 0),u(void 0),t()}async function y(w){w.preventDefault(),n.trim()&&x.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?fe(l,"yyyy-MM-dd"):null,end_date:d?fe(d,"yyyy-MM-dd"):null},{onSuccess:()=>{F.success("Sprint created"),v()},onError:()=>F.error("Failed to create sprint")})}return a.jsx(si,{open:e,onOpenChange:w=>!w&&v(),children:a.jsxs(ii,{className:"sm:max-w-md",children:[a.jsx(ao,{children:a.jsx(io,{children:"New Sprint"})}),a.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(so,{className:"space-y-4 py-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{htmlFor:"sprint-name",children:["Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:n,onChange:w=>s(w.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(vt,{htmlFor:"sprint-goal",children:["Goal ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(Ru,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:i,onChange:w=>o(w.target.value),className:"resize-none text-sm",rows:2})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"Start Date"}),a.jsxs(kt,{open:f,onOpenChange:m,children:[a.jsx(St,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:I("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[a.jsx(dr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?fe(l,"MMM d, yyyy"):"Pick date"]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:l,onSelect:w=>{c(w),m(!1)},disabled:w=>d?w>d:!1,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(vt,{children:"End Date"}),a.jsxs(kt,{open:h,onOpenChange:g,children:[a.jsx(St,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:I("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[a.jsx(dr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?fe(d,"MMM d, yyyy"):"Pick date"]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:d,onSelect:w=>{u(w),g(!1)},disabled:w=>l?w<l:!1,initialFocus:!0})})]})]})]})]}),a.jsxs(ql,{children:[a.jsx(J,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),a.jsx(J,{type:"submit",disabled:!n.trim()||x.isPending,children:x.isPending?"Creating…":"Create Sprint"})]})]})]})})}const sz={active:{label:"Active",icon:bu,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:Yn,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:ss,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function iz({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:s=[]}){const i=AI(e.id,t),o=EI(t),l=sz[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>F.success(`"${e.name}" started`),onError:()=>F.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>F.success(`"${e.name}" completed`),onError:g=>F.error((g==null?void 0:g.message)??"Failed to complete sprint")})}function f(){confirm(`Delete sprint "${e.name}"? This cannot be undone.`)&&o.mutate(e.id,{onSuccess:()=>F.success("Sprint deleted"),onError:()=>F.error("Failed to delete sprint")})}const m=!!e.start_date,h=!!e.end_date;return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:I("flex h-7 w-7 items-center justify-center rounded-full shrink-0",e.status==="active"?"bg-emerald-100 dark:bg-emerald-900/30":e.status==="completed"?"bg-blue-100 dark:bg-blue-900/30":"bg-zinc-100 dark:bg-zinc-800"),children:a.jsx(c,{className:I("h-3.5 w-3.5",e.status==="active"?"text-emerald-600 dark:text-emerald-400":e.status==="completed"?"text-blue-600 dark:text-blue-400":"text-zinc-500")})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.name}),e.goal&&a.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5 flex items-center gap-1",children:[a.jsx(VE,{className:"h-3 w-3 shrink-0"}),e.goal]})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0 w-64",children:[a.jsx(Qi,{className:"h-3.5 w-3.5 shrink-0"}),m||h?a.jsxs("span",{children:[m?fe(new Date(e.start_date),"MMM d"):"—"," → ",h?fe(new Date(e.end_date),"MMM d, yyyy"):"—",m&&h&&n&&(()=>{const g=yN(new Date(e.start_date),new Date(e.end_date),n,s);return a.jsxs("span",{className:"ml-1.5 text-[11px] text-muted-foreground/70",children:["(",g," biz day",g!==1?"s":"",")"]})})()]}):a.jsx("span",{className:"italic",children:"No dates set"})]}),a.jsxs("div",{className:"text-xs text-muted-foreground shrink-0 w-20 text-right",children:[r," issue",r!==1?"s":""]}),a.jsx(Ku,{className:I("shrink-0 text-[11px] border-0 w-20 justify-center",l.badge),children:l.label}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="planned"&&a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(bu,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(ss,{className:"h-3 w-3"}),"Complete"]}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:a.jsx(Dr,{className:"h-3.5 w-3.5"})})]})]})}function oz(){const{projectKey:e}=Ht(),[t,r]=p.useState(!1),{data:n}=Ca(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=co(s||void 0),{data:l}=Al(s||void 0),{data:c}=tg(),{data:d=[]}=rg(new Date().getFullYear()),u=(l??[]).reduce((h,g)=>(g.sprint_id&&(h[g.sprint_id]=(h[g.sprint_id]??0)+1),h),{}),f={active:(i??[]).filter(h=>h.status==="active"),planned:(i??[]).filter(h=>h.status==="planned"),completed:(i??[]).filter(h=>h.status==="completed")},m=[{key:"active",label:"Active Sprint",items:f.active},{key:"planned",label:"Planned",items:f.planned},{key:"completed",label:"Completed",items:f.completed}];return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"project.sprints.before",props:{projectId:s}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs(J,{size:"sm",onClick:()=>r(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"New Sprint"]})}),o?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(h=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-5 w-20"})]},h))}):(i??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Qi,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No sprints yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a sprint to start planning your work in time-boxed iterations."}),a.jsxs(J,{size:"sm",onClick:()=>r(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"New Sprint"]})]}):a.jsx("div",{children:m.map(({key:h,label:g,items:x})=>x.length===0?null:a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:g})}),a.jsx("div",{className:"divide-y divide-border",children:x.map(v=>a.jsx(iz,{sprint:v,projectId:s,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},h))})]}),a.jsx(yr,{zone:"project.sprints.after",props:{projectId:s}}),a.jsx(az,{open:t,onClose:()=>r(!1),projectId:s})]})}const zi={all:["roles"],list:()=>[...zi.all,"list"],detail:e=>[...zi.all,e]};function Yu(){return Be({queryKey:zi.list(),queryFn:()=>te.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function lz(){const e=we();return ye({mutationFn:t=>te.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:zi.list()})}})}function cz(e){const t=we();return ye({mutationFn:r=>te.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:zi.list()})}})}function dz(){const e=we();return ye({mutationFn:t=>te.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:zi.list()})}})}function Sk(){const e=we();return ye({mutationFn:({userId:t,appRoleId:r})=>te.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["users"]})}})}const ld=[{group:"Workspace Admin",permissions:[{key:"workspace:admin",label:"Workspace admin (full access to workspace settings, reports, and member management)"}]},{group:"Members & Invitations",permissions:[{key:"member:invite",label:"Invite members"},{key:"member:remove",label:"Remove members"},{key:"member:update_role",label:"Change member roles"}]},{group:"Workspaces",permissions:[{key:"workspace:create",label:"Create workspaces"},{key:"workspace:update",label:"Update workspace settings"},{key:"workspace:delete",label:"Delete workspaces"}]},{group:"Projects",permissions:[{key:"project:create",label:"Create projects"},{key:"project:update",label:"Update project settings"},{key:"project:delete",label:"Delete projects"},{key:"project:archive",label:"Archive projects"},{key:"project:manage_access",label:"Manage project access"}]},{group:"Issues",permissions:[{key:"issue:create",label:"Create issues"},{key:"issue:update",label:"Update issues"},{key:"issue:delete",label:"Delete issues"},{key:"issue:assign",label:"Assign issues"},{key:"issue:update_status",label:"Update issue status"}]},{group:"Sprints",permissions:[{key:"sprint:create",label:"Create sprints"},{key:"sprint:start",label:"Start sprints"},{key:"sprint:complete",label:"Complete sprints"},{key:"sprint:delete",label:"Delete sprints"}]},{group:"Teams",permissions:[{key:"team:create",label:"Create teams"},{key:"team:update",label:"Update teams"},{key:"team:delete",label:"Delete teams"},{key:"team:manage_members",label:"Manage team members"}]},{group:"Roles",permissions:[{key:"role:create",label:"Create roles"},{key:"role:update",label:"Update roles"},{key:"role:delete",label:"Delete roles"},{key:"role:assign",label:"Assign roles to users"}]}];function cd({open:e,onClose:t,onConfirm:r,title:n,description:s,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return a.jsx($i,{open:e,onOpenChange:c=>!c&&t(),children:a.jsxs(Us,{children:[a.jsxs(qs,{children:[a.jsx(Ks,{children:n}),a.jsx(Ys,{children:s})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{onClick:t,disabled:l,children:"Cancel"}),a.jsx(Gs,{onClick:r,disabled:l,className:I(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function hg({value:e,className:t}){const[r,n]=p.useState(!1),s=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)};return a.jsx("button",{onClick:s,className:I("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?a.jsx(rr,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Dp,{className:"h-3.5 w-3.5"})})}function gy({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:a.jsxs(Fe,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[a.jsx(ze,{className:"h-9",children:a.jsx(qe,{placeholder:"No custom role"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>a.jsx(xe,{value:n.id,children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{children:n.name}),n.description&&a.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]})},n.id))]})]})}function uz({open:e,onClose:t,workspaceId:r}){const[n,s]=p.useState("existing"),[i,o]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(""),[f,m]=p.useState(""),[h,g]=p.useState(""),[x,v]=p.useState(null),{data:y=[]}=Yl(),{data:w=[]}=zl(r),j=mD(r),N=uD(r),{data:k}=Yu(),b=p.useMemo(()=>new Set(w.map(P=>P.user_id)),[w]),S=p.useMemo(()=>y.filter(P=>!b.has(P.id)),[y,b]),_=p.useMemo(()=>{const P=i.toLowerCase().trim();return P?S.filter(O=>O.email.toLowerCase().includes(P)||`${O.first_name} ${O.last_name}`.toLowerCase().includes(P)):S},[S,i]);p.useEffect(()=>{e&&(o(""),c(""),u(""),m(""),g(""),v(null),s("existing"))},[e]);const C=()=>{l&&j.mutate({user_id:l,role:"member",app_role_id:d||null},{onSuccess:()=>{F.success("Member added"),t()},onError:P=>F.error(P.message||"Failed to add member")})},E=P=>{P.preventDefault(),N.mutate({email:f.trim()||void 0,role:"member",app_role_id:h||null},{onSuccess:O=>{v(O.invitation),F.success("Invitation created")},onError:O=>F.error(O.message||"Failed to create invitation")})};return a.jsx(ls,{open:e,onOpenChange:P=>!P&&t(),children:a.jsxs(_a,{className:"sm:max-w-[520px]",children:[a.jsx(cs,{children:a.jsx(ds,{children:"Add member"})}),!x&&a.jsxs("div",{className:"flex rounded-lg border border-border p-0.5 bg-muted/40 gap-0.5",children:[a.jsx("button",{type:"button",onClick:()=>s("existing"),className:I("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="existing"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Existing user"}),a.jsx("button",{type:"button",onClick:()=>s("invite"),className:I("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="invite"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Send invite"})]}),n==="existing"&&!x&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(Ae,{placeholder:"Search by name or email…",value:i,onChange:P=>o(P.target.value),className:"h-9",autoFocus:!0}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:S.length===0?a.jsxs("div",{className:"py-8 text-center px-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"All users are already members."}),a.jsx("button",{className:"mt-2 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",onClick:()=>s("invite"),children:"Send an invite instead"})]}):_.length===0?a.jsx("div",{className:"py-6 text-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',i,'"']})}):a.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:_.map(P=>{const O=P.first_name??"",$=P.last_name??"",D=`${O} ${$}`.trim()||P.email,B=(O[0]??$[0]??P.email[0]??"U").toUpperCase(),A=l===P.id;return a.jsxs("button",{type:"button",onClick:()=>c(A?"":P.id),className:I("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",A?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[a.jsx($t,{className:"h-7 w-7 shrink-0",children:a.jsx(zt,{className:"text-[11px] font-medium",children:B})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:D}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.email})]}),A&&a.jsx(rr,{className:"h-4 w-4 text-indigo shrink-0"})]},P.id)})})}),S.length>0&&a.jsxs(a.Fragment,{children:[k&&k.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(gy,{value:d,onChange:u,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"button",size:"sm",disabled:!l||j.isPending,onClick:C,children:j.isPending?"Adding…":"Add to workspace"})]})]})]}),n==="invite"&&!x&&a.jsxs("form",{onSubmit:E,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ae,{type:"email",placeholder:"colleague@example.com",value:f,onChange:P=>m(P.target.value),className:"h-9",autoFocus:!0}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),k&&k.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(gy,{value:h,onChange:g,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:N.isPending,children:N.isPending?"Creating…":"Create invitation"})]})]}),x&&a.jsxs("div",{className:"space-y-4 pt-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",x.email?a.jsx("span",{className:"font-medium text-foreground",children:x.email}):"anyone you want to invite","."]}),a.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[a.jsx(Rl,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),a.jsx("span",{className:"text-xs font-mono text-foreground flex-1 min-w-0 break-all",children:`${window.location.origin}/invite/${x.token}`}),a.jsx(hg,{value:`${window.location.origin}/invite/${x.token}`,className:"shrink-0"})]}),a.jsxs("div",{className:"flex items-center justify-between pt-1",children:[a.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>v(null),children:"Create another"}),a.jsx(J,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function fz({invitation:e,workspaceId:t}){const r=fD(t),n=`${window.location.origin}/invite/${e.token}`;return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(Rl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),a.jsx("span",{className:I("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",e.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":e.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:e.role==="super-admin"?"Super Admin":e.role==="admin"?"Admin":"Member"})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[280px]",children:n}),a.jsx(hg,{value:n})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:fe(new Date(e.created_at),"MMM d")}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>F.success("Invitation revoked"),onError:()=>F.error("Failed to revoke")}),disabled:r.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})]})}function mz({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=Ie(),{data:n,isLoading:s}=ju(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=oD(e),l=lD(e),c=cD(e),d=p.useRef(null),[u,f]=p.useState("");p.useEffect(()=>{i&&f(i.name)},[i==null?void 0:i.name]);const m=i?u.trim()!==i.name:!1,h=()=>{!u.trim()||!i||o.mutate({name:u.trim()},{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:y.workspace.logo_url}),F.success("Workspace updated")},onError:()=>F.error("Failed to update workspace")})},g=y=>{var j;const w=(j=y.target.files)==null?void 0:j[0];w&&(l.mutate(w,{onSuccess:N=>{r({id:N.workspace.id,name:N.workspace.name,slug:N.workspace.slug,logo_url:N.workspace.logo_url}),F.success("Logo updated")},onError:()=>F.error("Failed to upload logo")}),d.current&&(d.current.value=""))},x=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),F.success("Logo removed")},onError:()=>F.error("Failed to remove logo")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Workspace details"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Logo"}),s?a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("div",{className:"size-12 rounded-lg bg-muted animate-pulse"})}):a.jsxs("div",{className:"flex items-center gap-3",children:[i!=null&&i.logo_url?a.jsx("img",{src:i.logo_url,alt:"Workspace logo",className:"size-12 rounded-lg object-cover shrink-0 border border-border"}):a.jsx("div",{className:"flex size-12 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-lg font-bold",children:(((v=i==null?void 0:i.name)==null?void 0:v[0])??"M").toUpperCase()})}),a.jsx("input",{ref:d,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:g}),a.jsx(J,{size:"sm",variant:"outline",className:"h-8",onClick:()=>{var y;return(y=d.current)==null?void 0:y.click()},disabled:l.isPending,children:l.isPending?"Uploading…":"Upload logo"}),(i==null?void 0:i.logo_url)&&a.jsx(J,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:x,disabled:c.isPending,children:c.isPending?"Removing…":"Remove"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),s?a.jsx(le,{className:"h-8 w-64"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ae,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&a.jsx(J,{size:"sm",className:"h-8",onClick:h,disabled:!u.trim()||o.isPending,children:o.isPending?"Saving…":"Save"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"URL slug"}),s?a.jsx(le,{className:"h-4 w-40"}):a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("span",{className:"font-mono text-foreground",children:i==null?void 0:i.slug}),a.jsx(hg,{value:(i==null?void 0:i.slug)??""})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),s?a.jsx(le,{className:"h-4 w-16"}):a.jsx("span",{className:"text-sm capitalize",children:(i==null?void 0:i.plan)??"free"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),s?a.jsx(le,{className:"h-4 w-28"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?fe(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}function hz({workspaceId:e,onInvite:t}){var h;const{data:r,isLoading:n}=zl(e),{data:s,isLoading:i}=dD(e),o=hD(e),l=Sk(),{data:c}=Yu(),{user:d}=Ie(),[u,f]=p.useState(null),m=(s==null?void 0:s.filter(g=>g.status==="pending"))??[];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Members",!n&&r&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",r.length]})]})}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(g=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-32"}),a.jsx(le,{className:"h-3 w-48"})]})]},g))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(g=>{var k;const x=g.user,v=(x==null?void 0:x.first_name)??"",y=(x==null?void 0:x.last_name)??"",w=`${v} ${y}`.trim()||(x==null?void 0:x.email)||"Unknown",j=(v[0]??y[0]??((k=x==null?void 0:x.email)==null?void 0:k[0])??"U").toUpperCase(),N=(x==null?void 0:x.id)===(d==null?void 0:d.id);return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx($t,{className:"h-7 w-7 shrink-0",children:a.jsx(zt,{className:"text-[11px] font-medium",children:j})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:w}),N&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(x==null?void 0:x.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.email})]}),c&&c.length>0&&a.jsxs(Fe,{value:g.app_role_id??"none",onValueChange:b=>l.mutate({userId:g.user_id,appRoleId:b==="none"?null:b},{onSuccess:()=>F.success("Custom role updated"),onError:()=>F.error("Failed to update custom role")}),children:[a.jsx(ze,{className:"h-7 text-[11px] w-32 shrink-0",children:a.jsx(qe,{placeholder:"Custom role"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),c.map(b=>a.jsx(xe,{value:b.id,children:b.name},b.id))]})]}),!N&&a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(is,{className:"h-4 w-4"})})}),a.jsxs(Tr,{align:"end",className:"w-44",children:[a.jsx(pt,{onClick:()=>{fetch(`/admin/users/${g.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>F.success("Sessions revoked — user will be signed out")).catch(()=>F.error("Failed to revoke sessions"))},children:"Revoke sessions"}),a.jsx(Bn,{}),a.jsxs(pt,{className:"text-destructive focus:text-destructive",onClick:()=>f(g),children:[a.jsx(Dr,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},g.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(oa,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No members yet"}),a.jsx("button",{onClick:t,className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}),a.jsxs("div",{className:"px-6 py-2 border-t border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Pending invitations",!i&&m.length>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",m.length]})]}),a.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"Invite"]})]}),i?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(g=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-48"}),a.jsx(le,{className:"h-3 w-64"})]})]},g))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending invitations."}),a.jsx("button",{onClick:t,className:"mt-2 text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}):a.jsx("div",{className:"divide-y divide-border",children:m.map(g=>a.jsx(fz,{invitation:g,workspaceId:e},g.id))}),a.jsx(cd,{open:!!u,onClose:()=>f(null),onConfirm:()=>{u&&o.mutate(u.user_id,{onSuccess:()=>{F.success("Member removed"),f(null)},onError:()=>{F.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((h=u==null?void 0:u.user)==null?void 0:h.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending})]})}function pz({workspaceId:e,teamId:t,allMembers:r}){var y,w;const{data:n,isLoading:s}=xD(e,t),i=vD(e,t),o=yD(e,t),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,m]=p.useState(null),h=new Set((n==null?void 0:n.map(j=>j.user_id))??[]),g=r.filter(j=>!h.has(j.user_id)),x=n==null?void 0:n.find(j=>j.user_id===d),v=r.find(j=>j.user_id===f);return a.jsxs("div",{className:"bg-muted/10 border-t border-border",children:[s?a.jsx("div",{className:"px-8 py-3",children:a.jsx(le,{className:"h-3 w-40"})}):(n==null?void 0:n.length)===0?a.jsx("p",{className:"px-8 py-3 text-xs text-muted-foreground",children:"No members in this team yet."}):a.jsx("div",{className:"divide-y divide-border/50",children:n==null?void 0:n.map(j=>{var C;const N=j.user,k=(N==null?void 0:N.first_name)??"",b=(N==null?void 0:N.last_name)??"",S=`${k} ${b}`.trim()||(N==null?void 0:N.email)||"Unknown",_=(k[0]??b[0]??((C=N==null?void 0:N.email)==null?void 0:C[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-3 px-8 py-2.5 group hover:bg-muted/20 transition-colors",children:[a.jsx($t,{className:"h-6 w-6 shrink-0",children:a.jsx(zt,{className:"text-[10px] font-medium",children:_})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:S}),a.jsx("button",{onClick:()=>u(j.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]},j.id)})}),g.length>0&&a.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[a.jsx(to,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Fe,{value:l,onValueChange:c,children:[a.jsx(ze,{className:"h-7 text-xs flex-1 max-w-[200px]",children:a.jsx(qe,{placeholder:"Add member…"})}),a.jsx(Le,{children:g.map(j=>{const N=j.user,k=(N==null?void 0:N.first_name)??"",b=(N==null?void 0:N.last_name)??"",S=`${k} ${b}`.trim()||(N==null?void 0:N.email)||"Unknown";return a.jsx(xe,{value:j.user_id,children:S},j.user_id)})})]}),l&&a.jsx(J,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),a.jsx(cd,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{F.success("Removed from team"),u(null)},onError:()=>{F.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=x==null?void 0:x.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),a.jsx(cd,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{F.success("Added to team"),m(null),c("")},onError:()=>{F.error("Failed to add"),m(null)}})},title:"Add to team",description:`Add ${((w=v==null?void 0:v.user)==null?void 0:w.email)??"this member"} to the team?`,confirmLabel:"Add",loading:i.isPending})]})}function gz({workspaceId:e}){const{data:t,isLoading:r}=Nu(e),{data:n}=zl(e),s=pD(e),i=gD(e),[o,l]=p.useState(new Set),[c,d]=p.useState(!1),[u,f]=p.useState(""),[m,h]=p.useState(null),g=t==null?void 0:t.find(y=>y.id===m),x=y=>{l(w=>{const j=new Set(w);return j.has(y)?j.delete(y):j.add(y),j})},v=y=>{y.preventDefault(),u.trim()&&s.mutate({name:u.trim()},{onSuccess:()=>{F.success("Team created"),f(""),d(!1)},onError:()=>F.error("Failed to create team")})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Teams",!r&&t&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",t.length]})]}),a.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(st,{className:"h-3 w-3"}),"New team"]})]}),c&&a.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:a.jsxs("form",{onSubmit:v,className:"flex items-center gap-2",children:[a.jsx(Ae,{autoFocus:!0,placeholder:"Team name",value:u,onChange:y=>f(y.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),a.jsx(J,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||s.isPending,children:s.isPending?"Creating…":"Create"}),a.jsx(J,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{d(!1),f("")},children:"Cancel"})]})}),r?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(y=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg shrink-0"}),a.jsx(le,{className:"h-3.5 w-32"})]},y))}):t!=null&&t.length?a.jsx("div",{className:"divide-y divide-border",children:t.map(y=>{const w=o.has(y.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx("button",{onClick:()=>x(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:w?a.jsx(Kn,{className:"h-4 w-4"}):a.jsx(kn,{className:"h-4 w-4"})}),a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ls,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:y.name}),y.description&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.description})]}),a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[y.member_count," ",y.member_count===1?"member":"members"]}),a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(is,{className:"h-4 w-4"})})}),a.jsx(Tr,{align:"end",className:"w-36",children:a.jsxs(pt,{className:"text-destructive focus:text-destructive",onClick:()=>h(y.id),children:[a.jsx(Dr,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),w&&a.jsx(pz,{workspaceId:e,teamId:y.id,allMembers:n??[]})]},y.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ls,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No teams yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Teams make it easy to grant project access to groups of people."}),a.jsx(J,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),a.jsx(cd,{open:!!m,onClose:()=>h(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{F.success("Team deleted"),h(null)},onError:()=>{F.error("Failed to delete team"),h(null)}})},title:"Delete team",description:`Delete "${(g==null?void 0:g.name)??"this team"}"? All members will be removed from the team. Projects will not be affected.`,confirmLabel:"Delete team",variant:"destructive",loading:i.isPending})]})}const xz=["general","members","teams"];function vz(){const{workspace:e}=Ie(),t=(e==null?void 0:e.id)??"",[r,n]=fu(),s=r.get("tab"),[i,o]=p.useState(xz.includes(s)?s:"general"),l=u=>{o(u),n({tab:u},{replace:!0})},[c,d]=p.useState(!1);return a.jsxs("div",{className:"p-2",children:[a.jsx(yr,{zone:"workspace.settings.before",props:{workspaceId:t}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2",children:[a.jsx("div",{className:"flex",children:["general","members","teams"].map(u=>a.jsx("button",{onClick:()=>l(u),className:I("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize",i===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),i==="members"&&a.jsxs(J,{size:"sm",onClick:()=>d(!0),children:[a.jsx(st,{className:"h-4 w-4"}),"Add member"]})]}),i==="general"&&a.jsx(mz,{workspaceId:t}),i==="members"&&a.jsx(hz,{workspaceId:t,onInvite:()=>d(!0)}),i==="teams"&&a.jsx(gz,{workspaceId:t})]}),a.jsx(yr,{zone:"workspace.settings.after",props:{workspaceId:t}}),a.jsx(uz,{open:c,onClose:()=>d(!1),workspaceId:t})]})}function yz({open:e,onClose:t}){const[r,n]=p.useState(""),[s,i]=p.useState(""),[o,l]=p.useState(new Set),c=lz();p.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=ld.flatMap(x=>x.permissions.map(v=>v.key)),u=d.every(x=>o.has(x)),f=!u&&d.some(x=>o.has(x)),m=()=>{l(u?new Set:new Set(d))},h=x=>{l(v=>{const y=new Set(v);return y.has(x)?y.delete(x):y.add(x),y})},g=x=>{x.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{F.success("Role created"),t()},onError:v=>F.error(v.message||"Failed to create role")})};return a.jsx(ls,{open:e,onOpenChange:x=>!x&&t(),children:a.jsxs(_a,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[a.jsxs(cs,{children:[a.jsx(ds,{children:"Create role"}),a.jsx(Bl,{children:"Define a new custom role with a specific permission set."})]}),a.jsxs("form",{onSubmit:g,className:"space-y-5 pt-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ae,{value:r,onChange:x=>n(x.target.value),placeholder:"e.g. Developer, PM, Viewer",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Description ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ae,{value:s,onChange:x=>i(x.target.value),placeholder:"What is this role for?",className:"h-9"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:u?"Deselect all":"Select all"})]}),ld.map(x=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:x.group}),a.jsx("div",{className:"space-y-1.5",children:x.permissions.map(v=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(v.key),onChange:()=>h(v.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm group-hover:text-foreground text-muted-foreground transition-colors",children:v.label})]},v.key))})]},x.group))]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function bz({role:e,onDeleted:t}){const[r,n]=p.useState(e.name),[s,i]=p.useState(e.description??""),[o,l]=p.useState(new Set(e.permissions)),[c,d]=p.useState(!1),u=cz(e.id),f=dz();p.useEffect(()=>{n(e.name),i(e.description??""),l(new Set(e.permissions))},[e.id,e.name,e.description,e.permissions]);const m=r!==e.name||s!==(e.description??"")||o.size!==e.permissions.length||Array.from(o).some(N=>!e.permissions.includes(N)),h=ld.flatMap(N=>N.permissions.map(k=>k.key)),g=h.every(N=>o.has(N)),x=!g&&h.some(N=>o.has(N)),v=()=>{l(g?new Set:new Set(h))},y=N=>{l(k=>{const b=new Set(k);return b.has(N)?b.delete(N):b.add(N),b})},w=()=>{u.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>F.success("Role saved"),onError:N=>F.error(N.message||"Failed to save role")})},j=()=>{f.mutate(e.id,{onSuccess:()=>{F.success("Role deleted"),t(),d(!1)},onError:N=>F.error(N.message||"Failed to delete role")})};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e.name}),e.is_system&&a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[a.jsx(Ji,{className:"h-3 w-3"}),"System"]})]}),!e.is_system&&a.jsx("button",{onClick:()=>d(!0),className:"text-muted-foreground hover:text-destructive transition-colors",title:"Delete role",children:a.jsx(Dr,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ae,{value:r,onChange:N=>n(N.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx(Ae,{value:s,onChange:N=>i(N.target.value),placeholder:"What is this role for?",className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:v,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:g?"Deselect all":"Select all"})]}),ld.map(N=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:N.group}),a.jsx("div",{className:"space-y-2",children:N.permissions.map(k=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(k.key),onChange:()=>y(k.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:k.label})]},k.key))})]},N.group))]}),a.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:a.jsx(J,{size:"sm",onClick:w,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),a.jsx($i,{open:c,onOpenChange:d,children:a.jsxs(Us,{children:[a.jsxs(qs,{children:[a.jsxs(Ks,{children:['Delete "',e.name,'"?']}),a.jsx(Ys,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{children:"Cancel"}),a.jsx(Gs,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function wz(){const{data:e,isLoading:t}=Yu(),[r,n]=p.useState(null),[s,i]=p.useState(!1),o=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];p.useEffect(()=>{e&&e.length>0&&!r&&n(e[0].id)},[e]);const c=(e==null?void 0:e.find(d=>d.id===r))??null;return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ah,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Roles & Permissions"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Define what users with each custom role can do across the application."})]})]}),a.jsxs(J,{size:"sm",onClick:()=>i(!0),children:[a.jsx(st,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),a.jsxs("div",{className:"flex flex-1 min-h-0",children:[a.jsx("div",{className:"w-56 shrink-0 border-r border-border flex flex-col overflow-y-auto",children:t?a.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>a.jsx(le,{className:"h-8 w-full"},d))}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"System Roles"})}),o.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:I("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(Ji,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),l.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom Roles"})}),l.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:I("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx("div",{className:"h-3 w-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),!t&&(!e||e.length===0)&&a.jsx("div",{className:"flex flex-col items-center justify-center py-10 px-3 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No roles yet."})})]})}),a.jsx("div",{className:"flex-1 min-w-0",children:c?a.jsx(bz,{role:c,onDeleted:()=>{var u;const d=(e==null?void 0:e.filter(f=>f.id!==c.id))??[];n(((u=d[0])==null?void 0:u.id)??null)}},c.id):a.jsx("div",{className:"flex items-center justify-center h-full text-center p-8",children:a.jsxs("div",{children:[a.jsx(ah,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Select a role to edit"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or"," ",a.jsx("button",{onClick:()=>i(!0),className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"create a new role"})]})]})})})]}),a.jsx(yz,{open:s,onClose:()=>i(!1)})]})})}function jz(e){return Be({queryKey:["invite",e],queryFn:()=>te.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function Nz(){const{token:e}=Ht(),{isAuthenticated:t}=Ie(),r=Ct(),{data:n,isLoading:s,error:i}=jz(e??""),{data:o}=ku(),l=jD(e??""),[c,d]=p.useState(""),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(""),[v,y]=p.useState(!1);if(t&&n)return r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0}),null;const w=(n==null?void 0:n.invitation.email)??null,j=N=>{N.preventDefault();const k=w??m.trim();if(!k){F.error("Email is required");return}l.mutate({email:k,password:g,first_name:c,last_name:u},{onSuccess:()=>{r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0})},onError:b=>F.error(b.message??"Registration failed")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})})}),s?a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-48 mx-auto"}),a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-32 mx-auto"})]}):i?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-3",children:[a.jsx("p",{className:"text-sm font-medium",children:"Invalid or expired invitation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is no longer valid. Ask for a new one."}),a.jsx(Za,{to:"/login",children:a.jsx(J,{variant:"outline",size:"sm",className:"mt-2",children:"Go to login"})})]}):n?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-4 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(jE,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"You've been invited to"})]}),a.jsx("p",{className:"text-base font-semibold",children:n.workspace?n.workspace.name:"Meridian"})]}),a.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[n.invitation.role==="admin"?a.jsx(HE,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):a.jsx(rD,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:["Joining as"," ",a.jsx("span",{className:"font-medium text-foreground capitalize",children:n.invitation.role}),n.invitation.role==="admin"?" — full access":" — can view and edit"]})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-5",children:[a.jsx("p",{className:"text-sm font-medium mb-4",children:"Create your account"}),a.jsxs("form",{onSubmit:j,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ae,{placeholder:"First name",value:c,onChange:N=>d(N.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),a.jsx(Ae,{placeholder:"Last name",value:u,onChange:N=>f(N.target.value),required:!0,className:"h-9 bg-transparent"})]}),w?a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:"email",value:w,readOnly:!0,className:"h-9 bg-muted/50 text-muted-foreground cursor-not-allowed"}),a.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:"locked"})]}):a.jsx(Ae,{type:"email",placeholder:"Email",value:m,onChange:N=>h(N.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:g,onChange:N=>x(N.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>y(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:v?a.jsx(Ip,{className:"h-4 w-4"}):a.jsx(Il,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(J,{type:"submit",className:"w-full h-9 font-medium",disabled:l.isPending,children:l.isPending?"Creating account…":"Accept invitation"})})]})]}),(o==null?void 0:o.googleOAuthEnabled)&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(Kp,{flow:"invite",inviteToken:e,label:"Accept with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",a.jsx(Za,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}var kz=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function pg(e){if(typeof e!="string")return!1;var t=kz;return t.includes(e)}var Sz=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Cz=new Set(Sz);function Ck(e){return typeof e!="string"?!1:Cz.has(e)}function _k(e){return typeof e=="string"&&e.startsWith("data-")}function ga(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ck(r)||_k(r))&&(t[r]=e[r]);return t}function gg(e){if(e==null)return null;if(p.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ga(t)}return typeof e=="object"&&!Array.isArray(e)?ga(e):null}function on(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ck(r)||_k(r)||pg(r))&&(t[r]=e[r]);return t}var _z=["children","width","height","viewBox","className","style","title","desc"];function gh(){return gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gh.apply(null,arguments)}function Oz(e,t){if(e==null)return{};var r,n,s=Mz(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Mz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ok=p.forwardRef((e,t)=>{var{children:r,width:n,height:s,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=Oz(e,_z),f=i||{width:n,height:s,x:0,y:0},m=tt("recharts-surface",o);return p.createElement("svg",gh({},on(u),{className:m,width:n,height:s,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),p.createElement("title",null,c),p.createElement("desc",null,d),r)}),Pz=["children","className"];function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(null,arguments)}function Az(e,t){if(e==null)return{};var r,n,s=Ez(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ez(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var xa=p.forwardRef((e,t)=>{var{children:r,className:n}=e,s=Az(e,Pz),i=tt("recharts-layer",n);return p.createElement("g",xh({className:i},on(s),{ref:t}),r)}),Dz=p.createContext(null);function at(e){return function(){return e}}const Mk=Math.cos,dd=Math.sin,Sn=Math.sqrt,ud=Math.PI,Gu=2*ud,vh=Math.PI,yh=2*vh,bs=1e-6,Tz=yh-bs;function Pk(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Iz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Pk;const r=10**t;return function(n){this._+=n[0];for(let s=1,i=n.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class Rz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Pk:Iz(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,i,o){this._append`C${+t},${+r},${+n},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,s,i){if(t=+t,r=+r,n=+n,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,d=s-r,u=o-t,f=l-r,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>bs)if(!(Math.abs(f*c-d*u)>bs)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=s-l,x=c*c+d*d,v=h*h+g*g,y=Math.sqrt(x),w=Math.sqrt(m),j=i*Math.tan((vh-Math.acos((x+m-v)/(2*y*w)))/2),N=j/w,k=j/y;Math.abs(N-1)>bs&&this._append`L${t+N*u},${r+N*f}`,this._append`A${i},${i},0,0,${+(f*h>u*g)},${this._x1=t+k*c},${this._y1=r+k*d}`}}arc(t,r,n,s,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),c=n*Math.sin(s),d=t+l,u=r+c,f=1^o,m=o?s-i:i-s;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>bs||Math.abs(this._y1-u)>bs)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%yh+yh),m>Tz?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:m>bs&&this._append`A${n},${n},0,${+(m>=vh)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function xg(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Rz(t)}function vg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ak(e){this._context=e}Ak.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 Vu(e){return new Ak(e)}function Ek(e){return e[0]}function Dk(e){return e[1]}function Tk(e,t){var r=at(!0),n=null,s=Vu,i=null,o=xg(l);e=typeof e=="function"?e:e===void 0?Ek:at(e),t=typeof t=="function"?t:t===void 0?Dk:at(t);function l(c){var d,u=(c=vg(c)).length,f,m=!1,h;for(n==null&&(i=s(h=o())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+e(f,d,c),+t(f,d,c));if(h)return i=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:at(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:at(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:at(!!c),l):r},l.curve=function(c){return arguments.length?(s=c,n!=null&&(i=s(n)),l):s},l.context=function(c){return arguments.length?(c==null?n=i=null:i=s(n=c),l):n},l}function Pc(e,t,r){var n=null,s=at(!0),i=null,o=Vu,l=null,c=xg(d);e=typeof e=="function"?e:e===void 0?Ek:at(+e),t=typeof t=="function"?t:at(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Dk:at(+r);function d(f){var m,h,g,x=(f=vg(f)).length,v,y=!1,w,j=new Array(x),N=new Array(x);for(i==null&&(l=o(w=c())),m=0;m<=x;++m){if(!(m<x&&s(v=f[m],m,f))===y)if(y=!y)h=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=m-1;g>=h;--g)l.point(j[g],N[g]);l.lineEnd(),l.areaEnd()}y&&(j[m]=+e(v,m,f),N[m]=+t(v,m,f),l.point(n?+n(v,m,f):j[m],r?+r(v,m,f):N[m]))}if(w)return l=null,w+""||null}function u(){return Tk().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:at(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:at(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:at(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:at(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:at(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:at(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(s=typeof f=="function"?f:at(!!f),d):s},d.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),d):o},d.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),d):i},d}class Ik{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function $z(e){return new Ik(e,!0)}function zz(e){return new Ik(e,!1)}const yg={draw(e,t){const r=Sn(t/ud);e.moveTo(r,0),e.arc(0,0,r,0,Gu)}},Lz={draw(e,t){const r=Sn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},Rk=Sn(1/3),Fz=Rk*2,Bz={draw(e,t){const r=Sn(t/Fz),n=r*Rk;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Wz={draw(e,t){const r=Sn(t),n=-r/2;e.rect(n,n,r,r)}},Uz=.8908130915292852,$k=dd(ud/10)/dd(7*ud/10),qz=dd(Gu/10)*$k,Hz=-Mk(Gu/10)*$k,Kz={draw(e,t){const r=Sn(t*Uz),n=qz*r,s=Hz*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=Gu*i/5,l=Mk(o),c=dd(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},_m=Sn(3),Yz={draw(e,t){const r=-Sn(t/(_m*3));e.moveTo(0,r*2),e.lineTo(-_m*r,-r),e.lineTo(_m*r,-r),e.closePath()}},Zr=-.5,Jr=Sn(3)/2,bh=1/Sn(12),Gz=(bh/2+1)*3,Vz={draw(e,t){const r=Sn(t/Gz),n=r/2,s=r*bh,i=n,o=r*bh+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(Zr*n-Jr*s,Jr*n+Zr*s),e.lineTo(Zr*i-Jr*o,Jr*i+Zr*o),e.lineTo(Zr*l-Jr*c,Jr*l+Zr*c),e.lineTo(Zr*n+Jr*s,Zr*s-Jr*n),e.lineTo(Zr*i+Jr*o,Zr*o-Jr*i),e.lineTo(Zr*l+Jr*c,Zr*c-Jr*l),e.closePath()}};function Xz(e,t){let r=null,n=xg(s);e=typeof e=="function"?e:at(e||yg),t=typeof t=="function"?t:at(t===void 0?64:+t);function s(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:at(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:at(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function fd(){}function md(e,t,r){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+r)/6)}function zk(e){this._context=e}zk.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:md(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:md(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qz(e){return new zk(e)}function Lk(e){this._context=e}Lk.prototype={areaStart:fd,areaEnd:fd,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:md(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Zz(e){return new Lk(e)}function Fk(e){this._context=e}Fk.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:md(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jz(e){return new Fk(e)}function Bk(e){this._context=e}Bk.prototype={areaStart:fd,areaEnd:fd,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 eL(e){return new Bk(e)}function xy(e){return e<0?-1:1}function vy(e,t,r){var n=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(n||s<0&&-0),o=(r-e._y1)/(s||n<0&&-0),l=(i*s+o*n)/(n+s);return(xy(i)+xy(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function yy(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Om(e,t,r){var n=e._x0,s=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,s+l*t,i-l,o-l*r,i,o)}function hd(e){this._context=e}hd.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:Om(this,this._t0,yy(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 r=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,Om(this,yy(this,r=vy(this,e,t)),r);break;default:Om(this,this._t0,r=vy(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Wk(e){this._context=new Uk(e)}(Wk.prototype=Object.create(hd.prototype)).point=function(e,t){hd.prototype.point.call(this,t,e)};function Uk(e){this._context=e}Uk.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,r,n,s,i){this._context.bezierCurveTo(t,e,n,r,i,s)}};function tL(e){return new hd(e)}function rL(e){return new Wk(e)}function qk(e){this._context=e}qk.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=by(e),s=by(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],s[0][i],n[1][i],s[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function by(e){var t,r=e.length-1,n,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(s[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function nL(e){return new qk(e)}function Xu(e,t){this._context=e,this._t=t}Xu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function aL(e){return new Xu(e,.5)}function sL(e){return new Xu(e,0)}function iL(e){return new Xu(e,1)}function Xs(e,t){if((o=e.length)>1)for(var r=1,n,s,i=e[t[0]],o,l=i.length;r<o;++r)for(s=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function wh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function oL(e,t){return e[t]}function lL(e){const t=[];return t.key=e,t}function cL(){var e=at([]),t=wh,r=Xs,n=oL;function s(i){var o=Array.from(e.apply(this,arguments),lL),l,c=o.length,d=-1,u;for(const f of i)for(l=0,++d;l<c;++l)(o[l][d]=[0,+n(f,o[l].key,d,i)]).data=f;for(l=0,u=vg(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:at(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:at(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?wh:typeof i=="function"?i:at(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??Xs,s):r},s}function dL(e,t){if((n=e.length)>0){for(var r,n,s=0,i=e[0].length,o;s<i;++s){for(o=r=0;r<n;++r)o+=e[r][s][1]||0;if(o)for(r=0;r<n;++r)e[r][s][1]/=o}Xs(e,t)}}function uL(e,t){if((s=e.length)>0){for(var r=0,n=e[t[0]],s,i=n.length;r<i;++r){for(var o=0,l=0;o<s;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Xs(e,t)}}function fL(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,n=1,s,i,o;n<i;++n){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],f=u[n][1]||0,m=u[n-1][1]||0,h=(f-m)/2,g=0;g<l;++g){var x=e[t[g]],v=x[n][1]||0,y=x[n-1][1]||0;h+=v-y}c+=f,d+=h*f}s[n-1][1]+=s[n-1][0]=r,c&&(r-=d/c)}s[n-1][1]+=s[n-1][0]=r,Xs(e,t)}}var Qu={},Hk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(Hk);var bg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(bg);var Zu={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t})(Zu);var Ju={},Kk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(Kk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kk,r=Zu;function n(s){if(Array.isArray(s))return s.map(r.toKey);if(typeof s=="symbol")return[s];s=t.toString(s);const i=[],o=s.length;if(o===0)return i;let l=0,c="",d="",u=!1;for(s.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const f=s[l];d?f==="\\"&&l+1<o?(l++,c+=s[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,i.push(c),c=""):c+=f:f==="["?(u=!0,c&&(i.push(c),c="")):f==="."?c&&(i.push(c),c=""):c+=f,l++}return c&&i.push(c),i}e.toPath=n})(Ju);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hk,r=bg,n=Zu,s=Ju;function i(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?i(l,s.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function o(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=i})(Qu);var mL=Qu.get;const Li=Sa(mL);var hL=4;function Ha(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hL,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function bt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((s,i,o)=>{var l=r[o-1];return typeof l=="string"?s+l+i:l!==void 0?s+Ha(l)+i:s+i},"")}var Or=e=>e===0?0:e>0?1:-1,Wn=e=>typeof e=="number"&&e!=+e,Qs=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ve=e=>(typeof e=="number"||e instanceof Number)&&!Wn(e),Un=e=>ve(e)||typeof e=="string",pL=0,ll=e=>{var t=++pL;return"".concat(e||"").concat(t)},jn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ve(t)&&typeof t!="string")return n;var i;if(Qs(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Wn(i)&&(i=n),s&&r!=null&&i>r&&(i=r),i},Yk=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function tr(e,t,r){return ve(e)&&ve(t)?Ha(e+r*(t-e)):t}function gL(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Li(n,t))===r)}var qt=e=>e===null||typeof e>"u",Zl=e=>qt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Mr(e){return e!=null}function fo(){}var xL=["type","size","sizeType"];function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jh.apply(null,arguments)}function wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wy(Object(r),!0).forEach(function(n){vL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vL(e,t,r){return(t=yL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yL(e){var t=bL(e,"string");return typeof t=="symbol"?t:t+""}function bL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wL(e,t){if(e==null)return{};var r,n,s=jL(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function jL(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Gk={symbolCircle:yg,symbolCross:Lz,symbolDiamond:Bz,symbolSquare:Wz,symbolStar:Kz,symbolTriangle:Yz,symbolWye:Vz},NL=Math.PI/180,kL=e=>{var t="symbol".concat(Zl(e));return Gk[t]||yg},SL=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*NL;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},CL=(e,t)=>{Gk["symbol".concat(Zl(e))]=t},Vk=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,s=wL(e,xL),i=jy(jy({},s),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=kL(o),h=Xz().type(m).size(SL(r,n,o)),g=h();if(g!==null)return g},{className:c,cx:d,cy:u}=i,f=on(i);return ve(d)&&ve(u)&&ve(r)?p.createElement("path",jh({},f,{className:tt("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};Vk.registerSymbol=CL;var Xk=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,_L=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(p.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(s=>{pg(s)&&(n[s]=i=>r[s](r,i))}),n},OL=(e,t,r)=>n=>(e(t,r,n),null),wg=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(s=>{var i=e[s];pg(s)&&typeof i=="function"&&(n||(n={}),n[s]=OL(i,t,r))}),n};function Ny(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ML(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ny(Object(r),!0).forEach(function(n){PL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ny(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PL(e,t,r){return(t=AL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AL(e){var t=EL(e,"string");return typeof t=="symbol"?t:t+""}function EL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vr(e,t){var r=ML({},e),n=t,s=Object.keys(t),i=s.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return i}var Qk={},Zk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const s=new Map;for(let i=0;i<r.length;i++){const o=r[i],l=n(o,i,r);s.has(l)||s.set(l,o)}return Array.from(s.values())}e.uniqBy=t})(Zk);var Jk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...s){return r.apply(this,s.slice(0,n))}}e.ary=t})(Jk);var jg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(jg);var eS={},ef={},tS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(tS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tS;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(ef);var rS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(rS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ef,r=rS;function n(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=n})(eS);var nS={},aS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qu;function r(n){return function(s){return t.get(s,n)}}e.property=r})(aS);var sS={},Ng={},iS={},kg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(kg);var Sg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Sg);var Cg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.isEqualsSameValueZero=t})(Cg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kg,r=Sg,n=Cg;function s(u,f,m){return typeof m!="function"?s(u,f,()=>{}):i(u,f,function h(g,x,v,y,w,j){const N=m(g,x,v,y,w,j);return N!==void 0?!!N:i(g,x,h,j)},new Map)}function i(u,f,m,h){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,m,h);case"function":return Object.keys(f).length>0?i(u,{...f},m,h):n.isEqualsSameValueZero(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(u,f)}}function o(u,f,m,h){if(f==null)return!0;if(Array.isArray(f))return c(u,f,m,h);if(f instanceof Map)return l(u,f,m,h);if(f instanceof Set)return d(u,f,m,h);const g=Object.keys(f);if(u==null||r.isPrimitive(u))return g.length===0;if(g.length===0)return!0;if(h!=null&&h.has(f))return h.get(f)===u;h==null||h.set(f,u);try{for(let x=0;x<g.length;x++){const v=g[x];if(!r.isPrimitive(u)&&!(v in u)||f[v]===void 0&&u[v]!==void 0||f[v]===null&&u[v]!==null||!m(u[v],f[v],v,u,f,h))return!1}return!0}finally{h==null||h.delete(f)}}function l(u,f,m,h){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[g,x]of f.entries()){const v=u.get(g);if(m(v,x,g,u,f,h)===!1)return!1}return!0}function c(u,f,m,h){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const g=new Set;for(let x=0;x<f.length;x++){const v=f[x];let y=!1;for(let w=0;w<u.length;w++){if(g.has(w))continue;const j=u[w];let N=!1;if(m(j,v,x,u,f,h)&&(N=!0),N){g.add(w),y=!0;break}}if(!y)return!1}return!0}function d(u,f,m,h){return f.size===0?!0:u instanceof Set?c([...u],[...f],m,h):!1}e.isMatchWith=s,e.isSetMatch=d})(iS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iS;function r(n,s){return t.isMatchWith(n,s,()=>{})}e.isMatch=r})(Ng);var oS={},_g={},lS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(lS);var tf={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(tf);var Og={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",s="[object Boolean]",i="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",m="[object ArrayBuffer]",h="[object Object]",g="[object Error]",x="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",w="[object Uint16Array]",j="[object Uint32Array]",N="[object BigUint64Array]",k="[object Int8Array]",b="[object Int16Array]",S="[object Int32Array]",_="[object BigInt64Array]",C="[object Float32Array]",E="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=_,e.bigUint64ArrayTag=N,e.booleanTag=s,e.dataViewTag=x,e.dateTag=l,e.errorTag=g,e.float32ArrayTag=C,e.float64ArrayTag=E,e.functionTag=f,e.int16ArrayTag=b,e.int32ArrayTag=S,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=n,e.objectTag=h,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=w,e.uint32ArrayTag=j,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=y})(Og);var cS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(cS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lS,r=tf,n=Og,s=Sg,i=cS;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,h=new Map,g=void 0){const x=g==null?void 0:g(u,f,m,h);if(x!==void 0)return x;if(s.isPrimitive(u))return u;if(h.has(u))return h.get(u);if(Array.isArray(u)){const v=new Array(u.length);h.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,h,g);return Object.hasOwn(u,"index")&&(v.index=u.index),Object.hasOwn(u,"input")&&(v.input=u.input),v}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const v=new RegExp(u.source,u.flags);return v.lastIndex=u.lastIndex,v}if(u instanceof Map){const v=new Map;h.set(u,v);for(const[y,w]of u)v.set(y,l(w,y,m,h,g));return v}if(u instanceof Set){const v=new Set;h.set(u,v);for(const y of u)v.add(l(y,void 0,m,h,g));return v}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(i.isTypedArray(u)){const v=new(Object.getPrototypeOf(u)).constructor(u.length);h.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,h,g);return v}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const v=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return h.set(u,v),c(v,u,m,h,g),v}if(typeof File<"u"&&u instanceof File){const v=new File([u],u.name,{type:u.type});return h.set(u,v),c(v,u,m,h,g),v}if(typeof Blob<"u"&&u instanceof Blob){const v=new Blob([u],{type:u.type});return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof Error){const v=new u.constructor;return h.set(u,v),v.message=u.message,v.name=u.name,v.stack=u.stack,v.cause=u.cause,c(v,u,m,h,g),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof Number){const v=new Number(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(u instanceof String){const v=new String(u.valueOf());return h.set(u,v),c(v,u,m,h,g),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return h.set(u,v),c(v,u,m,h,g),v}return u}function c(u,f,m=u,h,g){const x=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<x.length;v++){const y=x[v],w=Object.getOwnPropertyDescriptor(u,y);(w==null||w.writable)&&(u[y]=l(f[y],y,m,h,g))}}function d(u){switch(r.getTag(u)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(_g);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_g;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(oS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ng,r=oS;function n(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=n})(sS);var dS={},uS={},fS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_g,r=tf,n=Og;function s(i,o){return t.cloneDeepWith(i,(l,c,d,u)=>{const f=o==null?void 0:o(l,c,d,u);if(f!==void 0)return f;if(typeof i=="object"){if(r.getTag(i)===n.objectTag&&typeof i.constructor!="function"){const m={};return u.set(i,m),t.copyProperties(m,i,d,u),m}switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const m=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(m,i),m}case n.argumentsTag:{const m={};return t.copyProperties(m,i),m.length=i.length,m[Symbol.iterator]=i[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=s})(fS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fS;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(uS);var mS={},Mg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,s=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<s;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(Mg);var hS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tf;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(hS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bg,r=Mg,n=hS,s=Ju;function i(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=s.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let u=0;u<c.length;u++){const f=c[u];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||n.isArguments(d))&&r.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=i})(mS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ng,r=Zu,n=uS,s=Qu,i=mS;function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=r.toKey(l);break}}return c=n.cloneDeep(c),function(d){const u=s.get(d,l);return u===void 0?i.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=o})(dS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jg,r=aS,n=sS,s=dS;function i(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?s.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=i})(nS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zk,r=Jk,n=jg,s=eS,i=nS;function o(l,c=n.identity){return s.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(Qk);var DL=Qk.uniqBy;const ky=Sa(DL);function TL(e,t,r){return t===!0?ky(e,r):typeof t=="function"?ky(e,t):e}var Pg=p.createContext(null),IL=e=>e,_t=()=>{var e=p.useContext(Pg);return e?e.store.dispatch:IL},Jc=()=>{},RL=()=>Jc,$L=(e,t)=>e===t;function Se(e){var t=p.useContext(Pg),r=p.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Jc,[t,e]);return KP.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:RL,t?t.store.getState:Jc,t?t.store.getState:Jc,r,$L)}function zL(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function LL(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function FL(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Sy=e=>Array.isArray(e)?e:[e];function BL(e){const t=Array.isArray(e[0])?e[0]:e;return FL(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function WL(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var UL=class{constructor(e){this.value=e}deref(){return this.value}},qL=typeof WeakRef<"u"?WeakRef:UL,HL=0,Cy=1;function Ac(){return{s:HL,v:void 0,o:null,p:null}}function pS(e,t={}){let r=Ac();const{resultEqualityCheck:n}=t;let s,i=0;function o(){var f;let l=r;const{length:c}=arguments;for(let m=0,h=c;m<h;m++){const g=arguments[m];if(typeof g=="function"||typeof g=="object"&&g!==null){let x=l.o;x===null&&(l.o=x=new WeakMap);const v=x.get(g);v===void 0?(l=Ac(),x.set(g,l)):l=v}else{let x=l.p;x===null&&(l.p=x=new Map);const v=x.get(g);v===void 0?(l=Ac(),x.set(g,l)):l=v}}const d=l;let u;if(l.s===Cy)u=l.v;else if(u=e.apply(null,arguments),i++,n){const m=((f=s==null?void 0:s.deref)==null?void 0:f.call(s))??s;m!=null&&n(m,u)&&(u=m,i!==0&&i--),s=typeof u=="object"&&u!==null||typeof u=="function"?new qL(u):u}return d.s=Cy,d.v=u,u}return o.clearCache=()=>{r=Ac(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function KL(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...s)=>{let i=0,o=0,l,c={},d=s.pop();typeof d=="object"&&(c=d,d=s.pop()),zL(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:h=pS,argsMemoizeOptions:g=[]}=u,x=Sy(m),v=Sy(g),y=BL(s),w=f(function(){return i++,d.apply(null,arguments)},...x),j=h(function(){o++;const k=WL(y,arguments);return l=w.apply(null,k),l},...v);return Object.assign(j,{resultFunc:d,memoizedResultFunc:w,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:h})};return Object.assign(n,{withTypes:()=>n}),n}var H=KL(pS),YL=Object.assign((e,t=H)=>{LL(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((o,l,c)=>(o[r[c]]=l,o),{}))},{withTypes:()=>YL}),gS={},xS={},vS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,s,i)=>{if(n!==s){const o=t(n),l=t(s);if(o===l&&o===0){if(n<s)return i==="desc"?1:-1;if(n>s)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};e.compareValues=r})(vS);var yS={},Ag={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Ag);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ag,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function s(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!r.test(i))||o!=null&&Object.hasOwn(o,i)}e.isKey=s})(yS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vS,r=yS,n=Ju;function s(i,o,l,c){if(i==null)return[];l=c?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(h=>String(h));const d=(h,g)=>{let x=h;for(let v=0;v<g.length&&x!=null;++v)x=x[g[v]];return x},u=(h,g)=>g==null||h==null?g:typeof h=="object"&&"key"in h?Object.hasOwn(g,h.key)?g[h.key]:d(g,h.path):typeof h=="function"?h(g):Array.isArray(h)?d(g,h):typeof g=="object"?g[h]:g,f=o.map(h=>(Array.isArray(h)&&h.length===1&&(h=h[0]),h==null||typeof h=="function"||Array.isArray(h)||r.isKey(h)?h:{key:h,path:n.toPath(h)}));return i.map(h=>({original:h,criteria:f.map(g=>u(g,h))})).slice().sort((h,g)=>{for(let x=0;x<f.length;x++){const v=t.compareValues(h.criteria[x],g.criteria[x],l[x]);if(v!==0)return v}return 0}).map(h=>h.original)}e.orderBy=s})(xS);var bS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const s=[],i=Math.floor(n),o=(l,c)=>{for(let d=0;d<l.length;d++){const u=l[d];Array.isArray(u)&&c<i?o(u,c+1):s.push(u)}};return o(r,0),s}e.flatten=t})(bS);var Eg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mg,r=ef,n=kg,s=Cg;function i(o,l,c){return n.isObject(c)&&(typeof l=="number"&&r.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?s.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=i})(Eg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xS,r=bS,n=Eg;function s(i,...o){const l=o.length;return l>1&&n.isIterateeCall(i,o[0],o[1])?o=[]:l>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(i,r.flatten(o),["asc"])}e.sortBy=s})(gS);var GL=gS.sortBy;const rf=Sa(GL);var wS=e=>e.legend.settings,VL=e=>e.legend.size,XL=e=>e.legend.payload;H([XL,wS],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?rf(n,r):n});var Ec=1;function QL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=p.useState({height:0,left:0,top:0,width:0}),n=p.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),o={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(o.height-t.height)>Ec||Math.abs(o.left-t.left)>Ec||Math.abs(o.top-t.top)>Ec||Math.abs(o.width-t.width)>Ec)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function Jt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ZL=typeof Symbol=="function"&&Symbol.observable||"@@observable",_y=ZL,Mm=()=>Math.random().toString(36).substring(7).split("").join("."),JL={INIT:`@@redux/INIT${Mm()}`,REPLACE:`@@redux/REPLACE${Mm()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Mm()}`},pd=JL;function Dg(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function jS(e,t,r){if(typeof e!="function")throw new Error(Jt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Jt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Jt(1));return r(jS)(e,t)}let n=e,s=t,i=new Map,o=i,l=0,c=!1;function d(){o===i&&(o=new Map,i.forEach((v,y)=>{o.set(y,v)}))}function u(){if(c)throw new Error(Jt(3));return s}function f(v){if(typeof v!="function")throw new Error(Jt(4));if(c)throw new Error(Jt(5));let y=!0;d();const w=l++;return o.set(w,v),function(){if(y){if(c)throw new Error(Jt(6));y=!1,d(),o.delete(w),i=null}}}function m(v){if(!Dg(v))throw new Error(Jt(7));if(typeof v.type>"u")throw new Error(Jt(8));if(typeof v.type!="string")throw new Error(Jt(17));if(c)throw new Error(Jt(9));try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(w=>{w()}),v}function h(v){if(typeof v!="function")throw new Error(Jt(10));n=v,m({type:pd.REPLACE})}function g(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Jt(11));function w(){const N=y;N.next&&N.next(u())}return w(),{unsubscribe:v(w)}},[_y](){return this}}}return m({type:pd.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:h,[_y]:g}}function e6(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:pd.INIT})>"u")throw new Error(Jt(12));if(typeof r(void 0,{type:pd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Jt(13))})}function NS(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const o=t[i];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let s;try{e6(r)}catch(i){s=i}return function(o={},l){if(s)throw s;let c=!1;const d={};for(let u=0;u<n.length;u++){const f=n[u],m=r[f],h=o[f],g=m(h,l);if(typeof g>"u")throw l&&l.type,new Error(Jt(14));d[f]=g,c=c||g!==h}return c=c||n.length!==Object.keys(o).length,c?d:o}}function gd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function t6(...e){return t=>(r,n)=>{const s=t(r,n);let i=()=>{throw new Error(Jt(15))};const o={getState:s.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=gd(...l)(s.dispatch),{...s,dispatch:i}}}function kS(e){return Dg(e)&&"type"in e&&typeof e.type=="string"}var SS=Symbol.for("immer-nothing"),Oy=Symbol.for("immer-draftable"),jr=Symbol.for("immer-state");function pn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ur=Object,Fi=Ur.getPrototypeOf,xd="constructor",nf="prototype",Nh="configurable",vd="enumerable",ed="writable",cl="value",va=e=>!!e&&!!e[jr];function Nn(e){var t;return e?CS(e)||sf(e)||!!e[Oy]||!!((t=e[xd])!=null&&t[Oy])||of(e)||lf(e):!1}var r6=Ur[nf][xd].toString(),My=new WeakMap;function CS(e){if(!e||!Tg(e))return!1;const t=Fi(e);if(t===null||t===Ur[nf])return!0;const r=Ur.hasOwnProperty.call(t,xd)&&t[xd];if(r===Object)return!0;if(!wi(r))return!1;let n=My.get(r);return n===void 0&&(n=Function.toString.call(r),My.set(r,n)),n===r6}function af(e,t,r=!0){Jl(e)===0?(r?Reflect.ownKeys(e):Ur.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function Jl(e){const t=e[jr];return t?t.type_:sf(e)?1:of(e)?2:lf(e)?3:0}var Py=(e,t,r=Jl(e))=>r===2?e.has(t):Ur[nf].hasOwnProperty.call(e,t),kh=(e,t,r=Jl(e))=>r===2?e.get(t):e[t],yd=(e,t,r,n=Jl(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function n6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sf=Array.isArray,of=e=>e instanceof Map,lf=e=>e instanceof Set,Tg=e=>typeof e=="object",wi=e=>typeof e=="function",Pm=e=>typeof e=="boolean";function a6(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var sa=e=>e.copy_||e.base_,Ig=e=>e.modified_?e.copy_:e.base_;function Sh(e,t){if(of(e))return new Map(e);if(lf(e))return new Set(e);if(sf(e))return Array[nf].slice.call(e);const r=CS(e);if(t===!0||t==="class_only"&&!r){const n=Ur.getOwnPropertyDescriptors(e);delete n[jr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l[ed]===!1&&(l[ed]=!0,l[Nh]=!0),(l.get||l.set)&&(n[o]={[Nh]:!0,[ed]:!0,[vd]:l[vd],[cl]:e[o]})}return Ur.create(Fi(e),n)}else{const n=Fi(e);if(n!==null&&r)return{...e};const s=Ur.create(n);return Ur.assign(s,e)}}function Rg(e,t=!1){return cf(e)||va(e)||!Nn(e)||(Jl(e)>1&&Ur.defineProperties(e,{set:Dc,add:Dc,clear:Dc,delete:Dc}),Ur.freeze(e),t&&af(e,(r,n)=>{Rg(n,!0)},!1)),e}function s6(){pn(2)}var Dc={[cl]:s6};function cf(e){return e===null||!Tg(e)?!0:Ur.isFrozen(e)}var bd="MapSet",Ch="Patches",Ay="ArrayMethods",_S={};function Zs(e){const t=_S[e];return t||pn(0,e),t}var Ey=e=>!!_S[e],dl,OS=()=>dl,i6=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ey(bd)?Zs(bd):void 0,arrayMethodsPlugin_:Ey(Ay)?Zs(Ay):void 0});function Dy(e,t){t&&(e.patchPlugin_=Zs(Ch),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _h(e){Oh(e),e.drafts_.forEach(o6),e.drafts_=null}function Oh(e){e===dl&&(dl=e.parent_)}var Ty=e=>dl=i6(dl,e);function o6(e){const t=e[jr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Iy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[jr].modified_&&(_h(t),pn(4)),Nn(e)&&(e=Ry(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[jr].base_,e,t)}else e=Ry(t,r);return l6(t,e,!0),_h(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==SS?e:void 0}function Ry(e,t){if(cf(t))return t;const r=t[jr];if(!r)return wd(t,e.handledSet_,e);if(!df(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);AS(r,e)}return r.copy_}function l6(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Rg(t,r)}function MS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var df=(e,t)=>e.scope_===t,c6=[];function PS(e,t,r,n){const s=sa(e),i=e.type_;if(n!==void 0&&kh(s,n,i)===t){yd(s,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;af(s,(c,d)=>{if(va(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??c6;for(const l of o)yd(s,l,r,i)}function d6(e,t,r){e.callbacks_.push(function(s){var l;const i=t;if(!i||!df(i,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(i);const o=Ig(i);PS(e,i.draft_??i,o,r),AS(i,s)})}function AS(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}MS(e)}}function u6(e,t,r){const{scope_:n}=e;if(va(r)){const s=r[jr];df(s,n)&&s.callbacks_.push(function(){td(e);const o=Ig(s);PS(e,r,o,t)})}else Nn(r)&&e.callbacks_.push(function(){const i=sa(e);e.type_===3?i.has(r)&&wd(r,n.handledSet_,n):kh(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&wd(kh(e.copy_,t,e.type_),n.handledSet_,n)})}function wd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||va(e)||t.has(e)||!Nn(e)||cf(e)||(t.add(e),af(e,(n,s)=>{if(va(s)){const i=s[jr];if(df(i,r)){const o=Ig(i);yd(e,n,o,e.type_),MS(i)}}else Nn(s)&&wd(s,t,r)})),e}function f6(e,t){const r=sf(e),n={type_:r?1:0,scope_:t?t.scope_:OS(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=n,i=jd;r&&(s=[n],i=ul);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,[l,n]}var jd={get(e,t){if(t===jr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=sa(e);if(!Py(s,t,e.type_))return m6(e,s,t);const i=s[t];if(e.finalized_||!Nn(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&a6(t))return i;if(i===Am(e.base_,t)){td(e);const o=e.type_===1?+t:t,l=Ph(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in sa(e)},ownKeys(e){return Reflect.ownKeys(sa(e))},set(e,t,r){const n=ES(sa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Am(sa(e),t),i=s==null?void 0:s[jr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(n6(r,s)&&(r!==void 0||Py(e.base_,t,e.type_)))return!0;td(e),Mh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),u6(e,t,r)),!0},deleteProperty(e,t){return td(e),Am(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Mh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=sa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[ed]:!0,[Nh]:e.type_!==1||t!=="length",[vd]:n[vd],[cl]:r[t]}},defineProperty(){pn(11)},getPrototypeOf(e){return Fi(e.base_)},setPrototypeOf(){pn(12)}},ul={};for(let e in jd){let t=jd[e];ul[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ul.deleteProperty=function(e,t){return ul.set.call(this,e,t,void 0)};ul.set=function(e,t,r){return jd.set.call(this,e[0],t,r,e[0])};function Am(e,t){const r=e[jr];return(r?sa(r):e)[t]}function m6(e,t,r){var s;const n=ES(t,r);return n?cl in n?n[cl]:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function ES(e,t){if(!(t in e))return;let r=Fi(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Fi(r)}}function Mh(e){e.modified_||(e.modified_=!0,e.parent_&&Mh(e.parent_))}function td(e){e.copy_||(e.assigned_=new Map,e.copy_=Sh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var h6=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,s)=>{if(wi(r)&&!wi(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}wi(n)||pn(6),s!==void 0&&!wi(s)&&pn(7);let i;if(Nn(r)){const o=Ty(this),l=Ph(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?_h(o):Oh(o)}return Dy(o,s),Iy(i,o)}else if(!r||!Tg(r)){if(i=n(r),i===void 0&&(i=r),i===SS&&(i=void 0),this.autoFreeze_&&Rg(i,!0),s){const o=[],l=[];Zs(Ch).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),s(o,l)}return i}else pn(1,r)},this.produceWithPatches=(r,n)=>{if(wi(r))return(l,...c)=>this.produceWithPatches(l,d=>r(d,...c));let s,i;return[this.produce(r,n,(l,c)=>{s=l,i=c}),s,i]},Pm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Pm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Pm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Nn(t)||pn(8),va(t)&&(t=bn(t));const r=Ty(this),n=Ph(r,t,void 0);return n[jr].isManual_=!0,Oh(r),n}finishDraft(t,r){const n=t&&t[jr];(!n||!n.isManual_)&&pn(9);const{scope_:s}=n;return Dy(s,r),Iy(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const i=r[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(r=r.slice(n+1));const s=Zs(Ch).applyPatches_;return va(t)?s(t,r):this.produce(t,i=>s(i,r))}};function Ph(e,t,r,n){const[s,i]=of(t)?Zs(bd).proxyMap_(t,r):lf(t)?Zs(bd).proxySet_(t,r):f6(t,r);return((r==null?void 0:r.scope_)??OS()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?d6(r,i,n):i.callbacks_.push(function(c){var u;(u=c.mapSetPlugin_)==null||u.fixSetContents(i);const{patchPlugin_:d}=c;i.modified_&&d&&d.generatePatches_(i,[],c)}),s}function bn(e){return va(e)||pn(10,e),DS(e)}function DS(e){if(!Nn(e)||cf(e))return e;const t=e[jr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Sh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Sh(e,!0);return af(r,(s,i)=>{yd(r,s,DS(i))},n),t&&(t.finalized_=!1),r}var p6=new h6,TS=p6.produce;function IS(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var g6=IS(),x6=IS,v6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?gd:gd.apply(null,arguments)};function ln(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(qr(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>kS(n)&&n.type===e,r}var RS=class Vo extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Vo.prototype)}static get[Symbol.species](){return Vo}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Vo(...t[0].concat(this)):new Vo(...t.concat(this))}};function $y(e){return Nn(e)?TS(e,()=>{}):e}function Tc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function y6(e){return typeof e=="boolean"}var b6=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new RS;return r&&(y6(r)?o.push(g6):o.push(x6(r.extraArgument))),o},$S="RTK_autoBatch",ct=()=>e=>({payload:e,meta:{[$S]:!0}}),zy=e=>t=>{setTimeout(t,e)},zS=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let s=!0,i=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:zy(10):e.type==="callback"?e.queueNotification:zy(e.timeout),d=()=>{o=!1,i&&(i=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>s&&u(),m=n.subscribe(f);return l.add(u),()=>{m(),l.delete(u)}},dispatch(u){var f;try{return s=!((f=u==null?void 0:u.meta)!=null&&f[$S]),i=!s,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{s=!0}}})},w6=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new RS(e);return n&&s.push(zS(typeof n=="object"?n:void 0)),s};function j6(e){const t=b6(),{reducer:r=void 0,middleware:n,devTools:s=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Dg(r))l=NS(r);else throw new Error(qr(1));let c;typeof n=="function"?c=n(t):c=t();let d=gd;s&&(d=v6({trace:!1,...typeof s=="object"&&s}));const u=t6(...c),f=w6(u);let m=typeof o=="function"?o(f):f();const h=d(...m);return jS(l,i,h)}function LS(e){const t={},r=[];let n;const s={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(qr(28));if(l in t)throw new Error(qr(29));return t[l]=o,s},addAsyncThunk(i,o){return o.pending&&(t[i.pending.type]=o.pending),o.rejected&&(t[i.rejected.type]=o.rejected),o.fulfilled&&(t[i.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:i.settled,reducer:o.settled}),s},addMatcher(i,o){return r.push({matcher:i,reducer:o}),s},addDefaultCase(i){return n=i,s}};return e(s),[t,r,n]}function N6(e){return typeof e=="function"}function k6(e,t){let[r,n,s]=LS(t),i;if(N6(e))i=()=>$y(e());else{const l=$y(e);i=()=>l}function o(l=i(),c){let d=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[s]),d.reduce((u,f)=>{if(f)if(va(u)){const h=f(u,c);return h===void 0?u:h}else{if(Nn(u))return TS(u,m=>f(m,c));{const m=f(u,c);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},l)}return o.getInitialState=i,o}var S6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",C6=(e=21)=>{let t="",r=e;for(;r--;)t+=S6[Math.random()*64|0];return t},_6=Symbol.for("rtk-slice-createasyncthunk");function O6(e,t){return`${e}/${t}`}function M6({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[_6];return function(s){const{name:i,reducerPath:o=i}=s;if(!i)throw new Error(qr(11));const l=(typeof s.reducers=="function"?s.reducers(A6()):s.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(N,k){const b=typeof N=="string"?N:N.type;if(!b)throw new Error(qr(12));if(b in d.sliceCaseReducersByType)throw new Error(qr(13));return d.sliceCaseReducersByType[b]=k,u},addMatcher(N,k){return d.sliceMatchers.push({matcher:N,reducer:k}),u},exposeAction(N,k){return d.actionCreators[N]=k,u},exposeCaseReducer(N,k){return d.sliceCaseReducersByName[N]=k,u}};c.forEach(N=>{const k=l[N],b={reducerName:N,type:O6(i,N),createNotation:typeof s.reducers=="function"};D6(k)?I6(b,k,u,t):E6(b,k,u)});function f(){const[N={},k=[],b=void 0]=typeof s.extraReducers=="function"?LS(s.extraReducers):[s.extraReducers],S={...N,...d.sliceCaseReducersByType};return k6(s.initialState,_=>{for(let C in S)_.addCase(C,S[C]);for(let C of d.sliceMatchers)_.addMatcher(C.matcher,C.reducer);for(let C of k)_.addMatcher(C.matcher,C.reducer);b&&_.addDefaultCase(b)})}const m=N=>N,h=new Map,g=new WeakMap;let x;function v(N,k){return x||(x=f()),x(N,k)}function y(){return x||(x=f()),x.getInitialState()}function w(N,k=!1){function b(_){let C=_[N];return typeof C>"u"&&k&&(C=Tc(g,b,y)),C}function S(_=m){const C=Tc(h,k,()=>new WeakMap);return Tc(C,_,()=>{const E={};for(const[P,O]of Object.entries(s.selectors??{}))E[P]=P6(O,_,()=>Tc(g,_,y),k);return E})}return{reducerPath:N,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const j={name:i,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:y,...w(o),injectInto(N,{reducerPath:k,...b}={}){const S=k??o;return N.inject({reducerPath:S,reducer:v},b),{...j,...w(S,!0)}}};return j}}function P6(e,t,r,n){function s(i,...o){let l=t(i);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return s.unwrapped=e,s}var Rr=M6();function A6(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function E6({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!T6(n))throw new Error(qr(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?ln(e,o):ln(e))}function D6(e){return e._reducerDefinitionType==="asyncThunk"}function T6(e){return e._reducerDefinitionType==="reducerWithPrepare"}function I6({type:e,reducerName:t},r,n,s){if(!s)throw new Error(qr(18));const{payloadCreator:i,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=s(e,i,u);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),l&&n.addCase(f.pending,l),c&&n.addCase(f.rejected,c),d&&n.addMatcher(f.settled,d),n.exposeCaseReducer(t,{fulfilled:o||Ic,pending:l||Ic,rejected:c||Ic,settled:d||Ic})}function Ic(){}var R6="task",FS="listener",BS="completed",$g="cancelled",$6=`task-${$g}`,z6=`task-${BS}`,Ah=`${FS}-${$g}`,L6=`${FS}-${BS}`,uf=class{constructor(e){Zf(this,"name","TaskAbortError");Zf(this,"message");this.code=e,this.message=`${R6} ${$g} (reason: ${e})`}},zg=(e,t)=>{if(typeof e!="function")throw new TypeError(qr(32))},Nd=()=>{},WS=(e,t=Nd)=>(e.catch(t),e),US=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Is=e=>{if(e.aborted)throw new uf(e.reason)};function qS(e,t){let r=Nd;return new Promise((n,s)=>{const i=()=>s(new uf(e.reason));if(e.aborted){i();return}r=US(e,i),t.finally(()=>r()).then(n,s)}).finally(()=>{r=Nd})}var F6=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof uf?"cancelled":"rejected",error:r}}finally{t==null||t()}},kd=e=>t=>WS(qS(e,t).then(r=>(Is(e),r))),HS=e=>{const t=kd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Mi}=Object,Ly={},ff="listenerMiddleware",B6=(e,t)=>{const r=n=>US(e,()=>n.abort(e.reason));return(n,s)=>{zg(n);const i=new AbortController;r(i);const o=F6(async()=>{Is(e),Is(i.signal);const l=await n({pause:kd(i.signal),delay:HS(i.signal),signal:i.signal});return Is(i.signal),l},()=>i.abort(z6));return s!=null&&s.autoJoin&&t.push(o.catch(Nd)),{result:kd(e)(o),cancel(){i.abort($6)}}}},W6=(e,t)=>{const r=async(n,s)=>{Is(t);let i=()=>{};const l=[new Promise((c,d)=>{let u=e({predicate:n,effect:(f,m)=>{m.unsubscribe(),c([f,m.getState(),m.getOriginalState()])}});i=()=>{u(),d()}})];s!=null&&l.push(new Promise(c=>setTimeout(c,s,null)));try{const c=await qS(t,Promise.race(l));return Is(t),c}finally{i()}};return(n,s)=>WS(r(n,s))},KS=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=ln(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(qr(21));return zg(i),{predicate:s,type:t,effect:i}},YS=Mi(e=>{const{type:t,predicate:r,effect:n}=KS(e);return{id:C6(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(qr(22))}}},{withTypes:()=>YS}),Fy=(e,t)=>{const{type:r,effect:n,predicate:s}=KS(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===n)},Eh=e=>{e.pending.forEach(t=>{t.abort(Ah)})},U6=(e,t)=>()=>{for(const r of t.keys())Eh(r);e.clear()},By=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},GS=Mi(ln(`${ff}/add`),{withTypes:()=>GS}),q6=ln(`${ff}/removeAll`),VS=Mi(ln(`${ff}/remove`),{withTypes:()=>VS}),H6=(...e)=>{console.error(`${ff}/error`,...e)},ec=(e={})=>{const t=new Map,r=new Map,n=h=>{const g=r.get(h)??0;r.set(h,g+1)},s=h=>{const g=r.get(h)??1;g===1?r.delete(h):r.set(h,g-1)},{extra:i,onError:o=H6}=e;zg(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),g=>{h.unsubscribe(),g!=null&&g.cancelActive&&Eh(h)}),c=h=>{const g=Fy(t,h)??YS(h);return l(g)};Mi(c,{withTypes:()=>c});const d=h=>{const g=Fy(t,h);return g&&(g.unsubscribe(),h.cancelActive&&Eh(g)),!!g};Mi(d,{withTypes:()=>d});const u=async(h,g,x,v)=>{const y=new AbortController,w=W6(c,y.signal),j=[];try{h.pending.add(y),n(h),await Promise.resolve(h.effect(g,Mi({},x,{getOriginalState:v,condition:(N,k)=>w(N,k).then(Boolean),take:w,delay:HS(y.signal),pause:kd(y.signal),extra:i,signal:y.signal,fork:B6(y.signal,j),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((N,k,b)=>{N!==y&&(N.abort(Ah),b.delete(N))})},cancel:()=>{y.abort(Ah),h.pending.delete(y)},throwIfCancelled:()=>{Is(y.signal)}})))}catch(N){N instanceof uf||By(o,N,{raisedBy:"effect"})}finally{await Promise.all(j),y.abort(L6),s(h),h.pending.delete(y)}},f=U6(t,r);return{middleware:h=>g=>x=>{if(!kS(x))return g(x);if(GS.match(x))return c(x.payload);if(q6.match(x)){f();return}if(VS.match(x))return d(x.payload);let v=h.getState();const y=()=>{if(v===Ly)throw new Error(qr(23));return v};let w;try{if(w=g(x),t.size>0){const j=h.getState(),N=Array.from(t.values());for(const k of N){let b=!1;try{b=k.predicate(x,j,v)}catch(S){b=!1,By(o,S,{raisedBy:"predicate"})}b&&u(k,x,h,y)}}}finally{v=Ly}return w},startListening:c,stopListening:d,clearListeners:f}};function qr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var K6={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},XS=Rr({name:"chartLayout",initialState:K6,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Y6,setLayout:G6,setChartSize:V6,setScale:X6}=XS.actions,Q6=XS.reducer;function QS(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Ue(e){return Number.isFinite(e)}function qn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ni(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wy(Object(r),!0).forEach(function(n){Z6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Z6(e,t,r){return(t=J6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function J6(e){var t=eF(e,"string");return typeof t=="symbol"?t:t+""}function eF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ar(e,t,r){return qt(e)||qt(t)?r:Un(t)?Li(e,t,r):typeof t=="function"?t(e):r}var tF=(e,t,r)=>{if(t&&r){var{width:n,height:s}=r,{align:i,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&i!=="center"&&ve(e[i]))return Ni(Ni({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&ve(e[o]))return Ni(Ni({},e),{},{[o]:e[o]+(s||0)})}return e},us=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",ZS=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var s,i,o=e.map(l=>(l.coordinate===t&&(s=!0),l.coordinate===r&&(i=!0),l.coordinate));return s||o.push(t),i||o.push(r),o},JS=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:s,range:i,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:m,axisType:h}=e;if(!o)return null;var g=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,x=s==="category"&&o.bandwidth?o.bandwidth()/g:0;if(x=h==="angleAxis"&&i&&i.length>=2?Or(i[0]-i[1])*2*x:x,f||m){var v=(f||m||[]).map((y,w)=>{var j=n?n.indexOf(y):y,N=o.map(j);return Ue(N)?{coordinate:N+x,value:y,offset:x,index:w}:null}).filter(Mr);return v}return c&&d?d.map((y,w)=>{var j=o.map(y);return Ue(j)?{coordinate:j+x,value:y,index:w,offset:x}:null}).filter(Mr):o.ticks&&u!=null?o.ticks(u).map((y,w)=>{var j=o.map(y);return Ue(j)?{coordinate:j+x,value:y,index:w,offset:x}:null}).filter(Mr):o.domain().map((y,w)=>{var j=o.map(y);return Ue(j)?{coordinate:j+x,value:n?n[y]:y,index:w,offset:x}:null}).filter(Mr)},rF=(e,t)=>{if(!t||t.length!==2||!ve(t[0])||!ve(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),s=[e[0],e[1]];return(!ve(e[0])||e[0]<r)&&(s[0]=r),(!ve(e[1])||e[1]>n)&&(s[1]=n),s[0]>n&&(s[0]=n),s[1]<r&&(s[1]=r),s},nF=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0,l=0;l<r;++l){var c=e[l],d=c==null?void 0:c[s];if(d!=null){var u=d[1],f=d[0],m=Wn(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},aF=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0;o<r;++o){var l=e[o],c=l==null?void 0:l[s];if(c!=null){var d=Wn(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},sF={sign:nF,expand:dL,none:Xs,silhouette:uL,wiggle:fL,positive:aF},iF=(e,t,r)=>{var n,s=(n=sF[r])!==null&&n!==void 0?n:Xs,i=cL().keys(t).value((l,c)=>Number(ar(l,c,0))).order(wh).offset(s),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=ar(e[u],t[c],0);Array.isArray(f)&&f.length===2&&ve(f[0])&&ve(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function oF(e){return e==null?void 0:String(e)}var Uy=e=>{var{axis:t,ticks:r,offset:n,bandSize:s,entry:i,index:o}=e;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var l=ar(i,t.dataKey,t.scale.domain()[o]);if(qt(l))return null;var c=t.scale.map(l);return ve(c)?c-s/2+n:null},lF=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return n<=0&&s>=0?0:s<0?s:n}return r[0]},cF=e=>{var t=e.flat(2).filter(ve);return[Math.min(...t),Math.max(...t)]},dF=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],uF=(e,t,r)=>{if(e!=null)return dF(Object.keys(e).reduce((n,s)=>{var i=e[s];if(!i)return n;var{stackedData:o}=i,l=o.reduce((c,d)=>{var u=QS(d,t,r),f=cF(u);return!Ue(f[0])||!Ue(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},qy=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Hy=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Sd=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var s=rf(t,u=>u.coordinate),i=1/0,o=1,l=s.length;o<l;o++){var c=s[o],d=s[o-1];i=Math.min(((c==null?void 0:c.coordinate)||0)-((d==null?void 0:d.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function Ky(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:s,name:i}=e;return Ni(Ni({},t),{},{dataKey:r,payload:n,value:s,name:i})}function e2(e,t){if(e)return String(e);if(typeof t=="string")return t}var fF=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},mF=(e,t)=>t==="centric"?e.angle:e.radius,Pa=e=>e.layout.width,Aa=e=>e.layout.height,hF=e=>e.layout.scale,t2=e=>e.layout.margin,mf=H(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),hf=H(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),pF="data-recharts-item-index",gF="data-recharts-item-id",tc=60;function Yy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yy(Object(r),!0).forEach(function(n){xF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xF(e,t,r){return(t=vF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vF(e){var t=yF(e,"string");return typeof t=="symbol"?t:t+""}function yF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bF=e=>e.brush.height;function wF(e){var t=hf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:tc;return r+s}return r},0)}function jF(e){var t=hf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:tc;return r+s}return r},0)}function NF(e){var t=mf(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function kF(e){var t=mf(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Kt=H([Pa,Aa,t2,bF,wF,jF,NF,kF,wS,VL],(e,t,r,n,s,i,o,l,c,d)=>{var u={left:(r.left||0)+s,right:(r.right||0)+i},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},m=Rc(Rc({},f),u),h=m.bottom;m.bottom+=n,m=tF(m,c,d);var g=e-m.left-m.right,x=t-m.top-m.bottom;return Rc(Rc({brushBottom:h},m),{},{width:Math.max(g,0),height:Math.max(x,0)})}),SF=H(Kt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Lg=H(Pa,Aa,(e,t)=>({x:0,y:0,width:e,height:t})),CF=p.createContext(null),$r=()=>p.useContext(CF)!=null,pf=e=>e.brush,gf=H([pf,Kt,t2],(e,t,r)=>({height:e.height,x:ve(e.x)?e.x:t.left,y:ve(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:ve(e.width)?e.width:t.width})),r2={},n2={},a2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:s,edges:i}={}){let o,l=null;const c=i!=null&&i.includes("leading"),d=i==null||i.includes("trailing"),u=()=>{l!==null&&(r.apply(o,l),o=void 0,l=null)},f=()=>{d&&u(),x()};let m=null;const h=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},g=()=>{m!==null&&(clearTimeout(m),m=null)},x=()=>{g(),o=void 0,l=null},v=()=>{u()},y=function(...w){if(s!=null&&s.aborted)return;o=this,l=w;const j=m==null;h(),c&&j&&u()};return y.schedule=h,y.cancel=x,y.flush=v,s==null||s.addEventListener("abort",x,{once:!0}),y}e.debounce=t})(a2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a2;function r(n,s=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:l=!0,maxWait:c}=i,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let u,f=null;const m=t.debounce(function(...x){u=n.apply(this,x),f=null},s,{edges:d}),h=function(...x){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,x),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,x),u)},g=()=>(m.flush(),u);return h.cancel=m.cancel,h.flush=g,h}e.debounce=r})(n2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=n2;function r(n,s=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return t.debounce(n,s,{leading:o,maxWait:s,trailing:l})}e.throttle=r})(r2);var _F=r2.throttle;const OF=Sa(_F);var Cd=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(r.replace(/%s/g,()=>s[o++]))}},zn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},s2=(e,t,r)=>{var{width:n=zn.width,height:s=zn.height,aspect:i,maxHeight:o}=r,l=Qs(n)?e:Number(n),c=Qs(s)?t:Number(s);return i&&i>0&&(l?c=l/i:c&&(l=c*i),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},MF={width:0,height:0,overflow:"visible"},PF={width:0,overflowX:"visible"},AF={height:0,overflowY:"visible"},EF={},DF=e=>{var{width:t,height:r}=e,n=Qs(t),s=Qs(r);return n&&s?MF:n?PF:s?AF:EF};function TF(e){var{width:t,height:r,aspect:n}=e,s=t,i=r;return s===void 0&&i===void 0?(s=zn.width,i=zn.height):s===void 0?s=n&&n>0?void 0:zn.width:i===void 0&&(i=n&&n>0?void 0:zn.height),{width:s,height:i}}function Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dh.apply(null,arguments)}function Gy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Vy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gy(Object(r),!0).forEach(function(n){IF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IF(e,t,r){return(t=RF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RF(e){var t=$F(e,"string");return typeof t=="symbol"?t:t+""}function $F(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i2=p.createContext(zn.initialDimension);function zF(e){return qn(e.width)&&qn(e.height)}function o2(e){var{children:t,width:r,height:n}=e,s=p.useMemo(()=>({width:r,height:n}),[r,n]);return zF(s)?p.createElement(i2.Provider,{value:s},t):null}var Fg=()=>p.useContext(i2),LF=p.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=zn.initialDimension,width:s,height:i,minWidth:o=zn.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=zn.debounce,id:f,className:m,onResize:h,style:g={}}=e,x=p.useRef(null),v=p.useRef();v.current=h,p.useImperativeHandle(t,()=>x.current);var[y,w]=p.useState({containerWidth:n.width,containerHeight:n.height}),j=p.useCallback((_,C)=>{w(E=>{var P=Math.round(_),O=Math.round(C);return E.containerWidth===P&&E.containerHeight===O?E:{containerWidth:P,containerHeight:O}})},[]);p.useEffect(()=>{if(x.current==null||typeof ResizeObserver>"u")return fo;var _=O=>{var $,D=O[0];if(D!=null){var{width:B,height:A}=D.contentRect;j(B,A),($=v.current)===null||$===void 0||$.call(v,B,A)}};u>0&&(_=OF(_,u,{trailing:!0,leading:!1}));var C=new ResizeObserver(_),{width:E,height:P}=x.current.getBoundingClientRect();return j(E,P),C.observe(x.current),()=>{C.disconnect()}},[j,u]);var{containerWidth:N,containerHeight:k}=y;Cd(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:b,calculatedHeight:S}=s2(N,k,{width:s,height:i,aspect:r,maxHeight:c});return Cd(b!=null&&b>0||S!=null&&S>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
543
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
544
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
545
|
+
height and width.`,b,S,s,i,o,l,r),p.createElement("div",{id:f?"".concat(f):void 0,className:tt("recharts-responsive-container",m),style:Vy(Vy({},g),{},{width:s,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:x},p.createElement("div",{style:DF({width:s,height:i})},p.createElement(o2,{width:b,height:S},d)))}),_d=p.forwardRef((e,t)=>{var r=Fg();if(qn(r.width)&&qn(r.height))return e.children;var{width:n,height:s}=TF({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=s2(void 0,void 0,{width:n,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return ve(i)&&ve(o)?p.createElement(o2,{width:i,height:o},e.children):p.createElement(LF,Dh({},e,{width:n,height:s,ref:t}))});function Bg(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var xf=()=>{var e,t=$r(),r=Se(SF),n=Se(gf),s=(e=Se(pf))===null||e===void 0?void 0:e.padding;return!t||!n||!s?r:{width:n.width-s.left-s.right,height:n.height-s.top-s.bottom,x:s.left,y:s.top}},FF={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},l2=()=>{var e;return(e=Se(Kt))!==null&&e!==void 0?e:FF},c2=()=>Se(Pa),d2=()=>Se(Aa),rt=e=>e.layout.layoutType,mo=()=>Se(rt),u2=()=>{var e=mo();if(e==="horizontal"||e==="vertical")return e},f2=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},BF=()=>{var e=mo();return e!==void 0},rc=e=>{var t=_t(),r=$r(),{width:n,height:s}=e,i=Fg(),o=n,l=s;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:s),p.useEffect(()=>{!r&&qn(o)&&qn(l)&&t(V6({width:o,height:l}))},[t,r,o,l]),null},m2=Symbol.for("immer-nothing"),Xy=Symbol.for("immer-draftable"),Kr=Symbol.for("immer-state");function gn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fl=Object.getPrototypeOf;function Bi(e){return!!e&&!!e[Kr]}function Js(e){var t;return e?h2(e)||Array.isArray(e)||!!e[Xy]||!!((t=e.constructor)!=null&&t[Xy])||nc(e)||yf(e):!1}var WF=Object.prototype.constructor.toString(),Qy=new WeakMap;function h2(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Qy.get(r);return n===void 0&&(n=Function.toString.call(r),Qy.set(r,n)),n===WF}function Od(e,t,r=!0){vf(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function vf(e){const t=e[Kr];return t?t.type_:Array.isArray(e)?1:nc(e)?2:yf(e)?3:0}function Th(e,t){return vf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function p2(e,t,r){const n=vf(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function UF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nc(e){return e instanceof Map}function yf(e){return e instanceof Set}function ws(e){return e.copy_||e.base_}function Ih(e,t){if(nc(e))return new Map(e);if(yf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=h2(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Kr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(n[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(fl(e),n)}else{const n=fl(e);if(n!==null&&r)return{...e};const s=Object.create(n);return Object.assign(s,e)}}function Wg(e,t=!1){return bf(e)||Bi(e)||!Js(e)||(vf(e)>1&&Object.defineProperties(e,{set:$c,add:$c,clear:$c,delete:$c}),Object.freeze(e),t&&Object.values(e).forEach(r=>Wg(r,!0))),e}function qF(){gn(2)}var $c={value:qF};function bf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var HF={};function ei(e){const t=HF[e];return t||gn(0,e),t}var ml;function g2(){return ml}function KF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zy(e,t){t&&(ei("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Rh(e){$h(e),e.drafts_.forEach(YF),e.drafts_=null}function $h(e){e===ml&&(ml=e.parent_)}function Jy(e){return ml=KF(ml,e)}function YF(e){const t=e[Kr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function eb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Kr].modified_&&(Rh(t),gn(4)),Js(e)&&(e=Md(t,e),t.parent_||Pd(t,e)),t.patches_&&ei("Patches").generateReplacementPatches_(r[Kr].base_,e,t.patches_,t.inversePatches_)):e=Md(t,r,[]),Rh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==m2?e:void 0}function Md(e,t,r){if(bf(t))return t;const n=e.immer_.shouldUseStrictIteration(),s=t[Kr];if(!s)return Od(t,(i,o)=>tb(e,s,t,i,o,r),n),t;if(s.scope_!==e)return t;if(!s.modified_)return Pd(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let o=i,l=!1;s.type_===3&&(o=new Set(i),i.clear(),l=!0),Od(o,(c,d)=>tb(e,s,i,c,d,r,l),n),Pd(e,i,!1),r&&e.patches_&&ei("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function tb(e,t,r,n,s,i,o){if(s==null||typeof s!="object"&&!o)return;const l=bf(s);if(!(l&&!o)){if(Bi(s)){const c=i&&t&&t.type_!==3&&!Th(t.assigned_,n)?i.concat(n):void 0,d=Md(e,s,c);if(p2(r,n,d),Bi(d))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(Js(s)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===s&&l)return;Md(e,s),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(nc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Pd(e,s)}}}function Pd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wg(t,r)}function GF(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:g2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=Ug;r&&(s=[n],i=hl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,l}var Ug={get(e,t){if(t===Kr)return e;const r=ws(e);if(!Th(r,t))return VF(e,r,t);const n=r[t];return e.finalized_||!Js(n)?n:n===Em(e.base_,t)?(Dm(e),e.copy_[t]=Lh(n,e)):n},has(e,t){return t in ws(e)},ownKeys(e){return Reflect.ownKeys(ws(e))},set(e,t,r){const n=x2(ws(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Em(ws(e),t),i=s==null?void 0:s[Kr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(UF(r,s)&&(r!==void 0||Th(e.base_,t)))return!0;Dm(e),zh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Em(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Dm(e),zh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ws(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){gn(11)},getPrototypeOf(e){return fl(e.base_)},setPrototypeOf(){gn(12)}},hl={};Od(Ug,(e,t)=>{hl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});hl.deleteProperty=function(e,t){return hl.set.call(this,e,t,void 0)};hl.set=function(e,t,r){return Ug.set.call(this,e[0],t,r,e[0])};function Em(e,t){const r=e[Kr];return(r?ws(r):e)[t]}function VF(e,t,r){var s;const n=x2(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function x2(e,t){if(!(t in e))return;let r=fl(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=fl(r)}}function zh(e){e.modified_||(e.modified_=!0,e.parent_&&zh(e.parent_))}function Dm(e){e.copy_||(e.copy_=Ih(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XF=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const o=this;return function(c=i,...d){return o.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&gn(6),n!==void 0&&typeof n!="function"&&gn(7);let s;if(Js(t)){const i=Jy(this),o=Lh(t,void 0);let l=!0;try{s=r(o),l=!1}finally{l?Rh(i):$h(i)}return Zy(i,n),eb(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===m2&&(s=void 0),this.autoFreeze_&&Wg(s,!0),n){const i=[],o=[];ei("Patches").generateReplacementPatches_(t,s,i,o),n(i,o)}return s}else gn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,s;return[this.produce(t,r,(o,l)=>{n=o,s=l}),n,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Js(e)||gn(8),Bi(e)&&(e=QF(e));const t=Jy(this),r=Lh(e,void 0);return r[Kr].isManual_=!0,$h(t),r}finishDraft(e,t){const r=e&&e[Kr];(!r||!r.isManual_)&&gn(9);const{scope_:n}=r;return Zy(n,t),eb(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const n=ei("Patches").applyPatches_;return Bi(e)?n(e,t):this.produce(e,s=>n(s,t))}};function Lh(e,t){const r=nc(e)?ei("MapSet").proxyMap_(e,t):yf(e)?ei("MapSet").proxySet_(e,t):GF(e,t);return(t?t.scope_:g2()).drafts_.push(r),r}function QF(e){return Bi(e)||gn(10,e),v2(e)}function v2(e){if(!Js(e)||bf(e))return e;const t=e[Kr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ih(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ih(e,!0);return Od(r,(s,i)=>{p2(r,s,v2(i))},n),t&&(t.finalized_=!1),r}var ZF=new XF;ZF.produce;var JF={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},y2=Rr({name:"legend",initialState:JF,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:ct()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).payload.indexOf(r);s>-1&&(e.payload[s]=n)},prepare:ct()},removeLegendPayload:{reducer(e,t){var r=bn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:ct()}}}),{setLegendSize:hee,setLegendSettings:pee,addLegendPayload:e8,replaceLegendPayload:t8,removeLegendPayload:r8}=y2.actions,n8=y2.reducer;function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fh.apply(null,arguments)}function rb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rb(Object(r),!0).forEach(function(n){a8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a8(e,t,r){return(t=s8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s8(e){var t=i8(e,"string");return typeof t=="symbol"?t:t+""}function i8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o8(e){return Array.isArray(e)&&Un(e[0])&&Un(e[1])?e.join(" ~ "):e}var pi={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},l8=e=>{var{separator:t=pi.separator,contentStyle:r,itemStyle:n,labelStyle:s=pi.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=pi.accessibilityLayer}=e,h=()=>{if(i&&i.length){var k={padding:0,margin:0},b=(l?rf(i,l):i).map((S,_)=>{if(S.type==="none")return null;var C=S.formatter||o||o8,{value:E,name:P}=S,O=E,$=P;if(C){var D=C(E,P,S,_,i);if(Array.isArray(D))[O,$]=D;else if(D!=null)O=D;else return null}var B=zo(zo({},pi.itemStyle),{},{color:S.color||pi.itemStyle.color},n);return p.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:B},Un($)?p.createElement("span",{className:"recharts-tooltip-item-name"},$):null,Un($)?p.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,p.createElement("span",{className:"recharts-tooltip-item-value"},O),p.createElement("span",{className:"recharts-tooltip-item-unit"},S.unit||""))});return p.createElement("ul",{className:"recharts-tooltip-item-list",style:k},b)}return null},g=zo(zo({},pi.contentStyle),r),x=zo({margin:0},s),v=!qt(u),y=v?u:"",w=tt("recharts-default-tooltip",c),j=tt("recharts-tooltip-label",d);v&&f&&i!==void 0&&i!==null&&(y=f(u,i));var N=m?{role:"status","aria-live":"assertive"}:{};return p.createElement("div",Fh({className:w,style:g},N),p.createElement("p",{className:j,style:x},p.isValidElement(y)?y:"".concat(y)),h())},Lo="recharts-tooltip-wrapper",c8={visibility:"hidden"};function d8(e){var{coordinate:t,translateX:r,translateY:n}=e;return tt(Lo,{["".concat(Lo,"-right")]:ve(r)&&t&&ve(t.x)&&r>=t.x,["".concat(Lo,"-left")]:ve(r)&&t&&ve(t.x)&&r<t.x,["".concat(Lo,"-bottom")]:ve(n)&&t&&ve(t.y)&&n>=t.y,["".concat(Lo,"-top")]:ve(n)&&t&&ve(t.y)&&n<t.y})}function nb(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:s,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&ve(i[n]))return i[n];var u=r[n]-l-(s>0?s:0),f=r[n]+s;if(t[n])return o[n]?u:f;var m=c[n];if(m==null)return 0;if(o[n]){var h=u,g=m;return h<g?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var x=f+l,v=m+d;return x>v?Math.max(u,m):Math.max(f,m)}function u8(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function f8(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:s,position:i,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,u,f,m;return l.height>0&&l.width>0&&r?(f=nb({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=nb({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=u8({translateX:f,translateY:m,useTranslate3d:c})):u=c8,{cssProperties:u,cssClasses:d8({translateX:f,translateY:m,coordinate:r})}}function ab(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ab(Object(r),!0).forEach(function(n){Bh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ab(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bh(e,t,r){return(t=m8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m8(e){var t=h8(e,"string");return typeof t=="symbol"?t:t+""}function h8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class p8 extends p.PureComponent{constructor(){super(...arguments),Bh(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Bh(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,s,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(s=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&s!==void 0?s:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.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)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:s,children:i,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:m,viewBox:h,wrapperStyle:g,lastBoundingBox:x,innerRef:v,hasPortalFromProps:y}=this.props,w=typeof d=="number"?d:d.x,j=typeof d=="number"?d:d.y,{cssClasses:N,cssProperties:k}=f8({allowEscapeViewBox:r,coordinate:o,offsetLeft:w,offsetTop:j,position:u,reverseDirection:f,tooltipBox:{height:x.height,width:x.width},useTranslate3d:m,viewBox:h}),b=y?{}:zc(zc({transition:c&&t?"transform ".concat(n,"ms ").concat(s):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),S=zc(zc({},b),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},g);return p.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:N,style:S,ref:v},i)}}var b2=()=>{var e;return(e=Se(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Wh(){return Wh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wh.apply(null,arguments)}function sb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ib(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sb(Object(r),!0).forEach(function(n){g8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g8(e,t,r){return(t=x8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x8(e){var t=v8(e,"string");return typeof t=="symbol"?t:t+""}function v8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ob={curveBasisClosed:Zz,curveBasisOpen:Jz,curveBasis:Qz,curveBumpX:$z,curveBumpY:zz,curveLinearClosed:eL,curveLinear:Vu,curveMonotoneX:tL,curveMonotoneY:rL,curveNatural:nL,curveStep:aL,curveStepAfter:iL,curveStepBefore:sL},Ad=e=>Ue(e.x)&&Ue(e.y),lb=e=>e.base!=null&&Ad(e.base)&&Ad(e),Fo=e=>e.x,Bo=e=>e.y,y8=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Zl(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=ob["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return ob[r]||Vu},cb={connectNulls:!1,type:"linear"},b8=e=>{var{type:t=cb.type,points:r=[],baseLine:n,layout:s,connectNulls:i=cb.connectNulls}=e,o=y8(t,s),l=i?r.filter(Ad):r;if(Array.isArray(n)){var c,d=r.map((g,x)=>ib(ib({},g),{},{base:n[x]}));s==="vertical"?c=Pc().y(Bo).x1(Fo).x0(g=>g.base.x):c=Pc().x(Fo).y1(Bo).y0(g=>g.base.y);var u=c.defined(lb).curve(o),f=i?d.filter(lb):d;return u(f)}var m;s==="vertical"&&ve(n)?m=Pc().y(Bo).x1(Fo).x0(n):ve(n)?m=Pc().x(Fo).y1(Bo).y0(n):m=Tk().x(Fo).y(Bo);var h=m.defined(Ad).curve(o);return h(l)},w2=e=>{var{className:t,points:r,path:n,pathRef:s}=e,i=mo();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},l=r&&r.length?b8(o):n;return p.createElement("path",Wh({},ga(e),_L(e),{className:tt("recharts-curve",t),d:l===null?void 0:l,ref:s}))},w8=["x","y","top","left","width","height","className"];function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uh.apply(null,arguments)}function db(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function j8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?db(Object(r),!0).forEach(function(n){N8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):db(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function N8(e,t,r){return(t=k8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k8(e){var t=S8(e,"string");return typeof t=="symbol"?t:t+""}function S8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C8(e,t){if(e==null)return{};var r,n,s=_8(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function _8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var O8=(e,t,r,n,s,i)=>"M".concat(e,",").concat(s,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),M8=e=>{var{x:t=0,y:r=0,top:n=0,left:s=0,width:i=0,height:o=0,className:l}=e,c=C8(e,w8),d=j8({x:t,y:r,top:n,left:s,width:i,height:o},c);return!ve(t)||!ve(r)||!ve(i)||!ve(o)||!ve(n)||!ve(s)?null:p.createElement("path",Uh({},on(d),{className:tt("recharts-cross",l),d:O8(t,r,i,o,n,s)}))};function P8(e,t,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function ub(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ub(Object(r),!0).forEach(function(n){A8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ub(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A8(e,t,r){return(t=E8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E8(e){var t=D8(e,"string");return typeof t=="symbol"?t:t+""}function D8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T8=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),j2=(e,t,r)=>e.map(n=>"".concat(T8(n)," ").concat(t,"ms ").concat(r)).join(","),I8=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(s=>n.includes(s))),pl=(e,t)=>Object.keys(t).reduce((r,n)=>fb(fb({},r),{},{[n]:e(n,t[n])}),{});function mb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mb(Object(r),!0).forEach(function(n){R8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R8(e,t,r){return(t=$8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $8(e){var t=z8(e,"string");return typeof t=="symbol"?t:t+""}function z8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ed=(e,t,r)=>e+(t-e)*r,qh=e=>{var{from:t,to:r}=e;return t!==r},N2=(e,t,r)=>{var n=pl((s,i)=>{if(qh(i)){var[o,l]=e(i.from,i.to,i.velocity);return It(It({},i),{},{from:o,velocity:l})}return i},t);return r<1?pl((s,i)=>qh(i)&&n[s]!=null?It(It({},i),{},{velocity:Ed(i.velocity,n[s].velocity,r),from:Ed(i.from,n[s].from,r)}):i,t):N2(e,n,r-1)};function L8(e,t,r,n,s,i){var o,l=n.reduce((m,h)=>It(It({},m),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>pl((m,h)=>h.from,l),d=()=>!Object.values(l).filter(qh).length,u=null,f=m=>{o||(o=m);var h=m-o,g=h/r.dt;l=N2(r,l,g),s(It(It(It({},e),t),c())),o=m,d()||(u=i.setTimeout(f))};return()=>(u=i.setTimeout(f),()=>{var m;(m=u)===null||m===void 0||m()})}function F8(e,t,r,n,s,i,o){var l=null,c=s.reduce((f,m)=>{var h=e[m],g=t[m];return h==null||g==null?f:It(It({},f),{},{[m]:[h,g]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,h=pl((x,v)=>Ed(...v,r(m)),c);if(i(It(It(It({},e),t),h)),m<1)l=o.setTimeout(u);else{var g=pl((x,v)=>Ed(...v,r(1)),c);i(It(It(It({},e),t),g))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const B8=(e,t,r,n,s,i)=>{var o=I8(e,t);return r==null?()=>(s(It(It({},e),t)),()=>{}):r.isStepper===!0?L8(e,t,r,o,s,i):F8(e,t,r,n,o,s,i)};var Dd=1e-4,k2=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],S2=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),hb=(e,t)=>r=>{var n=k2(e,t);return S2(n,r)},W8=(e,t)=>r=>{var n=k2(e,t),s=[...n.map((i,o)=>i*o).slice(1),0];return S2(s,r)},U8=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var s=n.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},q8=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=U8(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},H8=(e,t,r,n)=>{var s=hb(e,r),i=hb(t,n),o=W8(e,r),l=d=>d>1?1:d<0?0:d,c=d=>{for(var u=d>1?1:d,f=u,m=0;m<8;++m){var h=s(f)-u,g=o(f);if(Math.abs(h-u)<Dd||g<Dd)return i(f);f=l(f-h/g)}return i(f)};return c.isStepper=!1,c},pb=function(){return H8(...q8(...arguments))},K8=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:s=17}=t,i=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*s/1e3,m=c*s/1e3+o;return Math.abs(m-l)<Dd&&Math.abs(f)<Dd?[l,0]:[m,f]};return i.isStepper=!0,i.dt=s,i},Y8=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return pb(e);case"spring":return K8();default:if(e.split("(")[0]==="cubic-bezier")return pb(e)}return typeof e=="function"?e:null};function G8(e){var t,r=()=>null,n=!1,s=null,i=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){s=e.setTimeout(i.bind(null,d),c);return}i(c),s=e.setTimeout(i.bind(null,d));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,s&&(s(),s=null),i(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class V8{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),s=null,i=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function X8(){return G8(new V8)}var Q8=p.createContext(X8);function Z8(e,t){var r=p.useContext(Q8);return p.useMemo(()=>t??r(e),[e,t,r])}var J8=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),wf={isSsr:J8()},eB={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},gb={t:0},Tm={t:1};function qg(e){var t=Vr(e,eB),{isActive:r,canBegin:n,duration:s,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!wf.isSsr:r,f=Z8(t.animationId,t.animationManager),[m,h]=p.useState(u?gb:Tm),g=p.useRef(null);return p.useEffect(()=>{u||h(Tm)},[u]),p.useEffect(()=>{if(!u||!n)return fo;var x=B8(gb,Tm,Y8(i),s,h,f.getTimeoutController()),v=()=>{g.current=x()};return f.start([c,o,v,s,l]),()=>{f.stop(),g.current&&g.current(),l()}},[u,n,s,i,o,c,l,f]),d(m.t)}function Hg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=p.useRef(ll(t)),n=p.useRef(e);return n.current!==e&&(r.current=ll(t),n.current=e),r.current}var tB=["radius"],rB=["radius"],xb,vb,yb,bb,wb,jb,Nb,kb,Sb,Cb;function _b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ob(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_b(Object(r),!0).forEach(function(n){nB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_b(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nB(e,t,r){return(t=aB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aB(e){var t=sB(e,"string");return typeof t=="symbol"?t:t+""}function sB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Td.apply(null,arguments)}function Mb(e,t){if(e==null)return{};var r,n,s=iB(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function iB(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function An(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pb=(e,t,r,n,s)=>{var i=Ha(r),o=Ha(n),l=Math.min(Math.abs(i)/2,Math.abs(o)/2),c=o>=0?1:-1,d=i>=0?1:-1,u=o>=0&&i>=0||o<0&&i<0?1:0,f;if(l>0&&Array.isArray(s)){for(var m=[0,0,0,0],h=0,g=4;h<g;h++){var x,v=(x=s[h])!==null&&x!==void 0?x:0;m[h]=v>l?l:v}f=bt(xb||(xb=An(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=bt(vb||(vb=An(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=bt(yb||(yb=An(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=bt(bb||(bb=An(["A ",",",",0,0,",`,
|
|
546
|
+
`,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=bt(wb||(wb=An(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=bt(jb||(jb=An(["A ",",",",0,0,",`,
|
|
547
|
+
`,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=bt(Nb||(Nb=An(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=bt(kb||(kb=An(["A ",",",",0,0,",`,
|
|
548
|
+
`,",",""])),m[3],m[3],u,e,t+n-c*m[3])),f+="Z"}else if(l>0&&s===+s&&s>0){var y=Math.min(l,s);f=bt(Sb||(Sb=An(["M ",",",`
|
|
549
|
+
A `,",",",0,0,",",",",",`
|
|
550
|
+
L `,",",`
|
|
551
|
+
A `,",",",0,0,",",",",",`
|
|
552
|
+
L `,",",`
|
|
553
|
+
A `,",",",0,0,",",",",",`
|
|
554
|
+
L `,",",`
|
|
555
|
+
A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,u,e+d*y,t,e+r-d*y,t,y,y,u,e+r,t+c*y,e+r,t+n-c*y,y,y,u,e+r-d*y,t+n,e+d*y,t+n,y,y,u,e,t+n-c*y)}else f=bt(Cb||(Cb=An(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Ab={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},C2=e=>{var t=Vr(e,Ab),r=p.useRef(null),[n,s]=p.useState(-1);p.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var W=r.current.getTotalLength();W&&s(W)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:h,isAnimationActive:g,isUpdateAnimationActive:x}=t,v=p.useRef(l),y=p.useRef(c),w=p.useRef(i),j=p.useRef(o),N=p.useMemo(()=>({x:i,y:o,width:l,height:c,radius:d}),[i,o,l,c,d]),k=Hg(N,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var b=tt("recharts-rectangle",u);if(!x){var S=on(t),{radius:_}=S,C=Mb(S,tB);return p.createElement("path",Td({},C,{x:Ha(i),y:Ha(o),width:Ha(l),height:Ha(c),radius:typeof d=="number"?d:void 0,className:b,d:Pb(i,o,l,c,d)}))}var E=v.current,P=y.current,O=w.current,$=j.current,D="0px ".concat(n===-1?1:n,"px"),B="".concat(n,"px 0px"),A=j2(["strokeDasharray"],m,typeof f=="string"?f:Ab.animationEasing);return p.createElement(qg,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:x,begin:h},W=>{var Q=tr(E,l,W),K=tr(P,c,W),ie=tr(O,i,W),ne=tr($,o,W);r.current&&(v.current=Q,y.current=K,w.current=ie,j.current=ne);var U;g?W>0?U={transition:A,strokeDasharray:B}:U={strokeDasharray:D}:U={strokeDasharray:B};var Y=on(t),{radius:Z}=Y,G=Mb(Y,rB);return p.createElement("path",Td({},G,{radius:typeof d=="number"?d:void 0,className:b,d:Pb(ie,ne,Q,K,d),ref:r,style:Ob(Ob({},U),t.style)}))})};function Eb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Db(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Eb(Object(r),!0).forEach(function(n){oB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Eb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oB(e,t,r){return(t=lB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lB(e){var t=cB(e,"string");return typeof t=="symbol"?t:t+""}function cB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Id=Math.PI/180,dB=e=>e*180/Math.PI,nr=(e,t,r,n)=>({x:e+Math.cos(-Id*n)*r,y:t+Math.sin(-Id*n)*r}),uB=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},fB=(e,t)=>{var{x:r,y:n}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(n-i)**2)},mB=(e,t)=>{var{x:r,y:n}=e,{cx:s,cy:i}=t,o=fB({x:r,y:n},{x:s,y:i});if(o<=0)return{radius:o,angle:0};var l=(r-s)/o,c=Math.acos(l);return n>i&&(c=2*Math.PI-c),{radius:o,angle:dB(c),angleInRadian:c}},hB=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(n,s);return{startAngle:t-i*360,endAngle:r-i*360}},pB=(e,t)=>{var{startAngle:r,endAngle:n}=t,s=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(s,i);return e+o*360},gB=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:s,angle:i}=mB({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(s<o||s>l||s===0)return null;var{startAngle:c,endAngle:d}=hB(t),u=i,f;if(c<=d){for(;u>d;)u-=360;for(;u<c;)u+=360;f=u>=c&&u<=d}else{for(;u>c;)u-=360;for(;u<d;)u+=360;f=u>=d&&u<=c}return f?Db(Db({},t),{},{radius:s,angle:pB(u,t)}):null};function _2(e){var{cx:t,cy:r,radius:n,startAngle:s,endAngle:i}=e,o=nr(t,r,n,s),l=nr(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}var Tb,Ib,Rb,$b,zb,Lb,Fb;function Hh(){return Hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hh.apply(null,arguments)}function Ms(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var xB=(e,t)=>{var r=Or(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Lc=e=>{var{cx:t,cy:r,radius:n,angle:s,sign:i,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/Id,f=c?s:s+i*u,m=nr(t,r,d,f),h=nr(t,r,n,f),g=c?s-i*u:s,x=nr(t,r,d*Math.cos(u*Id),g);return{center:m,circleTangency:h,lineTangency:x,theta:u}},O2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:i,endAngle:o}=e,l=xB(i,o),c=i+l,d=nr(t,r,s,i),u=nr(t,r,s,c),f=bt(Tb||(Tb=Ms(["M ",",",`
|
|
556
|
+
A `,",",`,0,
|
|
557
|
+
`,",",`,
|
|
558
|
+
`,",",`
|
|
559
|
+
`])),d.x,d.y,s,s,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=nr(t,r,n,i),h=nr(t,r,n,c);f+=bt(Ib||(Ib=Ms(["L ",",",`
|
|
560
|
+
A `,",",`,0,
|
|
561
|
+
`,",",`,
|
|
562
|
+
`,","," Z"])),h.x,h.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=bt(Rb||(Rb=Ms(["L ",","," Z"])),t,r);return f},vB=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Or(d-c),{circleTangency:f,lineTangency:m,theta:h}=Lc({cx:t,cy:r,radius:s,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:g,lineTangency:x,theta:v}=Lc({cx:t,cy:r,radius:s,angle:d,sign:-u,cornerRadius:i,cornerIsExternal:l}),y=l?Math.abs(c-d):Math.abs(c-d)-h-v;if(y<0)return o?bt($b||($b=Ms(["M ",",",`
|
|
563
|
+
a`,",",",0,0,1,",`,0
|
|
564
|
+
a`,",",",0,0,1,",`,0
|
|
565
|
+
`])),m.x,m.y,i,i,i*2,i,i,-i*2):O2({cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:c,endAngle:d});var w=bt(zb||(zb=Ms(["M ",",",`
|
|
566
|
+
A`,",",",0,0,",",",",",`
|
|
567
|
+
A`,",",",0,",",",",",",",`
|
|
568
|
+
A`,",",",0,0,",",",",",`
|
|
569
|
+
`])),m.x,m.y,i,i,+(u<0),f.x,f.y,s,s,+(y>180),+(u<0),g.x,g.y,i,i,+(u<0),x.x,x.y);if(n>0){var{circleTangency:j,lineTangency:N,theta:k}=Lc({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:b,lineTangency:S,theta:_}=Lc({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),C=l?Math.abs(c-d):Math.abs(c-d)-k-_;if(C<0&&i===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=bt(Lb||(Lb=Ms(["L",",",`
|
|
570
|
+
A`,",",",0,0,",",",",",`
|
|
571
|
+
A`,",",",0,",",",",",",",`
|
|
572
|
+
A`,",",",0,0,",",",",","Z"])),S.x,S.y,i,i,+(u<0),b.x,b.y,n,n,+(C>180),+(u>0),j.x,j.y,i,i,+(u<0),N.x,N.y)}else w+=bt(Fb||(Fb=Ms(["L",",","Z"])),t,r);return w},yB={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},M2=e=>{var t=Vr(e,yB),{cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(i<s||d===u)return null;var m=tt("recharts-sector",f),h=i-s,g=jn(o,h,0,!0),x;return g>0&&Math.abs(d-u)<360?x=vB({cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:Math.min(g,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):x=O2({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u}),p.createElement("path",Hh({},on(t),{className:m,d:x}))};function bB(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Xk(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:i,outerRadius:o,angle:l}=t,c=nr(n,s,i,l),d=nr(n,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return _2(t)}}var P2={},A2={},E2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ag;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(E2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E2;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(A2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Eg,r=A2;function n(s,i,o){o&&typeof o!="number"&&t.isIterateeCall(s,i,o)&&(i=o=void 0),s=r.toFinite(s),i===void 0?(i=s,s=0):i=r.toFinite(i),o=o===void 0?s<i?1:-1:r.toFinite(o);const l=Math.max(Math.ceil((i-s)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=s,s+=o;return c}e.range=n})(P2);var wB=P2.range;const D2=Sa(wB);function Xa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jB(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Kg(e){let t,r,n;e.length!==2?(t=Xa,r=(l,c)=>Xa(e(l),c),n=(l,c)=>e(l)-c):(t=e===Xa||e===jB?e:NB,r=e,n=e);function s(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function o(l,c,d=0,u=l.length){const f=s(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:o,right:i}}function NB(){return 0}function T2(e){return e===null?NaN:+e}function*kB(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const SB=Kg(Xa),ac=SB.right;Kg(T2).center;class Bb extends Map{constructor(t,r=OB){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(Wb(this,t))}has(t){return super.has(Wb(this,t))}set(t,r){return super.set(CB(this,t),r)}delete(t){return super.delete(_B(this,t))}}function Wb({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function CB({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function _B({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function OB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function MB(e=Xa){if(e===Xa)return I2;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function I2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const PB=Math.sqrt(50),AB=Math.sqrt(10),EB=Math.sqrt(2);function Rd(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),i=n/Math.pow(10,s),o=i>=PB?10:i>=AB?5:i>=EB?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?Rd(e,t,r*2):[l,c,d]}function Kh(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,i,o]=n?Rd(t,e,r):Rd(e,t,r);if(!(i>=s))return[];const l=i-s+1,c=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)c[d]=(i-d)/-o;else for(let d=0;d<l;++d)c[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(s+d)/-o;else for(let d=0;d<l;++d)c[d]=(s+d)*o;return c}function Yh(e,t,r){return t=+t,e=+e,r=+r,Rd(e,t,r)[2]}function Gh(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?Yh(t,e,r):Yh(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function Ub(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function qb(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function R2(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?I2:MB(s);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),h=Math.max(r,Math.floor(t-d*f/c+m)),g=Math.min(n,Math.floor(t+(c-d)*f/c+m));R2(e,t,h,g,s)}const i=e[t];let o=r,l=n;for(Wo(e,r,t),s(e[n],i)>0&&Wo(e,r,n);o<l;){for(Wo(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?Wo(e,r,l):(++l,Wo(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Wo(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function DB(e,t,r){if(e=Float64Array.from(kB(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return qb(e);if(t>=1)return Ub(e);var n,s=(n-1)*t,i=Math.floor(s),o=Ub(R2(e,i).subarray(0,i+1)),l=qb(e.subarray(i+1));return o+(l-o)*(s-i)}}function TB(e,t,r=T2){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,i=Math.floor(s),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(s-i)}}function IB(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++n<s;)i[n]=e+n*r;return i}function dn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ea(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Vh=Symbol("implicit");function Yg(){var e=new Bb,t=[],r=[],n=Vh;function s(i){let o=e.get(i);if(o===void 0){if(n!==Vh)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Bb;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return Yg(t,r).unknown(n)},dn.apply(s,arguments),s}function Gg(){var e=Yg().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var m=t().length,h=s<n,g=h?s:n,x=h?n:s;i=(x-g)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),g+=(x-g-i*(m-c))*u,o=i*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=IB(m).map(function(y){return g+i*y});return r(h?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,s]=m,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(m){return[n,s]=m,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,d=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(d=+m,f()):d},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return Gg(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},dn.apply(f(),arguments)}function $2(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return $2(t())},e}function RB(){return $2(Gg.apply(null,arguments).paddingInner(1))}function Vg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function z2(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function sc(){}var gl=.7,$d=1/gl,Pi="\\s*([+-]?\\d+)\\s*",xl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$B=/^#([0-9a-f]{3,8})$/,zB=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),LB=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),FB=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${xl}\\)$`),BB=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${xl}\\)$`),WB=new RegExp(`^hsl\\(${xl},${Fn},${Fn}\\)$`),UB=new RegExp(`^hsla\\(${xl},${Fn},${Fn},${xl}\\)$`),Hb={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Vg(sc,vl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kb,formatHex:Kb,formatHex8:qB,formatHsl:HB,formatRgb:Yb,toString:Yb});function Kb(){return this.rgb().formatHex()}function qB(){return this.rgb().formatHex8()}function HB(){return L2(this).formatHsl()}function Yb(){return this.rgb().formatRgb()}function vl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=$B.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Gb(t):r===3?new Pr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Fc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Fc(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=zB.exec(e))?new Pr(t[1],t[2],t[3],1):(t=LB.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FB.exec(e))?Fc(t[1],t[2],t[3],t[4]):(t=BB.exec(e))?Fc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=WB.exec(e))?Qb(t[1],t[2]/100,t[3]/100,1):(t=UB.exec(e))?Qb(t[1],t[2]/100,t[3]/100,t[4]):Hb.hasOwnProperty(e)?Gb(Hb[e]):e==="transparent"?new Pr(NaN,NaN,NaN,0):null}function Gb(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function Fc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Pr(e,t,r,n)}function KB(e){return e instanceof sc||(e=vl(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function Xh(e,t,r,n){return arguments.length===1?KB(e):new Pr(e,t,r,n??1)}function Pr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Vg(Pr,Xh,z2(sc,{brighter(e){return e=e==null?$d:Math.pow($d,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gl:Math.pow(gl,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(Rs(this.r),Rs(this.g),Rs(this.b),zd(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:Vb,formatHex:Vb,formatHex8:YB,formatRgb:Xb,toString:Xb}));function Vb(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}`}function YB(){return`#${Ps(this.r)}${Ps(this.g)}${Ps(this.b)}${Ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xb(){const e=zd(this.opacity);return`${e===1?"rgb(":"rgba("}${Rs(this.r)}, ${Rs(this.g)}, ${Rs(this.b)}${e===1?")":`, ${e})`}`}function zd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ps(e){return e=Rs(e),(e<16?"0":"")+e.toString(16)}function Qb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new xn(e,t,r,n)}function L2(e){if(e instanceof xn)return new xn(e.h,e.s,e.l,e.opacity);if(e instanceof sc||(e=vl(e)),!e)return new xn;if(e instanceof xn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new xn(o,l,c,e.opacity)}function GB(e,t,r,n){return arguments.length===1?L2(e):new xn(e,t,r,n??1)}function xn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Vg(xn,GB,z2(sc,{brighter(e){return e=e==null?$d:Math.pow($d,e),new xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gl:Math.pow(gl,e),new xn(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,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new Pr(Im(e>=240?e-240:e+120,s,n),Im(e,s,n),Im(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new xn(Zb(this.h),Bc(this.s),Bc(this.l),zd(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=zd(this.opacity);return`${e===1?"hsl(":"hsla("}${Zb(this.h)}, ${Bc(this.s)*100}%, ${Bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zb(e){return e=(e||0)%360,e<0?e+360:e}function Bc(e){return Math.max(0,Math.min(1,e||0))}function Im(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Xg=e=>()=>e;function VB(e,t){return function(r){return e+r*t}}function XB(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function QB(e){return(e=+e)==1?F2:function(t,r){return r-t?XB(t,r,e):Xg(isNaN(t)?r:t)}}function F2(e,t){var r=t-e;return r?VB(e,r):Xg(isNaN(e)?t:e)}const Jb=function e(t){var r=QB(t);function n(s,i){var o=r((s=Xh(s)).r,(i=Xh(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=F2(s.opacity,i.opacity);return function(u){return s.r=o(u),s.g=l(u),s.b=c(u),s.opacity=d(u),s+""}}return n.gamma=e,n}(1);function ZB(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(i){for(s=0;s<r;++s)n[s]=e[s]*(1-i)+t[s]*i;return n}}function JB(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eW(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)s[o]=ho(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=s[o](l);return i}}function tW(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ld(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function rW(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=ho(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var Qh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rm=new RegExp(Qh.source,"g");function nW(e){return function(){return e}}function aW(e){return function(t){return e(t)+""}}function sW(e,t){var r=Qh.lastIndex=Rm.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Qh.exec(e))&&(s=Rm.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:Ld(n,s)})),r=Rm.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?aW(c[0].x):nW(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function ho(e,t){var r=typeof t,n;return t==null||r==="boolean"?Xg(t):(r==="number"?Ld:r==="string"?(n=vl(t))?(t=n,Jb):sW:t instanceof vl?Jb:t instanceof Date?tW:JB(t)?ZB:Array.isArray(t)?eW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?rW:Ld)(e,t)}function Qg(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function iW(e,t){t===void 0&&(t=e,e=ho);for(var r=0,n=t.length-1,s=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(s,s=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function oW(e){return function(){return e}}function Fd(e){return+e}var e0=[0,1];function xr(e){return e}function Zh(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:oW(isNaN(t)?NaN:.5)}function lW(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function cW(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=Zh(s,n),i=r(o,i)):(n=Zh(n,s),i=r(i,o)),function(l){return i(n(l))}}function dW(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)s[o]=Zh(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=ac(e,l,1,n)-1;return i[c](s[c](l))}}function ic(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function jf(){var e=e0,t=e0,r=ho,n,s,i,o=xr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==xr&&(o=lW(e[0],e[m-1])),l=m>2?dW:cW,c=d=null,f}function f(m){return m==null||isNaN(m=+m)?i:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return f.invert=function(m){return o(s((d||(d=l(t,e.map(n),Ld)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,Fd),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),r=Qg,u()},f.clamp=function(m){return arguments.length?(o=m?!0:xr,u()):o!==xr},f.interpolate=function(m){return arguments.length?(r=m,u()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,h){return n=m,s=h,u()}}function Zg(){return jf()(xr,xr)}function uW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Wi(e){return e=Bd(Math.abs(e)),e?e[1]:NaN}function fW(e,t){return function(r,n){for(var s=r.length,i=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function mW(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var hW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yl(e){if(!(t=hW.exec(e)))throw new Error("invalid format: "+e);var t;return new Jg({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]})}yl.prototype=Jg.prototype;function Jg(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+""}Jg.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 pW(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var Wd;function gW(e,t){var r=Bd(e,t);if(!r)return Wd=void 0,e.toPrecision(t);var n=r[0],s=r[1],i=s-(Wd=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Bd(e,Math.max(0,t+i-1))[0]}function t0(e,t){var r=Bd(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const r0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:uW,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)=>t0(e*100,t),r:t0,s:gW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function n0(e){return e}var a0=Array.prototype.map,s0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xW(e){var t=e.grouping===void 0||e.thousands===void 0?n0:fW(a0.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?n0:mW(a0.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f,m){f=yl(f);var h=f.fill,g=f.align,x=f.sign,v=f.symbol,y=f.zero,w=f.width,j=f.comma,N=f.precision,k=f.trim,b=f.type;b==="n"?(j=!0,b="g"):r0[b]||(N===void 0&&(N=12),k=!0,b="g"),(y||h==="0"&&g==="=")&&(y=!0,h="0",g="=");var S=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),_=(v==="$"?n:/[%p]/.test(b)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),C=r0[b],E=/[defgprs%]/.test(b);N=N===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function P(O){var $=S,D=_,B,A,W;if(b==="c")D=C(O)+D,O="";else{O=+O;var Q=O<0||1/O<0;if(O=isNaN(O)?c:C(Math.abs(O),N),k&&(O=pW(O)),Q&&+O==0&&x!=="+"&&(Q=!1),$=(Q?x==="("?x:l:x==="-"||x==="("?"":x)+$,D=(b==="s"&&!isNaN(O)&&Wd!==void 0?s0[8+Wd/3]:"")+D+(Q&&x==="("?")":""),E){for(B=-1,A=O.length;++B<A;)if(W=O.charCodeAt(B),48>W||W>57){D=(W===46?s+O.slice(B+1):O.slice(B))+D,O=O.slice(0,B);break}}}j&&!y&&(O=t(O,1/0));var K=$.length+O.length+D.length,ie=K<w?new Array(w-K+1).join(h):"";switch(j&&y&&(O=t(ie+O,ie.length?w-D.length:1/0),ie=""),g){case"<":O=$+O+D+ie;break;case"=":O=$+ie+O+D;break;case"^":O=ie.slice(0,K=ie.length>>1)+$+O+D+ie.slice(K);break;default:O=ie+$+O+D;break}return i(O)}return P.toString=function(){return f+""},P}function u(f,m){var h=Math.max(-8,Math.min(8,Math.floor(Wi(m)/3)))*3,g=Math.pow(10,-h),x=d((f=yl(f),f.type="f",f),{suffix:s0[8+h/3]});return function(v){return x(g*v)}}return{format:d,formatPrefix:u}}var Wc,ex,B2;vW({thousands:",",grouping:[3],currency:["$",""]});function vW(e){return Wc=xW(e),ex=Wc.format,B2=Wc.formatPrefix,Wc}function yW(e){return Math.max(0,-Wi(Math.abs(e)))}function bW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wi(t)/3)))*3-Wi(Math.abs(e)))}function wW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wi(t)-Wi(e))+1}function W2(e,t,r,n){var s=Gh(e,t,r),i;switch(n=yl(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=bW(s,o))&&(n.precision=i),B2(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=wW(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=yW(s))&&(n.precision=i-(n.type==="%")*2);break}}return ex(n)}function fs(e){var t=e.domain;return e.ticks=function(r){var n=t();return Kh(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return W2(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,i=n.length-1,o=n[s],l=n[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=s,s=i,i=d);u-- >0;){if(d=Yh(o,l,r),d===c)return n[s]=o,n[i]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function U2(){var e=Zg();return e.copy=function(){return ic(e,U2())},dn.apply(e,arguments),fs(e)}function q2(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Fd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return q2(e).unknown(t)},e=arguments.length?Array.from(e,Fd):[0,1],fs(r)}function H2(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],i=e[n],o;return i<s&&(o=r,r=n,n=o,o=s,s=i,i=o),e[r]=t.floor(s),e[n]=t.ceil(i),e}function i0(e){return Math.log(e)}function o0(e){return Math.exp(e)}function jW(e){return-Math.log(-e)}function NW(e){return-Math.exp(-e)}function kW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function SW(e){return e===10?kW:e===Math.E?Math.exp:t=>Math.pow(e,t)}function CW(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 l0(e){return(t,r)=>-e(-t,r)}function tx(e){const t=e(i0,o0),r=t.domain;let n=10,s,i;function o(){return s=CW(n),i=SW(n),r()[0]<0?(s=l0(s),i=l0(i),e(jW,NW)):e(i0,o0),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let m=s(d),h=s(u),g,x;const v=l==null?10:+l;let y=[];if(!(n%1)&&h-m<v){if(m=Math.floor(m),h=Math.ceil(h),d>0){for(;m<=h;++m)for(g=1;g<n;++g)if(x=m<0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}}else for(;m<=h;++m)for(g=n-1;g>=1;--g)if(x=m>0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}y.length*2<v&&(y=Kh(d,u,v))}else y=Kh(m,h,Math.min(h-m,v)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=yl(c)).precision==null&&(c.trim=!0),c=ex(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/i(Math.round(s(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(H2(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function K2(){const e=tx(jf()).domain([1,10]);return e.copy=()=>ic(e,K2()).base(e.base()),dn.apply(e,arguments),e}function c0(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function d0(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function rx(e){var t=1,r=e(c0(t),d0(t));return r.constant=function(n){return arguments.length?e(c0(t=+n),d0(t)):t},fs(r)}function Y2(){var e=rx(jf());return e.copy=function(){return ic(e,Y2()).constant(e.constant())},dn.apply(e,arguments)}function u0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function _W(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function OW(e){return e<0?-e*e:e*e}function nx(e){var t=e(xr,xr),r=1;function n(){return r===1?e(xr,xr):r===.5?e(_W,OW):e(u0(r),u0(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},fs(t)}function ax(){var e=nx(jf());return e.copy=function(){return ic(e,ax()).exponent(e.exponent())},dn.apply(e,arguments),e}function MW(){return ax.apply(null,arguments).exponent(.5)}function f0(e){return Math.sign(e)*e*e}function PW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function G2(){var e=Zg(),t=[0,1],r=!1,n;function s(i){var o=PW(e(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return e.invert(f0(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,Fd)).map(f0)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return G2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},dn.apply(s,arguments),fs(s)}function V2(){var e=[],t=[],r=[],n;function s(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=TB(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[ac(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Xa),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return V2().domain(e).range(t).unknown(n)},dn.apply(i,arguments)}function X2(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[ac(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var d=s.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return X2().domain([e,t]).range(s).unknown(i)},dn.apply(fs(o),arguments)}function Q2(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[ac(e,i,0,n)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return Q2().domain(e).range(t).unknown(r)},dn.apply(s,arguments)}const $m=new Date,zm=new Date;function Lt(e,t,r,n){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o<l-i?o:l},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d<i&&i<o);return c},s.filter=i=>Lt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(s.count=(i,o)=>($m.setTime(+i),zm.setTime(+o),e($m),e(zm),Math.floor(r($m,zm))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(n?o=>n(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const Ud=Lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ud.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Lt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ud);Ud.range;const da=1e3,nn=da*60,ua=nn*60,ya=ua*24,sx=ya*7,m0=ya*30,Lm=ya*365,As=Lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*da)},(e,t)=>(t-e)/da,e=>e.getUTCSeconds());As.range;const ix=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*da)},(e,t)=>{e.setTime(+e+t*nn)},(e,t)=>(t-e)/nn,e=>e.getMinutes());ix.range;const ox=Lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*nn)},(e,t)=>(t-e)/nn,e=>e.getUTCMinutes());ox.range;const lx=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*da-e.getMinutes()*nn)},(e,t)=>{e.setTime(+e+t*ua)},(e,t)=>(t-e)/ua,e=>e.getHours());lx.range;const cx=Lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ua)},(e,t)=>(t-e)/ua,e=>e.getUTCHours());cx.range;const oc=Lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*nn)/ya,e=>e.getDate()-1);oc.range;const Nf=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>e.getUTCDate()-1);Nf.range;const Z2=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>Math.floor(e/ya));Z2.range;function li(e){return Lt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*nn)/sx)}const kf=li(0),qd=li(1),AW=li(2),EW=li(3),Ui=li(4),DW=li(5),TW=li(6);kf.range;qd.range;AW.range;EW.range;Ui.range;DW.range;TW.range;function ci(e){return Lt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/sx)}const Sf=ci(0),Hd=ci(1),IW=ci(2),RW=ci(3),qi=ci(4),$W=ci(5),zW=ci(6);Sf.range;Hd.range;IW.range;RW.range;qi.range;$W.range;zW.range;const dx=Lt(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());dx.range;const ux=Lt(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());ux.range;const ba=Lt(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());ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});ba.range;const wa=Lt(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());wa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});wa.range;function J2(e,t,r,n,s,i){const o=[[As,1,da],[As,5,5*da],[As,15,15*da],[As,30,30*da],[i,1,nn],[i,5,5*nn],[i,15,15*nn],[i,30,30*nn],[s,1,ua],[s,3,3*ua],[s,6,6*ua],[s,12,12*ua],[n,1,ya],[n,2,2*ya],[r,1,sx],[t,1,m0],[t,3,3*m0],[e,1,Lm]];function l(d,u,f){const m=u<d;m&&([d,u]=[u,d]);const h=f&&typeof f.range=="function"?f:c(d,u,f),g=h?h.range(d,+u+1):[];return m?g.reverse():g}function c(d,u,f){const m=Math.abs(u-d)/f,h=Kg(([,,v])=>v).right(o,m);if(h===o.length)return e.every(Gh(d/Lm,u/Lm,f));if(h===0)return Ud.every(Math.max(Gh(d,u,f),1));const[g,x]=o[m/o[h-1][2]<o[h][2]/m?h-1:h];return g.every(x)}return[l,c]}const[LW,FW]=J2(wa,ux,Sf,Z2,cx,ox),[BW,WW]=J2(ba,dx,kf,oc,lx,ix);function Fm(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Bm(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Uo(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function UW(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=qo(s),u=Ho(s),f=qo(i),m=Ho(i),h=qo(o),g=Ho(o),x=qo(l),v=Ho(l),y=qo(c),w=Ho(c),j={a:W,A:Q,b:K,B:ie,c:null,d:y0,e:y0,f:f7,g:j7,G:k7,H:c7,I:d7,j:u7,L:eC,m:m7,M:h7,p:ne,q:U,Q:j0,s:N0,S:p7,u:g7,U:x7,V:v7,w:y7,W:b7,x:null,X:null,y:w7,Y:N7,Z:S7,"%":w0},N={a:Y,A:Z,b:G,B:M,c:null,d:b0,e:b0,f:M7,g:L7,G:B7,H:C7,I:_7,j:O7,L:rC,m:P7,M:A7,p:z,q:se,Q:j0,s:N0,S:E7,u:D7,U:T7,V:I7,w:R7,W:$7,x:null,X:null,y:z7,Y:F7,Z:W7,"%":w0},k={a:E,A:P,b:O,B:$,c:D,d:x0,e:x0,f:s7,g:g0,G:p0,H:v0,I:v0,j:t7,L:a7,m:e7,M:r7,p:C,q:JW,Q:o7,s:l7,S:n7,u:GW,U:VW,V:XW,w:YW,W:QW,x:B,X:A,y:g0,Y:p0,Z:ZW,"%":i7};j.x=b(r,j),j.X=b(n,j),j.c=b(t,j),N.x=b(r,N),N.X=b(n,N),N.c=b(t,N);function b(L,q){return function(de){var X=[],Me=-1,ae=0,Ce=L.length,_e,Pe,De;for(de instanceof Date||(de=new Date(+de));++Me<Ce;)L.charCodeAt(Me)===37&&(X.push(L.slice(ae,Me)),(Pe=h0[_e=L.charAt(++Me)])!=null?_e=L.charAt(++Me):Pe=_e==="e"?" ":"0",(De=q[_e])&&(_e=De(de,Pe)),X.push(_e),ae=Me+1);return X.push(L.slice(ae,Me)),X.join("")}}function S(L,q){return function(de){var X=Uo(1900,void 0,1),Me=_(X,L,de+="",0),ae,Ce;if(Me!=de.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(q&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(ae=Bm(Uo(X.y,0,1)),Ce=ae.getUTCDay(),ae=Ce>4||Ce===0?Hd.ceil(ae):Hd(ae),ae=Nf.offset(ae,(X.V-1)*7),X.y=ae.getUTCFullYear(),X.m=ae.getUTCMonth(),X.d=ae.getUTCDate()+(X.w+6)%7):(ae=Fm(Uo(X.y,0,1)),Ce=ae.getDay(),ae=Ce>4||Ce===0?qd.ceil(ae):qd(ae),ae=oc.offset(ae,(X.V-1)*7),X.y=ae.getFullYear(),X.m=ae.getMonth(),X.d=ae.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),Ce="Z"in X?Bm(Uo(X.y,0,1)).getUTCDay():Fm(Uo(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Ce+5)%7:X.w+X.U*7-(Ce+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,Bm(X)):Fm(X)}}function _(L,q,de,X){for(var Me=0,ae=q.length,Ce=de.length,_e,Pe;Me<ae;){if(X>=Ce)return-1;if(_e=q.charCodeAt(Me++),_e===37){if(_e=q.charAt(Me++),Pe=k[_e in h0?q.charAt(Me++):_e],!Pe||(X=Pe(L,de,X))<0)return-1}else if(_e!=de.charCodeAt(X++))return-1}return X}function C(L,q,de){var X=d.exec(q.slice(de));return X?(L.p=u.get(X[0].toLowerCase()),de+X[0].length):-1}function E(L,q,de){var X=h.exec(q.slice(de));return X?(L.w=g.get(X[0].toLowerCase()),de+X[0].length):-1}function P(L,q,de){var X=f.exec(q.slice(de));return X?(L.w=m.get(X[0].toLowerCase()),de+X[0].length):-1}function O(L,q,de){var X=y.exec(q.slice(de));return X?(L.m=w.get(X[0].toLowerCase()),de+X[0].length):-1}function $(L,q,de){var X=x.exec(q.slice(de));return X?(L.m=v.get(X[0].toLowerCase()),de+X[0].length):-1}function D(L,q,de){return _(L,t,q,de)}function B(L,q,de){return _(L,r,q,de)}function A(L,q,de){return _(L,n,q,de)}function W(L){return o[L.getDay()]}function Q(L){return i[L.getDay()]}function K(L){return c[L.getMonth()]}function ie(L){return l[L.getMonth()]}function ne(L){return s[+(L.getHours()>=12)]}function U(L){return 1+~~(L.getMonth()/3)}function Y(L){return o[L.getUTCDay()]}function Z(L){return i[L.getUTCDay()]}function G(L){return c[L.getUTCMonth()]}function M(L){return l[L.getUTCMonth()]}function z(L){return s[+(L.getUTCHours()>=12)]}function se(L){return 1+~~(L.getUTCMonth()/3)}return{format:function(L){var q=b(L+="",j);return q.toString=function(){return L},q},parse:function(L){var q=S(L+="",!1);return q.toString=function(){return L},q},utcFormat:function(L){var q=b(L+="",N);return q.toString=function(){return L},q},utcParse:function(L){var q=S(L+="",!0);return q.toString=function(){return L},q}}}var h0={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,qW=/^%/,HW=/[\\^$*+?|[\]().{}]/g;function Ke(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",i=s.length;return n+(i<r?new Array(r-i+1).join(t)+s:s)}function KW(e){return e.replace(HW,"\\$&")}function qo(e){return new RegExp("^(?:"+e.map(KW).join("|")+")","i")}function Ho(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function YW(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function GW(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function VW(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function XW(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function QW(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function p0(e,t,r){var n=Yt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function g0(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function ZW(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function JW(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function e7(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function x0(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function t7(e,t,r){var n=Yt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function v0(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function r7(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function n7(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function a7(e,t,r){var n=Yt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function s7(e,t,r){var n=Yt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function i7(e,t,r){var n=qW.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function o7(e,t,r){var n=Yt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function l7(e,t,r){var n=Yt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function y0(e,t){return Ke(e.getDate(),t,2)}function c7(e,t){return Ke(e.getHours(),t,2)}function d7(e,t){return Ke(e.getHours()%12||12,t,2)}function u7(e,t){return Ke(1+oc.count(ba(e),e),t,3)}function eC(e,t){return Ke(e.getMilliseconds(),t,3)}function f7(e,t){return eC(e,t)+"000"}function m7(e,t){return Ke(e.getMonth()+1,t,2)}function h7(e,t){return Ke(e.getMinutes(),t,2)}function p7(e,t){return Ke(e.getSeconds(),t,2)}function g7(e){var t=e.getDay();return t===0?7:t}function x7(e,t){return Ke(kf.count(ba(e)-1,e),t,2)}function tC(e){var t=e.getDay();return t>=4||t===0?Ui(e):Ui.ceil(e)}function v7(e,t){return e=tC(e),Ke(Ui.count(ba(e),e)+(ba(e).getDay()===4),t,2)}function y7(e){return e.getDay()}function b7(e,t){return Ke(qd.count(ba(e)-1,e),t,2)}function w7(e,t){return Ke(e.getFullYear()%100,t,2)}function j7(e,t){return e=tC(e),Ke(e.getFullYear()%100,t,2)}function N7(e,t){return Ke(e.getFullYear()%1e4,t,4)}function k7(e,t){var r=e.getDay();return e=r>=4||r===0?Ui(e):Ui.ceil(e),Ke(e.getFullYear()%1e4,t,4)}function S7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ke(t/60|0,"0",2)+Ke(t%60,"0",2)}function b0(e,t){return Ke(e.getUTCDate(),t,2)}function C7(e,t){return Ke(e.getUTCHours(),t,2)}function _7(e,t){return Ke(e.getUTCHours()%12||12,t,2)}function O7(e,t){return Ke(1+Nf.count(wa(e),e),t,3)}function rC(e,t){return Ke(e.getUTCMilliseconds(),t,3)}function M7(e,t){return rC(e,t)+"000"}function P7(e,t){return Ke(e.getUTCMonth()+1,t,2)}function A7(e,t){return Ke(e.getUTCMinutes(),t,2)}function E7(e,t){return Ke(e.getUTCSeconds(),t,2)}function D7(e){var t=e.getUTCDay();return t===0?7:t}function T7(e,t){return Ke(Sf.count(wa(e)-1,e),t,2)}function nC(e){var t=e.getUTCDay();return t>=4||t===0?qi(e):qi.ceil(e)}function I7(e,t){return e=nC(e),Ke(qi.count(wa(e),e)+(wa(e).getUTCDay()===4),t,2)}function R7(e){return e.getUTCDay()}function $7(e,t){return Ke(Hd.count(wa(e)-1,e),t,2)}function z7(e,t){return Ke(e.getUTCFullYear()%100,t,2)}function L7(e,t){return e=nC(e),Ke(e.getUTCFullYear()%100,t,2)}function F7(e,t){return Ke(e.getUTCFullYear()%1e4,t,4)}function B7(e,t){var r=e.getUTCDay();return e=r>=4||r===0?qi(e):qi.ceil(e),Ke(e.getUTCFullYear()%1e4,t,4)}function W7(){return"+0000"}function w0(){return"%"}function j0(e){return+e}function N0(e){return Math.floor(+e/1e3)}var gi,aC,sC;U7({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 U7(e){return gi=UW(e),aC=gi.format,gi.parse,sC=gi.utcFormat,gi.utcParse,gi}function q7(e){return new Date(e)}function H7(e){return e instanceof Date?+e:+new Date(+e)}function fx(e,t,r,n,s,i,o,l,c,d){var u=Zg(),f=u.invert,m=u.domain,h=d(".%L"),g=d(":%S"),x=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),w=d("%b %d"),j=d("%B"),N=d("%Y");function k(b){return(c(b)<b?h:l(b)<b?g:o(b)<b?x:i(b)<b?v:n(b)<b?s(b)<b?y:w:r(b)<b?j:N)(b)}return u.invert=function(b){return new Date(f(b))},u.domain=function(b){return arguments.length?m(Array.from(b,H7)):m().map(q7)},u.ticks=function(b){var S=m();return e(S[0],S[S.length-1],b??10)},u.tickFormat=function(b,S){return S==null?k:d(S)},u.nice=function(b){var S=m();return(!b||typeof b.range!="function")&&(b=t(S[0],S[S.length-1],b??10)),b?m(H2(S,b)):u},u.copy=function(){return ic(u,fx(e,t,r,n,s,i,o,l,c,d))},u}function K7(){return dn.apply(fx(BW,WW,ba,dx,kf,oc,lx,ix,As,aC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Y7(){return dn.apply(fx(LW,FW,wa,ux,Sf,Nf,cx,ox,As,sC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Cf(){var e=0,t=1,r,n,s,i,o=xr,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(i(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),s=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function u(f){return function(m){var h,g;return arguments.length?([h,g]=m,o=f(h,g),d):[o(0),o(1)]}}return d.range=u(ho),d.rangeRound=u(Qg),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return i=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),d}}function ms(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function iC(){var e=fs(Cf()(xr));return e.copy=function(){return ms(e,iC())},Ea.apply(e,arguments)}function oC(){var e=tx(Cf()).domain([1,10]);return e.copy=function(){return ms(e,oC()).base(e.base())},Ea.apply(e,arguments)}function lC(){var e=rx(Cf());return e.copy=function(){return ms(e,lC()).constant(e.constant())},Ea.apply(e,arguments)}function mx(){var e=nx(Cf());return e.copy=function(){return ms(e,mx()).exponent(e.exponent())},Ea.apply(e,arguments)}function G7(){return mx.apply(null,arguments).exponent(.5)}function cC(){var e=[],t=xr;function r(n){if(n!=null&&!isNaN(n=+n))return t((ac(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Xa),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,i)=>DB(e,i/n))},r.copy=function(){return cC(t).domain(e)},Ea.apply(r,arguments)}function _f(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=xr,u,f=!1,m;function h(x){return isNaN(x=+x)?m:(x=.5+((x=+u(x))-i)*(n*x<n*i?l:c),d(f?Math.max(0,Math.min(1,x)):x))}h.domain=function(x){return arguments.length?([e,t,r]=x,s=u(e=+e),i=u(t=+t),o=u(r=+r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,h):[e,t,r]},h.clamp=function(x){return arguments.length?(f=!!x,h):f},h.interpolator=function(x){return arguments.length?(d=x,h):d};function g(x){return function(v){var y,w,j;return arguments.length?([y,w,j]=v,d=iW(x,[y,w,j]),h):[d(0),d(.5),d(1)]}}return h.range=g(ho),h.rangeRound=g(Qg),h.unknown=function(x){return arguments.length?(m=x,h):m},function(x){return u=x,s=x(e),i=x(t),o=x(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,h}}function dC(){var e=fs(_f()(xr));return e.copy=function(){return ms(e,dC())},Ea.apply(e,arguments)}function uC(){var e=tx(_f()).domain([.1,1,10]);return e.copy=function(){return ms(e,uC()).base(e.base())},Ea.apply(e,arguments)}function fC(){var e=rx(_f());return e.copy=function(){return ms(e,fC()).constant(e.constant())},Ea.apply(e,arguments)}function hx(){var e=nx(_f());return e.copy=function(){return ms(e,hx()).exponent(e.exponent())},Ea.apply(e,arguments)}function V7(){return hx.apply(null,arguments).exponent(.5)}const Xo=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Gg,scaleDiverging:dC,scaleDivergingLog:uC,scaleDivergingPow:hx,scaleDivergingSqrt:V7,scaleDivergingSymlog:fC,scaleIdentity:q2,scaleImplicit:Vh,scaleLinear:U2,scaleLog:K2,scaleOrdinal:Yg,scalePoint:RB,scalePow:ax,scaleQuantile:V2,scaleQuantize:X2,scaleRadial:G2,scaleSequential:iC,scaleSequentialLog:oC,scaleSequentialPow:mx,scaleSequentialQuantile:cC,scaleSequentialSqrt:G7,scaleSequentialSymlog:lC,scaleSqrt:MW,scaleSymlog:Y2,scaleThreshold:Q2,scaleTime:K7,scaleUtc:Y7,tickFormat:W2},Symbol.toStringTag,{value:"Module"}));var Da=e=>e.chartData,mC=H([Da],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),hC=(e,t,r,n)=>n?mC(e):Da(e),X7=(e,t,r)=>r?mC(e):Da(e);function ja(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Ue(t)&&Ue(r))return!0}return!1}function k0(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function pC(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,i;if(Ue(r))s=r;else if(typeof r=="function")return;if(Ue(n))i=n;else if(typeof n=="function")return;var o=[s,i];if(ja(o))return o}}function Q7(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(ja(n))return k0(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,i]=e,o,l;if(s==="auto")t!=null&&(o=Math.min(...t));else if(ve(s))o=s;else if(typeof s=="function")try{t!=null&&(o=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&qy.test(s)){var c=qy.exec(s);if(c==null||c[1]==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(i==="auto")t!=null&&(l=Math.max(...t));else if(ve(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&Hy.test(i)){var u=Hy.exec(i);if(u==null||u[1]==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t==null?void 0:t[1];var m=[o,l];if(ja(m))return t==null?m:k0(m,t,r)}}}var po=1e9,Z7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gx,dt=!0,cn="[DecimalError] ",$s=cn+"Invalid argument: ",px=cn+"Exponent out of range: ",go=Math.floor,js=Math.pow,J7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Br,Ut=1e7,ot=7,gC=9007199254740991,Kd=go(gC/ot),he={};he.absoluteValue=he.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};he.comparedTo=he.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};he.decimalPlaces=he.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ot;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};he.dividedBy=he.div=function(e){return ha(this,new this.constructor(e))};he.dividedToIntegerBy=he.idiv=function(e){var t=this,r=t.constructor;return Je(ha(t,new r(e),0,1),r.precision)};he.equals=he.eq=function(e){return!this.cmp(e)};he.exponent=function(){return Dt(this)};he.greaterThan=he.gt=function(e){return this.cmp(e)>0};he.greaterThanOrEqualTo=he.gte=function(e){return this.cmp(e)>=0};he.isInteger=he.isint=function(){return this.e>this.d.length-2};he.isNegative=he.isneg=function(){return this.s<0};he.isPositive=he.ispos=function(){return this.s>0};he.isZero=function(){return this.s===0};he.lessThan=he.lt=function(e){return this.cmp(e)<0};he.lessThanOrEqualTo=he.lte=function(e){return this.cmp(e)<1};he.logarithm=he.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Br))throw Error(cn+"NaN");if(r.s<1)throw Error(cn+(r.s?"NaN":"-Infinity"));return r.eq(Br)?new n(0):(dt=!1,t=ha(bl(r,i),bl(e,i),i),dt=!0,Je(t,s))};he.minus=he.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yC(t,e):xC(t,(e.s=-e.s,e))};he.modulo=he.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(cn+"NaN");return r.s?(dt=!1,t=ha(r,e,0,1).times(e),dt=!0,r.minus(t)):Je(new n(r),s)};he.naturalExponential=he.exp=function(){return vC(this)};he.naturalLogarithm=he.ln=function(){return bl(this)};he.negated=he.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};he.plus=he.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?xC(t,e):yC(t,(e.s=-e.s,e))};he.precision=he.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($s+e);if(t=Dt(s)+1,n=s.d.length-1,r=n*ot+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};he.squareRoot=he.sqrt=function(){var e,t,r,n,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(cn+"NaN")}for(e=Dt(l),dt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Ln(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=go((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=o=r+3;;)if(i=n,n=i.plus(ha(l,i,o+2)).times(.5),Ln(i.d).slice(0,o)===(t=Ln(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(Je(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return dt=!0,Je(n,r)};he.times=he.mul=function(e){var t,r,n,s,i,o,l,c,d,u=this,f=u.constructor,m=u.d,h=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=m.length,d=h.length,c<d&&(i=m,m=h,h=i,o=c,c=d,d=o),i=[],o=c+d,n=o;n--;)i.push(0);for(n=d;--n>=0;){for(t=0,s=c+n;s>n;)l=i[s]+h[n]*m[s-n-1]+t,i[s--]=l%Ut|0,t=l/Ut|0;i[s]=(i[s]+t)%Ut|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,dt?Je(e,f.precision):e};he.toDecimalPlaces=he.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Hn(e,0,po),t===void 0?t=n.rounding:Hn(t,0,8),Je(r,e+Dt(r)+1,t))};he.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=ti(n,!0):(Hn(e,0,po),t===void 0?t=s.rounding:Hn(t,0,8),n=Je(new s(n),e+1,t),r=ti(n,!0,e+1)),r};he.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?ti(s):(Hn(e,0,po),t===void 0?t=i.rounding:Hn(t,0,8),n=Je(new i(s),e+Dt(s)+1,t),r=ti(n.abs(),!1,e+Dt(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};he.toInteger=he.toint=function(){var e=this,t=e.constructor;return Je(new t(e),Dt(e)+1,t.rounding)};he.toNumber=function(){return+this};he.toPower=he.pow=function(e){var t,r,n,s,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(Br);if(l=new c(l),!l.s){if(e.s<1)throw Error(cn+"Infinity");return l}if(l.eq(Br))return l;if(n=c.precision,e.eq(Br))return Je(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=gC){for(s=new c(Br),t=Math.ceil(n/ot+4),dt=!1;r%2&&(s=s.times(l),C0(s.d,t)),r=go(r/2),r!==0;)l=l.times(l),C0(l.d,t);return dt=!0,e.s<0?new c(Br).div(s):Je(s,n)}}else if(i<0)throw Error(cn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,dt=!1,s=e.times(bl(l,n+d)),dt=!0,s=vC(s),s.s=i,s};he.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=Dt(s),n=ti(s,r<=i.toExpNeg||r>=i.toExpPos)):(Hn(e,1,po),t===void 0?t=i.rounding:Hn(t,0,8),s=Je(new i(s),e,t),r=Dt(s),n=ti(s,e<=r||r<=i.toExpNeg,e)),n};he.toSignificantDigits=he.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Hn(e,1,po),t===void 0?t=n.rounding:Hn(t,0,8)),Je(new n(r),e,t)};he.toString=he.valueOf=he.val=he.toJSON=he[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Dt(e),r=e.constructor;return ti(e,t<=r.toExpNeg||t>=r.toExpPos)};function xC(e,t){var r,n,s,i,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),dt?Je(t,f):t;if(c=e.d,d=t.d,o=e.e,s=t.e,c=c.slice(),i=o-s,i){for(i<0?(n=c,i=-i,l=d.length):(n=d,s=o,l=c.length),o=Math.ceil(f/ot),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,n=d,d=c,c=n),r=0;i;)r=(c[--i]=c[i]+d[i]+r)/Ut|0,c[i]%=Ut;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,dt?Je(t,f):t}function Hn(e,t,r){if(e!==~~e||e<t||e>r)throw Error($s+e)}function Ln(e){var t,r,n,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)n=e[t]+"",r=ot-n.length,r&&(i+=Wa(r)),i+=n;o=e[t],n=o+"",r=ot-n.length,r&&(i+=Wa(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var ha=function(){function e(n,s){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*s+o,n[l]=i%Ut|0,o=i/Ut|0;return o&&n.unshift(o),n}function t(n,s,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*Ut+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var l,c,d,u,f,m,h,g,x,v,y,w,j,N,k,b,S,_,C=n.constructor,E=n.s==s.s?1:-1,P=n.d,O=s.d;if(!n.s)return new C(n);if(!s.s)throw Error(cn+"Division by zero");for(c=n.e-s.e,S=O.length,k=P.length,h=new C(E),g=h.d=[],d=0;O[d]==(P[d]||0);)++d;if(O[d]>(P[d]||0)&&--c,i==null?w=i=C.precision:o?w=i+(Dt(n)-Dt(s))+1:w=i,w<0)return new C(0);if(w=w/ot+2|0,d=0,S==1)for(u=0,O=O[0],w++;(d<k||u)&&w--;d++)j=u*Ut+(P[d]||0),g[d]=j/O|0,u=j%O|0;else{for(u=Ut/(O[0]+1)|0,u>1&&(O=e(O,u),P=e(P,u),S=O.length,k=P.length),N=S,x=P.slice(0,S),v=x.length;v<S;)x[v++]=0;_=O.slice(),_.unshift(0),b=O[0],O[1]>=Ut/2&&++b;do u=0,l=t(O,x,S,v),l<0?(y=x[0],S!=v&&(y=y*Ut+(x[1]||0)),u=y/b|0,u>1?(u>=Ut&&(u=Ut-1),f=e(O,u),m=f.length,v=x.length,l=t(f,x,m,v),l==1&&(u--,r(f,S<m?_:O,m))):(u==0&&(l=u=1),f=O.slice()),m=f.length,m<v&&f.unshift(0),r(x,f,v),l==-1&&(v=x.length,l=t(O,x,S,v),l<1&&(u++,r(x,S<v?_:O,v))),v=x.length):l===0&&(u++,x=[0]),g[d++]=u,l&&x[0]?x[v++]=P[N]||0:(x=[P[N]],v=1);while((N++<k||x[0]!==void 0)&&w--)}return g[0]||g.shift(),h.e=c,Je(h,o?i+Dt(h)+1:i)}}();function vC(e,t){var r,n,s,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(Dt(e)>16)throw Error(px+Dt(e));if(!e.s)return new u(Br);for(dt=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(js(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(Br),u.precision=l;;){if(s=Je(s.times(e),l),r=r.times(++c),o=i.plus(ha(s,r,l)),Ln(o.d).slice(0,l)===Ln(i.d).slice(0,l)){for(;d--;)i=Je(i.times(i),l);return u.precision=f,t==null?(dt=!0,Je(i,f)):i}i=o}}function Dt(e){for(var t=e.e*ot,r=e.d[0];r>=10;r/=10)t++;return t}function Wm(e,t,r){if(t>e.LN10.sd())throw dt=!0,r&&(e.precision=r),Error(cn+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function Wa(e){for(var t="";e--;)t+="0";return t}function bl(e,t){var r,n,s,i,o,l,c,d,u,f=1,m=10,h=e,g=h.d,x=h.constructor,v=x.precision;if(h.s<1)throw Error(cn+(h.s?"NaN":"-Infinity"));if(h.eq(Br))return new x(0);if(t==null?(dt=!1,d=v):d=t,h.eq(10))return t==null&&(dt=!0),Wm(x,d);if(d+=m,x.precision=d,r=Ln(g),n=r.charAt(0),i=Dt(h),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=Ln(h.d),n=r.charAt(0),f++;i=Dt(h),n>1?(h=new x("0."+r),i++):h=new x(n+"."+r.slice(1))}else return c=Wm(x,d+2,v).times(i+""),h=bl(new x(n+"."+r.slice(1)),d-m).plus(c),x.precision=v,t==null?(dt=!0,Je(h,v)):h;for(l=o=h=ha(h.minus(Br),h.plus(Br),d),u=Je(h.times(h),d),s=3;;){if(o=Je(o.times(u),d),c=l.plus(ha(o,new x(s),d)),Ln(c.d).slice(0,d)===Ln(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(Wm(x,d+2,v).times(i+""))),l=ha(l,new x(f),d),x.precision=v,t==null?(dt=!0,Je(l,v)):l;l=c,s+=2}}function S0(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=go(r/ot),e.d=[],n=(r+1)%ot,r<0&&(n+=ot),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ot;n<s;)e.d.push(+t.slice(n,n+=ot));t=t.slice(n),n=ot-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),dt&&(e.e>Kd||e.e<-Kd))throw Error(px+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,s,i,o,l,c,d,u,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=ot,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/ot),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=ot,s=n-ot+o}if(r!==void 0&&(i=js(10,o-s-1),l=d/i%10|0,c=t<0||f[u+1]!==void 0||d%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?d/js(10,o-s):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=Dt(e),f.length=1,t=t-i-1,f[0]=js(10,(ot-t%ot)%ot),e.e=go(-t/ot)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,i=1,u--):(f.length=u+1,i=js(10,ot-n),f[u]=s>0?(d/js(10,o-s)%js(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Ut&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Ut)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(dt&&(e.e>Kd||e.e<-Kd))throw Error(px+Dt(e));return e}function yC(e,t){var r,n,s,i,o,l,c,d,u,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),dt?Je(t,h):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),s=Math.max(Math.ceil(h/ot),l)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,u=s<l,u&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){u=c[s]<f[s];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(i=s;i&&c[--i]===0;)c[i]=Ut-1;--c[i],c[s]+=Ut}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,dt?Je(t,h):t):new m(0)}function ti(e,t,r){var n,s=Dt(e),i=Ln(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Wa(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Wa(-s-1)+i,r&&(n=r-o)>0&&(i+=Wa(n))):s>=o?(i+=Wa(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Wa(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Wa(n))),e.s<0?"-"+i:i}function C0(e,t){if(e.length>t)return e.length=t,!0}function bC(e){var t,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error($s+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return S0(o,i.toString())}else if(typeof i!="string")throw Error($s+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,J7.test(i))S0(o,i);else throw Error($s+i)}if(s.prototype=he,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=bC,s.config=s.set=e9,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function e9(e){if(!e||typeof e!="object")throw Error(cn+"Object expected");var t,r,n,s=["precision",1,po,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(go(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error($s+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error($s+r+": "+n);return this}var gx=bC(Z7);Br=new gx(1);const Xe=gx;function wC(e){var t;return e===0?t=1:t=Math.floor(new Xe(e).abs().log(10).toNumber())+1,t}function jC(e,t,r){for(var n=new Xe(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var NC=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},kC=(e,t,r)=>{if(e.lte(0))return new Xe(0);var n=wC(e.toNumber()),s=new Xe(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new Xe(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?new Xe(c.toNumber()):new Xe(Math.ceil(c.toNumber()))},t9=(e,t,r)=>{var n=new Xe(1),s=new Xe(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new Xe(10).pow(wC(e)-1),s=new Xe(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new Xe(Math.floor(e)))}else e===0?s=new Xe(Math.floor((t-1)/2)):r||(s=new Xe(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new Xe(c-o).mul(n)).toNumber());return l},SC=function(t,r,n,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Xe(0),tickMin:new Xe(0),tickMax:new Xe(0)};var o=kC(new Xe(r).sub(t).div(n-1),s,i),l;t<=0&&r>=0?l=new Xe(0):(l=new Xe(t).add(r).div(2),l=l.sub(new Xe(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new Xe(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?SC(t,r,n,s,i+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new Xe(c).mul(o)),tickMax:l.add(new Xe(d).mul(o))})},r9=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),[l,c]=NC([r,n]);if(l===-1/0||c===1/0){var d=c===1/0?[l,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),c];return r>n?d.reverse():d}if(l===c)return t9(l,s,i);var{step:u,tickMin:f,tickMax:m}=SC(l,c,o,i,0),h=jC(f,m.add(new Xe(.1).mul(u)),u);return r>n?h.reverse():h},n9=function(t,r){var[n,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=NC([n,s]);if(o===-1/0||l===1/0)return[n,s];if(o===l)return[o];var c=Math.max(r,2),d=kC(new Xe(l).sub(o).div(c-1),i,0),u=[...jC(new Xe(o),new Xe(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>s?u.reverse():u},CC=e=>e.rootProps.maxBarSize,a9=e=>e.rootProps.barGap,_C=e=>e.rootProps.barCategoryGap,s9=e=>e.rootProps.barSize,Of=e=>e.rootProps.stackOffset,OC=e=>e.rootProps.reverseStackOrder,xx=e=>e.options.chartName,vx=e=>e.rootProps.syncId,MC=e=>e.rootProps.syncMethod,yx=e=>e.options.eventEmitter,vr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},vs={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},En={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Mf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Pf(e,t,r){if(r!=="auto")return r;if(e!=null)return us(e,t)?"category":"number"}function _0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Yd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_0(Object(r),!0).forEach(function(n){i9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function i9(e,t,r){return(t=o9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o9(e){var t=l9(e,"string");return typeof t=="symbol"?t:t+""}function l9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O0={allowDataOverflow:vs.allowDataOverflow,allowDecimals:vs.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:vs.angleAxisId,includeHidden:!1,name:void 0,reversed:vs.reversed,scale:vs.scale,tick:vs.tick,tickCount:void 0,ticks:void 0,type:vs.type,unit:void 0},M0={allowDataOverflow:En.allowDataOverflow,allowDecimals:En.allowDecimals,allowDuplicatedCategory:En.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:En.radiusAxisId,includeHidden:En.includeHidden,name:void 0,reversed:En.reversed,scale:En.scale,tick:En.tick,tickCount:En.tickCount,ticks:void 0,type:En.type,unit:void 0},c9=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},bx=H([c9,f2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Pf(t,"angleAxis",O0.type))!==null&&r!==void 0?r:"category";return Yd(Yd({},O0),{},{type:n})}),d9=(e,t)=>e.polarAxis.radiusAxis[t],wx=H([d9,f2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Pf(t,"radiusAxis",M0.type))!==null&&r!==void 0?r:"category";return Yd(Yd({},M0),{},{type:n})}),Af=e=>e.polarOptions,jx=H([Pa,Aa,Kt],uB),PC=H([Af,jx],(e,t)=>{if(e!=null)return jn(e.innerRadius,t,0)}),AC=H([Af,jx],(e,t)=>{if(e!=null)return jn(e.outerRadius,t,t*.8)}),u9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},EC=H([Af],u9);H([bx,EC],Mf);var DC=H([jx,PC,AC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});H([wx,DC],Mf);var TC=H([rt,Af,PC,AC,Pa,Aa],(e,t,r,n,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:jn(o,s,s/2),cy:jn(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Gt=(e,t)=>t,Ef=(e,t,r)=>r;function Nx(e){return e==null?void 0:e.id}function IC(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=Nx(l);d.forEach((f,m)=>{var h=i==null||s?m:String(ar(f,i,null)),g=ar(f,l.dataKey,0),x;o.has(h)?x=o.get(h):x={},Object.assign(x,{[u]:g}),o.set(h,x)})}}),Array.from(o.values())}function Df(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Tf=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function If(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function f9(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var Vt=e=>{var t=rt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},xo=e=>e.tooltip.settings.axisId;function m9(e){if(e in Xo)return Xo[e]();var t="scale".concat(Zl(e));if(t in Xo)return Xo[t]()}function P0(e){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:function(i){function o(){return i.apply(this,arguments)}return o.toString=function(){return i.toString()},o}(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var o=s[0],l=s[1];return o<=l?i>=o&&i<=l:i>=l&&i<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,o)=>{var l=e(i);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function A0(e,t,r){if(typeof e=="function")return P0(e.copy().domain(t).range(r));if(e!=null){var n=m9(e);if(n!=null)return n.domain(t).range(r),P0(n)}}var h9=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ja(t)){for(var r,n,s=0;s<t.length;s++){var i=t[s];Ue(i)&&((r===void 0||i<r)&&(r=i),(n===void 0||i>n)&&(n=i))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function E0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Gd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E0(Object(r),!0).forEach(function(n){p9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function p9(e,t,r){return(t=g9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g9(e){var t=x9(e,"string");return typeof t=="symbol"?t:t+""}function x9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jh=[0,"auto"],Bt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},RC=(e,t)=>e.cartesianAxis.xAxis[t],Ta=(e,t)=>{var r=RC(e,t);return r??Bt},Wt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Jh,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:tc},$C=(e,t)=>e.cartesianAxis.yAxis[t],Ia=(e,t)=>{var r=$C(e,t);return r??Wt},v9={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},kx=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??v9},Nr=(e,t,r)=>{switch(t){case"xAxis":return Ta(e,r);case"yAxis":return Ia(e,r);case"zAxis":return kx(e,r);case"angleAxis":return bx(e,r);case"radiusAxis":return wx(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},y9=(e,t,r)=>{switch(t){case"xAxis":return Ta(e,r);case"yAxis":return Ia(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},lc=(e,t,r)=>{switch(t){case"xAxis":return Ta(e,r);case"yAxis":return Ia(e,r);case"angleAxis":return bx(e,r);case"radiusAxis":return wx(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},zC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function LC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Sx=e=>e.graphicalItems.cartesianItems,b9=H([Gt,Ef],LC),FC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),cc=H([Sx,Nr,b9],FC,{memoizeOptions:{resultEqualityCheck:If}}),BC=H([cc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Df)),WC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),w9=H([cc],WC),UC=e=>e.map(t=>t.data).filter(Boolean).flat(1),j9=H([cc],UC,{memoizeOptions:{resultEqualityCheck:If}}),qC=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},Cx=H([j9,hC],qC),HC=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:ar(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:ar(s,n)}))):e.map(n=>({value:n})),Rf=H([Cx,Nr,cc],HC);function KC(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function rd(e){if(Un(e)||e instanceof Date){var t=Number(e);if(Ue(t))return t}}function D0(e){if(Array.isArray(e)){var t=[rd(e[0]),rd(e[1])];return ja(t)?t:void 0}var r=rd(e);if(r!=null)return[r,r]}function Na(e){return e.map(rd).filter(Mr)}function N9(e,t,r){return!r||typeof t!="number"||Wn(t)?[]:r.length?Na(r.flatMap(n=>{var s=ar(e,n.dataKey),i,o;if(Array.isArray(s)?[i,o]=s:i=o=s,!(!Ue(i)||!Ue(o)))return[t-i,t+o]})):[]}var Ft=e=>{var t=Vt(e),r=xo(e);return lc(e,t,r)},dc=H([Ft],e=>e==null?void 0:e.dataKey),k9=H([BC,hC,Ft],IC),YC=(e,t,r,n)=>{var s={},i=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},s);return Object.fromEntries(Object.entries(i).map(o=>{var[l,c]=o,d=n?[...c].reverse():c,u=d.map(Nx);return[l,{stackedData:iF(e,u,r),graphicalItems:d}]}))},ep=H([k9,BC,Of,OC],YC),GC=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=uF(e,s,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},S9=H([Nr],e=>e.allowDataOverflow),_x=e=>{var t;if(e==null||!("domain"in e))return Jh;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Na(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Jh},VC=H([Nr],_x),XC=H([VC,S9],pC),C9=H([ep,Da,Gt,XC],GC,{memoizeOptions:{resultEqualityCheck:Tf}}),Ox=e=>e.errorBars,_9=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>KC(r,n)),Vd=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),o=Math.min(...i),l=Math.max(...i);return[o,l]}},QC=(e,t,r,n,s)=>{var i,o;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(y=>KC(s,y)),m=ar(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),h=N9(l,m,f);if(h.length>=2){var g=Math.min(...h),x=Math.max(...h);(i==null||g<i)&&(i=g),(o==null||x>o)&&(o=x)}var v=D0(m);v!=null&&(i=i==null?v[0]:Math.min(i,v[0]),o=o==null?v[1]:Math.max(o,v[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=D0(ar(l,t.dataKey));c!=null&&(i=i==null?c[0]:Math.min(i,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Ue(i)&&Ue(o))return[i,o]},O9=H([Cx,Nr,w9,Ox,Gt],QC,{memoizeOptions:{resultEqualityCheck:Tf}});function M9(e){var{value:t}=e;if(Un(t)||t instanceof Date)return t}var P9=(e,t,r)=>{var n=e.map(M9).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Yk(n))?D2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},ZC=e=>e.referenceElements.dots,vo=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),A9=H([ZC,Gt,Ef],vo),JC=e=>e.referenceElements.areas,E9=H([JC,Gt,Ef],vo),e_=e=>e.referenceElements.lines,D9=H([e_,Gt,Ef],vo),t_=(e,t)=>{if(e!=null){var r=Na(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},T9=H(A9,Gt,t_),r_=(e,t)=>{if(e!=null){var r=Na(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},I9=H([E9,Gt],r_);function R9(e){var t;if(e.x!=null)return Na([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Na(r)}function $9(e){var t;if(e.y!=null)return Na([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Na(r)}var n_=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?R9(n):$9(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},z9=H([D9,Gt],n_),L9=H(T9,z9,I9,(e,t,r)=>Vd(e,r,t)),a_=(e,t,r,n,s,i,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?Vd(n,i,s):Vd(i,s);return Q7(t,d,e.allowDataOverflow)},F9=H([Nr,VC,XC,C9,O9,L9,rt,Gt],a_,{memoizeOptions:{resultEqualityCheck:Tf}}),B9=[0,1],s_=(e,t,r,n,s,i,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=us(t,i);if(d&&l==null){var u;return D2(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?P9(n,e,d):s==="expand"?B9:o}},Mx=H([Nr,rt,Cx,Rf,Of,Gt,F9],s_);function W9(e){return e in Xo}var i_=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string"){var i="scale".concat(Zl(n));return W9(i)?i:"point"}}},yo=H([Nr,zC,xx],i_);function Px(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?A0(e.scale,r,n):A0(t,r,n)}var o_=(e,t,r)=>{var n=_x(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&ja(e))return r9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&ja(e))return n9(e,t.tickCount,t.allowDecimals)}},Ax=H([Mx,lc,yo],o_),l_=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ja(t)&&Array.isArray(r)&&r.length>0){var s,i,o=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],d=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(o,l),Math.max(c,d)]}return t},U9=H([Nr,Mx,Ax,Gt],l_),q9=H(Rf,Nr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Na(e.map(f=>f.value))).sort((f,m)=>f-m),s=n[0],i=n[n.length-1];if(s==null||i==null)return 1/0;var o=i-s;if(o===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],d=n[l+1];if(!(c==null||d==null)){var u=d-c;r=Math.min(r,u)}}return r/o}}),c_=H(q9,rt,_C,Kt,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!Ue(e))return 0;var i=t==="vertical"?n.height:n.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var o=jn(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),H9=(e,t,r)=>{var n=Ta(e,t);return n==null||typeof n.padding!="string"?0:c_(e,"xAxis",t,r,n.padding)},K9=(e,t,r)=>{var n=Ia(e,t);return n==null||typeof n.padding!="string"?0:c_(e,"yAxis",t,r,n.padding)},Y9=H(Ta,H9,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),G9=H(Ia,K9,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),V9=H([Kt,Y9,gf,pf,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:i}=n;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),X9=H([Kt,rt,G9,gf,pf,(e,t,r)=>r],(e,t,r,n,s,i)=>{var{padding:o}=s;return i?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),uc=(e,t,r,n)=>{var s;switch(t){case"xAxis":return V9(e,r,n);case"yAxis":return X9(e,r,n);case"zAxis":return(s=kx(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return EC(e);case"radiusAxis":return DC(e,r);default:return}},d_=H([Nr,uc],Mf),Q9=H([yo,U9],h9),$f=H([Nr,yo,Q9,d_],Px);H([cc,Ox,Gt],_9);function u_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var zf=(e,t)=>t,Lf=(e,t,r)=>r,Z9=H(mf,zf,Lf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(u_)),J9=H(hf,zf,Lf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(u_)),f_=(e,t)=>({width:e.width,height:t.height}),eU=(e,t)=>{var r=typeof t.width=="number"?t.width:tc;return{width:r,height:e.height}},m_=H(Kt,Ta,f_),tU=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},rU=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},nU=H(Aa,Kt,Z9,zf,Lf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=f_(t,l);o==null&&(o=tU(t,n,e));var d=n==="top"&&!s||n==="bottom"&&s;i[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),i}),aU=H(Pa,Kt,J9,zf,Lf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=eU(t,l);o==null&&(o=rU(t,n,e));var d=n==="left"&&!s||n==="right"&&s;i[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),i}),sU=(e,t)=>{var r=Ta(e,t);if(r!=null)return nU(e,r.orientation,r.mirror)},iU=H([Kt,Ta,sU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),oU=(e,t)=>{var r=Ia(e,t);if(r!=null)return aU(e,r.orientation,r.mirror)},lU=H([Kt,Ia,oU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),h_=H(Kt,Ia,(e,t)=>{var r=typeof t.width=="number"?t.width:tc;return{width:r,height:e.height}}),T0=(e,t,r)=>{switch(t){case"xAxis":return m_(e,r).width;case"yAxis":return h_(e,r).height;default:return}},p_=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:o}=r,l=us(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&s&&Yk(c))return c}},Ex=H([rt,Rf,Nr,Gt],p_),g_=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,o=us(e,n);if(o&&(s==="number"||i!=="auto"))return t.map(l=>l.value)}},Dx=H([rt,Rf,lc,Gt],g_),I0=H([rt,y9,yo,$f,Ex,Dx,uc,Ax,Gt],(e,t,r,n,s,i,o,l,c)=>{if(t!=null){var d=us(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:i,duplicateDomain:s,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),cU=(e,t,r,n,s,i,o,l,c)=>{if(!(t==null||n==null)){var d=us(e,c),{type:u,ticks:f,tickCount:m}=t,h=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,g=u==="category"&&n.bandwidth?n.bandwidth()/h:0;g=c==="angleAxis"&&i!=null&&i.length>=2?Or(i[0]-i[1])*2*g:g;var x=f||s;return x?x.map((v,y)=>{var w=o?o.indexOf(v):v,j=n.map(w);return Ue(j)?{index:y,coordinate:j+g,value:v,offset:g}:null}).filter(Mr):d&&l?l.map((v,y)=>{var w=n.map(v);return Ue(w)?{coordinate:w+g,value:v,index:y,offset:g}:null}).filter(Mr):n.ticks?n.ticks(m).map((v,y)=>{var w=n.map(v);return Ue(w)?{coordinate:w+g,value:v,index:y,offset:g}:null}).filter(Mr):n.domain().map((v,y)=>{var w=n.map(v);return Ue(w)?{coordinate:w+g,value:o?o[v]:v,index:y,offset:g}:null}).filter(Mr)}},x_=H([rt,lc,yo,$f,Ax,uc,Ex,Dx,Gt],cU),dU=(e,t,r,n,s,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=us(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Or(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return Ue(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Mr):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return Ue(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Mr):r.domain().map((u,f)=>{var m=r.map(u);return Ue(m)?{coordinate:m+d,value:s?s[u]:u,index:f,offset:d}:null}).filter(Mr)}},Hi=H([rt,lc,$f,uc,Ex,Dx,Gt],dU),Ki=H(Nr,$f,(e,t)=>{if(!(e==null||t==null))return Gd(Gd({},e),{},{scale:t})}),uU=H([Nr,yo,Mx,d_],Px);H((e,t,r)=>kx(e,r),uU,(e,t)=>{if(!(e==null||t==null))return Gd(Gd({},e),{},{scale:t})});var fU=H([rt,mf,hf],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),v_=e=>e.options.defaultTooltipEventType,y_=e=>e.options.validateTooltipEventTypes;function b_(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Tx(e,t){var r=v_(e),n=y_(e);return b_(t,r,n)}function mU(e){return Se(t=>Tx(t,e))}var w_=(e,t)=>{var r,n=Number(t);if(!(Wn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},hU=e=>e.tooltip.settings,qa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},pU={itemInteraction:{click:qa,hover:qa},axisInteraction:{click:qa,hover:qa},keyboardInteraction:qa,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},j_=Rr({name:"tooltip",initialState:pU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:ct()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:ct()},removeTooltipEntrySettings:{reducer(e,t){var r=bn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:ct()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:gU,replaceTooltipEntrySettings:xU,removeTooltipEntrySettings:vU,setTooltipSettingsState:yU,setActiveMouseOverItemIndex:N_,mouseLeaveItem:bU,mouseLeaveChart:k_,setActiveClickItemIndex:wU,setMouseOverAxisIndex:S_,setMouseClickAxisIndex:jU,setSyncInteraction:tp,setKeyboardInteraction:rp}=j_.actions,NU=j_.reducer;function R0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Uc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(r),!0).forEach(function(n){kU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kU(e,t,r){return(t=SU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SU(e){var t=CU(e,"string");return typeof t=="symbol"?t:t+""}function CU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _U(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function OU(e){return e.index!=null}var C_=(e,t,r,n)=>{if(t==null)return qa;var s=_U(e,t,r);if(s==null)return qa;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(OU(s)){if(i)return Uc(Uc({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Uc(Uc({},qa),{},{coordinate:s.coordinate})};function MU(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function PU(e,t){var r=MU(e),n=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(n,s),o=Math.max(n,s);return r>=i&&r<=o}function AU(e,t,r){if(r==null||t==null)return!0;var n=ar(e,t);return n==null||!ja(r)?!0:PU(n,r)}var Ix=(e,t,r,n)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Ue(i))return s;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(i,l)),d=t[c];return d==null||AU(d,r,n)?String(c):null},__=(e,t,r,n,s,i,o)=>{if(i!=null){var l=o[0],c=l==null?void 0:l.getPosition(i);if(c!=null)return c;var d=s==null?void 0:s[Number(i)];if(d)switch(r){case"horizontal":return{x:d.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:d.coordinate}}}},O_=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,s==null&&n!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},M_=e=>e.options.tooltipPayloadSearcher,bo=e=>e.tooltip;function $0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function z0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$0(Object(r),!0).forEach(function(n){EU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EU(e,t,r){return(t=DU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DU(e){var t=TU(e,"string");return typeof t=="symbol"?t:t+""}function TU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IU(e,t){return e??t}var P_=(e,t,r,n,s,i,o)=>{if(!(t==null||i==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((m,h)=>{var g,{dataDefinedOnItem:x,settings:v}=h,y=IU(x,l),w=Array.isArray(y)?QS(y,d,u):y,j=(g=v==null?void 0:v.dataKey)!==null&&g!==void 0?g:n,N=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&o==="axis"?k=gL(w,n,s):k=i(w,t,c,N),Array.isArray(k))k.forEach(S=>{var _=z0(z0({},v),{},{name:S.name,unit:S.unit,color:void 0,fill:void 0});m.push(Ky({tooltipEntrySettings:_,dataKey:S.dataKey,payload:S.payload,value:ar(S.payload,S.dataKey),name:S.name}))});else{var b;m.push(Ky({tooltipEntrySettings:v,dataKey:j,payload:k,value:ar(k,j),name:(b=ar(k,N))!==null&&b!==void 0?b:v==null?void 0:v.name}))}return m},f)}},Rx=H([Ft,zC,xx],i_),RU=H([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),$U=H([Vt,xo],LC),wo=H([RU,Ft,$U],FC,{memoizeOptions:{resultEqualityCheck:If}}),zU=H([wo],e=>e.filter(Df)),LU=H([wo],UC,{memoizeOptions:{resultEqualityCheck:If}}),jo=H([LU,Da],qC),FU=H([zU,Da,Ft],IC),$x=H([jo,Ft,wo],HC),A_=H([Ft],_x),BU=H([Ft],e=>e.allowDataOverflow),E_=H([A_,BU],pC),WU=H([wo],e=>e.filter(Df)),UU=H([FU,WU,Of,OC],YC),qU=H([UU,Da,Vt,E_],GC),HU=H([wo],WC),KU=H([jo,Ft,HU,Ox,Vt],QC,{memoizeOptions:{resultEqualityCheck:Tf}}),YU=H([ZC,Vt,xo],vo),GU=H([YU,Vt],t_),VU=H([JC,Vt,xo],vo),XU=H([VU,Vt],r_),QU=H([e_,Vt,xo],vo),ZU=H([QU,Vt],n_),JU=H([GU,ZU,XU],Vd),eq=H([Ft,A_,E_,qU,KU,JU,rt,Vt],a_),fc=H([Ft,rt,jo,$x,Of,Vt,eq],s_),tq=H([fc,Ft,Rx],o_),rq=H([Ft,fc,tq,Vt],l_),D_=e=>{var t=Vt(e),r=xo(e),n=!1;return uc(e,t,r,n)},T_=H([Ft,D_],Mf),I_=H([Ft,Rx,rq,T_],Px),nq=H([rt,$x,Ft,Vt],p_),aq=H([rt,$x,Ft,Vt],g_),sq=(e,t,r,n,s,i,o,l)=>{if(t){var{type:c}=t,d=us(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Or(s[0]-s[1])*2*f:f,d&&o?o.map((m,h)=>{var g=n.map(m);return Ue(g)?{coordinate:g+f,value:m,index:h,offset:f}:null}).filter(Mr):n.domain().map((m,h)=>{var g=n.map(m);return Ue(g)?{coordinate:g+f,value:i?i[m]:m,index:h,offset:f}:null}).filter(Mr)}}},Ra=H([rt,Ft,Rx,I_,D_,nq,aq,Vt],sq),zx=H([v_,y_,hU],(e,t,r)=>b_(r.shared,e,t)),R_=e=>e.tooltip.settings.trigger,Lx=e=>e.tooltip.settings.defaultIndex,mc=H([bo,zx,R_,Lx],C_),Yi=H([mc,jo,dc,fc],Ix),$_=H([Ra,Yi],w_),z_=H([mc],e=>{if(e)return e.dataKey});H([mc],e=>{if(e)return e.graphicalItemId});var L_=H([bo,zx,R_,Lx],O_),iq=H([Pa,Aa,rt,Kt,Ra,Lx,L_],__),oq=H([mc,iq],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),lq=H([mc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),cq=H([L_,Yi,Da,dc,$_,M_,zx],P_);H([cq],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function L0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function F0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L0(Object(r),!0).forEach(function(n){dq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dq(e,t,r){return(t=uq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uq(e){var t=fq(e,"string");return typeof t=="symbol"?t:t+""}function fq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mq=()=>Se(Ft),hq=()=>{var e=mq(),t=Se(Ra),r=Se(I_);return Sd(!e||!r?void 0:F0(F0({},e),{},{scale:r}),t)};function B0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B0(Object(r),!0).forEach(function(n){pq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pq(e,t,r){return(t=gq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gq(e){var t=xq(e,"string");return typeof t=="symbol"?t:t+""}function xq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vq=(e,t,r,n)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:s.coordinate}}return{x:0,y:0}},yq=(e,t,r,n)=>{var s=t.find(d=>d&&d.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:o}=n;return xi(xi(xi({},n),nr(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=s.coordinate,{angle:c}=n;return xi(xi(xi({},n),nr(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function bq(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var F_=(e,t,r,n,s)=>{var i,o=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,d,u,f,m,h=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(d=r[o-1])===null||d===void 0?void 0:d.coordinate,g=(u=r[l])===null||u===void 0?void 0:u.coordinate,x=l>=o-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(m=r[l+1])===null||m===void 0?void 0:m.coordinate,v=void 0;if(!(h==null||g==null||x==null))if(Or(g-h)!==Or(x-g)){var y=[];if(Or(x-g)===Or(s[1]-s[0])){v=x;var w=g+s[1]-s[0];y[0]=Math.min(w,(w+h)/2),y[1]=Math.max(w,(w+h)/2)}else{v=h;var j=x+s[1]-s[0];y[0]=Math.min(g,(j+g)/2),y[1]=Math.max(g,(j+g)/2)}var N=[Math.min(g,(v+g)/2),Math.max(g,(v+g)/2)];if(e>N[0]&&e<=N[1]||e>=y[0]&&e<=y[1]){var k;return(k=r[l])===null||k===void 0?void 0:k.index}}else{var b=Math.min(h,x),S=Math.max(h,x);if(e>(b+g)/2&&e<=(S+g)/2){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}}else if(t)for(var C=0;C<o;C++){var E=t[C];if(E!=null){var P=t[C+1],O=t[C-1];if(C===0&&P!=null&&e<=(E.coordinate+P.coordinate)/2||C===o-1&&O!=null&&e>(E.coordinate+O.coordinate)/2||C>0&&C<o-1&&O!=null&&P!=null&&e>(E.coordinate+O.coordinate)/2&&e<=(E.coordinate+P.coordinate)/2)return E.index}}return-1},wq=()=>Se(xx),Fx=(e,t)=>t,B_=(e,t,r)=>r,Bx=(e,t,r,n)=>n,jq=H(Ra,e=>rf(e,t=>t.coordinate)),Wx=H([bo,Fx,B_,Bx],C_),Ux=H([Wx,jo,dc,fc],Ix),Nq=(e,t,r)=>{if(t!=null){var n=bo(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},W_=H([bo,Fx,B_,Bx],O_),Xd=H([Pa,Aa,rt,Kt,Ra,Bx,W_],__),kq=H([Wx,Xd],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),U_=H([Ra,Ux],w_),Sq=H([W_,Ux,Da,dc,U_,M_,Fx],P_),Cq=H([Wx,Ux],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),_q=(e,t,r,n,s,i,o)=>{if(!(!e||!r||!n||!s)&&bq(e,o)){var l=fF(e,t),c=F_(l,i,s,r,n),d=vq(t,s,c,e);return{activeIndex:String(c),activeCoordinate:d}}},Oq=(e,t,r,n,s,i,o)=>{if(!(!e||!n||!s||!i||!r)){var l=gB(e,r);if(l){var c=mF(l,t),d=F_(c,o,i,n,s),u=yq(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},Mq=(e,t,r,n,s,i,o,l)=>{if(!(!e||!t||!n||!s||!i))return t==="horizontal"||t==="vertical"?_q(e,t,n,s,i,o,l):Oq(e,t,r,n,s,i,o)},Pq=H(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),Aq=H(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(vr)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:f9}});function W0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function U0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W0(Object(r),!0).forEach(function(n){Eq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Eq(e,t,r){return(t=Dq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dq(e){var t=Tq(e,"string");return typeof t=="symbol"?t:t+""}function Tq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iq={},Rq={zIndexMap:Object.values(vr).reduce((e,t)=>U0(U0({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Iq)},$q=new Set(Object.values(vr));function zq(e){return $q.has(e)}var q_=Rr({name:"zIndex",initialState:Rq,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:ct()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!zq(r)&&delete e.zIndexMap[r])},prepare:ct()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:ct()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:ct()}}}),{registerZIndexPortal:Lq,unregisterZIndexPortal:Fq,registerZIndexPortalElement:Bq,unregisterZIndexPortalElement:Wq}=q_.actions,Uq=q_.reducer;function $a(e){var{zIndex:t,children:r}=e,n=BF(),s=n&&t!==void 0&&t!==0,i=$r(),o=_t();p.useLayoutEffect(()=>s?(o(Lq({zIndex:t})),()=>{o(Fq({zIndex:t}))}):fo,[o,t,s]);var l=Se(c=>Pq(c,t,i));return s?l?bp.createPortal(r,l):null:r}function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},np.apply(null,arguments)}function q0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function qc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q0(Object(r),!0).forEach(function(n){qq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qq(e,t,r){return(t=Hq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hq(e){var t=Kq(e,"string");return typeof t=="symbol"?t:t+""}function Kq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yq(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return p.isValidElement(t)?p.cloneElement(t,n):p.createElement(r,n)}function Gq(e){var t,{coordinate:r,payload:n,index:s,offset:i,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:u}=e,f=r,m=n,h=s;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var g,x,v;if(u==="ScatterChart")g=f,x=M8,v=vr.cursorLine;else if(u==="BarChart")g=P8(l,f,i,o),x=C2,v=vr.cursorRectangle;else if(l==="radial"&&Xk(f)){var{cx:y,cy:w,radius:j,startAngle:N,endAngle:k}=_2(f);g={cx:y,cy:w,startAngle:N,endAngle:k,innerRadius:j,outerRadius:j},x=M2,v=vr.cursorLine}else g={points:bB(l,f,i)},x=w2,v=vr.cursorLine;var b=typeof c=="object"&&"className"in c?c.className:void 0,S=qc(qc(qc(qc({stroke:"#ccc",pointerEvents:"none"},i),g),gg(c)),{},{payload:m,payloadIndex:h,className:tt("recharts-tooltip-cursor",b)});return p.createElement($a,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},p.createElement(Yq,{cursor:c,cursorComp:x,cursorProps:S}))}function Vq(e){var t=hq(),r=l2(),n=mo(),s=wq();return t==null||r==null||n==null||s==null?null:p.createElement(Gq,np({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var H_=p.createContext(null),Xq=()=>p.useContext(H_),K_={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new s(u,f||c,m),g=r?r+d:d;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,h=f.length,g=new Array(h);m<h;m++)g[m]=f[m].fn;return g},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,m,h,g){var x=r?r+d:d;if(!this._events[x])return!1;var v=this._events[x],y=arguments.length,w,j;if(v.fn){switch(v.once&&this.removeListener(d,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,f),!0;case 4:return v.fn.call(v.context,u,f,m),!0;case 5:return v.fn.call(v.context,u,f,m,h),!0;case 6:return v.fn.call(v.context,u,f,m,h,g),!0}for(j=1,w=new Array(y-1);j<y;j++)w[j-1]=arguments[j];v.fn.apply(v.context,w)}else{var N=v.length,k;for(j=0;j<N;j++)switch(v[j].once&&this.removeListener(d,v[j].fn,void 0,!0),y){case 1:v[j].fn.call(v[j].context);break;case 2:v[j].fn.call(v[j].context,u);break;case 3:v[j].fn.call(v[j].context,u,f);break;case 4:v[j].fn.call(v[j].context,u,f,m);break;default:if(!w)for(k=1,w=new Array(y-1);k<y;k++)w[k-1]=arguments[k];v[j].fn.apply(v[j].context,w)}}return!0},l.prototype.on=function(d,u,f){return i(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return i(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,m){var h=r?r+d:d;if(!this._events[h])return this;if(!u)return o(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!m||g.once)&&(!f||g.context===f)&&o(this,h);else{for(var x=0,v=[],y=g.length;x<y;x++)(g[x].fn!==u||m&&!g[x].once||f&&g[x].context!==f)&&v.push(g[x]);v.length?this._events[h]=v.length===1?v[0]:v:o(this,h)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(K_);var Qq=K_.exports;const Zq=Sa(Qq);var wl=new Zq,ap="recharts.syncEvent.tooltip",H0="recharts.syncEvent.brush",Jq=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Wn(r))return e[r]}},eH={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Y_=Rr({name:"options",initialState:eH,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),tH=Y_.reducer,{createEventEmitter:rH}=Y_.actions;function nH(e){return e.tooltip.syncInteraction}var aH={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},G_=Rr({name:"chartData",initialState:aH,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:K0,setDataStartEndIndexes:sH,setComputedData:gee}=G_.actions,iH=G_.reducer,oH=["x","y"];function Y0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y0(Object(r),!0).forEach(function(n){lH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lH(e,t,r){return(t=cH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cH(e){var t=dH(e,"string");return typeof t=="symbol"?t:t+""}function dH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uH(e,t){if(e==null)return{};var r,n,s=fH(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function mH(){var e=Se(vx),t=Se(yx),r=_t(),n=Se(MC),s=Se(Ra),i=mo(),o=xf(),l=Se(c=>c.rootProps.className);p.useEffect(()=>{if(e==null)return fo;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var m;if(o&&u!==null&&u!==void 0&&(m=u.payload)!==null&&m!==void 0&&m.coordinate&&u.payload.sourceViewBox){var h=u.payload.coordinate,{x:g,y:x}=h,v=uH(h,oH),{x:y,y:w,width:j,height:N}=u.payload.sourceViewBox,k=vi(vi({},v),{},{x:o.x+(j?(g-y)/j:0)*o.width,y:o.y+(N?(x-w)/N:0)*o.height});r(vi(vi({},u),{},{payload:vi(vi({},u.payload),{},{coordinate:k})}))}else r(u);return}if(s!=null){var b;if(typeof n=="function"){var S={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},_=n(s,S);b=s[_]}else n==="value"&&(b=s.find(A=>String(A.value)===u.payload.label));var{coordinate:C}=u.payload;if(b==null||u.payload.active===!1||C==null||o==null){r(tp({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:E,y:P}=C,O=Math.min(E,o.x+o.width),$=Math.min(P,o.y+o.height),D={x:i==="horizontal"?b.coordinate:O,y:i==="horizontal"?$:b.coordinate},B=tp({active:u.payload.active,coordinate:D,dataKey:u.payload.dataKey,index:String(b.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(B)}}};return wl.on(ap,c),()=>{wl.off(ap,c)}},[l,r,t,e,n,s,i,o])}function hH(){var e=Se(vx),t=Se(yx),r=_t();p.useEffect(()=>{if(e==null)return fo;var n=(s,i,o)=>{t!==o&&e===s&&r(sH(i))};return wl.on(H0,n),()=>{wl.off(H0,n)}},[r,t,e])}function pH(){var e=_t();p.useEffect(()=>{e(rH())},[e]),mH(),hH()}function gH(e,t,r,n,s,i){var o=Se(h=>Nq(h,e,t)),l=Se(yx),c=Se(vx),d=Se(MC),u=Se(nH),f=u==null?void 0:u.active,m=xf();p.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=tp({active:i,coordinate:r,dataKey:o,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});wl.emit(ap,c,h,l)}},[f,r,o,s,n,l,c,d,i,m])}function G0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function V0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G0(Object(r),!0).forEach(function(n){xH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xH(e,t,r){return(t=vH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vH(e){var t=yH(e,"string");return typeof t=="symbol"?t:t+""}function yH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bH(e){return e.dataKey}function wH(e,t){return p.isValidElement(e)?p.cloneElement(e,t):typeof e=="function"?p.createElement(e,t):p.createElement(l8,t)}var X0=[],jH={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Qd(e){var t,r,n=Vr(e,jH),{active:s,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:h,reverseDirection:g,useTranslate3d:x,wrapperStyle:v,cursor:y,shared:w,trigger:j,defaultIndex:N,portal:k,axisId:b}=n,S=_t(),_=typeof N=="number"?String(N):N;p.useEffect(()=>{S(yU({shared:w,trigger:j,axisId:b,active:s,defaultIndex:_}))},[S,w,j,b,s,_]);var C=xf(),E=b2(),P=mU(w),{activeIndex:O,isActive:$}=(t=Se(z=>Cq(z,P,j,_)))!==null&&t!==void 0?t:{},D=Se(z=>Sq(z,P,j,_)),B=Se(z=>U_(z,P,j,_)),A=Se(z=>kq(z,P,j,_)),W=D,Q=Xq(),K=(r=s??$)!==null&&r!==void 0?r:!1,[ie,ne]=QL([W,K]),U=P==="axis"?B:void 0;gH(P,j,A,U,O,K);var Y=k??Q;if(Y==null||C==null||P==null)return null;var Z=W??X0;K||(Z=X0),d&&Z.length&&(Z=TL(Z.filter(z=>z.value!=null&&(z.hide!==!0||n.includeHidden)),m,bH));var G=Z.length>0,M=p.createElement(p8,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:K,coordinate:A,hasPayload:G,offset:f,position:h,reverseDirection:g,useTranslate3d:x,viewBox:C,wrapperStyle:v,lastBoundingBox:ie,innerRef:ne,hasPortalFromProps:!!k},wH(c,V0(V0({},n),{},{payload:Z,label:U,active:K,activeIndex:O,coordinate:A,accessibilityLayer:E})));return p.createElement(p.Fragment,null,bp.createPortal(M,Y),K&&p.createElement(Vq,{cursor:y,tooltipEventType:P,coordinate:A,payload:Z,index:O}))}var V_=e=>null;V_.displayName="Cell";function NH(e,t,r){return(t=kH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kH(e){var t=SH(e,"string");return typeof t=="symbol"?t:t+""}function SH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class CH{constructor(t){NH(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function Q0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _H(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q0(Object(r),!0).forEach(function(n){OH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OH(e,t,r){return(t=MH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MH(e){var t=PH(e,"string");return typeof t=="symbol"?t:t+""}function PH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AH={cacheSize:2e3,enableCache:!0},X_=_H({},AH),Z0=new CH(X_.cacheSize),EH={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},J0="recharts_measurement_span";function DH(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(i,"|").concat(o,"|").concat(l)}var ew=(e,t)=>{try{var r=document.getElementById(J0);r||(r=document.createElement("span"),r.setAttribute("id",J0),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,EH,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},rl=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wf.isSsr)return{width:0,height:0};if(!X_.enableCache)return ew(t,r);var n=DH(t,r),s=Z0.get(n);if(s)return s;var i=ew(t,r);return Z0.set(n,i),i},Q_;function TH(e,t,r){return(t=IH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IH(e){var t=RH(e,"string");return typeof t=="symbol"?t:t+""}function RH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,rw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$H=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,zH=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,LH={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},FH=["cm","mm","pt","pc","in","Q","px"];function BH(e){return FH.includes(e)}var ki="NaN";function WH(e,t){return e*LH[t]}class er{static parse(t){var r,[,n,s]=(r=zH.exec(t))!==null&&r!==void 0?r:[];return n==null?er.NaN:new er(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Wn(t)&&(this.unit=""),r!==""&&!$H.test(r)&&(this.num=NaN,this.unit=""),BH(r)&&(this.num=WH(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new er(NaN,""):new er(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new er(NaN,""):new er(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new er(NaN,""):new er(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new er(NaN,""):new er(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wn(this.num)}}Q_=er;TH(er,"NaN",new Q_(NaN,""));function Z_(e){if(e==null||e.includes(ki))return ki;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,i]=(r=tw.exec(t))!==null&&r!==void 0?r:[],o=er.parse(n??""),l=er.parse(i??""),c=s==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return ki;t=t.replace(tw,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=rw.exec(t))!==null&&d!==void 0?d:[],h=er.parse(u??""),g=er.parse(m??""),x=f==="+"?h.add(g):h.subtract(g);if(x.isNaN())return ki;t=t.replace(rw,x.toString())}return t}var nw=/\(([^()]*)\)/;function UH(e){for(var t=e,r;(r=nw.exec(t))!=null;){var[,n]=r;t=t.replace(nw,Z_(n))}return t}function qH(e){var t=e.replace(/\s+/g,"");return t=UH(t),t=Z_(t),t}function HH(e){try{return qH(e)}catch{return ki}}function Um(e){var t=HH(e.slice(5,-1));return t===ki?"":t}var KH=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],YH=["dx","dy","angle","className","breakAll"];function sp(){return sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sp.apply(null,arguments)}function aw(e,t){if(e==null)return{};var r,n,s=GH(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function GH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var J_=/[ \f\n\r\t\v\u2028\u2029]+/,eO=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];qt(t)||(r?s=t.toString().split(""):s=t.toString().split(J_));var i=s.map(l=>({word:l,width:rl(l,n).width})),o=r?0:rl(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function VH(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var tO=(e,t,r,n)=>e.reduce((s,i)=>{var{word:o,width:l}=i,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(o),c.width+=l+r;else{var d={words:[o],width:l};s.push(d)}return s},[]),rO=e=>e.reduce((t,r)=>t.width>r.width?t:r),XH="…",sw=(e,t,r,n,s,i,o,l)=>{var c=e.slice(0,t),d=eO({breakAll:r,style:n,children:c+XH});if(!d)return[!1,[]];var u=tO(d.wordsWithComputedWidth,i,o,l),f=u.length>s||rO(u).width>Number(i);return[f,u]},QH=(e,t,r,n,s)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=ve(i),u=String(o),f=tO(t,n,r,s);if(!d||s)return f;var m=f.length>i||rO(f).width>Number(n);if(!m)return f;for(var h=0,g=u.length-1,x=0,v;h<=g&&x<=u.length-1;){var y=Math.floor((h+g)/2),w=y-1,[j,N]=sw(u,w,c,l,i,n,r,s),[k]=sw(u,y,c,l,i,n,r,s);if(!j&&!k&&(h=y+1),j&&k&&(g=y-1),!j&&k){v=N;break}x++}return v||f},iw=e=>{var t=qt(e)?[]:e.toString().split(J_);return[{words:t,width:void 0}]},ZH=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:i,maxLines:o}=e;if((t||r)&&!wf.isSsr){var l,c,d=eO({breakAll:i,children:n,style:s});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return iw(n);return QH({breakAll:i,children:n,maxLines:o,style:s},l,c,t,!!r)}return iw(n)},nO="#808080",JH={angle:0,breakAll:!1,capHeight:"0.71em",fill:nO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},qx=p.forwardRef((e,t)=>{var r=Vr(e,JH),{x:n,y:s,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=aw(r,KH),m=p.useMemo(()=>ZH({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:h,dy:g,angle:x,className:v,breakAll:y}=f,w=aw(f,YH);if(!Un(n)||!Un(s)||m.length===0)return null;var j=Number(n)+(ve(h)?h:0),N=Number(s)+(ve(g)?g:0);if(!Ue(j)||!Ue(N))return null;var k;switch(u){case"start":k=Um("calc(".concat(o,")"));break;case"middle":k=Um("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=Um("calc(".concat(m.length-1," * -").concat(i,")"));break}var b=[],S=m[0];if(c&&S!=null){var _=S.width,{width:C}=f;b.push("scale(".concat(ve(C)&&ve(_)?C/_:1,")"))}return x&&b.push("rotate(".concat(x,", ").concat(j,", ").concat(N,")")),b.length&&(w.transform=b.join(" ")),p.createElement("text",sp({},on(w),{ref:t,x:j,y:N,className:tt("recharts-text",v),textAnchor:d,fill:l.includes("url")?nO:l}),m.map((E,P)=>{var O=E.words.join(y?"":" ");return p.createElement("tspan",{x:j,dy:P===0?k:i,key:"".concat(O,"-").concat(P)},O)}))});qx.displayName="Text";function ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ow(Object(r),!0).forEach(function(n){eK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ow(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eK(e,t,r){return(t=tK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tK(e){var t=rK(e,"string");return typeof t=="symbol"?t:t+""}function rK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nK=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=Bg(t),u=i,f=i+(c-d)/2,m=(u+f)/2,h=(c+d)/2,g=u+c/2,x=l>=0?1:-1,v=x*n,y=x>0?"end":"start",w=x>0?"start":"end",j=c>=0?1:-1,N=j*n,k=j>0?"end":"start",b=j>0?"start":"end",S=s;if(r==="top"){var _={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return S&&(_.height=Math.max(o-S.y,0),_.width=c),_}if(r==="bottom"){var C={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:w};return S&&(C.height=Math.max(S.y+S.height-(o+l),0),C.width=d),C}if(r==="left"){var E={x:m-N,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return S&&(E.width=Math.max(E.x-S.x,0),E.height=l),E}if(r==="right"){var P={x:m+h+N,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"};return S&&(P.width=Math.max(S.x+S.width-P.x,0),P.height=l),P}var O=S?{width:h,height:l}:{};return r==="insideLeft"?Dn({x:m+N,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},O):r==="insideRight"?Dn({x:m+h-N,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},O):r==="insideTop"?Dn({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:w},O):r==="insideBottom"?Dn({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},O):r==="insideTopLeft"?Dn({x:u+N,y:o+v,horizontalAnchor:b,verticalAnchor:w},O):r==="insideTopRight"?Dn({x:u+c-N,y:o+v,horizontalAnchor:k,verticalAnchor:w},O):r==="insideBottomLeft"?Dn({x:f+N,y:o+l-v,horizontalAnchor:b,verticalAnchor:y},O):r==="insideBottomRight"?Dn({x:f+d-N,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},O):r&&typeof r=="object"&&(ve(r.x)||Qs(r.x))&&(ve(r.y)||Qs(r.y))?Dn({x:i+jn(r.x,h),y:o+jn(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},O):Dn({x:g,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},O)},aK=["labelRef"],sK=["content"];function lw(e,t){if(e==null)return{};var r,n,s=iK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function iK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function cw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cw(Object(r),!0).forEach(function(n){oK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oK(e,t,r){return(t=lK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lK(e){var t=cK(e,"string");return typeof t=="symbol"?t:t+""}function cK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ia(){return ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ia.apply(null,arguments)}var aO=p.createContext(null),dK=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o,children:l}=e,c=p.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o}),[t,r,n,s,i,o]);return p.createElement(aO.Provider,{value:c},l)},sO=()=>{var e=p.useContext(aO),t=xf();return e||(t?Bg(t):void 0)},uK=p.createContext(null),fK=()=>{var e=p.useContext(uK),t=Se(TC);return e||t},mK=e=>{var{value:t,formatter:r}=e,n=qt(e.children)?t:e.children;return typeof r=="function"?r(n):n},Hx=e=>e!=null&&typeof e=="function",hK=(e,t)=>{var r=Or(t-e),n=Math.min(Math.abs(t-e),360);return r*n},pK=(e,t,r,n,s)=>{var{offset:i,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:m,clockWise:h}=s,g=(d+u)/2,x=hK(f,m),v=x>=0?1:-1,y,w;switch(t){case"insideStart":y=f+v*i,w=h;break;case"insideEnd":y=m-v*i,w=!h;break;case"end":y=m+v*i,w=h;break;default:throw new Error("Unsupported position ".concat(t))}w=x<=0?w:!w;var j=nr(l,c,g,y),N=nr(l,c,g,y+(w?1:-1)*359),k="M".concat(j.x,",").concat(j.y,`
|
|
573
|
+
A`).concat(g,",").concat(g,",0,1,").concat(w?0:1,`,
|
|
574
|
+
`).concat(N.x,",").concat(N.y),b=qt(e.id)?ll("recharts-radial-line-"):e.id;return p.createElement("text",ia({},n,{dominantBaseline:"central",className:tt("recharts-radial-bar-label",o)}),p.createElement("defs",null,p.createElement("path",{id:b,d:k})),p.createElement("textPath",{xlinkHref:"#".concat(b)},r))},gK=(e,t,r)=>{var{cx:n,cy:s,innerRadius:i,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=nr(n,s,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(i+o)/2,{x:h,y:g}=nr(n,s,m,d);return{x:h,y:g,textAnchor:"middle",verticalAnchor:"middle"}},nd=e=>e!=null&&"cx"in e&&ve(e.cx),xK={angle:0,offset:5,zIndex:vr.label,position:"middle",textBreakAll:!1};function vK(e){if(!nd(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function Ua(e){var t=Vr(e,xK),{viewBox:r,parentViewBox:n,position:s,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=fK(),m=sO(),h=s==="center"?m:f??m,g,x,v;r==null?g=h:nd(r)?g=r:g=Bg(r);var y=vK(g);if(!g||qt(i)&&qt(o)&&!p.isValidElement(l)&&typeof l!="function")return null;var w=Qo(Qo({},t),{},{viewBox:g});if(p.isValidElement(l)){var{labelRef:j}=w,N=lw(w,aK);return p.cloneElement(l,N)}if(typeof l=="function"){var{content:k}=w,b=lw(w,sK);if(x=p.createElement(l,b),p.isValidElement(x))return x}else x=mK(t);var S=on(t);if(nd(g)){if(s==="insideStart"||s==="insideEnd"||s==="end")return pK(t,s,x,S,g);v=gK(g,t.offset,t.position)}else{if(!y)return null;var _=nK({viewBox:y,position:s,offset:t.offset,parentViewBox:nd(n)?void 0:n});v=Qo(Qo({x:_.x,y:_.y,textAnchor:_.horizontalAnchor,verticalAnchor:_.verticalAnchor},_.width!==void 0?{width:_.width}:{}),_.height!==void 0?{height:_.height}:{})}return p.createElement($a,{zIndex:t.zIndex},p.createElement(qx,ia({ref:u,className:tt("recharts-label",c)},S,v,{textAnchor:VH(S.textAnchor)?S.textAnchor:v.textAnchor,breakAll:d}),x))}Ua.displayName="Label";var yK=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?p.createElement(Ua,ia({key:"label-implicit"},n)):Un(e)?p.createElement(Ua,ia({key:"label-implicit",value:e},n)):p.isValidElement(e)?e.type===Ua?p.cloneElement(e,Qo({key:"label-implicit"},n)):p.createElement(Ua,ia({key:"label-implicit",content:e},n)):Hx(e)?p.createElement(Ua,ia({key:"label-implicit",content:e},n)):e&&typeof e=="object"?p.createElement(Ua,ia({},e,{key:"label-implicit"},n)):null};function bK(e){var{label:t,labelRef:r}=e,n=sO();return yK(t,n,r)||null}var iO={},oO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(oO);var lO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(lO);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oO,r=lO,n=ef;function s(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(iO);var wK=iO.last;const jK=Sa(wK);var NK=["valueAccessor"],kK=["dataKey","clockWise","id","textBreakAll","zIndex"];function Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zd.apply(null,arguments)}function dw(e,t){if(e==null)return{};var r,n,s=SK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function SK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var CK=e=>Array.isArray(e.value)?jK(e.value):e.value,cO=p.createContext(void 0),_K=cO.Provider,dO=p.createContext(void 0);dO.Provider;function OK(){return p.useContext(cO)}function MK(){return p.useContext(dO)}function ad(e){var{valueAccessor:t=CK}=e,r=dw(e,NK),{dataKey:n,clockWise:s,id:i,textBreakAll:o,zIndex:l}=r,c=dw(r,kK),d=OK(),u=MK(),f=d||u;return!f||!f.length?null:p.createElement($a,{zIndex:l??vr.label},p.createElement(xa,{className:"recharts-label-list"},f.map((m,h)=>{var g,x=qt(n)?t(m,h):ar(m.payload,n),v=qt(i)?{}:{id:"".concat(i,"-").concat(h)};return p.createElement(Ua,Zd({key:"label-".concat(h)},on(m),c,v,{fill:(g=r.fill)!==null&&g!==void 0?g:m.fill,parentViewBox:m.parentViewBox,value:x,textBreakAll:o,viewBox:m.viewBox,index:h,zIndex:0}))})))}ad.displayName="LabelList";function PK(e){var{label:t}=e;return t?t===!0?p.createElement(ad,{key:"labelList-implicit"}):p.isValidElement(t)||Hx(t)?p.createElement(ad,{key:"labelList-implicit",content:t}):typeof t=="object"?p.createElement(ad,Zd({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var AK={radiusAxis:{},angleAxis:{}},uO=Rr({name:"polarAxis",initialState:AK,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:xee,removeRadiusAxis:vee,addAngleAxis:yee,removeAngleAxis:bee}=uO.actions,EK=uO.reducer;function DK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var fO={exports:{}},nt={};/**
|
|
575
|
+
* @license React
|
|
576
|
+
* react-is.production.js
|
|
577
|
+
*
|
|
578
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
579
|
+
*
|
|
580
|
+
* This source code is licensed under the MIT license found in the
|
|
581
|
+
* LICENSE file in the root directory of this source tree.
|
|
582
|
+
*/var Kx=Symbol.for("react.transitional.element"),Yx=Symbol.for("react.portal"),Ff=Symbol.for("react.fragment"),Bf=Symbol.for("react.strict_mode"),Wf=Symbol.for("react.profiler"),Uf=Symbol.for("react.consumer"),qf=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Kf=Symbol.for("react.suspense"),Yf=Symbol.for("react.suspense_list"),Gf=Symbol.for("react.memo"),Vf=Symbol.for("react.lazy"),TK=Symbol.for("react.view_transition"),IK=Symbol.for("react.client.reference");function un(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Kx:switch(e=e.type,e){case Ff:case Wf:case Bf:case Kf:case Yf:case TK:return e;default:switch(e=e&&e.$$typeof,e){case qf:case Hf:case Vf:case Gf:return e;case Uf:return e;default:return t}}case Yx:return t}}}nt.ContextConsumer=Uf;nt.ContextProvider=qf;nt.Element=Kx;nt.ForwardRef=Hf;nt.Fragment=Ff;nt.Lazy=Vf;nt.Memo=Gf;nt.Portal=Yx;nt.Profiler=Wf;nt.StrictMode=Bf;nt.Suspense=Kf;nt.SuspenseList=Yf;nt.isContextConsumer=function(e){return un(e)===Uf};nt.isContextProvider=function(e){return un(e)===qf};nt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kx};nt.isForwardRef=function(e){return un(e)===Hf};nt.isFragment=function(e){return un(e)===Ff};nt.isLazy=function(e){return un(e)===Vf};nt.isMemo=function(e){return un(e)===Gf};nt.isPortal=function(e){return un(e)===Yx};nt.isProfiler=function(e){return un(e)===Wf};nt.isStrictMode=function(e){return un(e)===Bf};nt.isSuspense=function(e){return un(e)===Kf};nt.isSuspenseList=function(e){return un(e)===Yf};nt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ff||e===Wf||e===Bf||e===Kf||e===Yf||typeof e=="object"&&e!==null&&(e.$$typeof===Vf||e.$$typeof===Gf||e.$$typeof===qf||e.$$typeof===Uf||e.$$typeof===Hf||e.$$typeof===IK||e.getModuleId!==void 0)};nt.typeOf=un;fO.exports=nt;var RK=fO.exports,uw=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",fw=null,qm=null,mO=e=>{if(e===fw&&Array.isArray(qm))return qm;var t=[];return p.Children.forEach(e,r=>{qt(r)||(RK.isFragment(r)?t=t.concat(mO(r.props.children)):t.push(r))}),qm=t,fw=e,t};function $K(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(s=>uw(s)):n=[uw(t)],mO(e).forEach(s=>{var i=Li(s,"type.displayName")||Li(s,"type.name");i&&n.indexOf(i)!==-1&&r.push(s)}),r}var hO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var s;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!((s=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&s.writable)?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(hO);var zK=hO.isPlainObject;const LK=Sa(zK);var mw,hw,pw,gw,xw;function vw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function yw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vw(Object(r),!0).forEach(function(n){FK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FK(e,t,r){return(t=BK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BK(e){var t=WK(e,"string");return typeof t=="symbol"?t:t+""}function WK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jd.apply(null,arguments)}function Ko(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bw=(e,t,r,n,s)=>{var i=r-n,o;return o=bt(mw||(mw=Ko(["M ",",",""])),e,t),o+=bt(hw||(hw=Ko(["L ",",",""])),e+r,t),o+=bt(pw||(pw=Ko(["L ",",",""])),e+r-i/2,t+s),o+=bt(gw||(gw=Ko(["L ",",",""])),e+r-i/2-n,t+s),o+=bt(xw||(xw=Ko(["L ",","," Z"])),e,t),o},UK={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qK=e=>{var t=Vr(e,UK),{x:r,y:n,upperWidth:s,lowerWidth:i,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,m=p.useRef(null),[h,g]=p.useState(-1),x=p.useRef(s),v=p.useRef(i),y=p.useRef(o),w=p.useRef(r),j=p.useRef(n),N=Hg(e,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var D=m.current.getTotalLength();D&&g(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var k=tt("recharts-trapezoid",l);if(!f)return p.createElement("g",null,p.createElement("path",Jd({},on(t),{className:k,d:bw(r,n,s,i,o)})));var b=x.current,S=v.current,_=y.current,C=w.current,E=j.current,P="0px ".concat(h===-1?1:h,"px"),O="".concat(h,"px 0px"),$=j2(["strokeDasharray"],d,c);return p.createElement(qg,{animationId:N,key:N,canBegin:h>0,duration:d,easing:c,isActive:f,begin:u},D=>{var B=tr(b,s,D),A=tr(S,i,D),W=tr(_,o,D),Q=tr(C,r,D),K=tr(E,n,D);m.current&&(x.current=B,v.current=A,y.current=W,w.current=Q,j.current=K);var ie=D>0?{transition:$,strokeDasharray:O}:{strokeDasharray:P};return p.createElement("path",Jd({},on(t),{className:k,d:bw(Q,K,B,A,W),ref:m,style:yw(yw({},ie),t.style)}))})},HK=["option","shapeType","activeClassName"];function KK(e,t){if(e==null)return{};var r,n,s=YK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function YK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ww(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ww(Object(r),!0).forEach(function(n){GK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ww(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GK(e,t,r){return(t=VK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VK(e){var t=XK(e,"string");return typeof t=="symbol"?t:t+""}function XK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QK(e,t){return eu(eu({},t),e)}function ZK(e,t){return e==="symbols"}function jw(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return p.createElement(C2,r);case"trapezoid":return p.createElement(qK,r);case"sector":return p.createElement(M2,r);case"symbols":if(ZK(t))return p.createElement(Vk,r);break;case"curve":return p.createElement(w2,r);default:return null}}function JK(e){return p.isValidElement(e)?e.props:e}function eY(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,s=KK(e,HK),i;if(p.isValidElement(t))i=p.cloneElement(t,eu(eu({},s),JK(t)));else if(typeof t=="function")i=t(s,s.index);else if(LK(t)&&typeof t!="boolean"){var o=QK(t,s);i=p.createElement(jw,{shapeType:r,elementProps:o})}else{var l=s;i=p.createElement(jw,{shapeType:r,elementProps:l})}return s.isActive?p.createElement(xa,{className:n},i):i}var pO=(e,t,r)=>{var n=_t();return(s,i)=>o=>{e==null||e(s,i,o),n(N_({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},gO=e=>{var t=_t();return(r,n)=>s=>{e==null||e(r,n,s),t(bU())}},xO=(e,t,r)=>{var n=_t();return(s,i)=>o=>{e==null||e(s,i,o),n(wU({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function tY(e){var{tooltipEntrySettings:t}=e,r=_t(),n=$r(),s=p.useRef(null);return p.useLayoutEffect(()=>{n||(s.current===null?r(gU(t)):s.current!==t&&r(xU({prev:s.current,next:t})),s.current=t)},[t,r,n]),p.useLayoutEffect(()=>()=>{s.current&&(r(vU(s.current)),s.current=null)},[r]),null}function rY(e){var{legendPayload:t}=e,r=_t(),n=$r(),s=p.useRef(null);return p.useLayoutEffect(()=>{n||(s.current===null?r(e8(t)):s.current!==t&&r(t8({prev:s.current,next:t})),s.current=t)},[r,n,t]),p.useLayoutEffect(()=>()=>{s.current&&(r(r8(s.current)),s.current=null)},[r]),null}var Hm,nY=()=>{var[e]=p.useState(()=>ll("uid-"));return e},aY=(Hm=FM.useId)!==null&&Hm!==void 0?Hm:nY;function sY(e,t){var r=aY();return t||(e?"".concat(e,"-").concat(r):r)}var iY=p.createContext(void 0),oY=e=>{var{id:t,type:r,children:n}=e,s=sY("recharts-".concat(r),t);return p.createElement(iY.Provider,{value:s},n(s))},lY={cartesianItems:[],polarItems:[]},vO=Rr({name:"graphicalItems",initialState:lY,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ct()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=bn(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:ct()},removeCartesianGraphicalItem:{reducer(e,t){var r=bn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:ct()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ct()},removePolarGraphicalItem:{reducer(e,t){var r=bn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:ct()}}}),{addCartesianGraphicalItem:cY,replaceCartesianGraphicalItem:dY,removeCartesianGraphicalItem:uY,addPolarGraphicalItem:wee,removePolarGraphicalItem:jee}=vO.actions,fY=vO.reducer,mY=e=>{var t=_t(),r=p.useRef(null);return p.useLayoutEffect(()=>{r.current===null?t(cY(e)):r.current!==e&&t(dY({prev:r.current,next:e})),r.current=e},[t,e]),p.useLayoutEffect(()=>()=>{r.current&&(t(uY(r.current)),r.current=null)},[t]),null},hY=p.memo(mY);function Nw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function kw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nw(Object(r),!0).forEach(function(n){pY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pY(e,t,r){return(t=gY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gY(e){var t=xY(e,"string");return typeof t=="symbol"?t:t+""}function xY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yO=0,vY={xAxis:{},yAxis:{},zAxis:{}},bO=Rr({name:"cartesianAxis",initialState:vY,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ct()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:ct()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ct()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ct()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:ct()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ct()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ct()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:ct()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ct()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var i,o=s.widthHistory||[];if(o.length===3&&o[0]===o[2]&&n===o[1]&&n!==s.width&&Math.abs(n-((i=o[0])!==null&&i!==void 0?i:0))<=1)return;var l=[...o,n].slice(-3);e.yAxis[r]=kw(kw({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:yY,replaceXAxis:bY,removeXAxis:wY,addYAxis:jY,replaceYAxis:NY,removeYAxis:kY,addZAxis:Nee,replaceZAxis:kee,removeZAxis:See,updateYAxisWidth:SY}=bO.actions,CY=bO.reducer,_Y=H([Kt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),OY=H([_Y,Pa,Aa],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),wO=()=>Se(OY),Sw=(e,t,r)=>{var n=r??e;if(!qt(n))return jn(n,t,0)},MY=(e,t,r)=>{var n={},s=e.filter(Df),i=e.filter(d=>d.stackId==null),o=s.reduce((d,u)=>{var f=d[u.stackId];return f==null&&(f=[]),f.push(u),d[u.stackId]=f,d},n),l=Object.entries(o).map(d=>{var u,[f,m]=d,h=m.map(x=>x.dataKey),g=Sw(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:h,barSize:g}}),c=i.map(d=>{var u=[d.dataKey].filter(m=>m!=null),f=Sw(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]};function Cw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cw(Object(r),!0).forEach(function(n){PY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PY(e,t,r){return(t=AY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AY(e){var t=EY(e,"string");return typeof t=="symbol"?t:t+""}function EY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DY(e,t,r,n,s){var i,o=n.length;if(!(o<1)){var l=jn(e,r,0,!0),c,d=[];if(Ue((i=n[0])===null||i===void 0?void 0:i.barSize)){var u=!1,f=r/o,m=n.reduce((w,j)=>w+(j.barSize||0),0);m+=(o-1)*l,m>=r&&(m-=(o-1)*l,l=0),m>=r&&f>0&&(u=!0,f*=.9,m=o*f);var h=(r-m)/2>>0,g={offset:h-l,size:0};c=n.reduce((w,j)=>{var N,k={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:g.offset+g.size+l,size:u?f:(N=j.barSize)!==null&&N!==void 0?N:0}},b=[...w,k];return g=k.position,b},d)}else{var x=jn(t,r,0,!0);r-2*x-(o-1)*l<=0&&(l=0);var v=(r-2*x-(o-1)*l)/o;v>1&&(v>>=0);var y=Ue(s)?Math.min(v,s):v;c=n.reduce((w,j,N)=>[...w,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:x+(v+l)*N+(v-y)/2,size:y}}],d)}return c}}var TY=(e,t,r,n,s,i,o)=>{var l=qt(o)?t:o,c=DY(r,n,s!==i?s:i,e,l);return s!==i&&c!=null&&(c=c.map(d=>Hc(Hc({},d),{},{position:Hc(Hc({},d.position),{},{offset:d.position.offset-s/2})}))),c},IY=(e,t)=>{var r=Nx(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var s=e[n];if(s){var{stackedData:i}=s;if(i)return i.find(o=>o.key===r)}}}},RY=(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function $Y(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ue(e.zIndex)?e.zIndex:t}var zY=e=>{var{chartData:t}=e,r=_t(),n=$r();return p.useEffect(()=>n?()=>{}:(r(K0(t)),()=>{r(K0(void 0))}),[t,r,n]),null},_w={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},jO=Rr({name:"brush",initialState:_w,reducers:{setBrushSettings(e,t){return t.payload==null?_w:t.payload}}}),{setBrushSettings:Cee}=jO.actions,LY=jO.reducer;function FY(e){return(e%180+180)%180}var BY=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=FY(s),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},WY={dots:[],areas:[],lines:[]},NO=Rr({name:"referenceElements",initialState:WY,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=bn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=bn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=bn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:_ee,removeDot:Oee,addArea:Mee,removeArea:Pee,addLine:Aee,removeLine:Eee}=NO.actions,UY=NO.reducer,qY=p.createContext(void 0),HY=e=>{var{children:t}=e,[r]=p.useState("".concat(ll("recharts"),"-clip")),n=wO();if(n==null)return null;var{x:s,y:i,width:o,height:l}=n;return p.createElement(qY.Provider,{value:r},p.createElement("defs",null,p.createElement("clipPath",{id:r},p.createElement("rect",{x:s,y:i,height:l,width:o}))),t)};function kO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function KY(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return BY(n,r)}function YY(e,t,r){var n=r==="width",{x:s,y:i,width:o,height:l}=e;return t===1?{start:n?s:i,end:n?s+o:i+l}:{start:n?s+o:i+l,end:n?s:i}}function jl(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-s)<=0}function GY(e,t){return kO(e,t+1)}function VY(e,t,r,n,s){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:kO(n,d)};var x=c,v,y=()=>(v===void 0&&(v=r(g,x)),v),w=g.coordinate,j=c===0||jl(e,w,y,u,l);j||(c=0,u=o,d+=1),j&&(u=w+e*(y()/2+s),c+=d)},m;d<=i.length;)if(m=f(),m)return m.v;return[]}function XY(e,t,r,n,s){var i=(n||[]).slice(),o=i.length;if(o===0)return[];for(var{start:l,end:c}=t,d=1;d<=o;d++){for(var u=(o-1)%d,f=l,m=!0,h=function(){var N=n[x];if(N==null)return 0;var k=x,b,S=()=>(b===void 0&&(b=r(N,k)),b),_=N.coordinate,C=x===u||jl(e,_,S,f,c);if(!C)return m=!1,1;C&&(f=_+e*(S()/2+s))},g,x=u;x<o&&(g=h(),!(g!==0&&g===1));x+=d);if(m){for(var v=[],y=u;y<o;y+=d){var w=n[y];w!=null&&v.push(w)}return v}}return[]}function Ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ow(Object(r),!0).forEach(function(n){QY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ow(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QY(e,t,r){return(t=ZY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZY(e){var t=JY(e,"string");return typeof t=="symbol"?t:t+""}function JY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eG(e,t,r,n,s){for(var i=(n||[]).slice(),o=i.length,{start:l}=t,{end:c}=t,d=function(m){var h=i[m];if(h==null)return 1;var g=h,x,v=()=>(x===void 0&&(x=r(h,m)),x);if(m===o-1){var y=e*(g.coordinate+e*v()/2-c);i[m]=g=or(or({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[m]=g=or(or({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var w=jl(e,g.tickCoord,v,l,c);w&&(c=g.tickCoord-e*(v()/2+s),i[m]=or(or({},g),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function tG(e,t,r,n,s,i){var o=(n||[]).slice(),l=o.length,{start:c,end:d}=t;if(i){var u=n[l-1];if(u!=null){var f=r(u,l-1),m=e*(u.coordinate+e*f/2-d);if(o[l-1]=u=or(or({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var h=jl(e,u.tickCoord,()=>f,c,d);h&&(d=u.tickCoord-e*(f/2+s),o[l-1]=or(or({},u),{},{isShow:!0}))}}}for(var g=i?l-1:l,x=function(w){var j=o[w];if(j==null)return 1;var N=j,k,b=()=>(k===void 0&&(k=r(j,w)),k);if(w===0){var S=e*(N.coordinate-e*b()/2-c);o[w]=N=or(or({},N),{},{tickCoord:S<0?N.coordinate-S*e:N.coordinate})}else o[w]=N=or(or({},N),{},{tickCoord:N.coordinate});if(N.tickCoord!=null){var _=jl(e,N.tickCoord,b,c,d);_&&(c=N.tickCoord+e*(b()/2+s),o[w]=or(or({},N),{},{isShow:!0}))}},v=0;v<g;v++)x(v);return o}function Gx(e,t,r){var{tick:n,ticks:s,viewBox:i,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!s||!s.length||!n)return[];if(ve(c)||wf.isSsr){var m;return(m=GY(s,ve(c)?c:0))!==null&&m!==void 0?m:[]}var h=[],g=l==="top"||l==="bottom"?"width":"height",x=u&&g==="width"?rl(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,b)=>{var S=typeof d=="function"?d(k.value,b):k.value;return g==="width"?KY(rl(S,{fontSize:t,letterSpacing:r}),x,f):rl(S,{fontSize:t,letterSpacing:r})[g]},y=s[0],w=s[1],j=s.length>=2&&y!=null&&w!=null?Or(w.coordinate-y.coordinate):1,N=YY(i,j,g);return c==="equidistantPreserveStart"?VY(j,N,v,s,o):c==="equidistantPreserveEnd"?XY(j,N,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?h=tG(j,N,v,s,o,c==="preserveStartEnd"):h=eG(j,N,v,s,o),h.filter(k=>k.isShow))}var rG=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:i=0}=e,o=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+i,d=o+c+l+(r?n:0);return Math.round(d)}return 0},nG=["axisLine","width","height","className","hide","ticks","axisType"];function aG(e,t){if(e==null)return{};var r,n,s=sG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function sG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ri(){return ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ri.apply(null,arguments)}function Mw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mw(Object(r),!0).forEach(function(n){iG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iG(e,t,r){return(t=oG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oG(e){var t=lG(e,"string");return typeof t=="symbol"?t:t+""}function lG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pa={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",zIndex:vr.axis};function cG(e){var{x:t,y:r,width:n,height:s,orientation:i,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=yt(yt(yt({},c),ga(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=yt(yt({},d),{},{x1:t,y1:r+u*s,x2:t+n,y2:r+u*s})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=yt(yt({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return p.createElement("line",ri({},d,{className:tt("recharts-cartesian-axis-line",Li(l,"className"))}))}function dG(e,t,r,n,s,i,o,l,c){var d,u,f,m,h,g,x=l?-1:1,v=e.tickSize||o,y=ve(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*s,f=m-x*v,g=f-x*c,h=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-x*v,h=d-x*c,g=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+x*v,h=d+x*c,g=y;break;default:d=u=e.coordinate,m=r+ +l*s,f=m+x*v,g=f+x*c,h=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:h,y:g}}}function uG(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function fG(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function mG(e){var{option:t,tickProps:r,value:n}=e,s,i=tt(r.className,"recharts-cartesian-axis-tick-value");if(p.isValidElement(t))s=p.cloneElement(t,yt(yt({},r),{},{className:i}));else if(typeof t=="function")s=t(yt(yt({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=tt(o,DK(t))),s=p.createElement(qx,ri({},r,{className:o}),n)}return s}var hG=p.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:i,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:m,y:h,width:g,height:x,tickSize:v,tickMargin:y,fontSize:w,letterSpacing:j,getTicksConfig:N,events:k,axisType:b}=e,S=Gx(yt(yt({},N),{},{ticks:r}),w,j),_=uG(u,f),C=fG(u,f),E=ga(N),P=gg(n),O={};typeof s=="object"&&(O=s);var $=yt(yt({},E),{},{fill:"none"},O),D=S.map(W=>yt({entry:W},dG(W,m,h,g,x,u,v,f,y))),B=D.map(W=>{var{entry:Q,line:K}=W;return p.createElement(xa,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&p.createElement("line",ri({},$,K,{className:tt("recharts-cartesian-axis-tick-line",Li(s,"className"))})))}),A=D.map((W,Q)=>{var K,ie,{entry:ne,tick:U}=W,Y=yt(yt(yt(yt({verticalAnchor:C},E),{},{textAnchor:_,stroke:"none",fill:i},U),{},{index:Q,payload:ne,visibleTicksCount:S.length,tickFormatter:o,padding:c},d),{},{angle:(K=(ie=d==null?void 0:d.angle)!==null&&ie!==void 0?ie:E.angle)!==null&&K!==void 0?K:0}),Z=yt(yt({},Y),P);return p.createElement(xa,ri({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ne.value,"-").concat(ne.coordinate,"-").concat(ne.tickCoord)},wg(k,ne,Q)),n&&p.createElement(mG,{option:n,tickProps:Z,value:"".concat(typeof o=="function"?o(ne.value,Q):ne.value).concat(l||"")}))});return p.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},A.length>0&&p.createElement($a,{zIndex:vr.label},p.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:t},A)),B.length>0&&p.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},B))}),pG=p.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:i,hide:o,ticks:l,axisType:c}=e,d=aG(e,nG),[u,f]=p.useState(""),[m,h]=p.useState(""),g=p.useRef(null);p.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return rG({ticks:g.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=p.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=y;var w=y[0];if(w){var j=window.getComputedStyle(w),N=j.fontSize,k=j.letterSpacing;(N!==u||k!==m)&&(f(N),h(k))}}},[u,m]);return o||n!=null&&n<=0||s!=null&&s<=0?null:p.createElement($a,{zIndex:e.zIndex},p.createElement(xa,{className:tt("recharts-cartesian-axis",i)},p.createElement(cG,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ga(e)}),p.createElement(hG,{ref:x,axisType:c,events:d,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),p.createElement(dK,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},p.createElement(bK,{label:e.label,labelRef:e.labelRef}),e.children)))}),Vx=p.forwardRef((e,t)=>{var r=Vr(e,pa);return p.createElement(pG,ri({},r,{ref:t}))});Vx.displayName="CartesianAxis";var gG=["x1","y1","x2","y2","key"],xG=["offset"],vG=["xAxisId","yAxisId"],yG=["xAxisId","yAxisId"];function Pw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pw(Object(r),!0).forEach(function(n){bG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bG(e,t,r){return(t=wG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wG(e){var t=jG(e,"string");return typeof t=="symbol"?t:t+""}function jG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Es.apply(null,arguments)}function tu(e,t){if(e==null)return{};var r,n,s=NG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function NG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var kG=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:i,height:o,ry:l}=e;return p.createElement("rect",{x:n,y:s,ry:l,width:i,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function SO(e){var{option:t,lineItemProps:r}=e,n;if(p.isValidElement(t))n=p.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:i,y1:o,x2:l,y2:c,key:d}=r,u=tu(r,gG),f=(s=ga(u))!==null&&s!==void 0?s:{},{offset:m}=f,h=tu(f,xG);n=p.createElement("line",Es({},h,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function SG(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=tu(e,vG),c=s.map((d,u)=>{var f=cr(cr({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return p.createElement(SO,{key:"line-".concat(u),option:n,lineItemProps:f})});return p.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function CG(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=tu(e,yG),c=s.map((d,u)=>{var f=cr(cr({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return p.createElement(SO,{option:n,lineItemProps:f,key:"line-".concat(u)})});return p.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function _G(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:i,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var h=d[m+1],g=h==null,x=g?s+o-f:h-f;if(x<=0)return null;var v=m%t.length;return p.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:x,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return p.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function OG(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:i,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var h=d[m+1],g=h==null,x=g?s+o-f:h-f;if(x<=0)return null;var v=m%r.length;return p.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:x,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return p.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var MG=(e,t)=>{var{xAxis:r,width:n,height:s,offset:i}=e;return ZS(Gx(cr(cr(cr({},pa),r),{},{ticks:JS(r),viewBox:{x:0,y:0,width:n,height:s}})),i.left,i.left+i.width,t)},PG=(e,t)=>{var{yAxis:r,width:n,height:s,offset:i}=e;return ZS(Gx(cr(cr(cr({},pa),r),{},{ticks:JS(r),viewBox:{x:0,y:0,width:n,height:s}})),i.top,i.top+i.height,t)},AG={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:vr.grid};function Nl(e){var t=c2(),r=d2(),n=l2(),s=cr(cr({},Vr(e,AG)),{},{x:ve(e.x)?e.x:n.left,y:ve(e.y)?e.y:n.top,width:ve(e.width)?e.width:n.width,height:ve(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:m,verticalValues:h}=s,g=$r(),x=Se(C=>I0(C,"xAxis",i,g)),v=Se(C=>I0(C,"yAxis",o,g));if(!qn(d)||!qn(u)||!ve(l)||!ve(c))return null;var y=s.verticalCoordinatesGenerator||MG,w=s.horizontalCoordinatesGenerator||PG,{horizontalPoints:j,verticalPoints:N}=s;if((!j||!j.length)&&typeof w=="function"){var k=m&&m.length,b=w({yAxis:v?cr(cr({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);Cd(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(j=b)}if((!N||!N.length)&&typeof y=="function"){var S=h&&h.length,_=y({xAxis:x?cr(cr({},x),{},{ticks:S?h:x.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);Cd(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(N=_)}return p.createElement($a,{zIndex:s.zIndex},p.createElement("g",{className:"recharts-cartesian-grid"},p.createElement(kG,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),p.createElement(_G,Es({},s,{horizontalPoints:j})),p.createElement(OG,Es({},s,{verticalPoints:N})),p.createElement(SG,Es({},s,{offset:n,horizontalPoints:j,xAxis:x,yAxis:v})),p.createElement(CG,Es({},s,{offset:n,verticalPoints:N,xAxis:x,yAxis:v}))))}Nl.displayName="CartesianGrid";var EG={},CO=Rr({name:"errorBars",initialState:EG,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:Dee,replaceErrorBar:Tee,removeErrorBar:Iee}=CO.actions,DG=CO.reducer,TG=["children"];function IG(e,t){if(e==null)return{};var r,n,s=RG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function RG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var $G={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},zG=p.createContext($G);function LG(e){var{children:t}=e,r=IG(e,TG);return p.createElement(zG.Provider,{value:r},t)}function _O(e,t){var r,n,s=Se(d=>Ta(d,e)),i=Se(d=>Ia(d,t)),o=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Bt.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Wt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function FG(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=wO(),{needClipX:i,needClipY:o,needClip:l}=_O(t,r);if(!l||!s)return null;var{x:c,y:d,width:u,height:f}=s;return p.createElement("clipPath",{id:"clipPath-".concat(n)},p.createElement("rect",{x:i?c:c-u/2,y:o?d:d-f/2,width:i?u:u*2,height:o?f:f*2}))}var BG={};/**
|
|
583
|
+
* @license React
|
|
584
|
+
* use-sync-external-store-with-selector.production.js
|
|
585
|
+
*
|
|
586
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
587
|
+
*
|
|
588
|
+
* This source code is licensed under the MIT license found in the
|
|
589
|
+
* LICENSE file in the root directory of this source tree.
|
|
590
|
+
*/var hc=p;function WG(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var UG=typeof Object.is=="function"?Object.is:WG,qG=hc.useSyncExternalStore,HG=hc.useRef,KG=hc.useEffect,YG=hc.useMemo,GG=hc.useDebugValue;BG.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=HG(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=YG(function(){function c(h){if(!d){if(d=!0,u=h,h=n(h),s!==void 0&&o.hasValue){var g=o.value;if(s(g,h))return f=g}return f=h}if(g=f,UG(u,h))return g;var x=n(h);return s!==void 0&&s(g,x)?(u=h,g):(u=h,f=x)}var d=!1,u,f,m=r===void 0?null:r;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,r,n,s]);var l=qG(e,i[0],i[1]);return KG(function(){o.hasValue=!0,o.value=l},[l]),GG(l),l};function VG(e){e()}function XG(){let e=null,t=null;return{clear(){e=null,t=null},notify(){VG(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!n||e===null||(n=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Aw={notify(){},get:()=>[]};function QG(e,t){let r,n=Aw,s=0,i=!1;function o(x){u();const v=n.subscribe(x);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){g.onStateChange&&g.onStateChange()}function d(){return i}function u(){s++,r||(r=e.subscribe(c),n=XG())}function f(){s--,r&&s===0&&(r(),r=void 0,n.clear(),n=Aw)}function m(){i||(i=!0,u())}function h(){i&&(i=!1,f())}const g={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:h,getListeners:()=>n};return g}var ZG=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JG=ZG(),eV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",tV=eV(),rV=()=>JG||tV?p.useLayoutEffect:p.useEffect,nV=rV();function Ew(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function aV(e,t){if(Ew(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!Ew(e[r[s]],t[r[s]]))return!1;return!0}var Km=Symbol.for("react-redux-context"),Ym=typeof globalThis<"u"?globalThis:{};function sV(){if(!p.createContext)return{};const e=Ym[Km]??(Ym[Km]=new Map);let t=e.get(p.createContext);return t||(t=p.createContext(null),e.set(p.createContext,t)),t}var iV=sV();function oV(e){const{children:t,context:r,serverState:n,store:s}=e,i=p.useMemo(()=>{const c=QG(s);return{store:s,subscription:c,getServerState:n?()=>n:void 0}},[s,n]),o=p.useMemo(()=>s.getState(),[s]);nV(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,o]);const l=r||iV;return p.createElement(l.Provider,{value:i},t)}var lV=oV,cV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function dV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Xx(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(cV.has(n)){if(e[n]==null&&t[n]==null)continue;if(!aV(e[n],t[n]))return!1}else if(!dV(e[n],t[n]))return!1;return!0}function di(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:yO}function ui(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:yO}var uV="Invariant failed";function fV(e,t){throw new Error(uV)}function ip(){return ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ip.apply(null,arguments)}function ru(e){return p.createElement(eY,ip({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var mV=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,s)=>{if(ve(t))return t;var i=ve(n)||qt(n);return i?t(n,s):(i||fV(),r)}},hV=(e,t,r)=>r,pV=(e,t)=>t,pc=H([Sx,pV],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),gV=H([pc],e=>e==null?void 0:e.maxBarSize),xV=(e,t,r,n)=>n,vV=H([rt,Sx,di,ui,hV],(e,t,r,n,s)=>t.filter(i=>e==="horizontal"?i.xAxisId===r:i.yAxisId===n).filter(i=>i.isPanorama===s).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),yV=(e,t,r)=>{var n=rt(e),s=di(e,t),i=ui(e,t);if(!(s==null||i==null))return n==="horizontal"?ep(e,"yAxis",i,r):ep(e,"xAxis",s,r)},bV=(e,t)=>{var r=rt(e),n=di(e,t),s=ui(e,t);if(!(n==null||s==null))return r==="horizontal"?T0(e,"xAxis",n):T0(e,"yAxis",s)},wV=H([vV,s9,bV],MY),jV=(e,t,r)=>{var n,s,i=pc(e,t);if(i==null)return 0;var o=di(e,t),l=ui(e,t);if(o==null||l==null)return 0;var c=rt(e),d=CC(e),{maxBarSize:u}=i,f=qt(u)?d:u,m,h;return c==="horizontal"?(m=Ki(e,"xAxis",o,r),h=Hi(e,"xAxis",o,r)):(m=Ki(e,"yAxis",l,r),h=Hi(e,"yAxis",l,r)),(n=(s=Sd(m,h,!0))!==null&&s!==void 0?s:f)!==null&&n!==void 0?n:0},OO=(e,t,r)=>{var n=rt(e),s=di(e,t),i=ui(e,t);if(!(s==null||i==null)){var o,l;return n==="horizontal"?(o=Ki(e,"xAxis",s,r),l=Hi(e,"xAxis",s,r)):(o=Ki(e,"yAxis",i,r),l=Hi(e,"yAxis",i,r)),Sd(o,l)}},NV=H([wV,CC,a9,_C,jV,OO,gV],TY),kV=(e,t,r)=>{var n=di(e,t);if(n!=null)return Ki(e,"xAxis",n,r)},SV=(e,t,r)=>{var n=ui(e,t);if(n!=null)return Ki(e,"yAxis",n,r)},CV=(e,t,r)=>{var n=di(e,t);if(n!=null)return Hi(e,"xAxis",n,r)},_V=(e,t,r)=>{var n=ui(e,t);if(n!=null)return Hi(e,"yAxis",n,r)},OV=H([NV,pc],RY),MV=H([yV,pc],IY),PV=H([Kt,Lg,kV,SV,CV,_V,OV,rt,X7,OO,MV,pc,xV],(e,t,r,n,s,i,o,l,c,d,u,f,m)=>{var{chartData:h,dataStartIndex:g,dataEndIndex:x}=c;if(!(f==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||s==null||i==null||d==null)){var{data:v}=f,y;if(v!=null&&v.length>0?y=v:y=h==null?void 0:h.slice(g,x+1),y!=null)return aX({layout:l,barSettings:f,pos:o,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:i,stackedData:u,displayedData:y,offset:e,cells:m,dataStartIndex:g})}}),AV=["index"];function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},op.apply(null,arguments)}function EV(e,t){if(e==null)return{};var r,n,s=DV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var MO=p.createContext(void 0),TV=e=>{var t=p.useContext(MO);if(t!=null)return t.stackId;if(e!=null)return oF(e)},IV=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),RV=e=>{var t=p.useContext(MO);if(t!=null){var{stackId:r}=t;return"url(#".concat(IV(r,e),")")}},PO=e=>{var{index:t}=e,r=EV(e,AV),n=RV(t);return p.createElement(xa,op({className:"recharts-bar-stack-layer",clipPath:n},r))},$V=["onMouseEnter","onMouseLeave","onClick"],zV=["value","background","tooltipPosition"],LV=["id"],FV=["onMouseEnter","onClick","onMouseLeave"];function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ka.apply(null,arguments)}function Dw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dw(Object(r),!0).forEach(function(n){BV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BV(e,t,r){return(t=WV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WV(e){var t=UV(e,"string");return typeof t=="symbol"?t:t+""}function UV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nu(e,t){if(e==null)return{};var r,n,s=qV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function qV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var HV=e=>{var{dataKey:t,name:r,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:n,value:e2(r,t),payload:e}]},KV=p.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:s,name:i,hide:o,unit:l,tooltipType:c,id:d}=e,u={dataDefinedOnItem:void 0,getPosition:fo,settings:{stroke:r,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:e2(i,t),hide:o,type:c,color:s,unit:l,graphicalItemId:d}};return p.createElement(tY,{tooltipEntrySettings:u})});function YV(e){var t=Se(Yi),{data:r,dataKey:n,background:s,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=nu(i,$V),u=pO(o,n,i.id),f=gO(l),m=xO(c,n,i.id);if(!s||r==null)return null;var h=gg(s);return p.createElement($a,{zIndex:$Y(s,vr.barBackground)},r.map((g,x)=>{var{value:v,background:y,tooltipPosition:w}=g,j=nu(g,zV);if(!y)return null;var N=u(g,x),k=f(g,x),b=m(g,x),S=pr(pr(pr(pr(pr({option:s,isActive:String(x)===t},j),{},{fill:"#eee"},y),h),wg(d,g,x)),{},{onMouseEnter:N,onMouseLeave:k,onClick:b,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return p.createElement(ru,ka({key:"background-bar-".concat(x)},S))}))}function GV(e){var{showLabels:t,children:r,rects:n}=e,s=n==null?void 0:n.map(i=>{var o={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return pr(pr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return p.createElement(_K,{value:t?s:void 0},r)}function VV(e){var{shape:t,activeBar:r,baseProps:n,entry:s,index:i,dataKey:o}=e,l=Se(Yi),c=Se(z_),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?p.createElement($a,{zIndex:vr.activeBar},p.createElement(PO,{index:i},p.createElement(ru,ka({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o})))):p.createElement(ru,ka({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o}))}function XV(e){var{shape:t,baseProps:r,entry:n,index:s,dataKey:i}=e;return p.createElement(ru,ka({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:s,dataKey:i}))}function QV(e){var t,{data:r,props:n}=e,s=(t=ga(n))!==null&&t!==void 0?t:{},{id:i}=s,o=nu(s,LV),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,h=nu(n,FV),g=pO(u,c,i),x=gO(m),v=xO(f,c,i);return r?p.createElement(p.Fragment,null,r.map((y,w)=>p.createElement(PO,ka({index:w,key:"rectangle-".concat(y==null?void 0:y.x,"-").concat(y==null?void 0:y.y,"-").concat(y==null?void 0:y.value,"-").concat(w),className:"recharts-bar-rectangle"},wg(h,y,w),{onMouseEnter:g(y,w),onMouseLeave:x(y,w),onClick:v(y,w)}),d?p.createElement(VV,{shape:l,activeBar:d,baseProps:o,entry:y,index:w,dataKey:c}):p.createElement(XV,{shape:l,baseProps:o,entry:y,index:w,dataKey:c})))):null}function ZV(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:s,isAnimationActive:i,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,m=Hg(t,"recharts-bar-"),[h,g]=p.useState(!1),x=!h,v=p.useCallback(()=>{typeof d=="function"&&d(),g(!1)},[d]),y=p.useCallback(()=>{typeof u=="function"&&u(),g(!0)},[u]);return p.createElement(GV,{showLabels:x,rects:n},p.createElement(qg,{animationId:m,begin:o,duration:l,isActive:i,easing:c,onAnimationEnd:v,onAnimationStart:y,key:m},w=>{var j=w===1?n:n==null?void 0:n.map((N,k)=>{var b=f&&f[k];if(b)return pr(pr({},N),{},{x:tr(b.x,N.x,w),y:tr(b.y,N.y,w),width:tr(b.width,N.width,w),height:tr(b.height,N.height,w)});if(s==="horizontal"){var S=tr(0,N.height,w),_=tr(N.stackedBarStart,N.y,w);return pr(pr({},N),{},{y:_,height:S})}var C=tr(0,N.width,w),E=tr(N.stackedBarStart,N.x,w);return pr(pr({},N),{},{width:C,x:E})});return w>0&&(r.current=j??null),j==null?null:p.createElement(xa,null,p.createElement(QV,{props:t,data:j}))}),p.createElement(PK,{label:t.label}),t.children)}function JV(e){var t=p.useRef(null);return p.createElement(ZV,{previousRectanglesRef:t,props:e})}var AO=0,eX=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:ar(e,t)}};class tX extends p.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:s,xAxisId:i,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=tt("recharts-bar",s),f=d;return p.createElement(xa,{className:u,id:d},l&&p.createElement("defs",null,p.createElement(FG,{clipPathId:f,xAxisId:i,yAxisId:o})),p.createElement(xa,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},p.createElement(YV,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),p.createElement(JV,this.props)))}}var rX={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:AO,xAxisId:0,yAxisId:0,zIndex:vr.bar};function nX(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=_O(t,r),m=mo(),h=$r(),g=$K(e.children,V_),x=Se(w=>PV(w,e.id,h,g));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=x==null?void 0:x[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,p.createElement(LG,{xAxisId:t,yAxisId:r,data:x,dataPointFormatter:eX,errorBarOffset:v},p.createElement(tX,ka({},e,{layout:m,needClip:f,data:x,xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function aX(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:s,bandSize:i,xAxis:o,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:m,cells:h,parentViewBox:g,dataStartIndex:x}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,w=lF({numericAxis:v}),j=v.scale.map(w);return f.map((N,k)=>{var b,S,_,C,E,P;if(u){var O=u[k+x];if(O==null)return null;b=rF(O,y)}else b=ar(N,r),Array.isArray(b)||(b=[w,b]);var $=mV(n,AO)(b[1],k);if(t==="horizontal"){var D,B=l.scale.map(b[0]),A=l.scale.map(b[1]);if(B==null||A==null)return null;S=Uy({axis:o,ticks:c,bandSize:i,offset:s.offset,entry:N,index:k}),_=(D=A??B)!==null&&D!==void 0?D:void 0,C=s.size;var W=B-A;if(E=Wn(W)?0:W,P={x:S,y:m.top,width:C,height:m.height},Math.abs($)>0&&Math.abs(E)<Math.abs($)){var Q=Or(E||$)*(Math.abs($)-Math.abs(E));_-=Q,E+=Q}}else{var K=o.scale.map(b[0]),ie=o.scale.map(b[1]);if(K==null||ie==null)return null;if(S=K,_=Uy({axis:l,ticks:d,bandSize:i,offset:s.offset,entry:N,index:k}),C=ie-K,E=s.size,P={x:m.left,y:_,width:m.width,height:E},Math.abs($)>0&&Math.abs(C)<Math.abs($)){var ne=Or(C||$)*(Math.abs($)-Math.abs(C));C+=ne}}if(S==null||_==null||C==null||E==null)return null;var U=pr(pr({},N),{},{stackedBarStart:j,x:S,y:_,width:C,height:E,value:u?b:b[1],payload:N,background:P,tooltipPosition:{x:S+C/2,y:_+E/2},parentViewBox:g},h&&h[k]&&h[k].props);return U}).filter(Boolean)}function sX(e){var t=Vr(e,rX),r=TV(t.stackId),n=$r();return p.createElement(oY,{id:t.id,type:"bar"},s=>p.createElement(p.Fragment,null,p.createElement(rY,{legendPayload:HV(t)}),p.createElement(KV,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:s}),p.createElement(hY,{type:"bar",id:s,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n}),p.createElement($a,{zIndex:t.zIndex},p.createElement(nX,ka({},t,{id:s})))))}var kl=p.memo(sX,Xx);kl.displayName="Bar";var iX=["domain","range"],oX=["domain","range"];function Tw(e,t){if(e==null)return{};var r,n,s=lX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Iw(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function EO(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=Tw(e,iX),{domain:i,range:o}=t,l=Tw(t,oX);return!Iw(r,i)||!Iw(n,o)?!1:Xx(s,l)}var cX=["type"],dX=["dangerouslySetInnerHTML","ticks","scale"],uX=["id","scale"];function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lp.apply(null,arguments)}function Rw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $w(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rw(Object(r),!0).forEach(function(n){fX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fX(e,t,r){return(t=mX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mX(e){var t=hX(e,"string");return typeof t=="symbol"?t:t+""}function hX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cp(e,t){if(e==null)return{};var r,n,s=pX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function pX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function gX(e){var t=_t(),r=p.useRef(null),n=u2(),{type:s}=e,i=cp(e,cX),o=Pf(n,"xAxis",s),l=p.useMemo(()=>{if(o!=null)return $w($w({},i),{},{type:o})},[i,o]);return p.useLayoutEffect(()=>{l!=null&&(r.current===null?t(yY(l)):r.current!==l&&t(bY({prev:r.current,next:l})),r.current=l)},[l,t]),p.useLayoutEffect(()=>()=>{r.current&&(t(wY(r.current)),r.current=null)},[t]),null}var xX=e=>{var{xAxisId:t,className:r}=e,n=Se(Lg),s=$r(),i="xAxis",o=Se(y=>x_(y,i,t,s)),l=Se(y=>m_(y,t)),c=Se(y=>iU(y,t)),d=Se(y=>RC(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,h=cp(e,dX),{id:g,scale:x}=d,v=cp(d,uX);return p.createElement(Vx,lp({},h,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:tt("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},vX={allowDataOverflow:Bt.allowDataOverflow,allowDecimals:Bt.allowDecimals,allowDuplicatedCategory:Bt.allowDuplicatedCategory,angle:Bt.angle,axisLine:pa.axisLine,height:Bt.height,hide:!1,includeHidden:Bt.includeHidden,interval:Bt.interval,label:!1,minTickGap:Bt.minTickGap,mirror:Bt.mirror,orientation:Bt.orientation,padding:Bt.padding,reversed:Bt.reversed,scale:Bt.scale,tick:Bt.tick,tickCount:Bt.tickCount,tickLine:pa.tickLine,tickSize:pa.tickSize,type:Bt.type,xAxisId:0},yX=e=>{var t=Vr(e,vX);return p.createElement(p.Fragment,null,p.createElement(gX,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),p.createElement(xX,t))},Sl=p.memo(yX,EO);Sl.displayName="XAxis";var bX=["type"],wX=["dangerouslySetInnerHTML","ticks","scale"],jX=["id","scale"];function dp(){return dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dp.apply(null,arguments)}function zw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Lw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zw(Object(r),!0).forEach(function(n){NX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NX(e,t,r){return(t=kX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kX(e){var t=SX(e,"string");return typeof t=="symbol"?t:t+""}function SX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function up(e,t){if(e==null)return{};var r,n,s=CX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function CX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function _X(e){var t=_t(),r=p.useRef(null),n=u2(),{type:s}=e,i=up(e,bX),o=Pf(n,"yAxis",s),l=p.useMemo(()=>{if(o!=null)return Lw(Lw({},i),{},{type:o})},[o,i]);return p.useLayoutEffect(()=>{l!=null&&(r.current===null?t(jY(l)):r.current!==l&&t(NY({prev:r.current,next:l})),r.current=l)},[l,t]),p.useLayoutEffect(()=>()=>{r.current&&(t(kY(r.current)),r.current=null)},[t]),null}function OX(e){var{yAxisId:t,className:r,width:n,label:s}=e,i=p.useRef(null),o=p.useRef(null),l=Se(Lg),c=$r(),d=_t(),u="yAxis",f=Se(b=>h_(b,t)),m=Se(b=>lU(b,t)),h=Se(b=>x_(b,u,t,c)),g=Se(b=>$C(b,t));if(p.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Hx(s)||p.isValidElement(s)||g==null)){var b=i.current;if(b){var S=b.getCalculatedWidth();Math.round(f.width)!==Math.round(S)&&d(SY({id:t,width:S}))}}},[h,f,d,s,t,n,g]),f==null||m==null||g==null)return null;var{dangerouslySetInnerHTML:x,ticks:v,scale:y}=e,w=up(e,wX),{id:j,scale:N}=g,k=up(g,jX);return p.createElement(Vx,dp({},w,k,{ref:i,labelRef:o,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:tt("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:h,axisType:u}))}var MX={allowDataOverflow:Wt.allowDataOverflow,allowDecimals:Wt.allowDecimals,allowDuplicatedCategory:Wt.allowDuplicatedCategory,angle:Wt.angle,axisLine:pa.axisLine,hide:!1,includeHidden:Wt.includeHidden,interval:Wt.interval,label:!1,minTickGap:Wt.minTickGap,mirror:Wt.mirror,orientation:Wt.orientation,padding:Wt.padding,reversed:Wt.reversed,scale:Wt.scale,tick:Wt.tick,tickCount:Wt.tickCount,tickLine:pa.tickLine,tickSize:pa.tickSize,type:Wt.type,width:Wt.width,yAxisId:0},PX=e=>{var t=Vr(e,MX);return p.createElement(p.Fragment,null,p.createElement(_X,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),p.createElement(OX,t))},Cl=p.memo(PX,EO);Cl.displayName="YAxis";var AX=(e,t)=>t,Qx=H([AX,rt,TC,Vt,T_,Ra,jq,Kt],Mq),Zx=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},DO=ln("mouseClick"),TO=ec();TO.startListening({actionCreator:DO,effect:(e,t)=>{var r=e.payload,n=Qx(t.getState(),Zx(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(jU({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var fp=ln("mouseMove"),IO=ec(),Kc=null;IO.startListening({actionCreator:fp,effect:(e,t)=>{var r=e.payload;Kc!==null&&cancelAnimationFrame(Kc);var n=Zx(r);Kc=requestAnimationFrame(()=>{var s=t.getState(),i=Tx(s,s.tooltip.settings.shared);if(i==="axis"){var o=Qx(s,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(S_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(k_())}Kc=null})}});function EX(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var Fw={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},RO=Rr({name:"rootProps",initialState:Fw,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:Fw.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),DX=RO.reducer,{updateOptions:TX}=RO.actions,IX=null,RX={updatePolarOptions:(e,t)=>t.payload},$O=Rr({name:"polarOptions",initialState:IX,reducers:RX}),{updatePolarOptions:Ree}=$O.actions,$X=$O.reducer,zO=ln("keyDown"),LO=ln("focus"),Jx=ec();Jx.startListening({actionCreator:zO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var o=Ix(s,jo(r),dc(r),fc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Ra(r);if(i==="Enter"){var d=Xd(r,"axis","hover",String(s.index));t.dispatch(rp({active:!s.active,activeIndex:s.index,activeCoordinate:d}));return}var u=fU(r),f=u==="left-to-right"?1:-1,m=i==="ArrowRight"?1:-1,h=l+m*f;if(!(c==null||h>=c.length||h<0)){var g=Xd(r,"axis","hover",String(h));t.dispatch(rp({active:!0,activeIndex:h.toString(),activeCoordinate:g}))}}}}}});Jx.startListening({actionCreator:LO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",o=Xd(r,"axis","hover",String(i));t.dispatch(rp({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var en=ln("externalEvent"),FO=ec(),Gm=new Map;FO.startListening({actionCreator:en,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var s=n.type,i=Gm.get(s);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:oq(l),activeDataKey:z_(l),activeIndex:Yi(l),activeLabel:$_(l),activeTooltipIndex:Yi(l),isTooltipActive:lq(l)};r(c,n)}finally{Gm.delete(s)}});Gm.set(s,o)}}});var zX=H([bo],e=>e.tooltipItemPayloads),LX=H([zX,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(i=>i.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),BO=ln("touchMove"),WO=ec();WO.startListening({actionCreator:BO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),s=Tx(n,n.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var o=Qx(n,Zx({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(S_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(s==="item"){var l,c=r.touches[0];if(document.elementFromPoint==null||c==null)return;var d=document.elementFromPoint(c.clientX,c.clientY);if(!d||!d.getAttribute)return;var u=d.getAttribute(pF),f=(l=d.getAttribute(gF))!==null&&l!==void 0?l:void 0,m=wo(n).find(x=>x.id===f);if(u==null||m==null||f==null)return;var{dataKey:h}=m,g=LX(n,u,f);t.dispatch(N_({activeDataKey:h,activeIndex:u,activeCoordinate:g,activeGraphicalItemId:f}))}}}});var FX=NS({brush:LY,cartesianAxis:CY,chartData:iH,errorBars:DG,graphicalItems:fY,layout:Q6,legend:n8,options:tH,polarAxis:EK,polarOptions:$X,referenceElements:UY,rootProps:DX,tooltip:NU,zIndex:Uq}),BX=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return j6({reducer:FX,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([TO.middleware,IO.middleware,Jx.middleware,FO.middleware,WO.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(zS({type:"raf"}))},devTools:{serialize:{replacer:EX},name:"recharts-".concat(r)}})};function WX(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=$r(),i=p.useRef(null);if(s)return r;i.current==null&&(i.current=BX(t,n));var o=Pg;return p.createElement(lV,{context:o,store:i.current},r)}function UX(e){var{layout:t,margin:r}=e,n=_t(),s=$r();return p.useEffect(()=>{s||(n(G6(t)),n(Y6(r)))},[n,s,t,r]),null}var qX=p.memo(UX,Xx);function HX(e){var t=_t();return p.useEffect(()=>{t(TX(e))},[t,e]),null}function Bw(e){var{zIndex:t,isPanorama:r}=e,n=p.useRef(null),s=_t();return p.useLayoutEffect(()=>(n.current&&s(Bq({zIndex:t,element:n.current,isPanorama:r})),()=>{s(Wq({zIndex:t,isPanorama:r}))}),[s,t,r]),p.createElement("g",{tabIndex:-1,ref:n})}function Ww(e){var{children:t,isPanorama:r}=e,n=Se(Aq);if(!n||n.length===0)return t;var s=n.filter(o=>o<0),i=n.filter(o=>o>0);return p.createElement(p.Fragment,null,s.map(o=>p.createElement(Bw,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>p.createElement(Bw,{key:o,zIndex:o,isPanorama:r})))}var KX=["children"];function YX(e,t){if(e==null)return{};var r,n,s=GX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function GX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},au.apply(null,arguments)}var VX={width:"100%",height:"100%",display:"block"},XX=p.forwardRef((e,t)=>{var r=c2(),n=d2(),s=b2();if(!qn(r)||!qn(n))return null;var{children:i,otherAttributes:o,title:l,desc:c}=e,d,u;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=s?0:void 0,typeof o.role=="string"?u=o.role:u=s?"application":void 0),p.createElement(Ok,au({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:VX,ref:t}),i)}),QX=e=>{var{children:t}=e,r=Se(gf);if(!r)return null;var{width:n,height:s,y:i,x:o}=r;return p.createElement(Ok,{width:n,height:s,x:o,y:i},t)},Uw=p.forwardRef((e,t)=>{var{children:r}=e,n=YX(e,KX),s=$r();return s?p.createElement(QX,null,p.createElement(Ww,{isPanorama:!0},r)):p.createElement(XX,au({ref:t},n),p.createElement(Ww,{isPanorama:!1},r))});function ZX(){var e=_t(),[t,r]=p.useState(null),n=Se(hF);return p.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Ue(i)&&i!==n&&e(X6(i))}},[t,e,n]),r}function qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function JX(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(r),!0).forEach(function(n){eQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eQ(e,t,r){return(t=tQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tQ(e){var t=rQ(e,"string");return typeof t=="symbol"?t:t+""}function rQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qa(){return Qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qa.apply(null,arguments)}var nQ=()=>(pH(),null);function su(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var aQ=p.forwardRef((e,t)=>{var r,n,s=p.useRef(null),[i,o]=p.useState({containerWidth:su((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:su((n=e.style)===null||n===void 0?void 0:n.height)}),l=p.useCallback((d,u)=>{o(f=>{var m=Math.round(d),h=Math.round(u);return f.containerWidth===m&&f.containerHeight===h?f:{containerWidth:m,containerHeight:h}})},[]),c=p.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var m=g=>{var x=g[0];if(x!=null){var{width:v,height:y}=x.contentRect;l(v,y)}},h=new ResizeObserver(m);h.observe(d),s.current=h}},[t,l]);return p.useEffect(()=>()=>{var d=s.current;d!=null&&d.disconnect()},[l]),p.createElement(p.Fragment,null,p.createElement(rc,{width:i.containerWidth,height:i.containerHeight}),p.createElement("div",Qa({ref:c},e)))}),sQ=p.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,i]=p.useState({containerWidth:su(r),containerHeight:su(n)}),o=p.useCallback((c,d)=>{i(u=>{var f=Math.round(c),m=Math.round(d);return u.containerWidth===f&&u.containerHeight===m?u:{containerWidth:f,containerHeight:m}})},[]),l=p.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return p.createElement(p.Fragment,null,p.createElement(rc,{width:s.containerWidth,height:s.containerHeight}),p.createElement("div",Qa({ref:l},e)))}),iQ=p.forwardRef((e,t)=>{var{width:r,height:n}=e;return p.createElement(p.Fragment,null,p.createElement(rc,{width:r,height:n}),p.createElement("div",Qa({ref:t},e)))}),oQ=p.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?p.createElement(sQ,Qa({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?p.createElement(iQ,Qa({},e,{width:r,height:n,ref:t})):p.createElement(p.Fragment,null,p.createElement(rc,{width:r,height:n}),p.createElement("div",Qa({ref:t},e)))});function lQ(e){return e?aQ:oQ}var cQ=p.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:i,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:m,onTouchEnd:h,onTouchMove:g,onTouchStart:x,style:v,width:y,responsive:w,dispatchTouchEvents:j=!0}=e,N=p.useRef(null),k=_t(),[b,S]=p.useState(null),[_,C]=p.useState(null),E=ZX(),P=Fg(),O=(P==null?void 0:P.width)>0?P.width:y,$=(P==null?void 0:P.height)>0?P.height:s,D=p.useCallback(L=>{E(L),typeof t=="function"&&t(L),S(L),C(L),L!=null&&(N.current=L)},[E,t,S,C]),B=p.useCallback(L=>{k(DO(L)),k(en({handler:i,reactEvent:L}))},[k,i]),A=p.useCallback(L=>{k(fp(L)),k(en({handler:d,reactEvent:L}))},[k,d]),W=p.useCallback(L=>{k(k_()),k(en({handler:u,reactEvent:L}))},[k,u]),Q=p.useCallback(L=>{k(fp(L)),k(en({handler:f,reactEvent:L}))},[k,f]),K=p.useCallback(()=>{k(LO())},[k]),ie=p.useCallback(L=>{k(zO(L.key))},[k]),ne=p.useCallback(L=>{k(en({handler:o,reactEvent:L}))},[k,o]),U=p.useCallback(L=>{k(en({handler:l,reactEvent:L}))},[k,l]),Y=p.useCallback(L=>{k(en({handler:c,reactEvent:L}))},[k,c]),Z=p.useCallback(L=>{k(en({handler:m,reactEvent:L}))},[k,m]),G=p.useCallback(L=>{k(en({handler:x,reactEvent:L}))},[k,x]),M=p.useCallback(L=>{j&&k(BO(L)),k(en({handler:g,reactEvent:L}))},[k,j,g]),z=p.useCallback(L=>{k(en({handler:h,reactEvent:L}))},[k,h]),se=lQ(w);return p.createElement(H_.Provider,{value:b},p.createElement(Dz.Provider,{value:_},p.createElement(se,{width:O??(v==null?void 0:v.width),height:$??(v==null?void 0:v.height),className:tt("recharts-wrapper",n),style:JX({position:"relative",cursor:"default",width:O,height:$},v),onClick:B,onContextMenu:ne,onDoubleClick:U,onFocus:K,onKeyDown:ie,onMouseDown:Y,onMouseEnter:A,onMouseLeave:W,onMouseMove:Q,onMouseUp:Z,onTouchEnd:z,onTouchMove:M,onTouchStart:G,ref:D},p.createElement(nQ,null),r)))}),dQ=["width","height","responsive","children","className","style","compact","title","desc"];function uQ(e,t){if(e==null)return{};var r,n,s=fQ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var mQ=p.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:i,className:o,style:l,compact:c,title:d,desc:u}=e,f=uQ(e,dQ),m=ga(f);return c?p.createElement(p.Fragment,null,p.createElement(rc,{width:r,height:n}),p.createElement(Uw,{otherAttributes:m,title:d,desc:u},i)):p.createElement(cQ,{className:o,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},p.createElement(Uw,{otherAttributes:m,title:d,desc:u,ref:t},p.createElement(HY,null,i)))});function mp(){return mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mp.apply(null,arguments)}var hQ={top:5,right:5,bottom:5,left:5},pQ={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:hQ,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},gQ=p.forwardRef(function(t,r){var n,s=Vr(t.categoricalChartProps,pQ),{chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return p.createElement(WX,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},p.createElement(zY,{chartData:d.data}),p.createElement(qX,{layout:s.layout,margin:s.margin}),p.createElement(HX,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),p.createElement(mQ,mp({},s,{ref:r})))}),xQ=["axis","item"],iu=p.forwardRef((e,t)=>p.createElement(gQ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:xQ,tooltipPayloadSearcher:Jq,categoricalChartProps:e,ref:t}));const UO={all:["reporting"],timeLogs:e=>[...UO.all,"time-logs",e]};function qO(e,t){return Be({queryKey:UO.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{s&&r.set(n,s)}),te.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)??(Object.values(e).some(Boolean)||!!e.workspace_id)})}function ou({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return a.jsxs(kt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs(J,{variant:"outline",className:I("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[a.jsx(dr,{className:"h-3.5 w-3.5 shrink-0"}),e?fe(e,"MMM d, yyyy"):a.jsx("span",{children:r}),e&&a.jsx("span",{role:"button",className:"ml-auto hover:text-foreground",onClick:s=>{s.stopPropagation(),t(void 0)},children:a.jsx(et,{className:"h-3 w-3"})})]})}),a.jsx(wt,{className:"w-auto p-0",align:"start",children:a.jsx(ur,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function hp({options:e,selected:t,onSelectionChange:r,placeholder:n="Select…",className:s}){var d;const[i,o]=p.useState(!1);function l(u){t.includes(u)?r(t.filter(f=>f!==u)):r([...t,u])}const c=t.length===0?null:t.length===1?(d=e.find(u=>u.value===t[0]))==null?void 0:d.label:`${t.length} selected`;return a.jsxs(kt,{open:i,onOpenChange:o,children:[a.jsx(St,{asChild:!0,children:a.jsxs(J,{variant:"outline",role:"combobox","aria-expanded":i,className:I("h-8 justify-between text-xs font-normal min-w-36",!c&&"text-muted-foreground",s),children:[a.jsx("span",{className:"truncate",children:c??n}),a.jsx(Zi,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),a.jsxs(wt,{className:"w-56 p-0",align:"start",children:[a.jsxs(Ds,{children:[a.jsx(Tu,{placeholder:"Search…",className:"h-8 text-xs"}),a.jsxs(Ts,{children:[a.jsx(Iu,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),a.jsx(Va,{children:e.map(u=>a.jsxs(rn,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[a.jsx(rr,{className:I("mr-2 h-3.5 w-3.5",t.includes(u.value)?"opacity-100":"opacity-0")}),u.label]},u.value))})]})]}),t.length>0&&a.jsx("div",{className:"border-t p-2",children:a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[a.jsx(et,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function Zo(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Hw({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[a.jsx("p",{className:"font-medium mb-0.5",children:r}),a.jsx("p",{className:"text-muted-foreground",children:Zo(((n=t[0])==null?void 0:n.value)??0)})]})}function vQ({workspaceId:e}){const[t,r]=p.useState(void 0),[n,s]=p.useState(void 0),[i,o]=p.useState([]),[l,c]=p.useState([]),{workspace:d}=Ie(),u=(d==null?void 0:d.slug)??"",{data:f=[],isLoading:m}=Yl(),{data:h=[],isLoading:g}=no(),{data:x}=oi(),v=t?fe(t,"yyyy-MM-dd"):void 0,y=n?fe(n,"yyyy-MM-dd"):void 0,w=p.useMemo(()=>new Map(h.map(D=>[D.id,D])),[h]),{data:j,isLoading:N}=qO({from:v,to:y,workspace_id:e},{enabled:!0}),k=(j==null?void 0:j.time_logs)??[],b=p.useMemo(()=>{let D=k;return g||(D=D.filter(B=>!B.project_id||w.has(B.project_id))),i.length>0&&(D=D.filter(B=>i.includes(B.user_id))),l.length>0&&(D=D.filter(B=>B.project_id&&l.includes(B.project_id))),D},[k,i,l,w,g]),S=b.reduce((D,B)=>D+(B.duration_minutes??0),0),_=p.useMemo(()=>new Set(b.map(D=>D.user_id)).size,[b]),C=p.useMemo(()=>new Set(b.map(D=>D.project_id).filter(Boolean)).size,[b]),E=p.useMemo(()=>{const D=new Map;for(const B of b)D.set(B.user_id,(D.get(B.user_id)??0)+(B.duration_minutes??0));return Array.from(D.entries()).map(([B,A])=>{var W;return{name:((W=x==null?void 0:x.get(B))==null?void 0:W.name)??"Unknown",minutes:A}}).sort((B,A)=>A.minutes-B.minutes).slice(0,8)},[b,x]),P=p.useMemo(()=>{const D=new Map;for(const B of b){const A=B.project_id??"__none__";D.set(A,(D.get(A)??0)+(B.duration_minutes??0))}return Array.from(D.entries()).map(([B,A])=>{var W;return{name:B==="__none__"?"No project":((W=w.get(B))==null?void 0:W.name)??"Unknown",minutes:A}}).sort((B,A)=>A.minutes-B.minutes).slice(0,8)},[b,w]),O=p.useMemo(()=>f.map(D=>({value:D.id,label:[D.first_name,D.last_name].filter(Boolean).join(" ")||D.email})),[f]),$=p.useMemo(()=>h.map(D=>({value:D.id,label:D.name})),[h]);return a.jsxs("div",{className:"p-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-6 py-4 flex items-center gap-3",children:[a.jsx("div",{className:"h-9 w-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(Ja,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:"Time Logs"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Filter by date range, employees, and projects to analyze time across the organization."})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Qi,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(ou,{value:t,onChange:r,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(ou,{value:n,onChange:s,placeholder:"To"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(oa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employees"})]}),m?a.jsx(le,{className:"h-8 w-40"}):a.jsx(hp,{options:O,selected:i,onSelectionChange:o,placeholder:"All employees",className:"w-44"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Er,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Projects"})]}),g?a.jsx(le,{className:"h-8 w-40"}):a.jsx(hp,{options:$,selected:l,onSelectionChange:c,placeholder:"All projects",className:"w-44"})]}),N?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden divide-y divide-border",children:[1,2,3,4].map(D=>a.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-4 w-48"})]},D))}):b.length===0?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Yn,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logs found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:v||y||i.length>0||l.length>0?"Try adjusting your filters.":"No time has been logged yet."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Total time"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:Zo(S)})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Employees"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:_})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Projects"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:C})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.length>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(oa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by employee"})]}),a.jsx(_d,{width:"100%",height:Math.max(80,E.length*36),children:a.jsxs(iu,{data:E,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(Nl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Sl,{type:"number",tickFormatter:D=>Zo(D),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Cl,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Qd,{content:a.jsx(Hw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(kl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),P.length>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by project"})]}),a.jsx(_d,{width:"100%",height:Math.max(80,P.length*36),children:a.jsxs(iu,{data:P,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(Nl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Sl,{type:"number",tickFormatter:D=>Zo(D),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Cl,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Qd,{content:a.jsx(Hw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(kl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Employee"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Project"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Description"}),a.jsx("th",{className:"text-right px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Duration"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:b.map(D=>{var W;const B=D.project_id?w.get(D.project_id):void 0,A=((W=x==null?void 0:x.get(D.user_id))==null?void 0:W.name)??D.user_id.slice(0,8)+"…";return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-xs font-medium",children:A}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(B==null?void 0:B.name)??(D.project_id?"Unknown":"—")}),a.jsx("td",{className:"px-6 py-3",children:D.issue_identifier?a.jsx(Za,{to:`/${u}/projects/${B==null?void 0:B.identifier}/issues/${D.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:D.issue_identifier}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[D.issue_id.slice(0,8),"…"]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:D.logged_date?fe(new Date(D.logged_date),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:D.description??a.jsx("span",{className:"italic",children:"—"})}),a.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:D.duration_minutes!=null?Zo(D.duration_minutes):"Running…"})]},D.id)})})]})})]})]})}function ji(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Kw({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[a.jsx("p",{className:"font-medium mb-0.5",children:r}),a.jsx("p",{className:"text-muted-foreground",children:ji(((n=t[0])==null?void 0:n.value)??0)})]})}function yQ(){const{projectKey:e,workspace:t}=Ht(),[r,n]=p.useState(void 0),[s,i]=p.useState(void 0),[o,l]=p.useState([]),{data:c}=Ca(e??""),{data:d}=oi(),{data:u=[]}=Yl(),f=r?fe(r,"yyyy-MM-dd"):void 0,m=s?fe(s,"yyyy-MM-dd"):void 0,{data:h,isLoading:g}=qO({project_id:c==null?void 0:c.id,from:f,to:m}),x=(h==null?void 0:h.time_logs)??[],v=p.useMemo(()=>o.length>0?x.filter(_=>o.includes(_.user_id)):x,[x,o]),y=p.useMemo(()=>v.reduce((_,C)=>_+(C.duration_minutes??0),0),[v]),w=p.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.user_id)||_.set(C.user_id,{logs:[],totalMinutes:0});const E=_.get(C.user_id);E.logs.push(C),E.totalMinutes+=C.duration_minutes??0}return _},[v]),j=p.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.issue_id)||_.set(C.issue_id,{logs:[],totalMinutes:0});const E=_.get(C.issue_id);E.logs.push(C),E.totalMinutes+=C.duration_minutes??0}return _},[v]),N=Array.from(w.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C}])=>{var E;return{name:((E=d==null?void 0:d.get(_))==null?void 0:E.name)??"Unknown",minutes:C}}),k=Array.from(j.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C,logs:E}])=>{var P;return{name:((P=E[0])==null?void 0:P.issue_identifier)??_.slice(0,8),minutes:C}}),b=p.useMemo(()=>u.map(_=>({value:_.id,label:[_.first_name,_.last_name].filter(Boolean).join(" ")||_.email})),[u]),S=v.length>0;return a.jsxs("div",{className:"p-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Qi,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(ou,{value:r,onChange:n,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(ou,{value:s,onChange:i,placeholder:"To"}),a.jsx("div",{className:"w-px h-4 bg-border"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(oa,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employee"})]}),a.jsx(hp,{options:b,selected:o,onSelectionChange:l,placeholder:"All employees",className:"w-44"})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"Total logged",value:y>0?ji(y):"—",icon:Yn},{label:"Contributors",value:w.size>0?String(w.size):"—",icon:oa},{label:"Issues tracked",value:j.size>0?String(j.size):"—",icon:ma}].map(({label:_,value:C,icon:E})=>a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(E,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium",children:_})]}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:C})]},_))}),g?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(_=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},_))})}):c!=null&&c.id?S?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.size>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(oa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),a.jsx(_d,{width:"100%",height:Math.max(100,N.length*36),children:a.jsxs(iu,{data:N,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(Nl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Sl,{type:"number",tickFormatter:_=>ji(_),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Cl,{type:"category",dataKey:"name",width:88,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Qd,{content:a.jsx(Kw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(kl,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),j.size>0&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(ma,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),a.jsx(_d,{width:"100%",height:Math.max(100,k.length*36),children:a.jsxs(iu,{data:k,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(Nl,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Sl,{type:"number",tickFormatter:_=>ji(_),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Cl,{type:"category",dataKey:"name",width:64,tick:{fontSize:11,fill:"hsl(var(--foreground))",fontFamily:"monospace"},axisLine:!1,tickLine:!1}),a.jsx(Qd,{content:a.jsx(Kw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(kl,{dataKey:"minutes",fill:"#818cf8",radius:[0,4,4,0]})]})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(oa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issues"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(w.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:E}])=>{const P=d==null?void 0:d.get(_),O=new Set(C.map($=>$.issue_id)).size;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-sm font-medium",children:(P==null?void 0:P.name)??_.slice(0,8)+"…"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:O}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ji(E)})]},_)})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(ma,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Last logged"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Contributors"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(j.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:E}])=>{var B,A;const P=new Set(C.map(W=>W.user_id)).size,O=C.reduce((W,Q)=>Q.logged_date&&(!W||new Date(Q.logged_date)>new Date(W))?Q.logged_date:W,null),$=(B=C[0])==null?void 0:B.issue_identifier,D=(A=C[0])==null?void 0:A.issue_title;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$?a.jsx(Za,{to:`/${t}/projects/${e}/issues/${_}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:$}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[_.slice(0,8),"…"]}),D&&a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:D})]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:O?fe(new Date(O),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:P}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ji(E)})]},_)})})]})]})]}):a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Ja,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logged"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:f||m||o.length>0?"No entries match the current filters.":"Start logging time on issues to see reports here."})]}):a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex items-center justify-center py-12",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading project…"})})]})}const bQ={share_enabled:{icon:nh,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:IE,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:to,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40",label:(e,t)=>{var i,o,l;const r=(i=e==null?void 0:e.user_id)==null?void 0:i.to,n=(o=e==null?void 0:e.role)==null?void 0:o.to,s=r?((l=t.get(r))==null?void 0:l.name)??r:"a user";return n?`Added ${s} as ${n}`:`Added ${s}`}},member_removed:{icon:j1,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:(e,t)=>{var s,i;const r=(s=e==null?void 0:e.user_id)==null?void 0:s.from;return`Removed ${r?((i=t.get(r))==null?void 0:i.name)??r:"a user"}`}},team_added:{icon:oa,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.to;return`Added team ${n?r.get(n)??n:"a team"}`}},team_removed:{icon:nD,color:"text-orange-500",bg:"bg-orange-50 dark:bg-orange-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.from;return`Removed team ${n?r.get(n)??n:"a team"}`}},status_updated:{icon:GE,color:"text-violet-500",bg:"bg-violet-50 dark:bg-violet-950/40",label:e=>{var n,s;const t=(n=e==null?void 0:e.name)==null?void 0:n.from,r=(s=e==null?void 0:e.name)==null?void 0:s.to;return t&&r?`Renamed status "${t}" to "${r}"`:"Updated status"}},status_deleted:{icon:Dr,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:e=>{var r;const t=(r=e==null?void 0:e.name)==null?void 0:r.from;return t?`Deleted status "${t}"`:"Deleted status"}},updated:{icon:zs,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:st,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"}},wQ={icon:xu,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function jQ({activity:e,userMap:t,teamMap:r}){const n=bQ[e.action]??wQ,s=n.icon,i=t.get(e.actor_id),o=(i==null?void 0:i.name)??"System",l=(i==null?void 0:i.initials)??"S",c=n.label(e.changes,t,r),d=(()=>{var u,f;if(e.action==="share_enabled"){const m=(f=(u=e.changes)==null?void 0:u.share_url)==null?void 0:f.to;return m?a.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono break-all",children:m}):null}return null})();return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors",children:[a.jsx("div",{className:I("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:a.jsx(s,{className:I("h-4 w-4",n.color)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($t,{className:"h-5 w-5 shrink-0",children:a.jsx(zt,{className:"text-[10px] font-medium",children:l})}),a.jsx("span",{className:"text-sm font-medium truncate",children:o}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:c})]}),d&&a.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),a.jsx("time",{className:"text-xs text-muted-foreground shrink-0",children:fe(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function NQ(){const{projectKey:e}=Ht(),{workspace:t}=Ie(),{data:r}=Ca(e??""),{data:n,isLoading:s}=HD((r==null?void 0:r.id)??""),{data:i=new Map}=oi(),{data:o=[]}=Nu((t==null?void 0:t.id)??""),l=new Map(o.map(d=>[d.id,d.name])),c=(n==null?void 0:n.length)??0;return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Activity"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"A log of share access changes, member updates, and project edits."})]}),!s&&c>0&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[c," event",c!==1?"s":""]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Log"})}),s?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(d=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-3 w-64"})]}),a.jsx(le,{className:"h-3 w-32 shrink-0"})]},d))}):!n||n.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(xu,{className:"h-8 w-8 text-muted-foreground/20 mb-3"}),a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No activity yet"}),a.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Actions like sharing the project or adding members will appear here."})]}):a.jsx("div",{className:"divide-y divide-border",children:n.map(d=>a.jsx(jQ,{activity:d,userMap:i,teamMap:l},d.id))})]})})}const kQ=[{key:"mon",label:"Monday",short:"Mon"},{key:"tue",label:"Tuesday",short:"Tue"},{key:"wed",label:"Wednesday",short:"Wed"},{key:"thu",label:"Thursday",short:"Thu"},{key:"fri",label:"Friday",short:"Fri"},{key:"sat",label:"Saturday",short:"Sat"},{key:"sun",label:"Sunday",short:"Sun"}],SQ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function CQ({open:e,onClose:t,holiday:r}){const[n,s]=p.useState((r==null?void 0:r.name)??""),[i,o]=p.useState(r!=null&&r.date?r.date.split("T")[0]:""),[l,c]=p.useState((r==null?void 0:r.recurring)??!1);p.useEffect(()=>{e&&(s((r==null?void 0:r.name)??""),o(r!=null&&r.date?r.date.split("T")[0]:""),c((r==null?void 0:r.recurring)??!1))},[e,r==null?void 0:r.id]);const d=kI(),u=SI(),f=d.isPending||u.isPending,m=h=>{if(h.preventDefault(),!n.trim()){F.error("Holiday name is required");return}if(!i){F.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{F.success("Holiday updated"),t()},onError:()=>F.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{F.success("Holiday added"),t()},onError:()=>F.error("Failed to add holiday")})};return a.jsx(ls,{open:e,onOpenChange:h=>!h&&t(),children:a.jsxs(_a,{className:"sm:max-w-md",children:[a.jsxs(cs,{children:[a.jsx(ds,{children:r?"Edit holiday":"Add holiday"}),a.jsx(Bl,{children:"Holidays are excluded from business day calculations across the app."})]}),a.jsxs("form",{onSubmit:m,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Ae,{value:n,onChange:h=>s(h.target.value),placeholder:"e.g. New Year's Day",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Date"}),a.jsx(Ae,{type:"date",value:i,onChange:h=>o(h.target.value),className:"h-9",required:!0})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(uo,{checked:l,onCheckedChange:h=>c(h)}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Recurring annually (applies every year on the same date)"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function _Q(){const{data:e,isLoading:t}=tg(),r=NI(),n=(e==null?void 0:e.working_days)??SQ,s=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>F.success("Working days updated"),onError:()=>F.error("Failed to update working days")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Working days"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure which days count as business days. This affects duration calculations across the app."})}),t?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3,4,5,6,7].map(i=>a.jsx(le,{className:"h-8 w-full"},i))}):kQ.map(({key:i,label:o})=>{const l=n[i];return a.jsxs("div",{className:"grid grid-cols-[180px_1fr_auto] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:o}),a.jsx("span",{className:I("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),a.jsx(uo,{checked:l,onCheckedChange:c=>s(i,c),disabled:r.isPending})]},i)})]})}function OQ(){const[e,t]=p.useState(new Date().getFullYear()),[r,n]=p.useState(!1),[s,i]=p.useState(null),[o,l]=p.useState(null),{data:c=[],isLoading:d}=rg(e),u=CI(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{F.success("Holiday removed"),l(null)},onError:()=>F.error("Failed to remove holiday")})},m=[...c].sort((h,g)=>{const x=new Date(h.date).getMonth()*100+new Date(h.date).getDate(),v=new Date(g.date).getMonth()*100+new Date(g.date).getDate();return x-v});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Holidays"}),a.jsxs(J,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}),a.jsxs("div",{className:"flex items-center gap-1 px-6 py-3 border-b border-border bg-muted/10",children:[a.jsxs("p",{className:"text-xs text-muted-foreground flex-1",children:["Showing holidays for"," ",a.jsx("span",{className:"font-medium text-foreground",children:e}),". Recurring holidays appear every year."]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>t(h=>h-1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(vu,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-medium tabular-nums w-10 text-center",children:e}),a.jsx("button",{onClick:()=>t(h=>h+1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(kn,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"grid grid-cols-[160px_1fr_120px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Name"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Recurrence"}),a.jsx("span",{})]}),d?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(h=>a.jsx(le,{className:"h-8 w-full"},h))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center",children:[a.jsx(c1,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsxs("p",{className:"text-sm font-medium mb-1",children:["No holidays for ",e]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Add a holiday or use the year navigation to view other years."}),a.jsxs(J,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(h=>{const g=new Date(h.date);return a.jsxs("div",{className:"grid grid-cols-[160px_1fr_120px_40px] gap-4 items-center px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors",children:[a.jsx("span",{className:"text-sm tabular-nums text-muted-foreground",children:fe(g,"MMM d, yyyy")}),a.jsx("span",{className:"text-sm font-medium truncate",children:h.name}),a.jsx("span",{className:"text-sm",children:h.recurring?a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(nl,{className:"h-3 w-3"}),"Every year"]}):a.jsx("span",{className:"text-xs text-muted-foreground/60",children:"One-time"})}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(is,{className:"h-3.5 w-3.5"})})}),a.jsxs(Tr,{align:"end",className:"w-36",children:[a.jsxs(pt,{className:"gap-2 cursor-pointer",onClick:()=>{i(h),n(!0)},children:[a.jsx(zs,{className:"h-3.5 w-3.5"}),"Edit"]}),a.jsxs(pt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(h),children:[a.jsx(Dr,{className:"h-3.5 w-3.5"}),"Remove"]})]})]})})]},h.id)}),a.jsx(CQ,{open:r,onClose:()=>{n(!1),i(null)},holiday:s}),a.jsx($i,{open:!!o,onOpenChange:h=>!h&&l(null),children:a.jsxs(Us,{children:[a.jsxs(qs,{children:[a.jsxs(Ks,{children:['Remove "',o==null?void 0:o.name,'"?']}),a.jsx(Ys,{children:"This holiday will no longer be excluded from business day calculations."})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{children:"Cancel"}),a.jsx(Gs,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}const Yw=["super-admin","admin","member"],MQ={"super-admin":"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",admin:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/40 dark:text-indigo-300",member:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300"},Gw={pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",accepted:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",revoked:"bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400"};function PQ({value:e}){const[t,r]=p.useState(!1),n=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return a.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Copy",children:t?a.jsx(rr,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Dp,{className:"h-3.5 w-3.5"})})}function AQ(){const{data:e=[],isLoading:t}=Yl(),{data:r=[],isLoading:n}=iI(),{data:s=[]}=Yu(),i=Sk(),o=cI(),l=dI(),c=oI(),d=lI(),[u,f]=p.useState(null),[m,h]=p.useState(null),[g,x]=p.useState(!1),[v,y]=p.useState(""),[w,j]=p.useState("member"),N=b=>{b.preventDefault(),v.trim()&&d.mutate({email:v.trim().toLowerCase(),role:w},{onSuccess:()=>{F.success(`Invitation sent to ${v.trim()}`),x(!1),y(""),j("member")},onError:S=>F.error((S==null?void 0:S.message)??"Failed to send invitation")})},k=()=>{u&&l.mutate(u,{onSuccess:()=>{F.success("User deleted"),f(null)},onError:()=>F.error("Failed to delete user")})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"All users"}),a.jsxs(J,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>x(!0),children:[a.jsx(st,{className:"h-3.5 w-3.5"}),"Invite member"]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"View and manage all platform users. Change a user's custom role or remove them from the system."})}),a.jsx(ls,{open:g,onOpenChange:b=>{b||(x(!1),y(""),j("member"))},children:a.jsxs(_a,{className:"sm:max-w-md",children:[a.jsx(cs,{children:a.jsx(ds,{children:"Invite member"})}),a.jsxs("form",{onSubmit:N,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Email"}),a.jsx(Ae,{type:"email",value:v,onChange:b=>y(b.target.value),placeholder:"name@example.com",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),a.jsxs(Fe,{value:w,onValueChange:j,children:[a.jsx(ze,{className:"h-9 text-sm",children:a.jsx(qe,{})}),a.jsx(Le,{children:Yw.map(b=>a.jsx(xe,{value:b,className:"text-sm capitalize",children:b},b))})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"The user will receive an invite link to create their account. They won't be added to any workspace automatically — you can add them from workspace settings after they join."}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:()=>x(!1),children:"Cancel"}),a.jsx(J,{type:"submit",size:"sm",disabled:d.isPending,children:d.isPending?"Sending…":"Send invite"})]})]})]})}),a.jsxs("div",{className:"grid grid-cols-[1fr_160px_200px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Global role"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom role"}),a.jsx("span",{})]}),t?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(b=>a.jsx(le,{className:"h-10 w-full"},b))}):e.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(oa,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsx("p",{className:"text-sm font-medium",children:"No users found"})]}):e.map(b=>{var P;const S=b.first_name??"",_=b.last_name??"",C=`${S} ${_}`.trim()||b.email,E=(S[0]??_[0]??((P=b.email)==null?void 0:P[0])??"U").toUpperCase();return a.jsxs("div",{className:"grid grid-cols-[1fr_160px_200px_40px] gap-4 items-center px-6 py-3 border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-xs font-semibold text-zinc-600 dark:text-zinc-300 shrink-0",children:E}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:C}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.email})]})]}),a.jsxs(Fe,{value:b.role??"member",onValueChange:O=>o.mutate({userId:b.id,role:O},{onSuccess:()=>F.success("Global role updated"),onError:()=>F.error("Failed to update global role")}),children:[a.jsx(ze,{className:"h-7 text-xs w-full",children:a.jsx(qe,{})}),a.jsx(Le,{children:Yw.map(O=>a.jsx(xe,{value:O,className:"text-xs",children:a.jsx("span",{className:I("inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",MQ[O]),children:O})},O))})]}),a.jsxs(Fe,{value:b.app_role_id??"none",onValueChange:O=>i.mutate({userId:b.id,appRoleId:O==="none"?null:O},{onSuccess:()=>F.success("Custom role updated"),onError:()=>F.error("Failed to update custom role")}),children:[a.jsx(ze,{className:"h-7 text-xs w-full",children:a.jsx(qe,{placeholder:"No role"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"none",className:"text-xs",children:"No role"}),s.map(O=>a.jsx(xe,{value:O.id,className:"text-xs",children:O.name},O.id))]})]}),a.jsx("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(is,{className:"h-3.5 w-3.5"})})}),a.jsx(Tr,{align:"end",className:"w-36",children:a.jsxs(pt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>f(b.id),children:[a.jsx(Dr,{className:"h-3.5 w-3.5"}),"Delete user"]})})]})})]},b.id)}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 mt-2",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Invitations"})}),n?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(b=>a.jsx(le,{className:"h-8 w-full"},b))}):r.length===0?a.jsx("div",{className:"px-6 py-6 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No invitations yet."})}):r.map(b=>{const S=`${window.location.origin}/invite/${b.token}`;return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(Rl,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:b.email??"Shareable link"}),a.jsx("span",{className:I("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",b.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":b.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:b.role==="super-admin"?"Super Admin":b.role==="admin"?"Admin":"Member"}),b.workspace_name&&a.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:["· ",b.workspace_name]})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[320px]",children:S}),a.jsx(PQ,{value:S})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:I("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",Gw[b.status]??Gw.revoked),children:b.status}),a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:fe(new Date(b.created_at),"MMM d")}),b.status==="pending"&&a.jsx("button",{onClick:()=>h(b),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:a.jsx(et,{className:"h-3.5 w-3.5"})})]})]},b.id)}),a.jsx($i,{open:!!u,onOpenChange:b=>!b&&f(null),children:a.jsxs(Us,{children:[a.jsxs(qs,{children:[a.jsx(Ks,{children:"Delete this user?"}),a.jsx(Ys,{children:"This action is permanent and cannot be undone. The user will lose access immediately."})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{children:"Cancel"}),a.jsx(Gs,{onClick:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),a.jsx($i,{open:!!m,onOpenChange:b=>!b&&h(null),children:a.jsxs(Us,{children:[a.jsxs(qs,{children:[a.jsx(Ks,{children:"Revoke this invitation?"}),a.jsxs(Ys,{children:["The invite link sent to ",a.jsx("span",{className:"font-medium",children:m==null?void 0:m.email})," will no longer work."]})]}),a.jsxs(Hs,{children:[a.jsx(Vs,{children:"Cancel"}),a.jsx(Gs,{onClick:()=>{m&&c.mutate(m.id,{onSuccess:()=>{F.success("Invitation revoked"),h(null)},onError:()=>F.error("Failed to revoke invitation")})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke"})]})]})})]})}const EQ=["working-days","holidays","members"];function DQ(){const[e,t]=fu(),r=e.get("tab"),n=r&&EQ.includes(r)?r:"working-days",s=o=>t({tab:o},{replace:!0}),i=[{id:"working-days",label:"Working Days"},{id:"holidays",label:"Holidays"},{id:"members",label:"Members"}];return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(c1,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Organization Settings"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Global configuration that applies across the entire Meridian deployment."})]})]})}),a.jsx("div",{className:"flex border-b border-border shrink-0 px-6",children:i.map(o=>a.jsx("button",{onClick:()=>s(o.id),className:I("px-1 py-3 mr-6 text-sm font-medium border-b-2 transition-colors",n===o.id?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:o.label},o.id))}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n==="working-days"&&a.jsx(_Q,{}),n==="holidays"&&a.jsx(OQ,{}),n==="members"&&a.jsx(AQ,{})]})]})})}const Vm=e=>{let{transform:t}=e;return{...t,y:0}};function ev(){const[e,t]=p.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),r=p.useRef(null);return p.useLayoutEffect(()=>{const n=s=>{var o;let i={x:s.pageX,y:s.pageY};if(((o=r.current)==null?void 0:o.nodeType)===Node.ELEMENT_NODE){const{left:l,top:c}=r.current.getBoundingClientRect(),d=l+window.scrollX,u=c+window.scrollY,f=s.pageX-d,m=s.pageY-u;i.elementX=f,i.elementY=m,i.elementPositionX=d,i.elementPositionY=u}t(l=>({...l,...i}))};return document.addEventListener("mousemove",n),()=>{document.removeEventListener("mousemove",n)}},[]),[e,r]}function TQ(e,t=500){const[r,n]=p.useState(e),s=p.useRef(null);return p.useEffect(()=>{const i=Date.now();if(s.current&&i>=s.current+t)s.current=i,n(e);else{const o=window.setTimeout(()=>{s.current=i,n(e)},t);return()=>window.clearTimeout(o)}},[e,t]),r}function IQ(){const[e,t]=p.useState({x:null,y:null}),r=p.useCallback((...n)=>{if(typeof n[0]=="object")window.scrollTo(n[0]);else if(typeof n[0]=="number"&&typeof n[1]=="number")window.scrollTo(n[0],n[1]);else throw new Error("Invalid arguments passed to scrollTo. See here for more info. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return p.useLayoutEffect(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),[e,r]}const Rn={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function HO(e){return"init"in e}function pp(e){return!!e.write}function Vw(e){return"v"in e||"e"in e}function lu(e){if("e"in e)throw e.e;if((Rn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function cu(e){return typeof(e==null?void 0:e.then)=="function"}function KO(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function YO(e,t,r){var n;const s=new Set;for(const i of((n=r.get(e))==null?void 0:n.t)||[])s.add(i);for(const i of t.p)s.add(i);return s}const RQ=(e,t,...r)=>t.read(...r),$Q=(e,t,...r)=>t.write(...r),zQ=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},LQ=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},FQ=(e,t)=>{var r;const n=Rt(e),s=n[0],i=n[6],o=n[9];if((Rn?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let l=s.get(t);return l||(l={d:new Map,p:new Set,n:0},s.set(t,l),(r=i.i)==null||r.call(i,t),o==null||o(e,t)),l},BQ=e=>{const t=Rt(e),r=t[1],n=t[3],s=t[4],i=t[5],o=t[6],l=t[13],c=[],d=u=>{try{u()}catch(f){c.push(f)}};do{o.f&&d(o.f);const u=new Set,f=u.add.bind(u);n.forEach(m=>{var h;return(h=r.get(m))==null?void 0:h.l.forEach(f)}),n.clear(),i.forEach(f),i.clear(),s.forEach(f),s.clear(),u.forEach(d),n.size&&l(e)}while(n.size||i.size||s.size);if(c.length)throw new AggregateError(c)},WQ=e=>{const t=Rt(e),r=t[1],n=t[2],s=t[3],i=t[11],o=t[14],l=t[17],c=[],d=new WeakSet,u=new WeakSet,f=Array.from(s);for(;f.length;){const m=f[f.length-1],h=i(e,m);if(u.has(m)){f.pop();continue}if(d.has(m)){if(n.get(m)===h.n)c.push([m,h]);else if((Rn?"production":void 0)!=="production"&&n.has(m))throw new Error("[Bug] invalidated atom exists");u.add(m),f.pop();continue}d.add(m);for(const g of YO(m,h,r))d.has(g)||f.push(g)}for(let m=c.length-1;m>=0;--m){const[h,g]=c[m];let x=!1;for(const v of g.d.keys())if(v!==h&&s.has(v)){x=!0;break}x&&(o(e,h),l(e,h)),n.delete(h)}},gp=new WeakSet,UQ=(e,t)=>{var r,n;const s=Rt(e),i=s[1],o=s[2],l=s[3],c=s[6],d=s[7],u=s[11],f=s[12],m=s[13],h=s[14],g=s[16],x=s[17],v=s[20],y=s[26],w=u(e,t);if(Vw(w)){if(i.has(t)&&o.get(t)!==w.n)return w;let $=!1;for(const[D,B]of w.d)if(h(e,D).n!==B){$=!0;break}if(!$)return w}let j=!0;const N=new Set(w.d.keys()),k=new Map,b=()=>{for(const $ of N)k.has($)||w.d.delete($)},S=()=>{if(i.has(t)){const $=!l.size;x(e,t),$&&(m(e),f(e))}},_=$=>{var D;if($===t){const A=u(e,$);if(!Vw(A))if(HO($))v(e,$,$.init);else throw new Error("no atom init");return lu(A)}const B=h(e,$);try{return lu(B)}finally{k.set($,B.n),w.d.set($,B.n),cu(w.v)&&KO(t,w.v,B),i.has(t)&&((D=i.get($))==null||D.t.add(t)),j||S()}};let C,E;const P={get signal(){return C||(C=new AbortController),C.signal},get setSelf(){return(Rn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Rn?"production":void 0)!=="production"&&!pp(t)&&console.warn("setSelf function cannot be used with read-only atom"),!E&&pp(t)&&(E=(...$)=>{if((Rn?"production":void 0)!=="production"&&j&&console.warn("setSelf function cannot be called in sync"),!j)try{return g(e,t,...$)}finally{m(e),f(e)}}),E}},O=w.n;try{(Rn?"production":void 0)!=="production"&&gp.delete(e);const $=d(e,t,_,P);if((Rn?"production":void 0)!=="production"&&gp.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,$),cu($)){y(e,$,()=>C==null?void 0:C.abort());const D=()=>{b(),S()};$.then(D,D)}else b();return(r=c.r)==null||r.call(c,t),w}catch($){return delete w.v,w.e=$,++w.n,w}finally{j=!1,O!==w.n&&o.get(t)===O&&(o.set(t,w.n),l.add(t),(n=c.c)==null||n.call(c,t))}},qQ=(e,t)=>{const r=Rt(e),n=r[1],s=r[2],i=r[11],o=[t];for(;o.length;){const l=o.pop(),c=i(e,l);for(const d of YO(l,c,n)){const u=i(e,d);s.get(d)!==u.n&&(s.set(d,u.n),o.push(d))}}},HQ=(e,t,...r)=>{const n=Rt(e),s=n[3],i=n[6],o=n[8],l=n[11],c=n[12],d=n[13],u=n[14],f=n[15],m=n[16],h=n[17],g=n[20];let x=!0;const v=w=>lu(u(e,w)),y=(w,...j)=>{var N;const k=l(e,w);try{if(w===t){if(!HO(w))throw new Error("atom not writable");(Rn?"production":void 0)!=="production"&&gp.add(e);const b=k.n,S=j[0];g(e,w,S),h(e,w),b!==k.n&&(s.add(w),f(e,w),(N=i.c)==null||N.call(i,w));return}else return m(e,w,...j)}finally{x||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{x=!1}},KQ=(e,t)=>{var r;const n=Rt(e),s=n[1],i=n[3],o=n[6],l=n[11],c=n[15],d=n[18],u=n[19],f=l(e,t),m=s.get(t);if(m){for(const[h,g]of f.d)if(!m.d.has(h)){const x=l(e,h);d(e,h).t.add(t),m.d.add(h),g!==x.n&&(i.add(h),c(e,h),(r=o.c)==null||r.call(o,h))}for(const h of m.d)if(!f.d.has(h)){m.d.delete(h);const g=u(e,h);g==null||g.t.delete(t)}}},YQ=(e,t)=>{var r;const n=Rt(e),s=n[1],i=n[4],o=n[6],l=n[10],c=n[11],d=n[12],u=n[13],f=n[14],m=n[16],h=n[18],g=c(e,t);let x=s.get(t);if(!x){f(e,t);for(const v of g.d.keys())h(e,v).t.add(t);if(x={l:new Set,d:new Set(g.d.keys()),t:new Set},s.set(t,x),pp(t)){const v=()=>{let y=!0;const w=(...j)=>{try{return m(e,t,...j)}finally{y||(u(e),d(e))}};try{const j=l(e,t,w);j&&(x.u=()=>{y=!0;try{j()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return x},GQ=(e,t)=>{var r,n;const s=Rt(e),i=s[1],o=s[5],l=s[6],c=s[11],d=s[19],u=c(e,t);let f=i.get(t);if(!f||f.l.size)return f;let m=!1;for(const h of f.t)if((r=i.get(h))!=null&&r.d.has(t)){m=!0;break}if(!m){f.u&&o.add(f.u),f=void 0,i.delete(t);for(const h of u.d.keys()){const g=d(e,h);g==null||g.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},VQ=(e,t,r)=>{const n=Rt(e),s=n[11],i=n[27],o=s(e,t),l="v"in o,c=o.v;if(cu(r))for(const d of o.d.keys())KO(t,r,s(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,cu(c)&&i(e,c))},XQ=(e,t)=>{const r=Rt(e)[14];return lu(r(e,t))},QQ=(e,t,...r)=>{const n=Rt(e),s=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),s(e)}},ZQ=(e,t,r)=>{const n=Rt(e),s=n[12],i=n[18],o=n[19],c=i(e,t).l;return c.add(r),s(e),()=>{c.delete(r),o(e,t),s(e)}},JQ=(e,t,r)=>{const s=Rt(e)[25];let i=s.get(t);if(!i){i=new Set,s.set(t,i);const o=()=>s.delete(t);t.then(o,o)}i.add(r)},eZ=(e,t)=>{const s=Rt(e)[25].get(t);s==null||s.forEach(i=>i())},GO=new WeakMap,Rt=e=>{const t=GO.get(e);if((Rn?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function tZ(e){const t=Rt(e),r=t[24];return r?r(t):t}function rZ(...e){const t={get(n){const s=Rt(t)[21];return s(t,n)},set(n,...s){const i=Rt(t)[22];return i(t,n,...s)},sub(n,s){const i=Rt(t)[23];return i(t,n,s)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},RQ,$Q,zQ,LQ,FQ,BQ,WQ,UQ,qQ,HQ,KQ,YQ,GQ,VQ,XQ,QQ,ZQ,void 0,new WeakMap,JQ,eZ].map((n,s)=>e[s]||n);return GO.set(t,Object.freeze(r)),t}const VO={};let nZ=0;function XO(e,t){const r=`atom${++nZ}`,n={toString(){return(VO?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=aZ,n.write=sZ),n}function aZ(e){return e(this)}function sZ(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function iZ(){return rZ()}let Yo;function oZ(){return Yo||(Yo=iZ(),(VO?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Yo),globalThis.__JOTAI_DEFAULT_STORE__!==Yo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Yo}const lZ={},cZ=p.createContext(void 0);function QO(e){return p.useContext(cZ)||oZ()}const xp=e=>typeof(e==null?void 0:e.then)=="function",vp=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},dZ=T.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(vp(e),e)}),Xm=new WeakMap,Xw=(e,t,r)=>{const s=tZ(e)[26];let i=Xm.get(t);return i||(i=new Promise((o,l)=>{let c=t;const d=m=>h=>{c===m&&o(h)},u=m=>h=>{c===m&&l(h)},f=()=>{try{const m=r();xp(m)?(Xm.set(m,i),c=m,m.then(d(m),u(m)),s(e,m,f)):o(m)}catch(m){l(m)}};t.then(d(t),u(t)),s(e,t,f)}),Xm.set(t,i)),i};function uZ(e,t){const{delay:r,unstable_promiseStatus:n=!T.use}={},s=QO(),[[i,o,l],c]=p.useReducer(u=>{const f=s.get(e);return Object.is(u[0],f)&&u[1]===s&&u[2]===e?u:[f,s,e]},void 0,()=>[s.get(e),s,e]);let d=i;if((o!==s||l!==e)&&(c(),d=s.get(e)),p.useEffect(()=>{const u=s.sub(e,()=>{if(n)try{const f=s.get(e);xp(f)&&vp(Xw(s,f,()=>s.get(e)))}catch{}if(typeof r=="number"){setTimeout(c,r);return}c()});return c(),u},[s,e,r,n]),p.useDebugValue(d),xp(d)){const u=Xw(s,d,()=>s.get(e));return n&&vp(u),dZ(u)}return d}function fZ(e,t){const r=QO();return p.useCallback((...s)=>{if((lZ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...s)},[r,e])}function ZO(e,t){return[uZ(e),fZ(e)]}var JO="Expected a function",Qw=NaN,mZ="[object Symbol]",hZ=/^\s+|\s+$/g,pZ=/^[-+]0x[0-9a-f]+$/i,gZ=/^0b[01]+$/i,xZ=/^0o[0-7]+$/i,vZ=parseInt,yZ=typeof xc=="object"&&xc&&xc.Object===Object&&xc,bZ=typeof self=="object"&&self&&self.Object===Object&&self,wZ=yZ||bZ||Function("return this")(),jZ=Object.prototype,NZ=jZ.toString,kZ=Math.max,SZ=Math.min,Qm=function(){return wZ.Date.now()};function CZ(e,t,r){var n,s,i,o,l,c,d=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(JO);t=Zw(t)||0,du(r)&&(u=!!r.leading,f="maxWait"in r,i=f?kZ(Zw(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function h(b){var S=n,_=s;return n=s=void 0,d=b,o=e.apply(_,S),o}function g(b){return d=b,l=setTimeout(y,t),u?h(b):o}function x(b){var S=b-c,_=b-d,C=t-S;return f?SZ(C,i-_):C}function v(b){var S=b-c,_=b-d;return c===void 0||S>=t||S<0||f&&_>=i}function y(){var b=Qm();if(v(b))return w(b);l=setTimeout(y,x(b))}function w(b){return l=void 0,m&&n?h(b):(n=s=void 0,o)}function j(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function N(){return l===void 0?o:w(Qm())}function k(){var b=Qm(),S=v(b);if(n=arguments,s=this,c=b,S){if(l===void 0)return g(c);if(f)return l=setTimeout(y,t),h(c)}return l===void 0&&(l=setTimeout(y,t)),o}return k.cancel=j,k.flush=N,k}function _Z(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(JO);return du(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),CZ(e,t,{leading:n,maxWait:t,trailing:s})}function du(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function OZ(e){return!!e&&typeof e=="object"}function MZ(e){return typeof e=="symbol"||OZ(e)&&NZ.call(e)==mZ}function Zw(e){if(typeof e=="number")return e;if(MZ(e))return Qw;if(du(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=du(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(hZ,"");var r=gZ.test(e);return r||xZ.test(e)?vZ(e.slice(2),r?2:8):pZ.test(e)?Qw:+e}var PZ=_Z;const AZ=Sa(PZ),eM=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:I("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));eM.displayName="Card";const EZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:I("flex flex-col space-y-1.5 p-6",e),...t}));EZ.displayName="CardHeader";const DZ=p.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:I("text-2xl font-semibold leading-none tracking-tight",e),...t}));DZ.displayName="CardTitle";const TZ=p.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:I("text-sm text-muted-foreground",e),...t}));TZ.displayName="CardDescription";const IZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:I("p-6 pt-0",e),...t}));IZ.displayName="CardContent";const RZ=p.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:I("flex items-center p-6 pt-0",e),...t}));RZ.displayName="CardFooter";function $Z(e,t=[]){let r=[];function n(i,o){const l=p.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:h,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:h})};d.displayName=i+"Provider";function u(f,m){var x;const h=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=p.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>p.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,zZ(s,...t)]}function zZ(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function LZ(e){const t=FZ(e),r=p.forwardRef((n,s)=>{const{children:i,...o}=n,l=p.Children.toArray(i),c=l.find(WZ);if(c){const d=c.props.children,u=l.map(f=>f===c?p.Children.count(d)>1?p.Children.only(null):p.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:p.isValidElement(d)?p.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function FZ(e){const t=p.forwardRef((r,n)=>{const{children:s,...i}=r;if(p.isValidElement(s)){const o=qZ(s),l=UZ(i,s.props);return s.type!==p.Fragment&&(l.ref=n?Mj(n,o):o),p.cloneElement(s,l)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BZ=Symbol("radix.slottable");function WZ(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BZ}function UZ(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function qZ(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var HZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KZ=HZ.reduce((e,t)=>{const r=LZ(`Primitive.${t}`),n=p.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),tv="ContextMenu",[YZ]=$Z(tv,[Dj]),kr=Dj(),[GZ,tM]=YZ(tv),rM=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:s,modal:i=!0}=e,[o,l]=p.useState(!1),c=kr(t),d=kP(n),u=p.useCallback(f=>{l(f),d(f)},[d]);return a.jsx(GZ,{scope:t,open:o,onOpenChange:u,modal:i,children:a.jsx(SP,{...c,dir:s,open:o,onOpenChange:u,modal:i,children:r})})};rM.displayName=tv;var nM="ContextMenuTrigger",aM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...s}=e,i=tM(nM,r),o=kr(r),l=p.useRef({x:0,y:0}),c=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=p.useRef(0),u=p.useCallback(()=>window.clearTimeout(d.current),[]),f=m=>{l.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return p.useEffect(()=>u,[u]),p.useEffect(()=>void(n&&u()),[n,u]),a.jsxs(a.Fragment,{children:[a.jsx(CP,{...o,virtualRef:c}),a.jsx(KZ.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Ns(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:Ns(e.onPointerDown,Yc(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:Ns(e.onPointerMove,Yc(u)),onPointerCancel:n?e.onPointerCancel:Ns(e.onPointerCancel,Yc(u)),onPointerUp:n?e.onPointerUp:Ns(e.onPointerUp,Yc(u))})]})});aM.displayName=nM;var VZ="ContextMenuPortal",sM=e=>{const{__scopeContextMenu:t,...r}=e,n=kr(t);return a.jsx(gP,{...n,...r})};sM.displayName=VZ;var iM="ContextMenuContent",oM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=tM(iM,r),i=kr(r),o=p.useRef(!1);return a.jsx(xP,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var c;(c=e.onCloseAutoFocus)==null||c.call(e,l),!l.defaultPrevented&&o.current&&l.preventDefault(),o.current=!1},onInteractOutside:l=>{var c;(c=e.onInteractOutside)==null||c.call(e,l),!l.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oM.displayName=iM;var XZ="ContextMenuGroup",QZ=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(_P,{...s,...n,ref:t})});QZ.displayName=XZ;var ZZ="ContextMenuLabel",lM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(jP,{...s,...n,ref:t})});lM.displayName=ZZ;var JZ="ContextMenuItem",cM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(vP,{...s,...n,ref:t})});cM.displayName=JZ;var eJ="ContextMenuCheckboxItem",dM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(yP,{...s,...n,ref:t})});dM.displayName=eJ;var tJ="ContextMenuRadioGroup",rJ=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(OP,{...s,...n,ref:t})});rJ.displayName=tJ;var nJ="ContextMenuRadioItem",uM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(wP,{...s,...n,ref:t})});uM.displayName=nJ;var aJ="ContextMenuItemIndicator",fM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(bP,{...s,...n,ref:t})});fM.displayName=aJ;var sJ="ContextMenuSeparator",mM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(NP,{...s,...n,ref:t})});mM.displayName=sJ;var iJ="ContextMenuArrow",oJ=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(MP,{...s,...n,ref:t})});oJ.displayName=iJ;var lJ="ContextMenuSubTrigger",hM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(hP,{...s,...n,ref:t})});hM.displayName=lJ;var cJ="ContextMenuSubContent",pM=p.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=kr(r);return a.jsx(pP,{...s,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pM.displayName=cJ;function Yc(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var dJ=rM,uJ=aM,fJ=sM,gM=oM,xM=lM,vM=cM,yM=dM,bM=uM,wM=fM,jM=mM,NM=hM,kM=pM;const mJ=dJ,hJ=uJ,pJ=p.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(NM,{ref:s,className:I("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,a.jsx(kn,{className:"ml-auto h-4 w-4"})]}));pJ.displayName=NM.displayName;const gJ=p.forwardRef(({className:e,...t},r)=>a.jsx(kM,{ref:r,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));gJ.displayName=kM.displayName;const SM=p.forwardRef(({className:e,...t},r)=>a.jsx(fJ,{children:a.jsx(gM,{ref:r,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));SM.displayName=gM.displayName;const CM=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(vM,{ref:n,className:I("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));CM.displayName=vM.displayName;const xJ=p.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(yM,{ref:s,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(wM,{children:a.jsx(rr,{className:"h-4 w-4"})})}),t]}));xJ.displayName=yM.displayName;const vJ=p.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(bM,{ref:n,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(wM,{children:a.jsx(an,{className:"h-2 w-2 fill-current"})})}),t]}));vJ.displayName=bM.displayName;const yJ=p.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(xM,{ref:n,className:I("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));yJ.displayName=xM.displayName;const bJ=p.forwardRef(({className:e,...t},r)=>a.jsx(jM,{ref:r,className:I("-mx-1 my-1 h-px bg-border",e),...t}));bJ.displayName=jM.displayName;const wJ=XO(!1),jJ=XO(0),rv=()=>ZO(wJ),nv=()=>ZO(jJ),NJ=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=ts),t},gc=e=>{let t=iN;return(e==="monthly"||e==="quarterly")&&(t=cN),t},av=e=>{let t=B5;return(e==="monthly"||e==="quarterly")&&(t=iN),t},_l=e=>{let t=Ti;return(e==="monthly"||e==="quarterly")&&(t=uN),t},kJ=e=>{let t=lN;return(e==="monthly"||e==="quarterly")&&(t=Qp),t},_M=e=>{let t=Ar;return(e==="monthly"||e==="quarterly")&&(t=Gp),t},Jo=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,s=Math.floor(t/n),i=NJ(e.range),l=_M(e.range)(r,s),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Ar(l,u)},SJ=e=>{const t=[];t.push({year:e.getFullYear()-1,quarters:new Array(4).fill(null)},{year:e.getFullYear(),quarters:new Array(4).fill(null)},{year:e.getFullYear()+1,quarters:new Array(4).fill(null)});for(const r of t)r.quarters=new Array(4).fill(null).map((n,s)=>({months:new Array(3).fill(null).map((i,o)=>{const l=s*3+o;return{days:ts(new Date(r.year,l,1))}})}));return t},OM=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,s=gc(r.range),i=_l(r.range),o=s(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=ts(e),d=n/c;return o*n+l*d},CJ=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const s=gc(r.range);if(r.range==="daily"){const g=s(t,e);return n*(g||1)}const i=ts(e),o=n/i;if(Ii(e,t))return o;const l=av(r.range),c=_l(r.range);if(Ii(c(e),c(t)))return l(t,e)*o;const d=i-tl(e),u=tl(t),f=s(c(t),c(e)),m=ts(t),h=n/m;return(f-1)*n+d*o+u*h},MM=(e,t,r)=>{const n=_l(t),s=kJ(t),i=av(t),o=n(e),l=s(e),c=i(l,o);return e.getDate()/c*r},Cn=p.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),sv=({title:e,columns:t,renderHeaderItem:r})=>{const n=p.useId();return a.jsxs("div",{className:"sticky top-0 z-20 grid w-full shrink-0 bg-backdrop/90 backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("div",{children:a.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:a.jsx("p",{children:e})})}),a.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((s,i)=>a.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:r(i)},`${n}-${i}`))})]})},_J=()=>p.useContext(Cn).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(sv,{columns:r.days,renderHeaderItem:s=>a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx("p",{children:fe(Ar(new Date(t.year,n,1),s),"d")}),a.jsx("p",{className:"text-muted-foreground",children:fe(Ar(new Date(t.year,n,1),s),"EEEEE")})]}),title:fe(new Date(t.year,n,1),"MMMM yyyy")}),a.jsx(iv,{columns:r.days,isColumnSecondary:s=>[0,6].includes(Ar(new Date(t.year,n,1),s).getDay())})]},`${t.year}-${n}`))),OJ=()=>p.useContext(Cn).timelineData.map(t=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(sv,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>a.jsx("p",{children:fe(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),a.jsx(iv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),MJ=()=>p.useContext(Cn).timelineData.map(t=>t.quarters.map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(sv,{columns:r.months.length,renderHeaderItem:s=>a.jsx("p",{children:fe(new Date(t.year,n*3+s,1),"MMM")}),title:`Q${n+1} ${t.year}`}),a.jsx(iv,{columns:r.months.length})]},`${t.year}-${n}`))),PJ={daily:_J,monthly:OJ,quarterly:MJ},AJ=({className:e})=>{const t=p.useContext(Cn),r=PJ[t.range];return a.jsx("div",{className:I("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:a.jsx(r,{})})},Zm=({feature:e,onSelectItem:t,className:r,duration:n})=>{const s=p.useContext(Cn),i=e.endAt&&Ii(e.startAt,e.endAt)?Ar(e.endAt,1):e.endAt,o=n??(i?ch(e.startAt,i):`${ch(e.startAt,new Date)} so far`),l=d=>{var u;d.target===d.currentTarget&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))},c=d=>{var u;d.key==="Enter"&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))};return a.jsxs("div",{className:I("relative flex items-center gap-2.5 p-2.5 text-xs hover:bg-secondary",r),onClick:l,onKeyDown:c,role:"button",style:{height:"var(--gantt-row-height)"},tabIndex:0,children:[a.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),a.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),a.jsx("p",{className:"pointer-events-none text-muted-foreground",children:o})]},e.id)},EJ=()=>a.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-end justify-between gap-2.5 border-border/50 border-b bg-backdrop/90 p-2.5 font-medium text-muted-foreground text-xs backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),a.jsx("p",{className:"shrink-0",children:"Duration"})]}),Jm=({children:e,name:t,className:r})=>a.jsxs("div",{className:r,children:[a.jsx("p",{className:"w-full truncate p-2.5 text-left font-medium text-muted-foreground text-xs",style:{height:"var(--gantt-row-height)"},children:t}),a.jsx("div",{className:"divide-y divide-border/50",children:e})]}),DJ=({children:e,className:t})=>a.jsxs("div",{className:I("sticky left-0 z-30 h-max min-h-full overflow-clip border-border/50 border-r bg-white dark:bg-zinc-950 backdrop-blur-md",t),"data-roadmap-ui":"gantt-sidebar",children:[a.jsx(EJ,{}),a.jsx("div",{className:"space-y-4",children:e})]}),TJ=({top:e,className:t})=>{const[r]=nv(),n=p.useContext(Cn),[s,i]=ev(),o=()=>{var u,f,m;const l=(f=(u=n.ref)==null?void 0:u.current)==null?void 0:f.getBoundingClientRect(),c=s.x-((l==null?void 0:l.left)??0)+r-n.sidebarWidth,d=Jo(n,c);(m=n.onAddItem)==null||m.call(n,d)};return a.jsx("div",{className:I("absolute top-0 w-full px-0.5",t),ref:i,style:{marginTop:-n.rowHeight/2,transform:`translateY(${e}px)`},children:a.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:o,type:"button",children:a.jsx(st,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},IJ=({index:e,isColumnSecondary:t})=>{var m;const r=p.useContext(Cn),[n]=rv(),[s,i]=ev(),[o,l]=p.useState(!1),[c]=IQ(),d=()=>l(!0),u=()=>l(!1),f=TQ(s.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return a.jsx("div",{className:I("group relative h-full overflow-hidden",t!=null&&t(e)?"bg-[#f59e0b]/5 dark:bg-[#f59e0b]/5":""),onMouseEnter:d,onMouseLeave:u,ref:i,children:!n&&o&&r.onAddItem?a.jsx(TJ,{top:f}):null})},iv=({columns:e,isColumnSecondary:t})=>{const r=p.useId();return a.jsx("div",{className:"divide grid h-full w-full divide-x divide-border/50",style:{gridTemplateColumns:`repeat(${e}, var(--gantt-column-width))`},children:Array.from({length:e}).map((n,s)=>a.jsx(IJ,{index:s,isColumnSecondary:t},`${r}-${s}`))})},Jw=({direction:e,featureId:t,date:r})=>{const[,n]=rv(),{attributes:s,listeners:i,setNodeRef:o}=$j({id:`feature-drag-helper-${t}`}),l=!!s["aria-pressed"];return p.useEffect(()=>n(l),[l,n]),a.jsxs("div",{className:I("group -translate-y-1/2 !cursor-col-resize absolute top-1/2 z-[3] h-full w-6 rounded-md outline-none",e==="left"?"-left-2.5":"-right-2.5"),ref:o,...s,...i,children:[a.jsx("div",{className:I("-translate-y-1/2 absolute top-1/2 h-[80%] w-1 rounded-sm bg-muted-foreground opacity-0 transition-all",e==="left"?"left-2.5":"right-2.5",e==="left"?"group-hover:left-0":"group-hover:right-0",l&&(e==="left"?"left-0":"right-0"),"group-hover:opacity-100",l&&"opacity-100")}),r&&a.jsx("div",{className:I("-translate-x-1/2 absolute top-10 hidden whitespace-nowrap rounded-lg border border-border/50 bg-background/90 px-2 py-1 text-foreground text-xs backdrop-blur-lg group-hover:block",l&&"block"),children:fe(r,"MMM dd, yyyy")})]})},RJ=({id:e,children:t})=>{const[,r]=rv(),{attributes:n,listeners:s,setNodeRef:i}=$j({id:e}),o=!!n["aria-pressed"];return p.useEffect(()=>r(o),[o,r]),a.jsx(eM,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:a.jsx("div",{className:I("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...s,ref:i,children:t})})},ej=({onMove:e,children:t,className:r,...n})=>{const[s]=nv(),i=p.useContext(Cn),o=p.useMemo(()=>{var P;return new Date(((P=i.timelineData.at(0))==null?void 0:P.year)??0,0,1)},[i.timelineData]),[l,c]=p.useState(n.startAt),[d,u]=p.useState(n.endAt),f=p.useMemo(()=>CJ(l,d,i),[l,d,i]),m=p.useMemo(()=>OM(l,o,i),[l,o,i]),h=p.useMemo(()=>_M(i.range),[i.range]),[g]=ev(),[x,v]=p.useState(0),[y,w]=p.useState(l),[j,N]=p.useState(d),k=jp(IP,{activationConstraint:{distance:10}}),b=p.useCallback(()=>{v(g.x),w(l),N(d)},[g.x,l,d]),S=p.useCallback(()=>{const P=Jo(i,g.x),O=Jo(i,x),$=i.range==="daily"?gc(i.range)(P,O):av(i.range)(P,O),D=Ar(y,$),B=j?Ar(j,$):null;c(D),u(B)},[i,g.x,x,y,j]),_=p.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),C=p.useCallback(()=>{var B,A;const P=(A=(B=i.ref)==null?void 0:B.current)==null?void 0:A.getBoundingClientRect(),O=g.x-((P==null?void 0:P.left)??0)+s-i.sidebarWidth,D=_l(i.range)(Jo(i,O));c(D)},[i,g.x,s]),E=p.useCallback(()=>{var B,A;const P=(A=(B=i.ref)==null?void 0:B.current)==null?void 0:A.getBoundingClientRect(),O=g.x-((P==null?void 0:P.left)??0)+s-i.sidebarWidth,D=_l(i.range)(Jo(i,O));u(D)},[i,g.x,s]);return a.jsx("div",{className:I("relative flex w-max min-w-full py-0.5",r),style:{height:"var(--gantt-row-height)"},children:a.jsxs("div",{className:"pointer-events-auto absolute top-0.5",style:{height:"calc(var(--gantt-row-height) - 4px)",width:Math.round(f),left:Math.round(m)},children:[e&&a.jsx(el,{modifiers:[Vm],onDragEnd:_,onDragMove:C,sensors:[k],children:a.jsx(Jw,{date:l,direction:"left",featureId:n.id})}),a.jsx(el,{modifiers:[Vm],onDragEnd:_,onDragMove:S,onDragStart:b,sensors:[k],children:a.jsx(RJ,{id:n.id,children:t??a.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&a.jsx(el,{modifiers:[Vm],onDragEnd:_,onDragMove:E,sensors:[k],children:a.jsx(Jw,{date:d?gN(d):h(l,1),direction:"right",featureId:n.id})})]})})},eh=({children:e,className:t})=>a.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),$J=({className:e,children:t})=>a.jsx("div",{className:I("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),PM=p.memo(({label:e,date:t,id:r,onRemove:n,className:s})=>{const i=p.useContext(Cn),o=p.useMemo(()=>gc(i.range),[i.range]),l=p.useMemo(()=>{var f;return new Date(((f=i.timelineData.at(0))==null?void 0:f.year)??0,0,1)},[i.timelineData]),c=p.useMemo(()=>o(t,l),[o,t,l]),d=p.useMemo(()=>MM(t,i.range,i.columnWidth*i.zoom/100),[t,i.range,i.columnWidth,i.zoom]),u=p.useCallback(()=>n==null?void 0:n(r),[n,r]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${c} + ${d}px))`},children:[a.jsxs(mJ,{children:[a.jsx(hJ,{asChild:!0,children:a.jsxs("div",{className:I("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",s),children:[e,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:fe(t,"MMM dd, yyyy")})]})}),a.jsx(SM,{children:n?a.jsxs(CM,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[a.jsx(ZE,{size:16}),"Remove marker"]}):null})]}),a.jsx("div",{className:I("h-full w-px bg-card",s)})]})});PM.displayName="GanttMarker";const zJ=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:s})=>{const i=p.useRef(null),[o,l]=p.useState(SJ(new Date)),[,c]=nv(),[d,u]=p.useState(0),f=60,m=36;let h=50;t==="monthly"?h=150:t==="quarterly"&&(h=100);const g=p.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*h}px`,"--gantt-header-height":`${f}px`,"--gantt-row-height":`${m}px`,"--gantt-sidebar-width":`${d}px`}),[e,h,d]);p.useEffect(()=>{i.current&&(i.current.scrollLeft=i.current.scrollWidth/2-i.current.clientWidth/2,c(i.current.scrollLeft))},[c]),p.useEffect(()=>{const y=()=>{var k;const N=((k=i.current)==null?void 0:k.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;u(N)};y();const w=new MutationObserver(y);return i.current&&w.observe(i.current,{childList:!0,subtree:!0}),()=>{w.disconnect()}},[]);const x=p.useCallback(AZ(()=>{var k,b;const y=i.current;if(!y)return;const{scrollLeft:w,scrollWidth:j,clientWidth:N}=y;if(c(w),w===0){const S=(k=o[0])==null?void 0:k.year;if(!S)return;const _=[...o];_.unshift({year:S-1,quarters:new Array(4).fill(null).map((C,E)=>({months:new Array(3).fill(null).map((P,O)=>{const $=E*3+O;return{days:ts(new Date(S,$,1))}})}))}),l(_),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(w+N>=j){const S=(b=o.at(-1))==null?void 0:b.year;if(!S)return;const _=[...o];_.push({year:S+1,quarters:new Array(4).fill(null).map((C,E)=>({months:new Array(3).fill(null).map((P,O)=>{const $=E*3+O;return{days:ts(new Date(S,$,1))}})}))}),l(_),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);p.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",x),()=>{y&&y.removeEventListener("scroll",x)}},[x]);const v=p.useCallback(y=>{const w=i.current;if(!w)return;const j=new Date(o[0].year,0,1),N=OM(y.startAt,j,{zoom:e,range:t,columnWidth:h}),k=Math.max(0,N);w.scrollTo({left:k,behavior:"smooth"})},[o,e,t,h,d,r]);return a.jsx(Cn.Provider,{value:{zoom:e,range:t,headerHeight:f,columnWidth:h,sidebarWidth:d,rowHeight:m,onAddItem:r,timelineData:o,placeholderLength:2,ref:i,scrollToFeature:v},children:a.jsx("div",{className:I("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:i,style:{...g,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},LJ=({children:e,className:t})=>a.jsx("div",{className:I("relative flex h-full w-max flex-none overflow-clip",t),children:e}),FJ=({className:e})=>{const t="Today",r=p.useMemo(()=>new Date,[]),n=p.useContext(Cn),s=p.useMemo(()=>gc(n.range),[n.range]),i=p.useMemo(()=>{var c;return new Date(((c=n.timelineData.at(0))==null?void 0:c.year)??0,0,1)},[n.timelineData]),o=p.useMemo(()=>s(r,i),[s,r,i]),l=p.useMemo(()=>MM(r,n.range,n.columnWidth*n.zoom/100),[r,n.range,n.columnWidth,n.zoom]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${o} + ${l}px))`},children:[a.jsxs("div",{className:I("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",e),children:[t,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:fe(r,"MMM dd, yyyy")})]}),a.jsx("div",{className:I("h-full w-px bg-card",e)})]})};function BJ(e){return Be({queryKey:["public","share",e],queryFn:()=>te.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function ov(e,t={}){const r=new URLSearchParams;t.status&&r.set("status",t.status),t.priority&&r.set("priority",t.priority),t.search&&r.set("search",t.search);const n=r.toString()?`?${r.toString()}`:"";return Be({queryKey:["public","share",e,"issues",t],queryFn:()=>te.get(`/public/share/${e}/issues${n}`),select:s=>s.issues,enabled:!!e,retry:!1})}function AM(e){return Be({queryKey:["public","share",e,"sprints"],queryFn:()=>te.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function WJ({priority:e,className:t}){const r=I("h-3.5 w-3.5 shrink-0",eg[e],t);switch(e){case"urgent":return a.jsx(os,{className:r});case"high":return a.jsx(Tl,{className:r});case"medium":return a.jsx(eo,{className:r});case"low":return a.jsx(Dl,{className:r});default:return a.jsx(an,{className:I("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const yp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function EM({issue:e,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:i=!1,children:o=[],childrenMap:l}){const[c,d]=p.useState(!1),u=o.length>0,f=n[e.status]??"#94a3b8",m=s.find(h=>h.id===e.sprint_id);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:I(`group grid ${yp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[a.jsx("span",{className:I("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"text-muted-foreground/60"),children:e.identifier}),a.jsxs("div",{className:I("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"bg-[#f8f9fa] dark:bg-muted/20"),children:[u?a.jsxs(Ya,{children:[a.jsx(Ga,{asChild:!0,children:a.jsx("button",{onClick:()=>d(!c),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:c?a.jsx(Kn,{className:"h-3.5 w-3.5"}):a.jsx(kn,{className:"h-3.5 w-3.5"})})}),a.jsx(fa,{side:"top",children:c?"Collapse":"Expand"})]}):i?a.jsx(yn,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:I("text-sm text-foreground truncate",i&&"text-muted-foreground"),children:e.title}),u&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(yn,{className:"h-2.5 w-2.5"}),o.length]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:f}}),a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(WJ,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:wn[e.priority]??e.priority})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx(Er,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:I("text-xs truncate",m?"text-foreground":"text-muted-foreground/50"),children:(m==null?void 0:m.name)??"—"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(dr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:I("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?fe(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),a.jsx("div",{className:"flex items-center px-1.5",children:a.jsx("div",{className:"flex -space-x-1.5",children:(e.assignees??[]).slice(0,3).map(h=>a.jsx("div",{title:h.name,className:"h-5 w-5 rounded-full bg-indigo-100 dark:bg-indigo-900 border border-white dark:border-card flex items-center justify-center text-[10px] font-medium text-indigo-700 dark:text-indigo-300",children:h.initials},h.id))})})]}),c&&o.map(h=>a.jsx(EM,{issue:h,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:!0,children:(l==null?void 0:l[h.id])??[],childrenMap:l},h.id))]})}function UJ({issues:e,childrenMap:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,totalCount:o}){const[l,c]=p.useState(!1);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border",children:[a.jsx("button",{onClick:()=>c(!l),className:"text-muted-foreground hover:text-foreground transition-colors",children:l?a.jsx(kn,{className:"h-3.5 w-3.5"}):a.jsx(Kn,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Issues"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:o})]}),!l&&a.jsx("div",{className:"divide-y divide-border/60",children:e.length===0?a.jsx("div",{className:"px-14 py-5 text-xs text-muted-foreground/50 italic",children:"No issues match your filters"}):e.map(d=>a.jsx(EM,{issue:d,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function qJ({token:e,statuses:t}){const[r,n]=p.useState("all"),[s,i]=p.useState("all"),[o,l]=p.useState("all"),[c,d]=p.useState(""),{data:u=[],isLoading:f}=ov(e),{data:m=[]}=AM(e),h=Object.fromEntries(t.map(j=>[j.key,j.name])),g=Object.fromEntries(t.map(j=>[j.key,j.color])),x={};for(const j of u)j.parent_id&&(x[j.parent_id]||(x[j.parent_id]=[]),x[j.parent_id].push(j));const v=u.filter(j=>!j.parent_id).filter(j=>{const N=c.toLowerCase(),k=!c||j.title.toLowerCase().includes(N)||j.identifier.toLowerCase().includes(N),b=r==="all"||j.status===r,S=s==="all"||j.priority===s,_=o==="all"?!0:o==="none"?!j.sprint_id:j.sprint_id===o;return k&&b&&S&&_}).sort((j,N)=>{const k=parseInt(j.identifier.split("-")[1]??"0",10),b=parseInt(N.identifier.split("-")[1]??"0",10);return k-b}),y=v.reduce((j,N)=>{var k;return j+(((k=x[N.id])==null?void 0:k.length)??0)},0),w=v.length+y;return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(Fe,{value:o,onValueChange:l,children:[a.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(qe,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(xe,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(j=>a.jsx(xe,{value:j.id,className:"text-xs",children:j.name},j.id))]})]}),a.jsxs(Fe,{value:r,onValueChange:n,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(qe,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:j,name:N})=>a.jsx(xe,{value:j,className:"text-xs",children:N},j))]})]}),a.jsxs(Fe,{value:s,onValueChange:i,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(qe,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(xe,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(wn).map(([j,N])=>a.jsx(xe,{value:j,className:"text-xs",children:N},j))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx($l,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),a.jsx(Ae,{placeholder:"Search...",value:c,onChange:j=>d(j.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[900px]",children:[a.jsxs("div",{className:I("grid items-center py-2.5 border-b border-border",yp),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"})]}),f?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(j=>a.jsxs("div",{className:I("grid items-center px-6 py-3 gap-4",yp),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"})]},j))}):u.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"})}):a.jsx(pu,{delayDuration:200,children:a.jsx(UJ,{issues:v,childrenMap:x,statuses:t,statusLabels:h,statusColorMap:g,sprints:m,totalCount:w})})]})}),!f&&w>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[w," issue",w!==1?"s":""]})})]})})}function Gc(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Ar(new Date(e.due_date),1):Ar(r,1);return{id:e.id,name:`${e.identifier} ${e.title}`,startAt:r,endAt:n,status:{id:e.status,name:e.status,color:t}}}function HJ({token:e,statuses:t}){const[r,n]=p.useState("monthly"),s=p.useRef(null),{data:i=[]}=ov(e),{data:o=[]}=AM(e);p.useEffect(()=>{const m=requestAnimationFrame(()=>{var w;const h=(w=s.current)==null?void 0:w.querySelector(".gantt");if(!h)return;const g=new Date,x=g.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((g.getTime()-new Date(x,0,1).getTime())/864e5)*50;else{const j=r==="monthly"?150:100,N=(g.getFullYear()-x)*12+g.getMonth(),k=new Date(g.getFullYear(),g.getMonth()+1,0).getDate();y=N*j+(g.getDate()-1)/k*j}h.scrollLeft=Math.max(0,y-(h.clientWidth-v)/2)});return()=>cancelAnimationFrame(m)},[r]);const l=Object.fromEntries(t.map(m=>[m.key,m.color])),c=i.filter(m=>m.due_date),d=i.filter(m=>!m.due_date),u={},f=[];for(const m of c)m.sprint_id?(u[m.sprint_id]||(u[m.sprint_id]=[]),u[m.sprint_id].push(m)):f.push(m);return a.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[a.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:a.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>a.jsx("button",{onClick:()=>n(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${r===m?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:m},m))})}),a.jsx("div",{ref:s,className:"flex-1 min-h-0 overflow-hidden",children:a.jsxs(zJ,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(DJ,{children:[o.map(m=>{const h=u[m.id]??[];return a.jsx(Jm,{name:m.name,children:h.map(g=>a.jsx(Zm,{feature:Gc(g,l[g.status]??"#94a3b8")},g.id))},m.id)}),f.length>0&&a.jsx(Jm,{name:"No Sprint",children:f.map(m=>a.jsx(Zm,{feature:Gc(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&a.jsx(Jm,{name:"Unscheduled",children:d.map(m=>a.jsx(Zm,{feature:{id:m.id,name:`${m.identifier} ${m.title}`,startAt:new Date,endAt:new Date,status:{id:m.status,name:m.status,color:l[m.status]??"#94a3b8"}}},m.id))})]}),a.jsxs(LJ,{children:[a.jsx(AJ,{}),a.jsxs($J,{children:[o.map(m=>a.jsx(eh,{children:(u[m.id]??[]).map(h=>a.jsx("div",{className:"flex",children:a.jsx(ej,{...Gc(h,l[h.status]??"#94a3b8")})},h.id))},m.id)),f.length>0&&a.jsx(eh,{children:f.map(m=>a.jsx("div",{className:"flex",children:a.jsx(ej,{...Gc(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&a.jsx(eh,{children:d.map(m=>a.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),o.filter(m=>m.end_date).map(m=>a.jsx(PM,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),a.jsx(FJ,{})]})]})})]})}function KJ(){const{token:e}=Ht(),[t,r]=p.useState("board"),{data:n,isLoading:s,isError:i}=BJ(e??""),{data:o}=ov(e??"");if(!e)return null;if(s)return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading…"})});if(i||!n)return a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[a.jsx("p",{className:"text-lg font-semibold",children:"Link not found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This share link is invalid or has been revoked."})]});const l=[{key:"board",label:"Board"},{key:"issues",label:"Issues"},{key:"timeline",label:"Timeline"}];return a.jsxs("div",{className:"h-screen flex flex-col bg-background overflow-hidden",children:[a.jsx("header",{className:"border-b border-border px-6 py-3 bg-white dark:bg-card shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&a.jsx("span",{className:"text-xl",children:n.icon}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:n.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:n.name})]}),a.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"Read-only view"})]})}),a.jsx("div",{className:"border-b border-border bg-white dark:bg-card px-6 shrink-0",children:a.jsx("div",{className:"flex -mb-px",children:l.map(({key:c,label:d})=>a.jsx("button",{onClick:()=>r(c),className:`px-3 py-2 text-sm border-b-2 transition-colors ${t===c?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:d},c))})}),a.jsxs("div",{className:`flex-1 min-h-0 ${t==="timeline"?"overflow-hidden":"overflow-auto"}`,children:[t==="board"&&a.jsx(vN,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&a.jsx(qJ,{token:e,statuses:n.statuses}),t==="timeline"&&a.jsx(HJ,{token:e,statuses:n.statuses})]})]})}function YJ(){const[e,t]=p.useState(null),r=Ct(),n=Ie();return p.useEffect(()=>{const s=new URLSearchParams(window.location.search);if(history.replaceState(null,"",window.location.pathname),s.get("linked")==="true"){r("/profile?linked=true",{replace:!0});return}const o=s.get("error");if(o){t(decodeURIComponent(o));return}const l=s.get("code");if(!l){t("No authorization code received from Google sign-in");return}(async()=>{const d=await fetch(`${Ai}/auth/google/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:l})});if(!d.ok)throw new Error(`Code exchange failed (${d.status}). Please try signing in again.`);const{token:u}=await d.json(),f=await fetch(`${Ai}/admin/users/me`,{headers:{Authorization:`Bearer ${u}`}});if(!f.ok)throw new Error(`Failed to load user profile (${f.status})`);const m=await f.json();n.login({id:m.id,email:m.email,first_name:m.first_name??"",last_name:m.last_name??""},u),r("/",{replace:!0})})().catch(d=>t(d.message??"Failed to complete sign-in"))},[]),e?a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px] bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-4",children:[a.jsx("p",{className:"text-sm font-medium",children:"Sign-in failed"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e}),a.jsx(Za,{to:"/login",children:a.jsx(J,{variant:"outline",size:"sm",children:"Back to login"})})]})}):a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Completing sign-in..."})})}function GJ(){return Be({queryKey:["me"],queryFn:()=>te.get("/admin/users/me")})}function VJ(){const e=we(),{updateLocalUser:t}=Ie();return ye({mutationFn:r=>te.patch("/admin/users/me",r),onSuccess:({user:r})=>{t({first_name:r.first_name??"",last_name:r.last_name??"",designation:r.designation,phone_number:r.phone_number}),e.invalidateQueries({queryKey:["me"]})}})}function XJ(){const e=we(),{updateLocalUser:t}=Ie();return ye({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),te.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function QJ(){const e=we(),{updateLocalUser:t}=Ie();return ye({mutationFn:()=>te.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function ZJ(){const e=we();return ye({mutationFn:()=>te.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function tj({className:e}){return a.jsxs("svg",{className:e??"size-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[a.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),a.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),a.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z",fill:"#FBBC05"}),a.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function JJ(){var _,C,E,P;const[e,t]=fu(),{user:r}=Ie(),{data:n,isLoading:s}=GJ(),i=VJ(),o=XJ(),l=QJ(),c=ZJ(),d=p.useRef(null),[u,f]=p.useState(""),[m,h]=p.useState(""),[g,x]=p.useState(""),[v,y]=p.useState("");p.useEffect(()=>{n&&(f(n.first_name??""),h(n.last_name??""),x(n.designation??""),y(n.phone_number??""))},[n]),p.useEffect(()=>{e.get("linked")==="true"&&(F.success("Google account connected successfully"),t(O=>(O.delete("linked"),O),{replace:!0}))},[e,t]);const w=r&&(`${((_=r.first_name)==null?void 0:_[0])??""}${((C=r.last_name)==null?void 0:C[0])??""}`.toUpperCase()||((P=(E=r.email)==null?void 0:E[0])==null?void 0:P.toUpperCase()))||"?",j=O=>{var D;const $=(D=O.target.files)==null?void 0:D[0];$&&(o.mutate($,{onSuccess:()=>F.success("Avatar updated"),onError:B=>F.error(B.message??"Failed to upload avatar")}),O.target.value="")},N=()=>{l.mutate(void 0,{onSuccess:()=>F.success("Avatar removed"),onError:O=>F.error(O.message??"Failed to remove avatar")})},k=()=>{i.mutate({first_name:u,last_name:m,designation:g||null,phone_number:v||null},{onSuccess:()=>F.success("Profile updated"),onError:O=>F.error(O.message??"Failed to update profile")})},b=()=>{const O=localStorage.getItem("meridian_token");if(!O){F.error("You must be logged in to connect Google");return}window.location.href=`${Ai}/auth/google/link?token=${encodeURIComponent(O)}`},S=()=>{c.mutate(void 0,{onSuccess:()=>F.success("Google account disconnected"),onError:O=>F.error(O.message??"Failed to unlink Google account")})};return a.jsx("div",{className:"p-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(wu,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Profile"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Manage your personal details and account connections."})]})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground w-44 shrink-0",children:"Profile photo"}),a.jsxs("div",{className:"flex flex-1 items-center gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsxs($t,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?a.jsx(al,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,a.jsx(zt,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:w})]}),o.isPending&&a.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 flex items-center justify-center",children:a.jsx("span",{className:"text-white text-[10px]",children:"…"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(J,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var O;return(O=d.current)==null?void 0:O.click()},disabled:o.isPending,children:[a.jsx(NE,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&a.jsxs(J,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:N,disabled:l.isPending,children:[a.jsx(Dr,{className:"size-3.5"}),"Remove"]})]}),a.jsx("input",{ref:d,type:"file",accept:"image/*",className:"hidden",onChange:j})]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Personal information"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"First name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ae,{value:u,onChange:O=>f(O.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"First name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Last name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ae,{value:m,onChange:O=>h(O.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Last name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),s?a.jsx(le,{className:"h-4 w-48"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.email)??"—"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Designation"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ae,{value:g,onChange:O=>x(O.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"e.g. Software Engineer"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Phone number"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Ae,{value:v,onChange:O=>y(O.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"+1 555 000 0000"})]}),a.jsx("div",{className:"flex justify-end px-6 py-4 border-b border-border",children:a.jsx(J,{size:"sm",onClick:k,disabled:i.isPending,children:i.isPending?"Saving…":"Save changes"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Connections"})}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(tj,{className:"size-3.5 shrink-0"}),"Google"]}),s?a.jsx(le,{className:"h-8 w-48"}):n!=null&&n.google_id?a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[a.jsx(ss,{className:"size-3.5 text-emerald-500 shrink-0"}),a.jsx("span",{className:"text-foreground font-medium",children:"Connected"}),a.jsxs("span",{className:"text-muted-foreground",children:["· ",n.email]})]}),a.jsxs(J,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-destructive ml-auto",onClick:S,disabled:c.isPending,children:[a.jsx(Ep,{className:"size-3.5"}),"Disconnect"]})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"}),a.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:b,children:[a.jsx(tj,{className:"size-3.5"}),"Connect"]})]})]})]})]})})}const eee=p.lazy(()=>Hj(()=>import("./ProjectTimelinePage-5sYFj4UJ.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),tee=p.lazy(()=>Hj(()=>import("./WorkspaceReportingPage-O-m_dFIA.js"),__vite__mapDeps([6,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function yi({children:e}){const{isAuthenticated:t}=Ie();return t?a.jsx(a.Fragment,{children:e}):a.jsx(Ka,{to:"/login",replace:!0})}function ree({children:e}){var r;const{user:t}=Ie();return(r=t==null?void 0:t.roles)!=null&&r.includes("super-admin")?a.jsx(a.Fragment,{children:e}):a.jsx(Ka,{to:"/",replace:!0})}function rj({children:e}){var s,i,o;const{user:t}=Ie(),r=((s=t==null?void 0:t.roles)==null?void 0:s.includes("super-admin"))||((i=t==null?void 0:t.roles)==null?void 0:i.includes("admin")),n=(o=t==null?void 0:t.permissions)==null?void 0:o.includes("workspace:admin");return r||n?a.jsx(a.Fragment,{children:e}):a.jsx(Ka,{to:"/",replace:!0})}function nj({children:e}){const{isAuthenticated:t}=Ie(),{data:r}=ku(),n=uu();return t?a.jsx(Ka,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?a.jsx(Ka,{to:"/register",replace:!0}):r&&!r.needsSetup&&n.pathname==="/register"?a.jsx(Ka,{to:"/login",replace:!0}):a.jsx(a.Fragment,{children:e})}function nee(){const{workspace:e,setWorkspace:t}=Ie(),r=Ct(),{data:n,isLoading:s}=ju(!e);return p.useEffect(()=>{if(e){r(`/${e.slug}/projects`,{replace:!0});return}if(!s&&n!==void 0)if(n.length>0){const i=n[0];t({id:i.id,name:i.name,slug:i.slug}),r(`/${i.slug}/projects`,{replace:!0})}else r("/setup",{replace:!0})},[e,n,s,r,t]),a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})})}function aee(){const{workspace:e}=Ht(),{workspace:t,setWorkspace:r}=Ie();SD();const n=Ct(),{data:s,isLoading:i,isFetching:o}=ju();return p.useEffect(()=>{if(i||!s)return;const l=s.find(c=>c.slug===e);l?l.id!==(t==null?void 0:t.id)&&r({id:l.id,name:l.name,slug:l.slug}):s.length>0?n(`/${s[0].slug}/projects`,{replace:!0}):!t&&!o&&n("/setup",{replace:!0})},[s,e,i,o,t==null?void 0:t.id,n,r]),i||!t||t.slug!==e?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})}):a.jsxs(a.Fragment,{children:[a.jsx(iT,{}),a.jsx(qT,{})]})}function see(){return a.jsxs(BM,{children:[a.jsx(Ye,{path:"/login",element:a.jsx(nj,{children:a.jsx(HT,{})})}),a.jsx(Ye,{path:"/register",element:a.jsx(nj,{children:a.jsx(KT,{})})}),a.jsx(Ye,{path:"/invite/:token",element:a.jsx(Nz,{})}),a.jsx(Ye,{path:"/oauth/google/callback",element:a.jsx(YJ,{})}),a.jsx(Ye,{path:"/share/:token",element:a.jsx(KJ,{})}),a.jsx(Ye,{path:"/reporting",element:a.jsx(yi,{children:a.jsx(rj,{children:a.jsx(fT,{})})}),children:a.jsx(Ye,{index:!0,element:a.jsx(vQ,{})})}),a.jsx(Ye,{path:"/org/settings",element:a.jsx(yi,{children:a.jsx(rj,{children:a.jsx(pT,{})})}),children:a.jsx(Ye,{index:!0,element:a.jsx(DQ,{})})}),a.jsx(Ye,{path:"/profile",element:a.jsx(yi,{children:a.jsx(vT,{})}),children:a.jsx(Ye,{index:!0,element:a.jsx(JJ,{})})}),a.jsx(Ye,{path:"/setup",element:a.jsx(yi,{children:a.jsx(YT,{})})}),a.jsx(Ye,{index:!0,element:a.jsx(yi,{children:a.jsx(nee,{})})}),a.jsxs(Ye,{path:"/:workspace",element:a.jsx(yi,{children:a.jsx(aee,{})}),children:[a.jsx(Ye,{index:!0,element:a.jsx(Ka,{to:"projects",replace:!0})}),a.jsx(Ye,{path:"projects",element:a.jsx(tI,{})}),a.jsxs(Ye,{path:"projects/:projectKey",element:a.jsx(cT,{}),children:[a.jsx(Ye,{path:"board",element:a.jsx(k$,{})}),a.jsx(Ye,{path:"issues",element:a.jsx(S$,{})}),a.jsx(Ye,{path:"issues/new",element:a.jsx(ez,{})}),a.jsx(Ye,{path:"issues/:issueId",element:a.jsx(V$,{})}),a.jsx(Ye,{path:"sprints",element:a.jsx(oz,{})}),a.jsx(Ye,{path:"timeline",element:a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(eee,{})})}),a.jsx(Ye,{path:"access",element:a.jsx(H$,{})}),a.jsx(Ye,{path:"reports",element:a.jsx(yQ,{})}),a.jsx(Ye,{path:"activity",element:a.jsx(NQ,{})})]}),a.jsx(Ye,{path:"notifications",element:a.jsx(nz,{})}),a.jsx(Ye,{path:"reporting",element:a.jsx(p.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(tee,{})})}),a.jsx(Ye,{path:"settings",element:a.jsx(vz,{})}),a.jsx(Ye,{path:"roles",element:a.jsx(ree,{children:a.jsx(wz,{})})})]}),a.jsx(Ye,{path:"*",element:a.jsx(Ka,{to:"/",replace:!0})})]})}window.__React=T;window.__ReactJsxRuntime=RM;const iee=new $M({defaultOptions:{queries:{staleTime:1e3*30,retry:1}}});(async()=>{let e=[];try{const r=await import("/admin-extensions.js");Array.isArray(r==null?void 0:r.default)&&(e=r.default)}catch{}qj(document.getElementById("root")).render(a.jsx(p.StrictMode,{children:a.jsx(hE,{widgets:[...sD,...e],children:a.jsx(DA,{children:a.jsxs(zM,{client:iee,children:[a.jsx(TA,{children:a.jsx(IA,{children:a.jsx(WM,{children:a.jsxs(pu,{delayDuration:300,children:[a.jsx(see,{}),a.jsx(jA,{position:"bottom-right",toastOptions:{classNames:{toast:"bg-white dark:bg-card border border-border text-foreground text-sm rounded-lg shadow-sm",description:"text-muted-foreground"}}})]})})})}),a.jsx(VP,{initialIsOpen:!1})]})})})}))})();export{J as B,Uu as C,zJ as G,ak as I,st as P,vQ as R,yr as W,Al as a,lo as b,co as c,tg as d,rg as e,DJ as f,Jm as g,Zm as h,LJ as i,AJ as j,$J as k,eh as l,ej as m,PM as n,FJ as o,yN as p,Ar as q,fe as r,gN as s,F as t,Ca as u,Et as v,te as w,Ie as x};
|