@meridianjs/admin-dashboard 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{HealthReportDetailPage-DKpFR2W0.js → HealthReportDetailPage-DNOCBj2U.js} +1 -1
- package/dist/assets/{ProjectHealthPage-D4tymjdG.js → ProjectHealthPage-3V_xKn6W.js} +1 -1
- package/dist/assets/{ProjectTimelinePage-DxWw_hGr.js → ProjectTimelinePage-TWQPJXGx.js} +1 -1
- package/dist/assets/WorkspaceReportingPage-EtA8B4LZ.js +1 -0
- package/dist/assets/index-N1f83ywp.css +1 -0
- package/dist/assets/index-WcKp7086.js +642 -0
- package/dist/assets/{parseISO-DfQyPasq.js → parseISO-BdsFsZH4.js} +1 -1
- package/dist/assets/{vendor-editor-AZ54pP77.js → vendor-editor-Cvk1s7Hk.js} +1 -1
- package/dist/assets/vendor-radix-Bt8AkWnj.js +53 -0
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/WorkspaceReportingPage-Bg9_S-oI.js +0 -1
- package/dist/assets/index-C90R1HkN.css +0 -1
- package/dist/assets/index-CNFNuWwT.js +0 -635
- package/dist/assets/vendor-radix-BO9o-Y4t.js +0 -53
|
@@ -1,635 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-DxWw_hGr.js","assets/vendor-query-CaIGp3JB.js","assets/vendor-react-Lycsri1F.js","assets/vendor-radix-BO9o-Y4t.js","assets/vendor-dnd-DuI-3XLF.js","assets/vendor-editor-AZ54pP77.js","assets/ProjectHealthPage-D4tymjdG.js","assets/parseISO-DfQyPasq.js","assets/HealthReportDetailPage-DKpFR2W0.js","assets/WorkspaceReportingPage-Bg9_S-oI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var tE=Object.defineProperty;var rE=(e,t,r)=>t in e?tE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var jm=(e,t,r)=>rE(e,typeof t!="symbol"?t+"":t,r);import{j as s,u as De,a as ye,b as xe,R as nE,Q as sE,c as aE}from"./vendor-query-CaIGp3JB.js";import{a as Vp,c as U,r as h,b as iE,u as It,d as wo,N as tn,e as ft,L as hr,O as Ql,f as Zl,h as Fn,g as Qs,R as oE,i as Lc,j as lE,k as $e,B as cE}from"./vendor-react-Lycsri1F.js";import{C as Gj,R as dE,T as uE,P as fE,S as Xp,a as Vj,O as ki,b as Jl,c as Si,d as qu,e as jo,D as No,f as ec,g as Xj,h as Qj,i as mE,j as Zj,I as Jj,k as e1,l as t1,m as r1,L as n1,n as s1,o as hE,p as pE,q as a1,r as i1,F as o1,u as Vi,t as Ia,s as xE,v as l1,w as gE,x as c1,y as vE,z as yE,A as d1,B as bE,E as u1,G as f1,H as wE,J as m1,V as jE,K as h1,M as p1,N as NE,Q as kE,U as x1,W as SE,X as CE,Y as Qp,Z as _E,_ as g1,$ as ko,a0 as Cs,a1 as v1,a2 as y1,a3 as PE,a4 as b1,a5 as ME,a6 as w1,a7 as OE,a8 as EE,a9 as j1,aa as AE,ab as DE,ac as TE,ad as IE,ae as RE,af as $E,ag as LE,ah as zE,ai as FE,aj as BE,ak as qE,al as N1,am as WE,an as UE,ao as HE,ap as KE,aq as YE,ar as GE}from"./vendor-radix-BO9o-Y4t.js";import{u as k1,a as Zp,P as S1,D as Cl,S as Jp,h as C1,b as yd,c as ex,C as tx,d as VE,v as XE,r as QE,p as ZE,e as JE,f as eA,M as tA,g as _1}from"./vendor-dnd-DuI-3XLF.js";import{P as P1,a as rA,D as nA,b as sA,e as aA,N as iA,c as oA,d as lA,m as zc,E as cA,u as M1,i as O1,f as E1,g as A1,h as D1,j as dA,k as uA,w as fA}from"./vendor-editor-AZ54pP77.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)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(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var T1,ty=Vp;T1=ty.createRoot,ty.hydrateRoot;const mA="modulepreload",hA=function(e){return"/"+e},ry={},Wu=function(t,r,n){let a=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"));a=Promise.allSettled(r.map(c=>{if(c=hA(c),c in ry)return;ry[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":mA,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(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 a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var pA=function(){return null},xA=e=>{switch(e){case"success":return yA;case"info":return wA;case"warning":return bA;case"error":return jA;default:return null}},gA=Array(12).fill(0),vA=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},gA.map((r,n)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),yA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),bA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.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"})),wA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),jA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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=U.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"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kA=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Ph=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,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Ph++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:r}),{...l,...e,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:a}),a},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(),a=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],U.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(_A(c)&&!c.ok){a=!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){a=!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){a=!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;a&&(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)||Ph++;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}},qr=new SA,CA=(e,t)=>{let r=(t==null?void 0:t.id)||Ph++;return qr.addToast({title:e,...t,id:r}),r},_A=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",PA=CA,MA=()=>qr.toasts,OA=()=>qr.getActiveToasts(),B=Object.assign(PA,{success:qr.success,info:qr.info,warning:qr.warning,error:qr.error,custom:qr.custom,message:qr.message,promise:qr.promise,dismiss:qr.dismiss,loading:qr.loading},{getHistory:MA,getToasts:OA});function EA(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))}EA(`: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 Fc(e){return e.label!==void 0}var AA=3,DA="32px",TA="16px",ny=4e3,IA=356,RA=14,$A=20,LA=200;function An(...e){return e.filter(Boolean).join(" ")}function zA(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var FA=e=>{var t,r,n,a,i,o,l,c,d,u,f;let{invert:m,toast:p,unstyled:x,interacting:g,setHeights:v,visibleToasts:y,heights:b,index:N,toasts:w,expanded:k,removeToast:j,defaultRichColors:C,closeButton:P,style:S,cancelButtonStyle:_,actionButtonStyle:M,className:E="",descriptionClassName:A="",duration:D,position:Z,gap:Q,loadingIcon:q,expandByDefault:te,classNames:ne,icons:I,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:L}=e,[H,R]=U.useState(null),[Y,F]=U.useState(null),[T,G]=U.useState(!1),[z,se]=U.useState(!1),[W,X]=U.useState(!1),[ie,V]=U.useState(!1),[J,ue]=U.useState(!1),[de,ee]=U.useState(0),[ge,be]=U.useState(0),qe=U.useRef(p.duration||D||ny),Ge=U.useRef(null),Je=U.useRef(null),rt=N===0,mt=N+1<=y,He=p.type,Ze=p.dismissible!==!1,nr=p.className||"",Lr=p.descriptionClassName||"",sr=U.useMemo(()=>b.findIndex(fe=>fe.toastId===p.id)||0,[b,p.id]),jr=U.useMemo(()=>{var fe;return(fe=p.closeButton)!=null?fe:P},[p.closeButton,P]),ar=U.useMemo(()=>p.duration||D||ny,[p.duration,D]),wt=U.useRef(0),Bt=U.useRef(0),Gt=U.useRef(0),ir=U.useRef(null),[Vn,bs]=Z.split("-"),Oe=U.useMemo(()=>b.reduce((fe,Pe,Ie)=>Ie>=sr?fe:fe+Pe.height,0),[b,sr]),ve=kA(),Ne=p.invert||m,pe=He==="loading";Bt.current=U.useMemo(()=>sr*Q+Oe,[sr,Oe]),U.useEffect(()=>{qe.current=ar},[ar]),U.useEffect(()=>{G(!0)},[]),U.useEffect(()=>{let fe=Je.current;if(fe){let Pe=fe.getBoundingClientRect().height;return be(Pe),v(Ie=>[{toastId:p.id,height:Pe,position:p.position},...Ie]),()=>v(Ie=>Ie.filter(jt=>jt.toastId!==p.id))}},[v,p.id]),U.useLayoutEffect(()=>{if(!T)return;let fe=Je.current,Pe=fe.style.height;fe.style.height="auto";let Ie=fe.getBoundingClientRect().height;fe.style.height=Pe,be(Ie),v(jt=>jt.find(nt=>nt.toastId===p.id)?jt.map(nt=>nt.toastId===p.id?{...nt,height:Ie}:nt):[{toastId:p.id,height:Ie,position:p.position},...jt])},[T,p.title,p.description,v,p.id]);let we=U.useCallback(()=>{se(!0),ee(Bt.current),v(fe=>fe.filter(Pe=>Pe.toastId!==p.id)),setTimeout(()=>{j(p)},LA)},[p,j,v,Bt]);U.useEffect(()=>{if(p.promise&&He==="loading"||p.duration===1/0||p.type==="loading")return;let fe;return k||g||L&&ve?(()=>{if(Gt.current<wt.current){let Pe=new Date().getTime()-wt.current;qe.current=qe.current-Pe}Gt.current=new Date().getTime()})():qe.current!==1/0&&(wt.current=new Date().getTime(),fe=setTimeout(()=>{var Pe;(Pe=p.onAutoClose)==null||Pe.call(p,p),we()},qe.current)),()=>clearTimeout(fe)},[k,g,p,He,L,ve,we]),U.useEffect(()=>{p.delete&&we()},[we,p.delete]);function Xe(){var fe,Pe,Ie;return I!=null&&I.loading?U.createElement("div",{className:An(ne==null?void 0:ne.loader,(fe=p==null?void 0:p.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":He==="loading"},I.loading):q?U.createElement("div",{className:An(ne==null?void 0:ne.loader,(Pe=p==null?void 0:p.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":He==="loading"},q):U.createElement(vA,{className:An(ne==null?void 0:ne.loader,(Ie=p==null?void 0:p.classNames)==null?void 0:Ie.loader),visible:He==="loading"})}return U.createElement("li",{tabIndex:0,ref:Je,className:An(E,nr,ne==null?void 0:ne.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,ne==null?void 0:ne.default,ne==null?void 0:ne[He],(r=p==null?void 0:p.classNames)==null?void 0:r[He]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:C,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":T,"data-promise":!!p.promise,"data-swiped":J,"data-removed":z,"data-visible":mt,"data-y-position":Vn,"data-x-position":bs,"data-index":N,"data-front":rt,"data-swiping":W,"data-dismissible":Ze,"data-type":He,"data-invert":Ne,"data-swipe-out":ie,"data-swipe-direction":Y,"data-expanded":!!(k||te&&T),style:{"--index":N,"--toasts-before":N,"--z-index":w.length-N,"--offset":`${z?de:Bt.current}px`,"--initial-height":te?"auto":`${ge}px`,...S,...p.style},onDragEnd:()=>{X(!1),R(null),ir.current=null},onPointerDown:fe=>{pe||!Ze||(Ge.current=new Date,ee(Bt.current),fe.target.setPointerCapture(fe.pointerId),fe.target.tagName!=="BUTTON"&&(X(!0),ir.current={x:fe.clientX,y:fe.clientY}))},onPointerUp:()=>{var fe,Pe,Ie,jt;if(ie||!Ze)return;ir.current=null;let nt=Number(((fe=Je.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),st=Number(((Pe=Je.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nr=new Date().getTime()-((Ie=Ge.current)==null?void 0:Ie.getTime()),or=H==="x"?nt:st,Xn=Math.abs(or)/Nr;if(Math.abs(or)>=$A||Xn>.11){ee(Bt.current),(jt=p.onDismiss)==null||jt.call(p,p),F(H==="x"?nt>0?"right":"left":st>0?"down":"up"),we(),V(!0),ue(!1);return}X(!1),R(null)},onPointerMove:fe=>{var Pe,Ie,jt,nt;if(!ir.current||!Ze||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;let st=fe.clientY-ir.current.y,Nr=fe.clientX-ir.current.x,or=(Ie=e.swipeDirections)!=null?Ie:zA(Z);!H&&(Math.abs(Nr)>1||Math.abs(st)>1)&&R(Math.abs(Nr)>Math.abs(st)?"x":"y");let Xn={x:0,y:0};H==="y"?(or.includes("top")||or.includes("bottom"))&&(or.includes("top")&&st<0||or.includes("bottom")&&st>0)&&(Xn.y=st):H==="x"&&(or.includes("left")||or.includes("right"))&&(or.includes("left")&&Nr<0||or.includes("right")&&Nr>0)&&(Xn.x=Nr),(Math.abs(Xn.x)>0||Math.abs(Xn.y)>0)&&ue(!0),(jt=Je.current)==null||jt.style.setProperty("--swipe-amount-x",`${Xn.x}px`),(nt=Je.current)==null||nt.style.setProperty("--swipe-amount-y",`${Xn.y}px`)}},jr&&!p.jsx?U.createElement("button",{"aria-label":O,"data-disabled":pe,"data-close-button":!0,onClick:pe||!Ze?()=>{}:()=>{var fe;we(),(fe=p.onDismiss)==null||fe.call(p,p)},className:An(ne==null?void 0:ne.closeButton,(a=p==null?void 0:p.classNames)==null?void 0:a.closeButton)},(i=I==null?void 0:I.close)!=null?i:NA):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:U.createElement(U.Fragment,null,He||p.icon||p.promise?U.createElement("div",{"data-icon":"",className:An(ne==null?void 0:ne.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Xe():null,p.type!=="loading"?p.icon||(I==null?void 0:I[He])||xA(He):null):null,U.createElement("div",{"data-content":"",className:An(ne==null?void 0:ne.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:An(ne==null?void 0:ne.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?U.createElement("div",{"data-description":"",className:An(A,Lr,ne==null?void 0:ne.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&Fc(p.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||_,onClick:fe=>{var Pe,Ie;Fc(p.cancel)&&Ze&&((Ie=(Pe=p.cancel).onClick)==null||Ie.call(Pe,fe),we())},className:An(ne==null?void 0:ne.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&Fc(p.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:fe=>{var Pe,Ie;Fc(p.action)&&((Ie=(Pe=p.action).onClick)==null||Ie.call(Pe,fe),!fe.defaultPrevented&&we())},className:An(ne==null?void 0:ne.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function sy(){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 BA(e,t){let r={};return[e,t].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?TA:DA;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 qA=h.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:p,visibleToasts:x=AA,toastOptions:g,dir:v=sy(),gap:y=RA,loadingIcon:b,icons:N,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:k}=e,[j,C]=U.useState([]),P=U.useMemo(()=>Array.from(new Set([n].concat(j.filter(L=>L.position).map(L=>L.position)))),[j,n]),[S,_]=U.useState([]),[M,E]=U.useState(!1),[A,D]=U.useState(!1),[Z,Q]=U.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=U.useRef(null),te=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),ne=U.useRef(null),I=U.useRef(!1),O=U.useCallback(L=>{C(H=>{var R;return(R=H.find(Y=>Y.id===L.id))!=null&&R.delete||qr.dismiss(L.id),H.filter(({id:Y})=>Y!==L.id)})},[]);return U.useEffect(()=>qr.subscribe(L=>{if(L.dismiss){C(H=>H.map(R=>R.id===L.id?{...R,delete:!0}:R));return}setTimeout(()=>{iE.flushSync(()=>{C(H=>{let R=H.findIndex(Y=>Y.id===L.id);return R!==-1?[...H.slice(0,R),{...H[R],...L},...H.slice(R+1)]:[L,...H]})})})}),[]),U.useEffect(()=>{if(u!=="system"){Q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:H})=>{Q(H?"dark":"light")})}catch{L.addListener(({matches:R})=>{try{Q(R?"dark":"light")}catch(Y){console.error(Y)}})}},[u]),U.useEffect(()=>{j.length<=1&&E(!1)},[j]),U.useEffect(()=>{let L=H=>{var R,Y;a.every(F=>H[F]||H.code===F)&&(E(!0),(R=q.current)==null||R.focus()),H.code==="Escape"&&(document.activeElement===q.current||(Y=q.current)!=null&&Y.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[a]),U.useEffect(()=>{if(q.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,I.current=!1)}},[q.current]),U.createElement("section",{ref:t,"aria-label":`${w} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((L,H)=>{var R;let[Y,F]=L.split("-");return j.length?U.createElement("ol",{key:L,dir:v==="auto"?sy():v,tabIndex:-1,ref:q,className:l,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Y,"data-lifted":M&&j.length>1&&!i,"data-x-position":F,style:{"--front-toast-height":`${((R=S[0])==null?void 0:R.height)||0}px`,"--width":`${IA}px`,"--gap":`${y}px`,...p,...BA(c,d)},onBlur:T=>{I.current&&!T.currentTarget.contains(T.relatedTarget)&&(I.current=!1,ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null))},onFocus:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||I.current||(I.current=!0,ne.current=T.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{A||E(!1)},onDragEnd:()=>E(!1),onPointerDown:T=>{T.target instanceof HTMLElement&&T.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},j.filter(T=>!T.position&&H===0||T.position===L).map((T,G)=>{var z,se;return U.createElement(FA,{key:T.id,icons:N,index:G,toast:T,defaultRichColors:f,duration:(z=g==null?void 0:g.duration)!=null?z:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:x,closeButton:(se=g==null?void 0:g.closeButton)!=null?se:o,interacting:A,position:L,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:O,toasts:j.filter(W=>W.position==T.position),heights:S.filter(W=>W.position==T.position),setHeights:_,expandByDefault:i,gap:y,loadingIcon:b,expanded:M,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),WA=(e,t,r,n,a,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&i?a.map(y=>i[y]||y):a;g?(c.classList.remove(...v),c.classList.add(i&&i[p]?i[p]:p)):c.setAttribute(x,p)}),f(p)}function f(p){l&&d.includes(p)&&(c.style.colorScheme=p)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)u(n);else try{let p=localStorage.getItem(t)||r,x=o&&p==="system"?m():p;u(x)}catch{}},ay=["light","dark"],I1="(prefers-color-scheme: dark)",UA=typeof window>"u",rx=h.createContext(void 0),HA={setTheme:e=>{},themes:[]},KA=()=>{var e;return(e=h.useContext(rx))!=null?e:HA},YA=e=>h.useContext(rx)?h.createElement(h.Fragment,null,e.children):h.createElement(VA,{...e}),GA=["light","dark"],VA=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:a="theme",themes:i=GA,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,p]=h.useState(()=>QA(a,o)),[x,g]=h.useState(()=>m==="system"?Nm():m),v=c?Object.values(c):i,y=h.useCallback(k=>{let j=k;if(!j)return;k==="system"&&r&&(j=Nm());let C=c?c[j]:j,P=t?ZA(u):null,S=document.documentElement,_=M=>{M==="class"?(S.classList.remove(...v),C&&S.classList.add(C)):M.startsWith("data-")&&(C?S.setAttribute(M,C):S.removeAttribute(M))};if(Array.isArray(l)?l.forEach(_):_(l),n){let M=ay.includes(o)?o:null,E=ay.includes(j)?j:M;S.style.colorScheme=E}P==null||P()},[u]),b=h.useCallback(k=>{let j=typeof k=="function"?k(m):k;p(j);try{localStorage.setItem(a,j)}catch{}},[m]),N=h.useCallback(k=>{let j=Nm(k);g(j),m==="system"&&r&&!e&&y("system")},[m,e]);h.useEffect(()=>{let k=window.matchMedia(I1);return k.addListener(N),N(k),()=>k.removeListener(N)},[N]),h.useEffect(()=>{let k=j=>{j.key===a&&(j.newValue?p(j.newValue):b(o))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[b]),h.useEffect(()=>{y(e??m)},[e,m]);let w=h.useMemo(()=>({theme:m,setTheme:b,forcedTheme:e,resolvedTheme:m==="system"?x:m,themes:r?[...i,"system"]:i,systemTheme:r?x:void 0}),[m,b,e,x,r,i]);return h.createElement(rx.Provider,{value:w},h.createElement(XA,{forcedTheme:e,storageKey:a,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},XA=h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([r,t,i,e,l,o,n,a]).slice(1,-1);return h.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${WA.toString()})(${u})`}})}),QA=(e,t)=>{if(UA)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},ZA=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)}},Nm=e=>(e||(e=window.matchMedia(I1)),e.matches?"dark":"light");function JA({children:e}){return s.jsx(YA,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const R1=h.createContext(null),qa="meridian_token",Xo="meridian_user",Bc="meridian_workspace";function iy(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 e5({children:e}){const[t,r]=h.useState(()=>{try{const f=localStorage.getItem(Xo),m=localStorage.getItem(qa);if(!f)return null;const p=JSON.parse(f),{roles:x,permissions:g}=m?iy(m):{roles:[],permissions:[]};return p.roles=x,p.permissions=g,p}catch{return null}}),[n,a]=h.useState(()=>{const f=localStorage.getItem(qa),m=localStorage.getItem(Xo);return f&&!m?(localStorage.removeItem(qa),null):f}),[i,o]=h.useState(()=>{try{const f=localStorage.getItem(Bc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const{roles:p,permissions:x}=iy(m),g={...f,roles:p,permissions:x};r(g),a(m),localStorage.setItem(qa,m),localStorage.setItem(Xo,JSON.stringify(g))},c=()=>{const f=localStorage.getItem(qa);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),a(null),o(null),localStorage.removeItem(qa),localStorage.removeItem(Xo),localStorage.removeItem(Bc)};h.useEffect(()=>{const f=()=>{localStorage.getItem(qa)&&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 p={...m,...f};return localStorage.setItem(Xo,JSON.stringify(p)),p})};return s.jsx(R1.Provider,{value:{user:t,token:n,workspace:i,isAuthenticated:!!n&&!!t,login:l,logout:c,setWorkspace:d,updateLocalUser:u},children:e})}function Te(){const e=h.useContext(R1);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const $1=h.createContext(null);function t5({children:e}){const[t,r]=h.useState(!1);return h.useEffect(()=>{const n=a=>{(a.metaKey||a.ctrlKey)&&a.key==="k"&&(a.preventDefault(),r(i=>!i))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),s.jsx($1.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function nx(){const e=h.useContext($1);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function L1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=L1(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function lt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=L1(e))&&(n&&(n+=" "),n+=t);return n}const sx="-",r5=e=>{const t=s5(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(sx);return l[0]===""&&l.length!==1&&l.shift(),z1(l,t)||n5(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},z1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?z1(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(sx);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},oy=/^\[(.+)\]$/,n5=e=>{if(oy.test(e)){const t=oy.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},s5=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return i5(Object.entries(e.classGroups),r).forEach(([i,o])=>{Mh(o,n,i,t)}),n},Mh=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ly(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(a5(a)){Mh(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{Mh(o,ly(t,i),r,n)})})},ly=(e,t)=>{let r=e;return t.split(sx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},a5=e=>e.isThemeGetter,i5=(e,t)=>t?e.map(([r,n])=>{const a=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,a]}):e,o5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(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 a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},F1="!",l5=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=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===a&&(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),p=m.startsWith(F1),x=p?m.substring(1):m,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},c5=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},d5=e=>({cache:o5(e.cacheSize),parseClassName:l5(e),...r5(e)}),u5=/\s+/,f5=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(u5);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(d);let x=!!p,g=n(x?m.substring(0,p):m);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const v=c5(u).join(":"),y=f?v+F1:v,b=y+g;if(i.includes(b))continue;i.push(b);const N=a(g,x);for(let w=0;w<N.length;++w){const k=N[w];i.push(y+k)}l=d+(l.length>0?" "+l:l)}return l};function m5(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=B1(t))&&(n&&(n+=" "),n+=r);return n}const B1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=B1(e[n]))&&(r&&(r+=" "),r+=t);return r};function h5(e,...t){let r,n,a,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=d5(d),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=f5(c,r);return a(c,u),u}return function(){return i(m5.apply(null,arguments))}}const ht=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},q1=/^\[(?:([a-z-]+):)?(.+)\]$/i,p5=/^\d+\/\d+$/,x5=new Set(["px","full","screen"]),g5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v5=/\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$/,y5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,b5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ns=e=>Xi(e)||x5.has(e)||p5.test(e),ua=e=>So(e,"length",M5),Xi=e=>!!e&&!Number.isNaN(Number(e)),km=e=>So(e,"number",Xi),Qo=e=>!!e&&Number.isInteger(Number(e)),j5=e=>e.endsWith("%")&&Xi(e.slice(0,-1)),Re=e=>q1.test(e),fa=e=>g5.test(e),N5=new Set(["length","size","percentage"]),k5=e=>So(e,N5,W1),S5=e=>So(e,"position",W1),C5=new Set(["image","url"]),_5=e=>So(e,C5,E5),P5=e=>So(e,"",O5),Zo=()=>!0,So=(e,t,r)=>{const n=q1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},M5=e=>v5.test(e)&&!y5.test(e),W1=()=>!1,O5=e=>b5.test(e),E5=e=>w5.test(e),A5=()=>{const e=ht("colors"),t=ht("spacing"),r=ht("blur"),n=ht("brightness"),a=ht("borderColor"),i=ht("borderRadius"),o=ht("borderSpacing"),l=ht("borderWidth"),c=ht("contrast"),d=ht("grayscale"),u=ht("hueRotate"),f=ht("invert"),m=ht("gap"),p=ht("gradientColorStops"),x=ht("gradientColorStopPositions"),g=ht("inset"),v=ht("margin"),y=ht("opacity"),b=ht("padding"),N=ht("saturate"),w=ht("scale"),k=ht("sepia"),j=ht("skew"),C=ht("space"),P=ht("translate"),S=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Re,t],E=()=>[Re,t],A=()=>["",Ns,ua],D=()=>["auto",Xi,Re],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",Re],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[Xi,Re];return{cacheSize:500,separator:":",theme:{colors:[Zo],spacing:[Ns,ua],blur:["none","",fa,Re],brightness:O(),borderColor:[e],borderRadius:["none","","full",fa,Re],borderSpacing:E(),borderWidth:A(),contrast:O(),grayscale:ne(),hueRotate:O(),invert:ne(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[j5,ua],inset:M(),margin:M(),opacity:O(),padding:E(),saturate:O(),scale:O(),sepia:ne(),skew:O(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[fa]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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:[...Z(),Re]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qo,Re]}],basis:[{basis:M()}],"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:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",Qo,Re]}],"grid-cols":[{"grid-cols":[Zo]}],"col-start-end":[{col:["auto",{span:["full",Qo,Re]},Re]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Zo]}],"row-start-end":[{row:["auto",{span:[Qo,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",...te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"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,ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",km]}],"font-family":[{font:[Zo]}],"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",Xi,km]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ns,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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ns,ua]}],"underline-offset":[{"underline-offset":["auto",Ns,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:E()}],"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:[...Z(),S5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_5]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[...Q(),"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:Q()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[Ns,Re]}],"outline-w":[{outline:[Ns,ua]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ns,ua]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fa,P5]}],"shadow-color":[{shadow:[Zo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],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:[N]}],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":[N]}],"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:O()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Qo,Re]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"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":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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:[Ns,ua,km]}],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"]}}},D5=h5(A5);function $(...e){return D5(lt(e))}const Uu=fE,os=dE,ls=uE,Bn=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(Gj,{ref:n,sideOffset:t,className:$("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}));Bn.displayName=Gj.displayName;const U1=h.createContext([]);function T5({widgets:e,children:t}){return U.createElement(U1.Provider,{value:e},t)}function I5(e){return h.useContext(U1).filter(r=>r.zone===e).map(r=>r.component)}var Kj;const to=((Kj=window.__MERIDIAN_CONFIG__)==null?void 0:Kj.apiUrl)??void 0??"";class ax extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function H1(){return localStorage.getItem("meridian_token")}async function Jo(e,t={}){var i;const r=H1(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const a=await fetch(`${to}${e}`,{...t,headers:n});if(!a.ok){let o;try{o=await a.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${a.status}`;throw a.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new ax(a.status,l,o)}if(a.status!==204)return a.json()}const oe={get:e=>Jo(e,{method:"GET"}),post:(e,t)=>Jo(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Jo(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Jo(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Jo(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=H1(),n={};r&&(n.Authorization=`Bearer ${r}`);const a=await fetch(`${to}${e}`,{method:"POST",headers:n,body:t});if(!a.ok){let o;try{o=await a.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${a.status}`;throw a.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new ax(a.status,l,o)}if(a.status!==204)return a.json()}},xt={all:["issues"],byProject:(e,t)=>[...xt.all,"project",e,...t?[t]:[]],paginated:e=>[...xt.all,"paginated",e],related:e=>[...xt.all,e,"related"],relations:e=>[...xt.all,e,"relations"],detail:e=>[...xt.all,e],comments:e=>[...xt.all,e,"comments"],activities:e=>[...xt.all,e,"activities"]};function Hu(e,t){return De({queryKey:e?xt.byProject(e,t):xt.all,queryFn:async()=>{var u,f,m;const r=new URLSearchParams;e&&(r.set("project_id",e),r.set("limit","1000")),(u=t==null?void 0:t.priority)!=null&&u.length&&r.set("priority",t.priority.join(",")),t!=null&&t.assignee_id&&r.set("assignee_id",t.assignee_id),(f=t==null?void 0:t.type)!=null&&f.length&&r.set("type",t.type.join(",")),(m=t==null?void 0:t.status)!=null&&m.length&&r.set("status",t.status.join(","));const n=await oe.get(`/admin/issues?${r}`);if(n.count<=n.issues.length)return n;const a=n.issues.length,i=n.count-a,o=Math.ceil(i/a),l=Array.from({length:o},(p,x)=>{const g=new URLSearchParams(r);return g.set("offset",String(a*(x+1))),oe.get(`/admin/issues?${g}`)}),c=await Promise.all(l);return{issues:n.issues.concat(...c.map(p=>p.issues)),count:n.count}},select:r=>r.issues,enabled:!!e})}function K1(e){return De({queryKey:xt.detail(e),queryFn:()=>oe.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function Y1(e){return De({queryKey:xt.related(e),queryFn:()=>oe.get(`/admin/issues/${e}/related`),enabled:!!e})}function R5(e){return De({queryKey:xt.comments(e),queryFn:()=>oe.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function G1(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:xt.byProject(r.project_id)}),e.invalidateQueries({queryKey:["issues","paginated"]})}})}function Ku(e,t){const r=ye();return xe({mutationFn:n=>oe.put(`/admin/issues/${e}`,n),onMutate:async n=>{await r.cancelQueries({queryKey:xt.byProject(t)});const a=r.getQueryData(xt.byProject(t));return r.setQueryData(xt.byProject(t),i=>i&&{...i,issues:i.issues.map(o=>o.id===e?{...o,...n}:o)}),{previous:a}},onError:(n,a,i)=>{i!=null&&i.previous&&r.setQueryData(xt.byProject(t),i.previous)},onSettled:()=>{r.invalidateQueries({queryKey:xt.byProject(t)}),r.invalidateQueries({queryKey:xt.detail(e)}),r.invalidateQueries({queryKey:["issues","paginated"]}),r.invalidateQueries({queryKey:xt.related(e)})}})}function $5(e){return De({queryKey:xt.activities(e),queryFn:()=>oe.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function L5(e){const t=ye();return xe({mutationFn:({body:r,metadata:n})=>oe.post(`/admin/issues/${e}/comments`,{body:r,metadata:n}),onSuccess:()=>{t.invalidateQueries({queryKey:xt.comments(e)})}})}const cy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dy=lt,tc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return dy(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(d=>{const u=r==null?void 0:r[d],f=i==null?void 0:i[d];if(u===null)return null;const m=cy(u)||cy(f);return a[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,...p}=u;return Object.entries(p).every(x=>{let[g,v]=x;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...d,f,m]:d},[]);return dy(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},Qi=tc("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"}}),re=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?Xp:"button";return s.jsx(o,{className:$(Qi({variant:t,size:r,className:e})),ref:i,...a})});re.displayName="Button";const _e=h.forwardRef(({className:e,type:t,...r},n)=>s.jsx("input",{type:t,className:$("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}));_e.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 z5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V1=(...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 F5={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 B5=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...F5,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:V1("lucide",a),...l},[...o.map(([d,u])=>h.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 ce=(e,t)=>{const r=h.forwardRef(({className:n,...a},i)=>h.createElement(B5,{ref:i,iconNode:t,className:V1(`lucide-${z5(e)}`,n),...a}));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 Ml=ce("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 Ci=ce("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 Co=ce("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 Md=ce("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
|
|
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 ix=ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
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 _i=ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 fi=ce("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"}]]);/**
|
|
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 X1=ce("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"}]]);/**
|
|
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 Q1=ce("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"}]]);/**
|
|
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 Od=ce("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"}]]);/**
|
|
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 Z1=ce("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"}]]);/**
|
|
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 mi=ce("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"}]]);/**
|
|
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 Ut=ce("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"}]]);/**
|
|
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 q5=ce("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"}]]);/**
|
|
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 Ls=ce("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"}]]);/**
|
|
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 uy=ce("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
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 At=ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 Zs=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 us=ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 pr=ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 ox=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 _o=ce("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
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 kn=ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 J1=ce("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"}]]);/**
|
|
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 lx=ce("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"}]]);/**
|
|
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 Er=ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 W5=ce("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"}]]);/**
|
|
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 dn=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 eN=ce("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"}]]);/**
|
|
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 tN=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
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 cx=ce("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"}]]);/**
|
|
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 U5=ce("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"}]]);/**
|
|
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 dx=ce("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"}]]);/**
|
|
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 zs=ce("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"}]]);/**
|
|
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 ux=ce("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"}]]);/**
|
|
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 rc=ce("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"}]]);/**
|
|
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 Pi=ce("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"}]]);/**
|
|
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 H5=ce("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"}]]);/**
|
|
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 K5=ce("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"}]]);/**
|
|
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 Y5=ce("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"}]]);/**
|
|
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 G5=ce("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"}]]);/**
|
|
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 V5=ce("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"}]]);/**
|
|
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 fx=ce("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"}]]);/**
|
|
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 cs=ce("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"}]]);/**
|
|
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 Oh=ce("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"}]]);/**
|
|
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 rN=ce("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"}]]);/**
|
|
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 X5=ce("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"}]]);/**
|
|
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 Q5=ce("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"}]]);/**
|
|
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 Z5=ce("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"}]]);/**
|
|
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 nN=ce("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"}]]);/**
|
|
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 J5=ce("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
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 Yr=ce("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"}]]);/**
|
|
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 Ed=ce("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"}]]);/**
|
|
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 sN=ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
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 eD=ce("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"}]]);/**
|
|
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 Oa=ce("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"}]]);/**
|
|
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 tD=ce("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"}]]);/**
|
|
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 aN=ce("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"}]]);/**
|
|
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 Ds=ce("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"}]]);/**
|
|
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 mx=ce("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"}]]);/**
|
|
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 fs=ce("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"}]]);/**
|
|
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 Yu=ce("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"}]]);/**
|
|
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 rD=ce("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"}]]);/**
|
|
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 iN=ce("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"}]]);/**
|
|
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 Js=ce("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
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 nD=ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 sD=ce("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 hx=ce("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"}]]);/**
|
|
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 Fs=ce("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"}]]);/**
|
|
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 Ol=ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 ot=ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 aD=ce("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"}]]);/**
|
|
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 iD=ce("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"}]]);/**
|
|
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 ro=ce("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"}]]);/**
|
|
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 Ad=ce("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
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 Ra=ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 oD=ce("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"}]]);/**
|
|
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 Dd=ce("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"}]]);/**
|
|
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 px=ce("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"}]]);/**
|
|
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 lD=ce("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"}]]);/**
|
|
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 cD=ce("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"}]]);/**
|
|
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 Eh=ce("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"}]]);/**
|
|
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 oN=ce("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"}]]);/**
|
|
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 Gu=ce("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"}]]);/**
|
|
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 lN=ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 cN=ce("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"}]]);/**
|
|
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 dD=ce("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"}]]);/**
|
|
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 uD=ce("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"}]]);/**
|
|
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 fy=ce("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"}]]);/**
|
|
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 fD=ce("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"}]]);/**
|
|
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 dN=ce("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"}]]);/**
|
|
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 wr=ce("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"}]]);/**
|
|
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 mD=ce("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"}]]);/**
|
|
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 uN=ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
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 hD=ce("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
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 pD=ce("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"}]]);/**
|
|
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 xD=ce("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"}]]);/**
|
|
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 gD=ce("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
|
|
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 fN=ce("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"}]]);/**
|
|
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 ln=ce("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"}]]);/**
|
|
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 vD=ce("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
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 Ah=ce("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"}]]);/**
|
|
534
|
-
* @license lucide-react v0.468.0 - ISC
|
|
535
|
-
*
|
|
536
|
-
* This source code is licensed under the ISC license.
|
|
537
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
-
*/const nc=ce("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"}]]);/**
|
|
539
|
-
* @license lucide-react v0.468.0 - ISC
|
|
540
|
-
*
|
|
541
|
-
* This source code is licensed under the ISC license.
|
|
542
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
-
*/const Ea=ce("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"}]]);/**
|
|
544
|
-
* @license lucide-react v0.468.0 - ISC
|
|
545
|
-
*
|
|
546
|
-
* This source code is licensed under the ISC license.
|
|
547
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
548
|
-
*/const Ps=ce("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"}]]);/**
|
|
549
|
-
* @license lucide-react v0.468.0 - ISC
|
|
550
|
-
*
|
|
551
|
-
* This source code is licensed under the ISC license.
|
|
552
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
-
*/const We=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
554
|
-
* @license lucide-react v0.468.0 - ISC
|
|
555
|
-
*
|
|
556
|
-
* This source code is licensed under the ISC license.
|
|
557
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
558
|
-
*/const gs=ce("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 yD({issue:e}){const t=Ku(e.id,e.project_id),[r,n]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(!1),c=e.metadata??{},d=Object.entries(c),u=()=>{if(!r.trim())return;const m={...c,[r.trim()]:a};t.mutate({metadata:m},{onSuccess:()=>{B.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>B.error("Failed to save metadata")})},f=m=>{const p={...c};delete p[m],t.mutate({metadata:Object.keys(p).length?p:null},{onSuccess:()=>B.success("Entry removed"),onError:()=>B.error("Failed to update metadata")})};return s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[s.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(U5,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Metadata"})]}),!o&&s.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Add field"]})]}),s.jsxs("div",{className:"px-5 py-3 space-y-2",children:[d.length===0&&!o&&s.jsx("p",{className:"text-xs text-muted-foreground/50 italic",children:"No metadata fields yet"}),d.map(([m,p])=>s.jsxs("div",{className:"flex items-center gap-2 group",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground w-28 shrink-0 truncate",children:m}),s.jsx("span",{className:"text-xs text-foreground flex-1 truncate",children:String(p)}),s.jsx("button",{onClick:()=>f(m),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:s.jsx(wr,{className:"h-3 w-3"})})]},m)),o&&s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsx(_e,{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"}),s.jsx(_e,{placeholder:"value",value:a,onChange:m=>i(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs flex-1"}),s.jsx(re,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const bD=[{zone:"issue.details.after",component:yD}];function Wn(e=!0){const t=typeof e=="boolean"?e:!0,r=typeof e=="object"?e.orgScope??!1:!1,n=typeof e=="object"?e.refetchInterval??!1:!1,a=r?"?org_scope=true":"";return De({queryKey:["workspaces",r?"org":"default"],queryFn:()=>oe.get(`/admin/workspaces${a}`),select:i=>i.workspaces,enabled:t,refetchInterval:n,staleTime:1e3*60*2})}function wD(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function jD(e){const t=ye();return xe({mutationFn:r=>oe.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function ND(e){const t=ye();return xe({mutationFn:r=>{const n=new FormData;return n.append("logo",r),oe.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function kD(e){const t=ye();return xe({mutationFn:()=>oe.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const xx={list:e=>["workspaces",e,"invitations"]};function SD(e){return De({queryKey:xx.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e,staleTime:1e3*60*2})}function CD(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:xx.list(e)})}})}function _D(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:xx.list(e)})}})}function PD(e){return xe({mutationFn:t=>oe.post(`/admin/workspaces/${e}/invitations/${t}/resend`)})}const gx={list:e=>["workspaces",e,"members"]};function Po(e){return De({queryKey:gx.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e,staleTime:1e3*60*2})}function MD(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/workspaces/${e}/members/batch`,r),onSuccess:()=>{t.invalidateQueries({queryKey:gx.list(e)}),t.invalidateQueries({queryKey:["workspaces"]})}})}function OD(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:gx.list(e)}),t.invalidateQueries({queryKey:["workspaces"]})}})}const Aa={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function Vu(e){return De({queryKey:Aa.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e,staleTime:1e3*60*2})}function ED(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Aa.list(e)})}})}function AD(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Aa.list(e)})}})}function DD(e,t){return De({queryKey:Aa.members(e,t),queryFn:()=>oe.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function TD(e,t){const r=ye();return xe({mutationFn:n=>oe.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:Aa.members(e,t)}),r.invalidateQueries({queryKey:Aa.list(e)})}})}function ID(e,t){const r=ye();return xe({mutationFn:n=>oe.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:Aa.members(e,t)}),r.invalidateQueries({queryKey:Aa.list(e)})}})}function vx(e,t){const r=(t==null?void 0:t.enabled)??!0;return De({queryKey:["workspaces","search",e],queryFn:()=>oe.get(`/admin/workspaces/search?q=${encodeURIComponent(e)}`),select:n=>n.workspaces,enabled:r,staleTime:1e4})}const yx={list:e=>["workspaces",e,"access-requests"]};function bx(e){return De({queryKey:yx.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/access-requests`),select:t=>t.access_requests,enabled:!!e,staleTime:1e3*60*2})}function wx(){const e=ye();return xe({mutationFn:({workspaceId:t,message:r})=>oe.post(`/admin/workspaces/${t}/access-requests`,{message:r??null}),onSuccess:(t,{workspaceId:r})=>{e.invalidateQueries({queryKey:yx.list(r)})}})}function RD(e){const t=ye();return xe({mutationFn:({requestId:r,action:n})=>oe.patch(`/admin/workspaces/${e}/access-requests/${r}`,{action:n}),onSuccess:()=>{t.invalidateQueries({queryKey:yx.list(e)}),t.invalidateQueries({queryKey:["workspaces"]})}})}function $D(){return De({queryKey:["workspaces","my-access-requests"],queryFn:()=>oe.get("/admin/workspaces/my-access-requests"),select:e=>e.requests})}function LD(){const e=ye();return xe({mutationFn:({workspaceId:t,requestId:r})=>oe.delete(`/admin/workspaces/${t}/access-requests/${r}`),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces","my-access-requests"]}),e.invalidateQueries({queryKey:["workspaces","search"]})}})}function Xu(){return De({queryKey:["setup-status"],queryFn:()=>oe.get("/auth/setup"),staleTime:6e4,retry:!1})}function zD(){return xe({mutationFn:e=>oe.post("/auth/register/send-otp",e)})}function FD(){const{login:e}=Te();return xe({mutationFn:t=>oe.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function BD(){const{login:e}=Te();return xe({mutationFn:t=>oe.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function qD(){return xe({mutationFn:e=>oe.post("/auth/forgot-password",e)})}function WD(){return xe({mutationFn:e=>oe.post("/auth/reset-password",e)})}function UD(e){const{login:t}=Te();return xe({mutationFn:r=>oe.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var Yj;const mN=((Yj=window.__MERIDIAN_CONFIG__)==null?void 0:Yj.apiUrl)??void 0??"";function HD(e,t){const r=`${mN}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function hN(e){const t=`${mN}/admin/events?token=${encodeURIComponent(e)}&mode=user`;return new EventSource(t)}function KD(){const{token:e,workspace:t}=Te(),r=ye(),n=h.useRef(null);h.useEffect(()=>{if(!e||!t)return;const a=HD(e,t.id);n.current=a;const i=o=>{o.forEach(l=>r.invalidateQueries({queryKey:l}))};return a.addEventListener("issue.created",()=>{i([["issues"],["notifications"]])}),a.addEventListener("issue.status_changed",()=>{i([["issues"]])}),a.addEventListener("issue.assigned",()=>{i([["issues"],["notifications"]])}),a.addEventListener("comment.created",()=>{i([["issues"],["notifications"]])}),a.addEventListener("project.member_added",()=>{i([["notifications"]])}),a.addEventListener("timer.started",()=>{i([["time-logs"]])}),a.addEventListener("timer.stopped",()=>{i([["time-logs"]])}),a.addEventListener("notification.created",()=>{i([["notifications"]])}),a.addEventListener("workspace.access_requested",()=>{i([["workspaces",t==null?void 0:t.id,"access-requests"],["notifications"]])}),a.addEventListener("workspace.access_request_resolved",()=>{i([["workspaces",t==null?void 0:t.id,"access-requests"],["workspaces"],["notifications"]])}),a.addEventListener("project.access_requested",o=>{const l=JSON.parse(o.data??"{}");i([["projects"],["projects",l.project_id,"access-requests"],["notifications"]])}),a.addEventListener("project.access_request_resolved",o=>{const l=JSON.parse(o.data??"{}");i([["projects"],["projects",l.project_id,"access-requests"],["notifications"]])}),a.onerror=()=>{},()=>{a.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const Sm=768;function YD(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Sm-1}px)`),n=()=>{t(window.innerWidth<Sm)};return r.addEventListener("change",n),t(window.innerWidth<Sm),()=>r.removeEventListener("change",n)},[]),!!e}const Mo=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>s.jsx(Vj,{ref:a,decorative:r,orientation:t,className:$("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));Mo.displayName=Vj.displayName;const GD=ec,VD=Jl,pN=h.forwardRef(({className:e,...t},r)=>s.jsx(ki,{className:$("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}));pN.displayName=ki.displayName;const XD=tc("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"}}),xN=h.forwardRef(({side:e="right",className:t,children:r,...n},a)=>s.jsxs(VD,{children:[s.jsx(pN,{}),s.jsxs(Si,{ref:a,className:$(XD({side:e}),t),...n,children:[r,s.jsxs(qu,{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:[s.jsx(We,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xN.displayName=Si.displayName;const gN=({className:e,...t})=>s.jsx("div",{className:$("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});gN.displayName="SheetHeader";const vN=h.forwardRef(({className:e,...t},r)=>s.jsx(jo,{ref:r,className:$("text-base font-semibold text-foreground",e),...t}));vN.displayName=jo.displayName;const yN=h.forwardRef(({className:e,...t},r)=>s.jsx(No,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));yN.displayName=No.displayName;function le({className:e,...t}){return s.jsx("div",{className:$("animate-pulse rounded-md bg-muted",e),...t})}const QD="sidebar_state",ZD=60*60*24*7,JD="16rem",eT="18rem",tT="3rem",rT="b",bN=h.createContext(null);function jx(){const e=h.useContext(bN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Qu({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:i,...o}){const l=YD(),[c,d]=h.useState(!1),[u,f]=h.useState(e),m=t??u,p=h.useCallback(y=>{const b=typeof y=="function"?y(m):y;r?r(b):f(b),document.cookie=`${QD}=${b}; path=/; max-age=${ZD}`},[r,m]),x=h.useCallback(()=>l?d(y=>!y):p(y=>!y),[l,p,d]);h.useEffect(()=>{const y=b=>{b.key===rT&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),x())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x]);const g=m?"expanded":"collapsed",v=h.useMemo(()=>({state:g,open:m,setOpen:p,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:x}),[g,m,p,l,c,d,x]);return s.jsx(bN.Provider,{value:v,children:s.jsx(Uu,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":JD,"--sidebar-width-icon":tT,...a},className:$("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function Zu({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=jx();return r==="none"?s.jsx("div",{"data-slot":"sidebar",className:$("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:a}):o?s.jsx(GD,{open:c,onOpenChange:d,...i,children:s.jsxs(xN,{"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":eT},side:e,children:[s.jsxs(gN,{className:"sr-only",children:[s.jsx(vN,{children:"Sidebar"}),s.jsx(yN,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):s.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:[s.jsx("div",{"data-slot":"sidebar-gap",className:$("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)]")}),s.jsx("div",{"data-slot":"sidebar-container",className:$("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:s.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:a})})]})}function Ju({className:e,onClick:t,...r}){const{toggleSidebar:n}=jx();return s.jsxs(re,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:$("size-7",e),onClick:a=>{t==null||t(a),n()},...r,children:[s.jsx(sD,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ef({className:e,...t}){return s.jsx("main",{"data-slot":"sidebar-inset",className:$("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 tf({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:$("flex flex-col gap-2 p-2",e),...t})}function rf({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:$("flex flex-col gap-2 p-2",e),...t})}function my({className:e,...t}){return s.jsx(Mo,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:$("bg-sidebar-border mx-2 w-auto",e),...t})}function nf({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:$("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ei({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:$("relative flex w-full min-w-0 flex-col p-2",e),...t})}function hy({className:e,asChild:t=!1,...r}){const n=t?Xp:"div";return s.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:$("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 ti({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:$("w-full text-sm",e),...t})}function Cr({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:$("flex w-full min-w-0 flex-col gap-1",e),...t})}function kt({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:$("group/menu-item relative",e),...t})}const nT=tc("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"}}),vt=h.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:a="default",tooltip:i,className:o,...l},c){const d=t?Xp:"button",{isMobile:u,state:f}=jx(),m=s.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":r,className:$(nT({variant:n,size:a}),o),...l});return i?(typeof i=="string"&&(i={children:i}),s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:m}),s.jsx(Bn,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});vt.displayName="SidebarMenuButton";const sT=250,aT=300,_r={all:["projects"],list:()=>[..._r.all,"list"],detail:e=>[..._r.all,e],byKey:e=>[..._r.all,"key",e],activities:e=>[..._r.all,e,"activities"]};function sc(e){const{workspace:t}=Te(),r=e==null?void 0:e.workspaceIds,n=(e==null?void 0:e.orgScope)??!1,a=!(e!=null&&e.allWorkspaces)&&!(r!=null&&r.length)&&!n,i=a?t==null?void 0:t.id:void 0;return De({queryKey:[..._r.list(),i??r??(n?"org":"all")],queryFn:()=>{const o=new URLSearchParams;i?o.set("workspace_id",i):r!=null&&r.length&&o.set("workspace_ids",r.join(",")),n&&o.set("org_scope","true");const l=o.toString()?`?${o}`:"";return oe.get(`/admin/projects${l}`)},select:o=>o.projects,enabled:a?!!(t!=null&&t.id):!0,staleTime:1e3*60*2})}function ea(e){return De({queryKey:_r.byKey(e),queryFn:()=>oe.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function iT(e,t={}){const[r,n]=h.useState(e),a=t.enabled!==!1;return h.useEffect(()=>{if(!a)return;const l=setTimeout(()=>n(e),sT);return()=>clearTimeout(l)},[e,a]),{...De({queryKey:["projects","suggest-identifier",r],queryFn:()=>oe.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:a&&r.trim().length>0}),flush:()=>n(e)}}function oT(e,t={}){const r=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[n,a]=h.useState(r),i=t.enabled!==!1&&r.length>=3;h.useEffect(()=>{if(!r){a("");return}const l=setTimeout(()=>a(r),aT);return()=>clearTimeout(l)},[r]);const o=De({queryKey:["projects","check-identifier",n],queryFn:()=>oe.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 lT(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:_r.list()})}})}function cT(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:_r.list()})}})}function dT(e){const t=ye();return xe({mutationFn:()=>oe.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:_r.detail(e)}),t.invalidateQueries({queryKey:_r.list()})}})}function uT(e){const t=ye();return xe({mutationFn:()=>oe.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:_r.detail(e)}),t.invalidateQueries({queryKey:_r.list()})}})}function fT(e){return De({queryKey:_r.activities(e),queryFn:()=>oe.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}function mT(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/transfer`,r),onSuccess:()=>{t.invalidateQueries({queryKey:_r.list()}),t.invalidateQueries({queryKey:_r.detail(e)}),t.invalidateQueries({queryKey:["projects",e,"access"]})}})}const Gr=hE,Vr=pE,hT=h.forwardRef(({className:e,inset:t,children:r,...n},a)=>s.jsxs(Xj,{ref:a,className:$("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,s.jsx(pr,{className:"ml-auto"})]}));hT.displayName=Xj.displayName;const pT=h.forwardRef(({className:e,...t},r)=>s.jsx(Qj,{ref:r,className:$("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}));pT.displayName=Qj.displayName;const Ar=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(mE,{children:s.jsx(Zj,{ref:n,sideOffset:t,className:$("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})}));Ar.displayName=Zj.displayName;const Ye=h.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(Jj,{ref:n,className:$("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}));Ye.displayName=Jj.displayName;const xT=h.forwardRef(({className:e,children:t,checked:r,...n},a)=>s.jsxs(e1,{ref:a,className:$("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(t1,{children:s.jsx(At,{className:"h-4 w-4"})})}),t]}));xT.displayName=e1.displayName;const gT=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(r1,{ref:n,className:$("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(t1,{children:s.jsx(Er,{className:"h-2 w-2 fill-current"})})}),t]}));gT.displayName=r1.displayName;const Td=h.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(n1,{ref:n,className:$("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));Td.displayName=n1.displayName;const Sn=h.forwardRef(({className:e,...t},r)=>s.jsx(s1,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));Sn.displayName=s1.displayName;const hn=ec,vT=Jl,wN=h.forwardRef(({className:e,...t},r)=>s.jsx(ki,{ref:r,className:$("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}));wN.displayName=ki.displayName;const Qr=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(vT,{children:[s.jsx(wN,{}),s.jsxs(Si,{ref:n,className:$("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,s.jsxs(qu,{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:[s.jsx(We,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Qr.displayName=Si.displayName;const pn=({className:e,...t})=>s.jsx("div",{className:$("flex flex-col space-y-1.5",e),...t});pn.displayName="DialogHeader";const Oo=({className:e,...t})=>s.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Oo.displayName="DialogFooter";const xn=h.forwardRef(({className:e,...t},r)=>s.jsx(jo,{ref:r,className:$("text-base font-semibold leading-none tracking-tight",e),...t}));xn.displayName=jo.displayName;const Eo=h.forwardRef(({className:e,...t},r)=>s.jsx(No,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));Eo.displayName=No.displayName;const _t=h.forwardRef(({className:e,...t},r)=>s.jsx(a1,{ref:r,className:$("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));_t.displayName=a1.displayName;const El=h.forwardRef(({className:e,...t},r)=>s.jsx(i1,{ref:r,className:$("aspect-square h-full w-full",e),...t}));El.displayName=i1.displayName;const Pt=h.forwardRef(({className:e,...t},r)=>s.jsx(o1,{ref:r,className:$("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));Pt.displayName=o1.displayName;function yT(){var y;const{workspace:e,setWorkspace:t}=Te(),{data:r}=Wn(),[n,a]=h.useState(!1),{data:i=[]}=vx("",{enabled:n}),o=wx(),l=ft(),[c,d]=h.useState(new Set),[u,f]=h.useState(null),[m,p]=h.useState(""),x=[...r??[]].sort((b,N)=>b.name.localeCompare(N.name)),g=i.filter(b=>!b.is_member).sort((b,N)=>b.name.localeCompare(N.name)),v=()=>{u&&o.mutate({workspaceId:u.id,message:m.trim()||void 0},{onSuccess:()=>{d(b=>new Set([...b,u.id])),B.success(`Access request sent for ${u.name}`),f(null)},onError:b=>{B.error(b.message??"Failed to send request"),f(null)}})};return s.jsxs(s.Fragment,{children:[s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(Gr,{open:n,onOpenChange:a,children:[s.jsx(Vr,{asChild:!0,children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[e!=null&&e.logo_url?s.jsx("img",{src:e.logo_url,alt:e.name,className:"size-8 rounded-lg object-cover shrink-0"}):s.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:s.jsx("span",{className:"text-[13px] font-bold",children:(((y=e==null?void 0:e.name)==null?void 0:y[0])??"M").toUpperCase()})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:(e==null?void 0:e.name)??"Meridian"}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.slug)??""})]}),s.jsx(_o,{className:"ml-auto size-4 shrink-0"})]})}),s.jsxs(Ar,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[s.jsx(Td,{className:"text-xs text-muted-foreground font-normal",children:"My workspaces"}),s.jsx("div",{className:"max-h-48 overflow-y-auto",children:x.map(b=>s.jsxs(Ye,{className:"cursor-pointer gap-2 p-2",onClick:()=>{t({id:b.id,name:b.name,slug:b.slug,logo_url:b.logo_url}),l(`/${b.slug}/projects`)},children:[b.logo_url?s.jsx("img",{src:b.logo_url,alt:b.name,className:"size-6 rounded-sm object-cover shrink-0"}):s.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-foreground text-background shrink-0",children:s.jsx("span",{className:"text-[10px] font-bold",children:b.name[0].toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:b.name}),b.id===(e==null?void 0:e.id)&&s.jsx(At,{className:"size-3.5 text-muted-foreground shrink-0"})]},b.id))}),g.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Sn,{}),s.jsx(Td,{className:"text-xs text-muted-foreground font-normal",children:"Other workspaces"}),s.jsx("div",{className:"max-h-36 overflow-y-auto",children:g.map(b=>{const N=c.has(b.id);return s.jsxs(Ye,{className:"cursor-pointer gap-2 p-2",onClick:()=>{N||(f({id:b.id,name:b.name}),p(""))},disabled:N,children:[s.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-muted text-muted-foreground shrink-0",children:s.jsx("span",{className:"text-[10px] font-bold",children:b.name[0].toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate text-muted-foreground",children:b.name}),N?s.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:"Requested"}):s.jsx(fs,{className:"size-3.5 text-muted-foreground shrink-0"})]},b.id)})})]}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"cursor-pointer gap-2 p-2 text-muted-foreground",onClick:()=>l("/setup"),children:[s.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:s.jsx("span",{className:"text-xs font-semibold",children:"+"})}),s.jsx("span",{children:"Create workspace"})]})]})]})})}),s.jsx(hn,{open:!!u,onOpenChange:b=>{b||f(null)},children:s.jsxs(Qr,{className:"max-w-sm",children:[s.jsx(pn,{children:s.jsxs(xn,{children:["Request access to ",u==null?void 0:u.name,"?"]})}),s.jsxs("div",{className:"space-y-3 py-1",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"A request will be sent to the workspace admins. You'll be notified once it's approved."}),s.jsx(_e,{placeholder:"Optional message to admins...",value:m,onChange:b=>p(b.target.value),className:"h-9 text-sm"})]}),s.jsxs(Oo,{children:[s.jsx(re,{variant:"outline",size:"sm",onClick:()=>f(null),children:"Cancel"}),s.jsx(re,{size:"sm",disabled:o.isPending,onClick:v,children:o.isPending?"Sending...":"Send request"})]})]})})]})}function bT(){var i,o,l,c;const{user:e,logout:t}=Te(),r=ft(),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()))||"?",a=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[s.jsxs(_t,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&s.jsx(El,{src:e.avatar_url,alt:a??"",className:"object-cover"}),s.jsx(Pt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:a}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),s.jsx(_o,{className:"ml-auto size-4 shrink-0"})]})}),s.jsxs(Ar,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[s.jsx(Td,{className:"p-0 font-normal",children:s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[s.jsxs(_t,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&s.jsx(El,{src:e.avatar_url,alt:a??"",className:"object-cover"}),s.jsx(Pt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:a}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:(e==null?void 0:e.email)??""})]})]})}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[s.jsx(nc,{className:"size-4"}),"Profile"]}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[s.jsx(Yu,{className:"size-4"}),"Sign out"]})]})]})})})}function wT({...e}){var M,E,A;const{workspace:t,projectKey:r}=It(),{data:n}=sc(),a=(n??[]).reduce((D,Z)=>D+(Z.pending_request_count??0),0),{toggle:i}=nx(),{user:o,workspace:l}=Te(),c=(l==null?void 0:l.id)??"",d=(o==null?void 0:o.roles)??[],u=d.includes("super-admin")||d.includes("admin"),{data:f=[]}=bx(c),m=u?f.length:0,p=wo(),x=t??"",g=p.pathname===`/${x}/projects`,v=p.pathname===`/${x}/my-tasks`,y=p.pathname.includes("/notifications"),b=p.pathname.includes("/settings"),N=p.pathname.includes("/roles"),w=p.pathname===`/${x}/reporting`,k=p.pathname.startsWith("/reporting"),j=p.pathname.startsWith("/org/settings"),C=((M=o==null?void 0:o.roles)==null?void 0:M.includes("super-admin"))??!1,P=C||(((E=o==null?void 0:o.roles)==null?void 0:E.includes("admin"))??!1),S=((A=o==null?void 0:o.permissions)==null?void 0:A.includes("workspace:admin"))??!1,_=P||S;return s.jsxs(Zu,{collapsible:"offcanvas",...e,children:[s.jsx(tf,{children:s.jsx(yT,{})}),s.jsxs(nf,{children:[s.jsx(ei,{children:s.jsx(ti,{children:s.jsxs(Cr,{children:[s.jsx(kt,{children:s.jsxs(vt,{onClick:i,tooltip:"Search",children:[s.jsx(Ra,{}),s.jsx("span",{children:"Search"}),s.jsx("kbd",{className:"ml-auto hidden text-[10px] text-sidebar-foreground/40 font-mono sm:inline-flex",children:"⌘K"})]})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:v,tooltip:"My Tasks",children:s.jsxs(tn,{to:`/${x}/my-tasks`,children:[s.jsx(Gu,{}),s.jsx("span",{children:"My Tasks"})]})})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:g,tooltip:"Projects",children:s.jsxs(tn,{to:`/${x}/projects`,end:!0,children:[s.jsx(Yr,{}),s.jsx("span",{className:"flex-1",children:"Projects"}),a>0&&s.jsx("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:a>9?"9+":a})]})})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:y,tooltip:"Notifications",children:s.jsxs(tn,{to:`/${x}/notifications`,children:[s.jsx(fi,{}),s.jsx("span",{children:"Notifications"})]})})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:w,tooltip:"Reports",children:s.jsxs(tn,{to:`/${x}/reporting`,children:[s.jsx(Ls,{}),s.jsx("span",{children:"Reports"})]})})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:b,tooltip:"Settings",children:s.jsxs(tn,{to:`/${x}/settings`,children:[s.jsx(px,{}),s.jsx("span",{className:"flex-1",children:"Workspace settings"}),m>0&&s.jsx("span",{className:"ml-auto flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:m>9?"9+":m})]})})})]})})}),n&&n.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(my,{}),s.jsxs(ei,{children:[s.jsx(hy,{children:"Recent"}),s.jsx(ti,{children:s.jsx(Cr,{children:n.slice(0,5).map(D=>s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:D.identifier===r,tooltip:D.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:s.jsxs(tn,{to:`/${x}/projects/${D.identifier}/board`,children:[s.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:D.identifier}),s.jsx("span",{className:"truncate",children:D.name})]})})},D.id))})})]})]}),_&&s.jsxs(s.Fragment,{children:[s.jsx(my,{}),s.jsxs(ei,{children:[s.jsx(hy,{children:"Global"}),s.jsx(ti,{children:s.jsxs(Cr,{children:[s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:k,tooltip:"Global Reports",children:s.jsxs(tn,{to:"/reporting",children:[s.jsx(Ls,{}),s.jsx("span",{children:"Global Reports"})]})})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:j,tooltip:"Org Settings",children:s.jsxs(tn,{to:"/org/settings",children:[s.jsx(Dd,{}),s.jsx("span",{children:"Org Settings"})]})})})]})})]})]}),s.jsx(ei,{className:"mt-auto",children:s.jsx(ti,{children:s.jsx(Cr,{children:C&&s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:N,tooltip:"Roles & Permissions",children:s.jsxs(tn,{to:`/${x}/roles`,children:[s.jsx(Eh,{}),s.jsx("span",{children:"Custom Roles"})]})})})})})})]}),s.jsx(rf,{children:s.jsx(bT,{})})]})}function sf(){const{theme:e,setTheme:t}=KA();return s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsxs(re,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[s.jsx(dD,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s.jsx(nD,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),s.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),s.jsx(Bn,{children:"Toggle theme"})]})}const fr={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"],globalActiveTimer:["time-logs","global-active-timer"]};function jT(e){return De({queryKey:fr.byIssue(e),queryFn:()=>oe.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function NT(e){return De({queryKey:fr.activeTimer(e),queryFn:()=>oe.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e})}function kT(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:fr.byIssue(e)})}})}function ST(e){const t=ye();return xe({mutationFn:()=>oe.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:r=>{t.invalidateQueries({queryKey:fr.activeTimer(e)}),t.invalidateQueries({queryKey:fr.byIssue(e)}),t.invalidateQueries({queryKey:fr.globalActiveTimer}),r.stopped_timer&&r.stopped_timer.issue_id!==e&&(t.invalidateQueries({queryKey:fr.byIssue(r.stopped_timer.issue_id)}),t.invalidateQueries({queryKey:fr.activeTimer(r.stopped_timer.issue_id)}))}})}function CT(e){const t=ye();return xe({mutationFn:()=>oe.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:fr.activeTimer(e)}),t.invalidateQueries({queryKey:fr.byIssue(e)}),t.invalidateQueries({queryKey:fr.globalActiveTimer})}})}function _T(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:fr.byIssue(e)})}})}function PT(e){const t=ye();return xe({mutationFn:({logId:r,data:n})=>oe.put(`/admin/issues/${e}/time-logs/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:fr.byIssue(e)})}})}function MT(){return De({queryKey:fr.globalActiveTimer,queryFn:()=>oe.get("/admin/time-logs/active-timer"),select:e=>e.active_timer})}function OT(){const e=ye();return xe({mutationFn:()=>oe.post("/admin/time-logs/active-timer"),onSuccess:t=>{e.invalidateQueries({queryKey:fr.globalActiveTimer}),t.time_log&&(e.invalidateQueries({queryKey:fr.byIssue(t.time_log.issue_id)}),e.invalidateQueries({queryKey:fr.activeTimer(t.time_log.issue_id)}))}})}function Id(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Rd(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3),n=Math.floor(r/3600),a=Math.floor(r%3600/60),i=r%60,o=String(a).padStart(2,"0"),l=String(i).padStart(2,"0");return n>0?`${n}:${o}:${l}`:`${o}:${l}`}function ET({startedAt:e}){const[t,r]=h.useState(()=>Rd(e));return h.useEffect(()=>{const n=setInterval(()=>r(Rd(e)),1e3);return()=>clearInterval(n)},[e]),s.jsx("span",{className:"font-mono tabular-nums text-xs font-semibold",children:t})}function AT(){const{data:e}=MT(),t=OT(),{workspace:r}=Te(),n=(r==null?void 0:r.slug)??"";if(!e||!e.started_at)return null;const a=e.issue_identifier??"Issue",i=e.project_identifier?`/${n}/projects/${e.project_identifier}/issues/${e.issue_id}`:`/${n}/projects`,o=()=>{t.mutate(void 0,{onSuccess:l=>{var d;const c=((d=l.time_log)==null?void 0:d.duration_minutes)??0;B.success(`Timer stopped — ${Id(c)} logged`)},onError:()=>B.error("Failed to stop timer")})};return s.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950/40 px-2.5 py-1 text-emerald-700 dark:text-emerald-400",children:[s.jsx(dN,{className:"h-3 w-3 shrink-0"}),s.jsx(hr,{to:i,className:"text-xs font-medium hover:underline truncate max-w-[100px]",title:e.issue_title??a,children:a}),s.jsx(ET,{startedAt:e.started_at}),s.jsx(re,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded-full text-emerald-700 dark:text-emerald-400 hover:bg-emerald-200 dark:hover:bg-emerald-900 hover:text-emerald-900 dark:hover:text-emerald-200",onClick:o,disabled:t.isPending,children:s.jsx(lN,{className:"h-2.5 w-2.5 fill-current"})})]})}const ac={all:["notifications"],list:()=>[...ac.all,"list"]};function DT(){return De({queryKey:ac.list(),queryFn:()=>oe.get("/admin/notifications"),select:e=>e.notifications})}function jN(){return De({queryKey:[...ac.list(),"unread"],queryFn:()=>oe.get("/admin/notifications?unread=true"),select:e=>e.count})}function TT(){const e=ye();return xe({mutationFn:t=>oe.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:ac.all})}})}function IT(){const e=ye();return xe({mutationFn:()=>oe.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:ac.all})}})}function RT(){const e=wo(),{projectKey:t}=It(),{data:r}=sc(),n=r==null?void 0:r.find(i=>i.identifier===t),a=e.pathname;return a.includes("/board")?{icon:Yr,label:n?`${n.name} / Board`:"Board"}:a.includes("/issues")?{icon:cs,label:n?`${n.name} / Issues`:"Issues"}:a.includes("/sprints")?{icon:gs,label:n?`${n.name} / Sprints`:"Sprints"}:a.includes("/timeline")?{icon:mi,label:n?`${n.name} / Timeline`:"Timeline"}:a.includes("/access")?{icon:fs,label:n?`${n.name} / Access`:"Access"}:a.includes("/reports")?{icon:Ls,label:n?`${n.name} / Reports`:"Reports"}:a.includes("/activity")?{icon:Ml,label:n?`${n.name} / Activity`:"Activity"}:a.endsWith("/projects")?{icon:Ed,label:"Projects"}:a.includes("/notifications")?{icon:fi,label:"Notifications"}:a.includes("/settings")?{icon:px,label:"Settings"}:{icon:Ed,label:"Meridian"}}function $T(){const{data:e=0}=jN(),{icon:t,label:r}=RT(),{workspace:n}=Te(),a=(n==null?void 0:n.slug)??"";return s.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear w-full",children:s.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[s.jsx(Ju,{className:"-ml-1"}),s.jsx(Mo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(t,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),s.jsx("span",{className:"font-medium",children:r})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsx(AT,{}),s.jsx("span",{className:"hidden md:flex",children:s.jsx(sf,{})}),s.jsx(re,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:s.jsxs(hr,{to:`/${a}/notifications`,children:[s.jsx(fi,{className:"h-4 w-4",strokeWidth:1.5}),e>0&&s.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 LT(){const e=wo(),{workspace:t}=It(),r=t??"",{data:n=0}=jN(),{toggle:a}=nx(),i=[{key:"projects",label:"Projects",icon:sN,to:`/${r}/projects`,match:/\/projects($|\/)/},{key:"notifications",label:"Notifications",icon:fi,to:`/${r}/notifications`,match:/\/notifications/,badge:n>0?n>9?"9+":String(n):null},{key:"my-tasks",label:"My Tasks",icon:Gu,to:`/${r}/my-tasks`,match:/\/my-tasks/},{key:"profile",label:"Profile",icon:nc,to:"/profile",match:/^\/profile/}];return s.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 bg-background border-t border-border md:hidden",children:s.jsxs("div",{className:"flex items-stretch h-16 pb-safe",children:[i.map(({key:o,label:l,icon:c,to:d,match:u,badge:f})=>{const m=u.test(e.pathname);return s.jsxs(hr,{to:d,className:$("flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium transition-colors relative",m?"text-indigo-600 dark:text-indigo-400":"text-muted-foreground hover:text-foreground"),children:[s.jsxs("div",{className:"relative",children:[s.jsx(c,{className:"h-5 w-5",strokeWidth:m?2:1.5}),f&&s.jsx("span",{className:"absolute -top-1 -right-1.5 h-3.5 w-3.5 rounded-full bg-indigo-600 text-[9px] font-bold text-white flex items-center justify-center leading-none",children:f})]}),s.jsx("span",{children:l})]},o)}),s.jsxs("button",{onClick:a,className:"flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Ra,{className:"h-5 w-5",strokeWidth:1.5}),s.jsx("span",{children:"Search"})]})]})})}function zT(){const{user:e,token:t,updateLocalUser:r,workspace:n,setWorkspace:a}=Te();h.useEffect(()=>{!e||!t||!e.email||fetch("/admin/users/me",{headers:{Authorization:`Bearer ${t}`}}).then(i=>i.ok?i.json():null).then(i=>{i&&r({avatar_url:i.avatar_url??null})}).catch(()=>{})},[e==null?void 0:e.id]),h.useEffect(()=>{!n||n.logo_url!==void 0||t&&fetch("/admin/workspaces",{headers:{Authorization:`Bearer ${t}`}}).then(i=>i.ok?i.json():null).then(i=>{var l;const o=(l=i==null?void 0:i.workspaces)==null?void 0:l.find(c=>c.id===n.id);o&&a({...n,logo_url:o.logo_url??null})}).catch(()=>{})},[n==null?void 0:n.id])}function FT(){return zT(),s.jsxs(Qu,{children:[s.jsx(wT,{variant:"inset"}),s.jsxs(ef,{className:"flex flex-col min-w-0",children:[s.jsx($T,{}),s.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden pb-16 md:pb-0",children:s.jsx(Ql,{})})]}),s.jsx(LT,{})]})}const Da={project:e=>["projects",e,"access"],requests:e=>["projects",e,"access-requests"]};function Kn(e){return De({queryKey:Da.project(e),queryFn:()=>oe.get(`/admin/projects/${e}/access`),enabled:!!e})}function NN(e){const t=ye();return xe({mutationFn:({userIds:r,role:n})=>oe.post(`/admin/projects/${e}/members/batch`,{user_ids:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Da.project(e)})}})}function kN(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Da.project(e)})}})}function SN(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/teams/batch`,{team_ids:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Da.project(e)})}})}function CN(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Da.project(e)})}})}function Nx(e){return De({queryKey:Da.requests(e),queryFn:()=>oe.get(`/admin/projects/${e}/access-requests`),enabled:!!e})}function BT(){const e=ye();return xe({mutationFn:({projectId:t,message:r})=>oe.post(`/admin/projects/${t}/access-requests`,{message:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]})}})}function _N(e){const t=ye();return xe({mutationFn:({requestId:r,action:n})=>oe.patch(`/admin/projects/${e}/access-requests/${r}`,{action:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Da.requests(e)}),t.invalidateQueries({queryKey:Da.project(e)}),t.invalidateQueries({queryKey:["projects"]})}})}function qT(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/projects/${t}/access-requests`),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]})}})}const no={byProject:e=>["projects",e,"health"],single:(e,t)=>["projects",e,"health",t]};function WT(e){return De({queryKey:no.byProject(e??""),queryFn:()=>oe.get(`/admin/projects/${e}/health`),select:t=>t.updates,enabled:!!e})}function Ire(e,t){return De({queryKey:no.single(e??"",t??""),queryFn:()=>oe.get(`/admin/projects/${e}/health/${t}`),select:r=>r.update,enabled:!!e&&!!t})}function Rre(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/health`,r),onSuccess:()=>{t.invalidateQueries({queryKey:no.byProject(e)})}})}function $re(e){const t=ye();return xe({mutationFn:({updateId:r,...n})=>oe.put(`/admin/projects/${e}/health/${r}`,n),onSuccess:(r,n)=>{t.invalidateQueries({queryKey:no.byProject(e)}),t.invalidateQueries({queryKey:no.single(e,n.updateId)})}})}function Lre(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/projects/${e}/health/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:no.byProject(e)})}})}function zre(e){return xe({mutationFn:t=>oe.post(`/admin/projects/${e}/health/${t}/send`,{})})}function UT({open:e,onClose:t,project:r}){const[n,a]=h.useState(null),i=dT(r.id),o=uT(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:p=>{const x=`${window.location.origin}/share/${p.project.share_token}`;a(x),B.success("Public link enabled")},onError:()=>B.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{a(null),B.success("Public link revoked")},onError:()=>B.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{B.success("Link copied to clipboard")})},m=!!c;return s.jsx(hn,{open:e,onOpenChange:p=>!p&&t(),children:s.jsxs(Qr,{className:"sm:max-w-md overflow-hidden",children:[s.jsxs(pn,{children:[s.jsxs(xn,{className:"flex items-center gap-2",children:[s.jsx(Oa,{className:"h-4 w-4"}),"Share project"]}),s.jsx(Eo,{children:"Allow anyone with the link to view this project without logging in."})]}),s.jsx("div",{className:"space-y-4 pt-2",children:m?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 overflow-hidden",children:[s.jsx(Oh,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),s.jsx("span",{className:"text-xs text-muted-foreground min-w-0 flex-1 break-all",children:c})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[s.jsx(cx,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),s.jsxs(re,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[s.jsx(wr,{className:"h-3.5 w-3.5 mr-1.5"}),"Revoke"]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone with this link can view the board, issues, and timeline. No account required."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed border-border px-3 py-4 text-center justify-center",children:[s.jsx(fs,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),s.jsxs(re,{className:"w-full",onClick:d,disabled:i.isPending,children:[s.jsx(Oh,{className:"h-4 w-4 mr-2"}),"Enable public link"]}),s.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Generates a secret link for read-only access. No write permissions granted."})]})})]})})}function PN(e=768){const[t,r]=h.useState(()=>typeof window<"u"?window.innerWidth<e:!1);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${e-1}px)`),a=i=>r(i.matches);return r(n.matches),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[e]),t}const Cm={on_track:{label:"On track",dot:"bg-green-500",badge:"text-green-700 bg-green-50 border-green-200 dark:text-green-400 dark:bg-green-950/40 dark:border-green-800"},delayed:{label:"Delayed",dot:"bg-orange-500",badge:"text-orange-700 bg-orange-50 border-orange-200 dark:text-orange-400 dark:bg-orange-950/40 dark:border-orange-800"},on_hold:{label:"On hold",dot:"bg-yellow-500",badge:"text-yellow-700 bg-yellow-50 border-yellow-200 dark:text-yellow-400 dark:bg-yellow-950/40 dark:border-yellow-800"},completed:{label:"Completed",dot:"bg-indigo-500",badge:"text-indigo-700 bg-indigo-50 border-indigo-200 dark:text-indigo-400 dark:bg-indigo-950/40 dark:border-indigo-800"}},py=["board","issues","sprints","timeline","access","reports","activity"];function HT(){const{projectKey:e,workspace:t}=It(),{data:r,error:n}=ea(e??""),{user:a}=Te(),{data:i}=Kn((r==null?void 0:r.id)??""),{data:o}=Nx((r==null?void 0:r.id)??""),l=((o==null?void 0:o.requests)??[]).filter(S=>S.status==="pending").length,{data:c}=WT(r==null?void 0:r.id),d=(c==null?void 0:c[0])??null,[u,f]=h.useState(!1),m=ft(),p=wo(),[x]=Zl(),g=PN(),v=(a==null?void 0:a.roles)??[],y=v.includes("super-admin")||v.includes("admin"),b=i==null?void 0:i.members.some(S=>S.user_id===(a==null?void 0:a.id)&&S.role==="manager"),N=y||b;h.useEffect(()=>{n&&n instanceof ax&&(n.status===403||n.status===404)&&m(`/${t}/projects`,{replace:!0})},[n,t,m]),h.useEffect(()=>{const S=x.get("tab");if(!S||!py.includes(S))return;py.every(M=>!p.pathname.endsWith(`/${M}`))&&m(`/${t}/projects/${e}/${S}`,{replace:!0})},[]);const w=`/${t}/projects/${e}`,k=[{to:`${w}/board`,label:"Board",icon:Ed,end:!0,desktopOnly:!0},{to:`${w}/issues`,label:"Issues",icon:cs,end:!1},{to:`${w}/sprints`,label:"Sprints",icon:gs,end:!0},{to:`${w}/timeline`,label:"Timeline",icon:mi,end:!0,desktopOnly:!0},{to:`${w}/access`,label:"Access",icon:fs,end:!0},{to:`${w}/reports`,label:"Reports",icon:Ls,end:!0},{to:`${w}/activity`,label:"Activity",icon:Ml,end:!0}],j=k,C=k.filter(S=>!S.desktopOnly),P=p.pathname.endsWith("/board")||p.pathname.endsWith("/timeline");return g&&P?s.jsx(Fn,{to:`${w}/issues`,replace:!0}):s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"border-b border-border bg-white dark:bg-card shrink-0 px-4 pt-4 md:px-6 md:pt-5",children:[s.jsxs("div",{className:"flex items-center gap-2.5 mb-3 md:mb-4",children:[r&&s.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}),s.jsx("h1",{className:"text-sm font-semibold",children:(r==null?void 0:r.name)??""}),d&&s.jsxs(hr,{to:"health",className:$("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium border transition-opacity hover:opacity-80",Cm[d.health].badge),children:[s.jsx("span",{className:$("h-1.5 w-1.5 rounded-full shrink-0",Cm[d.health].dot)}),Cm[d.health].label]})]}),s.jsxs("div",{className:"hidden md:flex items-center -mb-px",children:[s.jsx("div",{className:"flex flex-1",children:j.map(({to:S,label:_,icon:M,end:E})=>s.jsxs(tn,{to:S,end:E,className:({isActive:A})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${A?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[s.jsx(M,{className:"h-3.5 w-3.5",strokeWidth:1.5}),_,_==="Access"&&l>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:l>9?"9+":l})]},S))}),r&&s.jsx("div",{className:"pb-px",children:s.jsx(re,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 px-2 text-xs text-muted-foreground",children:s.jsxs(hr,{to:"health",children:[s.jsx(Ml,{className:"h-3.5 w-3.5 mr-1"}),"Status"]})})}),N&&r&&s.jsx("div",{className:"pb-px pr-1",children:s.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[s.jsx(lD,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]}),s.jsx("div",{className:"flex md:hidden overflow-x-auto -mb-px scrollbar-none",children:C.map(({to:S,label:_,icon:M,end:E})=>s.jsxs(tn,{to:S,end:E,className:({isActive:A})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 whitespace-nowrap transition-colors shrink-0 ${A?"border-indigo-600 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400 font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[s.jsx(M,{className:"h-3.5 w-3.5",strokeWidth:1.5}),_,_==="Access"&&l>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:l>9?"9+":l})]},S))})]}),s.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:s.jsx(Ql,{})}),r&&s.jsx(UT,{open:u,onClose:()=>f(!1),project:r})]})}function KT(){var a,i;const{user:e,logout:t}=Te(),r=e?`${((a=e.first_name)==null?void 0:a[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 s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[s.jsx(_t,{className:"h-8 w-8 rounded-lg shrink-0",children:s.jsx(Pt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:n}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),s.jsx(_o,{className:"ml-auto size-4 shrink-0"})]})}),s.jsxs(Ar,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[s.jsx(Yu,{className:"size-4"}),"Sign out"]})]})]})})})}function YT(){const{workspace:e}=Te(),t=ft(),r=(e==null?void 0:e.slug)??"";return s.jsxs(Zu,{collapsible:"offcanvas",variant:"inset",children:[s.jsx(tf,{children:s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[s.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:s.jsx(Ls,{className:"size-4"})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:"Reporting"}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Time analytics"})]})]})})})}),s.jsx(nf,{children:s.jsx(ei,{children:s.jsx(ti,{children:s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(vt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[s.jsx(Co,{}),s.jsx("span",{children:"Back to workspace"})]})})})})})}),s.jsx(rf,{children:s.jsx(KT,{})})]})}function GT(){return s.jsxs(Qu,{children:[s.jsx(YT,{}),s.jsxs(ef,{className:"flex flex-col min-w-0",children:[s.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:s.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[s.jsx(Ju,{className:"-ml-1"}),s.jsx(Mo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Ls,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),s.jsx("span",{className:"font-medium",children:"Reporting"})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(sf,{})})]})}),s.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:s.jsx(Ql,{})})]})]})}function VT(){var a,i;const{user:e,logout:t}=Te(),r=e?`${((a=e.first_name)==null?void 0:a[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 s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[s.jsx(_t,{className:"h-8 w-8 rounded-lg shrink-0",children:s.jsx(Pt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:n}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),s.jsx(_o,{className:"ml-auto size-4 shrink-0"})]})}),s.jsxs(Ar,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[s.jsx(Yu,{className:"size-4"}),"Sign out"]})]})]})})})}function XT(){var o;const{workspace:e,user:t}=Te(),r=ft(),n=wo(),a=(e==null?void 0:e.slug)??"",i=((o=t==null?void 0:t.roles)==null?void 0:o.includes("super-admin"))??!1;return s.jsxs(Zu,{collapsible:"offcanvas",variant:"inset",children:[s.jsx(tf,{children:s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[s.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:s.jsx(Dd,{className:"size-4"})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:"Org Settings"}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Global configuration"})]})]})})})}),s.jsx(nf,{children:s.jsx(ei,{children:s.jsx(ti,{children:s.jsxs(Cr,{children:[s.jsx(kt,{children:s.jsxs(vt,{onClick:()=>r(a?`/${a}/projects`:"/"),tooltip:"Back to workspace",children:[s.jsx(Co,{}),s.jsx("span",{children:"Back to workspace"})]})}),s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:n.pathname==="/org/settings",tooltip:"Settings",children:s.jsxs(tn,{to:"/org/settings",children:[s.jsx(Dd,{}),s.jsx("span",{children:"Settings"})]})})}),i&&s.jsx(kt,{children:s.jsx(vt,{asChild:!0,isActive:n.pathname==="/org/reports",tooltip:"Org Reports",children:s.jsxs(tn,{to:"/org/reports",children:[s.jsx(Ls,{}),s.jsx("span",{children:"Org Reports"})]})})})]})})})}),s.jsx(rf,{children:s.jsx(VT,{})})]})}function QT(){return s.jsxs(Qu,{children:[s.jsx(XT,{}),s.jsxs(ef,{className:"flex flex-col min-w-0",children:[s.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:s.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[s.jsx(Ju,{className:"-ml-1"}),s.jsx(Mo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Dd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),s.jsx("span",{className:"font-medium",children:"Org Settings"})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(sf,{})})]})}),s.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:s.jsx(Ql,{})})]})]})}function ZT(){var a,i;const{user:e,logout:t}=Te(),r=e?`${((a=e.first_name)==null?void 0:a[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 s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[s.jsxs(_t,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&s.jsx(El,{src:e.avatar_url,alt:n??"",className:"object-cover"}),s.jsx(Pt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})]}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:n}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),s.jsx(_o,{className:"ml-auto size-4 shrink-0"})]})}),s.jsxs(Ar,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[s.jsx(Yu,{className:"size-4"}),"Sign out"]})]})]})})})}function JT(){const{workspace:e}=Te(),t=ft(),r=(e==null?void 0:e.slug)??"";return s.jsxs(Zu,{collapsible:"offcanvas",variant:"inset",children:[s.jsx(tf,{children:s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(vt,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[s.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:s.jsx(nc,{className:"size-4"})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-semibold",children:"Profile"}),s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Personal settings"})]})]})})})}),s.jsx(nf,{children:s.jsx(ei,{children:s.jsx(ti,{children:s.jsx(Cr,{children:s.jsx(kt,{children:s.jsxs(vt,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[s.jsx(Co,{}),s.jsx("span",{children:"Back to workspace"})]})})})})})}),s.jsx(rf,{children:s.jsx(ZT,{})})]})}function e3(){return s.jsxs(Qu,{children:[s.jsx(JT,{}),s.jsxs(ef,{className:"flex flex-col min-w-0",children:[s.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:s.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[s.jsx(Ju,{className:"-ml-1"}),s.jsx(Mo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(nc,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),s.jsx("span",{className:"font-medium",children:"Profile"})]}),s.jsx("div",{className:"ml-auto",children:s.jsx(sf,{})})]})}),s.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:s.jsx(Ql,{})})]})]})}var xy=1,t3=.9,r3=.8,n3=.17,_m=.1,Pm=.999,s3=.9999,a3=.99,i3=/[\\\/_+.#"@\[\(\{&]/,o3=/[\\\/_+.#"@\[\(\{&]/g,l3=/[\s-]/,MN=/[\s-]/g;function Dh(e,t,r,n,a,i,o){if(i===t.length)return a===e.length?xy:a3;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),d=r.indexOf(c,a),u=0,f,m,p,x;d>=0;)f=Dh(e,t,r,n,d+1,i+1,o),f>u&&(d===a?f*=xy:i3.test(e.charAt(d-1))?(f*=r3,p=e.slice(a,d-1).match(o3),p&&a>0&&(f*=Math.pow(Pm,p.length))):l3.test(e.charAt(d-1))?(f*=t3,x=e.slice(a,d-1).match(MN),x&&a>0&&(f*=Math.pow(Pm,x.length))):(f*=n3,a>0&&(f*=Math.pow(Pm,d-a))),e.charAt(d)!==t.charAt(i)&&(f*=s3)),(f<_m&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=Dh(e,t,r,n,d+1,i+2,o),m*_m>f&&(f=m*_m)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function gy(e){return e.toLowerCase().replace(MN," ")}function c3(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Dh(e,t,gy(e),gy(t),0,0,{})}var el='[cmdk-group=""]',Mm='[cmdk-group-items=""]',d3='[cmdk-group-heading=""]',kx='[cmdk-item=""]',vy=`${kx}:not([aria-disabled="true"])`,Th="cmdk-item-select",Za="data-value",u3=(e,t,r)=>c3(e,t,r),ON=h.createContext(void 0),ic=()=>h.useContext(ON),EN=h.createContext(void 0),Sx=()=>h.useContext(EN),AN=h.createContext(void 0),DN=h.forwardRef((e,t)=>{let r=Hi(()=>{var L,H;return{search:"",value:(H=(L=e.value)!=null?L:e.defaultValue)!=null?H:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Hi(()=>new Set),a=Hi(()=>new Map),i=Hi(()=>new Map),o=Hi(()=>new Set),l=TN(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:x,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=Vi(),N=Vi(),w=Vi(),k=h.useRef(null),j=j3();hi(()=>{if(u!==void 0){let L=u.trim();r.current.value=L,C.emit()}},[u]),hi(()=>{j(6,A)},[]);let C=h.useMemo(()=>({subscribe:L=>(o.current.add(L),()=>o.current.delete(L)),snapshot:()=>r.current,setState:(L,H,R)=>{var Y,F,T;if(!Object.is(r.current[L],H)){if(r.current[L]=H,L==="search")E(),_(),j(1,M);else if(L==="value"&&(R||j(5,A),((Y=l.current)==null?void 0:Y.value)!==void 0)){let G=H??"";(T=(F=l.current).onValueChange)==null||T.call(F,G);return}C.emit()}},emit:()=>{o.current.forEach(L=>L())}}),[]),P=h.useMemo(()=>({value:(L,H,R)=>{var Y;H!==((Y=i.current.get(L))==null?void 0:Y.value)&&(i.current.set(L,{value:H,keywords:R}),r.current.filtered.items.set(L,S(H,R)),j(2,()=>{_(),C.emit()}))},item:(L,H)=>(n.current.add(L),H&&(a.current.has(H)?a.current.get(H).add(L):a.current.set(H,new Set([L]))),j(3,()=>{E(),_(),r.current.value||M(),C.emit()}),()=>{i.current.delete(L),n.current.delete(L),r.current.filtered.items.delete(L);let R=D();j(4,()=>{E(),(R==null?void 0:R.getAttribute("id"))===L&&M(),C.emit()})}),group:L=>(a.current.has(L)||a.current.set(L,new Set),()=>{i.current.delete(L),a.current.delete(L)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:N,listInnerRef:k}),[]);function S(L,H){var R,Y;let F=(Y=(R=l.current)==null?void 0:R.filter)!=null?Y:u3;return L?F(L,r.current.search,H):0}function _(){if(!r.current.search||l.current.shouldFilter===!1)return;let L=r.current.filtered.items,H=[];r.current.filtered.groups.forEach(Y=>{let F=a.current.get(Y),T=0;F.forEach(G=>{let z=L.get(G);T=Math.max(z,T)}),H.push([Y,T])});let R=k.current;Z().sort((Y,F)=>{var T,G;let z=Y.getAttribute("id"),se=F.getAttribute("id");return((T=L.get(se))!=null?T:0)-((G=L.get(z))!=null?G:0)}).forEach(Y=>{let F=Y.closest(Mm);F?F.appendChild(Y.parentElement===F?Y:Y.closest(`${Mm} > *`)):R.appendChild(Y.parentElement===R?Y:Y.closest(`${Mm} > *`))}),H.sort((Y,F)=>F[1]-Y[1]).forEach(Y=>{var F;let T=(F=k.current)==null?void 0:F.querySelector(`${el}[${Za}="${encodeURIComponent(Y[0])}"]`);T==null||T.parentElement.appendChild(T)})}function M(){let L=Z().find(R=>R.getAttribute("aria-disabled")!=="true"),H=L==null?void 0:L.getAttribute(Za);C.setState("value",H||void 0)}function E(){var L,H,R,Y;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let F=0;for(let T of n.current){let G=(H=(L=i.current.get(T))==null?void 0:L.value)!=null?H:"",z=(Y=(R=i.current.get(T))==null?void 0:R.keywords)!=null?Y:[],se=S(G,z);r.current.filtered.items.set(T,se),se>0&&F++}for(let[T,G]of a.current)for(let z of G)if(r.current.filtered.items.get(z)>0){r.current.filtered.groups.add(T);break}r.current.filtered.count=F}function A(){var L,H,R;let Y=D();Y&&(((L=Y.parentElement)==null?void 0:L.firstChild)===Y&&((R=(H=Y.closest(el))==null?void 0:H.querySelector(d3))==null||R.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function D(){var L;return(L=k.current)==null?void 0:L.querySelector(`${kx}[aria-selected="true"]`)}function Z(){var L;return Array.from(((L=k.current)==null?void 0:L.querySelectorAll(vy))||[])}function Q(L){let H=Z()[L];H&&C.setState("value",H.getAttribute(Za))}function q(L){var H;let R=D(),Y=Z(),F=Y.findIndex(G=>G===R),T=Y[F+L];(H=l.current)!=null&&H.loop&&(T=F+L<0?Y[Y.length-1]:F+L===Y.length?Y[0]:Y[F+L]),T&&C.setState("value",T.getAttribute(Za))}function te(L){let H=D(),R=H==null?void 0:H.closest(el),Y;for(;R&&!Y;)R=L>0?b3(R,el):w3(R,el),Y=R==null?void 0:R.querySelector(vy);Y?C.setState("value",Y.getAttribute(Za)):q(L)}let ne=()=>Q(Z().length-1),I=L=>{L.preventDefault(),L.metaKey?ne():L.altKey?te(1):q(1)},O=L=>{L.preventDefault(),L.metaKey?Q(0):L.altKey?te(-1):q(-1)};return h.createElement(Ia.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:L=>{var H;if((H=y.onKeyDown)==null||H.call(y,L),!L.defaultPrevented)switch(L.key){case"n":case"j":{v&&L.ctrlKey&&I(L);break}case"ArrowDown":{I(L);break}case"p":case"k":{v&&L.ctrlKey&&O(L);break}case"ArrowUp":{O(L);break}case"Home":{L.preventDefault(),Q(0);break}case"End":{L.preventDefault(),ne();break}case"Enter":if(!L.nativeEvent.isComposing&&L.keyCode!==229){L.preventDefault();let R=D();if(R){let Y=new Event(Th);R.dispatchEvent(Y)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:k3},c),af(e,L=>h.createElement(EN.Provider,{value:C},h.createElement(ON.Provider,{value:P},L))))}),f3=h.forwardRef((e,t)=>{var r,n;let a=Vi(),i=h.useRef(null),o=h.useContext(AN),l=ic(),c=TN(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;hi(()=>{if(!d)return l.item(a,o==null?void 0:o.id)},[d]);let u=IN(a,i,[e.value,e.children,i],e.keywords),f=Sx(),m=pi(j=>j.value&&j.value===u.current),p=pi(j=>d||l.filter()===!1?!0:j.search?j.filtered.items.get(a)>0:!0);h.useEffect(()=>{let j=i.current;if(!(!j||e.disabled))return j.addEventListener(Th,x),()=>j.removeEventListener(Th,x)},[p,e.onSelect,e.disabled]);function x(){var j,C;g(),(C=(j=c.current).onSelect)==null||C.call(j,u.current)}function g(){f.setState("value",u.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:N,keywords:w,...k}=e;return h.createElement(Ia.div,{ref:Al([i,t]),...k,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:x},e.children)}),m3=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...i}=e,o=Vi(),l=h.useRef(null),c=h.useRef(null),d=Vi(),u=ic(),f=pi(p=>a||u.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);hi(()=>u.group(o),[]),IN(o,l,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:o,forceMount:a}),[a]);return h.createElement(Ia.div,{ref:Al([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&h.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),af(e,p=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},h.createElement(AN.Provider,{value:m},p))))}),h3=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=h.useRef(null),i=pi(o=>!o.search);return!r&&!i?null:h.createElement(Ia.div,{ref:Al([a,t]),...n,"cmdk-separator":"",role:"separator"})}),p3=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,i=Sx(),o=pi(u=>u.search),l=pi(u=>u.value),c=ic(),d=h.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${kx}[${Za}="${encodeURIComponent(l)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(Ia.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:a?e.value:o,onChange:u=>{a||i.setState("search",u.target.value),r==null||r(u.target.value)}})}),x3=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,i=h.useRef(null),o=h.useRef(null),l=ic();return h.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)}}},[]),h.createElement(Ia.div,{ref:Al([i,t]),...a,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},af(e,c=>h.createElement("div",{ref:Al([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),g3=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:i,container:o,...l}=e;return h.createElement(ec,{open:r,onOpenChange:n},h.createElement(Jl,{container:o},h.createElement(ki,{"cmdk-overlay":"",className:a}),h.createElement(Si,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(DN,{ref:t,...l}))))}),v3=h.forwardRef((e,t)=>pi(r=>r.filtered.count===0)?h.createElement(Ia.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),y3=h.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...i}=e;return h.createElement(Ia.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},af(e,o=>h.createElement("div",{"aria-hidden":!0},o)))}),Zr=Object.assign(DN,{List:x3,Item:f3,Input:p3,Group:m3,Separator:h3,Dialog:g3,Empty:v3,Loading:y3});function b3(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function w3(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function TN(e){let t=h.useRef(e);return hi(()=>{t.current=e}),t}var hi=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Hi(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function Al(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function pi(e){let t=Sx(),r=()=>e(t.snapshot());return xE.useSyncExternalStore(t.subscribe,r,r)}function IN(e,t,r,n=[]){let a=h.useRef(),i=ic();return hi(()=>{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():a.current}})(),c=n.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Za,l),a.current=l}),a}var j3=()=>{let[e,t]=h.useState(),r=Hi(()=>new Map);return hi(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function N3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function af({asChild:e,children:t},r){return e&&h.isValidElement(t)?h.cloneElement(N3(t),{ref:t.ref},r(t.props.children)):r(t)}var k3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const va=h.forwardRef(({className:e,...t},r)=>s.jsx(Zr,{ref:r,className:$("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));va.displayName=Zr.displayName;const S3=({children:e,open:t,onOpenChange:r})=>s.jsx(hn,{open:t,onOpenChange:r,children:s.jsx(Qr,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:s.jsx(va,{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})})}),oc=h.forwardRef(({className:e,...t},r)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(Ra,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Zr.Input,{ref:r,className:$("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})]}));oc.displayName=Zr.Input.displayName;const ya=h.forwardRef(({className:e,...t},r)=>s.jsx(Zr.List,{ref:r,className:$("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));ya.displayName=Zr.List.displayName;const lc=h.forwardRef((e,t)=>s.jsx(Zr.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));lc.displayName=Zr.Empty.displayName;const Ts=h.forwardRef(({className:e,...t},r)=>s.jsx(Zr.Group,{ref:r,className:$("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}));Ts.displayName=Zr.Group.displayName;const RN=h.forwardRef(({className:e,...t},r)=>s.jsx(Zr.Separator,{ref:r,className:$("-mx-1 h-px bg-border",e),...t}));RN.displayName=Zr.Separator.displayName;const sn=h.forwardRef(({className:e,...t},r)=>s.jsx(Zr.Item,{ref:r,className:$("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}));sn.displayName=Zr.Item.displayName;function C3(){const{open:e,setOpen:t}=nx(),r=ft(),{data:n}=sc(),{workspace:a}=Te(),i=(a==null?void 0:a.slug)??"",o=l=>{t(!1),l()};return s.jsxs(S3,{open:e,onOpenChange:t,children:[s.jsx(oc,{placeholder:"Search or jump to..."}),s.jsxs(ya,{children:[s.jsx(lc,{children:"No results found."}),s.jsxs(Ts,{heading:"Navigation",children:[s.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[s.jsx(Ed,{className:"text-muted-foreground"}),s.jsx("span",{children:"Projects"})]}),s.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[s.jsx(fi,{className:"text-muted-foreground"}),s.jsx("span",{children:"Notifications"})]}),s.jsxs(sn,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[s.jsx(px,{className:"text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(RN,{}),s.jsxs(Ts,{heading:"Projects",children:[n.map(l=>s.jsxs(sn,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[s.jsx(Yr,{className:"text-muted-foreground"}),s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),s.jsx("span",{className:"truncate",children:l.name}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Board"})]})]},`${l.id}-board`)),n.map(l=>s.jsxs(sn,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[s.jsx(cs,{className:"text-muted-foreground"}),s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),s.jsx("span",{className:"truncate",children:l.name}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Issues"})]})]},`${l.id}-issues`))]})]})]})]})}function Or({zone:e,props:t}){const r=I5(e);return r.length?s.jsx(s.Fragment,{children:r.map((n,a)=>s.jsx(n,{...t},n.displayName??n.name??a))}):null}function Cx({flow:e,inviteToken:t,label:r,disabled:n}){const a=()=>{const i=`${to}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return s.jsxs(re,{type:"button",variant:"outline",className:"w-full gap-2 bg-white dark:bg-black text-black dark:text-white",onClick:a,disabled:n,children:[s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[s.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"}),s.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"}),s.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"}),s.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 cc(){var e;return((e=window.__MERIDIAN_CONFIG__)==null?void 0:e.appName)??"Meridian"}function _3(){var e;return(e=window.__MERIDIAN_CONFIG__)==null?void 0:e.logoUrl}function dc({className:e}){const t=_3();return t?s.jsx("img",{src:t,alt:cc(),className:e??"h-12 w-12"}):s.jsx("div",{className:e??"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:s.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:s.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:s.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})})}function P3(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[a,i]=h.useState(!1),o=ft(),l=FD(),{data:c}=Xu(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>B.error(f.message??"Invalid email or password")})};return s.jsx("div",{className:"min-h-screen bg-white dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[360px]",children:[s.jsx(Or,{zone:"login.before",props:{}}),s.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[s.jsx(dc,{}),s.jsxs("div",{className:"text-center",children:[s.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Welcome to ",cc()]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Sign in to access the admin area"})]})]}),s.jsxs("form",{onSubmit:d,className:"space-y-2",children:[s.jsx(_e,{type:"email",placeholder:"Email",value:e,onChange:u=>t(u.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:a?"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"}),s.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:a?s.jsx(rc,{className:"h-4 w-4"}):s.jsx(Pi,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(hr,{to:"/forgot-password",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})}),s.jsx("div",{className:"pt-1",children:s.jsx(re,{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)&&s.jsxs("div",{className:"mt-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-px flex-1 bg-border"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),s.jsx("div",{className:"h-px flex-1 bg-border"})]}),s.jsx(Cx,{flow:"login"})]}),((c==null?void 0:c.needsSetup)||(c==null?void 0:c.registrationEnabled))&&s.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",s.jsx(hr,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),s.jsx(Or,{zone:"login.after",props:{}})]})})}var M3=Object.defineProperty,O3=Object.defineProperties,E3=Object.getOwnPropertyDescriptors,$d=Object.getOwnPropertySymbols,$N=Object.prototype.hasOwnProperty,LN=Object.prototype.propertyIsEnumerable,yy=(e,t,r)=>t in e?M3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A3=(e,t)=>{for(var r in t||(t={}))$N.call(t,r)&&yy(e,r,t[r]);if($d)for(var r of $d(t))LN.call(t,r)&&yy(e,r,t[r]);return e},D3=(e,t)=>O3(e,E3(t)),T3=(e,t)=>{var r={};for(var n in e)$N.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$d)for(var n of $d(e))t.indexOf(n)<0&&LN.call(e,n)&&(r[n]=e[n]);return r};function I3(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function R3(e){let t=h.useRef();return h.useEffect(()=>{t.current=e}),t.current}var $3=18,zN=40,L3=`${zN}px`,z3=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function F3({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[a,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),u=h.useMemo(()=>r==="none"?!1:(r==="increase-width"||r==="experimental-no-flickering")&&a&&o,[a,o,r]),f=h.useCallback(()=>{let m=e.current,p=t.current;if(!m||!p||c||r==="none")return;let x=m,g=x.getBoundingClientRect().left+x.offsetWidth,v=x.getBoundingClientRect().top+x.offsetHeight/2,y=g-$3,b=v;document.querySelectorAll(z3).length===0&&document.elementFromPoint(y,b)===m||(i(!0),d(!0))},[e,t,c,r]);return h.useEffect(()=>{let m=e.current;if(!m||r==="none")return;function p(){let g=window.innerWidth-m.getBoundingClientRect().right;l(g>=zN)}p();let x=setInterval(p,1e3);return()=>{clearInterval(x)}},[e,r]),h.useEffect(()=>{let m=n||document.activeElement===t.current;if(r==="none"||!m)return;let p=setTimeout(f,0),x=setTimeout(f,2e3),g=setTimeout(f,5e3),v=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(x),clearTimeout(g),clearTimeout(v)}},[t,n,r,f]),{hasPWMBadge:a,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:L3}}var FN=h.createContext({}),BN=h.forwardRef((e,t)=>{var r=e,{value:n,onChange:a,maxLength:i,textAlign:o="left",pattern:l,placeholder:c,inputMode:d="numeric",onComplete:u,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:m,containerClassName:p,noScriptCSSFallback:x=B3,render:g,children:v}=r,y=T3(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),b,N,w,k,j;let[C,P]=h.useState(typeof y.defaultValue=="string"?y.defaultValue:""),S=n??C,_=R3(S),M=h.useCallback(V=>{a==null||a(V),P(V)},[a]),E=h.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),A=h.useRef(null),D=h.useRef(null),Z=h.useRef({value:S,onChange:M,isIOS:typeof window<"u"&&((N=(b=window==null?void 0:window.CSS)==null?void 0:b.supports)==null?void 0:N.call(b,"-webkit-touch-callout","none"))}),Q=h.useRef({prev:[(w=A.current)==null?void 0:w.selectionStart,(k=A.current)==null?void 0:k.selectionEnd,(j=A.current)==null?void 0:j.selectionDirection]});h.useImperativeHandle(t,()=>A.current,[]),h.useEffect(()=>{let V=A.current,J=D.current;if(!V||!J)return;Z.current.value!==V.value&&Z.current.onChange(V.value),Q.current.prev=[V.selectionStart,V.selectionEnd,V.selectionDirection];function ue(){if(document.activeElement!==V){L(null),R(null);return}let ge=V.selectionStart,be=V.selectionEnd,qe=V.selectionDirection,Ge=V.maxLength,Je=V.value,rt=Q.current.prev,mt=-1,He=-1,Ze;if(Je.length!==0&&ge!==null&&be!==null){let jr=ge===be,ar=ge===Je.length&&Je.length<Ge;if(jr&&!ar){let wt=ge;if(wt===0)mt=0,He=1,Ze="forward";else if(wt===Ge)mt=wt-1,He=wt,Ze="backward";else if(Ge>1&&Je.length>1){let Bt=0;if(rt[0]!==null&&rt[1]!==null){Ze=wt<rt[1]?"backward":"forward";let Gt=rt[0]===rt[1]&&rt[0]<Ge;Ze==="backward"&&!Gt&&(Bt=-1)}mt=Bt+wt,He=Bt+wt+1}}mt!==-1&&He!==-1&&mt!==He&&A.current.setSelectionRange(mt,He,Ze)}let nr=mt!==-1?mt:ge,Lr=He!==-1?He:be,sr=Ze??qe;L(nr),R(Lr),Q.current.prev=[nr,Lr,sr]}if(document.addEventListener("selectionchange",ue,{capture:!0}),ue(),document.activeElement===V&&I(!0),!document.getElementById("input-otp-style")){let ge=document.createElement("style");if(ge.id="input-otp-style",document.head.appendChild(ge),ge.sheet){let be="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";tl(ge.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),tl(ge.sheet,`[data-input-otp]:autofill { ${be} }`),tl(ge.sheet,`[data-input-otp]:-webkit-autofill { ${be} }`),tl(ge.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),tl(ge.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let de=()=>{J&&J.style.setProperty("--root-height",`${V.clientHeight}px`)};de();let ee=new ResizeObserver(de);return ee.observe(V),()=>{document.removeEventListener("selectionchange",ue,{capture:!0}),ee.disconnect()}},[]);let[q,te]=h.useState(!1),[ne,I]=h.useState(!1),[O,L]=h.useState(null),[H,R]=h.useState(null);h.useEffect(()=>{I3(()=>{var V,J,ue,de;(V=A.current)==null||V.dispatchEvent(new Event("input"));let ee=(J=A.current)==null?void 0:J.selectionStart,ge=(ue=A.current)==null?void 0:ue.selectionEnd,be=(de=A.current)==null?void 0:de.selectionDirection;ee!==null&&ge!==null&&(L(ee),R(ge),Q.current.prev=[ee,ge,be])})},[S,ne]),h.useEffect(()=>{_!==void 0&&S!==_&&_.length<i&&S.length===i&&(u==null||u(S))},[i,u,_,S]);let Y=F3({containerRef:D,inputRef:A,pushPasswordManagerStrategy:f,isFocused:ne}),F=h.useCallback(V=>{let J=V.currentTarget.value.slice(0,i);if(J.length>0&&E&&!E.test(J)){V.preventDefault();return}typeof _=="string"&&J.length<_.length&&document.dispatchEvent(new Event("selectionchange")),M(J)},[i,M,_,E]),T=h.useCallback(()=>{var V;if(A.current){let J=Math.min(A.current.value.length,i-1),ue=A.current.value.length;(V=A.current)==null||V.setSelectionRange(J,ue),L(J),R(ue)}I(!0)},[i]),G=h.useCallback(V=>{var J,ue;let de=A.current;if(!m&&(!Z.current.isIOS||!V.clipboardData||!de))return;let ee=V.clipboardData.getData("text/plain"),ge=m?m(ee):ee;V.preventDefault();let be=(J=A.current)==null?void 0:J.selectionStart,qe=(ue=A.current)==null?void 0:ue.selectionEnd,Ge=(be!==qe?S.slice(0,be)+ge+S.slice(qe):S.slice(0,be)+ge+S.slice(be)).slice(0,i);if(Ge.length>0&&E&&!E.test(Ge))return;de.value=Ge,M(Ge);let Je=Math.min(Ge.length,i-1),rt=Ge.length;de.setSelectionRange(Je,rt),L(Je),R(rt)},[i,M,E,S]),z=h.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=h.useMemo(()=>({position:"absolute",inset:0,width:Y.willPushPWMBadge?`calc(100% + ${Y.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:Y.willPushPWMBadge?`inset(0 ${Y.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[Y.PWM_BADGE_SPACE_WIDTH,Y.willPushPWMBadge,o]),W=h.useMemo(()=>h.createElement("input",D3(A3({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":S.length===0||void 0,"data-input-otp-mss":O,"data-input-otp-mse":H,inputMode:d,pattern:E==null?void 0:E.source,"aria-placeholder":c,style:se,maxLength:i,value:S,ref:A,onPaste:V=>{var J;G(V),(J=y.onPaste)==null||J.call(y,V)},onChange:F,onMouseOver:V=>{var J;te(!0),(J=y.onMouseOver)==null||J.call(y,V)},onMouseLeave:V=>{var J;te(!1),(J=y.onMouseLeave)==null||J.call(y,V)},onFocus:V=>{var J;T(),(J=y.onFocus)==null||J.call(y,V)},onBlur:V=>{var J;I(!1),(J=y.onBlur)==null||J.call(y,V)}})),[F,T,G,d,se,i,H,O,y,E==null?void 0:E.source,S]),X=h.useMemo(()=>({slots:Array.from({length:i}).map((V,J)=>{var ue;let de=ne&&O!==null&&H!==null&&(O===H&&J===O||J>=O&&J<H),ee=S[J]!==void 0?S[J]:null,ge=S[0]!==void 0?null:(ue=c==null?void 0:c[J])!=null?ue:null;return{char:ee,placeholderChar:ge,isActive:de,hasFakeCaret:de&&ee===null}}),isFocused:ne,isHovering:!y.disabled&&q}),[ne,q,i,H,O,y.disabled,S]),ie=h.useMemo(()=>g?g(X):h.createElement(FN.Provider,{value:X},v),[v,X,g]);return h.createElement(h.Fragment,null,x!==null&&h.createElement("noscript",null,h.createElement("style",null,x)),h.createElement("div",{ref:D,"data-input-otp-container":!0,style:z,className:p},ie,h.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},W)))});BN.displayName="Input";function tl(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var B3=`
|
|
559
|
-
[data-input-otp] {
|
|
560
|
-
--nojs-bg: white !important;
|
|
561
|
-
--nojs-fg: black !important;
|
|
562
|
-
|
|
563
|
-
background-color: var(--nojs-bg) !important;
|
|
564
|
-
color: var(--nojs-fg) !important;
|
|
565
|
-
caret-color: var(--nojs-fg) !important;
|
|
566
|
-
letter-spacing: .25em !important;
|
|
567
|
-
text-align: center !important;
|
|
568
|
-
border: 1px solid var(--nojs-fg) !important;
|
|
569
|
-
border-radius: 4px !important;
|
|
570
|
-
width: 100% !important;
|
|
571
|
-
}
|
|
572
|
-
@media (prefers-color-scheme: dark) {
|
|
573
|
-
[data-input-otp] {
|
|
574
|
-
--nojs-bg: black !important;
|
|
575
|
-
--nojs-fg: white !important;
|
|
576
|
-
}
|
|
577
|
-
}`;const _x=h.forwardRef(({className:e,containerClassName:t,...r},n)=>s.jsx(BN,{ref:n,containerClassName:$("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:$("disabled:cursor-not-allowed",e),...r}));_x.displayName="InputOTP";const Ld=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:$("flex items-center",e),...t}));Ld.displayName="InputOTPGroup";const nn=h.forwardRef(({index:e,className:t,...r},n)=>{const a=h.useContext(FN),{char:i,hasFakeCaret:o,isActive:l}=a.slots[e];return s.jsxs("div",{ref:n,className:$("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-2 ring-ring ring-offset-background",t),...r,children:[i,o&&s.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});nn.displayName="InputOTPSlot";const qN=h.forwardRef(({...e},t)=>s.jsx("div",{ref:t,role:"separator",...e,children:s.jsx(Js,{})}));qN.displayName="InputOTPSeparator";function q3(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState("form"),[m,p]=h.useState(""),x=ft(),g=BD(),v=zD(),{data:y}=Xu(),b=(y==null?void 0:y.needsSetup)===!0,N=!b&&(y==null?void 0:y.registrationEnabled)===!0,w=async j=>{if(j.preventDefault(),N&&u==="form"){v.mutate({email:a},{onSuccess:()=>f("otp"),onError:C=>B.error(C.message??"Failed to send verification code")});return}g.mutate({email:a,password:o,first_name:e,last_name:r,...N?{otp:m}:{}},{onSuccess:()=>x("/"),onError:C=>B.error(C.message??"Registration failed")})},k=()=>{v.mutate({email:a},{onSuccess:()=>B.success("A new code has been sent"),onError:j=>B.error(j.message??"Failed to resend code")})};return s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[360px]",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[s.jsx(dc,{}),s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-lg font-semibold text-foreground",children:b?"Set up your account":"Create your account"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:b?"You're the first user — you'll be the super admin.":u==="otp"?`We sent a code to ${a}`:`Get started with ${cc()}`})]})]}),u==="otp"?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(_x,{maxLength:6,value:m,onChange:p,children:s.jsxs(Ld,{children:[s.jsx(nn,{index:0}),s.jsx(nn,{index:1}),s.jsx(nn,{index:2}),s.jsx(nn,{index:3}),s.jsx(nn,{index:4}),s.jsx(nn,{index:5})]})})}),s.jsx(re,{className:"w-full h-10 font-medium",disabled:m.length<6||g.isPending,onClick:w,children:g.isPending?"Creating account...":"Verify & Create Account"}),s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("button",{type:"button",onClick:()=>{f("form"),p("")},className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Co,{className:"h-3.5 w-3.5"}),"Back"]}),s.jsx("button",{type:"button",onClick:k,disabled:v.isPending,className:"text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:v.isPending?"Sending...":"Resend code"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("form",{onSubmit:w,className:"space-y-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(_e,{placeholder:"First name",value:e,onChange:j=>t(j.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),s.jsx(_e,{placeholder:"Last name",value:r,onChange:j=>n(j.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),s.jsx(_e,{type:"email",placeholder:"Email",value:a,onChange:j=>i(j.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:c?"text":"password",placeholder:"Password",value:o,onChange:j=>l(j.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),s.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?s.jsx(rc,{className:"h-4 w-4"}):s.jsx(Pi,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"pt-1",children:s.jsx(re,{type:"submit",className:"w-full h-10 font-medium",disabled:g.isPending||v.isPending,children:v.isPending?"Sending code...":g.isPending?"Creating account...":N?"Continue":"Create Account"})})]}),(y==null?void 0:y.googleOAuthEnabled)&&s.jsxs("div",{className:"mt-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-px flex-1 bg-border"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),s.jsx("div",{className:"h-px flex-1 bg-border"})]}),s.jsx(Cx,{flow:"register",label:b?"Set up with Google":"Continue with Google"})]}),s.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Already have an account?"," ",s.jsx(hr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})]})})}function Px(e,t=300){const[r,n]=h.useState(e);return h.useEffect(()=>{const a=setTimeout(()=>n(e),t);return()=>clearTimeout(a)},[e,t]),r}function by(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function W3(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),[a,i]=h.useState(null),[o,l]=h.useState(!1),c=ft(),d=ye(),{token:u,setWorkspace:f}=Te();h.useEffect(()=>{if(!o||!u)return;const C=hN(u);return C.addEventListener("workspace.access_request_resolved",P=>{try{JSON.parse(P.data??"{}").action==="approve"&&d.invalidateQueries({queryKey:["workspaces"]})}catch{}}),C.onerror=()=>{},()=>C.close()},[o,u,d]);const{data:m}=Wn(o?{refetchInterval:15e3}:!1);h.useEffect(()=>{if(o&&m&&m.length>0){const C=m[0];f({id:C.id,name:C.name,slug:C.slug,logo_url:C.logo_url??null}),c(`/${C.slug}/projects`,{replace:!0})}},[m,o]);const p=wD(),x=wx(),g=Px(e,300),{data:v=[]}=vx(g),y=by(g),b=g.trim().length>0?v.find(C=>by(C.name)===y)??null:null,N=C=>{t(C.target.value),i(null),l(!1)},w=C=>{C.preventDefault(),e.trim()&&p.mutate({name:e.trim(),is_private:r},{onSuccess:P=>{const S={id:P.workspace.id,name:P.workspace.name,slug:P.workspace.slug};f(S),c(`/${S.slug}/projects`,{replace:!0})},onError:P=>{var _,M;const S=P;if(S.status===409){const E=(M=(_=S.data)==null?void 0:_.error)==null?void 0:M.workspace;if(E){i(E);return}}B.error(S.message??"Failed to create workspace")}})},k=C=>{x.mutate({workspaceId:C.id},{onSuccess:()=>l(!0),onError:P=>B.error(P.message??"Failed to send request")})},j=b?{id:b.id,name:b.name,slug:b.slug}:a;return s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[380px]",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[s.jsx(dc,{}),s.jsxs("div",{className:"text-center",children:[s.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Create your ",cc()," workspace"]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"A workspace is where your team's projects and issues live."})]})]}),s.jsxs("form",{onSubmit:w,className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(_e,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:N,autoFocus:!0,required:!0,className:$("bg-white dark:bg-card h-10",j&&!o&&"border-amber-400 focus-visible:ring-amber-300")}),s.jsx("p",{className:"text-xs text-muted-foreground px-0.5",children:"You can rename it later from settings."})]}),j&&!o&&s.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 dark:bg-amber-950/20 dark:border-amber-800 px-3 py-2.5 space-y-2",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(uN,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-sm text-amber-800 dark:text-amber-300",children:["A workspace named ",s.jsx("strong",{children:j.name})," already exists."]})]}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"w-full h-8 text-xs border-amber-300 hover:bg-amber-100 dark:border-amber-700 dark:hover:bg-amber-900/30",disabled:x.isPending,onClick:()=>k(j),children:x.isPending?"Sending request...":`Request access to ${j.name}`})]}),o&&j&&s.jsxs("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 dark:bg-emerald-950/20 dark:border-emerald-800 px-3 py-2.5 flex items-center gap-2",children:[s.jsx(kn,{className:"h-4 w-4 text-emerald-600 shrink-0"}),s.jsxs("p",{className:"text-sm text-emerald-800 dark:text-emerald-300",children:["Request sent to ",s.jsx("strong",{children:j.name}),". Admins will review it shortly."]})]}),s.jsxs("label",{className:"flex items-center gap-2.5 px-0.5 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:C=>n(C.target.checked),className:"size-4 rounded border-border accent-indigo-600"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(fs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-foreground",children:"Private workspace"})]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Only visible to members"})]}),s.jsx(re,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||p.isPending,children:p.isPending?"Creating workspace...":"Create workspace"})]})]})})}function U3(){const{token:e,logout:t,setWorkspace:r}=Te(),n=ft(),a=ye(),{data:i=[]}=$D(),o=LD();h.useEffect(()=>{if(!e)return;const D=hN(e);return D.addEventListener("workspace.access_request_resolved",Z=>{try{JSON.parse(Z.data??"{}").action==="approve"&&(a.invalidateQueries({queryKey:["workspaces"]}),a.invalidateQueries({queryKey:["my-access-requests"]}))}catch{}}),D.onerror=()=>{},()=>D.close()},[e,a]);const l=i.length>0,{data:c}=Wn({refetchInterval:l?6e4:!1});h.useEffect(()=>{if(c&&c.length>0){const D=c[0];r({id:D.id,name:D.name,slug:D.slug,logo_url:D.logo_url??null}),n(`/${D.slug}/projects`,{replace:!0})}},[c]);const[d,u]=h.useState(""),[f,m]=h.useState(!1),[p,x]=h.useState(null),[g,v]=h.useState(!1),[y,b]=h.useState(null),[N,w]=h.useState(""),k=h.useRef(null),j=h.useRef(null),C=Px(d,250),{data:P=[]}=vx(C),S=wx();h.useEffect(()=>{function D(Z){j.current&&!j.current.contains(Z.target)&&k.current&&!k.current.contains(Z.target)&&m(!1)}return document.addEventListener("pointerdown",D),()=>document.removeEventListener("pointerdown",D)},[]);const _=D=>{if(m(!1),!D.is_member&&!D.has_pending_request){b(D),w("");return}x(D),u(D.name),v(D.has_pending_request)},M=D=>{u(D.target.value),x(null),v(!1),m(!0)},E=()=>{y&&S.mutate({workspaceId:y.id,message:N.trim()||void 0},{onSuccess:()=>{b(null),x(y),u(y.name),v(!0)},onError:D=>{B.error(D.message??"Failed to send request"),b(null)}})},A=(D,Z,Q)=>{o.mutate({workspaceId:D,requestId:Z},{onSuccess:()=>{B.success(`Request to ${Q??"workspace"} cancelled`),(p==null?void 0:p.id)===D&&(x(null),u(""),v(!1))},onError:()=>B.error("Failed to cancel request")})};return s.jsxs("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:[s.jsxs("div",{className:"w-full max-w-[420px] space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(dc,{}),s.jsxs("div",{className:"text-center",children:[s.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Welcome to ",cc()]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"You haven't been assigned to a workspace yet. Create one or request access to an existing workspace."})]})]}),i.length>0&&s.jsxs("div",{className:"bg-white dark:bg-card border border-amber-200 dark:border-amber-800 rounded-lg p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(dn,{className:"h-4 w-4 text-amber-600 shrink-0"}),s.jsx("span",{className:"text-sm font-medium",children:"Pending access requests"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Waiting for admin approval. You'll be redirected automatically once approved."}),s.jsx("div",{className:"space-y-2",children:i.map(D=>s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md bg-amber-50 dark:bg-amber-950/20 px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Od,{className:"h-3.5 w-3.5 text-amber-600 shrink-0"}),s.jsx("span",{className:"text-sm font-medium truncate",children:D.workspace_name??D.workspace_id})]}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-muted-foreground hover:text-destructive shrink-0",disabled:o.isPending,onClick:()=>A(D.workspace_id,D.id,D.workspace_name),title:"Cancel request",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]},D.id))})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-lg p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ot,{className:"h-4 w-4 text-indigo-600"}),s.jsx("span",{className:"text-sm font-medium",children:"Create a new workspace"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Start fresh with your own workspace. You'll be the admin."}),s.jsx(re,{size:"sm",className:"w-full",onClick:()=>n("/setup"),children:"Create workspace"})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-lg p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ra,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium",children:"Join an existing workspace"})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Search for a public workspace and request access."}),s.jsxs("div",{className:"relative",children:[s.jsx(_e,{ref:k,placeholder:"Search workspaces...",value:d,onChange:M,onFocus:()=>m(!0),className:"bg-white dark:bg-card h-9 text-sm"}),f&&P.length>0&&s.jsx("div",{ref:j,className:"absolute z-50 mt-1 w-full bg-white dark:bg-card border border-border rounded-md shadow-md overflow-hidden max-h-48 overflow-y-auto",children:P.map(D=>s.jsxs("button",{type:"button",className:$("w-full flex items-center justify-between px-3 py-2 text-sm hover:bg-accent text-left",(p==null?void 0:p.id)===D.id&&"bg-accent"),onClick:()=>_(D),children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Od,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:"truncate",children:D.name})]}),D.is_member&&s.jsx("span",{className:"text-xs text-emerald-600 shrink-0 ml-2",children:"Member"}),!D.is_member&&D.has_pending_request&&s.jsx("span",{className:"text-xs text-amber-600 shrink-0 ml-2",children:"Pending"}),!D.is_member&&!D.has_pending_request&&s.jsx(pr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 ml-2"})]},D.id))})]}),p&&p.is_member&&s.jsx("div",{className:"pt-1",children:s.jsxs("p",{className:"text-xs text-emerald-600 flex items-center gap-1.5",children:[s.jsx(kn,{className:"h-3.5 w-3.5"}),"You're already a member of this workspace."]})}),(g||p&&p.has_pending_request)&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-600 pt-1",children:[s.jsx(dn,{className:"h-4 w-4 shrink-0"}),s.jsx("span",{children:"Request sent! Waiting for admin approval."})]})]}),s.jsx(re,{variant:"ghost",className:"w-full text-muted-foreground",onClick:t,children:"Sign out"})]}),s.jsx(hn,{open:!!y,onOpenChange:D=>{D||b(null)},children:s.jsxs(Qr,{className:"max-w-sm",children:[s.jsx(pn,{children:s.jsxs(xn,{children:["Request access to ",y==null?void 0:y.name,"?"]})}),s.jsxs("div",{className:"space-y-3 py-1",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"A request will be sent to the workspace admins. You'll be notified once it's approved."}),s.jsx(_e,{placeholder:"Optional message to admins...",value:N,onChange:D=>w(D.target.value),className:"h-9 text-sm"})]}),s.jsxs(Oo,{children:[s.jsx(re,{variant:"outline",size:"sm",onClick:()=>b(null),children:"Cancel"}),s.jsx(re,{size:"sm",disabled:S.isPending,onClick:E,children:S.isPending?"Sending...":"Send request"})]})]})})]})}function H3(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 WN=U.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}),uc=()=>{const e=U.useContext(WN);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};H3(`[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(
|
|
578
|
-
[data-state=closed]
|
|
579
|
-
){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 K3(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Y3(){return Mx(/^Mac/)}function G3(){return Mx(/^iPhone/)}function wy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function V3(){return Mx(/^iPad/)||Y3()&&navigator.maxTouchPoints>1}function UN(){return G3()||V3()}function Mx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const X3=24,Q3=typeof window<"u"?h.useLayoutEffect:h.useEffect;function jy(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const Om=typeof document<"u"&&window.visualViewport;function Ny(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function HN(e){for(Ny(e)&&(e=e.parentElement);e&&!Ny(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Z3=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let qc=0,Em;function J3(e={}){let{isDisabled:t}=e;Q3(()=>{if(!t)return qc++,qc===1&&UN()&&(Em=eI()),()=>{qc--,qc===0&&(Em==null||Em())}},[t])}function eI(){let e,t=0,r=f=>{e=HN(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,p=e.scrollTop,x=e.scrollHeight-e.clientHeight;x!==0&&((p<=0&&m>t||p>=x&&m<t)&&f.preventDefault(),t=m)},a=f=>{let m=f.target;Ih(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;Ih(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",Om&&(Om.height<window.innerHeight?requestAnimationFrame(()=>{ky(m)}):Om.addEventListener("resize",()=>ky(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=jy(tI(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=jy(rl(document,"touchstart",r,{passive:!1,capture:!0}),rl(document,"touchmove",n,{passive:!1,capture:!0}),rl(document,"touchend",a,{passive:!1,capture:!0}),rl(document,"focus",i,!0),rl(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function tI(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function rl(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function ky(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=HN(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,a=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=r.getBoundingClientRect().bottom+X3;i>o&&(r.scrollTop+=a-n)}e=r.parentElement}}function Ih(e){return e instanceof HTMLInputElement&&!Z3.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function rI(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function nI(...e){return t=>e.forEach(r=>rI(r,t))}function KN(...e){return h.useCallback(nI(...e),e)}const YN=new WeakMap;function qt(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([a,i])=>{if(a.startsWith("--")){e.style.setProperty(a,i);return}n[a]=e.style[a],e.style[a]=i}),!r&&YN.set(e,n)}function sI(e,t){if(!e||!(e instanceof HTMLElement))return;let r=YN.get(e);r&&(e.style[t]=r[t])}const Lt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Wc(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let a=n.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[Lt(t)?13:12]):(a=n.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[Lt(t)?5:4]):null)}function aI(e){return 8*(Math.log(e+1)-2)}function Am(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function iI(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const Nt={DURATION:.5,EASE:[.32,.72,0,1]},GN=.4,oI=.25,lI=100,VN=8,Wa=16,Rh=26,Dm="vaul-dragging";function XN(e){const t=U.useRef(e);return U.useEffect(()=>{t.current=e}),U.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function cI({defaultProp:e,onChange:t}){const r=U.useState(e),[n]=r,a=U.useRef(n),i=XN(t);return U.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}function QN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=cI({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=XN(r),c=U.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&l(f)}else a(d)},[i,e,a,l]);return[o,c]}function dI({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:a,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=QN({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,p]=U.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);U.useEffect(()=>{function C(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const x=U.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),g=U.useMemo(()=>{var C;return(C=r==null?void 0:r.findIndex(P=>P===u))!=null?C:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=U.useMemo(()=>{const C=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var P;return(P=r==null?void 0:r.map(S=>{const _=typeof S=="string";let M=0;if(_&&(M=parseInt(S,10)),Lt(l)){const A=_?M:m?S*C.height:0;return m?l==="bottom"?C.height-A:-C.height+A:A}const E=_?M:m?S*C.width:0;return m?l==="right"?C.width-E:-C.width+E:E}))!=null?P:[]},[r,m,c]),b=U.useMemo(()=>g!==null?y==null?void 0:y[g]:null,[y,g]),N=U.useCallback(C=>{var P;const S=(P=y==null?void 0:y.findIndex(_=>_===C))!=null?P:null;o(S),qt(n.current,{transition:`transform ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,transform:Lt(l)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`}),y&&S!==y.length-1&&i!==void 0&&S!==i&&S<i?qt(a.current,{transition:`opacity ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,opacity:"0"}):qt(a.current,{transition:`opacity ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(S,0)])},[n.current,r,y,i,a,f]);U.useEffect(()=>{if(u||e){var C;const P=(C=r==null?void 0:r.findIndex(S=>S===e||S===u))!=null?C:-1;y&&P!==-1&&typeof y[P]=="number"&&N(y[P])}},[u,e,r,y,N]);function w({draggedDistance:C,closeDrawer:P,velocity:S,dismissible:_}){if(i===void 0)return;const M=l==="bottom"||l==="right"?(b??0)-C:(b??0)+C,E=g===i-1,A=g===0,D=C>0;if(E&&qt(a.current,{transition:`opacity ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`}),!d&&S>2&&!D){_?P():N(y[0]);return}if(!d&&S>2&&D&&y&&r){N(y[r.length-1]);return}const Z=y==null?void 0:y.reduce((q,te)=>typeof q!="number"||typeof te!="number"?q:Math.abs(te-M)<Math.abs(q-M)?te:q),Q=Lt(l)?window.innerHeight:window.innerWidth;if(S>GN&&Math.abs(C)<Q*.4){const q=D?1:-1;if(q>0&&x&&r){N(y[r.length-1]);return}if(A&&q<0&&_&&P(),g===null)return;N(y[g+q]);return}N(Z)}function k({draggedDistance:C}){if(b===null)return;const P=l==="bottom"||l==="right"?b-C:b+C;(l==="bottom"||l==="right")&&P<y[y.length-1]||(l==="top"||l==="left")&&P>y[y.length-1]||qt(n.current,{transform:Lt(l)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`})}function j(C,P){if(!r||typeof g!="number"||!y||i===void 0)return null;const S=g===i-1;if(g>=i&&P)return 0;if(S&&!P)return 1;if(!v&&!S)return null;const M=S?g+1:g-1,E=S?y[M]-y[M-1]:y[M+1]-y[M],A=C/Math.abs(E);return S?1-A:A}return{isLastSnapPoint:x,activeSnapPoint:u,shouldFade:v,getPercentageDragged:j,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:w,onDrag:k,snapPointsOffset:y}}const uI=()=>()=>{};function fI(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:a}=uc(),i=U.useRef(null),o=h.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-Rh)/window.innerWidth}U.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;iI(n&&!a?Am(document.body,{background:"black"}):uI,Am(c,{transformOrigin:Lt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Nt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Nt.EASE.join(",")})`}));const d=Am(c,{borderRadius:`${VN}px`,overflow:"hidden",...Lt(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")},Nt.DURATION*1e3)}}},[t,r,o])}let nl=null;function mI({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:a,noBodyStyles:i}){const[o,l]=U.useState(()=>typeof window<"u"?window.location.href:""),c=U.useRef(0),d=U.useCallback(()=>{if(wy()&&nl===null&&e&&!i){nl={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 p=m-window.innerHeight;p&&c.current>=m&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[e]),u=U.useCallback(()=>{if(wy()&&nl!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,nl),window.requestAnimationFrame(()=>{if(a&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),nl=null}},[o]);return U.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),U.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),U.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 hI({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:a,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=oI,scrollLockTimeout:d=lI,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:x,fixed:g,modal:v=!0,onClose:y,nested:b,noBodyStyles:N=!1,direction:w="bottom",defaultOpen:k=!1,disablePreventScroll:j=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:P=!1,repositionInputs:S=!0,onAnimationEnd:_,container:M,autoFocus:E=!1}){var A,D;const[Z=!1,Q]=QN({defaultProp:k,prop:e,onChange:Oe=>{t==null||t(Oe),!Oe&&!b&&Ze(),setTimeout(()=>{_==null||_(Oe)},Nt.DURATION*1e3),Oe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Oe||(document.body.style.pointerEvents="auto")}}),[q,te]=U.useState(!1),[ne,I]=U.useState(!1),[O,L]=U.useState(!1),H=U.useRef(null),R=U.useRef(null),Y=U.useRef(null),F=U.useRef(null),T=U.useRef(null),G=U.useRef(!1),z=U.useRef(null),se=U.useRef(0),W=U.useRef(!1),X=U.useRef(!k),ie=U.useRef(0),V=U.useRef(null),J=U.useRef(((A=V.current)==null?void 0:A.getBoundingClientRect().height)||0),ue=U.useRef(((D=V.current)==null?void 0:D.getBoundingClientRect().width)||0),de=U.useRef(0),ee=U.useCallback(Oe=>{i&&Oe===Je.length-1&&(R.current=new Date)},[]),{activeSnapPoint:ge,activeSnapPointIndex:be,setActiveSnapPoint:qe,onRelease:Ge,snapPointsOffset:Je,onDrag:rt,shouldFade:mt,getPercentageDragged:He}=dI({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:x,drawerRef:V,fadeFromIndex:m,overlayRef:H,onSnapPointChange:ee,direction:w,container:M,snapToSequentialPoint:C});J3({isDisabled:!Z||ne||!v||O||!q||!S||!j});const{restorePositionSetting:Ze}=mI({isOpen:Z,modal:v,nested:b??!1,hasBeenOpened:q,preventScrollRestoration:P,noBodyStyles:N});function nr(){return(window.innerWidth-Rh)/window.innerWidth}function Lr(Oe){var ve,Ne;!u&&!i||V.current&&!V.current.contains(Oe.target)||(J.current=((ve=V.current)==null?void 0:ve.getBoundingClientRect().height)||0,ue.current=((Ne=V.current)==null?void 0:Ne.getBoundingClientRect().width)||0,I(!0),Y.current=new Date,UN()&&window.addEventListener("touchend",()=>G.current=!1,{once:!0}),Oe.target.setPointerCapture(Oe.pointerId),se.current=Lt(w)?Oe.pageY:Oe.pageX)}function sr(Oe,ve){var Ne;let pe=Oe;const we=(Ne=window.getSelection())==null?void 0:Ne.toString(),Xe=V.current?Wc(V.current,w):null,fe=new Date;if(pe.tagName==="SELECT"||pe.hasAttribute("data-vaul-no-drag")||pe.closest("[data-vaul-no-drag]"))return!1;if(w==="right"||w==="left")return!0;if(R.current&&fe.getTime()-R.current.getTime()<500)return!1;if(Xe!==null&&(w==="bottom"?Xe>0:Xe<0))return!0;if(we&&we.length>0)return!1;if(T.current&&fe.getTime()-T.current.getTime()<d&&Xe===0||ve)return T.current=fe,!1;for(;pe;){if(pe.scrollHeight>pe.clientHeight){if(pe.scrollTop!==0)return T.current=new Date,!1;if(pe.getAttribute("role")==="dialog")return!0}pe=pe.parentNode}return!0}function jr(Oe){if(V.current&&ne){const ve=w==="bottom"||w==="right"?1:-1,Ne=(se.current-(Lt(w)?Oe.pageY:Oe.pageX))*ve,pe=Ne>0,we=i&&!u&&!pe;if(we&&be===0)return;const Xe=Math.abs(Ne),fe=document.querySelector("[data-vaul-drawer-wrapper]"),Pe=w==="bottom"||w==="top"?J.current:ue.current;let Ie=Xe/Pe;const jt=He(Xe,pe);if(jt!==null&&(Ie=jt),we&&Ie>=1||!G.current&&!sr(Oe.target,pe))return;if(V.current.classList.add(Dm),G.current=!0,qt(V.current,{transition:"none"}),qt(H.current,{transition:"none"}),i&&rt({draggedDistance:Ne}),pe&&!i){const st=aI(Ne),Nr=Math.min(st*-1,0)*ve;qt(V.current,{transform:Lt(w)?`translate3d(0, ${Nr}px, 0)`:`translate3d(${Nr}px, 0, 0)`});return}const nt=1-Ie;if((mt||m&&be===m-1)&&(n==null||n(Oe,Ie),qt(H.current,{opacity:`${nt}`,transition:"none"},!0)),fe&&H.current&&o){const st=Math.min(nr()+Ie*(1-nr()),1),Nr=8-Ie*8,or=Math.max(0,14-Ie*14);qt(fe,{borderRadius:`${Nr}px`,transform:Lt(w)?`scale(${st}) translate3d(0, ${or}px, 0)`:`scale(${st}) translate3d(${or}px, 0, 0)`,transition:"none"},!0)}if(!i){const st=Xe*ve;qt(V.current,{transform:Lt(w)?`translate3d(0, ${st}px, 0)`:`translate3d(${st}px, 0, 0)`})}}}U.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),U.useEffect(()=>{var Oe;function ve(){if(!V.current||!S)return;const Ne=document.activeElement;if(Ih(Ne)||W.current){var pe;const we=((pe=window.visualViewport)==null?void 0:pe.height)||0,Xe=window.innerHeight;let fe=Xe-we;const Pe=V.current.getBoundingClientRect().height||0,Ie=Pe>Xe*.8;de.current||(de.current=Pe);const jt=V.current.getBoundingClientRect().top;if(Math.abs(ie.current-fe)>60&&(W.current=!W.current),i&&i.length>0&&Je&&be){const nt=Je[be]||0;fe+=nt}if(ie.current=fe,Pe>we||W.current){const nt=V.current.getBoundingClientRect().height;let st=nt;nt>we&&(st=we-(Ie?jt:Rh)),g?V.current.style.height=`${nt-Math.max(fe,0)}px`:V.current.style.height=`${Math.max(st,we-jt)}px`}else K3()||(V.current.style.height=`${de.current}px`);i&&i.length>0&&!W.current?V.current.style.bottom="0px":V.current.style.bottom=`${Math.max(fe,0)}px`}}return(Oe=window.visualViewport)==null||Oe.addEventListener("resize",ve),()=>{var Ne;return(Ne=window.visualViewport)==null?void 0:Ne.removeEventListener("resize",ve)}},[be,i,Je]);function ar(Oe){Bt(),y==null||y(),Oe||Q(!1),setTimeout(()=>{i&&qe(i[0])},Nt.DURATION*1e3)}function wt(){if(!V.current)return;const Oe=document.querySelector("[data-vaul-drawer-wrapper]"),ve=Wc(V.current,w);qt(V.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`}),qt(H.current,{transition:`opacity ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,opacity:"1"}),o&&ve&&ve>0&&Z&&qt(Oe,{borderRadius:`${VN}px`,overflow:"hidden",...Lt(w)?{transform:`scale(${nr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${nr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Nt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Nt.EASE.join(",")})`},!0)}function Bt(){!ne||!V.current||(V.current.classList.remove(Dm),G.current=!1,I(!1),F.current=new Date)}function Gt(Oe){if(!ne||!V.current)return;V.current.classList.remove(Dm),G.current=!1,I(!1),F.current=new Date;const ve=Wc(V.current,w);if(!Oe||!sr(Oe.target,!1)||!ve||Number.isNaN(ve)||Y.current===null)return;const Ne=F.current.getTime()-Y.current.getTime(),pe=se.current-(Lt(w)?Oe.pageY:Oe.pageX),we=Math.abs(pe)/Ne;if(we>.05&&(L(!0),setTimeout(()=>{L(!1)},200)),i){Ge({draggedDistance:pe*(w==="bottom"||w==="right"?1:-1),closeDrawer:ar,velocity:we,dismissible:u}),a==null||a(Oe,!0);return}if(w==="bottom"||w==="right"?pe>0:pe<0){wt(),a==null||a(Oe,!0);return}if(we>GN){ar(),a==null||a(Oe,!1);return}var Xe;const fe=Math.min((Xe=V.current.getBoundingClientRect().height)!=null?Xe:0,window.innerHeight);var Pe;const Ie=Math.min((Pe=V.current.getBoundingClientRect().width)!=null?Pe:0,window.innerWidth),jt=w==="left"||w==="right";if(Math.abs(ve)>=(jt?Ie:fe)*c){ar(),a==null||a(Oe,!1);return}a==null||a(Oe,!0),wt()}U.useEffect(()=>(Z&&(qt(document.documentElement,{scrollBehavior:"auto"}),R.current=new Date),()=>{sI(document.documentElement,"scrollBehavior")}),[Z]);function ir(Oe){const ve=Oe?(window.innerWidth-Wa)/window.innerWidth:1,Ne=Oe?-Wa:0;z.current&&window.clearTimeout(z.current),qt(V.current,{transition:`transform ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,transform:Lt(w)?`scale(${ve}) translate3d(0, ${Ne}px, 0)`:`scale(${ve}) translate3d(${Ne}px, 0, 0)`}),!Oe&&V.current&&(z.current=setTimeout(()=>{const pe=Wc(V.current,w);qt(V.current,{transition:"none",transform:Lt(w)?`translate3d(0, ${pe}px, 0)`:`translate3d(${pe}px, 0, 0)`})},500))}function Vn(Oe,ve){if(ve<0)return;const Ne=(window.innerWidth-Wa)/window.innerWidth,pe=Ne+ve*(1-Ne),we=-Wa+ve*Wa;qt(V.current,{transform:Lt(w)?`scale(${pe}) translate3d(0, ${we}px, 0)`:`scale(${pe}) translate3d(${we}px, 0, 0)`,transition:"none"})}function bs(Oe,ve){const Ne=Lt(w)?window.innerHeight:window.innerWidth,pe=ve?(Ne-Wa)/Ne:1,we=ve?-Wa:0;ve&&qt(V.current,{transition:`transform ${Nt.DURATION}s cubic-bezier(${Nt.EASE.join(",")})`,transform:Lt(w)?`scale(${pe}) translate3d(0, ${we}px, 0)`:`scale(${pe}) translate3d(${we}px, 0, 0)`})}return U.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),U.createElement(ec,{defaultOpen:k,onOpenChange:Oe=>{!u&&!Oe||(Oe?te(!0):ar(!0),Q(Oe))},open:Z},U.createElement(WN.Provider,{value:{activeSnapPoint:ge,snapPoints:i,setActiveSnapPoint:qe,drawerRef:V,overlayRef:H,onOpenChange:t,onPress:Lr,onRelease:Gt,onDrag:jr,dismissible:u,shouldAnimate:X,handleOnly:f,isOpen:Z,isDragging:ne,shouldFade:mt,closeDrawer:ar,onNestedDrag:Vn,onNestedOpenChange:ir,onNestedRelease:bs,keyboardIsOpen:W,modal:v,snapPointsOffset:Je,activeSnapPointIndex:be,direction:w,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:N,container:M,autoFocus:E}},r))}const ZN=U.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:a,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=uc(),d=KN(t,r),u=n&&n.length>0;if(!l)return null;const f=U.useCallback(m=>a(m),[a]);return U.createElement(ki,{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})});ZN.displayName="Drawer.Overlay";const JN=U.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},a){const{drawerRef:i,onPress:o,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,activeSnapPointIndex:f,modal:m,isOpen:p,direction:x,snapPoints:g,container:v,handleOnly:y,shouldAnimate:b,autoFocus:N}=uc(),[w,k]=U.useState(!1),j=KN(a,i),C=U.useRef(null),P=U.useRef(null),S=U.useRef(!1),_=g&&g.length>0;fI();const M=(A,D,Z=0)=>{if(S.current)return!0;const Q=Math.abs(A.y),q=Math.abs(A.x),te=q>Q,ne=["bottom","right"].includes(D)?1:-1;if(D==="left"||D==="right"){if(!(A.x*ne<0)&&q>=0&&q<=Z)return te}else if(!(A.y*ne<0)&&Q>=0&&Q<=Z)return!te;return S.current=!0,!0};U.useEffect(()=>{_&&window.requestAnimationFrame(()=>{k(!0)})},[]);function E(A){C.current=null,S.current=!1,l(A)}return U.createElement(Si,{"data-vaul-drawer-direction":x,"data-vaul-drawer":"","data-vaul-delayed-snap-points":w?"true":"false","data-vaul-snap-points":p&&_?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":b!=null&&b.current?"true":"false",...n,ref:j,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:A=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,A),C.current={x:A.pageX,y:A.pageY},o(A))},onOpenAutoFocus:A=>{r==null||r(A),N||A.preventDefault()},onPointerDownOutside:A=>{if(e==null||e(A),!m||A.defaultPrevented){A.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:A=>{if(!m){A.preventDefault();return}},onPointerMove:A=>{if(P.current=A,y||(n.onPointerMove==null||n.onPointerMove.call(n,A),!C.current))return;const D=A.pageY-C.current.y,Z=A.pageX-C.current.x,Q=A.pointerType==="touch"?10:2;M({x:Z,y:D},x,Q)?c(A):(Math.abs(Z)>Q||Math.abs(D)>Q)&&(C.current=null)},onPointerUp:A=>{n.onPointerUp==null||n.onPointerUp.call(n,A),C.current=null,S.current=!1,l(A)},onPointerOut:A=>{n.onPointerOut==null||n.onPointerOut.call(n,A),E(P.current)},onContextMenu:A=>{n.onContextMenu==null||n.onContextMenu.call(n,A),P.current&&E(P.current)}})});JN.displayName="Drawer.Content";const pI=250,xI=120,gI=U.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:a,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:f,onPress:m,onDrag:p}=uc(),x=U.useRef(null),g=U.useRef(!1);function v(){if(g.current){N();return}window.setTimeout(()=>{y()},xI)}function y(){if(i||e||g.current){N();return}if(N(),!o||o.length===0){d||a();return}if(l===o[o.length-1]&&d){a();return}const k=o.findIndex(C=>C===l);if(k===-1)return;const j=o[k+1];c(j)}function b(){x.current=window.setTimeout(()=>{g.current=!0},pI)}function N(){x.current&&window.clearTimeout(x.current),g.current=!1}return U.createElement("div",{onClick:v,onPointerCancel:N,onPointerDown:w=>{u&&m(w),b()},onPointerMove:w=>{u&&p(w)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},U.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});gI.displayName="Drawer.Handle";function vI(e){const t=uc(),{container:r=t.container,...n}=e;return U.createElement(Jl,{container:r,...n})}const ta={Root:hI,Content:JN,Overlay:ZN,Portal:vI,Title:jo,Description:No},Mi=({shouldScaleBackground:e=!1,direction:t="right",...r})=>s.jsx(ta.Root,{shouldScaleBackground:e,direction:t,...r});Mi.displayName="Drawer";const yI=ta.Portal,ek=h.forwardRef(({className:e,...t},r)=>s.jsx(ta.Overlay,{ref:r,className:$("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}));ek.displayName=ta.Overlay.displayName;const Oi=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(yI,{children:[s.jsx(ek,{}),s.jsx(ta.Content,{ref:n,className:$("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})]}));Oi.displayName="DrawerContent";const Ao=({className:e,...t})=>s.jsx("div",{className:$("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 Do=({className:e,...t})=>s.jsx("div",{className:$("flex-1 overflow-y-auto px-6 py-4",e),...t});Do.displayName="DrawerBody";const fc=({className:e,...t})=>s.jsx("div",{className:$("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});fc.displayName="DrawerFooter";const To=h.forwardRef(({className:e,...t},r)=>s.jsx(ta.Title,{ref:r,className:$("text-base font-semibold text-foreground",e),...t}));To.displayName=ta.Title.displayName;const bI=h.forwardRef(({className:e,...t},r)=>s.jsx(ta.Description,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));bI.displayName=ta.Description.displayName;const wI=tc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),at=h.forwardRef(({className:e,...t},r)=>s.jsx(l1,{ref:r,className:$(wI(),e),...t}));at.displayName=l1.displayName;const Ox=h.forwardRef(({className:e,...t},r)=>s.jsx("textarea",{className:$("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}));Ox.displayName="Textarea";const Sy=[{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}],Tm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function jI(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function NI({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:a,transform:i,transition:o,isDragging:l}=ex({id:e.key});return s.jsxs("div",{ref:a,style:{transform:tx.Transform.toString(i),transition:o},className:$("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:[s.jsx("span",{...r,...n,className:"text-muted-foreground/50 hover:text-muted-foreground cursor-grab touch-none",children:s.jsx(rN,{className:"h-3 w-3"})}),s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),s.jsx("span",{className:"text-[11px]",children:e.name}),s.jsx("button",{type:"button",onClick:t,className:"ml-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:s.jsx(We,{className:"h-3 w-3"})})]})}const kI=3;function SI({open:e,onClose:t}){var Z;const[r,n]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState(!1),[m,p]=h.useState(Sy),[x,g]=h.useState(""),[v,y]=h.useState(Tm[2]),{workspace:b}=Te(),N=lT(),w=iT(r,{enabled:e}),k=oT(a,{enabled:e});h.useEffect(()=>{e&&w.data&&!c&&i(w.data)},[e,w.data,c]);const j=k.available===!1||N.isError&&((Z=N.error)==null?void 0:Z.status)===409,C=a.trim().length>=kI&&/^[A-Z0-9]+$/i.test(a.trim()),P=k1(Zp(S1,{activationConstraint:{distance:5}})),S=Q=>{n(Q)},_=()=>{r.trim()&&!c&&w.flush()},M=()=>{n(""),i(""),l(""),d(!1),f(!1),p(Sy),g(""),y(Tm[2]),N.reset(),t()},E=()=>{if(!x.trim())return;const Q=jI(x.trim());if(m.some(q=>q.key===Q)){B.error("A status with this name already exists");return}p(q=>[...q,{name:x.trim(),key:Q,color:v,category:"started",position:q.length}]),g("")},A=Q=>{const{active:q,over:te}=Q;!te||q.id===te.id||p(ne=>{const I=ne.findIndex(L=>L.key===q.id),O=ne.findIndex(L=>L.key===te.id);return yd(ne,I,O).map((L,H)=>({...L,position:H}))})},D=Q=>{Q.preventDefault(),!(!r.trim()||!a.trim()||!C||j)&&N.mutate({name:r.trim(),identifier:a.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:b.id,initial_statuses:m},{onSuccess:()=>{B.success("Project created"),M()},onError:q=>{(q==null?void 0:q.status)===409?B.error("This project key is already in use."):B.error(q.message??"Failed to create project")}})};return s.jsx(Mi,{open:e,onOpenChange:Q=>!Q&&M(),dismissible:!1,children:s.jsxs(Oi,{className:"max-w-md",children:[s.jsx(Ao,{children:s.jsx(To,{children:"New project"})}),s.jsxs("form",{onSubmit:D,className:"flex flex-col flex-1 overflow-hidden",children:[s.jsxs(Do,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{htmlFor:"project-name",children:"Name"}),s.jsx(_e,{id:"project-name",placeholder:"My Project",value:r,onChange:Q=>S(Q.target.value),onBlur:_,autoFocus:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Project key below will auto-fill when you finish typing; you can change it."})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{htmlFor:"project-id",children:["Identifier",s.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Used as issue prefix (e.g. PROJ-1)"})]}),s.jsx(_e,{id:"project-id",placeholder:"PROJ",value:a,onChange:Q=>{i(Q.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:$("font-mono",j&&"border-destructive"),"aria-invalid":j}),j&&s.jsx("p",{className:"text-xs text-destructive",children:"This project key is already in use."})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{htmlFor:"project-desc",children:["Description",s.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsx(Ox,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:Q=>l(Q.target.value),className:"min-h-[80px]"})]}),s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[s.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:s.jsxs("span",{className:"flex items-center gap-1.5",children:[u?s.jsx(Zs,{className:"h-3.5 w-3.5"}):s.jsx(pr,{className:"h-3.5 w-3.5"}),"Statuses",s.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",m.length,")"]})]})}),u&&s.jsxs("div",{className:"px-3 pb-3 border-t border-border space-y-3 pt-3",children:[s.jsx(Cl,{sensors:P,onDragEnd:A,children:s.jsx(Jp,{items:m.map(Q=>Q.key),strategy:C1,children:s.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(Q=>s.jsx(NI,{chip:Q,onRemove:()=>p(q=>q.filter(te=>te.key!==Q.key).map((te,ne)=>({...te,position:ne})))},Q.key))})})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:Tm.map(Q=>s.jsx("button",{type:"button",onClick:()=>y(Q),className:$("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===Q?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:Q}},Q))}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[s.jsx(_e,{placeholder:"Status name…",value:x,onChange:Q=>g(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),E())},className:"h-7 text-xs flex-1"}),s.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:E,disabled:!x.trim(),children:s.jsx(ot,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),s.jsxs(fc,{children:[s.jsx(re,{type:"button",variant:"ghost",onClick:M,children:"Cancel"}),s.jsx(re,{type:"submit",disabled:!r.trim()||!a.trim()||!C||j||N.isPending,children:N.isPending?"Creating...":"Create project"})]})]})]})})}const Dt=vE,Tt=yE,Ct=h.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},a)=>s.jsx(gE,{children:s.jsx(c1,{ref:a,align:t,sideOffset:r,className:$("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})}));Ct.displayName=c1.displayName;function Is({options:e,selected:t,onSelectionChange:r,placeholder:n="Select…",className:a}){var d;const[i,o]=h.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 s.jsxs(Dt,{open:i,onOpenChange:o,children:[s.jsx(Tt,{asChild:!0,children:s.jsxs(re,{variant:"outline",role:"combobox","aria-expanded":i,className:$("h-8 justify-between text-xs font-normal min-w-36",!c&&"text-muted-foreground",a),children:[s.jsx("span",{className:"truncate",children:c??n}),s.jsx(_o,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),s.jsxs(Ct,{className:"w-56 p-0",align:"start",children:[s.jsxs(va,{children:[s.jsx(oc,{placeholder:"Search…",className:"h-8 text-xs"}),s.jsxs(ya,{children:[s.jsx(lc,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),s.jsx(Ts,{children:e.map(u=>s.jsxs(sn,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[s.jsx(At,{className:$("mr-2 h-3.5 w-3.5",t.includes(u.value)?"opacity-100":"opacity-0")}),u.label]},u.value))})]})]}),t.length>0&&s.jsx("div",{className:"border-t p-2",children:s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[s.jsx(We,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function CI({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:a}=Te(),i=(a==null?void 0:a.id)??"",{data:o,isLoading:l}=Kn(r),{data:c}=Nx(r),{data:d}=Po(i),{data:u}=Vu(i),f=NN(r),m=kN(r),p=SN(r),x=CN(r),g=_N(r),v=(c==null?void 0:c.requests)??[],[y,b]=h.useState([]),[N,w]=h.useState([]),k=new Set((o==null?void 0:o.members.map(S=>S.user_id))??[]),j=new Set((o==null?void 0:o.teams.map(S=>S.team_id))??[]),C=(d??[]).filter(S=>!k.has(S.user_id)),P=(u??[]).filter(S=>!j.has(S.id));return s.jsx(hn,{open:e,onOpenChange:S=>!S&&t(),children:s.jsxs(Qr,{className:"sm:max-w-[480px]",children:[s.jsx(pn,{children:s.jsxs(xn,{className:"flex items-center gap-2",children:["Access — ",n,v.length>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:v.length})]})}),s.jsxs("div",{className:"space-y-5 pt-1",children:[v.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Requests"}),s.jsx("div",{className:"space-y-1",children:v.map(S=>{var A,D,Z;const _=S.user,M=_?`${_.first_name??""} ${_.last_name??""}`.trim()||_.email:"Unknown",E=(((A=_==null?void 0:_.first_name)==null?void 0:A[0])??((D=_==null?void 0:_.last_name)==null?void 0:D[0])??((Z=_==null?void 0:_.email)==null?void 0:Z[0])??"U").toUpperCase();return s.jsxs("div",{className:"flex items-center gap-2.5 py-1",children:[s.jsx(_t,{className:"h-7 w-7 shrink-0",children:s.jsx(Pt,{className:"text-[11px] font-medium",children:E})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm truncate",children:M}),S.message&&s.jsx("p",{className:"text-xs text-muted-foreground italic truncate",children:S.message})]}),s.jsx("button",{className:"h-6 px-2 text-xs rounded border border-border hover:bg-muted text-muted-foreground shrink-0",onClick:()=>g.mutate({requestId:S.id,action:"deny"},{onSuccess:()=>B.success("Request denied"),onError:()=>B.error("Failed")}),children:"Deny"}),s.jsxs("button",{className:"h-6 px-2 text-xs rounded bg-foreground text-background hover:opacity-90 shrink-0 flex items-center gap-1",onClick:()=>g.mutate({requestId:S.id,action:"approve"},{onSuccess:()=>B.success("Access granted"),onError:()=>B.error("Failed")}),children:[s.jsx(At,{className:"h-3 w-3"}),"Approve"]})]},S.id)})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center justify-between mb-2",children:s.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),l?s.jsx("div",{className:"space-y-2",children:[1,2].map(S=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{className:"h-7 w-7 rounded-full"}),s.jsx(le,{className:"h-3.5 w-32"})]},S))}):(o==null?void 0:o.members.length)===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):s.jsx("div",{className:"space-y-1",children:o==null?void 0:o.members.map(S=>{var Z;const _=S.user,M=(_==null?void 0:_.first_name)??"",E=(_==null?void 0:_.last_name)??"",A=`${M} ${E}`.trim()||(_==null?void 0:_.email)||"Unknown",D=(M[0]??E[0]??((Z=_==null?void 0:_.email)==null?void 0:Z[0])??"U").toUpperCase();return s.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[s.jsx(_t,{className:"h-7 w-7 shrink-0",children:s.jsx(Pt,{className:"text-[11px] font-medium",children:D})}),s.jsx("span",{className:"flex-1 text-sm truncate",children:A}),s.jsx("span",{className:$("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",S.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:S.role}),s.jsx("button",{onClick:()=>m.mutate(S.user_id,{onSuccess:()=>B.success("Access removed"),onError:()=>B.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]},S.id)})}),C.length>0&&s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(ln,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx(Is,{options:C.map(S=>{const _=S.user,M=(_==null?void 0:_.first_name)??"",E=(_==null?void 0:_.last_name)??"";return{value:S.user_id,label:`${M} ${E}`.trim()||(_==null?void 0:_.email)||"Unknown"}}),selected:y,onSelectionChange:b,placeholder:"Add people…",className:"flex-1"}),y.length>0&&s.jsx(re,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:f.isPending,onClick:()=>f.mutate({userIds:y},{onSuccess:S=>{B.success(`${S.added} member${S.added===1?"":"s"} added`),b([])},onError:()=>B.error("Failed to grant access")}),children:y.length===1?"Add":`Add ${y.length} members`})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center justify-between mb-2",children:s.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),l?s.jsx("div",{className:"space-y-2",children:[1].map(S=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{className:"h-7 w-7 rounded-lg"}),s.jsx(le,{className:"h-3.5 w-28"})]},S))}):(o==null?void 0:o.teams.length)===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):s.jsx("div",{className:"space-y-1",children:o==null?void 0:o.teams.map(S=>{const _=S.team;return s.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[s.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ea,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsx("span",{className:"flex-1 text-sm truncate",children:(_==null?void 0:_.name)??"Unknown team"}),_&&s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[_.member_count," ",_.member_count===1?"member":"members"]}),s.jsx("button",{onClick:()=>x.mutate(S.team_id,{onSuccess:()=>B.success("Team access removed"),onError:()=>B.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]},S.id)})}),P.length>0&&s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx(Ea,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx(Is,{options:P.map(S=>({value:S.id,label:S.name})),selected:N,onSelectionChange:w,placeholder:"Add teams…",className:"flex-1"}),N.length>0&&s.jsx(re,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:p.isPending,onClick:()=>p.mutate(N,{onSuccess:S=>{B.success(`${S.added} team${S.added===1?"":"s"} added`),w([])},onError:()=>B.error("Failed to add teams")}),children:N.length===1?"Add":`Add ${N.length} teams`})]})]}),s.jsx("div",{className:"flex justify-end pt-1",children:s.jsx(re,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const Be=SE,Ve=CE,ze=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(d1,{ref:n,className:$("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,s.jsx(bE,{asChild:!0,children:s.jsx(Zs,{className:"h-4 w-4 opacity-50"})})]}));ze.displayName=d1.displayName;const tk=h.forwardRef(({className:e,...t},r)=>s.jsx(u1,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ox,{className:"h-4 w-4"})}));tk.displayName=u1.displayName;const rk=h.forwardRef(({className:e,...t},r)=>s.jsx(f1,{ref:r,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Zs,{className:"h-4 w-4"})}));rk.displayName=f1.displayName;const Fe=h.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>s.jsx(wE,{children:s.jsxs(m1,{ref:a,className:$("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:[s.jsx(tk,{}),s.jsx(jE,{className:$("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(rk,{})]})}));Fe.displayName=m1.displayName;const _I=h.forwardRef(({className:e,...t},r)=>s.jsx(h1,{ref:r,className:$("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));_I.displayName=h1.displayName;const ke=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(p1,{ref:n,className:$("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:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(NE,{children:s.jsx(At,{className:"h-4 w-4"})})}),s.jsx(kE,{children:t})]}));ke.displayName=p1.displayName;const PI=h.forwardRef(({className:e,...t},r)=>s.jsx(x1,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));PI.displayName=x1.displayName;function MI(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return s.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,OI(a,...t)]}function OI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function EI(e){const t=AI(e),r=h.forwardRef((n,a)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(TI);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return s.jsx(t,{...o,ref:a,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function AI(e){const t=h.forwardRef((r,n)=>{const{children:a,...i}=r;if(h.isValidElement(a)){const o=RI(a),l=II(i,a.props);return a.type!==h.Fragment&&(l.ref=n?Qp(n,o):o),h.cloneElement(a,l)}return h.Children.count(a)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DI=Symbol("radix.slottable");function TI(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DI}function II(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function RI(e){var n,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var $I=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ex=$I.reduce((e,t)=>{const r=EI(`Primitive.${t}`),n=h.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),of="Checkbox",[LI]=MI(of),[zI,Ax]=LI(of);function FI(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:f}=e,[m,p]=g1({prop:r,defaultProp:a??!1,onChange:c,caller:of}),[x,g]=h.useState(null),[v,y]=h.useState(null),b=h.useRef(!1),N=x?!!o||!!x.closest("form"):!0,w={checked:m,disabled:i,setChecked:p,control:x,setControl:g,name:l,form:o,value:u,hasConsumerStoppedPropagationRef:b,required:d,defaultChecked:ba(a)?!1:a,isFormControl:N,bubbleInput:v,setBubbleInput:y};return s.jsx(zI,{scope:t,...w,children:BI(f)?f(w):n})}var nk="CheckboxTrigger",sk=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},a)=>{const{control:i,value:o,disabled:l,checked:c,required:d,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:p,bubbleInput:x}=Ax(nk,e),g=ko(a,u),v=h.useRef(c);return h.useEffect(()=>{const y=i==null?void 0:i.form;if(y){const b=()=>f(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[i,f]),s.jsx(Ex.button,{type:"button",role:"checkbox","aria-checked":ba(c)?"mixed":c,"aria-required":d,"data-state":ck(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:g,onKeyDown:Cs(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:Cs(r,y=>{f(b=>ba(b)?!0:!b),x&&p&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});sk.displayName=nk;var Dx=h.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:d,form:u,...f}=e;return s.jsx(FI,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:d,name:n,form:u,value:c,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(sk,{...f,ref:t,__scopeCheckbox:r}),m&&s.jsx(lk,{__scopeCheckbox:r})]})})});Dx.displayName=of;var ak="CheckboxIndicator",ik=h.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=Ax(ak,r);return s.jsx(_E,{present:n||ba(i.checked)||i.checked===!0,children:s.jsx(Ex.span,{"data-state":ck(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});ik.displayName=ak;var ok="CheckboxBubbleInput",lk=h.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:d,value:u,form:f,bubbleInput:m,setBubbleInput:p}=Ax(ok,e),x=ko(r,p),g=v1(i),v=y1(n);h.useEffect(()=>{const b=m;if(!b)return;const N=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(N,"checked").set,j=!a.current;if(g!==i&&k){const C=new Event("click",{bubbles:j});b.indeterminate=ba(i),k.call(b,ba(i)?!1:i),b.dispatchEvent(C)}},[m,g,i,a]);const y=h.useRef(ba(i)?!1:i);return s.jsx(Ex.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:l,disabled:c,name:d,value:u,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});lk.displayName=ok;function BI(e){return typeof e=="function"}function ba(e){return e==="indeterminate"}function ck(e){return ba(e)?"indeterminate":e?"checked":"unchecked"}const dk=h.forwardRef(({className:e,...t},r)=>s.jsx(Dx,{ref:r,className:$("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:s.jsx(ik,{className:$("flex items-center justify-center text-current"),children:s.jsx(At,{className:"h-4 w-4"})})}));dk.displayName=Dx.displayName;function qI({open:e,onClose:t,projectId:r,projectName:n,currentWorkspaceId:a}){const[i,o]=h.useState("workspace"),[l,c]=h.useState(""),[d,u]=h.useState(new Set),{data:f,isLoading:m}=Wn(),{data:p,isLoading:x}=Kn(r),g=mT(r),v=(f??[]).filter(w=>w.id!==a),y=v.find(w=>w.id===l);h.useEffect(()=>{i==="members"&&(p!=null&&p.members)&&u(new Set(p.members.map(w=>w.user_id)))},[i,p==null?void 0:p.members]),h.useEffect(()=>{e||(o("workspace"),c(""),u(new Set))},[e]);const b=w=>{u(k=>{const j=new Set(k);return j.has(w)?j.delete(w):j.add(w),j})},N=()=>{g.mutate({target_workspace_id:l,carry_over_user_ids:[...d]},{onSuccess:()=>{B.success("Project transferred"),t()},onError:w=>{var j,C,P;const k=((P=(C=(j=w==null?void 0:w.response)==null?void 0:j.data)==null?void 0:C.error)==null?void 0:P.message)??(w==null?void 0:w.message)??"Unknown error";B.error(`Transfer failed: ${k}`)}})};return s.jsx(hn,{open:e,onOpenChange:w=>!w&&t(),children:s.jsxs(Qr,{className:"sm:max-w-[480px]",children:[s.jsx(pn,{children:s.jsx(xn,{children:i==="workspace"?`Transfer "${n}"`:"Review Members"})}),i==="workspace"?s.jsxs("div",{className:"space-y-4 pt-1",children:[s.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-amber-200 bg-amber-50 dark:border-amber-800/40 dark:bg-amber-950/20 px-3.5 py-3",children:[s.jsx(uN,{className:"h-4 w-4 text-amber-600 dark:text-amber-500 shrink-0 mt-0.5"}),s.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-400",children:"This will move the project and all its issues to another workspace."})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:"Target workspace"}),m?s.jsx(le,{className:"h-9 w-full"}):v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No other workspaces available."}):s.jsxs(Be,{value:l,onValueChange:c,children:[s.jsx(ze,{className:"w-full",children:s.jsx(Ve,{placeholder:"Select a workspace…"})}),s.jsx(Fe,{children:v.map(w=>s.jsx(ke,{value:w.id,children:w.name},w.id))})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(re,{size:"sm",disabled:!l,onClick:()=>o("members"),children:"Next: Review Members →"})]})]}):s.jsxs("div",{className:"space-y-4 pt-1",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Select who to carry over. Selected members will be added to"," ",s.jsx("span",{className:"font-medium text-foreground",children:y==null?void 0:y.name})," if not already a member."]}),x?s.jsx("div",{className:"space-y-2.5",children:[1,2,3].map(w=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(le,{className:"h-4 w-4 rounded"}),s.jsx(le,{className:"h-7 w-7 rounded-full"}),s.jsx(le,{className:"h-3.5 w-36"})]},w))}):((p==null?void 0:p.members)??[]).length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No project members to review."}):s.jsx("div",{className:"space-y-1 max-h-56 overflow-y-auto pr-1",children:((p==null?void 0:p.members)??[]).map(w=>{var M;const k=w.user,j=(k==null?void 0:k.first_name)??"",C=(k==null?void 0:k.last_name)??"",P=`${j} ${C}`.trim()||(k==null?void 0:k.email)||"Unknown",S=(j[0]??C[0]??((M=k==null?void 0:k.email)==null?void 0:M[0])??"U").toUpperCase(),_=d.has(w.user_id);return s.jsxs("div",{className:"flex items-center gap-2.5 py-1.5 cursor-pointer",onClick:()=>b(w.user_id),children:[s.jsx(dk,{checked:_,onCheckedChange:()=>b(w.user_id),onClick:E=>E.stopPropagation(),className:"shrink-0"}),s.jsx(_t,{className:"h-7 w-7 shrink-0",children:s.jsx(Pt,{className:"text-[11px] font-medium",children:S})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm truncate block",children:P}),(k==null?void 0:k.email)&&s.jsx("span",{className:"text-xs text-muted-foreground truncate block",children:k.email})]}),s.jsx("span",{className:$("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",w.role==="manager"?"bg-indigo-50 text-indigo-700 dark:bg-indigo-950/30 dark:text-indigo-400":"bg-muted text-muted-foreground"),children:w.role})]},w.id)})}),((p==null?void 0:p.teams)??[]).length>0&&s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2.5",children:[s.jsx(Ea,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Project teams will be removed as they belong to the current workspace."})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:()=>o("workspace"),children:"← Back"}),s.jsxs(re,{size:"sm",disabled:g.isPending,onClick:N,children:[s.jsx(Md,{className:"h-4 w-4"}),g.isPending?"Transferring…":"Transfer Project"]})]})]})]})})}const uk=6048e5,WI=864e5,Fre=6e4,UI=36e5,Uc=43200,Cy=1440,_y=Symbol.for("constructDateFrom");function Mt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_y in e?e[_y](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ue(e,t){return Mt(t||e,e)}function Kr(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(t)?Mt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Tx(e,t,r){const n=Ue(e,r==null?void 0:r.in);if(isNaN(t))return Mt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const a=n.getDate(),i=Mt((r==null?void 0:r.in)||e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return a>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),a),n)}let HI={};function Io(){return HI}function so(e,t){var l,c,d,u;const r=Io(),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,a=Ue(e,t==null?void 0:t.in),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Dl(e,t){return so(e,{...t,weekStartsOn:1})}function fk(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),a=Mt(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=Dl(a),o=Mt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=Dl(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function zd(e){const t=Ue(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 vs(e,...t){const r=Mt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function ao(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function lf(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t),i=ao(n),o=ao(a),l=+i-zd(i),c=+o-zd(o);return Math.round((l-c)/WI)}function KI(e,t){const r=fk(e,t),n=Mt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Dl(n)}function YI(e,t,r){return Kr(e,t*7,r)}function GI(e,t,r){return Tx(e,t*12,r)}function VI(e,t){let r,n=t==null?void 0:t.in;return e.forEach(a=>{!n&&typeof a=="object"&&(n=Mt.bind(null,a));const i=Ue(a,n);(!r||r<i||isNaN(+i))&&(r=i)}),Mt(n,r||NaN)}function XI(e,t){let r,n=t==null?void 0:t.in;return e.forEach(a=>{!n&&typeof a=="object"&&(n=Mt.bind(null,a));const i=Ue(a,n);(!r||r>i||isNaN(+i))&&(r=i)}),Mt(n,r||NaN)}function bd(e,t){const r=+Ue(e)-+Ue(t);return r<0?-1:r>0?1:r}function Ix(e){return Mt(e,Date.now())}function io(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t);return+ao(n)==+ao(a)}function mk(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function QI(e){return!(!mk(e)&&typeof e!="number"||isNaN(+Ue(e)))}function Rx(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t),i=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return i*12+o}function hk(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t),i=Py(n,a),o=Math.abs(lf(n,a));n.setDate(n.getDate()-i*o);const l=+(Py(n,a)===-i),c=i*(o-l);return c===0?0:c}function Py(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 pk(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function ZI(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t),i=(+n-+a)/UI;return pk(r==null?void 0:r.roundingMethod)(i)}function JI(e,t){return+Ue(e)-+Ue(t)}function xk(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function $x(e,t){const r=Ue(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 e4(e,t){const r=Ue(e,t==null?void 0:t.in);return+xk(r,t)==+$x(r,t)}function gk(e,t,r){const[n,a,i]=vs(r==null?void 0:r.in,e,e,t),o=bd(a,i),l=Math.abs(Rx(a,i));if(l<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-o*l);let c=bd(a,i)===-o;e4(n)&&l===1&&bd(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function t4(e,t,r){const n=JI(e,t)/1e3;return pk(r==null?void 0:r.roundingMethod)(n)}function vk(e,t){const[r,n]=vs(e,t.start,t.end);return{start:r,end:n}}function r4(e,t){const{start:r,end:n}=vk(t==null?void 0:t.in,e);let a=+r>+n;const i=a?+r:+n,o=a?n:r;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Mt(r,o)),o.setMonth(o.getMonth()+l);return a?c.reverse():c}function yk(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function n4(e,t){const r=Ue(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 bk(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function s4(e,t){const{start:r,end:n}=vk(t==null?void 0:t.in,e);let a=+r>+n;const i=a?+r:+n,o=a?n:r;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Mt(r,o)),o.setFullYear(o.getFullYear()+l);return a?c.reverse():c}function wk(e,t){var l,c,d,u;const r=Io(),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,a=Ue(e,t==null?void 0:t.in),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function a4(e,t){return wk(e,{...t,weekStartsOn:1})}const i4={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"}},o4=(e,t,r)=>{let n;const a=i4[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Im(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const l4={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},c4={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},d4={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},u4={date:Im({formats:l4,defaultWidth:"full"}),time:Im({formats:c4,defaultWidth:"full"}),dateTime:Im({formats:d4,defaultWidth:"full"})},f4={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},m4=(e,t,r,n)=>f4[e];function sl(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const h4={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},p4={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},x4={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"]},g4={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"]},v4={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"}},y4={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"}},b4=(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"},w4={ordinalNumber:b4,era:sl({values:h4,defaultWidth:"wide"}),quarter:sl({values:p4,defaultWidth:"wide",argumentCallback:e=>e-1}),month:sl({values:x4,defaultWidth:"wide"}),day:sl({values:g4,defaultWidth:"wide"}),dayPeriod:sl({values:v4,defaultWidth:"wide",formattingValues:y4,defaultFormattingWidth:"wide"})};function al(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?N4(l,f=>f.test(o)):j4(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 j4(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function N4(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function k4(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=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(a.length);return{value:o,rest:l}}}const S4=/^(\d+)(th|st|nd|rd)?/i,C4=/\d+/i,_4={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},P4={any:[/^b/i,/^(a|c)/i]},M4={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},O4={any:[/1/i,/2/i,/3/i,/4/i]},E4={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},A4={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]},D4={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},T4={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]},I4={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},R4={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}},$4={ordinalNumber:k4({matchPattern:S4,parsePattern:C4,valueCallback:e=>parseInt(e,10)}),era:al({matchPatterns:_4,defaultMatchWidth:"wide",parsePatterns:P4,defaultParseWidth:"any"}),quarter:al({matchPatterns:M4,defaultMatchWidth:"wide",parsePatterns:O4,defaultParseWidth:"any",valueCallback:e=>e+1}),month:al({matchPatterns:E4,defaultMatchWidth:"wide",parsePatterns:A4,defaultParseWidth:"any"}),day:al({matchPatterns:D4,defaultMatchWidth:"wide",parsePatterns:T4,defaultParseWidth:"any"}),dayPeriod:al({matchPatterns:I4,defaultMatchWidth:"any",parsePatterns:R4,defaultParseWidth:"any"})},Ja={code:"en-US",formatDistance:o4,formatLong:u4,formatRelative:m4,localize:w4,match:$4,options:{weekStartsOn:0,firstWeekContainsDate:1}};function L4(e,t){const r=Ue(e,t==null?void 0:t.in);return lf(r,bk(r))+1}function Lx(e,t){const r=Ue(e,t==null?void 0:t.in),n=+Dl(r)-+KI(r);return Math.round(n/uk)+1}function jk(e,t){var u,f,m,p;const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),a=Io(),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)??a.firstWeekContainsDate??((p=(m=a.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=Mt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=so(o,t),c=Mt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=so(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function z4(e,t){var l,c,d,u;const r=Io(),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,a=jk(e,t),i=Mt((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),so(i,t)}function zx(e,t){const r=Ue(e,t==null?void 0:t.in),n=+so(r,t)-+z4(r,t);return Math.round(n/uk)+1}function et(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const ma={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return et(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):et(r+1,2)},d(e,t){return et(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 et(e.getHours()%12||12,t.length)},H(e,t){return et(e.getHours(),t.length)},m(e,t){return et(e.getMinutes(),t.length)},s(e,t){return et(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return et(a,t.length)}},$i={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},My={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(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return ma.y(e,t)},Y:function(e,t,r,n){const a=jk(e,n),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return et(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):et(i,t.length)},R:function(e,t){const r=fk(e);return et(r,t.length)},u:function(e,t){const r=e.getFullYear();return et(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 et(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 et(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 ma.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 et(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 a=zx(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):et(a,t.length)},I:function(e,t,r){const n=Lx(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):et(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):ma.d(e,t)},D:function(e,t,r){const n=L4(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):et(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 a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return et(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return et(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return et(a,t.length);case"io":return r.ordinalNumber(a,{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 a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=$i.noon:n===0?a=$i.midnight:a=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=$i.evening:n>=12?a=$i.afternoon:n>=4?a=$i.morning:a=$i.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{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 ma.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):ma.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):et(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):et(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):ma.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):ma.s(e,t)},S:function(e,t){return ma.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Ey(n);case"XXXX":case"XX":return Ga(n);case"XXXXX":case"XXX":default:return Ga(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Ey(n);case"xxxx":case"xx":return Ga(n);case"xxxxx":case"xxx":default:return Ga(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Oy(n,":");case"OOOO":default:return"GMT"+Ga(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Oy(n,":");case"zzzz":default:return"GMT"+Ga(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return et(n,t.length)},T:function(e,t,r){return et(+e,t.length)}};function Oy(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+et(i,2)}function Ey(e,t){return e%60===0?(e>0?"-":"+")+et(Math.abs(e)/60,2):Ga(e,t)}function Ga(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=et(Math.trunc(n/60),2),i=et(n%60,2);return r+a+t+i}const Ay=(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"})}},Nk=(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"})}},F4=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return Ay(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}}",Ay(n,t)).replace("{{time}}",Nk(a,t))},B4={p:Nk,P:F4},q4=/^D+$/,W4=/^Y+$/,U4=["D","DD","YY","YYYY"];function H4(e){return q4.test(e)}function K4(e){return W4.test(e)}function Y4(e,t,r){const n=G4(e,t,r);if(console.warn(n),U4.includes(e))throw new RangeError(n)}function G4(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 V4=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,X4=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Q4=/^'([^]*?)'?$/,Z4=/''/g,J4=/[a-zA-Z]/;function me(e,t,r){var u,f,m,p,x,g,v,y;const n=Io(),a=(r==null?void 0:r.locale)??n.locale??Ja,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??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=Ue(e,r==null?void 0:r.in);if(!QI(l))throw new RangeError("Invalid time value");let c=t.match(X4).map(b=>{const N=b[0];if(N==="p"||N==="P"){const w=B4[N];return w(b,a.formatLong)}return b}).join("").match(V4).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const N=b[0];if(N==="'")return{isToken:!1,value:eR(b)};if(My[N])return{isToken:!0,value:b};if(N.match(J4))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(b=>{if(!b.isToken)return b.value;const N=b.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&K4(N)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&H4(N))&&Y4(N,t,String(e));const w=My[N[0]];return w(l,N,a.localize,d)}).join("")}function eR(e){const t=e.match(Q4);return t?t[1].replace(Z4,"'"):e}function $h(e,t,r){const n=Io(),a=(r==null?void 0:r.locale)??n.locale??Ja,i=2520,o=bd(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]=vs(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=t4(d,c),f=(zd(d)-zd(c))/1e3,m=Math.round((u-f)/60);let p;if(m<2)return r!=null&&r.includeSeconds?u<5?a.formatDistance("lessThanXSeconds",5,l):u<10?a.formatDistance("lessThanXSeconds",10,l):u<20?a.formatDistance("lessThanXSeconds",20,l):u<40?a.formatDistance("halfAMinute",0,l):u<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):m===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",m,l);if(m<45)return a.formatDistance("xMinutes",m,l);if(m<90)return a.formatDistance("aboutXHours",1,l);if(m<Cy){const x=Math.round(m/60);return a.formatDistance("aboutXHours",x,l)}else{if(m<i)return a.formatDistance("xDays",1,l);if(m<Uc){const x=Math.round(m/Cy);return a.formatDistance("xDays",x,l)}else if(m<Uc*2)return p=Math.round(m/Uc),a.formatDistance("aboutXMonths",p,l)}if(p=gk(d,c),p<12){const x=Math.round(m/Uc);return a.formatDistance("xMonths",x,l)}else{const x=p%12,g=Math.trunc(p/12);return x<3?a.formatDistance("aboutXYears",g,l):x<9?a.formatDistance("overXYears",g,l):a.formatDistance("almostXYears",g+1,l)}}function tR(e,t){return $h(e,Ix(e),t)}function _l(e,t){return Ue(e,t==null?void 0:t.in).getDate()}function rR(e,t){return Ue(e,t==null?void 0:t.in).getDay()}function Ta(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),a=r.getMonth(),i=Mt(r,0);return i.setFullYear(n,a+1,0),i.setHours(0,0,0,0),i.getDate()}function wd(e,t){return Ue(e,t==null?void 0:t.in).getMonth()}function nR(e,t){return Ue(e,t==null?void 0:t.in).getFullYear()}function sR(e,t){return+Ue(e)>+Ue(t)}function aR(e,t){return+Ue(e)<+Ue(t)}function iR(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function oR(e,t,r){const[n,a]=vs(r==null?void 0:r.in,e,t);return n.getFullYear()===a.getFullYear()}function lR(e,t){return io(Mt(e,e),Ix(e))}function kk(e,t,r){return Kr(e,-t,r)}function cR(e,t){return io(Mt(e,e),kk(Ix(e),1))}function dR(e,t,r){const n=Ue(e,r==null?void 0:r.in),a=n.getFullYear(),i=n.getDate(),o=Mt(e,0);o.setFullYear(a,t,15),o.setHours(0,0,0,0);const l=Ta(o);return n.setMonth(t,Math.min(i,l)),n}function uR(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(+n)?Mt(e,NaN):(n.setFullYear(t),n)}function fR(){const[e,t]=h.useState(!1),[r,n]=h.useState(null),[a,i]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState(""),[u,f]=h.useState(new Set),[m,p]=h.useState(""),[x,g]=h.useState("all"),{workspace:v}=It(),{data:y,isLoading:b}=sc(),{data:N}=Wn(),w=cT(),k=BT(),j=qT(),C=ft(),P=N==null?void 0:N.find(M=>M.slug===v),S=M=>M.has_pending_request||u.has(M.id),_=(y??[]).filter(M=>(x==="all"||M.status===x)&&(!m||M.name.toLowerCase().includes(m.toLowerCase())||M.identifier.toLowerCase().includes(m.toLowerCase())));return s.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[s.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),s.jsxs(re,{size:"sm",onClick:()=>t(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"Create"]})]}),s.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 md:py-4 border-b border-border md:flex-row md:items-center md:justify-between",children:[s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-none",children:["all","active","paused","archived"].map(M=>s.jsx("button",{onClick:()=>g(M),className:$("px-3 h-7 rounded-md text-xs font-medium transition-colors whitespace-nowrap shrink-0",x===M?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:M==="all"?"All":M.charAt(0).toUpperCase()+M.slice(1)},M))}),s.jsxs("div",{className:"relative",children:[s.jsx(Ra,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search...",value:m,onChange:M=>p(M.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),s.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-2.5 border-b border-border",children:[s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Identifier"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Created"}),s.jsx("span",{})]}),b?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(M=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[s.jsx(le,{className:"h-4 w-48"}),s.jsx(le,{className:"h-4 w-12"}),s.jsx(le,{className:"h-5 w-16 rounded-full"}),s.jsx(le,{className:"h-4 w-24"}),s.jsx("div",{})]},`d-${M}`),s.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3",children:[s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-4 w-40"}),s.jsx(le,{className:"h-3 w-24"})]}),s.jsx(le,{className:"h-6 w-6 rounded-full"})]},`m-${M}`)]}))}):_.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(Yr,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:m||x!=="all"?"No projects match":"No projects yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:m||x!=="all"?"Try adjusting your filters.":"Create your first project to get started."}),!m&&x==="all"&&s.jsxs(re,{size:"sm",onClick:()=>t(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"Create project"]})]}):s.jsx("div",{className:"divide-y divide-border",children:_.map(M=>s.jsxs("div",{children:[s.jsxs("div",{className:$("hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3 transition-colors group",M.is_member===!1?"opacity-60 cursor-default":"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer"),onClick:()=>M.is_member!==!1&&C(`/${v}/projects/${M.identifier}/board`),children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:M.name}),M.is_member===!1&&S(M)&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 shrink-0",children:"Pending"}),(M.pending_request_count??0)>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white shrink-0",children:M.pending_request_count}),M.description&&s.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:M.description})]}),s.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:M.identifier}),s.jsx("div",{children:s.jsxs("span",{className:$("inline-flex items-center gap-1.5 text-xs",M.status==="active"&&"text-emerald-600",M.status==="paused"&&"text-amber-600",M.status==="archived"&&"text-muted-foreground"),children:[s.jsx("span",{className:$("h-1.5 w-1.5 rounded-full shrink-0",M.status==="active"&&"bg-emerald-500",M.status==="paused"&&"bg-amber-500",M.status==="archived"&&"bg-zinc-400")}),M.status.charAt(0).toUpperCase()+M.status.slice(1)]})}),s.jsx("span",{className:"text-sm text-muted-foreground",children:me(new Date(M.created_at),"MMM d, yyyy")}),s.jsx("div",{className:"flex justify-end",onClick:E=>E.stopPropagation(),children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(zs,{className:"h-4 w-4"})})}),s.jsx(Ar,{align:"end",children:M.is_member===!1?s.jsxs(s.Fragment,{children:[s.jsxs(Ye,{disabled:S(M),onClick:()=>{S(M)||(l({id:M.id,name:M.name}),d(""))},children:[s.jsx(ln,{className:"h-4 w-4"}),S(M)?"Request pending":"Request access"]}),S(M)&&s.jsxs(Ye,{className:"text-destructive focus:text-destructive",disabled:j.isPending,onClick:()=>j.mutate(M.id,{onSuccess:()=>{f(E=>{const A=new Set(E);return A.delete(M.id),A}),B.success("Access request cancelled")},onError:()=>B.error("Failed to cancel request")}),children:[s.jsx(We,{className:"h-4 w-4"}),"Cancel request"]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(Ye,{onClick:()=>C(`/${v}/projects/${M.identifier}/board`),children:[s.jsx(Yr,{className:"h-4 w-4"}),"Open board"]}),s.jsxs(Ye,{onClick:()=>C(`/${v}/projects/${M.identifier}/issues`),children:[s.jsx(cs,{className:"h-4 w-4"}),"View issues"]}),s.jsxs(Ye,{onClick:()=>n({id:M.id,name:M.name}),children:[s.jsx(fs,{className:"h-4 w-4"}),"Manage access"]}),s.jsxs(Ye,{onClick:()=>i({id:M.id,name:M.name}),children:[s.jsx(Md,{className:"h-4 w-4"}),"Transfer to workspace"]}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${M.name}"? This cannot be undone.`)&&w.mutate(M.id,{onSuccess:()=>B.success("Project deleted"),onError:()=>B.error("Failed to delete project")})},children:[s.jsx(wr,{className:"h-4 w-4"}),"Delete"]})]})})]})})]}),s.jsxs("div",{className:$("md:hidden flex items-center gap-3 px-4 py-3 transition-colors",M.is_member===!1?"opacity-60 cursor-default":"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer"),onClick:()=>M.is_member!==!1&&C(`/${v}/projects/${M.identifier}/issues`),children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:M.name}),s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:M.identifier})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:$("h-1.5 w-1.5 rounded-full shrink-0",M.status==="active"&&"bg-emerald-500",M.status==="paused"&&"bg-amber-500",M.status==="archived"&&"bg-zinc-400")}),s.jsx("span",{className:$("text-xs",M.status==="active"&&"text-emerald-600",M.status==="paused"&&"text-amber-600",M.status==="archived"&&"text-muted-foreground"),children:M.status.charAt(0).toUpperCase()+M.status.slice(1)}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:me(new Date(M.created_at),"MMM d, yyyy")})]})]}),s.jsx("div",{onClick:E=>E.stopPropagation(),children:s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 text-muted-foreground",children:s.jsx(zs,{className:"h-4 w-4"})})}),s.jsx(Ar,{align:"end",children:M.is_member===!1?s.jsxs(s.Fragment,{children:[s.jsxs(Ye,{disabled:S(M),onClick:()=>{S(M)||(l({id:M.id,name:M.name}),d(""))},children:[s.jsx(ln,{className:"h-4 w-4"}),S(M)?"Request pending":"Request access"]}),S(M)&&s.jsxs(Ye,{className:"text-destructive focus:text-destructive",disabled:j.isPending,onClick:()=>j.mutate(M.id,{onSuccess:()=>{f(E=>{const A=new Set(E);return A.delete(M.id),A}),B.success("Access request cancelled")},onError:()=>B.error("Failed to cancel request")}),children:[s.jsx(We,{className:"h-4 w-4"}),"Cancel request"]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(Ye,{onClick:()=>C(`/${v}/projects/${M.identifier}/issues`),children:[s.jsx(cs,{className:"h-4 w-4"}),"View issues"]}),s.jsxs(Ye,{onClick:()=>n({id:M.id,name:M.name}),children:[s.jsx(fs,{className:"h-4 w-4"}),"Manage access"]}),s.jsxs(Ye,{onClick:()=>i({id:M.id,name:M.name}),children:[s.jsx(Md,{className:"h-4 w-4"}),"Transfer to workspace"]}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${M.name}"? This cannot be undone.`)&&w.mutate(M.id,{onSuccess:()=>B.success("Project deleted"),onError:()=>B.error("Failed to delete project")})},children:[s.jsx(wr,{className:"h-4 w-4"}),"Delete"]})]})})]})})]})]},M.id))}),!b&&_.length>0&&s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["1 — ",_.length," of ",_.length," result",_.length!==1?"s":""]}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{children:"1 of 1 pages"}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),s.jsx(hn,{open:!!o,onOpenChange:M=>{M||l(null)},children:s.jsxs(Qr,{className:"max-w-sm",children:[s.jsx(pn,{children:s.jsxs(xn,{children:["Request access to ",o==null?void 0:o.name,"?"]})}),s.jsxs("div",{className:"space-y-3 py-1",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"A request will be sent to the project managers. You'll be notified once it's approved."}),s.jsx(_e,{placeholder:"Optional message...",value:c,onChange:M=>d(M.target.value),className:"h-9 text-sm"})]}),s.jsxs(Oo,{children:[s.jsx(re,{variant:"outline",size:"sm",onClick:()=>l(null),children:"Cancel"}),s.jsx(re,{size:"sm",disabled:k.isPending,onClick:()=>{o&&k.mutate({projectId:o.id,message:c.trim()||void 0},{onSuccess:()=>{f(M=>new Set([...M,o.id])),l(null),B.success("Access request sent")},onError:M=>{B.error(M.message??"Failed to send request"),l(null)}})},children:k.isPending?"Sending...":"Send request"})]})]})}),s.jsx(SI,{open:e,onClose:()=>t(!1)}),r&&s.jsx(CI,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name}),a&&s.jsx(qI,{open:!!a,onClose:()=>i(null),projectId:a.id,projectName:a.name,currentWorkspaceId:(P==null?void 0:P.id)??""})]})}const mc={byProject:e=>["projects",e,"statuses"]};function Ro(e){return De({queryKey:mc.byProject(e??""),queryFn:()=>oe.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function mR(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:mc.byProject(e)})}})}function hR(e,t){const r=ye();return xe({mutationFn:n=>oe.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:mc.byProject(e)})}})}function pR(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:mc.byProject(e)})}})}function xR(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:mc.byProject(e)})}})}const Ei={all:["users"],list:e=>[...Ei.all,"list",e??{}]};function Sk(e){const{limit:t=20,offset:r=0,q:n=""}=e??{},a=new URLSearchParams;return a.set("limit",String(t)),a.set("offset",String(r)),n&&a.set("q",n),De({queryKey:Ei.list({limit:t,offset:r,q:n}),queryFn:()=>oe.get(`/admin/users?${a}`),staleTime:1e3*60*5,placeholderData:i=>i})}const cf={all:["org-invitations"],list:e=>[...cf.all,"list",e??{}]};function gR(e){const{limit:t=20,offset:r=0,q:n=""}=e??{},a=new URLSearchParams;return a.set("limit",String(t)),a.set("offset",String(r)),n&&a.set("q",n),De({queryKey:cf.list({limit:t,offset:r,q:n}),queryFn:()=>oe.get(`/admin/users/invitations?${a}`),staleTime:1e3*30,placeholderData:i=>i})}function vR(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/users/invitations/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:cf.all})})}function yR(){return xe({mutationFn:e=>oe.post(`/admin/users/invitations/${e}/resend`)})}function bR(){const e=ye();return xe({mutationFn:({email:t,role:r})=>oe.post("/admin/users/invite",{email:t,role:r}),onSuccess:()=>e.invalidateQueries({queryKey:cf.all})})}function wR(){const e=ye();return xe({mutationFn:({userId:t,role:r})=>oe.patch(`/admin/users/${t}`,{role:r}),onSuccess:()=>e.invalidateQueries({queryKey:Ei.all})})}function jR(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/users/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:Ei.all})})}function NR(){const e=ye();return xe({mutationFn:t=>oe.post(`/admin/users/${t}/reactivate`),onSuccess:()=>e.invalidateQueries({queryKey:Ei.all})})}function Ck(){return De({queryKey:[...Ei.all,"map"],queryFn:()=>oe.get("/admin/users/map"),select:e=>e.users,staleTime:1e3*60*5})}function $a(){return De({queryKey:[...Ei.all,"map"],queryFn:()=>oe.get("/admin/users/map"),select:e=>new Map(e.users.map(t=>{var o;const r=t.first_name??"",n=t.last_name??"",a=`${r} ${n}`.trim()||t.email,i=(r[0]??n[0]??((o=t.email)==null?void 0:o[0])??"U").toUpperCase();return[t.id,{name:a,initials:i}]})),staleTime:1e3*60*5})}const xi={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},un={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},hc={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},Bs={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},kR=({priority:e})=>{const t=$("h-3 w-3 shrink-0",hc[e]);switch(e){case"urgent":return s.jsx(gs,{className:t});case"high":return s.jsx(_i,{className:t});case"medium":return s.jsx(Js,{className:t});case"low":return s.jsx(Ci,{className:t});default:return s.jsx(Er,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function _k({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=$a(),{attributes:a,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=ex({id:e.id}),u={transform:tx.Transform.toString(l),transition:c};return s.jsxs("div",{ref:o,style:u,...a,...i,onClick:r,className:$("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:[s.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),s.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mb-2",children:[s.jsx(Ut,{className:"h-2.5 w-2.5 shrink-0"}),s.jsx("span",{children:e.start_date?me(new Date(e.start_date),"MMM d"):"?"}),s.jsx("span",{children:"→"}),s.jsx("span",{children:e.due_date?me(new Date(e.due_date),"MMM d"):"?"})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.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&&s.jsx("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500 shrink-0",title:"Child issue",children:s.jsx(Ds,{className:"h-3 w-3"})}),t>0&&s.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:[s.jsx(Ds,{className:"h-2.5 w-2.5"}),t]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&s.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(p=>{const x=n==null?void 0:n.get(p);return s.jsx(_t,{className:"h-4 w-4 border border-background",children:s.jsx(Pt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(x==null?void 0:x.initials)??"?"})},p)}),(((f=e.assignee_ids)==null?void 0:f.length)??0)>2&&s.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]})]}),s.jsx(kR,{priority:e.priority})]})]})]})}function Hc(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(a)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${a},${i},${t})`}const SR=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return s.jsx(kn,{className:r,style:n});case"started":return s.jsx(dn,{className:r,style:n});default:return s.jsx(Er,{className:r,style:n})}};function CR({id:e,label:t,color:r,category:n,issues:a,childCounts:i,sortable:o,onIssueClick:l,onRename:c,onDelete:d,isRenaming:u,renameValue:f,onRenameChange:m,onRenameSubmit:p,onRenameCancel:x}){const{setNodeRef:g,isOver:v}=VE({id:e}),{attributes:y,listeners:b,setNodeRef:N,transform:w,transition:k,isDragging:j}=ex({id:e,disabled:!o}),C=h.useRef(null),P=h.useRef(!1);h.useEffect(()=>{u&&(P.current=!1,setTimeout(()=>{var D;return(D=C.current)==null?void 0:D.focus()},0))},[u]);const S=o?{transform:tx.Transform.toString(w),transition:k}:void 0,_=Hc(r,.08),M=Hc(r,.16),E=Hc(r,.35),A=!!(c||d);return s.jsxs("div",{ref:N,style:S,className:$("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",j&&"opacity-50"),children:[s.jsxs("div",{className:$("flex items-center gap-2 mb-2 px-1",o&&"cursor-grab"),children:[o&&s.jsx("span",{...y,...b,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:s.jsx(rN,{className:"h-3.5 w-3.5"})}),s.jsx(SR,{category:n,color:r}),u?s.jsx("input",{ref:C,value:f??"",onChange:D=>m==null?void 0:m(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),p==null||p()),D.key==="Escape"&&(D.preventDefault(),P.current=!0,x==null||x())},onBlur:()=>{P.current||p==null||p()},className:"flex-1 text-xs font-medium bg-transparent border-b border-foreground/30 outline-none py-0.5 min-w-0"}):s.jsx("span",{className:"text-xs font-medium text-foreground",children:t}),s.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:Hc(r,.12),color:r},children:a.length}),A&&!u&&s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.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:s.jsx(zs,{className:"h-3.5 w-3.5"})})}),s.jsxs(Ar,{align:"end",className:"w-40",children:[c&&s.jsx(Ye,{onClick:c,children:"Rename"}),c&&d&&s.jsx(Sn,{}),d&&s.jsx(Ye,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),s.jsxs("div",{ref:g,className:$("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?M:_,boxShadow:v?`inset 0 0 0 1px ${E}`:void 0},children:[s.jsx(Jp,{items:a.map(D=>D.id),strategy:XE,children:a.map(D=>s.jsx(_k,{issue:D,childCount:(i==null?void 0:i.get(D.id))??0,onClick:()=>l==null?void 0:l(D)},D.id))}),a.length===0&&s.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:s.jsx("p",{className:"text-xs text-muted-foreground/40",children:"Drop here"})})]})]})}const Rm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],_R=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function PR({open:e,onClose:t,projectId:r}){const[n,a]=h.useState(""),[i,o]=h.useState(Rm[0]),[l,c]=h.useState(""),[d,u]=h.useState("started"),f=mR(r),m=l||i,p=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{B.success("Status created"),a(""),o(Rm[0]),c(""),u("started"),t()},onError:()=>B.error("Failed to create status")})};return s.jsx(Mi,{open:e,onOpenChange:x=>!x&&t(),children:s.jsxs(Oi,{className:"sm:max-w-sm",children:[s.jsx(Ao,{children:s.jsx(To,{className:"text-sm font-medium",children:"New Status"})}),s.jsx(Do,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Name"}),s.jsx(_e,{placeholder:"e.g. In Review",value:n,onChange:x=>a(x.target.value),onKeyDown:x=>x.key==="Enter"&&p(),autoFocus:!0,className:"h-8 text-sm"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Color"}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Rm.map(x=>s.jsx("button",{onClick:()=>{o(x),c("")},className:$("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===x&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:x}},x)),s.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[s.jsx("div",{className:"h-6 w-6 rounded-full border border-border shrink-0",style:{backgroundColor:l||"#e5e7eb"}}),s.jsx(_e,{placeholder:"#hex",value:l,onChange:x=>c(x.target.value),className:"h-6 w-20 text-xs px-1.5"})]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Category"}),s.jsxs(Be,{value:d,onValueChange:x=>u(x),children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:_R.map(x=>s.jsx(ke,{value:x.value,className:"text-xs",children:x.label},x.value))})]})]})]})}),s.jsxs(fc,{className:"mt-2",children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),s.jsx(re,{size:"sm",onClick:p,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function MR({projectId:e}){const[t,r]=h.useState(!1);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:s.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:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Add status"]})}),s.jsx(PR,{open:t,onClose:()=>r(!1),projectId:e})]})}function OR({open:e,statusName:t,issueCount:r,otherStatuses:n,onConfirm:a,onCancel:i,isLoading:o}){const[l,c]=h.useState(""),d=()=>{r>0&&!l||a(r>0?l:null)};return s.jsx(hn,{open:e,onOpenChange:u=>{u||i()},children:s.jsxs(Qr,{className:"sm:max-w-md",children:[s.jsxs(pn,{children:[s.jsx(xn,{children:"Delete status"}),s.jsx(Eo,{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&&s.jsxs("div",{className:"py-2",children:[s.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Move issues to"}),s.jsxs(Be,{value:l,onValueChange:c,children:[s.jsx(ze,{children:s.jsx(Ve,{placeholder:"Select a status..."})}),s.jsx(Fe,{children:n.map(u=>s.jsx(ke,{value:u.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),u.name]})},u.id))})]})]}),s.jsxs(Oo,{children:[s.jsx(re,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),s.jsx(re,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}var Fx={};(function e(t,r,n,a){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;try{var I=new OffscreenCanvas(1,1),O=I.getContext("2d");O.fillRect(0,0,1,1);var L=I.transferToImageBitmap();O.createPattern(L,"no-repeat")}catch{return!1}return!0}();function c(){}function d(I){var O=r.exports.Promise,L=O!==void 0?O:t.Promise;return typeof L=="function"?new L(I):(I(c,c),null)}var u=function(I,O){return{transform:function(L){if(I)return L;if(O.has(L))return O.get(L);var H=new OffscreenCanvas(L.width,L.height),R=H.getContext("2d");return R.drawImage(L,0,0),O.set(L,H),H},clear:function(){O.clear()}}}(l,new Map),f=function(){var I=Math.floor(16.666666666666668),O,L,H={},R=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(O=function(Y){var F=Math.random();return H[F]=requestAnimationFrame(function T(G){R===G||R+I-1<G?(R=G,delete H[F],Y()):H[F]=requestAnimationFrame(T)}),F},L=function(Y){H[Y]&&cancelAnimationFrame(H[Y])}):(O=function(Y){return setTimeout(Y,I)},L=function(Y){return clearTimeout(Y)}),{frame:O,cancel:L}}(),m=function(){var I,O,L={};function H(R){function Y(F,T){R.postMessage({options:F||{},callback:T})}R.init=function(T){var G=T.transferControlToOffscreen();R.postMessage({canvas:G},[G])},R.fire=function(T,G,z){if(O)return Y(T,null),O;var se=Math.random().toString(36).slice(2);return O=d(function(W){function X(ie){ie.data.callback===se&&(delete L[se],R.removeEventListener("message",X),O=null,u.clear(),z(),W())}R.addEventListener("message",X),Y(T,se),L[se]=X.bind(null,{data:{callback:se}})}),O},R.reset=function(){R.postMessage({reset:!0});for(var T in L)L[T](),delete L[T]}}return function(){if(I)return I;if(!n&&i){var R=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
|
|
580
|
-
`);try{I=new Worker(URL.createObjectURL(new Blob([R])))}catch(Y){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",Y),null}H(I)}return I}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function x(I,O){return O?O(I):I}function g(I){return I!=null}function v(I,O,L){return x(I&&g(I[O])?I[O]:p[O],L)}function y(I){return I<0?0:Math.floor(I)}function b(I,O){return Math.floor(Math.random()*(O-I))+I}function N(I){return parseInt(I,16)}function w(I){return I.map(k)}function k(I){var O=String(I).replace(/[^0-9a-f]/gi,"");return O.length<6&&(O=O[0]+O[0]+O[1]+O[1]+O[2]+O[2]),{r:N(O.substring(0,2)),g:N(O.substring(2,4)),b:N(O.substring(4,6))}}function j(I){var O=v(I,"origin",Object);return O.x=v(O,"x",Number),O.y=v(O,"y",Number),O}function C(I){I.width=document.documentElement.clientWidth,I.height=document.documentElement.clientHeight}function P(I){var O=I.getBoundingClientRect();I.width=O.width,I.height=O.height}function S(I){var O=document.createElement("canvas");return O.style.position="fixed",O.style.top="0px",O.style.left="0px",O.style.pointerEvents="none",O.style.zIndex=I,O}function _(I,O,L,H,R,Y,F,T,G){I.save(),I.translate(O,L),I.rotate(Y),I.scale(H,R),I.arc(0,0,1,F,T,G),I.restore()}function M(I){var O=I.angle*(Math.PI/180),L=I.spread*(Math.PI/180);return{x:I.x,y:I.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:I.startVelocity*.5+Math.random()*I.startVelocity,angle2D:-O+(.5*L-Math.random()*L),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:I.color,shape:I.shape,tick:0,totalTicks:I.ticks,decay:I.decay,drift:I.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:I.gravity*3,ovalScalar:.6,scalar:I.scalar,flat:I.flat}}function E(I,O){O.x+=Math.cos(O.angle2D)*O.velocity+O.drift,O.y+=Math.sin(O.angle2D)*O.velocity+O.gravity,O.velocity*=O.decay,O.flat?(O.wobble=0,O.wobbleX=O.x+10*O.scalar,O.wobbleY=O.y+10*O.scalar,O.tiltSin=0,O.tiltCos=0,O.random=1):(O.wobble+=O.wobbleSpeed,O.wobbleX=O.x+10*O.scalar*Math.cos(O.wobble),O.wobbleY=O.y+10*O.scalar*Math.sin(O.wobble),O.tiltAngle+=.1,O.tiltSin=Math.sin(O.tiltAngle),O.tiltCos=Math.cos(O.tiltAngle),O.random=Math.random()+2);var L=O.tick++/O.totalTicks,H=O.x+O.random*O.tiltCos,R=O.y+O.random*O.tiltSin,Y=O.wobbleX+O.random*O.tiltCos,F=O.wobbleY+O.random*O.tiltSin;if(I.fillStyle="rgba("+O.color.r+", "+O.color.g+", "+O.color.b+", "+(1-L)+")",I.beginPath(),o&&O.shape.type==="path"&&typeof O.shape.path=="string"&&Array.isArray(O.shape.matrix))I.fill(q(O.shape.path,O.shape.matrix,O.x,O.y,Math.abs(Y-H)*.1,Math.abs(F-R)*.1,Math.PI/10*O.wobble));else if(O.shape.type==="bitmap"){var T=Math.PI/10*O.wobble,G=Math.abs(Y-H)*.1,z=Math.abs(F-R)*.1,se=O.shape.bitmap.width*O.scalar,W=O.shape.bitmap.height*O.scalar,X=new DOMMatrix([Math.cos(T)*G,Math.sin(T)*G,-Math.sin(T)*z,Math.cos(T)*z,O.x,O.y]);X.multiplySelf(new DOMMatrix(O.shape.matrix));var ie=I.createPattern(u.transform(O.shape.bitmap),"no-repeat");ie.setTransform(X),I.globalAlpha=1-L,I.fillStyle=ie,I.fillRect(O.x-se/2,O.y-W/2,se,W),I.globalAlpha=1}else if(O.shape==="circle")I.ellipse?I.ellipse(O.x,O.y,Math.abs(Y-H)*O.ovalScalar,Math.abs(F-R)*O.ovalScalar,Math.PI/10*O.wobble,0,2*Math.PI):_(I,O.x,O.y,Math.abs(Y-H)*O.ovalScalar,Math.abs(F-R)*O.ovalScalar,Math.PI/10*O.wobble,0,2*Math.PI);else if(O.shape==="star")for(var V=Math.PI/2*3,J=4*O.scalar,ue=8*O.scalar,de=O.x,ee=O.y,ge=5,be=Math.PI/ge;ge--;)de=O.x+Math.cos(V)*ue,ee=O.y+Math.sin(V)*ue,I.lineTo(de,ee),V+=be,de=O.x+Math.cos(V)*J,ee=O.y+Math.sin(V)*J,I.lineTo(de,ee),V+=be;else I.moveTo(Math.floor(O.x),Math.floor(O.y)),I.lineTo(Math.floor(O.wobbleX),Math.floor(R)),I.lineTo(Math.floor(Y),Math.floor(F)),I.lineTo(Math.floor(H),Math.floor(O.wobbleY));return I.closePath(),I.fill(),O.tick<O.totalTicks}function A(I,O,L,H,R){var Y=O.slice(),F=I.getContext("2d"),T,G,z=d(function(se){function W(){T=G=null,F.clearRect(0,0,H.width,H.height),u.clear(),R(),se()}function X(){n&&!(H.width===a.width&&H.height===a.height)&&(H.width=I.width=a.width,H.height=I.height=a.height),!H.width&&!H.height&&(L(I),H.width=I.width,H.height=I.height),F.clearRect(0,0,H.width,H.height),Y=Y.filter(function(ie){return E(F,ie)}),Y.length?T=f.frame(X):W()}T=f.frame(X),G=W});return{addFettis:function(se){return Y=Y.concat(se),z},canvas:I,promise:z,reset:function(){T&&f.cancel(T),G&&G()}}}function D(I,O){var L=!I,H=!!v(O||{},"resize"),R=!1,Y=v(O,"disableForReducedMotion",Boolean),F=i&&!!v(O||{},"useWorker"),T=F?m():null,G=L?C:P,z=I&&T?!!I.__confetti_initialized:!1,se=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,W;function X(V,J,ue){for(var de=v(V,"particleCount",y),ee=v(V,"angle",Number),ge=v(V,"spread",Number),be=v(V,"startVelocity",Number),qe=v(V,"decay",Number),Ge=v(V,"gravity",Number),Je=v(V,"drift",Number),rt=v(V,"colors",w),mt=v(V,"ticks",Number),He=v(V,"shapes"),Ze=v(V,"scalar"),nr=!!v(V,"flat"),Lr=j(V),sr=de,jr=[],ar=I.width*Lr.x,wt=I.height*Lr.y;sr--;)jr.push(M({x:ar,y:wt,angle:ee,spread:ge,startVelocity:be,color:rt[sr%rt.length],shape:He[b(0,He.length)],ticks:mt,decay:qe,gravity:Ge,drift:Je,scalar:Ze,flat:nr}));return W?W.addFettis(jr):(W=A(I,jr,G,J,ue),W.promise)}function ie(V){var J=Y||v(V,"disableForReducedMotion",Boolean),ue=v(V,"zIndex",Number);if(J&&se)return d(function(be){be()});L&&W?I=W.canvas:L&&!I&&(I=S(ue),document.body.appendChild(I)),H&&!z&&G(I);var de={width:I.width,height:I.height};T&&!z&&T.init(I),z=!0,T&&(I.__confetti_initialized=!0);function ee(){if(T){var be={getBoundingClientRect:function(){if(!L)return I.getBoundingClientRect()}};G(be),T.postMessage({resize:{width:be.width,height:be.height}});return}de.width=de.height=null}function ge(){W=null,H&&(R=!1,t.removeEventListener("resize",ee)),L&&I&&(document.body.contains(I)&&document.body.removeChild(I),I=null,z=!1)}return H&&!R&&(R=!0,t.addEventListener("resize",ee,!1)),T?T.fire(V,de,ge):X(V,de,ge)}return ie.reset=function(){T&&T.reset(),W&&W.reset()},ie}var Z;function Q(){return Z||(Z=D(null,{useWorker:!0,resize:!0})),Z}function q(I,O,L,H,R,Y,F){var T=new Path2D(I),G=new Path2D;G.addPath(T,new DOMMatrix(O));var z=new Path2D;return z.addPath(G,new DOMMatrix([Math.cos(F)*R,Math.sin(F)*R,-Math.sin(F)*Y,Math.cos(F)*Y,L,H])),z}function te(I){if(!o)throw new Error("path confetti are not supported in this browser");var O,L;typeof I=="string"?O=I:(O=I.path,L=I.matrix);var H=new Path2D(O),R=document.createElement("canvas"),Y=R.getContext("2d");if(!L){for(var F=1e3,T=F,G=F,z=0,se=0,W,X,ie=0;ie<F;ie+=2)for(var V=0;V<F;V+=2)Y.isPointInPath(H,ie,V,"nonzero")&&(T=Math.min(T,ie),G=Math.min(G,V),z=Math.max(z,ie),se=Math.max(se,V));W=z-T,X=se-G;var J=10,ue=Math.min(J/W,J/X);L=[ue,0,0,ue,-Math.round(W/2+T)*ue,-Math.round(X/2+G)*ue]}return{type:"path",path:O,matrix:L}}function ne(I){var O,L=1,H="#000000",R='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof I=="string"?O=I:(O=I.text,L="scalar"in I?I.scalar:L,R="fontFamily"in I?I.fontFamily:R,H="color"in I?I.color:H);var Y=10*L,F=""+Y+"px "+R,T=new OffscreenCanvas(Y,Y),G=T.getContext("2d");G.font=F;var z=G.measureText(O),se=Math.ceil(z.actualBoundingBoxRight+z.actualBoundingBoxLeft),W=Math.ceil(z.actualBoundingBoxAscent+z.actualBoundingBoxDescent),X=2,ie=z.actualBoundingBoxLeft+X,V=z.actualBoundingBoxAscent+X;se+=X+X,W+=X+X,T=new OffscreenCanvas(se,W),G=T.getContext("2d"),G.font=F,G.fillStyle=H,G.fillText(O,ie,V);var J=1/L;return{type:"bitmap",bitmap:T.transferToImageBitmap(),matrix:[J,0,0,J,-se*J/2,-W*J/2]}}r.exports=function(){return Q().apply(this,arguments)},r.exports.reset=function(){Q().reset()},r.exports.create=D,r.exports.shapeFromPath=te,r.exports.shapeFromText=ne})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),Fx,!1);const ER=Fx.exports;Fx.exports.create;function $m(e,t){var n;const r={};for(const a of t)r[a.key]=[];for(const a of e)if(r[a.status]!==void 0)r[a.status].push(a);else{const i=((n=t[0])==null?void 0:n.key)??"backlog";r[i]=[...r[i]??[],a]}return r}function AR(e,t,r){var i;const n=new Map(t.map(o=>[o.id,o])),a={};for(const o of r)a[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&&(a[o.key].push(c),n.delete(l.id))}for(const o of n.values()){const l=a[o.status];if(l)l.push(o);else{const c=(i=r[0])==null?void 0:i.key;c&&a[c].push(o)}}return a}function Pk({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:a,readOnly:i=!1,filters:o}){var Y;const[l,c]=h.useState(()=>r.map(F=>F.id)),[d,u]=h.useState(()=>$m(e,r)),[f,m]=h.useState(null),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,b]=h.useState(null),[N,w]=h.useState(""),k=h.useRef(null),j=h.useRef(!1),C=ye(),P=xt.byProject(t,o),S=pR(t),_=hR(t,y??""),M=h.useMemo(()=>{const F=new Map;for(const T of e)T.parent_id&&F.set(T.parent_id,(F.get(T.parent_id)??0)+1);return F},[e]);h.useEffect(()=>{c(F=>{const T=new Set(r.map(se=>se.id)),G=F.filter(se=>T.has(se)),z=r.map(se=>se.id).filter(se=>!F.includes(se));return G.length===F.length&&z.length===0?F:[...G,...z]})},[r]),h.useEffect(()=>{j.current||u(F=>AR(F,e,r))},[e,r]);const E=[...r].sort((F,T)=>{const G=l.indexOf(F.id),z=l.indexOf(T.id);return G===-1&&z===-1?F.position-T.position:G===-1?1:z===-1?-1:G-z}),A=k1(Zp(S1,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),D=h.useCallback(F=>{if(p){const G=F.droppableContainers.filter(z=>l.includes(z.id));return QE({...F,droppableContainers:G})}const T=ZE(F);return T.length>0?T:JE(F)},[p,l]),Z=h.useCallback(F=>{for(const[T,G]of Object.entries(d))if(G.some(z=>z.id===F))return T;return null},[d]),Q=h.useCallback(F=>r.some(T=>T.id===F),[r]),q=F=>{const T=F.active.id;if(j.current=!0,Q(T)){x(T);return}for(const[G,z]of Object.entries(d)){const se=z.find(W=>W.id===T);if(se){m(se),k.current=G;return}}},te=F=>{const{active:T,over:G}=F;if(!G||p)return;const z=T.id,se=G.id;if(Q(z))return;const W=Z(z),X=r.find(V=>V.key===se||V.id===se),ie=(X==null?void 0:X.key)??Z(se);!W||!ie||W===ie||u(V=>{const J=[...V[W]??[]],ue=[...V[ie]??[]],de=J.findIndex(be=>be.id===z);if(de===-1)return V;const[ee]=J.splice(de,1),ge={...ee,status:ie};if(X)ue.push(ge);else{const be=ue.findIndex(qe=>qe.id===se);if(be===-1)ue.push(ge);else{const qe=T.rect.current.translated!=null&&T.rect.current.translated.top>G.rect.top+G.rect.height/2;ue.splice(qe?be+1:be,0,ge)}}return{...V,[W]:J,[ie]:ue}})},ne=F=>{var V;const{active:T,over:G}=F;if(m(null),p){if(x(null),j.current=!1,!G||T.id===G.id)return;const J=l.indexOf(T.id),ue=l.indexOf(G.id);if(J===-1||ue===-1||J===ue)return;const de=yd(l,J,ue);c(de),a==null||a(de);return}if(!G){j.current=!1;const J=k.current;k.current=null,J&&u($m(e,r));return}const z=T.id,se=G.id,W=k.current;k.current=null;const X=r.find(J=>J.key===se||J.id===se),ie=(X==null?void 0:X.key)??Z(se);if(!W||!ie){j.current=!1;return}if(W===ie)j.current=!1,u(J=>{const ue=J[W]??[],de=ue.findIndex(ge=>ge.id===z),ee=ue.findIndex(ge=>ge.id===se);return de===-1||ee===-1||de===ee?J:{...J,[W]:yd(ue,de,ee)}});else{if(!r.find(de=>de.key===se||de.id===se))u(de=>{const ee=[...de[ie]??[]],ge=ee.findIndex(rt=>rt.id===z);if(ge===-1)return de;const be=F.active.rect.current.translated!=null&&F.active.rect.current.translated.top>F.over.rect.top+F.over.rect.height/2,[qe]=ee.splice(ge,1),Ge=ee.findIndex(rt=>rt.id===se);if(Ge===-1)return ee.splice(ge,0,qe),de;const Je=be?Ge+1:Ge;return ee.splice(Je,0,qe),{...de,[ie]:ee}});else{const de=((V=F.active.rect.current.translated)==null?void 0:V.top)??1/0,ee=F.over.rect.top+F.over.rect.height/2;de<ee&&u(ge=>{const be=ge[ie]??[],qe=be.findIndex(Ge=>Ge.id===z);return qe<=0?ge:{...ge,[ie]:yd(be,qe,0)}})}const ue=C.getQueryData(P);C.cancelQueries({queryKey:P}),C.setQueryData(P,de=>de&&{...de,issues:de.issues.map(ee=>ee.id===z?{...ee,status:ie}:ee)}),oe.put(`/admin/issues/${z}`,{status:ie}).then(()=>{j.current=!1,C.invalidateQueries({queryKey:P});const de=r.find(ee=>ee.key===ie);(de==null?void 0:de.category)==="completed"&&ER({particleCount:80,spread:60,origin:{y:.6}})}).catch(()=>{j.current=!1,ue&&C.setQueryData(P,ue),u($m((ue==null?void 0:ue.issues)??e,r)),B.error("Failed to update issue status")})}},I=F=>{v(F)},O=async F=>{if(!g)return;const T=d[g.key]??[];if(T.length>0){const G=r.find(z=>z.id===F);if(!G)return;try{await Promise.all(T.map(z=>oe.put(`/admin/issues/${z.id}`,{status:G.key}))),C.invalidateQueries({queryKey:xt.byProject(t)})}catch{B.error("Failed to move issues");return}}S.mutate(g.id,{onSuccess:()=>{B.success(`Status "${g.name}" deleted`),v(null)},onError:()=>B.error("Failed to delete status")})},L=()=>{const F=N.trim();!F||!y||_.mutate({name:F},{onSuccess:()=>{B.success("Status renamed"),b(null)},onError:()=>B.error("Failed to rename status")})},H=()=>{b(null)},R=p?r.find(F=>F.id===p):null;return s.jsxs(Cl,{sensors:A,collisionDetection:D,onDragStart:q,onDragOver:te,onDragEnd:ne,children:[s.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[s.jsx(Jp,{items:l,strategy:C1,children:E.map(F=>s.jsx(CR,{id:F.id,label:F.name,color:F.color,category:F.category,issues:d[F.key]??[],childCounts:M,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{b(F.id),w(F.name)},onDelete:i?void 0:()=>I(F),isRenaming:y===F.id,renameValue:y===F.id?N:"",onRenameChange:w,onRenameSubmit:L,onRenameCancel:H},F.id))}),!i&&s.jsx(MR,{projectId:t})]}),s.jsxs(eA,{children:[f&&s.jsx(_k,{issue:f}),R&&s.jsx("div",{className:"opacity-80 min-w-[260px] max-w-[280px]",children:s.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:[s.jsx("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:R.color}}),R.name]})})]}),g&&s.jsx(OR,{open:!!g,statusName:g.name,issueCount:((Y=d[g.key])==null?void 0:Y.length)??0,otherStatuses:r.filter(F=>F.id!==g.id),onConfirm:O,onCancel:()=>v(null),isLoading:S.isPending})]})}const DR=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],TR=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function Kc({label:e,activeCount:t,children:r}){const[n,a]=h.useState(!1);return s.jsxs(Dt,{open:n,onOpenChange:a,children:[s.jsx(Tt,{asChild:!0,children:s.jsxs("button",{className:$("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&&s.jsx("span",{className:"flex items-center justify-center h-4 w-4 rounded-full bg-foreground text-background text-[10px] font-semibold",children:t}),s.jsx(Zs,{className:"h-3 w-3 opacity-60"})]})}),s.jsx(Ct,{className:"w-48 p-1",align:"start",children:r})]})}function Lm({options:e,selected:t,onToggle:r}){return s.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(n=>{const a=t.includes(n.value);return s.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:[s.jsx("div",{className:$("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",a?"bg-foreground border-foreground":"border-border"),children:a&&s.jsx(At,{className:"h-2.5 w-2.5 text-background"})}),n.color&&s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:n.color}}),s.jsx("span",{className:"truncate",children:n.label})]},n.value)})})}function IR({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,p,x;const a=(((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=(g,v)=>{const y=r[g]??[],b=y.includes(v)?y.filter(N=>N!==v):[...y,v];n({...r,[g]:b.length?b:void 0})},o=g=>{n({...r,assignee_id:r.assignee_id===g?void 0:g})},l=r.assignee_id?((f=t.find(g=>g.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Kc,{label:r.assignee_id?l:"Assignee",activeCount:r.assignee_id?1:0,children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground px-2 py-1.5",children:"No members"}),t.map(g=>{const v=r.assignee_id===g.userId;return s.jsxs("button",{onClick:()=>o(g.userId),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[s.jsx("div",{className:$("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",v?"bg-foreground border-foreground":"border-border"),children:v&&s.jsx(At,{className:"h-2.5 w-2.5 text-background"})}),s.jsx("span",{className:"h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium shrink-0",children:g.initials}),s.jsx("span",{className:"truncate",children:g.name})]},g.userId)})]})}),s.jsx(Kc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:s.jsx(Lm,{options:DR,selected:r.priority??[],onToggle:g=>i("priority",g)})}),s.jsx(Kc,{label:"Type",activeCount:((p=r.type)==null?void 0:p.length)??0,children:s.jsx(Lm,{options:TR,selected:r.type??[],onToggle:g=>i("type",g)})}),s.jsx(Kc,{label:"Status",activeCount:((x=r.status)==null?void 0:x.length)??0,children:s.jsx(Lm,{options:e.map(g=>({value:g.key,label:g.name,color:g.color})),selected:r.status??[],onToggle:g=>i("status",g)})}),a&&s.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:[s.jsx(We,{className:"h-3 w-3"}),"Clear"]})]})}const RR={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function Bx(){return De({queryKey:["org","calendar"],queryFn:()=>oe.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??RR,timezone:e.timezone})})}function $R(){const e=ye();return xe({mutationFn:t=>oe.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function qx(e){const t=e??new Date().getFullYear();return De({queryKey:["org","holidays",t],queryFn:()=>oe.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function LR(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function zR(){const e=ye();return xe({mutationFn:({id:t,...r})=>oe.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function FR(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function Mk(){return De({queryKey:["app-config"],queryFn:()=>oe.get("/admin/config"),staleTime:1/0})}const BR=["sun","mon","tue","wed","thu","fri","sat"];function qR(e,t,r){const n=BR[rR(e)];if(!t[n])return!1;const a=wd(e),i=_l(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(wd(l)===a&&_l(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&wd(l)===a&&_l(l)===i)return!1}return!0}function Lh(e,t,r,n){let a=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;)qR(i,r,n)&&a++,i=Kr(i,1);return a}const oo={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function $o(e){return De({queryKey:e?oo.byProject(e):oo.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return oe.get(t)},select:t=>t.sprints,enabled:!!e})}function WR(e){const t=ye();return xe({mutationFn:r=>oe.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:oo.byProject(e)})}})}function UR(e,t){const r=ye();return xe({mutationFn:n=>oe.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:oo.byProject(t)}),r.invalidateQueries({queryKey:oo.detail(e)})}})}function HR(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:oo.byProject(e)})}})}const df={byProject:e=>["task-lists","project",e]};function pc(e){return De({queryKey:e?df.byProject(e):["task-lists"],queryFn:()=>oe.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function KR(e){const t=ye();return xe({mutationFn:r=>oe.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:df.byProject(e)})}})}function YR(e){const t=ye();return xe({mutationFn:({id:r,...n})=>oe.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:df.byProject(e)})}})}function GR(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:df.byProject(e)}),t.invalidateQueries({queryKey:xt.byProject(e)})}})}function Dy(e,t,r){const n=(e==null?void 0:e[0])??"",a=(t==null?void 0:t[0])??"";return(n+a).toUpperCase()||((r==null?void 0:r[0])??"U").toUpperCase()}function Ty(e,t,r){return`${e??""} ${t??""}`.trim()||r}function xc({value:e,onChange:t,disabled:r,users:n,emptyLabel:a="Assign"}){const[i,o]=h.useState(!1),[l,c]=h.useState(e),{data:d}=Ck(),u=n??d??[],f=e.slice().sort().join(",");h.useEffect(()=>{c(e)},[f]);const m=x=>{const g=l.includes(x)?l.filter(v=>v!==x):[...l,x];c(g),t(g)},p=u.filter(x=>l.includes(x.id));return s.jsxs(Dt,{open:i,onOpenChange:o,children:[s.jsx(Tt,{asChild:!0,disabled:r,children:s.jsx("button",{type:"button",className:$("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:p.length===0?s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(ln,{className:"h-3.5 w-3.5"}),a]}):s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex -space-x-1.5",children:p.slice(0,3).map(x=>s.jsx(_t,{className:"h-5 w-5 border border-background ring-0",children:s.jsx(Pt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:Dy(x.first_name,x.last_name,x.email)})},x.id))}),p.length>3&&s.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",p.length-3]}),s.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:p.length===1?Ty(p[0].first_name,p[0].last_name,p[0].email):`${p.length} assignees`})]})})}),s.jsx(Ct,{className:"w-60 p-0",align:"start",children:s.jsxs(va,{children:[s.jsx(oc,{placeholder:"Search users...",className:"h-8 text-xs"}),s.jsxs(ya,{children:[s.jsx(lc,{className:"text-xs py-4",children:"No users found."}),s.jsx(Ts,{children:u.map(x=>{const g=l.includes(x.id),v=Ty(x.first_name,x.last_name,x.email),y=Dy(x.first_name,x.last_name,x.email);return s.jsxs(sn,{value:v,onSelect:()=>m(x.id),className:"gap-2 py-1.5",children:[s.jsx(_t,{className:"h-5 w-5 shrink-0",children:s.jsx(Pt,{className:"text-[9px] bg-muted text-muted-foreground",children:y})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs font-medium truncate",children:v}),s.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:x.email})]}),s.jsx(At,{className:$("h-3.5 w-3.5 shrink-0",g?"opacity-100 text-indigo-500":"opacity-0")})]},x.id)})})]})]})})]})}const VR=tc("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 Cn({className:e,variant:t,...r}){return s.jsx("div",{className:$(VR({variant:t}),e),...r})}function lo({value:e,onChange:t,projectId:r,excludeId:n,disabled:a,emptyLabel:i="None"}){const[o,l]=h.useState(!1),[c,d]=h.useState(e),{data:u=[]}=Hu(r),{workspace:f,projectKey:m}=It(),p=e.slice().sort().join(",");h.useEffect(()=>{d(e)},[p]);const x=u.filter(N=>N.id!==n),g=x.filter(N=>c.includes(N.id)),v=N=>{const w=c.includes(N)?c.filter(k=>k!==N):[...c,N];d(w),t(w)},y=(N,w)=>{N.stopPropagation();const k=c.filter(j=>j!==w);d(k),t(k)},b=(N,w)=>{N.stopPropagation(),f&&m&&window.open(`/${f}/projects/${m}/issues/${w}`,"_blank")};return s.jsxs(Dt,{open:o,onOpenChange:l,children:[s.jsx(Tt,{asChild:!0,disabled:a,children:s.jsx("button",{type:"button",className:$("flex flex-wrap items-center gap-1 min-h-[28px] w-full rounded-md px-1 py-1","transition-colors text-left",g.length===0&&"hover:bg-accent","focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",a&&"pointer-events-none opacity-50"),children:g.length===0?s.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(Oa,{className:"h-3.5 w-3.5"}),i]}):s.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(N=>s.jsxs(Cn,{variant:"secondary",className:"text-[10px] h-5 px-1.5 gap-1 font-normal max-w-[160px] hover:bg-indigo-100 dark:hover:bg-indigo-900/40 transition-colors",children:[s.jsxs("span",{role:"button",tabIndex:0,onClick:w=>b(w,N.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&b(w,N.id)},className:"flex items-center gap-1 min-w-0 cursor-pointer hover:text-foreground transition-colors",children:[s.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:N.identifier}),s.jsx("span",{className:"truncate",children:N.title})]}),s.jsx("span",{role:"button",tabIndex:0,onClick:w=>y(w,N.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&y(w,N.id)},className:"ml-0.5 hover:text-destructive transition-colors cursor-pointer shrink-0",children:s.jsx(We,{className:"h-2.5 w-2.5"})})]},N.id))})})}),s.jsx(Ct,{className:"w-72 p-0",align:"start",children:s.jsxs(va,{children:[s.jsx(oc,{placeholder:"Search issues...",className:"h-8 text-xs"}),s.jsxs(ya,{children:[s.jsx(lc,{className:"text-xs py-4",children:"No issues found."}),s.jsx(Ts,{children:x.map(N=>{const w=c.includes(N.id);return s.jsxs(sn,{value:`${N.identifier} ${N.title}`,onSelect:()=>v(N.id),className:"gap-2 py-1.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("p",{className:"text-xs truncate",children:[s.jsx("span",{className:"font-mono text-muted-foreground mr-1.5",children:N.identifier}),N.title]})}),s.jsx(At,{className:$("h-3.5 w-3.5 shrink-0",w?"opacity-100 text-indigo-500":"opacity-0")})]},N.id)})})]})]})})]})}/*! @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:Ok,setPrototypeOf:Iy,isFrozen:XR,getPrototypeOf:QR,getOwnPropertyDescriptor:ZR}=Object;let{freeze:Dr,seal:_n,create:zh}=Object,{apply:Fh,construct:Bh}=typeof Reflect<"u"&&Reflect;Dr||(Dr=function(t){return t});_n||(_n=function(t){return t});Fh||(Fh=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return t.apply(r,a)});Bh||(Bh=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return new t(...n)});const Yc=Tr(Array.prototype.forEach),JR=Tr(Array.prototype.lastIndexOf),Ry=Tr(Array.prototype.pop),il=Tr(Array.prototype.push),e$=Tr(Array.prototype.splice),jd=Tr(String.prototype.toLowerCase),zm=Tr(String.prototype.toString),Fm=Tr(String.prototype.match),ol=Tr(String.prototype.replace),t$=Tr(String.prototype.indexOf),r$=Tr(String.prototype.trim),In=Tr(Object.prototype.hasOwnProperty),kr=Tr(RegExp.prototype.test),ll=n$(TypeError);function Tr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return Fh(e,t,n)}}function n$(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Bh(e,r)}}function Le(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jd;Iy&&Iy(e,null);let n=t.length;for(;n--;){let a=t[n];if(typeof a=="string"){const i=r(a);i!==a&&(XR(t)||(t[n]=i),a=i)}e[a]=!0}return e}function s$(e){for(let t=0;t<e.length;t++)In(e,t)||(e[t]=null);return e}function ts(e){const t=zh(null);for(const[r,n]of Ok(e))In(e,r)&&(Array.isArray(n)?t[r]=s$(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=ts(n):t[r]=n);return t}function cl(e,t){for(;e!==null;){const n=ZR(e,t);if(n){if(n.get)return Tr(n.get);if(typeof n.value=="function")return Tr(n.value)}e=QR(e)}function r(){return null}return r}const $y=Dr(["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"]),Bm=Dr(["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"]),qm=Dr(["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$=Dr(["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"]),Wm=Dr(["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"]),i$=Dr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ly=Dr(["#text"]),zy=Dr(["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"]),Um=Dr(["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"]),Fy=Dr(["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"]),Gc=Dr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),o$=_n(/\{\{[\w\W]*|[\w\W]*\}\}/gm),l$=_n(/<%[\w\W]*|[\w\W]*%>/gm),c$=_n(/\$\{[\w\W]*/gm),d$=_n(/^data-[\-\w.\u00B7-\uFFFF]+$/),u$=_n(/^aria-[\-\w]+$/),Ek=_n(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),f$=_n(/^(?:\w+script|data):/i),m$=_n(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ak=_n(/^html$/i),h$=_n(/^[a-z][.\w]*(-[.\w]+)+$/i);var By=Object.freeze({__proto__:null,ARIA_ATTR:u$,ATTR_WHITESPACE:m$,CUSTOM_ELEMENT:h$,DATA_ATTR:d$,DOCTYPE_NAME:Ak,ERB_EXPR:l$,IS_ALLOWED_URI:Ek,IS_SCRIPT_OR_DATA:f$,MUSTACHE_EXPR:o$,TMPLIT_EXPR:c$});const dl={element:1,text:3,progressingInstruction:7,comment:8,document:9},p$=function(){return typeof window>"u"?null:window},x$=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(n=r.getAttribute(a));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}},qy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Dk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p$();const t=Ee=>Dk(Ee);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==dl.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:p}=e,x=c.prototype,g=cl(x,"cloneNode"),v=cl(x,"remove"),y=cl(x,"nextSibling"),b=cl(x,"childNodes"),N=cl(x,"parentNode");if(typeof o=="function"){const Ee=r.createElement("template");Ee.content&&Ee.content.ownerDocument&&(r=Ee.content.ownerDocument)}let w,k="";const{implementation:j,createNodeIterator:C,createDocumentFragment:P,getElementsByTagName:S}=r,{importNode:_}=n;let M=qy();t.isSupported=typeof Ok=="function"&&typeof N=="function"&&j&&j.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:E,ERB_EXPR:A,TMPLIT_EXPR:D,DATA_ATTR:Z,ARIA_ATTR:Q,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:ne}=By;let{IS_ALLOWED_URI:I}=By,O=null;const L=Le({},[...$y,...Bm,...qm,...Wm,...Ly]);let H=null;const R=Le({},[...zy,...Um,...Fy,...Gc]);let Y=Object.seal(zh(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}})),F=null,T=null;const G=Object.seal(zh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let z=!0,se=!0,W=!1,X=!0,ie=!1,V=!0,J=!1,ue=!1,de=!1,ee=!1,ge=!1,be=!1,qe=!0,Ge=!1;const Je="user-content-";let rt=!0,mt=!1,He={},Ze=null;const nr=Le({},["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 Lr=null;const sr=Le({},["audio","video","img","source","image","track"]);let jr=null;const ar=Le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",Bt="http://www.w3.org/2000/svg",Gt="http://www.w3.org/1999/xhtml";let ir=Gt,Vn=!1,bs=null;const Oe=Le({},[wt,Bt,Gt],zm);let ve=Le({},["mi","mo","mn","ms","mtext"]),Ne=Le({},["annotation-xml"]);const pe=Le({},["title","style","font","a","script"]);let we=null;const Xe=["application/xhtml+xml","text/html"],fe="text/html";let Pe=null,Ie=null;const jt=r.createElement("form"),nt=function(K){return K instanceof RegExp||K instanceof Function},st=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ie&&Ie===K)){if((!K||typeof K!="object")&&(K={}),K=ts(K),we=Xe.indexOf(K.PARSER_MEDIA_TYPE)===-1?fe:K.PARSER_MEDIA_TYPE,Pe=we==="application/xhtml+xml"?zm:jd,O=In(K,"ALLOWED_TAGS")?Le({},K.ALLOWED_TAGS,Pe):L,H=In(K,"ALLOWED_ATTR")?Le({},K.ALLOWED_ATTR,Pe):R,bs=In(K,"ALLOWED_NAMESPACES")?Le({},K.ALLOWED_NAMESPACES,zm):Oe,jr=In(K,"ADD_URI_SAFE_ATTR")?Le(ts(ar),K.ADD_URI_SAFE_ATTR,Pe):ar,Lr=In(K,"ADD_DATA_URI_TAGS")?Le(ts(sr),K.ADD_DATA_URI_TAGS,Pe):sr,Ze=In(K,"FORBID_CONTENTS")?Le({},K.FORBID_CONTENTS,Pe):nr,F=In(K,"FORBID_TAGS")?Le({},K.FORBID_TAGS,Pe):ts({}),T=In(K,"FORBID_ATTR")?Le({},K.FORBID_ATTR,Pe):ts({}),He=In(K,"USE_PROFILES")?K.USE_PROFILES:!1,z=K.ALLOW_ARIA_ATTR!==!1,se=K.ALLOW_DATA_ATTR!==!1,W=K.ALLOW_UNKNOWN_PROTOCOLS||!1,X=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=K.SAFE_FOR_TEMPLATES||!1,V=K.SAFE_FOR_XML!==!1,J=K.WHOLE_DOCUMENT||!1,ee=K.RETURN_DOM||!1,ge=K.RETURN_DOM_FRAGMENT||!1,be=K.RETURN_TRUSTED_TYPE||!1,de=K.FORCE_BODY||!1,qe=K.SANITIZE_DOM!==!1,Ge=K.SANITIZE_NAMED_PROPS||!1,rt=K.KEEP_CONTENT!==!1,mt=K.IN_PLACE||!1,I=K.ALLOWED_URI_REGEXP||Ek,ir=K.NAMESPACE||Gt,ve=K.MATHML_TEXT_INTEGRATION_POINTS||ve,Ne=K.HTML_INTEGRATION_POINTS||Ne,Y=K.CUSTOM_ELEMENT_HANDLING||{},K.CUSTOM_ELEMENT_HANDLING&&nt(K.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=K.CUSTOM_ELEMENT_HANDLING.tagNameCheck),K.CUSTOM_ELEMENT_HANDLING&&nt(K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=K.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=K.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ie&&(se=!1),ge&&(ee=!0),He&&(O=Le({},Ly),H=[],He.html===!0&&(Le(O,$y),Le(H,zy)),He.svg===!0&&(Le(O,Bm),Le(H,Um),Le(H,Gc)),He.svgFilters===!0&&(Le(O,qm),Le(H,Um),Le(H,Gc)),He.mathMl===!0&&(Le(O,Wm),Le(H,Fy),Le(H,Gc))),K.ADD_TAGS&&(typeof K.ADD_TAGS=="function"?G.tagCheck=K.ADD_TAGS:(O===L&&(O=ts(O)),Le(O,K.ADD_TAGS,Pe))),K.ADD_ATTR&&(typeof K.ADD_ATTR=="function"?G.attributeCheck=K.ADD_ATTR:(H===R&&(H=ts(H)),Le(H,K.ADD_ATTR,Pe))),K.ADD_URI_SAFE_ATTR&&Le(jr,K.ADD_URI_SAFE_ATTR,Pe),K.FORBID_CONTENTS&&(Ze===nr&&(Ze=ts(Ze)),Le(Ze,K.FORBID_CONTENTS,Pe)),K.ADD_FORBID_CONTENTS&&(Ze===nr&&(Ze=ts(Ze)),Le(Ze,K.ADD_FORBID_CONTENTS,Pe)),rt&&(O["#text"]=!0),J&&Le(O,["html","head","body"]),O.table&&(Le(O,["tbody"]),delete F.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw ll('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ll('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=K.TRUSTED_TYPES_POLICY,k=w.createHTML("")}else w===void 0&&(w=x$(p,a)),w!==null&&typeof k=="string"&&(k=w.createHTML(""));Dr&&Dr(K),Ie=K}},Nr=Le({},[...Bm,...qm,...a$]),or=Le({},[...Wm,...i$]),Xn=function(K){let he=N(K);(!he||!he.tagName)&&(he={namespaceURI:ir,tagName:"template"});const Se=jd(K.tagName),gt=jd(he.tagName);return bs[K.namespaceURI]?K.namespaceURI===Bt?he.namespaceURI===Gt?Se==="svg":he.namespaceURI===wt?Se==="svg"&&(gt==="annotation-xml"||ve[gt]):!!Nr[Se]:K.namespaceURI===wt?he.namespaceURI===Gt?Se==="math":he.namespaceURI===Bt?Se==="math"&&Ne[gt]:!!or[Se]:K.namespaceURI===Gt?he.namespaceURI===Bt&&!Ne[gt]||he.namespaceURI===wt&&!ve[gt]?!1:!or[Se]&&(pe[Se]||!Nr[Se]):!!(we==="application/xhtml+xml"&&bs[K.namespaceURI]):!1},Qn=function(K){il(t.removed,{element:K});try{N(K).removeChild(K)}catch{v(K)}},Ba=function(K,he){try{il(t.removed,{attribute:he.getAttributeNode(K),from:he})}catch{il(t.removed,{attribute:null,from:he})}if(he.removeAttribute(K),K==="is")if(ee||ge)try{Qn(he)}catch{}else try{he.setAttribute(K,"")}catch{}},Kv=function(K){let he=null,Se=null;if(de)K="<remove></remove>"+K;else{const $t=Fm(K,/^[\r\n\t ]+/);Se=$t&&$t[0]}we==="application/xhtml+xml"&&ir===Gt&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const gt=w?w.createHTML(K):K;if(ir===Gt)try{he=new m().parseFromString(gt,we)}catch{}if(!he||!he.documentElement){he=j.createDocument(ir,"template",null);try{he.documentElement.innerHTML=Vn?k:gt}catch{}}const xr=he.body||he.documentElement;return K&&Se&&xr.insertBefore(r.createTextNode(Se),xr.childNodes[0]||null),ir===Gt?S.call(he,J?"html":"body")[0]:J?he.documentElement:xr},Yv=function(K){return C.call(K.ownerDocument||K,K,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},bm=function(K){return K instanceof f&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof u)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},Gv=function(K){return typeof l=="function"&&K instanceof l};function ws(Ee,K,he){Yc(Ee,Se=>{Se.call(t,K,he,Ie)})}const Vv=function(K){let he=null;if(ws(M.beforeSanitizeElements,K,null),bm(K))return Qn(K),!0;const Se=Pe(K.nodeName);if(ws(M.uponSanitizeElement,K,{tagName:Se,allowedTags:O}),V&&K.hasChildNodes()&&!Gv(K.firstElementChild)&&kr(/<[/\w!]/g,K.innerHTML)&&kr(/<[/\w!]/g,K.textContent)||K.nodeType===dl.progressingInstruction||V&&K.nodeType===dl.comment&&kr(/<[/\w]/g,K.data))return Qn(K),!0;if(!(G.tagCheck instanceof Function&&G.tagCheck(Se))&&(!O[Se]||F[Se])){if(!F[Se]&&Qv(Se)&&(Y.tagNameCheck instanceof RegExp&&kr(Y.tagNameCheck,Se)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(Se)))return!1;if(rt&&!Ze[Se]){const gt=N(K)||K.parentNode,xr=b(K)||K.childNodes;if(xr&>){const $t=xr.length;for(let zr=$t-1;zr>=0;--zr){const js=g(xr[zr],!0);js.__removalCount=(K.__removalCount||0)+1,gt.insertBefore(js,y(K))}}}return Qn(K),!0}return K instanceof c&&!Xn(K)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&kr(/<\/no(script|embed|frames)/i,K.innerHTML)?(Qn(K),!0):(ie&&K.nodeType===dl.text&&(he=K.textContent,Yc([E,A,D],gt=>{he=ol(he,gt," ")}),K.textContent!==he&&(il(t.removed,{element:K.cloneNode()}),K.textContent=he)),ws(M.afterSanitizeElements,K,null),!1)},Xv=function(K,he,Se){if(qe&&(he==="id"||he==="name")&&(Se in r||Se in jt))return!1;if(!(se&&!T[he]&&kr(Z,he))){if(!(z&&kr(Q,he))){if(!(G.attributeCheck instanceof Function&&G.attributeCheck(he,K))){if(!H[he]||T[he]){if(!(Qv(K)&&(Y.tagNameCheck instanceof RegExp&&kr(Y.tagNameCheck,K)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(K))&&(Y.attributeNameCheck instanceof RegExp&&kr(Y.attributeNameCheck,he)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(he,K))||he==="is"&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&kr(Y.tagNameCheck,Se)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(Se))))return!1}else if(!jr[he]){if(!kr(I,ol(Se,te,""))){if(!((he==="src"||he==="xlink:href"||he==="href")&&K!=="script"&&t$(Se,"data:")===0&&Lr[K])){if(!(W&&!kr(q,ol(Se,te,"")))){if(Se)return!1}}}}}}}return!0},Qv=function(K){return K!=="annotation-xml"&&Fm(K,ne)},Zv=function(K){ws(M.beforeSanitizeAttributes,K,null);const{attributes:he}=K;if(!he||bm(K))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let gt=he.length;for(;gt--;){const xr=he[gt],{name:$t,namespaceURI:zr,value:js}=xr,Ri=Pe($t),wm=js;let lr=$t==="value"?wm:r$(wm);if(Se.attrName=Ri,Se.attrValue=lr,Se.keepAttr=!0,Se.forceKeepAttr=void 0,ws(M.uponSanitizeAttribute,K,Se),lr=Se.attrValue,Ge&&(Ri==="id"||Ri==="name")&&(Ba($t,K),lr=Je+lr),V&&kr(/((--!?|])>)|<\/(style|title|textarea)/i,lr)){Ba($t,K);continue}if(Ri==="attributename"&&Fm(lr,"href")){Ba($t,K);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){Ba($t,K);continue}if(!X&&kr(/\/>/i,lr)){Ba($t,K);continue}ie&&Yc([E,A,D],ey=>{lr=ol(lr,ey," ")});const Jv=Pe(K.nodeName);if(!Xv(Jv,Ri,lr)){Ba($t,K);continue}if(w&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!zr)switch(p.getAttributeType(Jv,Ri)){case"TrustedHTML":{lr=w.createHTML(lr);break}case"TrustedScriptURL":{lr=w.createScriptURL(lr);break}}if(lr!==wm)try{zr?K.setAttributeNS(zr,$t,lr):K.setAttribute($t,lr),bm(K)?Qn(K):Ry(t.removed)}catch{Ba($t,K)}}ws(M.afterSanitizeAttributes,K,null)},eE=function Ee(K){let he=null;const Se=Yv(K);for(ws(M.beforeSanitizeShadowDOM,K,null);he=Se.nextNode();)ws(M.uponSanitizeShadowNode,he,null),Vv(he),Zv(he),he.content instanceof i&&Ee(he.content);ws(M.afterSanitizeShadowDOM,K,null)};return t.sanitize=function(Ee){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},he=null,Se=null,gt=null,xr=null;if(Vn=!Ee,Vn&&(Ee="<!-->"),typeof Ee!="string"&&!Gv(Ee))if(typeof Ee.toString=="function"){if(Ee=Ee.toString(),typeof Ee!="string")throw ll("dirty is not a string, aborting")}else throw ll("toString is not a function");if(!t.isSupported)return Ee;if(ue||st(K),t.removed=[],typeof Ee=="string"&&(mt=!1),mt){if(Ee.nodeName){const js=Pe(Ee.nodeName);if(!O[js]||F[js])throw ll("root node is forbidden and cannot be sanitized in-place")}}else if(Ee instanceof l)he=Kv("<!---->"),Se=he.ownerDocument.importNode(Ee,!0),Se.nodeType===dl.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?he=Se:he.appendChild(Se);else{if(!ee&&!ie&&!J&&Ee.indexOf("<")===-1)return w&&be?w.createHTML(Ee):Ee;if(he=Kv(Ee),!he)return ee?null:be?k:""}he&&de&&Qn(he.firstChild);const $t=Yv(mt?Ee:he);for(;gt=$t.nextNode();)Vv(gt),Zv(gt),gt.content instanceof i&&eE(gt.content);if(mt)return Ee;if(ee){if(ge)for(xr=P.call(he.ownerDocument);he.firstChild;)xr.appendChild(he.firstChild);else xr=he;return(H.shadowroot||H.shadowrootmode)&&(xr=_.call(n,xr,!0)),xr}let zr=J?he.outerHTML:he.innerHTML;return J&&O["!doctype"]&&he.ownerDocument&&he.ownerDocument.doctype&&he.ownerDocument.doctype.name&&kr(Ak,he.ownerDocument.doctype.name)&&(zr="<!DOCTYPE "+he.ownerDocument.doctype.name+`>
|
|
581
|
-
`+zr),ie&&Yc([E,A,D],js=>{zr=ol(zr,js," ")}),w&&be?w.createHTML(zr):zr},t.setConfig=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};st(Ee),ue=!0},t.clearConfig=function(){Ie=null,ue=!1},t.isValidAttribute=function(Ee,K,he){Ie||st({});const Se=Pe(Ee),gt=Pe(K);return Xv(Se,gt,he)},t.addHook=function(Ee,K){typeof K=="function"&&il(M[Ee],K)},t.removeHook=function(Ee,K){if(K!==void 0){const he=JR(M[Ee],K);return he===-1?void 0:e$(M[Ee],he,1)[0]}return Ry(M[Ee])},t.removeHooks=function(Ee){M[Ee]=[]},t.removeAllHooks=function(){M=qy()},t}var g$=Dk();function v$(e){var t;const{char:r,allowSpaces:n,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:o,$position:l}=e,c=n&&!a,d=aA(r),u=new RegExp(`\\s${d}$`),f=o?"^":"",m=a?"":d,p=c?new RegExp(`${f}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${m}]*`,"gm"),x=((t=l.nodeBefore)==null?void 0:t.isText)&&l.nodeBefore.text;if(!x)return null;const g=l.pos-x.length,v=Array.from(x.matchAll(p)).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),b=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!b)return null;const N=g+v.index;let w=N+v[0].length;return c&&u.test(x.slice(w-1,w+1))&&(v[0]+=" ",w+=1),N<l.pos&&w>=l.pos?{range:{from:N,to:w},query:v[0].slice(r.length),text:v[0]}:null}var y$=new P1("suggestion");function b$({pluginKey:e=y$,editor:t,char:r="@",allowSpaces:n=!1,allowToIncludeChar:a=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:c="suggestion",decorationContent:d="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:m=()=>[],render:p=()=>({}),allow:x=()=>!0,findSuggestionMatch:g=v$,shouldShow:v}){let y;const b=p==null?void 0:p(),N=()=>{const C=t.state.selection.$anchor.pos,P=t.view.coordsAtPos(C),{top:S,right:_,bottom:M,left:E}=P;try{return new DOMRect(E,S,_-E,M-S)}catch{return null}},w=(C,P)=>P?()=>{const S=e.getState(t.state),_=S==null?void 0:S.decorationId,M=C.dom.querySelector(`[data-decoration-id="${_}"]`);return(M==null?void 0:M.getBoundingClientRect())||null}:N;function k(C,P){var S;try{const M=e.getState(C.state),E=M!=null&&M.decorationId?C.dom.querySelector(`[data-decoration-id="${M.decorationId}"]`):null,A={editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},query:(M==null?void 0:M.query)||null,text:(M==null?void 0:M.text)||null,items:[],command:D=>f({editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},props:D}),decorationNode:E,clientRect:w(C,E)};(S=b==null?void 0:b.onExit)==null||S.call(b,A)}catch{}const _=C.state.tr.setMeta(P,{exit:!0});C.dispatch(_)}const j=new rA({key:e,view(){return{update:async(C,P)=>{var S,_,M,E,A,D,Z;const Q=(S=this.key)==null?void 0:S.getState(P),q=(_=this.key)==null?void 0:_.getState(C.state),te=Q.active&&q.active&&Q.range.from!==q.range.from,ne=!Q.active&&q.active,I=Q.active&&!q.active,O=!ne&&!I&&Q.query!==q.query,L=ne||te&&O,H=O||te,R=I||te&&O;if(!L&&!H&&!R)return;const Y=R&&!L?Q:q,F=C.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`);y={editor:t,range:Y.range,query:Y.query,text:Y.text,items:[],command:T=>f({editor:t,range:Y.range,props:T}),decorationNode:F,clientRect:w(C,F)},L&&((M=b==null?void 0:b.onBeforeStart)==null||M.call(b,y)),H&&((E=b==null?void 0:b.onBeforeUpdate)==null||E.call(b,y)),(H||L)&&(y.items=await m({editor:t,query:Y.query})),R&&((A=b==null?void 0:b.onExit)==null||A.call(b,y)),H&&((D=b==null?void 0:b.onUpdate)==null||D.call(b,y)),L&&((Z=b==null?void 0:b.onStart)==null||Z.call(b,y))},destroy:()=>{var C;y&&((C=b==null?void 0:b.onExit)==null||C.call(b,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,P,S,_){const{isEditable:M}=t,{composing:E}=t.view,{selection:A}=C,{empty:D,from:Z}=A,Q={...P},q=C.getMeta(e);if(q&&q.exit)return Q.active=!1,Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null,Q;if(Q.composing=E,M&&(D||t.view.composing)){(Z<P.range.from||Z>P.range.to)&&!E&&!P.composing&&(Q.active=!1);const te=g({char:r,allowSpaces:n,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:o,$position:A.$from}),ne=`id_${Math.floor(Math.random()*4294967295)}`;te&&x({editor:t,state:_,range:te.range,isActive:P.active})&&(!v||v({editor:t,range:te.range,query:te.query,text:te.text,transaction:C}))?(Q.active=!0,Q.decorationId=P.decorationId?P.decorationId:ne,Q.range=te.range,Q.query=te.query,Q.text=te.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(C,P){var S,_,M,E;const{active:A,range:D}=j.getState(C.state);if(!A)return!1;if(P.key==="Escape"||P.key==="Esc"){const Q=j.getState(C.state),q=(S=y==null?void 0:y.decorationNode)!=null?S:null,te=q??(Q!=null&&Q.decorationId?C.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`):null);if(((_=b==null?void 0:b.onKeyDown)==null?void 0:_.call(b,{view:C,event:P,range:Q.range}))||!1)return!0;const I={editor:t,range:Q.range,query:Q.query,text:Q.text,items:[],command:O=>f({editor:t,range:Q.range,props:O}),decorationNode:te,clientRect:te?()=>te.getBoundingClientRect()||null:null};return(M=b==null?void 0:b.onExit)==null||M.call(b,I),k(C,e),!0}return((E=b==null?void 0:b.onKeyDown)==null?void 0:E.call(b,{view:C,event:P,range:D}))||!1},decorations(C){const{active:P,range:S,decorationId:_,query:M}=j.getState(C);if(!P)return null;const E=!(M!=null&&M.length),A=[c];return E&&A.push(u),nA.create(C.doc,[sA.inline(S.from,S.to,{nodeName:l,class:A.join(" "),"data-decoration-id":_,"data-decoration-content":d})])}}});return j}function w$({editor:e,overrideSuggestionOptions:t,extensionName:r,char:n="@"}){const a=new P1;return{editor:e,char:n,pluginKey:a,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 Tk(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>w$({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function Wy(e,t){const r=Tk(e),n=r.find(a=>a.char===t);return n||(r.length?r[0]:null)}var j$=iA.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,a;return["span",zc(this.HTMLAttributes,e.HTMLAttributes),`${(n=r==null?void 0:r.char)!=null?n:"@"}${(a=t.attrs.label)!=null?a: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=Wy(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",zc({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:r})];const n={...this.options};n.HTMLAttributes=zc({"data-type":this.name},this.options.HTMLAttributes,t);const a=this.options.renderHTML({options:n,node:e,suggestion:r});return typeof a=="string"?["span",zc({"data-type":this.name},this.options.HTMLAttributes,t),a]:a},...lA({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[,a,i,o]=n,l=i??o;t[a==="char"?"mentionSuggestionChar":a]=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:Wy(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:a,anchor:i}=n;if(!a)return!1;let o=new oA,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 Tk(this).map(b$)}}),Ik=j$;const Wx={byIssue:e=>["attachments",e]};function Rk(e){return De({queryKey:Wx.byIssue(e),queryFn:()=>oe.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function $k(e){const t=ye();return xe({mutationFn:({file:r,commentId:n})=>{const a=new FormData;return a.append("file",r),n&&a.append("comment_id",n),oe.upload(`/admin/issues/${e}/attachments`,a)},onSuccess:()=>{t.invalidateQueries({queryKey:Wx.byIssue(e)})}})}function N$(e){const t=ye();return xe({mutationFn:r=>oe.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Wx.byIssue(e)})}})}function Tl(e){return e.startsWith("image/")}function uf(e){return e.startsWith("video/")}function ff(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Fd(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function Ux(e,t){if(!Fd(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 Hx({mimeType:e,className:t}){return Tl(e)?s.jsx(Y5,{className:t}):uf(e)?s.jsx(Ol,{className:t}):e.startsWith("text/")||e.includes("json")?s.jsx(K5,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?s.jsx(H5,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?s.jsx(G5,{className:t}):s.jsx(V5,{className:t})}function Lk({attachment:e,onClose:t}){return e?s.jsx(Mi,{open:!0,onOpenChange:r=>!r&&t(),children:s.jsxs(Oi,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[s.jsxs(Ao,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[s.jsx(To,{className:"text-sm font-medium truncate",children:e.original_name}),s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>Ux(e.url,e.original_name),children:[s.jsx(dx,{className:"h-3.5 w-3.5"}),"Download"]})]}),s.jsxs(Do,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[Tl(e.mime_type)&&Fd(e.url)&&s.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),uf(e.mime_type)&&Fd(e.url)&&s.jsx("video",{src:e.url,controls:!0,className:"max-w-full max-h-[75vh]"})]}),s.jsxs("div",{className:"px-4 py-2 border-t border-border text-[11px] text-muted-foreground flex items-center gap-3 shrink-0",children:[s.jsx("span",{children:ff(e.size)}),s.jsx("span",{children:"·"}),s.jsx("span",{children:e.mime_type}),s.jsx("span",{children:"·"}),s.jsxs("span",{children:["Uploaded ",me(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function k$({attachment:e}){const[t,r]=h.useState(null),n=Tl(e.mime_type)||uf(e.mime_type),a=()=>{n?r(e):Ux(e.url,e.original_name)};return s.jsxs(s.Fragment,{children:[Tl(e.mime_type)?s.jsx("button",{type:"button",onClick:a,className:"block rounded-md overflow-hidden border border-border hover:opacity-90 transition-opacity",title:e.original_name,children:s.jsx("img",{src:Fd(e.url)?e.url:"",alt:e.original_name,className:"max-h-48 max-w-xs object-cover"})}):s.jsxs("button",{type:"button",onClick:a,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:[s.jsx(Hx,{mimeType:e.mime_type,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-foreground truncate",children:e.original_name}),s.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:ff(e.size)}),!n&&s.jsx(dx,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&s.jsx(Lk,{attachment:t,onClose:()=>r(null)})]})}function S$({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const a=Tl(e.mime_type)||uf(e.mime_type),i=()=>{a?t(e):Ux(e.url,e.original_name)};return s.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[s.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:a?"View":"Download",children:s.jsx(Hx,{mimeType:e.mime_type,className:"h-4 w-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.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}),s.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[s.jsx("span",{children:ff(e.size)}),s.jsx("span",{children:"·"}),s.jsx("span",{children:me(new Date(e.created_at),"MMM d, yyyy")}),e.comment_id&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsx("span",{className:"italic",children:"from comment"})]}),!a&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx(dx,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),s.jsx(re,{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:s.jsx(wr,{className:"h-3.5 w-3.5"})})]})}function C$({onFiles:e,isUploading:t}){const[r,n]=h.useState(!1),a=h.useRef(null),i=h.useCallback(o=>{o.preventDefault(),n(!1);const l=Array.from(o.dataTransfer.files);l.length>0&&e(l)},[e]);return s.jsxs("div",{onDragOver:o=>{o.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:i,onClick:()=>{var o;return!t&&((o=a.current)==null?void 0:o.click())},className:$("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:[s.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted",children:s.jsx(xD,{className:"h-4 w-4 text-muted-foreground"})}),s.jsx("p",{className:"text-xs font-medium text-foreground",children:t?"Uploading…":"Drop files or click to browse"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to 50 MB per file"}),s.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:o=>{const l=Array.from(o.target.files??[]);l.length>0&&e(l),o.target.value=""}})]})}function _$({issueId:e,className:t}){const[r,n]=h.useState(null),{data:a,isLoading:i}=Rk(e),o=$k(e),l=N$(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>B.success(`${f.name} uploaded`),onError:()=>B.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>B.success("Attachment removed"),onError:()=>B.error("Failed to remove attachment")})};return s.jsxs("div",{className:$("px-6 py-4 space-y-4",t),children:[s.jsx(C$,{onFiles:c,isUploading:o.isPending}),i?s.jsx("div",{className:"space-y-2",children:[1,2].map(u=>s.jsxs("div",{className:"flex items-center gap-3 px-3",children:[s.jsx(le,{className:"h-8 w-8 rounded-md shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-3 w-2/3"}),s.jsx(le,{className:"h-2.5 w-1/3"})]})]},u))}):a&&a.length>0?s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[s.jsx(hx,{className:"h-3 w-3 text-muted-foreground"}),s.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[a.length," ",a.length===1?"file":"files"]})]}),s.jsx("div",{children:a.map(u=>s.jsx(S$,{attachment:u,onOpen:n,onDelete:d,isDeleting:l.isPending},u.id))})]}):s.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No attachments yet."}),s.jsx(Lk,{attachment:r,onClose:()=>n(null)})]})}function P$(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return s.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,M$(a,...t)]}function M$(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var O$=Symbol("radix.slottable");function E$(e){const t=({children:r})=>s.jsx(s.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=O$,t}var zk="AlertDialog",[A$]=P$(zk,[b1]),ra=b1(),Fk=e=>{const{__scopeAlertDialog:t,...r}=e,n=ra(t);return s.jsx(ec,{...n,...r,modal:!0})};Fk.displayName=zk;var D$="AlertDialogTrigger",T$=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ra(r);return s.jsx(ME,{...a,...n,ref:t})});T$.displayName=D$;var I$="AlertDialogPortal",Bk=e=>{const{__scopeAlertDialog:t,...r}=e,n=ra(t);return s.jsx(Jl,{...n,...r})};Bk.displayName=I$;var R$="AlertDialogOverlay",qk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ra(r);return s.jsx(ki,{...a,...n,ref:t})});qk.displayName=R$;var Zi="AlertDialogContent",[$$,L$]=A$(Zi),z$=E$("AlertDialogContent"),Wk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,i=ra(r),o=h.useRef(null),l=ko(t,o),c=h.useRef(null);return s.jsx(PE,{contentName:Zi,titleName:Uk,docsSlug:"alert-dialog",children:s.jsx($$,{scope:r,cancelRef:c,children:s.jsxs(Si,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:Cs(a.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[s.jsx(z$,{children:n}),s.jsx(B$,{contentRef:o})]})})})});Wk.displayName=Zi;var Uk="AlertDialogTitle",Hk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ra(r);return s.jsx(jo,{...a,...n,ref:t})});Hk.displayName=Uk;var Kk="AlertDialogDescription",Yk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ra(r);return s.jsx(No,{...a,...n,ref:t})});Yk.displayName=Kk;var F$="AlertDialogAction",Gk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ra(r);return s.jsx(qu,{...a,...n,ref:t})});Gk.displayName=F$;var Vk="AlertDialogCancel",Xk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=L$(Vk,r),i=ra(r),o=ko(t,a);return s.jsx(qu,{...i,...n,ref:o})});Xk.displayName=Vk;var B$=({contentRef:e})=>{const t=`\`${Zi}\` requires a description for the component to be accessible for screen reader users.
|
|
582
|
-
|
|
583
|
-
You can add a description to the \`${Zi}\` by passing a \`${Kk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
584
|
-
|
|
585
|
-
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 \`${Zi}\`. 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.
|
|
586
|
-
|
|
587
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},q$=Fk,W$=Bk,Qk=qk,Zk=Wk,Jk=Gk,eS=Xk,tS=Hk,rS=Yk;const oi=q$,U$=W$,nS=h.forwardRef(({className:e,...t},r)=>s.jsx(Qk,{className:$("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}));nS.displayName=Qk.displayName;const wa=h.forwardRef(({className:e,...t},r)=>s.jsxs(U$,{children:[s.jsx(nS,{}),s.jsx(Zk,{ref:r,className:$("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})]}));wa.displayName=Zk.displayName;const ja=({className:e,...t})=>s.jsx("div",{className:$("flex flex-col space-y-2 text-center sm:text-left",e),...t});ja.displayName="AlertDialogHeader";const Na=({className:e,...t})=>s.jsx("div",{className:$("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Na.displayName="AlertDialogFooter";const ka=h.forwardRef(({className:e,...t},r)=>s.jsx(tS,{ref:r,className:$("text-base font-semibold",e),...t}));ka.displayName=tS.displayName;const Sa=h.forwardRef(({className:e,...t},r)=>s.jsx(rS,{ref:r,className:$("text-sm text-muted-foreground",e),...t}));Sa.displayName=rS.displayName;const Ca=h.forwardRef(({className:e,...t},r)=>s.jsx(Jk,{ref:r,className:$(Qi(),e),...t}));Ca.displayName=Jk.displayName;const _a=h.forwardRef(({className:e,...t},r)=>s.jsx(eS,{ref:r,className:$(Qi({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));_a.displayName=eS.displayName;function co({open:e,onClose:t,onConfirm:r,title:n,description:a,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return s.jsx(oi,{open:e,onOpenChange:c=>!c&&t(),children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsx(ka,{children:n}),s.jsx(Sa,{children:a})]}),s.jsxs(Na,{children:[s.jsx(_a,{onClick:t,disabled:l,children:"Cancel"}),s.jsx(Ca,{onClick:r,disabled:l,className:$(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function H$({startedAt:e}){const[t,r]=h.useState(()=>Rd(e));return h.useEffect(()=>{const n=setInterval(()=>r(Rd(e)),1e3);return()=>clearInterval(n)},[e]),s.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function K$({onSubmit:e,isPending:t,onCancel:r}){const[n,a]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(new Date().toISOString().split("T")[0]),f=m=>{m.preventDefault();const p=parseInt(n||"0",10),x=parseInt(i||"0",10),g=p*60+x;if(g<=0){B.error("Please enter a duration greater than 0.");return}e({duration_minutes:g,description:l.trim()||void 0,logged_date:d||void 0})};return s.jsxs("form",{onSubmit:f,className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[s.jsx("p",{className:"text-xs font-medium text-foreground",children:"Log time manually"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Hours"}),s.jsx(_e,{type:"number",min:"0",max:"999",placeholder:"0",value:n,onChange:m=>a(m.target.value),className:"h-8 text-sm"})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Minutes"}),s.jsx(_e,{type:"number",min:"0",max:"59",placeholder:"0",value:i,onChange:m=>o(m.target.value),className:"h-8 text-sm"})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Date"}),s.jsx(_e,{type:"date",value:d,onChange:m=>u(m.target.value),className:"h-8 text-sm"})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:["Description ",s.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),s.jsx(_e,{placeholder:"What did you work on?",value:l,onChange:m=>c(m.target.value),className:"h-8 text-sm"})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),s.jsx(re,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function Y$({entry:e,onSave:t,onCancel:r,isPending:n}){const a=e.duration_minutes??0,[i,o]=h.useState(String(Math.floor(a/60))),[l,c]=h.useState(String(a%60)),[d,u]=h.useState(e.description??""),[f,m]=h.useState(e.logged_date?new Date(e.logged_date).toISOString().split("T")[0]:new Date().toISOString().split("T")[0]),p=x=>{x.preventDefault();const g=parseInt(i||"0",10),v=parseInt(l||"0",10),y=g*60+v;if(y<=0){B.error("Please enter a duration greater than 0.");return}t({duration_minutes:y,description:d.trim()||void 0,logged_date:f||void 0})};return s.jsxs("form",{onSubmit:p,className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"w-16",children:[s.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Hours"}),s.jsx(_e,{type:"number",min:"0",max:"999",value:i,onChange:x=>o(x.target.value),className:"h-7 text-xs"})]}),s.jsxs("div",{className:"w-16",children:[s.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Min"}),s.jsx(_e,{type:"number",min:"0",max:"59",value:l,onChange:x=>c(x.target.value),className:"h-7 text-xs"})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Date"}),s.jsx(_e,{type:"date",value:f,onChange:x=>m(x.target.value),className:"h-7 text-xs"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Description"}),s.jsx(_e,{placeholder:"What did you work on?",value:d,onChange:x=>u(x.target.value),className:"h-7 text-xs"})]}),s.jsxs("div",{className:"flex justify-end gap-1.5 pt-0.5",children:[s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:r,disabled:n,children:s.jsx(We,{className:"h-3 w-3"})}),s.jsx(re,{type:"submit",size:"icon",className:"h-6 w-6",disabled:n,children:s.jsx(At,{className:"h-3 w-3"})})]})]})}function G$({entry:e,userName:t,isOwnEntry:r,onDelete:n,isDeleting:a,onEdit:i,isEditing:o,editForm:l}){const c=e.started_at!=null&&e.stopped_at==null;return o?s.jsx("div",{className:"py-1.5 px-3",children:l}):s.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[s.jsx("div",{className:$("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",c?"bg-emerald-50 dark:bg-emerald-950/40":e.source==="timer"?"bg-sky-50 dark:bg-sky-950/40":"bg-violet-50 dark:bg-violet-950/40"),children:c?s.jsx(dN,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?s.jsx(dn,{className:"h-3.5 w-3.5 text-sky-600 dark:text-sky-400"}):s.jsx(W5,{className:"h-3.5 w-3.5 text-violet-600 dark:text-violet-400"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[c?s.jsx(H$,{startedAt:e.started_at}):s.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:Id(e.duration_minutes??0)}),s.jsx(Cn,{variant:"muted",className:$("text-[10px] px-1.5 py-0",c?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":e.source==="timer"?"bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-400":"bg-violet-100 text-violet-700 dark:bg-violet-950 dark:text-violet-400"),children:c?"Running":e.source==="timer"?"Timer":"Manual"}),t&&s.jsx("span",{className:"text-[11px] text-foreground",children:t})]}),e.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!c&&s.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:me(new Date(e.logged_date),"MMM d, yyyy")})]}),!c&&r&&s.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover:opacity-100 transition-all mt-0.5",children:[s.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>i(e.id),children:s.jsx(Fs,{className:"h-3.5 w-3.5"})}),s.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>n(e.id),disabled:a,children:s.jsx(wr,{className:"h-3.5 w-3.5"})})]})]})}function V$({issueId:e,className:t}){const[r,n]=h.useState(!1),[a,i]=h.useState(null),[o,l]=h.useState(null),{data:c,isLoading:d}=jT(e),{data:u}=NT(e),{data:f}=$a(),{user:m}=Te(),p=kT(e),x=ST(e),g=CT(e),v=_T(e),y=PT(e),b=(c==null?void 0:c.time_logs)??[],N=(c==null?void 0:c.total_minutes)??0,w=u!=null,k=_=>{p.mutate(_,{onSuccess:()=>{n(!1),B.success("Time logged")},onError:()=>B.error("Failed to log time")})},j=()=>{x.mutate(void 0,{onSuccess:_=>{_.stopped_timer?B.success("Previous timer stopped, new timer started"):B.success("Timer started")},onError:_=>B.error(_.message??"Failed to start timer")})},C=()=>{g.mutate(void 0,{onSuccess:_=>{const M=_.time_log.duration_minutes??0;B.success(`Timer stopped — ${Id(M)} logged`)},onError:()=>B.error("Failed to stop timer")})},P=()=>{o&&v.mutate(o,{onSuccess:()=>{l(null),B.success("Time entry removed")},onError:()=>B.error("Failed to remove entry")})},S=(_,M)=>{y.mutate({logId:_,data:M},{onSuccess:()=>{i(null),B.success("Time entry updated")},onError:()=>B.error("Failed to update entry")})};return s.jsxs("div",{className:$("px-6 py-4 space-y-4",t),children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Total logged"}),s.jsx("p",{className:"text-xl font-bold text-foreground tabular-nums",children:N>0?Id(N):"—"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[!r&&s.jsxs(re,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Log time"]}),w?s.jsxs(re,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:C,disabled:g.isPending,children:[s.jsx(lN,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):s.jsxs(re,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:j,disabled:x.isPending,children:[s.jsx(Ol,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&s.jsx(K$,{onSubmit:k,isPending:p.isPending,onCancel:()=>n(!1)}),d?s.jsx("div",{className:"space-y-2",children:[1,2].map(_=>s.jsxs("div",{className:"flex items-center gap-3 px-3",children:[s.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-3 w-1/3"}),s.jsx(le,{className:"h-2.5 w-1/4"})]})]},_))}):b.length>0?s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[s.jsx(dn,{className:"h-3 w-3 text-muted-foreground"}),s.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[b.length," ",b.length===1?"entry":"entries"]})]}),s.jsx("div",{children:b.map(_=>{var M;return s.jsx(G$,{entry:_,userName:(M=f==null?void 0:f.get(_.user_id))==null?void 0:M.name,isOwnEntry:_.user_id===(m==null?void 0:m.id),onDelete:l,isDeleting:v.isPending,onEdit:i,isEditing:a===_.id,editForm:s.jsx(Y$,{entry:_,onSave:E=>S(_.id,E),onCancel:()=>i(null),isPending:y.isPending})},_.id)})})]}):s.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."}),s.jsx(co,{open:o!==null,onClose:()=>l(null),onConfirm:P,title:"Delete time entry",description:"This time entry will be permanently removed. This action cannot be undone.",confirmLabel:"Delete",variant:"destructive",loading:v.isPending})]})}function Ua({onClick:e,active:t,title:r,children:n}){return s.jsx("button",{type:"button",title:r,onMouseDown:a=>{a.preventDefault(),e()},className:$("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 Uy(){return s.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}const Vc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function sS({issueId:e,projectId:t,compact:r,className:n,onSuccess:a}){const[i,o]=h.useState(!0),[l,c]=h.useState([]),[d,u]=h.useState(!1),[f,m]=h.useState(Vc),p=h.useRef(null),x=h.useRef(async()=>{}),g=h.useRef(null),{user:v}=Te(),y=L5(e),b=$k(e),{data:N}=Kn(t??""),w=h.useMemo(()=>N!=null&&N.members?N.members.filter(F=>F.user).map(F=>{const T=F.user,G=`${T.first_name??""} ${T.last_name??""}`.trim()||T.email;return{id:T.id,label:G,email:T.email}}):[],[N]),k=h.useRef([]);k.current=w;const j=h.useRef(m);j.current=m;const C=h.useRef([]),P=h.useRef(null),S=h.useRef(0),_=(v==null?void 0:v.first_name)??"",M=(v==null?void 0:v.last_name)??"",E=`${_} ${M}`.trim()||(v==null?void 0:v.email)||"?",A=v&&`${_[0]??""}${M[0]??""}`.toUpperCase()||"?",D=Kx(E),Z=h.useMemo(()=>cA.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(x.current(),!0)}}}),[]),Q=h.useMemo(()=>Ik.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:F})=>{const T=k.current;if(!T.length)return[];const G=F.toLowerCase();return T.filter(z=>!G||z.label.toLowerCase().includes(G)||z.email.toLowerCase().includes(G)).slice(0,8)},render:()=>({onStart:F=>{var T;C.current=F.items,P.current=F.command,S.current=0,j.current({active:!0,items:F.items,selectedIndex:0,rect:((T=F.clientRect)==null?void 0:T.call(F))??null,command:F.command})},onUpdate:F=>{var T;C.current=F.items,P.current=F.command,S.current=0,j.current({active:!0,items:F.items,selectedIndex:0,rect:((T=F.clientRect)==null?void 0:T.call(F))??null,command:F.command})},onKeyDown:({event:F})=>{var G;const T=C.current;if(!T.length)return!1;if(F.key==="Escape")return j.current(Vc),!0;if(F.key==="ArrowDown"){const z=(S.current+1)%T.length;return S.current=z,j.current(se=>({...se,selectedIndex:z})),!0}if(F.key==="ArrowUp"){const z=(S.current-1+T.length)%T.length;return S.current=z,j.current(se=>({...se,selectedIndex:z})),!0}if(F.key==="Enter"){const z=T[S.current];return z&&((G=P.current)==null||G.call(P,z)),!0}return!1},onExit:()=>{j.current(Vc),P.current=null}})}}),[]),q=M1({extensions:[O1,E1,A1.configure({placeholder:"Leave a comment… (type @ to mention)"}),Z,Q],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:F}){o(F.isEmpty)}}),te=!i||l.length>0,ne=25*1024*1024,I=F=>{const T=F.filter(z=>z.size>ne);T.length>0&&B.error(`Files must be under 25 MB: ${T.map(z=>z.name).join(", ")}`);const G=F.filter(z=>z.size<=ne);c(z=>{const se=new Set(z.map(W=>`${W.name}-${W.size}`));return[...z,...G.filter(W=>!se.has(`${W.name}-${W.size}`))]})},O=F=>{c(T=>T.filter((G,z)=>z!==F))},L=h.useCallback(F=>{var T;(T=P.current)==null||T.call(P,F),m(Vc)},[]),H=async()=>{if(!(!te||d)){u(!0);try{const F=q!=null&&q.isEmpty?"":(q==null?void 0:q.getHTML())??"",T=[];F&&new DOMParser().parseFromString(F,"text/html").querySelectorAll("[data-type='mention']").forEach(ie=>{const V=ie.getAttribute("data-id");V&&!T.includes(V)&&T.push(V)});const G=T.length>0?{mentioned_user_ids:T}:void 0,se=(await y.mutateAsync({body:F||" ",metadata:G})).comment.id;for(const W of l)await b.mutateAsync({file:W,commentId:se});q==null||q.commands.clearContent(),o(!0),c([]),B.success("Comment added"),a==null||a()}catch{B.error("Failed to add comment")}finally{u(!1)}}};x.current=H;const R="h-3 w-3",Y=h.useMemo(()=>{if(!f.rect||!g.current)return{bottom:"105%",left:0};const F=g.current.getBoundingClientRect(),T=Math.max(0,f.rect.left-F.left);return{top:f.rect.bottom-F.top+4,left:T}},[f.rect]);return s.jsxs("div",{className:$("flex gap-3 items-start",n),children:[s.jsx(_t,{className:"h-7 w-7 shrink-0 mt-1",children:s.jsx(Pt,{className:$("text-[11px] font-semibold",D.bg,D.text),children:A})}),s.jsxs("div",{className:"flex-1 min-w-0 relative",ref:g,children:[s.jsxs("div",{className:$("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[q&&s.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border/70 bg-muted/30",children:[s.jsx(Ua,{title:"Bold (⌘B)",active:q.isActive("bold"),onClick:()=>q.chain().focus().toggleBold().run(),children:s.jsx(X1,{className:R})}),s.jsx(Ua,{title:"Italic (⌘I)",active:q.isActive("italic"),onClick:()=>q.chain().focus().toggleItalic().run(),children:s.jsx(nN,{className:R})}),s.jsx(Ua,{title:"Strikethrough",active:q.isActive("strike"),onClick:()=>q.chain().focus().toggleStrike().run(),children:s.jsx(cN,{className:R})}),s.jsx(Ua,{title:"Inline code",active:q.isActive("code"),onClick:()=>q.chain().focus().toggleCode().run(),children:s.jsx(tN,{className:R})}),s.jsx(Uy,{}),s.jsx(Ua,{title:"Bullet list",active:q.isActive("bulletList"),onClick:()=>q.chain().focus().toggleBulletList().run(),children:s.jsx(mx,{className:R})}),s.jsx(Ua,{title:"Ordered list",active:q.isActive("orderedList"),onClick:()=>q.chain().focus().toggleOrderedList().run(),children:s.jsx(aN,{className:R})}),s.jsx(Uy,{}),s.jsx(Ua,{title:"Code block",active:q.isActive("codeBlock"),onClick:()=>q.chain().focus().toggleCodeBlock().run(),children:s.jsx(eN,{className:R})})]}),s.jsx(D1,{editor:q,className:$("px-3 py-2.5 text-sm overflow-y-auto",r?"min-h-[68px] max-h-[160px]":"min-h-[80px] max-h-[200px]")})]}),l.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:l.map((F,T)=>s.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:[s.jsx(Hx,{mimeType:F.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:F.name}),s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",ff(F.size),")"]}),s.jsx("button",{type:"button",onClick:()=>O(T),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:s.jsx(We,{className:"h-3 w-3"})})]},T))}),s.jsxs("div",{className:"flex items-center justify-between mt-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var F;return(F=p.current)==null?void 0:F.click()},disabled:d,title:"Attach files",children:s.jsx(hx,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-[11px] text-muted-foreground/50 hidden sm:block",children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})]}),s.jsx(re,{size:"icon",className:"h-8 w-8",onClick:H,disabled:!te||d,children:s.jsx(oD,{className:"h-3.5 w-3.5"})})]}),s.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:F=>{const T=Array.from(F.target.files??[]);T.length>0&&I(T),F.target.value=""}}),f.active&&f.items.length>0&&s.jsx("div",{className:"absolute z-[9999]",style:Y,children:s.jsx(iS,{items:f.items,selectedIndex:f.selectedIndex,onSelect:L})})]})]})}const Hy=[{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 Kx(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return Hy[t%Hy.length]}function X$({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?s.jsx(Yx,{html:t,className:"text-xs"}):s.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const Ky={created:{icon:ot,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:ix,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:ln,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:fN,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:Fs,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function Q$(e,t){var a,i,o,l;const{action:r,changes:n}=e;if(r==="created")return"created this issue";if(r==="status_changed"){const c=(a=n==null?void 0:n.status)==null?void 0:a.from,d=(i=n==null?void 0:n.status)==null?void 0:i.to;return s.jsxs(s.Fragment,{children:["changed status",c&&s.jsxs(s.Fragment,{children:[" from ",s.jsx("strong",{className:"font-medium text-foreground",children:xi[c]??c})]}),d&&s.jsxs(s.Fragment,{children:[" to ",s.jsx("strong",{className:"font-medium text-foreground",children:xi[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(p=>!d.includes(p)),f=d.filter(p=>!c.includes(p)),m=p=>{var x;return((x=t==null?void 0:t.get(p))==null?void 0:x.name)??p.slice(0,8)+"…"};return u.length>0&&f.length>0?s.jsx(s.Fragment,{children:"updated assignees"}):u.length>0?s.jsxs(s.Fragment,{children:["assigned ",s.jsx("strong",{className:"font-medium text-foreground",children:u.map(m).join(", ")})]}):f.length>0?s.jsxs(s.Fragment,{children:["unassigned ",s.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(s.jsxs("span",{children:["updated ",s.jsx("strong",{className:"font-medium text-foreground",children:d})]},d)):d==="priority"?c.push(s.jsxs("span",{children:["changed ",s.jsx("strong",{className:"font-medium text-foreground",children:"priority"}),f!=null&&s.jsxs(s.Fragment,{children:[" from ",s.jsx("strong",{className:"font-medium text-foreground",children:un[f]??String(f)})]}),m!=null&&s.jsxs(s.Fragment,{children:[" to ",s.jsx("strong",{className:"font-medium text-foreground",children:un[m]??String(m)})]})]},d)):d==="type"?c.push(s.jsxs("span",{children:["changed ",s.jsx("strong",{className:"font-medium text-foreground",children:"type"}),f!=null&&s.jsxs(s.Fragment,{children:[" from ",s.jsx("strong",{className:"font-medium text-foreground",children:Bs[f]??String(f)})]}),m!=null&&s.jsxs(s.Fragment,{children:[" to ",s.jsx("strong",{className:"font-medium text-foreground",children:Bs[m]??String(m)})]})]},d)):c.push(s.jsxs("span",{children:["updated ",s.jsx("strong",{className:"font-medium text-foreground",children:d.replace(/_/g," ")})]},d))}return c.length===0?"made changes":s.jsx(s.Fragment,{children:c.reduce((d,u,f)=>f===0?[u]:[...d,s.jsx("span",{children:" and "},`sep-${f}`),u],[])})}return r.replace(/_/g," ")}function aS({issueId:e,projectId:t,className:r,compact:n,onViewMore:a,onTabChange:i,hideCommentInput:o,scrollMarginTop:l=0}){const[c,d]=h.useState("comments"),u=k=>{d(k),i==null||i(k)},f=h.useRef(null),m=h.useRef(null),{user:p}=Te(),{data:x}=$a(),{data:g,isLoading:v}=R5(e),{data:y,isLoading:b}=$5(e),{data:N}=Rk(e);h.useEffect(()=>{var j;const k=g==null?void 0:g.length;k!==void 0&&(m.current!==null&&k>m.current&&((j=f.current)==null||j.scrollIntoView({behavior:"smooth",block:"start"})),m.current=k)},[g==null?void 0:g.length]);const w=k=>{var j;if(p&&k===p.id){const C=p.first_name??"",P=p.last_name??"",S=`${C} ${P}`.trim()||p.email,_=(C[0]??P[0]??((j=p.email)==null?void 0:j[0])??"U").toUpperCase();return{name:S,initials:_}}return(x==null?void 0:x.get(k))??{name:"Unknown",initials:"?"}};return s.jsxs("div",{className:r,children:[s.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(k=>{const j=k==="comments"?(g==null?void 0:g.length)??0:k==="activity"?(y==null?void 0:y.length)??0:k==="attachments"?(N==null?void 0:N.length)??0:void 0,C=k==="comments"?"Comments":k==="activity"?"Activity":k==="attachments"?"Attachments":"Time",P=c===k;return s.jsxs("button",{onClick:()=>u(k),className:$("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",P?"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:[C,j!=null&&j>0&&s.jsx("span",{className:$("ml-1.5 text-[10px] tabular-nums font-normal",P?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:j})]},k)})}),c==="comments"&&s.jsxs("div",{className:"px-6 pb-5 pt-4",children:[s.jsx("div",{ref:f,style:{scrollMarginTop:l},className:"space-y-5 mb-5",children:v?s.jsxs("div",{className:"flex gap-3",children:[s.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),s.jsx(le,{className:"h-16 flex-1"})]}):g&&g.length>0?(n?g.slice(0,5):g).map(k=>{const j=w(k.author_id),C=Kx(j.name),P=(N??[]).filter(S=>S.comment_id===k.id);return s.jsxs("div",{className:"flex gap-3",children:[s.jsx(_t,{className:"h-7 w-7 mt-0.5 shrink-0",children:s.jsx(Pt,{className:$("text-[11px] font-semibold",C.bg,C.text),children:j.initials})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[s.jsx("span",{className:"text-xs font-semibold text-zinc-900 dark:text-zinc-100",children:j.name}),s.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:me(new Date(k.created_at),"MMM d, h:mm a")})]}),s.jsxs("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:[s.jsx(X$,{body:k.body}),P.length>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:P.map(S=>s.jsx(k$,{attachment:S},S.id))})]})]})]},k.id)}):s.jsxs("div",{className:"flex flex-col items-center py-6 gap-2",children:[s.jsx("div",{className:"h-9 w-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:s.jsx(iN,{className:"h-4 w-4 text-zinc-400 dark:text-zinc-500"})}),s.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"})]})}),n&&g&&g.length>5&&a&&s.jsxs("button",{onClick:a,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 ",g.length," comments →"]}),!o&&s.jsx(sS,{issueId:e,projectId:t})]}),c==="activity"&&s.jsx("div",{className:"px-6 pb-6 pt-4",children:b?s.jsx("div",{className:"space-y-4",children:[1,2,3].map(k=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx(le,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),s.jsx(le,{className:"h-4 flex-1 mt-1"})]},k))}):y&&y.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-zinc-100 dark:bg-zinc-800"}),s.jsx("div",{className:"space-y-0",children:(n?y.slice(-5):y).map((k,j,C)=>{var E;const P=Ky[k.action]??Ky.updated,S=P.icon,_=((E=x==null?void 0:x.get(k.actor_id))==null?void 0:E.name)??"System",M=j===C.length-1;return s.jsxs("div",{className:$("relative flex gap-3",M?"pb-0":"pb-4"),children:[s.jsx("div",{className:$("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",P.bg),children:s.jsx(S,{className:$("h-3 w-3",P.color)})}),s.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[s.jsxs("p",{className:"text-xs text-foreground leading-relaxed",children:[s.jsx("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:_})," ",s.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:Q$(k,x)})]}),s.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:me(new Date(k.created_at),"MMM d, yyyy · h:mm a")})]})]},k.id)})})]}),n&&y.length>5&&a&&s.jsxs("button",{onClick:a,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 ",y.length," events →"]})]}):s.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),c==="attachments"&&s.jsx(_$,{issueId:e}),c==="time"&&s.jsx(V$,{issueId:e})]})}function iS({items:e,selectedIndex:t,onSelect:r}){const n=h.useRef(null);return h.useEffect(()=>{var i;const a=(i=n.current)==null?void 0:i.querySelector(`[data-index="${t}"]`);a==null||a.scrollIntoView({block:"nearest"})},[t]),e.length===0?null:s.jsx("div",{className:$("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:s.jsx("div",{ref:n,className:"max-h-[200px] overflow-y-auto p-1",role:"listbox",children:e.map((a,i)=>{const o=a.label.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2)||"?",l=Kx(a.label);return s.jsxs("button",{"data-index":i,role:"option","aria-selected":i===t,onMouseDown:c=>{c.preventDefault(),r(a)},className:$("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:[s.jsx(_t,{className:"h-5 w-5 shrink-0",children:s.jsx(Pt,{className:$("text-[9px] font-semibold",l.bg,l.text),children:o})}),s.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[s.jsx("span",{className:"font-medium text-foreground truncate leading-tight",children:a.label}),s.jsx("span",{className:"text-[10px] text-muted-foreground truncate leading-tight",children:a.email})]})]},a.id)})})})}const Xc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function Z$({onClick:e,active:t,disabled:r,title:n,children:a}){return s.jsx("button",{type:"button",title:n,disabled:r,onMouseDown:i=>{i.preventDefault(),e()},className:$("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:a})}function Qc(){return s.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function mf({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:a,editorClassName:i,users:o}){const[l,c]=h.useState(Xc),d=h.useRef(c);d.current=c;const u=h.useRef([]);o&&(u.current=o);const f=h.useRef([]),m=h.useRef(null),p=h.useRef(0),x=h.useMemo(()=>o!==void 0?Ik.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:k})=>{const j=u.current;if(!j.length)return[];const C=k.toLowerCase();return j.filter(P=>!C||P.label.toLowerCase().includes(C)||P.email.toLowerCase().includes(C)).slice(0,8)},render:()=>({onStart:k=>{var j;f.current=k.items,m.current=k.command,p.current=0,d.current({active:!0,items:k.items,selectedIndex:0,rect:((j=k.clientRect)==null?void 0:j.call(k))??null,command:k.command})},onUpdate:k=>{var j;f.current=k.items,m.current=k.command,p.current=0,d.current({active:!0,items:k.items,selectedIndex:0,rect:((j=k.clientRect)==null?void 0:j.call(k))??null,command:k.command})},onKeyDown:({event:k})=>{var C;const j=f.current;if(!j.length)return!1;if(k.key==="Escape")return d.current(Xc),!0;if(k.key==="ArrowDown"){const P=(p.current+1)%j.length;return p.current=P,d.current(S=>({...S,selectedIndex:P})),!0}if(k.key==="ArrowUp"){const P=(p.current-1+j.length)%j.length;return p.current=P,d.current(S=>({...S,selectedIndex:P})),!0}if(k.key==="Enter"){const P=j[p.current];return P&&((C=m.current)==null||C.call(m,P)),!0}return!1},onExit:()=>{d.current(Xc),m.current=null}})}}):null,[o!==void 0]),g=h.useCallback(k=>{var j;(j=m.current)==null||j.call(m,k),c(Xc)},[]),v=h.useRef(null),y=h.useMemo(()=>{if(!l.rect||!v.current)return{top:0,left:0};const k=v.current.getBoundingClientRect();return{top:l.rect.bottom-k.top+4,left:Math.max(0,l.rect.left-k.left)}},[l.rect]),b=M1({extensions:[O1.configure({heading:{levels:[1,2,3]}}),E1,dA,uA.configure({nested:!0}),A1.configure({placeholder:r}),...x?[x]:[]],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:k}){t&&t(k.isEmpty?"":k.getHTML())}});if(!b)return null;const N=(k,j,C,P,S)=>s.jsx(Z$,{title:k,onClick:C,active:P,disabled:S,children:j},k),w="h-3.5 w-3.5";return s.jsxs("div",{ref:v,className:"relative",children:[s.jsxs("div",{className:$("flex flex-col overflow-hidden",n),children:[s.jsxs("div",{className:$("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",a),children:[N("Undo",s.jsx(pD,{className:w}),()=>b.chain().focus().undo().run(),!1,!b.can().undo()),N("Redo",s.jsx(iD,{className:w}),()=>b.chain().focus().redo().run(),!1,!b.can().redo()),s.jsx(Qc,{}),N("Bold (⌘B)",s.jsx(X1,{className:w}),()=>b.chain().focus().toggleBold().run(),b.isActive("bold")),N("Italic (⌘I)",s.jsx(nN,{className:w}),()=>b.chain().focus().toggleItalic().run(),b.isActive("italic")),N("Underline (⌘U)",s.jsx(hD,{className:w}),()=>b.chain().focus().toggleUnderline().run(),b.isActive("underline")),N("Strikethrough",s.jsx(cN,{className:w}),()=>b.chain().focus().toggleStrike().run(),b.isActive("strike")),N("Inline code",s.jsx(tN,{className:w}),()=>b.chain().focus().toggleCode().run(),b.isActive("code")),s.jsx(Qc,{}),N("Heading 1",s.jsx(X5,{className:w}),()=>b.chain().focus().toggleHeading({level:1}).run(),b.isActive("heading",{level:1})),N("Heading 2",s.jsx(Q5,{className:w}),()=>b.chain().focus().toggleHeading({level:2}).run(),b.isActive("heading",{level:2})),N("Heading 3",s.jsx(Z5,{className:w}),()=>b.chain().focus().toggleHeading({level:3}).run(),b.isActive("heading",{level:3})),s.jsx(Qc,{}),N("Bullet list",s.jsx(mx,{className:w}),()=>b.chain().focus().toggleBulletList().run(),b.isActive("bulletList")),N("Ordered list",s.jsx(aN,{className:w}),()=>b.chain().focus().toggleOrderedList().run(),b.isActive("orderedList")),N("Task list",s.jsx(tD,{className:w}),()=>b.chain().focus().toggleTaskList().run(),b.isActive("taskList")),s.jsx(Qc,{}),N("Blockquote",s.jsx(aD,{className:w}),()=>b.chain().focus().toggleBlockquote().run(),b.isActive("blockquote")),N("Code block",s.jsx(eN,{className:w}),()=>b.chain().focus().toggleCodeBlock().run(),b.isActive("codeBlock")),N("Divider line",s.jsx(Js,{className:w}),()=>b.chain().focus().setHorizontalRule().run())]}),s.jsx(D1,{editor:b,className:$("flex-1 px-5 py-4",i)})]}),l.active&&l.items.length>0&&s.jsx("div",{className:"absolute z-[9999]",style:y,children:s.jsx(iS,{items:l.items,selectedIndex:l.selectedIndex,onSelect:g})})]})}function Yx({html:e,className:t}){return e?s.jsx("div",{className:$("meridian-editor",t),dangerouslySetInnerHTML:{__html:g$.sanitize(e,{ADD_ATTR:["data-type","data-id","data-label"]})}}):null}function J$(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={},wl={};function ri(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 wl?wl[n]:Yy(n,n.split(":"))}catch{if(e in wl)return wl[e];const r=e==null?void 0:e.match(e6);return r?Yy(e,r.slice(1)):NaN}}const e6=/([+-]\d\d):?(\d\d)?/;function Yy(e,t){const r=+(t[0]||0),n=+(t[1]||0),a=+(t[2]||0)/60;return wl[e]=r*60+n>0?r*60+n+a:r*60-n-a}class ss extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ri(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)),oS(this),qh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new ss(...r,t):new ss(Date.now(),t)}withTimeZone(t){return new ss(+this,t)}getTimezoneOffset(){const t=-ri(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),qh(this),+this}[Symbol.for("constructDateFrom")](t){return new ss(+new Date(t),this.timeZone)}}const Gy=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Gy.test(e))return;const t=e.replace(Gy,"$1UTC");ss.prototype[t]&&(e.startsWith("get")?ss.prototype[e]=function(){return this.internal[t]()}:(ss.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),t6(this),+this},ss.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),qh(this),+this}))});function qh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ri(e.timeZone,e)*60))}function t6(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()),oS(e)}function oS(e){const t=ri(e.timeZone,e),r=t>0?Math.floor(t):Math.ceil(t),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=a-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=a-r;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const u=a>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(ri(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=ri(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),g=-new Date(+e).getTimezoneOffset()-p,v=p!==r,y=g-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const b=ri(e.timeZone,e),N=b>0?Math.floor(b):Math.ceil(b),w=p-N;w&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+w),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+w))}}class vr extends ss{static tz(t,...r){return r.length?new vr(...r,t):new vr(Date.now(),t)}toISOString(){const[t,r,n]=this.tzComponents(),a=`${t}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,r,n,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${r} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[r,n,a]=this.tzComponents();return`${t} GMT${r}${n}${a} (${J$(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"),a=String(Math.abs(t)%60).padStart(2,"0");return[r,n,a]}withTimeZone(t){return new vr(+this,t)}[Symbol.for("constructDateFrom")](t){return new vr(+new Date(t),this.timeZone)}}const Vy=5,r6=4;function n6(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,a=t.addDays(e,-n+1),i=t.addDays(a,Vy*7-1);return t.getMonth(e)===t.getMonth(i)?Vy:r6}function lS(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 s6(e,t){const r=lS(e,t),n=n6(e,t);return t.addDays(r,n*7-1)}const cS={...Ja,labels:{labelDayButton:(e,t,r,n)=>{let a;n&&typeof n.format=="function"?a=n.format.bind(n):a=(o,l)=>me(o,l,{locale:Ja,...r});let i=a(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=(a,i)=>me(a,i,{locale:Ja,...t}),n(e,"LLLL yyyy")},labelGridcell:(e,t,r,n)=>{let a;n&&typeof n.format=="function"?a=n.format.bind(n):a=(o,l)=>me(o,l,{locale:Ja,...r});let i=a(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=(a,i)=>me(a,i,{locale:Ja,...t}),n(e,"cccc")}}};class fn{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?vr.tz(this.options.timeZone):new this.Date},this.newDate=(n,a,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(n,a,i):this.options.timeZone?new vr(n,a,i,this.options.timeZone):new Date(n,a,i)},this.addDays=(n,a)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(n,a):Kr(n,a)},this.addMonths=(n,a)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,a):Tx(n,a)},this.addWeeks=(n,a)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,a):YI(n,a)},this.addYears=(n,a)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,a):GI(n,a)},this.differenceInCalendarDays=(n,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,a):lf(n,a)},this.differenceInCalendarMonths=(n,a)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,a):Rx(n,a)},this.eachMonthOfInterval=n=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):r4(n)},this.eachYearOfInterval=n=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):s4(n),i=new Set(a.map(c=>this.getYear(c)));if(i.size===a.length)return a;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=n=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):s6(n,this)},this.endOfISOWeek=n=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(n):a4(n)},this.endOfMonth=n=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(n):$x(n)},this.endOfWeek=(n,a)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,a):wk(n,this.options)},this.endOfYear=n=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(n):n4(n)},this.format=(n,a,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,a,this.options):me(n,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=n=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(n):Lx(n)},this.getMonth=(n,a)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):wd(n,this.options)},this.getYear=(n,a)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):nR(n,this.options)},this.getWeek=(n,a)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):zx(n,this.options)},this.isAfter=(n,a)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,a):sR(n,a)},this.isBefore=(n,a)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,a):aR(n,a)},this.isDate=n=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(n):mk(n)},this.isSameDay=(n,a)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,a):io(n,a)},this.isSameMonth=(n,a)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,a):iR(n,a)},this.isSameYear=(n,a)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,a):oR(n,a)},this.max=n=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(n):VI(n)},this.min=n=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(n):XI(n)},this.setMonth=(n,a)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,a):dR(n,a)},this.setYear=(n,a)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,a):uR(n,a)},this.startOfBroadcastWeek=(n,a)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):lS(n,this)},this.startOfDay=n=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(n):ao(n)},this.startOfISOWeek=n=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(n):Dl(n)},this.startOfMonth=n=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(n):yk(n)},this.startOfWeek=(n,a)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):so(n,this.options)},this.startOfYear=n=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(n):bk(n)},this.options={locale:cS,...t},this.overrides=r}getDigitMap(){const{numerals:t="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let a=0;a<10;a++)n[a.toString()]=r.format(a);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&&fn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:r,timeZone:n,numerals:a}=this.options,i=r==null?void 0:r.code;if(i&&fn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:a}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}fn.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 ys=new fn;class dS{constructor(t,r,n=ys){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 a6{constructor(t,r){this.date=t,this.weeks=r}}class i6{constructor(t,r){this.days=r,this.weekNumber=t}}function o6(e){return U.createElement("button",{...e})}function l6(e){return U.createElement("span",{...e})}function c6(e){const{size:t=24,orientation:r="left",className:n}=e;return U.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&U.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&U.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&U.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&U.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function d6(e){const{day:t,modifiers:r,...n}=e;return U.createElement("td",{...n})}function u6(e){const{day:t,modifiers:r,...n}=e,a=U.useRef(null);return U.useEffect(()=>{var i;r.focused&&((i=a.current)==null||i.focus())},[r.focused]),U.createElement("button",{ref:a,...n})}var Me;(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"})(Me||(Me={}));var St;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(St||(St={}));var zn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(zn||(zn={}));var rn;(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"})(rn||(rn={}));function f6(e){const{options:t,className:r,components:n,classNames:a,...i}=e,o=[a[Me.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return U.createElement("span",{"data-disabled":i.disabled,className:a[Me.DropdownRoot]},U.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>U.createElement(n.Option,{key:c,value:c,disabled:u},d))),U.createElement("span",{className:a[Me.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,U.createElement(n.Chevron,{orientation:"down",size:18,className:a[Me.Chevron]})))}function m6(e){return U.createElement("div",{...e})}function h6(e){return U.createElement("div",{...e})}function p6(e){const{calendarMonth:t,displayIndex:r,...n}=e;return U.createElement("div",{...n},e.children)}function x6(e){const{calendarMonth:t,displayIndex:r,...n}=e;return U.createElement("div",{...n})}function g6(e){return U.createElement("table",{...e})}function v6(e){return U.createElement("div",{...e})}const uS=h.createContext(void 0);function gc(){const e=h.useContext(uS);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function y6(e){const{components:t}=gc();return U.createElement(t.Dropdown,{...e})}function b6(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:a,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=gc(),u=h.useCallback(m=>{a&&(r==null||r(m))},[a,r]),f=h.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return U.createElement("nav",{...i},U.createElement(o.PreviousMonthButton,{type:"button",className:l[Me.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},U.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[Me.Chevron],orientation:"left"})),U.createElement(o.NextMonthButton,{type:"button",className:l[Me.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":d(a),onClick:u},U.createElement(o.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[Me.Chevron]})))}function w6(e){const{components:t}=gc();return U.createElement(t.Button,{...e})}function j6(e){return U.createElement("option",{...e})}function N6(e){const{components:t}=gc();return U.createElement(t.Button,{...e})}function k6(e){const{rootRef:t,...r}=e;return U.createElement("div",{...r,ref:t})}function S6(e){return U.createElement("select",{...e})}function C6(e){const{week:t,...r}=e;return U.createElement("tr",{...r})}function _6(e){return U.createElement("th",{...e})}function P6(e){return U.createElement("thead",{"aria-hidden":!0},U.createElement("tr",{...e}))}function M6(e){const{week:t,...r}=e;return U.createElement("th",{...r})}function O6(e){return U.createElement("th",{...e})}function E6(e){return U.createElement("tbody",{...e})}function A6(e){const{components:t}=gc();return U.createElement(t.Dropdown,{...e})}const D6=Object.freeze(Object.defineProperty({__proto__:null,Button:o6,CaptionLabel:l6,Chevron:c6,Day:d6,DayButton:u6,Dropdown:f6,DropdownNav:m6,Footer:h6,Month:p6,MonthCaption:x6,MonthGrid:g6,Months:v6,MonthsDropdown:y6,Nav:b6,NextMonthButton:w6,Option:j6,PreviousMonthButton:N6,Root:k6,Select:S6,Week:C6,WeekNumber:M6,WeekNumberHeader:O6,Weekday:_6,Weekdays:P6,Weeks:E6,YearsDropdown:A6},Symbol.toStringTag,{value:"Module"}));function Ms(e,t,r=!1,n=ys){let{from:a,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=n;return a&&i?(o(i,a)<0&&([a,i]=[i,a]),o(t,a)>=(r?1:0)&&o(i,t)>=(r?1:0)):!r&&i?l(i,t):!r&&a?l(a,t):!1}function Gx(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function hf(e){return!!(e&&typeof e=="object"&&"from"in e)}function Vx(e){return!!(e&&typeof e=="object"&&"after"in e)}function Xx(e){return!!(e&&typeof e=="object"&&"before"in e)}function fS(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function mS(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Os(e,t,r=ys){const n=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:i,isAfter:o}=r;return n.some(l=>{if(typeof l=="boolean")return l;if(r.isDate(l))return a(e,l);if(mS(l,r))return l.some(c=>a(e,c));if(hf(l))return Ms(l,e,!1,r);if(fS(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(Gx(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 Vx(l)?i(e,l.after)>0:Xx(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function T6(e,t,r,n,a){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:u=a.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:p,isBefore:x,endOfMonth:g,isAfter:v}=a,y=r&&p(r),b=n&&g(n),N={[St.focused]:[],[St.outside]:[],[St.disabled]:[],[St.hidden]:[],[St.today]:[]},w={};for(const k of e){const{date:j,displayMonth:C}=k,P=!!(C&&!m(j,C)),S=!!(y&&x(j,y)),_=!!(b&&v(j,b)),M=!!(i&&Os(j,i,a)),E=!!(o&&Os(j,o,a))||S||_||!d&&!c&&P||d&&c===!1&&P,A=f(j,u);P&&N.outside.push(k),M&&N.disabled.push(k),E&&N.hidden.push(k),A&&N.today.push(k),l&&Object.keys(l).forEach(D=>{const Z=l==null?void 0:l[D];Z&&Os(j,Z,a)&&(w[D]?w[D].push(k):w[D]=[k])})}return k=>{const j={[St.focused]:!1,[St.disabled]:!1,[St.hidden]:!1,[St.outside]:!1,[St.today]:!1},C={};for(const P in N){const S=N[P];j[P]=S.some(_=>_===k)}for(const P in w)C[P]=w[P].some(S=>S===k);return{...j,...C}}}function I6(e,t,r={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[i])=>(r[i]?a.push(r[i]):t[St[i]]?a.push(t[St[i]]):t[zn[i]]&&a.push(t[zn[i]]),a),[t[Me.Day]])}function R6(e){return{...D6,...e}}function $6(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 L6(){const e={};for(const t in Me)e[Me[t]]=`rdp-${Me[t]}`;for(const t in St)e[St[t]]=`rdp-${St[t]}`;for(const t in zn)e[zn[t]]=`rdp-${zn[t]}`;for(const t in rn)e[rn[t]]=`rdp-${rn[t]}`;return e}function hS(e,t,r){return(r??new fn(t)).formatMonthYear(e)}const z6=hS;function F6(e,t,r){return(r??new fn(t)).format(e,"d")}function B6(e,t=ys){return t.format(e,"LLLL")}function q6(e,t,r){return(r??new fn(t)).format(e,"cccccc")}function W6(e,t=ys){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function U6(){return""}function pS(e,t=ys){return t.format(e,"yyyy")}const H6=pS,K6=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:hS,formatDay:F6,formatMonthCaption:z6,formatMonthDropdown:B6,formatWeekNumber:W6,formatWeekNumberHeader:U6,formatWeekdayName:q6,formatYearCaption:H6,formatYearDropdown:pS},Symbol.toStringTag,{value:"Module"}));function Y6(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...K6,...e}}function Qx(e,t,r,n){let a=(n??new fn(r)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const G6=Qx;function Zx(e,t,r){return(r??new fn(t)).formatMonthYear(e)}const V6=Zx;function xS(e,t,r,n){let a=(n??new fn(r)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function gS(e){return"Choose the Month"}function vS(){return""}const X6="Go to the Next Month";function yS(e,t){return X6}function bS(e){return"Go to the Previous Month"}function wS(e,t,r){return(r??new fn(t)).format(e,"cccc")}function jS(e,t){return`Week ${e}`}function NS(e){return"Week Number"}function kS(e){return"Choose the Year"}const Q6=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:V6,labelDay:G6,labelDayButton:Qx,labelGrid:Zx,labelGridcell:xS,labelMonthDropdown:gS,labelNav:vS,labelNext:yS,labelPrevious:bS,labelWeekNumber:jS,labelWeekNumberHeader:NS,labelWeekday:wS,labelYearDropdown:kS},Symbol.toStringTag,{value:"Module"})),Dn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function Z6(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...Q6,...e??{},labelDayButton:Dn(Qx,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:Dn(gS,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:Dn(yS,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:Dn(bS,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:Dn(jS,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:Dn(kS,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:Dn(Zx,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:Dn(xS,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:Dn(vS,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:Dn(NS,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:Dn(wS,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function J6(e,t,r,n,a){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=a;return c({start:o(e),end:l(e)}).map(m=>{const p=n.formatMonthDropdown(m,a),x=d(m),g=t&&m<i(t)||r&&m>i(r)||!1;return{value:x,label:p,disabled:g}})}function eL(e,t={},r={}){let n={...t==null?void 0:t[Me.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{n={...n,...r==null?void 0:r[a]}}),n}function tL(e,t,r,n){const a=n??e.today(),i=r?e.startOfBroadcastWeek(a,e):t?e.startOfISOWeek(a):e.startOfWeek(a),o=[];for(let l=0;l<7;l++){const c=e.addDays(i,l);o.push(c)}return o}function rL(e,t,r,n,a=!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 a&&f.reverse(),f.map(m=>{const p=r.formatYearDropdown(m,n);return{value:c(m),label:p,disabled:!1}})}function nL(e,t={}){var l;const{weekStartsOn:r,locale:n}=t,a=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 vr(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(vr.tz(e)),newDate:(c,d,u)=>new vr(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)??a,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),p=((((d==null?void 0:d.weekStartsOn)??a)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),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 vr(d.getFullYear(),d.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)f.push(new vr(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 vr(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new vr(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return zx(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??a,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 Lx(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return lf(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return Rx(u,f)}}}const vc=e=>e instanceof HTMLElement?e:null,Km=e=>[...e.querySelectorAll("[data-animated-month]")??[]],sL=e=>vc(e.querySelector("[data-animated-month]")),Ym=e=>vc(e.querySelector("[data-animated-caption]")),Gm=e=>vc(e.querySelector("[data-animated-weeks]")),aL=e=>vc(e.querySelector("[data-animated-nav]")),iL=e=>vc(e.querySelector("[data-animated-weekdays]"));function oL(e,t,{classNames:r,months:n,focused:a,dateLib:i}){const o=h.useRef(null),l=h.useRef(n),c=h.useRef(!1);h.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[rn.caption_after_enter]:r[rn.caption_before_enter],p=f?r[rn.weeks_after_enter]:r[rn.weeks_before_enter],x=o.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(Km(g).forEach(N=>{if(!(N instanceof HTMLElement))return;const w=sL(N);w&&N.contains(w)&&N.removeChild(w);const k=Ym(N);k&&k.classList.remove(m);const j=Gm(N);j&&j.classList.remove(p)}),o.current=g):o.current=null,c.current||u||a)return;const v=x instanceof HTMLElement?Km(x):[],y=Km(e.current);if(y!=null&&y.every(b=>b instanceof HTMLElement)&&v&&v.every(b=>b instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const b=aL(e.current);b&&(b.style.zIndex="1"),y.forEach((N,w)=>{const k=v[w];if(!k)return;N.style.position="relative",N.style.overflow="hidden";const j=Ym(N);j&&j.classList.add(m);const C=Gm(N);C&&C.classList.add(p);const P=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),b&&(b.style.zIndex=""),j&&j.classList.remove(m),C&&C.classList.remove(p),N.style.position="",N.style.overflow="",N.contains(k)&&N.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const S=iL(k);S&&(S.style.opacity="0");const _=Ym(k);_&&(_.classList.add(f?r[rn.caption_before_exit]:r[rn.caption_after_exit]),_.addEventListener("animationend",P));const M=Gm(k);M&&M.classList.add(f?r[rn.weeks_before_exit]:r[rn.weeks_after_exit]),N.insertBefore(k,N.firstChild)})}})}function lL(e,t,r,n){const a=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=r??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:p,endOfMonth:x,endOfWeek:g,isAfter:v,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:N}=n,w=c?y(a,n):o?b(a):N(a),k=c?m(i):o?p(x(i)):g(x(i)),j=t&&(c?m(t):o?p(t):g(t)),C=j&&v(k,j)?j:k,P=u(C,w),S=f(i,a)+1,_=[];for(let A=0;A<=P;A++){const D=d(w,A);_.push(D)}const E=(c?35:42)*S;if(l&&_.length<E){const A=E-_.length;for(let D=0;D<A;D++){const Z=d(_[_.length-1],1);_.push(Z)}}return _}function cL(e){const t=[];return e.reduce((r,n)=>{const a=n.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return r.concat(a.slice())},t.slice())}function dL(e,t,r,n){const{numberOfMonths:a=1}=r,i=[];for(let o=0;o<a;o++){const l=n.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function Xy(e,t,r,n){const{month:a,defaultMonth:i,today:o=n.today(),numberOfMonths:l=1}=e;let c=a||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 uL(e,t,r,n){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:p}=n,x=e.reduce((g,v)=>{const y=r.broadcastCalendar?f(v,n):r.ISOWeek?m(v):p(v),b=r.broadcastCalendar?i(v):r.ISOWeek?o(l(v)):c(l(v)),N=t.filter(C=>C>=y&&C<=b),w=r.broadcastCalendar?35:42;if(r.fixedWeeks&&N.length<w){const C=t.filter(P=>{const S=w-N.length;return P>b&&P<=a(b,S)});N.push(...C)}const k=N.reduce((C,P)=>{const S=r.ISOWeek?d(P):u(P),_=C.find(E=>E.weekNumber===S),M=new dS(P,v,n);return _?_.days.push(M):C.push(new i6(S,[M])),C},[]),j=new a6(v,k);return g.push(j),g},[]);return r.reverseMonths?x.reverse():x}function fL(e,t){let{startMonth:r,endMonth:n}=e;const{startOfYear:a,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:p,fromMonth:x,toMonth:g}=e;!r&&x&&(r=x),!r&&m&&(r=t.newDate(m,0,1)),!n&&g&&(n=g),!n&&p&&(n=u(p,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=a(c(e.today??f(),-100))),n?n=l(n):p?n=u(p,11,31):!n&&v&&(n=d(e.today??f())),[r&&i(r),n&&i(n)]}function mL(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=a?i:1,u=o(e);if(!t)return l(u,d);if(!(c(t,e)<i))return l(u,d)}function hL(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=a?i??1:1,u=o(e);if(!t)return l(u,-d);if(!(c(u,t)<=0))return l(u,-d)}function pL(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function pf(e,t){const[r,n]=h.useState(e);return[t===void 0?r:t,n]}function xL(e,t){var w;const[r,n]=fL(e,t),{startOfMonth:a,endOfMonth:i}=t,o=Xy(e,r,n,t),[l,c]=pf(o,e.month?o:void 0);h.useEffect(()=>{const k=Xy(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=h.useMemo(()=>{const k=dL(l,n,{numberOfMonths:e.numberOfMonths},t),j=lL(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=uL(k,j,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),P=pL(C),S=cL(C),_=hL(l,r,e,t),M=mL(l,n,e,t);return{months:C,weeks:P,days:S,previousMonth:_,nextMonth:M}},[t,l.getTime(),n==null?void 0:n.getTime(),r==null?void 0:r.getTime(),e.disableNavigation,e.broadcastCalendar,(w=e.endMonth)==null?void 0:w.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:x,onMonthChange:g}=e,v=k=>u.some(j=>j.days.some(C=>C.isEqualTo(k))),y=k=>{if(x)return;let j=a(k);r&&j<a(r)&&(j=a(r)),n&&j>a(n)&&(j=a(n)),c(j),g==null||g(j)};return{months:d,weeks:u,days:f,navStart:r,navEnd:n,previousMonth:m,nextMonth:p,goToMonth:y,goToDay:k=>{v(k)||y(k.date)}}}var rs;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(rs||(rs={}));function Qy(e){return!e[St.disabled]&&!e[St.hidden]&&!e[St.outside]}function gL(e,t,r,n){let a,i=-1;for(const o of e){const l=t(o);Qy(l)&&(l[St.focused]&&i<rs.FocusedModifier?(a=o,i=rs.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<rs.LastFocused?(a=o,i=rs.LastFocused):r(o.date)&&i<rs.Selected?(a=o,i=rs.Selected):l[St.today]&&i<rs.Today&&(a=o,i=rs.Today))}return a||(a=e.find(o=>Qy(t(o)))),a}function vL(e,t,r,n,a,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:x,endOfWeek:g,max:v,min:y,startOfBroadcastWeek:b,startOfISOWeek:N,startOfWeek:w}=o;let j={day:d,week:f,month:u,year:m,startOfWeek:C=>c?b(C,o):l?N(C):w(C),endOfWeek:C=>c?p(C):l?x(C):g(C)}[e](r,t==="after"?1:-1);return t==="before"&&n?j=v([n,j]):t==="after"&&a&&(j=y([a,j])),j}function SS(e,t,r,n,a,i,o,l=0){if(l>365)return;const c=vL(e,t,r.date,n,a,i,o),d=!!(i.disabled&&Os(c,i.disabled,o)),u=!!(i.hidden&&Os(c,i.hidden,o)),f=c,m=new dS(c,f,o);return!d&&!u?m:SS(e,t,m,n,a,i,o,l+1)}function yL(e,t,r,n,a){const{autoFocus:i}=e,[o,l]=h.useState(),c=gL(t.days,r,n||(()=>!1),o),[d,u]=h.useState(i?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(g,v)=>{if(!d)return;const y=SS(g,v,d,t.navStart,t.navEnd,e,a);y&&(e.disableNavigation&&!t.days.some(N=>N.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function bL(e,t){const{selected:r,required:n,onSelect:a}=e,[i,o]=pf(r,a?r:void 0),l=a?r:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(x=>c(x,p)))??!1,{min:u,max:f}=e;return{selected:l,select:(p,x,g)=>{let v=[...l??[]];if(d(p)){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,p))}else(l==null?void 0:l.length)===f?v=[p]:v=[...v,p];return a||o(v),a==null||a(v,p,x,g),v},isSelected:d}}function wL(e,t,r=0,n=0,a=!1,i=ys){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}:a?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))a?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 jL(e,t,r=ys){const n=Array.isArray(t)?t:[t];let a=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(a.getDay()))return!0;a=r.addDays(a,1)}return!1}function Zy(e,t,r=ys){return Ms(e,t.from,!1,r)||Ms(e,t.to,!1,r)||Ms(t,e.from,!1,r)||Ms(t,e.to,!1,r)}function NL(e,t,r=ys){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?Ms(e,l,!1,r):mS(l,r)?l.some(c=>Ms(e,c,!1,r)):hf(l)?l.from&&l.to?Zy(e,{from:l.from,to:l.to},r):!1:fS(l)?jL(e,l.dayOfWeek,r):Gx(l)?r.isAfter(l.before,l.after)?Zy(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):Os(e.from,l,r)||Os(e.to,l,r):Vx(l)||Xx(l)?Os(e.from,l,r)||Os(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 kL(e,t){const{disabled:r,excludeDisabled:n,selected:a,required:i,onSelect:o}=e,[l,c]=pf(a,o?a:void 0),d=o?a:l;return{selected:d,select:(m,p,x)=>{const{min:g,max:v}=e,y=m?wL(m,d,g,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&NL({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,p,x),y},isSelected:m=>d&&Ms(d,m,!1,t)}}function SL(e,t){const{selected:r,required:n,onSelect:a}=e,[i,o]=pf(r,a?r:void 0),l=a?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,p)=>{let x=f;return!n&&l&&l&&c(f,l)&&(x=void 0),a||o(x),a==null||a(x,f,m,p),x},isSelected:f=>l?c(l,f):!1}}function CL(e,t){const r=SL(e,t),n=bL(e,t),a=kL(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return a;default:return}}function jn(e,t){return e instanceof vr&&e.timeZone===t?e:new vr(e,t)}function Li(e,t,r){return jn(e,t)}function Jy(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Li(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?Li(n,t):n):hf(e)?{...e,from:e.from?jn(e.from,t):e.from,to:e.to?jn(e.to,t):e.to}:Gx(e)?{before:Li(e.before,t),after:Li(e.after,t)}:Vx(e)?{after:Li(e.after,t)}:Xx(e)?{before:Li(e.before,t)}:e}function Vm(e,t,r){return e&&(Array.isArray(e)?e.map(n=>Jy(n,t)):Jy(e,t))}function _L(e){var Oe;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=jn(t.today,r)),t.month&&(t.month=jn(t.month,r)),t.defaultMonth&&(t.defaultMonth=jn(t.defaultMonth,r)),t.startMonth&&(t.startMonth=jn(t.startMonth,r)),t.endMonth&&(t.endMonth=jn(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=jn(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(Oe=t.selected)==null?void 0:Oe.map(ve=>jn(ve,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?jn(t.selected.from,r):t.selected.from,to:t.selected.to?jn(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 ve={};Object.keys(t.modifiers).forEach(Ne=>{var pe;ve[Ne]=Vm((pe=t.modifiers)==null?void 0:pe[Ne],r)}),t.modifiers=ve}const{components:n,formatters:a,labels:i,dateLib:o,locale:l,classNames:c}=h.useMemo(()=>{const ve={...cS,...t.locale},Ne=t.broadcastCalendar?1:t.weekStartsOn,pe=t.noonSafe&&t.timeZone?nL(t.timeZone,{weekStartsOn:Ne,locale:ve}):void 0,we=t.dateLib&&pe?{...pe,...t.dateLib}:t.dateLib??pe,Xe=new fn({locale:ve,weekStartsOn:Ne,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},we);return{dateLib:Xe,components:R6(t.components),formatters:Y6(t.formatters),labels:Z6(t.labels,Xe.options),locale:ve,classNames:{...L6(),...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:p,onDayClick:x,onDayFocus:g,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:b,onNextClick:N,onPrevClick:w,showWeekNumber:k,styles:j}=t,{formatCaption:C,formatDay:P,formatMonthDropdown:S,formatWeekNumber:_,formatWeekNumberHeader:M,formatWeekdayName:E,formatYearDropdown:A}=a,D=xL(t,o),{days:Z,months:Q,navStart:q,navEnd:te,previousMonth:ne,nextMonth:I,goToMonth:O}=D,L=T6(Z,t,q,te,o),{isSelected:H,select:R,selected:Y}=CL(t,o)??{},{blur:F,focused:T,isFocusTarget:G,moveFocus:z,setFocused:se}=yL(t,D,L,H??(()=>!1),o),{labelDayButton:W,labelGridcell:X,labelGrid:ie,labelMonthDropdown:V,labelNav:J,labelPrevious:ue,labelNext:de,labelWeekday:ee,labelWeekNumber:ge,labelWeekNumberHeader:be,labelYearDropdown:qe}=i,Ge=h.useMemo(()=>tL(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Je=u!==void 0||x!==void 0,rt=h.useCallback(()=>{ne&&(O(ne),w==null||w(ne))},[ne,O,w]),mt=h.useCallback(()=>{I&&(O(I),N==null||N(I))},[O,I,N]),He=h.useCallback((ve,Ne)=>pe=>{pe.preventDefault(),pe.stopPropagation(),se(ve),!Ne.disabled&&(R==null||R(ve.date,Ne,pe),x==null||x(ve.date,Ne,pe))},[R,x,se]),Ze=h.useCallback((ve,Ne)=>pe=>{se(ve),g==null||g(ve.date,Ne,pe)},[g,se]),nr=h.useCallback((ve,Ne)=>pe=>{F(),p==null||p(ve.date,Ne,pe)},[F,p]),Lr=h.useCallback((ve,Ne)=>pe=>{const we={ArrowLeft:[pe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[pe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[pe.shiftKey?"year":"week","after"],ArrowUp:[pe.shiftKey?"year":"week","before"],PageUp:[pe.shiftKey?"year":"month","before"],PageDown:[pe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(we[pe.key]){pe.preventDefault(),pe.stopPropagation();const[Xe,fe]=we[pe.key];z(Xe,fe)}v==null||v(ve.date,Ne,pe)},[z,v,t.dir]),sr=h.useCallback((ve,Ne)=>pe=>{y==null||y(ve.date,Ne,pe)},[y]),jr=h.useCallback((ve,Ne)=>pe=>{b==null||b(ve.date,Ne,pe)},[b]),ar=h.useCallback(ve=>Ne=>{const pe=Number(Ne.target.value),we=o.setMonth(o.startOfMonth(ve),pe);O(we)},[o,O]),wt=h.useCallback(ve=>Ne=>{const pe=Number(Ne.target.value),we=o.setYear(o.startOfMonth(ve),pe);O(we)},[o,O]),{className:Bt,style:Gt}=h.useMemo(()=>({className:[c[Me.Root],t.className].filter(Boolean).join(" "),style:{...j==null?void 0:j[Me.Root],...t.style}}),[c,t.className,t.style,j]),ir=$6(t),Vn=h.useRef(null);oL(Vn,!!t.animate,{classNames:c,months:Q,focused:T,dateLib:o});const bs={dayPickerProps:t,selected:Y,select:R,isSelected:H,months:Q,nextMonth:I,previousMonth:ne,goToMonth:O,getModifiers:L,components:n,classNames:c,styles:j,labels:i,formatters:a};return U.createElement(uS.Provider,{value:bs},U.createElement(n.Root,{rootRef:t.animate?Vn:void 0,className:Bt,style:Gt,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"],...ir},U.createElement(n.Months,{className:c[Me.Months],style:j==null?void 0:j[Me.Months]},!t.hideNavigation&&!f&&U.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Me.Nav],style:j==null?void 0:j[Me.Nav],"aria-label":J(),onPreviousClick:rt,onNextClick:mt,previousMonth:ne,nextMonth:I}),Q.map((ve,Ne)=>U.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[Me.Month],style:j==null?void 0:j[Me.Month],key:Ne,displayIndex:Ne,calendarMonth:ve},f==="around"&&!t.hideNavigation&&Ne===0&&U.createElement(n.PreviousMonthButton,{type:"button",className:c[Me.PreviousMonthButton],tabIndex:ne?void 0:-1,"aria-disabled":ne?void 0:!0,"aria-label":ue(ne),onClick:rt,"data-animated-button":t.animate?"true":void 0},U.createElement(n.Chevron,{disabled:ne?void 0:!0,className:c[Me.Chevron],orientation:t.dir==="rtl"?"right":"left"})),U.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[Me.MonthCaption],style:j==null?void 0:j[Me.MonthCaption],calendarMonth:ve,displayIndex:Ne},d!=null&&d.startsWith("dropdown")?U.createElement(n.DropdownNav,{className:c[Me.Dropdowns],style:j==null?void 0:j[Me.Dropdowns]},(()=>{const pe=d==="dropdown"||d==="dropdown-months"?U.createElement(n.MonthsDropdown,{key:"month",className:c[Me.MonthsDropdown],"aria-label":V(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:ar(ve.date),options:J6(ve.date,q,te,a,o),style:j==null?void 0:j[Me.Dropdown],value:o.getMonth(ve.date)}):U.createElement("span",{key:"month"},S(ve.date,o)),we=d==="dropdown"||d==="dropdown-years"?U.createElement(n.YearsDropdown,{key:"year",className:c[Me.YearsDropdown],"aria-label":qe(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:wt(ve.date),options:rL(q,te,a,o,!!t.reverseYears),style:j==null?void 0:j[Me.Dropdown],value:o.getYear(ve.date)}):U.createElement("span",{key:"year"},A(ve.date,o));return o.getMonthYearOrder()==="year-first"?[we,pe]:[pe,we]})(),U.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"}},C(ve.date,o.options,o))):U.createElement(n.CaptionLabel,{className:c[Me.CaptionLabel],role:"status","aria-live":"polite"},C(ve.date,o.options,o))),f==="around"&&!t.hideNavigation&&Ne===m-1&&U.createElement(n.NextMonthButton,{type:"button",className:c[Me.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":de(I),onClick:mt,"data-animated-button":t.animate?"true":void 0},U.createElement(n.Chevron,{disabled:I?void 0:!0,className:c[Me.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Ne===m-1&&f==="after"&&!t.hideNavigation&&U.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Me.Nav],style:j==null?void 0:j[Me.Nav],"aria-label":J(),onPreviousClick:rt,onNextClick:mt,previousMonth:ne,nextMonth:I}),U.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ie(ve.date,o.options,o)||void 0,className:c[Me.MonthGrid],style:j==null?void 0:j[Me.MonthGrid]},!t.hideWeekdays&&U.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[Me.Weekdays],style:j==null?void 0:j[Me.Weekdays]},k&&U.createElement(n.WeekNumberHeader,{"aria-label":be(o.options),className:c[Me.WeekNumberHeader],style:j==null?void 0:j[Me.WeekNumberHeader],scope:"col"},M()),Ge.map(pe=>U.createElement(n.Weekday,{"aria-label":ee(pe,o.options,o),className:c[Me.Weekday],key:String(pe),style:j==null?void 0:j[Me.Weekday],scope:"col"},E(pe,o.options,o)))),U.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[Me.Weeks],style:j==null?void 0:j[Me.Weeks]},ve.weeks.map(pe=>U.createElement(n.Week,{className:c[Me.Week],key:pe.weekNumber,style:j==null?void 0:j[Me.Week],week:pe},k&&U.createElement(n.WeekNumber,{week:pe,style:j==null?void 0:j[Me.WeekNumber],"aria-label":ge(pe.weekNumber,{locale:l}),className:c[Me.WeekNumber],scope:"row",role:"rowheader"},_(pe.weekNumber,o)),pe.days.map(we=>{const{date:Xe}=we,fe=L(we);if(fe[St.focused]=!fe.hidden&&!!(T!=null&&T.isEqualTo(we)),fe[zn.selected]=(H==null?void 0:H(Xe))||fe.selected,hf(Y)){const{from:nt,to:st}=Y;fe[zn.range_start]=!!(nt&&st&&o.isSameDay(Xe,nt)),fe[zn.range_end]=!!(nt&&st&&o.isSameDay(Xe,st)),fe[zn.range_middle]=Ms(Y,Xe,!0,o)}const Pe=eL(fe,j,t.modifiersStyles),Ie=I6(fe,c,t.modifiersClassNames),jt=!Je&&!fe.hidden?X(Xe,fe,o.options,o):void 0;return U.createElement(n.Day,{key:`${we.isoDate}_${we.displayMonthId}`,day:we,modifiers:fe,className:Ie.join(" "),style:Pe,role:"gridcell","aria-selected":fe.selected||void 0,"aria-label":jt,"data-day":we.isoDate,"data-month":we.outside?we.dateMonthId:void 0,"data-selected":fe.selected||void 0,"data-disabled":fe.disabled||void 0,"data-hidden":fe.hidden||void 0,"data-outside":we.outside||void 0,"data-focused":fe.focused||void 0,"data-today":fe.today||void 0},!fe.hidden&&Je?U.createElement(n.DayButton,{className:c[Me.DayButton],style:j==null?void 0:j[Me.DayButton],type:"button",day:we,modifiers:fe,disabled:!fe.focused&&fe.disabled||void 0,"aria-disabled":fe.focused&&fe.disabled||void 0,tabIndex:G(we)?0:-1,"aria-label":W(Xe,fe,o.options,o),onClick:He(we,fe),onBlur:nr(we,fe),onFocus:Ze(we,fe),onKeyDown:Lr(we,fe),onMouseEnter:sr(we,fe),onMouseLeave:jr(we,fe)},P(Xe,o.options,o)):!fe.hidden&&P(we.date,o.options,o))})))))))),t.footer&&U.createElement(n.Footer,{className:c[Me.Footer],style:j==null?void 0:j[Me.Footer],role:"status","aria-live":"polite"},t.footer)))}function br({className:e,classNames:t,showOutsideDays:r=!0,...n}){return s.jsx(_L,{showOutsideDays:r,className:$("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:$(Qi({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:$(Qi({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:$(Qi({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:a})=>a==="left"?s.jsx(us,{className:"h-4 w-4"}):s.jsx(pr,{className:"h-4 w-4"})},...n})}br.displayName="Calendar";function PL(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return s.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,ML(a,...t)]}function ML(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function OL(e){const t=EL(e),r=h.forwardRef((n,a)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(DL);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return s.jsx(t,{...o,ref:a,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function EL(e){const t=h.forwardRef((r,n)=>{const{children:a,...i}=r;if(h.isValidElement(a)){const o=IL(a),l=TL(i,a.props);return a.type!==h.Fragment&&(l.ref=n?Qp(n,o):o),h.cloneElement(a,l)}return h.Children.count(a)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AL=Symbol("radix.slottable");function DL(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AL}function TL(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function IL(e){var n,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var RL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],CS=RL.reduce((e,t)=>{const r=OL(`Primitive.${t}`),n=h.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),xf="Switch",[$L]=PL(xf),[LL,zL]=$L(xf),_S=h.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,p]=h.useState(null),x=ko(t,N=>p(N)),g=h.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,b]=g1({prop:a,defaultProp:i??!1,onChange:d,caller:xf});return s.jsxs(LL,{scope:r,checked:y,disabled:l,children:[s.jsx(CS.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":ES(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:Cs(e.onClick,N=>{b(w=>!w),v&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})}),v&&s.jsx(OS,{control:m,bubbles:!g.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});_S.displayName=xf;var PS="SwitchThumb",MS=h.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=zL(PS,r);return s.jsx(CS.span,{"data-state":ES(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});MS.displayName=PS;var FL="SwitchBubbleInput",OS=h.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{const o=h.useRef(null),l=ko(o,i),c=v1(r),d=y1(t);return h.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const x=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(x)}},[c,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});OS.displayName=FL;function ES(e){return e?"checked":"unchecked"}var AS=_S,BL=MS;const Lo=h.forwardRef(({className:e,...t},r)=>s.jsx(AS,{className:$("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:s.jsx(BL,{className:$("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")})}));Lo.displayName=AS.displayName;function qL(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function gf({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:a,defaultParentId:i}){const o=ft(),{workspace:l,projectKey:c}=It(),{workspace:d}=Te(),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(n),[v,y]=h.useState("medium"),[b,N]=h.useState("task"),[w,k]=h.useState([]),[j,C]=h.useState(""),[P,S]=h.useState(a??""),[_,M]=h.useState(void 0),[E,A]=h.useState(void 0),[D,Z]=h.useState(!1),[Q,q]=h.useState("weekly"),[te,ne]=h.useState(void 0),[I,O]=h.useState([]),[L,H]=h.useState([]),R=G1(),{data:Y}=Kn(r),F=h.useMemo(()=>Y?Y.members.filter(J=>J.user).map(J=>J.user):void 0,[Y]),T=h.useMemo(()=>F==null?void 0:F.map(J=>({id:J.id,label:`${J.first_name??""} ${J.last_name??""}`.trim()||J.email,email:J.email})),[F]),{data:G}=Ro(r),{data:z}=$o(r||void 0);h.useEffect(()=>{G&&G.length>0&&(G.map(ue=>ue.key).includes(x)||g(G[0].key))},[G]);const{data:se}=pc(r||void 0),W=(z??[]).filter(J=>J.status!=="completed"),X=G&&G.length>0?Object.fromEntries(G.map(J=>[J.key,J.name])):xi,ie=()=>{f(""),p(""),g(n),y("medium"),N("task"),k([]),C(""),S(a??""),M(void 0),A(void 0),Z(!1),q("weekly"),ne(void 0),O([]),H([]),t()},V=J=>{if(J.preventDefault(),!u.trim())return;const ue=[];m&&new DOMParser().parseFromString(m,"text/html").querySelectorAll("[data-type='mention']").forEach(ge=>{const be=ge.getAttribute("data-id");be&&!ue.includes(be)&&ue.push(be)}),R.mutate({title:u.trim(),description:m.trim()||void 0,status:x,priority:v,type:b,project_id:r,workspace_id:d.id,assignee_ids:w.length>0?w:void 0,sprint_id:j||null,task_list_id:P||null,parent_id:i||null,start_date:_?me(_,"yyyy-MM-dd"):null,due_date:E?me(E,"yyyy-MM-dd"):null,recurrence_frequency:D?Q:void 0,recurrence_end_date:D&&te?me(te,"yyyy-MM-dd"):void 0,mentioned_user_ids:ue.length>0?ue:void 0,depends_on_ids:I.length>0?I:null,related_to_ids:L.length>0?L:null},{onSuccess:()=>{B.success("Issue created"),ie()},onError:de=>B.error(de.message??"Failed to create issue")})};return s.jsx(Mi,{open:e,onOpenChange:J=>!J&&ie(),dismissible:!1,children:s.jsxs(Oi,{className:"max-w-xl",children:[s.jsx(Ao,{children:s.jsx(To,{children:"New issue"})}),s.jsxs("form",{onSubmit:V,className:"flex flex-col flex-1 overflow-hidden",children:[s.jsxs(Do,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{htmlFor:"issue-title",children:"Title"}),s.jsx(_e,{id:"issue-title",placeholder:"Issue title",value:u,onChange:J=>f(J.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Description ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsx(mf,{content:m,onChange:p,placeholder:"Add more context… (type @ to mention)",className:"min-h-[120px] rounded-md border border-input",users:T})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"Status"}),s.jsxs(Be,{value:x,onValueChange:g,children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(X).map(([J,ue])=>s.jsx(ke,{value:J,className:"text-xs",children:ue},J))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"Priority"}),s.jsxs(Be,{value:v,onValueChange:y,children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(un).map(([J,ue])=>s.jsx(ke,{value:J,className:"text-xs",children:ue},J))})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"Type"}),s.jsxs(Be,{value:b,onValueChange:N,children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(Bs).map(([J,ue])=>s.jsx(ke,{value:J,className:"text-xs",children:ue},J))})]})]})]}),i&&s.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"}),(se??[]).length>0&&!i&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["List ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsxs(Be,{value:P||"none",onValueChange:J=>S(J==="none"?"":J),children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{placeholder:"No list"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs",children:s.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(se??[]).map(J=>s.jsx(ke,{value:J.id,className:"text-xs",children:J.name},J.id))]})]})]}),W.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Sprint ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsxs(Be,{value:j||"none",onValueChange:J=>C(J==="none"?"":J),children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{placeholder:"No sprint"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs",children:s.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),W.map(J=>{const ue=qL(J);return s.jsx(ke,{value:J.id,className:"text-xs",children:s.jsxs("div",{children:[s.jsx("span",{children:J.name}),ue&&s.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:ue})]})},J.id)})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Assignees ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsx(xc,{value:w,onChange:k,users:F})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Start Date ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:_?"text-foreground":"text-muted-foreground",children:_?me(_,"MMM d, yyyy"):"No start date"}),_&&s.jsx("button",{type:"button",onClick:J=>{J.stopPropagation(),M(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:_,onSelect:M,initialFocus:!0})})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Due Date ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?me(E,"MMM d, yyyy"):"No due date"}),E&&s.jsx("button",{type:"button",onClick:J=>{J.stopPropagation(),A(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:E,onSelect:A,initialFocus:!0})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Depends on ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsx(lo,{value:I,onChange:O,projectId:r,emptyLabel:"No dependencies"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Related to ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsx(lo,{value:L,onChange:H,projectId:r,emptyLabel:"No relations"})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lo,{id:"recurring",checked:D,onCheckedChange:Z}),s.jsxs(at,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[s.jsx(ro,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),D&&s.jsx("div",{className:"space-y-3 pl-4 border-l-2 border-indigo-200 dark:border-indigo-800",children:s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"Frequency"}),s.jsxs(Be,{value:Q,onValueChange:J=>q(J),children:[s.jsx(ze,{className:"h-8 text-xs",children:s.jsx(Ve,{})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),s.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{children:["Until ",s.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:te?"text-foreground":"text-muted-foreground",children:te?me(te,"MMM d, yyyy"):"No end date"}),te&&s.jsx("button",{type:"button",onClick:J=>{J.stopPropagation(),ne(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:te,onSelect:ne,initialFocus:!0})})]})]})]})})]})]}),s.jsxs(fc,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[s.jsxs(re,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{ie(),o(`/${l}/projects/${c}/issues/new`)},children:[s.jsx(ux,{className:"h-3.5 w-3.5"}),"Open full form"]}),s.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[s.jsx(re,{type:"button",variant:"ghost",onClick:ie,children:"Cancel"}),s.jsx(re,{type:"submit",disabled:!u.trim()||R.isPending,children:R.isPending?"Creating...":"Create issue"})]})]})]})]})})}const DS=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(w1,{ref:n,className:$("relative overflow-hidden",e),...r,children:[s.jsx(OE,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(TS,{}),s.jsx(EE,{})]}));DS.displayName=w1.displayName;const TS=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>s.jsx(j1,{ref:n,orientation:t,className:$("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:s.jsx(AE,{className:"relative flex-1 rounded-full bg-border"})}));TS.displayName=j1.displayName;function WL(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const UL={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function HL(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 vn=({children:e})=>s.jsx("p",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100 mb-1.5",children:e}),zi=()=>s.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function IS({issue:e,projectId:t,open:r,onClose:n}){const a=ft(),{workspace:i,projectKey:o}=It(),{data:l}=K1((e==null?void 0:e.id)??""),c=l??e,[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState("comments"),[y,b]=h.useState(!1),N=Ku((c==null?void 0:c.id)??"",t),{data:w}=Kn(t),k=h.useMemo(()=>w?w.members.filter(ee=>ee.user).map(ee=>ee.user):void 0,[w]),j=h.useMemo(()=>k==null?void 0:k.map(ee=>({id:ee.id,label:`${ee.first_name??""} ${ee.last_name??""}`.trim()||ee.email,email:ee.email})),[k]),{data:C}=Ro(t),{data:P}=$o(t||void 0),{data:S}=pc(t||void 0),{data:_}=Y1((c==null?void 0:c.id)??""),{data:M}=Bx(),{data:E=[]}=qx(new Date().getFullYear()),A=(P??[]).filter(ee=>ee.status!=="completed"),{data:D}=Mk(),Z=(D==null?void 0:D.maxChildIssueDepth)??1,q=((_==null?void 0:_.depth)??0)<Z,te=(_==null?void 0:_.parent)??null,ne=(_==null?void 0:_.children)??[],I=c!=null&&c.task_list_id?S==null?void 0:S.find(ee=>ee.id===c.task_list_id):null,O=C&&C.length>0?Object.fromEntries(C.map(ee=>[ee.key,ee.name])):xi;if(h.useEffect(()=>{c&&(m(c.title),x(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const L=()=>{if(!f.trim())return;const ee=[];new DOMParser().parseFromString(p,"text/html").querySelectorAll("[data-type='mention']").forEach(qe=>{const Ge=qe.getAttribute("data-id");Ge&&!ee.includes(Ge)&&ee.push(Ge)}),N.mutate({title:f.trim(),description:p.trim()||void 0,mentioned_user_ids:ee.length>0?ee:void 0},{onSuccess:()=>{u(!1),B.success("Issue updated")},onError:()=>B.error("Failed to update issue")})},H=()=>{m(c.title),x(c.description??""),u(!1)},R=ee=>{N.mutate({status:ee},{onSuccess:()=>B.success("Status updated"),onError:()=>B.error("Failed to update status")})},Y=ee=>{N.mutate({priority:ee},{onSuccess:()=>B.success("Priority updated"),onError:()=>B.error("Failed to update priority")})},F=ee=>{N.mutate({type:ee},{onSuccess:()=>B.success("Type updated"),onError:()=>B.error("Failed to update type")})},T=ee=>{N.mutate({assignee_ids:ee},{onSuccess:()=>B.success("Assignees updated"),onError:()=>B.error("Failed to update assignees")})},G=ee=>{N.mutate({sprint_id:ee},{onSuccess:()=>B.success(ee?"Sprint assigned":"Removed from sprint"),onError:()=>B.error("Failed to update sprint")})},z=ee=>{N.mutate({task_list_id:ee},{onSuccess:()=>B.success(ee?"Moved to list":"Removed from list"),onError:()=>B.error("Failed to update list")})},se=ee=>{N.mutate({start_date:ee?me(ee,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(ee?"Start date set":"Start date cleared"),onError:()=>B.error("Failed to update start date")})},W=ee=>{N.mutate({due_date:ee?me(ee,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(ee?"Due date set":"Due date cleared"),onError:()=>B.error("Failed to update due date")})},X=ee=>{if(ee){const ge=c.start_date?new Date(c.start_date):new Date,be=new Date(ge);be.setDate(be.getDate()+7),N.mutate({recurrence_frequency:"weekly",next_occurrence_date:me(be,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>B.success("Recurrence enabled"),onError:()=>B.error("Failed to enable recurrence")})}else N.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>B.success("Recurrence stopped"),onError:()=>B.error("Failed to stop recurrence")})},ie=ee=>{const ge=c.start_date?new Date(c.start_date):new Date,be=new Date(ge);ee==="weekly"?be.setDate(be.getDate()+7):be.setMonth(be.getMonth()+1),N.mutate({recurrence_frequency:ee,next_occurrence_date:me(be,"yyyy-MM-dd")},{onSuccess:()=>B.success("Frequency updated"),onError:()=>B.error("Failed to update frequency")})},V=ee=>{N.mutate({recurrence_end_date:ee?me(ee,"yyyy-MM-dd"):null},{onSuccess:()=>B.success(ee?"End date set":"End date cleared"),onError:()=>B.error("Failed to update end date")})},J=C==null?void 0:C.find(ee=>ee.category==="completed"),ue=!!J&&c.status===J.key,de=(ee,ge,be)=>{const qe=ee;return s.jsx("button",{title:ge,onClick:be,className:"h-8 w-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:s.jsx(qe,{className:"h-4 w-4"})},ge)};return s.jsxs(s.Fragment,{children:[s.jsx(Mi,{open:r,onOpenChange:ee=>!ee&&n(),dismissible:!1,children:s.jsxs(Oi,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden bg-white dark:bg-zinc-950",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[s.jsxs("button",{onClick:()=>{var ee;J&&R(ue?((ee=C==null?void 0:C.find(ge=>ge.category==="unstarted"||ge.category==="backlog"))==null?void 0:ee.key)??c.status:J.key)},className:$("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",ue?"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:[s.jsx(At,{className:"h-3.5 w-3.5"}),ue?"Completed":"Mark complete"]}),s.jsxs("div",{className:"flex items-center",children:[de(fD,"Upvote"),de(hx,"Attachments"),q&&de(cs,"Add sub-issue",()=>b(!0)),de(Oa,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),B.success("Link copied")}),de(rD,"Open full page",()=>{n(),a(`/${i}/projects/${o}/issues/${c.id}`)}),d?s.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:H,children:"Cancel"}),s.jsxs(re,{size:"sm",className:"h-7 text-xs",onClick:L,disabled:!f.trim()||N.isPending,children:[s.jsx(At,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:de(zs,"More options")}),s.jsx(Ar,{align:"end",className:"w-40",children:s.jsxs(Ye,{onClick:()=>u(!0),children:[s.jsx(Fs,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),de(We,"Close",n)]})]}),s.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?s.jsx(_e,{value:f,onChange:ee=>m(ee.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[s.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}),s.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase text-violet-500 dark:text-violet-400",children:Bs[c.type]??c.type}),c.recurrence_frequency&&s.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:[s.jsx(ro,{className:"h-2.5 w-2.5"}),"Repeats ",c.recurrence_frequency==="weekly"?"Weekly":"Monthly"]}),c.recurrence_source_id&&s.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:[s.jsx(ro,{className:"h-2.5 w-2.5"}),"Recurring instance"]})]}),s.jsx("h2",{className:"text-[17px] font-semibold leading-snug text-zinc-900 dark:text-zinc-50",children:c.title})]})}),s.jsxs(DS,{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[s.jsx(Or,{zone:"issue.details.before",props:{issue:c}}),s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(vn,{children:"Status"}),s.jsxs(Be,{value:c.status,onValueChange:R,children:[s.jsx(ze,{className:"h-8 text-xs min-w-0",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(O).map(([ee,ge])=>{const be=C==null?void 0:C.find(qe=>qe.key===ee);return s.jsx(ke,{value:ee,className:"text-xs",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:$("h-2 w-2 rounded-full shrink-0 flex-none",HL(be==null?void 0:be.category,ee))}),s.jsx("span",{children:ge})]})},ee)})})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(vn,{children:"Priority"}),s.jsxs(Be,{value:c.priority,onValueChange:Y,children:[s.jsx(ze,{className:"h-8 text-xs min-w-0",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(un).map(([ee,ge])=>s.jsx(ke,{value:ee,className:"text-xs",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:$("h-2 w-2 rounded-full shrink-0 flex-none",UL[ee]??"bg-zinc-400")}),s.jsx("span",{children:ge})]})},ee))})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(vn,{children:"Type"}),s.jsxs(Be,{value:c.type,onValueChange:F,children:[s.jsx(ze,{className:"h-8 text-xs min-w-0",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Object.entries(Bs).map(([ee,ge])=>s.jsx(ke,{value:ee,className:"text-xs",children:ge},ee))})]})]})]}),s.jsx(zi,{}),s.jsxs("div",{children:[s.jsx(vn,{children:"Assignees"}),s.jsx(xc,{value:c.assignee_ids??[],onChange:T,disabled:N.isPending,users:k})]}),s.jsx(zi,{}),s.jsxs("div",{className:"flex gap-3 items-start min-w-0",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx(vn,{children:"Sprint"}),s.jsxs(Be,{value:c.sprint_id??"none",onValueChange:ee=>G(ee==="none"?null:ee),children:[s.jsx(ze,{className:"h-8 text-xs min-w-0",children:s.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[s.jsx(Yr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx(Ve,{placeholder:"No sprint"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),A.map(ee=>{const ge=WL(ee);return s.jsx(ke,{value:ee.id,className:"text-xs",children:s.jsxs("div",{className:"flex items-baseline gap-1.5",children:[s.jsx("span",{children:ee.name}),ge&&s.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:ge})]})},ee.id)})]})]})]}),(S??[]).length>0&&s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx(vn,{children:"List"}),s.jsxs(Be,{value:c.task_list_id??"none",onValueChange:ee=>z(ee==="none"?null:ee),children:[s.jsx(ze,{className:"h-8 text-xs min-w-0",children:s.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[s.jsx(fx,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx(Ve,{placeholder:"No list",children:I?I.name:"No list"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(S??[]).map(ee=>s.jsx(ke,{value:ee.id,className:"text-xs",children:ee.name},ee.id))]})]})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx(vn,{children:"Start Date"}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:`truncate ${c.start_date?"text-foreground":"text-muted-foreground"}`,children:c.start_date?me(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",children:[s.jsx(br,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:se,initialFocus:!0}),c.start_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>se(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(M==null?void 0:M.working_days)&&(()=>{const ee=Lh(new Date(c.start_date),new Date(c.due_date),M.working_days,E);return s.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[ee," biz day",ee!==1?"s":""]})})(),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx(vn,{children:"Due Date"}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:`truncate ${c.due_date?"text-foreground":"text-muted-foreground"}`,children:c.due_date?me(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",children:[s.jsx(br,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:W,initialFocus:!0}),c.due_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>W(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),s.jsx(zi,{}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(vn,{children:"Depends on"}),s.jsx(lo,{value:c.depends_on_ids??[],onChange:ee=>N.mutate({depends_on_ids:ee},{onSuccess:()=>B.success("Dependencies updated")}),projectId:c.project_id,excludeId:c.id,disabled:N.isPending})]}),s.jsxs("div",{children:[s.jsx(vn,{children:"Related to"}),s.jsx(lo,{value:c.related_to_ids??[],onChange:ee=>N.mutate({related_to_ids:ee},{onSuccess:()=>B.success("Relations updated")}),projectId:c.project_id,excludeId:c.id,disabled:N.isPending})]})]}),s.jsx(zi,{}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(vn,{children:"Recurring"}),s.jsx(Lo,{checked:!!c.recurrence_frequency,onCheckedChange:X,disabled:N.isPending})]}),c.recurrence_frequency&&s.jsxs("div",{className:"space-y-2 pl-3 border-l-2 border-indigo-200 dark:border-indigo-800",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:"Frequency"}),s.jsxs(Be,{value:c.recurrence_frequency,onValueChange:ee=>ie(ee),children:[s.jsx(ze,{className:"h-7 text-xs",children:s.jsx(Ve,{})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),s.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:["Until ",s.jsx("span",{className:"font-normal",children:"(optional)"})]}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:c.recurrence_end_date?"text-foreground":"text-muted-foreground",children:c.recurrence_end_date?me(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",children:[s.jsx(br,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:V,initialFocus:!0}),c.recurrence_end_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>V(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),s.jsx(zi,{}),q&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100",children:"Child Issues"}),s.jsxs("button",{onClick:()=>b(!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:[s.jsx(ot,{className:"h-3 w-3"}),"Add"]})]}),te&&s.jsxs("button",{onClick:()=>a(`/${i}/projects/${o}/issues/${te.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:[s.jsx(ox,{className:"h-3.5 w-3.5 text-zinc-400 shrink-0"}),s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-400 shrink-0",children:"Parent:"}),s.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:te.identifier}),s.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:te.title})]}),ne.length===0?s.jsxs("button",{onClick:()=>b(!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:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Create child issue"]}):s.jsx("div",{className:"space-y-1",children:ne.map(ee=>s.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:[s.jsx(Ds,{className:"h-3.5 w-3.5 text-indigo-400 dark:text-indigo-500 shrink-0"}),s.jsxs("button",{onClick:()=>{n(),a(`/${i}/projects/${o}/issues/${ee.id}`)},className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[s.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:ee.identifier}),s.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:ee.title})]})]},ee.id))})]}),s.jsx(zi,{}),s.jsxs("div",{children:[s.jsx(vn,{children:"Description"}),d?s.jsx(mf,{content:p,onChange:x,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input",users:j},`${c.id}-edit`):c.description?s.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:s.jsx(Yx,{html:c.description,className:"text-sm"})}):s.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:[s.jsx(Fs,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),s.jsx("div",{className:"px-6 py-4",children:s.jsx(Or,{zone:"issue.details.after",props:{issue:c}})}),s.jsx(aS,{issueId:c.id,projectId:t,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:v,onViewMore:()=>{n(),a(`/${i}/projects/${o}/issues/${c.id}`)}})]}),g==="comments"&&s.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:s.jsx(sS,{issueId:c.id,projectId:t,compact:!0})})]})}),s.jsx(gf,{open:y,onClose:()=>b(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function KL(){const{projectKey:e,workspace:t}=It(),r=PN(),[n,a]=h.useState(null),[i,o]=h.useState(!1),[l,c]=h.useState({}),{data:d}=ea(e??""),u=(d==null?void 0:d.id)??"",{data:f,isLoading:m}=Hu(u||void 0,l),{data:p,isLoading:x}=Ro(u||void 0),{data:g}=Kn(u),{data:v}=$a(),y=xR(u),b=h.useMemo(()=>!(g!=null&&g.members)||!v?[]:g.members.map(k=>{const j=v.get(k.user_id);return j?{userId:k.user_id,name:j.name,initials:j.initials}:null}).filter(k=>k!==null),[g,v]);if(r&&e&&t)return s.jsx(Fn,{to:`/${t}/projects/${e}/issues`,replace:!0});if(!e)return null;const N=m||x||!d,w=k=>{y.mutate(k)};return s.jsxs("div",{className:"flex flex-col h-full gap-0",children:[s.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0",children:[s.jsx(IR,{statuses:p??[],members:b,filters:l,onChange:c}),s.jsxs(re,{size:"sm",onClick:()=>o(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"Create"]})]}),s.jsx(Or,{zone:"project.board.before",props:{projectId:u}}),s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:N?s.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(k=>s.jsxs("div",{className:"min-w-[260px]",children:[s.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(le,{className:"h-[82px] w-full rounded-lg"}),s.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},k))}):s.jsx(Pk,{issues:f??[],projectId:u,statuses:p??[],onIssueClick:a,onColumnsReorder:w,filters:l})})]}),s.jsx(Or,{zone:"project.board.after",props:{projectId:u}}),s.jsx(IS,{issue:n,projectId:u,open:!!n,onClose:()=>a(null)}),s.jsx(gf,{open:i,onClose:()=>o(!1),projectId:u})]})}const Wh=({priority:e,className:t})=>{const r=$("h-3.5 w-3.5 shrink-0",hc[e],t);switch(e){case"urgent":return s.jsx(gs,{className:r});case"high":return s.jsx(_i,{className:r});case"medium":return s.jsx(Js,{className:r});case"low":return s.jsx(Ci,{className:r});default:return s.jsx(Er,{className:$("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},Uh="grid-cols-[110px_250px_150px_120px_130px_140px_130px_32px]";function RS({issue:e,projectId:t,statuses:r,statusLabels:n,statusColorMap:a,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:d=!1,depth:u=0,children:f=[],childrenMap:m,onAddChild:p}){const x=ft(),[g,v]=h.useState(null),[y,b]=h.useState(!1),N=Ku(e.id,t),{data:w}=Kn(t),k=h.useMemo(()=>w?w.members.filter(_=>_.user).map(_=>_.user):void 0,[w]);function j(_){N.mutate(_),v(null)}const C=(a==null?void 0:a[e.status])??"#94a3b8",P=i.find(_=>_.id===e.sprint_id),S=f.length>0;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{onClick:()=>c(e),className:$(`group grid ${Uh} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-zinc-50/80 dark:bg-zinc-800/30",N.isPending&&"opacity-70"),children:[s.jsx("span",{className:$("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 transition-colors",d?"bg-zinc-50/80 dark:bg-zinc-800/30 group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30":"bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30"),style:{paddingLeft:`${1.5+u*1.25}rem`},children:e.identifier}),s.jsxs("div",{className:$("flex items-center gap-1 min-w-0 pr-3","sticky left-[110px] z-10 transition-colors",d?"bg-zinc-50/80 dark:bg-zinc-800/30 group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30":"bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30"),children:[S?s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:_=>{_.stopPropagation(),b(!y)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:y?s.jsx(Zs,{className:"h-3.5 w-3.5"}):s.jsx(pr,{className:"h-3.5 w-3.5"})})}),s.jsx(Bn,{side:"top",children:y?"Collapse":"Expand"})]}):d?s.jsx(Ds,{className:"h-3 w-3 text-muted-foreground shrink-0"}):s.jsx("span",{className:"w-4 shrink-0"}),s.jsx("span",{className:$("text-sm text-foreground truncate",d&&"text-primary"),children:e.title}),S&&s.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:[s.jsx(Ds,{className:"h-2.5 w-2.5"}),f.length]})]}),s.jsx("div",{onClick:_=>_.stopPropagation(),children:s.jsxs(Dt,{open:g==="status",onOpenChange:_=>v(_?"status":null),children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:C}}),s.jsx("span",{className:"text-xs text-primary truncate",children:n[e.status]??e.status})]})}),s.jsx(Ct,{className:"w-52 p-1",align:"start",onClick:_=>_.stopPropagation(),children:s.jsx(va,{children:s.jsx(ya,{children:s.jsx(Ts,{children:r.map(_=>s.jsxs(sn,{value:_.name,onSelect:()=>j({status:_.key}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:_.color}}),s.jsx("span",{className:"text-xs flex-1",children:_.name}),e.status===_.key&&s.jsx(At,{className:"h-3.5 w-3.5 text-indigo-500"})]},_.key))})})})})]})}),s.jsx("div",{onClick:_=>_.stopPropagation(),children:s.jsxs(Dt,{open:g==="priority",onOpenChange:_=>v(_?"priority":null),children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Wh,{priority:e.priority}),s.jsx("span",{className:"text-xs text-primary",children:un[e.priority]??e.priority})]})}),s.jsx(Ct,{className:"w-44 p-1",align:"start",onClick:_=>_.stopPropagation(),children:s.jsx(va,{children:s.jsx(ya,{children:s.jsx(Ts,{children:Object.entries(un).map(([_,M])=>s.jsxs(sn,{value:M,onSelect:()=>j({priority:_}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[s.jsx(Wh,{priority:_}),s.jsx("span",{className:"text-xs flex-1",children:M}),e.priority===_&&s.jsx(At,{className:"h-3.5 w-3.5 text-indigo-500"})]},_))})})})})]})}),s.jsx("div",{onClick:_=>_.stopPropagation(),children:s.jsxs(Dt,{open:g==="sprint",onOpenChange:_=>v(_?"sprint":null),children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Yr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:$("text-xs truncate",P?"text-foreground":"text-muted-foreground"),children:(P==null?void 0:P.name)??"No sprint"})]})}),s.jsx(Ct,{className:"w-56 p-1",align:"start",onClick:_=>_.stopPropagation(),children:s.jsx(va,{children:s.jsx(ya,{children:s.jsxs(Ts,{children:[s.jsxs(sn,{value:"no-sprint",onSelect:()=>j({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[s.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs flex-1 text-muted-foreground",children:"No sprint"}),!e.sprint_id&&s.jsx(At,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(_=>_.status!=="completed").map(_=>s.jsxs(sn,{value:_.name,onSelect:()=>j({sprint_id:_.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[s.jsx(Yr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs truncate",children:_.name}),(_.start_date||_.end_date)&&s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[_.start_date?me(new Date(_.start_date),"MMM d"):"—"," → ",_.end_date?me(new Date(_.end_date),"MMM d"):"—"]})]}),e.sprint_id===_.id&&s.jsx(At,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},_.id))]})})})})]})}),s.jsx("div",{onClick:_=>_.stopPropagation(),children:s.jsxs(Dt,{open:g==="due",onOpenChange:_=>v(_?"due":null),children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:$("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?me(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",onClick:_=>_.stopPropagation(),children:[s.jsx(br,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:_=>j({due_date:_?me(_,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>j({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),s.jsx("div",{onClick:_=>_.stopPropagation(),children:s.jsx(xc,{value:e.assignee_ids??[],onChange:_=>N.mutate({assignee_ids:_}),users:k})}),s.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:_=>_.stopPropagation(),children:[!d&&p&&s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>p(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:s.jsx(Ds,{className:"h-3.5 w-3.5"})})}),s.jsx(Bn,{side:"top",children:"Add child issue"})]}),s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>x(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:s.jsx(ux,{className:"h-3.5 w-3.5"})})}),s.jsx(Bn,{side:"top",children:"Open full page"})]})]})]}),y&&f.map(_=>s.jsx(RS,{issue:_,projectId:t,statuses:r,statusLabels:n,statusColorMap:a,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,depth:u+1,children:(m==null?void 0:m[_.id])??[],childrenMap:m,onAddChild:p},_.id))]})}function eb({taskList:e,issues:t,childrenMap:r,projectId:n,statuses:a,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,onAddIssue:f,onAddChild:m,onRenameList:p,onDeleteList:x}){const[g,v]=h.useState(!1),[y,b]=h.useState(!1),[N,w]=h.useState((e==null?void 0:e.name)??""),k=t.reduce((P,S)=>{var _;return P+(((_=r[S.id])==null?void 0:_.length)??0)},0),j=t.length+k,C=()=>{e&&N.trim()&&p&&p(e.id,N.trim()),b(!1)};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border group/header",children:[s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>v(!g),className:"text-muted-foreground hover:text-foreground transition-colors",children:g?s.jsx(pr,{className:"h-3.5 w-3.5"}):s.jsx(Zs,{className:"h-3.5 w-3.5"})})}),s.jsx(Bn,{side:"right",children:g?"Expand":"Collapse"})]}),e?y?s.jsx("input",{autoFocus:!0,value:N,onChange:P=>w(P.target.value),onBlur:C,onKeyDown:P=>{P.key==="Enter"&&C(),P.key==="Escape"&&(b(!1),w(e.name))},className:"text-xs font-semibold text-foreground bg-transparent border-b border-indigo-400 outline-none px-0.5"}):s.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.name}):s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"No List"}),s.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:j}),s.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[s.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:[s.jsx(ot,{className:"h-3 w-3"}),"Add issue"]}),e&&s.jsxs(Gr,{children:[s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx(Vr,{asChild:!0,children:s.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(zs,{className:"h-3.5 w-3.5"})})})}),s.jsx(Bn,{side:"top",children:"More options"})]}),s.jsxs(Ar,{align:"end",className:"w-36",children:[s.jsxs(Ye,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{b(!0),w(e.name)},children:[s.jsx(Fs,{className:"h-3.5 w-3.5"}),"Rename"]}),s.jsxs(Ye,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>x==null?void 0:x(e.id),children:[s.jsx(wr,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!g&&s.jsx("div",{className:"divide-y divide-border/60",children:t.length===0?s.jsx("div",{className:"px-14 py-3 text-xs text-muted-foreground/50 italic",children:"No issues in this list"}):t.map(P=>s.jsx(RS,{issue:P,projectId:n,statuses:a,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[P.id]??[],childrenMap:r,onAddChild:m},P.id))})]})}function YL(){var z,se;const e=ft(),{workspace:t,projectKey:r}=It(),[n,a]=h.useState(null),[i,o]=h.useState({open:!1}),[l,c]=h.useState(""),[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState("all"),[g,v]=h.useState("all"),[y,b]=h.useState("all"),{data:N}=ea(r??""),w=(N==null?void 0:N.id)??"",{data:k,isLoading:j}=Hu(w||void 0),{data:C}=Ro(w||void 0),{data:P}=$o(w||void 0),{data:S}=pc(w||void 0),_=KR(w),M=YR(w),E=GR(w),A=C&&C.length>0?C:Object.entries(xi).map(([W,X],ie)=>({id:W,project_id:w,key:W,name:X,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[W]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[W]??"backlog",position:ie})),D=Object.fromEntries(A.map(W=>[W.key,W.name])),Z=Object.fromEntries(A.map(W=>[W.key,W.color])),Q=P??[];if(!r||!t)return null;const q=(k??[]).filter(W=>{const X=!f||W.title.toLowerCase().includes(f.toLowerCase())||W.identifier.toLowerCase().includes(f.toLowerCase()),ie=p==="all"||W.status===p,V=g==="all"||W.priority===g,J=y==="all"||(y==="none"?!W.sprint_id:W.sprint_id===y);return X&&ie&&V&&J}).sort((W,X)=>{const ie=parseInt(W.identifier.split("-")[1]??"0",10),V=parseInt(X.identifier.split("-")[1]??"0",10);return ie-V}),te=new Map((k??[]).map(W=>[W.id,W])),ne=new Set(q.map(W=>W.id)),I=new Set(ne);for(const W of q){let X=W.parent_id;for(;X&&!I.has(X);)I.add(X),X=((z=te.get(X))==null?void 0:z.parent_id)??null}const O={};for(const W of I){const X=te.get(W);X.parent_id&&I.has(X.parent_id)&&(O[X.parent_id]||(O[X.parent_id]=[]),O[X.parent_id].push(X))}for(const W of Object.values(O))W.sort((X,ie)=>{const V=parseInt(X.identifier.split("-")[1]??"0",10),J=parseInt(ie.identifier.split("-")[1]??"0",10);return V-J});const L=Array.from(I).map(W=>te.get(W)).filter(W=>!W.parent_id||!I.has(W.parent_id)).sort((W,X)=>{const ie=parseInt(W.identifier.split("-")[1]??"0",10),V=parseInt(X.identifier.split("-")[1]??"0",10);return ie-V}),H=q.length,R=new Set((S??[]).map(W=>W.id)),Y={__none__:[]};for(const W of S??[])Y[W.id]=[];for(const W of L){const X=W.task_list_id&&R.has(W.task_list_id)?W.task_list_id:"__none__";Y[X].push(W)}function F(){l.trim()&&_.mutate({name:l.trim()},{onSuccess:()=>{c(""),u(!1),B.success("List created")},onError:()=>B.error("Failed to create list")})}function T(W,X){M.mutate({id:W,name:X},{onError:()=>B.error("Failed to rename list")})}function G(W){const X=S==null?void 0:S.find(ie=>ie.id===W);confirm(`Delete list "${X==null?void 0:X.name}"? Issues in this list will be moved to No List.`)&&E.mutate(W,{onSuccess:()=>B.success("List deleted"),onError:()=>B.error("Failed to delete list")})}return s.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[s.jsx(Or,{zone:"project.issues.before",props:{projectId:w}}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-2",children:[d?s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(_e,{autoFocus:!0,placeholder:"List name...",value:l,onChange:W=>c(W.target.value),onKeyDown:W=>{W.key==="Enter"&&F(),W.key==="Escape"&&(u(!1),c(""))},className:"h-8 text-xs w-36"}),s.jsx(re,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:F,disabled:!l.trim()||_.isPending,children:"Add"}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),c("")},children:"Cancel"})]}):s.jsxs(re,{size:"sm",variant:"outline",onClick:()=>u(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"New List"]}),s.jsxs(re,{size:"sm",onClick:()=>o({open:!0}),children:[s.jsx(ot,{className:"h-4 w-4"}),"Create"]})]})}),s.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 border-b border-border md:flex-row md:items-center md:justify-between md:gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2 md:overflow-x-auto md:scrollbar-none",children:[s.jsxs(Be,{value:y,onValueChange:b,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[140px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Sprint"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),Q.map(W=>s.jsx(ke,{value:W.id,className:"text-xs",children:W.name},W.id))]})]}),s.jsxs(Be,{value:p,onValueChange:x,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Status"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),A.map(({key:W,name:X})=>s.jsx(ke,{value:W,className:"text-xs",children:X},W))]})]}),s.jsxs(Be,{value:g,onValueChange:v,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Priority"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(un).map(([W,X])=>s.jsx(ke,{value:W,className:"text-xs",children:X},W))]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ra,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search...",value:f,onChange:W=>m(W.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsxs("div",{className:"min-w-[1025px]",children:[s.jsxs("div",{className:$("grid items-center py-2.5 border-b border-border",Uh),children:[s.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[110px] z-10 bg-white dark:bg-card",children:"Title"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"}),s.jsx("span",{className:"pr-6"})]}),j?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(W=>s.jsxs("div",{className:$("grid items-center px-6 py-3 gap-4",Uh),children:[s.jsx(le,{className:"h-4 w-14"}),s.jsx(le,{className:"h-4 w-56"}),s.jsx(le,{className:"h-5 w-20"}),s.jsx(le,{className:"h-4 w-16"}),s.jsx(le,{className:"h-4 w-20"}),s.jsx(le,{className:"h-4 w-24"}),s.jsx(le,{className:"h-6 w-16"}),s.jsx("span",{})]},W))}):H===0&&(k??[]).length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first issue to start tracking work."}),s.jsxs(re,{size:"sm",onClick:()=>o({open:!0}),children:[s.jsx(ot,{className:"h-4 w-4"}),"Create issue"]})]}):L.length===0&&(k??[]).length>0?s.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No issues match your filters."})}):s.jsx(Uu,{delayDuration:200,children:s.jsxs("div",{className:"divide-y divide-border",children:[(S??[]).map(W=>s.jsx(eb,{taskList:W,issues:Y[W.id]??[],childrenMap:O,projectId:w,statuses:A,statusLabels:D,statusColorMap:Z,sprints:Q,workspace:t,projectKey:r,onOpen:a,onAddIssue:X=>o({open:!0,defaultTaskListId:X}),onAddChild:X=>o({open:!0,defaultParentId:X}),onRenameList:T,onDeleteList:G},W.id)),(((se=Y.__none__)==null?void 0:se.length)>0||(S??[]).length===0)&&s.jsx(eb,{taskList:null,issues:Y.__none__??[],childrenMap:O,projectId:w,statuses:A,statusLabels:D,statusColorMap:Z,sprints:Q,workspace:t,projectKey:r,onOpen:a,onAddIssue:W=>o({open:!0,defaultTaskListId:W}),onAddChild:W=>o({open:!0,defaultParentId:W})})]})})]})}),s.jsx("div",{className:"md:hidden divide-y divide-border/60",children:j?[1,2,3,4].map(W=>s.jsx("div",{className:"flex items-start gap-3 px-4 py-3",children:s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-3 w-10 bg-muted rounded animate-pulse"}),s.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"})]}),s.jsx("div",{className:"h-3 w-32 bg-muted rounded animate-pulse"})]})},W)):L.length===0?null:L.map(W=>{const X=(Z==null?void 0:Z[W.status])??"#94a3b8",ie=Q.find(V=>V.id===W.sprint_id);return s.jsx("div",{onClick:()=>e(`/${t}/projects/${r}/issues/${W.id}`),className:"flex items-start gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",children:s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:W.identifier}),s.jsx("span",{className:"text-sm text-foreground truncate font-medium",children:W.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(Wh,{priority:W.priority}),s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:X}}),D[W.status]??W.status]}),ie&&s.jsx("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:ie.name}),W.due_date&&s.jsx("span",{className:"text-[11px] text-muted-foreground",children:me(new Date(W.due_date),"MMM d")})]})]})},W.id)})}),!j&&H>0&&s.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:s.jsxs("span",{className:"text-xs text-muted-foreground",children:[H," issue",H!==1?"s":""]})})]}),s.jsx(Or,{zone:"project.issues.after",props:{projectId:w}}),s.jsx(IS,{issue:n,projectId:w,open:!!n,onClose:()=>a(null)}),s.jsx(gf,{open:i.open,onClose:()=>o({open:!1}),projectId:w,defaultTaskListId:i.defaultTaskListId,defaultParentId:i.defaultParentId})]})}const Fr=20;function GL({member:e,onRequestRemove:t}){var l;const r=e.user,n=(r==null?void 0:r.first_name)??"",a=(r==null?void 0:r.last_name)??"",i=`${n} ${a}`.trim()||(r==null?void 0:r.email)||"Unknown",o=(n[0]??a[0]??((l=r==null?void 0:r.email)==null?void 0:l[0])??"U").toUpperCase();return s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[s.jsx(_t,{className:"h-8 w-8 shrink-0",children:s.jsx(Pt,{className:"text-xs font-medium",children:o})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i}),(r==null?void 0:r.email)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:r.email})]}),s.jsx(Cn,{className:$("shrink-0 text-[11px] border-0 min-w-20 justify-center",e.app_role_name==="Workspace Admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400":e.app_role_name==="Viewer"?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:e.app_role_name??e.role}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})}function VL({teamEntry:e,onRemove:t}){const r=e.team;return s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ea,{className:"h-4 w-4 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:(r==null?void 0:r.name)??"Unknown team"}),r&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[r.member_count," ",r.member_count===1?"member":"members"]})]}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})}function XL(){const{projectKey:e}=It(),{workspace:t}=Te(),r=(t==null?void 0:t.id)??"",{data:n}=ea(e??""),a=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=Kn(a),{data:l}=Po(r),{data:c}=Vu(r),{data:d}=Nx(a),u=_N(a),f=((d==null?void 0:d.requests)??[]).filter(q=>q.status==="pending"),m=NN(a),p=kN(a),x=SN(a),g=CN(a),[v,y]=h.useState([]),[b,N]=h.useState([]),[w,k]=h.useState(0),[j,C]=h.useState(0),[P,S]=h.useState(null),_=new Set((i==null?void 0:i.members.map(q=>q.user_id))??[]),M=new Set((i==null?void 0:i.teams.map(q=>q.team_id))??[]),E=(l??[]).filter(q=>!_.has(q.user_id)),A=(c??[]).filter(q=>!M.has(q.id)),D=(i==null?void 0:i.members.length)??0,Z=(i==null?void 0:i.teams.length)??0;function Q(){P&&p.mutate(P.userId,{onSuccess:()=>{B.success("Access removed"),S(null)},onError:()=>B.error("Failed to remove")})}return s.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold",children:"Access"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Manage who has access to this project."})]}),!o&&s.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[D," member",D!==1?"s":""," • ",Z," team",Z!==1?"s":""]})]}),o?s.jsxs("div",{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),s.jsx("div",{className:"divide-y divide-border",children:[1,2].map(q=>s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[s.jsx(le,{className:"h-8 w-8 rounded-full"}),s.jsx(le,{className:"h-4 w-44"}),s.jsx("div",{className:"flex-1"}),s.jsx(le,{className:"h-5 w-20"})]},q))}),s.jsx("div",{className:"px-6 py-2 border-y border-border bg-muted/20",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),s.jsx("div",{className:"divide-y divide-border",children:[1].map(q=>s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[s.jsx(le,{className:"h-8 w-8 rounded-lg"}),s.jsx(le,{className:"h-4 w-32"}),s.jsx("div",{className:"flex-1"}),s.jsx(le,{className:"h-4 w-20"})]},q))})]}):s.jsxs("div",{children:[f.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-amber-50 dark:bg-amber-950/20",children:s.jsxs("span",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400 uppercase tracking-wide flex items-center gap-2",children:["Requests",s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-amber-500 px-1 text-[10px] font-medium text-white",children:f.length})]})}),s.jsx("div",{className:"divide-y divide-border",children:f.map(q=>{var L,H,R,Y,F,T;const te=((L=q.user)==null?void 0:L.first_name)??"",ne=((H=q.user)==null?void 0:H.last_name)??"",I=`${te} ${ne}`.trim()||((R=q.user)==null?void 0:R.email)||"Unknown",O=(te[0]??ne[0]??((F=(Y=q.user)==null?void 0:Y.email)==null?void 0:F[0])??"U").toUpperCase();return s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors",children:[s.jsx(_t,{className:"h-8 w-8 shrink-0",children:s.jsx(Pt,{className:"text-xs font-medium",children:O})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:I}),((T=q.user)==null?void 0:T.email)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:q.user.email}),q.message&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-1 italic",children:['"',q.message,'"']})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 px-2 text-xs text-destructive border-destructive/30 hover:bg-destructive/10",disabled:u.isPending,onClick:()=>u.mutate({requestId:q.id,action:"deny"},{onError:()=>B.error("Failed to deny request")}),children:[s.jsx(We,{className:"h-3 w-3 mr-1"}),"Deny"]}),s.jsxs(re,{size:"sm",className:"h-7 px-2 text-xs",disabled:u.isPending,onClick:()=>u.mutate({requestId:q.id,action:"approve"},{onSuccess:()=>B.success(`${I} granted access`),onError:()=>B.error("Failed to approve request")}),children:[s.jsx(At,{className:"h-3 w-3 mr-1"}),"Approve"]})]})]},q.id)})})]}),s.jsxs("div",{children:[s.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:[s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["People",D>0&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:D})]}),E.length>0&&s.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[s.jsx(Is,{options:E.map(q=>{const te=q.user,ne=(te==null?void 0:te.first_name)??"",I=(te==null?void 0:te.last_name)??"";return{value:q.user_id,label:`${ne} ${I}`.trim()||(te==null?void 0:te.email)||"Unknown"}}),selected:v,onSelectionChange:y,placeholder:"Add people…",className:"w-full sm:w-56"}),s.jsxs(re,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:v.length===0||m.isPending,onClick:()=>m.mutate({userIds:v},{onSuccess:q=>{B.success(`${q.added} member${q.added===1?"":"s"} added`),y([])},onError:()=>B.error("Failed to grant access")}),children:[s.jsx(ln,{className:"h-3.5 w-3.5"}),v.length<=1?"Add":`Add ${v.length}`]})]})]}),D===0?s.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.members)??[]).slice(w*Fr,(w+1)*Fr).map(q=>s.jsx(GL,{member:q,onRequestRemove:(te,ne)=>S({userId:te,displayName:ne})},q.id))}),D>Fr&&s.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[w*Fr+1,"–",Math.min((w+1)*Fr,D)," of ",D]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>k(q=>q-1),disabled:w===0,children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[w+1," / ",Math.ceil(D/Fr)]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>k(q=>q+1),disabled:(w+1)*Fr>=D,children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]})]})]}),s.jsxs("div",{className:"border-t border-border",children:[s.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:[s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Teams",Z>0&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:Z})]}),A.length>0&&s.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[s.jsx(Is,{options:A.map(q=>({value:q.id,label:q.name})),selected:b,onSelectionChange:N,placeholder:"Add teams…",className:"w-full sm:w-56"}),s.jsxs(re,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:b.length===0||x.isPending,onClick:()=>x.mutate(b,{onSuccess:q=>{B.success(`${q.added} team${q.added===1?"":"s"} added`),N([])},onError:()=>B.error("Failed to add teams")}),children:[s.jsx(Ea,{className:"h-3.5 w-3.5"}),b.length<=1?"Add":`Add ${b.length}`]})]})]}),Z===0?s.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.teams)??[]).slice(j*Fr,(j+1)*Fr).map(q=>s.jsx(VL,{teamEntry:q,onRemove:te=>g.mutate(te,{onSuccess:()=>B.success("Team access removed"),onError:()=>B.error("Failed to remove team")})},q.id))}),Z>Fr&&s.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j*Fr+1,"–",Math.min((j+1)*Fr,Z)," of ",Z]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>C(q=>q-1),disabled:j===0,children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[j+1," / ",Math.ceil(Z/Fr)]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>C(q=>q+1),disabled:(j+1)*Fr>=Z,children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]})]})]}),D===0&&Z===0&&E.length===0&&A.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center border-t border-border",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(Ea,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No access entries yet"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add workspace people or teams first to grant project access."})]})]})]}),s.jsx(oi,{open:!!P,onOpenChange:q=>{q||S(null)},children:s.jsxs(wa,{className:"sm:max-w-md",children:[s.jsxs(ja,{children:[s.jsx(ka,{children:"Remove member access?"}),s.jsx(Sa,{children:P?`${P.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),s.jsxs(Na,{children:[s.jsx(_a,{disabled:p.isPending,children:"Cancel"}),s.jsx(Ca,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:q=>{q.preventDefault(),Q()},disabled:p.isPending,children:p.isPending?"Removing...":"Remove"})]})]})})]})}function tb(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function Tn({label:e,children:t}){return s.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),s.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const QL={backlog:s.jsx(Er,{className:"h-3 w-3 text-zinc-400"}),todo:s.jsx(Er,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:s.jsx(dn,{className:"h-3 w-3 text-indigo-500"}),in_review:s.jsx(Pi,{className:"h-3 w-3 text-amber-500"}),done:s.jsx(kn,{className:"h-3 w-3 text-emerald-500"}),cancelled:s.jsx(lx,{className:"h-3 w-3 text-zinc-400"})},ZL={urgent:s.jsx(gs,{className:"h-3 w-3 text-red-500"}),high:s.jsx(_i,{className:"h-3 w-3 text-orange-500"}),medium:s.jsx(Js,{className:"h-3 w-3 text-yellow-500"}),low:s.jsx(Ci,{className:"h-3 w-3 text-blue-400"})},JL={bug:s.jsx(Q1,{className:"h-3 w-3 text-red-500"}),feature:s.jsx(oN,{className:"h-3 w-3 text-purple-500"}),task:s.jsx(Gu,{className:"h-3 w-3 text-blue-500"}),chore:s.jsx(ix,{className:"h-3 w-3 text-zinc-500"})};function Xm({value:e,onValueChange:t,options:r,icons:n,placeholder:a}){return s.jsxs(Be,{value:e,onValueChange:t,children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??s.jsx(J1,{className:"h-3 w-3 text-muted-foreground"}),s.jsx("span",{children:r[e]??a??""})]})}),s.jsx(Fe,{children:Object.entries(r).map(([i,o])=>s.jsx(ke,{value:i,className:"text-xs",children:s.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function ez(){const{workspace:e,projectKey:t,issueId:r}=It(),n=ft(),[a,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(!1),{data:m}=ea(t??""),p=(m==null?void 0:m.id)??"",{data:x,isLoading:g}=K1(r??""),v=Ku(r??"",p),{data:y}=Kn(p),b=h.useMemo(()=>y?y.members.filter(O=>O.user).map(O=>O.user):void 0,[y]),N=h.useMemo(()=>b==null?void 0:b.map(O=>({id:O.id,label:`${O.first_name??""} ${O.last_name??""}`.trim()||O.email,email:O.email})),[b]),{data:w}=Ro(p||void 0),{data:k}=$o(p||void 0),{data:j}=pc(p||void 0),{data:C}=Y1(r??""),P=(k??[]).filter(O=>O.status!=="completed"),{data:S}=Mk(),_=(S==null?void 0:S.maxChildIssueDepth)??1,E=((C==null?void 0:C.depth)??0)<_,A=(C==null?void 0:C.parent)??null,D=(C==null?void 0:C.children)??[],Z=x!=null&&x.task_list_id?j==null?void 0:j.find(O=>O.id===x.task_list_id):null,Q=w&&w.length>0?Object.fromEntries(w.map(O=>[O.key,O.name])):xi,q=w&&w.length>0?Object.fromEntries(w.map(O=>[O.key,O.category==="completed"?s.jsx(kn,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?s.jsx(dn,{className:"h-3 w-3",style:{color:O.color}}):s.jsx(Er,{className:"h-3 w-3",style:{color:O.color}})])):QL;if(h.useEffect(()=>{x&&(l(x.title),d(x.description??"")),i(!1)},[x==null?void 0:x.id]),!t||!r)return null;const te=()=>{if(!o.trim())return;const O=[];new DOMParser().parseFromString(c,"text/html").querySelectorAll("[data-type='mention']").forEach(R=>{const Y=R.getAttribute("data-id");Y&&!O.includes(Y)&&O.push(Y)}),v.mutate({title:o.trim(),description:c.trim()||void 0,mentioned_user_ids:O.length>0?O:void 0},{onSuccess:()=>{i(!1),B.success("Issue updated")},onError:()=>B.error("Failed to update issue")})},ne=()=>{x&&(l(x.title),d(x.description??"")),i(!1)},I=(O,L)=>{v.mutate(O,{onSuccess:()=>B.success(`${L} updated`),onError:()=>B.error(`Failed to update ${L.toLowerCase()}`)})};return g||!x?s.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[s.jsx("div",{className:"sticky top-0 z-10 h-[57px] bg-white dark:bg-card border-b border-border"}),s.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 space-y-4 shadow-sm",children:[s.jsx(le,{className:"h-7 w-3/4"}),s.jsx(le,{className:"h-32 w-full"})]}),s.jsx(le,{className:"h-24 w-full rounded-xl"}),s.jsx(le,{className:"h-48 w-full rounded-xl"})]}),s.jsx(le,{className:"h-[280px] w-full rounded-xl"})]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[s.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:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>n(`/${e}/projects/${t}/issues`),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),(m==null?void 0:m.name)??"Issues"]}),s.jsx("span",{className:"text-border",children:"/"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x.identifier}),s.jsx(Cn,{variant:"muted",className:"text-[10px] ml-1",children:Bs[x.type]??x.type})]}),s.jsx("div",{className:"flex items-center gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:ne,children:"Discard"}),s.jsx(re,{size:"sm",onClick:te,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[s.jsx(Fs,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),s.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Or,{zone:"issue.details.before",props:{issue:x}}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"px-6 pt-6 pb-3",children:a?s.jsx("input",{autoFocus:!0,value:o,onChange:O=>l(O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()},className:$("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")}):s.jsx("h1",{className:"text-xl font-semibold text-foreground leading-snug",children:x.title})}),s.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:s.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),a?s.jsx(mf,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]",users:N}):x.description?s.jsx("div",{className:"border-t border-border/50",children:s.jsx(Yx,{html:x.description,className:"px-5 py-4"})}):s.jsx("div",{className:"border-t border-border/50 px-6 py-4",children:s.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})})]}),E&&s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[s.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Child Issues"}),s.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),D.length===0?s.jsx("div",{className:"px-5 py-4 text-xs text-muted-foreground/50 italic",children:"No child issues yet"}):s.jsx("div",{className:"px-5 py-2 divide-y divide-border/40",children:D.map(O=>s.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[s.jsx(Ds,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${O.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:O.identifier}),s.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${O.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:O.title})]},O.id))})]}),s.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:s.jsx(aS,{issueId:r,projectId:p,scrollMarginTop:57})}),s.jsx(Or,{zone:"issue.details.after",props:{issue:x}})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Or,{zone:"issue.details.sidebar",props:{issue:x}}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),s.jsxs("div",{className:"px-4 py-1",children:[s.jsx(Tn,{label:"Status",children:s.jsx(Xm,{value:x.status,onValueChange:O=>I({status:O},"Status"),options:Q,icons:q})}),s.jsx(Tn,{label:"Priority",children:s.jsx(Xm,{value:x.priority,onValueChange:O=>I({priority:O},"Priority"),options:un,icons:ZL})}),s.jsx(Tn,{label:"Type",children:s.jsx(Xm,{value:x.type,onValueChange:O=>I({type:O},"Type"),options:Bs,icons:JL})}),s.jsx(Tn,{label:"Assignees",children:s.jsx(xc,{value:x.assignee_ids??[],onChange:O=>I({assignee_ids:O},"Assignees"),disabled:v.isPending,users:b})}),s.jsx(Tn,{label:"Sprint",children:s.jsxs(Be,{value:x.sprint_id??"none",onValueChange:O=>I({sprint_id:O==="none"?null:O},"Sprint"),children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Yr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),x.sprint_id?(()=>{const O=P.find(H=>H.id===x.sprint_id)??(k==null?void 0:k.find(H=>H.id===x.sprint_id));if(!O)return s.jsxs("span",{className:"truncate",children:[x.sprint_id.slice(0,8),"…"]});const L=tb(O);return s.jsxs("span",{className:"truncate",children:[O.name,L&&s.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",L]})]})})():s.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),P.map(O=>{const L=tb(O);return s.jsx(ke,{value:O.id,className:"text-xs",children:s.jsxs("div",{className:"flex items-baseline gap-1.5",children:[s.jsx("span",{children:O.name}),L&&s.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:L})]})},O.id)})]})]})}),(j??[]).length>0&&s.jsx(Tn,{label:"List",children:s.jsxs(Be,{value:x.task_list_id??"none",onValueChange:O=>I({task_list_id:O==="none"?null:O},"List"),children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(fx,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:Z?"truncate":"text-muted-foreground",children:(Z==null?void 0:Z.name)??"No list"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(j??[]).map(O=>s.jsx(ke,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),s.jsx(Tn,{label:"Start Date",children:s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:x.start_date?"text-foreground":"text-muted-foreground",children:x.start_date?me(new Date(x.start_date),"MMM d, yyyy"):"No start date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",children:[s.jsx(br,{mode:"single",selected:x.start_date?new Date(x.start_date):void 0,onSelect:O=>I({start_date:O?me(O,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),x.start_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>I({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),s.jsx(Tn,{label:"Due Date",children:s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:x.due_date?"text-foreground":"text-muted-foreground",children:x.due_date?me(new Date(x.due_date),"MMM d, yyyy"):"No due date"})]})}),s.jsxs(Ct,{className:"w-auto p-0",align:"start",children:[s.jsx(br,{mode:"single",selected:x.due_date?new Date(x.due_date):void 0,onSelect:O=>I({due_date:O?me(O,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),x.due_date&&s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs("button",{onClick:()=>I({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[s.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),s.jsx(Tn,{label:"Depends on",children:s.jsx(lo,{value:x.depends_on_ids??[],onChange:O=>I({depends_on_ids:O},"Dependencies"),projectId:x.project_id,excludeId:x.id,disabled:v.isPending})}),s.jsx(Tn,{label:"Related to",children:s.jsx(lo,{value:x.related_to_ids??[],onChange:O=>I({related_to_ids:O},"Relations"),projectId:x.project_id,excludeId:x.id,disabled:v.isPending})}),A&&s.jsx(Tn,{label:"Parent",children:s.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${A.id}`),className:"flex items-center gap-1.5 text-xs hover:text-foreground transition-colors text-left w-full min-w-0",children:[s.jsx(ox,{className:"h-3 w-3 text-muted-foreground shrink-0"}),s.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:A.identifier}),s.jsx("span",{className:"text-foreground truncate",children:A.title})]})})]})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Details"})}),s.jsxs("div",{className:"px-4 pt-3 pb-4 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Created"}),s.jsx("span",{className:"text-foreground",children:me(new Date(x.created_at),"MMM d, yyyy")})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-muted-foreground",children:"Updated"}),s.jsx("span",{className:"text-foreground",children:me(new Date(x.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),s.jsx(gf,{open:u,onClose:()=>f(!1),projectId:p,defaultParentId:r,defaultTaskListId:x.task_list_id})]})}function ks({label:e,children:t}){return s.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),s.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const tz={backlog:s.jsx(Er,{className:"h-3 w-3 text-zinc-400"}),todo:s.jsx(Er,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:s.jsx(dn,{className:"h-3 w-3 text-indigo-500"}),in_review:s.jsx(Pi,{className:"h-3 w-3 text-amber-500"}),done:s.jsx(kn,{className:"h-3 w-3 text-emerald-500"}),cancelled:s.jsx(lx,{className:"h-3 w-3 text-zinc-400"})},rz={urgent:s.jsx(gs,{className:"h-3 w-3 text-red-500"}),high:s.jsx(_i,{className:"h-3 w-3 text-orange-500"}),medium:s.jsx(Js,{className:"h-3 w-3 text-yellow-500"}),low:s.jsx(Ci,{className:"h-3 w-3 text-blue-400"})},nz={bug:s.jsx(Q1,{className:"h-3 w-3 text-red-500"}),feature:s.jsx(oN,{className:"h-3 w-3 text-purple-500"}),task:s.jsx(Gu,{className:"h-3 w-3 text-blue-500"}),chore:s.jsx(ix,{className:"h-3 w-3 text-zinc-500"})};function Qm({value:e,onValueChange:t,options:r,icons:n,placeholder:a}){return s.jsxs(Be,{value:e,onValueChange:t,children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??s.jsx(J1,{className:"h-3 w-3 text-muted-foreground"}),s.jsx("span",{children:r[e]??a??""})]})}),s.jsx(Fe,{children:Object.entries(r).map(([i,o])=>s.jsx(ke,{value:i,className:"text-xs",children:s.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function sz(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?me(new Date(e.start_date),"MMM d"):"—",r=e.end_date?me(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function az(){const{workspace:e,projectKey:t}=It(),r=ft(),{workspace:n}=Te(),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("backlog"),[u,f]=h.useState("medium"),[m,p]=h.useState("task"),[x,g]=h.useState([]),[v,y]=h.useState(""),[b,N]=h.useState(""),[w,k]=h.useState(void 0),[j,C]=h.useState(void 0),[P,S]=h.useState(!1),[_,M]=h.useState("weekly"),[E,A]=h.useState(void 0),{data:D}=ea(t??""),Z=(D==null?void 0:D.id)??"",Q=G1(),{data:q}=Kn(Z),te=h.useMemo(()=>q?q.members.filter(T=>T.user).map(T=>T.user):void 0,[q]),ne=h.useMemo(()=>te==null?void 0:te.map(T=>({id:T.id,label:`${T.first_name??""} ${T.last_name??""}`.trim()||T.email,email:T.email})),[te]),{data:I}=Ro(Z||void 0),{data:O}=$o(Z||void 0);h.useEffect(()=>{I&&I.length>0&&(I.map(G=>G.key).includes(c)||d(I[0].key))},[I]);const{data:L}=pc(Z||void 0),H=(O??[]).filter(T=>T.status!=="completed"),R=I&&I.length>0?Object.fromEntries(I.map(T=>[T.key,T.name])):xi,Y=I&&I.length>0?Object.fromEntries(I.map(T=>[T.key,T.category==="completed"?s.jsx(kn,{className:"h-3 w-3",style:{color:T.color}}):T.category==="started"?s.jsx(dn,{className:"h-3 w-3",style:{color:T.color}}):s.jsx(Er,{className:"h-3 w-3",style:{color:T.color}})])):tz;if(!t||!Z)return null;const F=()=>{if(!a.trim()){B.error("Title is required");return}const T=[];o&&new DOMParser().parseFromString(o,"text/html").querySelectorAll("[data-type='mention']").forEach(se=>{const W=se.getAttribute("data-id");W&&!T.includes(W)&&T.push(W)}),Q.mutate({title:a.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:Z,workspace_id:n.id,assignee_ids:x.length>0?x:void 0,sprint_id:v||null,task_list_id:b||null,start_date:w?me(w,"yyyy-MM-dd"):null,due_date:j?me(j,"yyyy-MM-dd"):null,recurrence_frequency:P?_:void 0,recurrence_end_date:P&&E?me(E,"yyyy-MM-dd"):void 0,mentioned_user_ids:T.length>0?T:void 0},{onSuccess:G=>{B.success("Issue created"),r(`/${e}/projects/${t}/issues/${G.issue.id}`,{replace:!0})},onError:G=>B.error(G.message??"Failed to create issue")})};return s.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[s.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:[s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>r(`/${e}/projects/${t}/issues`),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),(D==null?void 0:D.name)??"Issues"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),s.jsx(re,{size:"sm",onClick:F,disabled:!a.trim()||Q.isPending,className:"px-4",children:Q.isPending?"Creating…":"Create issue"})]})]}),s.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[s.jsx("div",{className:"px-6 pt-6 pb-3",children:s.jsx("input",{autoFocus:!0,value:a,onChange:T=>i(T.target.value),onKeyDown:T=>{T.key==="Enter"&&T.preventDefault()},placeholder:"Issue title…",className:$("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")})}),s.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:s.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),s.jsx(mf,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]",users:ne})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),s.jsxs("div",{className:"px-4 py-1",children:[s.jsx(ks,{label:"Status",children:s.jsx(Qm,{value:c,onValueChange:d,options:R,icons:Y})}),s.jsx(ks,{label:"Priority",children:s.jsx(Qm,{value:u,onValueChange:f,options:un,icons:rz})}),s.jsx(ks,{label:"Type",children:s.jsx(Qm,{value:m,onValueChange:p,options:Bs,icons:nz})}),s.jsx(ks,{label:"Assignees",children:s.jsx(xc,{value:x,onChange:g,users:te})}),H.length>0&&s.jsx(ks,{label:"Sprint",children:s.jsxs(Be,{value:v||"none",onValueChange:T=>y(T==="none"?"":T),children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Yr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx(Ve,{placeholder:"No sprint"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),H.map(T=>{const G=sz(T);return s.jsx(ke,{value:T.id,className:"text-xs",children:s.jsxs("div",{className:"flex items-baseline gap-1.5",children:[s.jsx("span",{children:T.name}),G&&s.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:G})]})},T.id)})]})]})}),(L??[]).length>0&&s.jsx(ks,{label:"List",children:s.jsxs(Be,{value:b||"none",onValueChange:T=>N(T==="none"?"":T),children:[s.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:s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(fx,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx(Ve,{placeholder:"No list"})]})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(L??[]).map(T=>s.jsx(ke,{value:T.id,className:"text-xs",children:T.name},T.id))]})]})}),s.jsx(ks,{label:"Start Date",children:s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:w?"text-foreground":"text-muted-foreground",children:w?me(w,"MMM d, yyyy"):"No start date"}),w&&s.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),k(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3 w-3"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:w,onSelect:k,initialFocus:!0})})]})}),s.jsx(ks,{label:"Due Date",children:s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:j?"text-foreground":"text-muted-foreground",children:j?me(j,"MMM d, yyyy"):"No due date"}),j&&s.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),C(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3 w-3"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:j,onSelect:C,initialFocus:!0})})]})}),s.jsx(ks,{label:"Recurring",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 pl-1",children:[s.jsx(Lo,{id:"new-recurring",checked:P,onCheckedChange:S}),s.jsxs(at,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[s.jsx(ro,{className:"h-3 w-3 text-muted-foreground"}),P?_.charAt(0).toUpperCase()+_.slice(1):"Off"]})]}),P&&s.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[s.jsxs(Be,{value:_,onValueChange:T=>M(T),children:[s.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:s.jsx(Ve,{})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),s.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.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:[s.jsx(Ut,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?me(E,"MMM d, yyyy"):"No end date"}),E&&s.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),A(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(We,{className:"h-3 w-3"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:E,onSelect:A,initialFocus:!0})})]})]})]})})]}),s.jsx("div",{className:"px-4 pt-2 pb-3 mt-1 border-t border-border/60",children:s.jsxs("p",{className:"text-[11px] text-muted-foreground/50 leading-relaxed",children:["Press ",s.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})})]})]})})]})}const $S={all:["my-tasks"],filtered:e=>[...$S.all,e??{}]};function iz(e){return De({queryKey:$S.filtered(e),queryFn:()=>{var r,n,a,i;const t=new URLSearchParams;return t.set("limit","200"),(r=e==null?void 0:e.workspace_id)!=null&&r.length&&t.set("workspace_id",e.workspace_id.join(",")),(n=e==null?void 0:e.priority)!=null&&n.length&&t.set("priority",e.priority.join(",")),(a=e==null?void 0:e.type)!=null&&a.length&&t.set("type",e.type.join(",")),(i=e==null?void 0:e.category)!=null&&i.length&&t.set("category",e.category.join(",")),oe.get(`/admin/my/tasks?${t}`)},select:t=>t.issues})}const oz=({priority:e})=>{const t=$("h-3 w-3 shrink-0",hc[e]);switch(e){case"urgent":return s.jsx(gs,{className:t});case"high":return s.jsx(_i,{className:t});case"medium":return s.jsx(Js,{className:t});case"low":return s.jsx(Ci,{className:t});default:return s.jsx(Er,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function lz({issue:e,onClick:t}){var n,a;const{data:r}=$a();return s.jsxs("div",{onClick:t,className:$("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"),children:[s.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),s.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mb-2",children:[s.jsx(Ut,{className:"h-2.5 w-2.5 shrink-0"}),s.jsx("span",{children:e.start_date?me(new Date(e.start_date),"MMM d"):"?"}),s.jsx("span",{children:"→"}),s.jsx("span",{children:e.due_date?me(new Date(e.due_date),"MMM d"):"?"})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.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._project&&s.jsx("span",{className:"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 shrink-0",children:e._project.identifier}),s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e._status.color}}),s.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:e._status.name})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&s.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(i=>{const o=r==null?void 0:r.get(i);return s.jsx(_t,{className:"h-4 w-4 border border-background",children:s.jsx(Pt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(o==null?void 0:o.initials)??"?"})},i)}),(((n=e.assignee_ids)==null?void 0:n.length)??0)>2&&s.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((a=e.assignee_ids)==null?void 0:a.length)??0)-2]})]}),s.jsx(oz,{priority:e.priority})]})]})]})}const rb=[{key:"backlog",label:"Backlog",color:"#94a3b8"},{key:"unstarted",label:"Unstarted",color:"#64748b"},{key:"started",label:"Started",color:"#6366f1"},{key:"completed",label:"Completed",color:"#10b981"},{key:"cancelled",label:"Cancelled",color:"#9ca3af"}];function nb(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(a)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${a},${i},${t})`}const cz=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return s.jsx(kn,{className:r,style:n});case"started":return s.jsx(dn,{className:r,style:n});default:return s.jsx(Er,{className:r,style:n})}};function dz({issues:e,onIssueClick:t}){const r=h.useMemo(()=>{const n={};for(const a of rb)n[a.key]=[];for(const a of e){const i=a._status.category;n[i]?n[i].push(a):n.backlog.push(a)}return n},[e]);return s.jsx("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:rb.map(n=>{const a=r[n.key],i=nb(n.color,.08);return s.jsxs("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[s.jsx(cz,{category:n.key,color:n.color}),s.jsx("span",{className:"text-xs font-medium text-foreground",children:n.label}),s.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:nb(n.color,.12),color:n.color},children:a.length})]}),s.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors",style:{backgroundColor:i},children:[a.map(o=>s.jsx(lz,{issue:o,onClick:()=>t==null?void 0:t(o)},o.id)),a.length===0&&s.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:s.jsx("p",{className:"text-xs text-muted-foreground/40",children:"No tasks"})})]})]},n.key)})})}const LS=({priority:e,className:t})=>{const r=$("h-3.5 w-3.5 shrink-0",hc[e],t);switch(e){case"urgent":return s.jsx(gs,{className:r});case"high":return s.jsx(_i,{className:r});case"medium":return s.jsx(Js,{className:r});case"low":return s.jsx(Ci,{className:r});default:return s.jsx(Er,{className:$("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},uz={backlog:"Backlog",unstarted:"Unstarted",started:"Started",completed:"Completed",cancelled:"Cancelled"},Hh="grid-cols-[70px_1fr_100px_140px_100px_110px_32px]";function fz({issue:e,workspace:t,onNavigate:r}){var i,o;const n=ft(),a=((i=e._project)==null?void 0:i.identifier)??"";return s.jsxs("div",{onClick:()=>r(e),className:$(`group grid ${Hh} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors"),children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate pl-6",children:e.identifier}),s.jsx("span",{className:"text-sm text-foreground truncate pr-3",children:e.title}),s.jsx("span",{className:"text-[11px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded truncate w-fit",children:((o=e._project)==null?void 0:o.identifier)??"—"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e._status.color}}),s.jsx("span",{className:"text-xs text-primary truncate",children:e._status.name})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(LS,{priority:e.priority}),s.jsx("span",{className:"text-xs text-primary",children:un[e.priority]??e.priority})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ut,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx("span",{className:$("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?me(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),s.jsx("div",{className:"pr-6",onClick:l=>l.stopPropagation(),children:s.jsx("button",{onClick:()=>n(`/${t}/projects/${a}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(ux,{className:"h-3.5 w-3.5"})})})]})}function mz(){const e=ft(),{workspace:t}=It(),r=t??"",{workspace:n}=Te(),{data:a}=Wn(),[i,o]=h.useState(()=>localStorage.getItem("meridian_my_tasks_view")??"list"),[l,c]=h.useState(""),[d,u]=h.useState([]),[f,m]=h.useState("all"),[p,x]=h.useState("all"),[g,v]=h.useState("all");h.useEffect(()=>{n!=null&&n.id&&d.length===0&&u([n.id])},[n==null?void 0:n.id]);const y=h.useMemo(()=>(a??[]).map(S=>({value:S.id,label:S.name})),[a]),b=h.useMemo(()=>{const S={};return d.length>0&&(S.workspace_id=d),f!=="all"&&(S.priority=[f]),p!=="all"&&(S.type=[p]),g!=="all"&&(S.category=[g]),S},[d,f,p,g]),{data:N,isLoading:w}=iz(b),k=S=>{o(S),localStorage.setItem("meridian_my_tasks_view",S)},j=h.useMemo(()=>{if(!N)return[];if(!l)return N;const S=l.toLowerCase();return N.filter(_=>{var M,E;return _.title.toLowerCase().includes(S)||_.identifier.toLowerCase().includes(S)||(((M=_._project)==null?void 0:M.identifier)??"").toLowerCase().includes(S)||(((E=_._project)==null?void 0:E.name)??"").toLowerCase().includes(S)})},[N,l]),C=S=>{var M;const _=(M=S._project)==null?void 0:M.identifier;_&&e(`/${r}/projects/${_}/issues/${S.id}`)},P=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[s.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"My Tasks"}),s.jsxs("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-0.5",children:[s.jsxs("button",{onClick:()=>k("list"),className:$("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",i==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[s.jsx(mx,{className:"h-3.5 w-3.5"}),"List"]}),s.jsxs("button",{onClick:()=>k("board"),className:$("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",i==="board"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[s.jsx(sN,{className:"h-3.5 w-3.5"}),"Board"]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 border-b border-border md:flex-row md:items-center md:justify-between md:gap-3 shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2 md:overflow-x-auto md:scrollbar-none",children:[s.jsx(Is,{options:y,selected:d,onSelectionChange:u,placeholder:"All workspaces",className:"md:w-[160px]"}),s.jsxs(Be,{value:f,onValueChange:m,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Priority"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(un).map(([S,_])=>s.jsx(ke,{value:S,className:"text-xs",children:_},S))]})]}),s.jsxs(Be,{value:p,onValueChange:x,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Type"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All types"}),Object.entries(Bs).map(([S,_])=>s.jsx(ke,{value:S,className:"text-xs",children:_},S))]})]}),s.jsxs(Be,{value:g,onValueChange:v,children:[s.jsx(ze,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:s.jsx(Ve,{placeholder:"Category"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All categories"}),Object.entries(uz).map(([S,_])=>s.jsx(ke,{value:S,className:"text-xs",children:_},S))]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ra,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),s.jsx(_e,{placeholder:"Search tasks...",value:l,onChange:S=>c(S.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]})]});return i==="board"?s.jsx("div",{className:"flex flex-col h-full gap-0",children:s.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[P,s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:w?s.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4,5].map(S=>s.jsxs("div",{className:"min-w-[260px]",children:[s.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(le,{className:"h-[82px] w-full rounded-lg"}),s.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},S))}):s.jsx(dz,{issues:j,onIssueClick:C})})]})}):s.jsx("div",{className:"p-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[P,s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsxs("div",{className:"min-w-[800px]",children:[s.jsxs("div",{className:$("grid items-center py-2.5 border-b border-border",Hh),children:[s.jsx("span",{className:"text-xs font-medium text-[#6b7280] pl-6",children:"ID"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Title"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),s.jsx("span",{className:"pr-6"})]}),w?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(S=>s.jsxs("div",{className:$("grid items-center px-6 py-3 gap-4",Hh),children:[s.jsx(le,{className:"h-4 w-14"}),s.jsx(le,{className:"h-4 w-56"}),s.jsx(le,{className:"h-5 w-16"}),s.jsx(le,{className:"h-5 w-20"}),s.jsx(le,{className:"h-4 w-16"}),s.jsx(le,{className:"h-4 w-24"}),s.jsx("span",{})]},S))}):j.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx("p",{className:"text-sm font-medium mb-1",children:(N??[]).length===0?"No tasks assigned to you":"No tasks match your filters"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:(N??[]).length===0?"Issues assigned to you across all projects will appear here.":"Try adjusting your search or filters."})]}):s.jsx("div",{className:"divide-y divide-border/60",children:j.map(S=>s.jsx(fz,{issue:S,workspace:r,onNavigate:C},S.id))})]})}),s.jsx("div",{className:"md:hidden divide-y divide-border/60",children:w?[1,2,3,4].map(S=>s.jsx("div",{className:"flex items-start gap-3 px-4 py-3",children:s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"}),s.jsx("div",{className:"h-3 w-32 bg-muted rounded animate-pulse"})]})},S)):j.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center px-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No tasks found"})}):j.map(S=>s.jsx("div",{onClick:()=>C(S),className:"flex items-start gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",children:s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:S.identifier}),s.jsx("span",{className:"text-sm text-foreground truncate font-medium",children:S.title})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(LS,{priority:S.priority}),s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:S._status.color}}),S._status.name]}),S._project&&s.jsx("span",{className:"text-[10px] font-medium text-zinc-500 bg-zinc-100 dark:bg-zinc-800 px-1 py-0.5 rounded",children:S._project.identifier}),S.due_date&&s.jsx("span",{className:"text-[11px] text-muted-foreground",children:me(new Date(S.due_date),"MMM d")})]})]})},S.id))}),!w&&j.length>0&&s.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.length," task",j.length!==1?"s":""]})})]})})}const hz={issue:{icon:cs,label:"Issue"},project:{icon:Yr,label:"Project"},comment:{icon:iN,label:"Comment"},sprint:{icon:gs,label:"Sprint"},workspace_access_request:{icon:ln,label:"Access Request"},project_access_request:{icon:ln,label:"Access Request"},project_access_resolved:{icon:ln,label:"Access Request"}};function sb(e){const t=new Date(e);return lR(t)?tR(t,{addSuffix:!0}):cR(t)?`Yesterday ${me(t,"h:mm a")}`:me(t,"MMM d, yyyy")}function ab(e){return typeof e=="string"&&e.length>0?e:null}function pz(){const{workspace:e}=It(),t=ft(),{data:r,isLoading:n}=DT(),a=TT(),i=IT(),o=(r==null?void 0:r.filter(c=>!c.read).length)??0;function l(c){const d=c.metadata??{},u=ab(d.workspace_slug)??e??null,f=ab(d.project_identifier);return c.entity_type==="issue"&&u&&f?`/${u}/projects/${f}/issues/${c.entity_id}`:c.entity_type==="project"&&u&&f?`/${u}/projects/${f}/board`:c.entity_type==="workspace_access_request"&&u?`/${u}/settings?tab=access-requests`:(c.entity_type==="project_access_request"||c.entity_type==="project_access_resolved")&&u&&f?`/${u}/projects/${f}/access`:null}return s.jsx("div",{className:"p-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[s.jsx("h1",{className:"text-base font-semibold",children:"Notifications"}),o>0&&s.jsxs(re,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>i.mutate(void 0,{onSuccess:()=>B.success("All marked as read"),onError:()=>B.error("Failed")}),disabled:i.isPending,children:[s.jsx(uy,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),s.jsxs("div",{className:"hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-2.5 border-b border-border",children:[s.jsx("span",{}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Type"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Message"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Time"}),s.jsx("span",{})]}),n?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(c=>s.jsxs("div",{children:[s.jsxs("div",{className:"hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[s.jsx("div",{}),s.jsx(le,{className:"h-5 w-20 rounded-full"}),s.jsx(le,{className:"h-4 w-3/4"}),s.jsx(le,{className:"h-4 w-20"}),s.jsx("div",{})]}),s.jsxs("div",{className:"md:hidden flex items-start gap-3 px-4 py-3",children:[s.jsx(le,{className:"h-4 w-4 rounded-full mt-1 shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx(le,{className:"h-4 w-24 rounded-full"}),s.jsx(le,{className:"h-4 w-full"})]})]})]},c))}):r!=null&&r.length?s.jsx("div",{className:"divide-y divide-border",children:r.map(c=>{const d=hz[c.entity_type]??{icon:fi,label:c.entity_type},u=d.icon,f=l(c),m=()=>{f&&(c.read||a.mutate(c.id),t(f))};return s.jsxs("div",{children:[s.jsxs("div",{className:$("hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3 transition-colors",!c.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",f&&"cursor-pointer"),onClick:m,children:[s.jsx("div",{className:"flex items-center justify-center",children:!c.read&&s.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500 shrink-0"})}),s.jsx("div",{children:s.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:[s.jsx(u,{className:"h-3 w-3"}),d.label]})}),s.jsx("p",{className:$("text-sm truncate",c.read?"text-muted-foreground":"font-medium text-foreground"),children:c.message}),s.jsx("span",{className:"text-xs text-muted-foreground",children:sb(c.created_at)}),s.jsx("div",{className:"flex justify-end",onClick:p=>p.stopPropagation(),children:!c.read&&s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>a.mutate(c.id,{onError:()=>B.error("Failed")}),children:"Mark read"})})]}),s.jsxs("div",{className:$("md:hidden flex items-start gap-3 px-4 py-3 transition-colors",!c.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",f&&"cursor-pointer"),onClick:m,children:[s.jsx("div",{className:"mt-1 shrink-0",children:c.read?s.jsx("div",{className:"h-1.5 w-1.5"}):s.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500"})}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full shrink-0",children:[s.jsx(u,{className:"h-3 w-3"}),d.label]}),s.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:sb(c.created_at)})]}),s.jsx("p",{className:$("text-sm",c.read?"text-muted-foreground":"font-medium text-foreground"),children:c.message})]}),!c.read&&s.jsx("div",{onClick:p=>p.stopPropagation(),className:"shrink-0",children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a.mutate(c.id,{onError:()=>B.error("Failed")}),children:s.jsx(uy,{className:"h-3.5 w-3.5"})})})]})]},c.id)})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(fi,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No notifications"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"You're all caught up."})]}),!n&&!!(r!=null&&r.length)&&s.jsx("div",{className:"px-6 py-3 border-t border-border",children:s.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," notification",r.length!==1?"s":"",o>0?` · ${o} unread`:""]})})]})})}function xz({open:e,onClose:t,projectId:r}){const[n,a]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(),[d,u]=h.useState(),[f,m]=h.useState(!1),[p,x]=h.useState(!1),g=WR(r);function v(){a(""),o(""),c(void 0),u(void 0),t()}async function y(b){b.preventDefault(),n.trim()&&g.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?me(l,"yyyy-MM-dd"):null,end_date:d?me(d,"yyyy-MM-dd"):null},{onSuccess:()=>{B.success("Sprint created"),v()},onError:()=>B.error("Failed to create sprint")})}return s.jsx(Mi,{open:e,onOpenChange:b=>!b&&v(),children:s.jsxs(Oi,{className:"sm:max-w-md",children:[s.jsx(Ao,{children:s.jsx(To,{children:"New Sprint"})}),s.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[s.jsxs(Do,{className:"space-y-4 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{htmlFor:"sprint-name",children:["Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(_e,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:n,onChange:b=>a(b.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs(at,{htmlFor:"sprint-goal",children:["Goal ",s.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),s.jsx(Ox,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:i,onChange:b=>o(b.target.value),className:"resize-none text-sm",rows:2})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"Start Date"}),s.jsxs(Dt,{open:f,onOpenChange:m,children:[s.jsx(Tt,{asChild:!0,children:s.jsxs(re,{variant:"outline",className:$("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[s.jsx(Ut,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?me(l,"MMM d, yyyy"):"Pick date"]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:l,onSelect:b=>{c(b),m(!1)},disabled:b=>d?b>d:!1,initialFocus:!0})})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(at,{children:"End Date"}),s.jsxs(Dt,{open:p,onOpenChange:x,children:[s.jsx(Tt,{asChild:!0,children:s.jsxs(re,{variant:"outline",className:$("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[s.jsx(Ut,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?me(d,"MMM d, yyyy"):"Pick date"]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:d,onSelect:b=>{u(b),x(!1)},disabled:b=>l?b<l:!1,initialFocus:!0})})]})]})]})]}),s.jsxs(fc,{children:[s.jsx(re,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),s.jsx(re,{type:"submit",disabled:!n.trim()||g.isPending,children:g.isPending?"Creating…":"Create Sprint"})]})]})]})})}const gz={active:{label:"Active",icon:Ol,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:dn,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:kn,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function vz({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:a=[]}){const i=UR(e.id,t),o=HR(t),l=gz[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>B.success(`"${e.name}" started`),onError:()=>B.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>B.success(`"${e.name}" completed`),onError:g=>B.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:()=>B.success("Sprint deleted"),onError:()=>B.error("Failed to delete sprint")})}const m=!!e.start_date,p=!!e.end_date,x=s.jsx(s.Fragment,{children:m||p?s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(mi,{className:"h-3.5 w-3.5 shrink-0"}),m?me(new Date(e.start_date),"MMM d"):"—"," → ",p?me(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=Lh(new Date(e.start_date),new Date(e.end_date),n,a);return s.jsxs("span",{className:"ml-1 text-[11px] text-muted-foreground/70",children:["(",g,"d)"]})})()]}):s.jsx("span",{className:"italic text-muted-foreground/60",children:"No dates"})});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"hidden md:flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx("div",{className:$("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:s.jsx(c,{className:$("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")})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:e.name}),e.goal&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5 flex items-center gap-1",children:[s.jsx(fy,{className:"h-3 w-3 shrink-0"}),e.goal]})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0 w-64",children:[s.jsx(mi,{className:"h-3.5 w-3.5 shrink-0"}),m||p?s.jsxs("span",{children:[m?me(new Date(e.start_date),"MMM d"):"—"," → ",p?me(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=Lh(new Date(e.start_date),new Date(e.end_date),n,a);return s.jsxs("span",{className:"ml-1.5 text-[11px] text-muted-foreground/70",children:["(",g," biz day",g!==1?"s":"",")"]})})()]}):s.jsx("span",{className:"italic",children:"No dates set"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground shrink-0 w-20 text-right",children:[r," issue",r!==1?"s":""]}),s.jsx(Cn,{className:$("shrink-0 text-[11px] border-0 w-20 justify-center",l.badge),children:l.label}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="planned"&&s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[s.jsx(Ol,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[s.jsx(kn,{className:"h-3 w-3"}),"Complete"]}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:s.jsx(wr,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"md:hidden px-4 py-3 hover:bg-muted/30 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx("div",{className:$("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:s.jsx(c,{className:$("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")})}),s.jsx("p",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.name}),s.jsx(Cn,{className:$("shrink-0 text-[11px] border-0",l.badge),children:l.label})]}),e.goal&&s.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2 ml-10 flex items-center gap-1",children:[s.jsx(fy,{className:"h-3 w-3 shrink-0"}),e.goal]}),s.jsxs("div",{className:"flex items-center gap-2 ml-10",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-1 min-w-0 flex-wrap",children:[x,s.jsx("span",{children:"·"}),s.jsxs("span",{className:"shrink-0",children:[r," issue",r!==1?"s":""]})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.status==="planned"&&s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[s.jsx(Ol,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[s.jsx(kn,{className:"h-3 w-3"}),"Complete"]}),s.jsx(re,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:s.jsx(wr,{className:"h-3.5 w-3.5"})})]})]})]})]})}function yz(){const{projectKey:e}=It(),[t,r]=h.useState(!1),{data:n}=ea(e??""),a=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=$o(a||void 0),{data:l}=Hu(a||void 0),{data:c}=Bx(),{data:d=[]}=qx(new Date().getFullYear()),u=(l??[]).reduce((p,x)=>(x.sprint_id&&(p[x.sprint_id]=(p[x.sprint_id]??0)+1),p),{}),f={active:(i??[]).filter(p=>p.status==="active"),planned:(i??[]).filter(p=>p.status==="planned"),completed:(i??[]).filter(p=>p.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 s.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[s.jsx(Or,{zone:"project.sprints.before",props:{projectId:a}}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:s.jsxs(re,{size:"sm",onClick:()=>r(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"New Sprint"]})}),o?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(p=>s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[s.jsx(le,{className:"h-7 w-7 rounded-full"}),s.jsx(le,{className:"h-4 w-40"}),s.jsx("div",{className:"flex-1"}),s.jsx(le,{className:"h-4 w-32"}),s.jsx(le,{className:"h-5 w-20"})]},p))}):(i??[]).length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(mi,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No sprints yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a sprint to start planning your work in time-boxed iterations."}),s.jsxs(re,{size:"sm",onClick:()=>r(!0),children:[s.jsx(ot,{className:"h-4 w-4"}),"New Sprint"]})]}):s.jsx("div",{children:m.map(({key:p,label:x,items:g})=>g.length===0?null:s.jsxs("div",{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:x})}),s.jsx("div",{className:"divide-y divide-border",children:g.map(v=>s.jsx(vz,{sprint:v,projectId:a,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},p))})]}),s.jsx(Or,{zone:"project.sprints.after",props:{projectId:a}}),s.jsx(xz,{open:t,onClose:()=>r(!1),projectId:a})]})}const uo={all:["roles"],list:()=>[...uo.all,"list"],detail:e=>[...uo.all,e]};function vf(){return De({queryKey:uo.list(),queryFn:()=>oe.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function bz(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:uo.list()})}})}function wz(e){const t=ye();return xe({mutationFn:r=>oe.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:uo.list()})}})}function jz(){const e=ye();return xe({mutationFn:t=>oe.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:uo.list()})}})}function zS(){const e=ye();return xe({mutationFn:({userId:t,appRoleId:r})=>oe.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["users"]})}})}const Bd=[{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 qd({value:e,className:t}){const[r,n]=h.useState(!1),a=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)};return s.jsx("button",{onClick:a,className:$("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?s.jsx(At,{className:"h-3.5 w-3.5 text-emerald-500"}):s.jsx(cx,{className:"h-3.5 w-3.5"})})}function ib({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:s.jsxs(Be,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[s.jsx(ze,{className:"h-9",children:s.jsx(Ve,{placeholder:"No custom role"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",children:s.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>s.jsx(ke,{value:n.id,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:n.name}),n.description&&s.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]})},n.id))]})]})}function Nz({open:e,onClose:t,workspaceId:r}){const[n,a]=h.useState("existing"),[i,o]=h.useState(""),[l,c]=h.useState([]),[d,u]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState(null),y=Px(i,300),{data:b,isFetching:N}=Sk({q:y}),w=(b==null?void 0:b.users)??[],{data:k=[]}=Po(r),j=MD(r),C=CD(r),{data:P}=vf(),S=h.useMemo(()=>new Set(k.map(A=>A.user_id)),[k]),_=h.useMemo(()=>w.filter(A=>!S.has(A.id)),[w,S]);h.useEffect(()=>{e&&(o(""),c([]),u(""),m(""),x(""),v(null),a("existing"))},[e]);const M=()=>{l.length!==0&&j.mutate({user_ids:l,role:"member",app_role_id:d||null},{onSuccess:A=>{B.success(`${A.added} member${A.added===1?"":"s"} added`),t()},onError:A=>B.error(A.message||"Failed to add members")})},E=A=>{A.preventDefault(),C.mutate({email:f.trim()||void 0,role:"member",app_role_id:p||null},{onSuccess:D=>{v(D.invitation),B.success("Invitation created")},onError:D=>B.error(D.message||"Failed to create invitation")})};return s.jsx(hn,{open:e,onOpenChange:A=>!A&&t(),children:s.jsxs(Qr,{className:"sm:max-w-[520px] bg-white dark:bg-card",children:[s.jsx(pn,{children:s.jsx(xn,{children:"Add member"})}),!g&&s.jsxs("div",{className:"flex rounded-lg border border-border p-0.5 bg-muted/40 gap-0.5",children:[s.jsx("button",{type:"button",onClick:()=>a("existing"),className:$("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"}),s.jsx("button",{type:"button",onClick:()=>a("invite"),className:$("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"&&!g&&s.jsxs("div",{className:"space-y-3 pt-1",children:[s.jsx(_e,{placeholder:"Search by name or email…",value:i,onChange:A=>o(A.target.value),className:"h-9",autoFocus:!0}),s.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:N&&i!==y?s.jsx("div",{className:"py-6 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching…"})}):_.length===0&&i.trim()?s.jsx("div",{className:"py-6 text-center",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',i,'"']})}):_.length===0?s.jsxs("div",{className:"py-8 text-center px-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"All users are already members."}),s.jsx("button",{className:"mt-2 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",onClick:()=>a("invite"),children:"Send an invite instead"})]}):s.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:_.map(A=>{const D=A.first_name??"",Z=A.last_name??"",Q=`${D} ${Z}`.trim()||A.email,q=(D[0]??Z[0]??A.email[0]??"U").toUpperCase(),te=l.includes(A.id);return s.jsxs("button",{type:"button",onClick:()=>c(ne=>te?ne.filter(I=>I!==A.id):[...ne,A.id]),className:$("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",te?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[s.jsx(_t,{className:"h-7 w-7 shrink-0",children:s.jsx(Pt,{className:"text-[11px] font-medium",children:q})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.email})]}),te&&s.jsx(At,{className:"h-4 w-4 text-indigo shrink-0"})]},A.id)})})}),_.length>0&&s.jsxs(s.Fragment,{children:[P&&P.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",s.jsx("span",{className:"font-normal",children:"(optional)"})]}),s.jsx(ib,{value:d,onChange:u,appRoles:P})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),s.jsx(re,{type:"button",size:"sm",disabled:l.length===0||j.isPending,onClick:M,children:j.isPending?"Adding…":l.length<=1?"Add to workspace":`Add ${l.length} members`})]})]})]}),n==="invite"&&!g&&s.jsxs("form",{onSubmit:E,className:"space-y-4 pt-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",s.jsx("span",{className:"font-normal",children:"(optional)"})]}),s.jsx(_e,{type:"email",placeholder:"colleague@example.com",value:f,onChange:A=>m(A.target.value),className:"h-9",autoFocus:!0}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),P&&P.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",s.jsx("span",{className:"font-normal",children:"(optional)"})]}),s.jsx(ib,{value:p,onChange:x,appRoles:P})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),s.jsx(re,{type:"submit",size:"sm",disabled:C.isPending,children:C.isPending?"Creating…":"Create invitation"})]})]}),g&&s.jsxs("div",{className:"space-y-4 pt-1",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",g.email?s.jsx("span",{className:"font-medium text-foreground",children:g.email}):"anyone you want to invite","."]}),s.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[s.jsx(Oa,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),s.jsx("span",{className:"text-xs font-mono text-foreground flex-1 min-w-0 break-all",children:`${window.location.origin}/invite/${g.token}`}),s.jsx(qd,{value:`${window.location.origin}/invite/${g.token}`,className:"shrink-0"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>v(null),children:"Create another"}),s.jsx(re,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function kz({invitation:e,workspaceId:t}){const r=_D(t),n=PD(t),[a,i]=h.useState(!1),o=`${window.location.origin}/invite/${e.token}`;return s.jsxs("div",{className:"px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[s.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[s.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(Oa,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),s.jsx("span",{className:$("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"})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[280px]",children:o}),s.jsx(qd,{value:o})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:me(new Date(e.created_at),"MMM d")}),e.email&&s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>i(!0),disabled:n.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:s.jsx(Ad,{className:$("h-3.5 w-3.5",n.isPending&&"animate-spin")})})}),s.jsx(Bn,{children:"Resend invite"})]}),s.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>B.success("Invitation revoked"),onError:()=>B.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:s.jsx(We,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"md:hidden space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(Oa,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),s.jsx("span",{className:$("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",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"})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.email&&s.jsx("button",{onClick:()=>i(!0),disabled:n.isPending,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:s.jsx(Ad,{className:$("h-3.5 w-3.5",n.isPending&&"animate-spin")})}),s.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>B.success("Invitation revoked"),onError:()=>B.error("Failed to revoke")}),disabled:r.isPending,className:"text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pl-10",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate flex-1 min-w-0",children:o}),s.jsx(qd,{value:o}),s.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:me(new Date(e.created_at),"MMM d")})]})]}),s.jsx(co,{open:a,onClose:()=>i(!1),onConfirm:()=>n.mutate(e.id,{onSuccess:()=>{B.success("Invitation resent"),i(!1)},onError:()=>B.error("Failed to resend invitation")}),title:"Resend invitation?",description:`A new invitation email will be sent to ${e.email}.`,confirmLabel:"Resend",loading:n.isPending})]})}function Sz({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=Te(),{data:n,isLoading:a}=Wn(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=jD(e),l=ND(e),c=kD(e),d=h.useRef(null),[u,f]=h.useState("");h.useEffect(()=>{i&&f(i.name)},[i==null?void 0:i.name]);const m=i?u.trim()!==i.name:!1,p=()=>{!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}),B.success("Workspace updated")},onError:()=>B.error("Failed to update workspace")})},x=y=>{var N;const b=(N=y.target.files)==null?void 0:N[0];b&&(l.mutate(b,{onSuccess:w=>{r({id:w.workspace.id,name:w.workspace.name,slug:w.workspace.slug,logo_url:w.workspace.logo_url}),B.success("Logo updated")},onError:()=>B.error("Failed to upload logo")}),d.current&&(d.current.value=""))},g=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),B.success("Logo removed")},onError:()=>B.error("Failed to remove logo")})};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Workspace details"})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Logo"}),a?s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("div",{className:"size-12 rounded-lg bg-muted animate-pulse"})}):s.jsxs("div",{className:"flex items-center gap-3",children:[i!=null&&i.logo_url?s.jsx("img",{src:i.logo_url,alt:"Workspace logo",className:"size-12 rounded-lg object-cover shrink-0 border border-border"}):s.jsx("div",{className:"flex size-12 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:s.jsx("span",{className:"text-lg font-bold",children:(((v=i==null?void 0:i.name)==null?void 0:v[0])??"M").toUpperCase()})}),s.jsx("input",{ref:d,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:x}),s.jsx(re,{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)&&s.jsx(re,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:g,disabled:c.isPending,children:c.isPending?"Removing…":"Remove"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),a?s.jsx(le,{className:"h-8 w-64"}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(_e,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&s.jsx(re,{size:"sm",className:"h-8",onClick:p,disabled:!u.trim()||o.isPending,children:o.isPending?"Saving…":"Save"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"URL slug"}),a?s.jsx(le,{className:"h-4 w-40"}):s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("span",{className:"font-mono text-foreground",children:i==null?void 0:i.slug}),s.jsx(qd,{value:(i==null?void 0:i.slug)??""})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),a?s.jsx(le,{className:"h-4 w-16"}):s.jsx("span",{className:"text-sm capitalize",children:(i==null?void 0:i.plan)??"free"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Visibility"}),a?s.jsx(le,{className:"h-4 w-28"}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:(i==null?void 0:i.is_private)??!1,onChange:y=>{o.mutate({is_private:y.target.checked},{onSuccess:()=>B.success(y.target.checked?"Workspace is now public":"Workspace is now private"),onError:()=>B.error("Failed to update visibility")})},className:"size-4 rounded border-border accent-indigo-600"}),s.jsx(fs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-sm",children:"Private"})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:i!=null&&i.is_private?"Only members can see this workspace":"Admins can see this workspace without being a member"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),a?s.jsx(le,{className:"h-4 w-28"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?me(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}const Ha=20;function Cz({workspaceId:e,onInvite:t}){var g;const{data:r,isLoading:n}=Po(e),{data:a,isLoading:i}=SD(e),o=OD(e),l=zS(),{data:c}=vf(),{user:d}=Te(),[u,f]=h.useState(null),[m,p]=h.useState(0),x=(a==null?void 0:a.filter(v=>v.status==="pending"))??[];return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Members",!n&&r&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:r.length})]})}),n?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(v=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[s.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-3.5 w-32"}),s.jsx(le,{className:"h-3 w-48"})]})]},v))}):r!=null&&r.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-border",children:(r??[]).slice(m*Ha,(m+1)*Ha).map(v=>{var C;const y=v.user,b=(y==null?void 0:y.first_name)??"",N=(y==null?void 0:y.last_name)??"",w=`${b} ${N}`.trim()||(y==null?void 0:y.email)||"Unknown",k=(b[0]??N[0]??((C=y==null?void 0:y.email)==null?void 0:C[0])??"U").toUpperCase(),j=(y==null?void 0:y.id)===(d==null?void 0:d.id);return s.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:[s.jsx(_t,{className:"h-7 w-7 shrink-0",children:s.jsx(Pt,{className:"text-[11px] font-medium",children:k})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w}),j&&s.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(y==null?void 0:y.email)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.email})]}),c&&c.length>0&&s.jsxs(Be,{value:v.app_role_id??"none",onValueChange:P=>l.mutate({userId:v.user_id,appRoleId:P==="none"?null:P},{onSuccess:()=>B.success("Custom role updated"),onError:()=>B.error("Failed to update custom role")}),children:[s.jsx(ze,{className:"h-7 text-[11px] w-32 shrink-0",children:s.jsx(Ve,{placeholder:"Custom role"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",children:s.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),c.map(P=>s.jsx(ke,{value:P.id,children:P.name},P.id))]})]}),!j&&s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:s.jsx(zs,{className:"h-4 w-4"})})}),s.jsxs(Ar,{align:"end",className:"w-44",children:[s.jsx(Ye,{onClick:()=>{fetch(`/admin/users/${v.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>B.success("Sessions revoked — user will be signed out")).catch(()=>B.error("Failed to revoke sessions"))},children:"Revoke sessions"}),s.jsx(Sn,{}),s.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:()=>f(v),children:[s.jsx(wr,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},v.id)})}),((r==null?void 0:r.length)??0)>Ha&&s.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[m*Ha+1,"–",Math.min((m+1)*Ha,r.length)," of ",r.length]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v-1),disabled:m===0,children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[m+1," / ",Math.ceil(r.length/Ha)]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v+1),disabled:(m+1)*Ha>=r.length,children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(Ps,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No members yet"}),s.jsx("button",{onClick:t,className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}),s.jsxs("div",{className:"px-6 py-2 border-t border-b border-border bg-muted/20 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Pending invitations",!i&&x.length>0&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:x.length})]}),s.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(ot,{className:"h-3 w-3"}),"Invite"]})]}),i?s.jsx("div",{className:"divide-y divide-border",children:[1,2].map(v=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[s.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-3.5 w-48"}),s.jsx(le,{className:"h-3 w-64"})]})]},v))}):x.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending invitations."}),s.jsx("button",{onClick:t,className:"mt-2 text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}):s.jsx("div",{className:"divide-y divide-border",children:x.map(v=>s.jsx(kz,{invitation:v,workspaceId:e},v.id))}),s.jsx(co,{open:!!u,onClose:()=>f(null),onConfirm:()=>{u&&o.mutate(u.user_id,{onSuccess:()=>{B.success("Member removed"),f(null)},onError:()=>{B.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((g=u==null?void 0:u.user)==null?void 0:g.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending})]})}function _z({workspaceId:e,teamId:t,allMembers:r}){var y,b;const{data:n,isLoading:a}=DD(e,t),i=TD(e,t),o=ID(e,t),[l,c]=h.useState(""),[d,u]=h.useState(null),[f,m]=h.useState(null),p=new Set((n==null?void 0:n.map(N=>N.user_id))??[]),x=r.filter(N=>!p.has(N.user_id)),g=n==null?void 0:n.find(N=>N.user_id===d),v=r.find(N=>N.user_id===f);return s.jsxs("div",{className:"bg-muted/10 border-t border-border",children:[a?s.jsx("div",{className:"px-8 py-3",children:s.jsx(le,{className:"h-3 w-40"})}):(n==null?void 0:n.length)===0?s.jsx("p",{className:"px-8 py-3 text-xs text-muted-foreground",children:"No members in this team yet."}):s.jsx("div",{className:"divide-y divide-border/50",children:n==null?void 0:n.map(N=>{var S;const w=N.user,k=(w==null?void 0:w.first_name)??"",j=(w==null?void 0:w.last_name)??"",C=`${k} ${j}`.trim()||(w==null?void 0:w.email)||"Unknown",P=(k[0]??j[0]??((S=w==null?void 0:w.email)==null?void 0:S[0])??"U").toUpperCase();return s.jsxs("div",{className:"flex items-center gap-3 px-8 py-2.5 group hover:bg-muted/20 transition-colors",children:[s.jsx(_t,{className:"h-6 w-6 shrink-0",children:s.jsx(Pt,{className:"text-[10px] font-medium",children:P})}),s.jsx("span",{className:"flex-1 text-sm truncate",children:C}),s.jsx("button",{onClick:()=>u(N.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]},N.id)})}),x.length>0&&s.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[s.jsx(ln,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsxs(Be,{value:l,onValueChange:c,children:[s.jsx(ze,{className:"h-7 text-xs flex-1 max-w-[200px]",children:s.jsx(Ve,{placeholder:"Add member…"})}),s.jsx(Fe,{children:x.map(N=>{const w=N.user,k=(w==null?void 0:w.first_name)??"",j=(w==null?void 0:w.last_name)??"",C=`${k} ${j}`.trim()||(w==null?void 0:w.email)||"Unknown";return s.jsx(ke,{value:N.user_id,children:C},N.user_id)})})]}),l&&s.jsx(re,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),s.jsx(co,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{B.success("Removed from team"),u(null)},onError:()=>{B.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=g==null?void 0:g.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),s.jsx(co,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{B.success("Added to team"),m(null),c("")},onError:()=>{B.error("Failed to add"),m(null)}})},title:"Add to team",description:`Add ${((b=v==null?void 0:v.user)==null?void 0:b.email)??"this member"} to the team?`,confirmLabel:"Add",loading:i.isPending})]})}function Pz({workspaceId:e}){const{data:t,isLoading:r}=Vu(e),{data:n}=Po(e),a=ED(e),i=AD(e),[o,l]=h.useState(new Set),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,p]=h.useState(null),x=t==null?void 0:t.find(y=>y.id===m),g=y=>{l(b=>{const N=new Set(b);return N.has(y)?N.delete(y):N.add(y),N})},v=y=>{y.preventDefault(),u.trim()&&a.mutate({name:u.trim()},{onSuccess:()=>{B.success("Team created"),f(""),d(!1)},onError:()=>B.error("Failed to create team")})};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Teams",!r&&t&&s.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",t.length]})]}),s.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(ot,{className:"h-3 w-3"}),"New team"]})]}),c&&s.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:s.jsxs("form",{onSubmit:v,className:"flex items-center gap-2",children:[s.jsx(_e,{autoFocus:!0,placeholder:"Team name",value:u,onChange:y=>f(y.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),s.jsx(re,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||a.isPending,children:a.isPending?"Creating…":"Create"}),s.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{d(!1),f("")},children:"Cancel"})]})}),r?s.jsx("div",{className:"divide-y divide-border",children:[1,2].map(y=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[s.jsx(le,{className:"h-7 w-7 rounded-lg shrink-0"}),s.jsx(le,{className:"h-3.5 w-32"})]},y))}):t!=null&&t.length?s.jsx("div",{className:"divide-y divide-border",children:t.map(y=>{const b=o.has(y.id);return s.jsxs("div",{children:[s.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:[s.jsx("button",{onClick:()=>g(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:b?s.jsx(Zs,{className:"h-4 w-4"}):s.jsx(pr,{className:"h-4 w-4"})}),s.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ea,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.name}),y.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.description})]}),s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[y.member_count," ",y.member_count===1?"member":"members"]}),s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:s.jsx(zs,{className:"h-4 w-4"})})}),s.jsx(Ar,{align:"end",className:"w-36",children:s.jsxs(Ye,{className:"text-destructive focus:text-destructive",onClick:()=>p(y.id),children:[s.jsx(wr,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),b&&s.jsx(_z,{workspaceId:e,teamId:y.id,allMembers:n??[]})]},y.id)})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(Ea,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No teams yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Teams make it easy to grant project access to groups of people."}),s.jsx(re,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),s.jsx(co,{open:!!m,onClose:()=>p(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{B.success("Team deleted"),p(null)},onError:()=>{B.error("Failed to delete team"),p(null)}})},title:"Delete team",description:`Delete "${(x==null?void 0:x.name)??"this team"}"? All members will be removed from the team. Projects will not be affected.`,confirmLabel:"Delete team",variant:"destructive",loading:i.isPending})]})}function Mz({workspaceId:e}){const{data:t=[],isLoading:r}=bx(e),n=RD(e),a=(i,o)=>{n.mutate({requestId:i,action:o},{onSuccess:()=>B.success(o==="approve"?"Access approved":"Request denied"),onError:l=>B.error(l.message??"Failed to update request")})};return r?s.jsx("div",{className:"p-6 space-y-3",children:[1,2].map(i=>s.jsx(le,{className:"h-12 w-full"},i))}):t.length===0?s.jsx("div",{className:"p-10 text-center text-sm text-muted-foreground",children:"No pending access requests."}):s.jsx("div",{className:"divide-y divide-border",children:t.map(i=>{var l;const o=i.user?[i.user.first_name,i.user.last_name].filter(Boolean).join(" ")||i.user.email:i.user_id;return s.jsxs("div",{className:"flex items-center justify-between gap-4 px-6 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:o}),((l=i.user)==null?void 0:l.email)&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user.email}),i.message&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 italic truncate",children:['"',i.message,'"']})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(re,{size:"sm",variant:"outline",className:"h-7 text-xs",disabled:n.isPending,onClick:()=>a(i.id,"deny"),children:"Deny"}),s.jsx(re,{size:"sm",className:"h-7 text-xs",disabled:n.isPending,onClick:()=>a(i.id,"approve"),children:"Approve"})]})]},i.id)})})}const Oz=["general","members","teams","access-requests"];function Ez(){const{workspace:e,user:t}=Te(),r=(e==null?void 0:e.id)??"",[n,a]=Zl(),i=n.get("tab"),[o,l]=h.useState(Oz.includes(i)?i:"general"),c=(t==null?void 0:t.roles)??[],d=c.includes("super-admin")||c.includes("admin"),{data:u=[]}=Po(r),f=u.find(w=>w.user_id===(t==null?void 0:t.id)),m=d||(f==null?void 0:f.role)==="admin",p=w=>{l(w),a({tab:w},{replace:!0})},[x,g]=h.useState(!1),v=m?["general","members","teams","access-requests"]:["general","members","teams"],{data:y=[]}=bx(r),b=m?y.length:0,N={general:"General",members:"Members",teams:"Teams","access-requests":s.jsxs("span",{className:"flex items-center gap-1.5",children:["Access Requests",b>0&&s.jsx("span",{className:"flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:b>9?"9+":b})]})};return s.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[s.jsx(Or,{zone:"workspace.settings.before",props:{workspaceId:r}}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2",children:[s.jsx("div",{className:"flex overflow-x-auto scrollbar-none",children:v.map(w=>s.jsx("button",{onClick:()=>p(w),className:$("h-12 px-4 text-sm font-medium border-b-2 transition-colors whitespace-nowrap shrink-0",o===w?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:N[w]},w))}),o==="members"&&s.jsxs(re,{size:"sm",onClick:()=>g(!0),className:"shrink-0 ml-2",children:[s.jsx(ot,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Add member"})]})]}),o==="general"&&s.jsx(Sz,{workspaceId:r}),o==="members"&&s.jsx(Cz,{workspaceId:r,onInvite:()=>g(!0)}),o==="teams"&&s.jsx(Pz,{workspaceId:r}),o==="access-requests"&&m&&s.jsx(Mz,{workspaceId:r})]}),s.jsx(Or,{zone:"workspace.settings.after",props:{workspaceId:r}}),s.jsx(Nz,{open:x,onClose:()=>g(!1),workspaceId:r})]})}function Az({open:e,onClose:t}){const[r,n]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(new Set),c=bz();h.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=Bd.flatMap(g=>g.permissions.map(v=>v.key)),u=d.every(g=>o.has(g)),f=!u&&d.some(g=>o.has(g)),m=()=>{l(u?new Set:new Set(d))},p=g=>{l(v=>{const y=new Set(v);return y.has(g)?y.delete(g):y.add(g),y})},x=g=>{g.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:a.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{B.success("Role created"),t()},onError:v=>B.error(v.message||"Failed to create role")})};return s.jsx(hn,{open:e,onOpenChange:g=>!g&&t(),children:s.jsxs(Qr,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[s.jsxs(pn,{children:[s.jsx(xn,{children:"Create role"}),s.jsx(Eo,{children:"Define a new custom role with a specific permission set."})]}),s.jsxs("form",{onSubmit:x,className:"space-y-5 pt-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),s.jsx(_e,{value:r,onChange:g=>n(g.target.value),placeholder:"e.g. Developer, PM, Viewer",className:"h-9",autoFocus:!0,required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Description ",s.jsx("span",{className:"font-normal",children:"(optional)"})]}),s.jsx(_e,{value:a,onChange:g=>i(g.target.value),placeholder:"What is this role for?",className:"h-9"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),s.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"})]}),Bd.map(g=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:g.group}),s.jsx("div",{className:"space-y-1.5",children:g.permissions.map(v=>s.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[s.jsx("input",{type:"checkbox",checked:o.has(v.key),onChange:()=>p(v.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),s.jsx("span",{className:"text-sm group-hover:text-foreground text-muted-foreground transition-colors",children:v.label})]},v.key))})]},g.group))]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),s.jsx(re,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function Dz({role:e,onDeleted:t}){const[r,n]=h.useState(e.name),[a,i]=h.useState(e.description??""),[o,l]=h.useState(new Set(e.permissions)),[c,d]=h.useState(!1),u=wz(e.id),f=jz();h.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||a!==(e.description??"")||o.size!==e.permissions.length||Array.from(o).some(w=>!e.permissions.includes(w)),p=Bd.flatMap(w=>w.permissions.map(k=>k.key)),x=p.every(w=>o.has(w)),g=!x&&p.some(w=>o.has(w)),v=()=>{l(x?new Set:new Set(p))},y=w=>{l(k=>{const j=new Set(k);return j.has(w)?j.delete(w):j.add(w),j})},b=()=>{u.mutate({name:r.trim(),description:a.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>B.success("Role saved"),onError:w=>B.error(w.message||"Failed to save role")})},N=()=>{f.mutate(e.id,{onSuccess:()=>{B.success("Role deleted"),t(),d(!1)},onError:w=>B.error(w.message||"Failed to delete role")})};return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-sm font-semibold",children:e.name}),e.is_system&&s.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[s.jsx(fs,{className:"h-3 w-3"}),"System"]})]}),!e.is_system&&s.jsx("button",{onClick:()=>d(!0),className:"text-muted-foreground hover:text-destructive transition-colors",title:"Delete role",children:s.jsx(wr,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-5",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),s.jsx(_e,{value:r,onChange:w=>n(w.target.value),className:"h-8 text-sm"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),s.jsx(_e,{value:a,onChange:w=>i(w.target.value),placeholder:"What is this role for?",className:"h-8 text-sm"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),s.jsx("button",{type:"button",onClick:v,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:x?"Deselect all":"Select all"})]}),Bd.map(w=>s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:w.group}),s.jsx("div",{className:"space-y-2",children:w.permissions.map(k=>s.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[s.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"}),s.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:k.label})]},k.key))})]},w.group))]}),s.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:s.jsx(re,{size:"sm",onClick:b,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),s.jsx(oi,{open:c,onOpenChange:d,children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsxs(ka,{children:['Delete "',e.name,'"?']}),s.jsx(Sa,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),s.jsxs(Na,{children:[s.jsx(_a,{children:"Cancel"}),s.jsx(Ca,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function Tz(){const{data:e,isLoading:t}=vf(),[r,n]=h.useState(null),[a,i]=h.useState(!1),o=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];h.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 s.jsx("div",{className:"p-2 pb-24 md:pb-2 h-full",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Eh,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-semibold",children:"Roles & Permissions"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Define what users with each custom role can do across the application."})]})]}),s.jsxs(re,{size:"sm",onClick:()=>i(!0),children:[s.jsx(ot,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),s.jsxs("div",{className:"flex flex-col md:flex-row flex-1 min-h-0",children:[s.jsx("div",{className:"w-full md:w-56 shrink-0 md:border-r border-b md:border-b-0 border-border flex flex-col overflow-y-auto md:overflow-y-auto max-h-48 md:max-h-none",children:t?s.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>s.jsx(le,{className:"h-8 w-full"},d))}):s.jsxs(s.Fragment,{children:[o.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"px-3 pt-3 pb-1",children:s.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"System Roles"})}),o.map(d=>s.jsxs("button",{onClick:()=>n(d.id),className:$("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:[s.jsx(fs,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),l.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"px-3 pt-3 pb-1",children:s.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom Roles"})}),l.map(d=>s.jsxs("button",{onClick:()=>n(d.id),className:$("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:[s.jsx("div",{className:"h-3 w-3 shrink-0"}),s.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),!t&&(!e||e.length===0)&&s.jsx("div",{className:"flex flex-col items-center justify-center py-10 px-3 text-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"No roles yet."})})]})}),s.jsx("div",{className:"flex-1 min-w-0",children:c?s.jsx(Dz,{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):s.jsx("div",{className:"flex items-center justify-center h-full text-center p-8",children:s.jsxs("div",{children:[s.jsx(Eh,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"Select a role to edit"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or"," ",s.jsx("button",{onClick:()=>i(!0),className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"create a new role"})]})]})})})]}),s.jsx(Az,{open:a,onClose:()=>i(!1)})]})})}function Iz(e){return De({queryKey:["invite",e],queryFn:()=>oe.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function Rz(){const{token:e}=It(),{isAuthenticated:t}=Te(),r=ft(),{data:n,isLoading:a,error:i}=Iz(e??""),{data:o}=Xu(),l=UD(e??""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(!1);if(t&&n)return r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0}),null;const b=(n==null?void 0:n.invitation.email)??null,N=w=>{w.preventDefault();const k=b??m.trim();if(!k){B.error("Email is required");return}l.mutate({email:k,password:x,first_name:c,last_name:u},{onSuccess:()=>{r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0})},onError:j=>B.error(j.message??"Registration failed")})};return s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[380px]",children:[s.jsx("div",{className:"flex justify-center mb-8",children:s.jsx(dc,{})}),a?s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-48 mx-auto"}),s.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-32 mx-auto"})]}):i?s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-3",children:[s.jsx("p",{className:"text-sm font-medium",children:"Invalid or expired invitation"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is no longer valid. Ask for a new one."}),s.jsx(hr,{to:"/login",children:s.jsx(re,{variant:"outline",size:"sm",className:"mt-2",children:"Go to login"})})]}):n?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"px-5 py-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(Od,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"You've been invited to"})]}),s.jsx("p",{className:"text-base font-semibold",children:n.workspace?n.workspace.name:"Meridian"})]}),s.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[n.invitation.role==="admin"?s.jsx(cD,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):s.jsx(vD,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Joining as"," ",s.jsx("span",{className:"font-medium text-foreground capitalize",children:n.invitation.role}),n.invitation.role==="admin"?" — full access":" — can view and edit"]})]})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-5",children:[s.jsx("p",{className:"text-sm font-medium mb-4",children:"Create your account"}),s.jsxs("form",{onSubmit:N,className:"space-y-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(_e,{placeholder:"First name",value:c,onChange:w=>d(w.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),s.jsx(_e,{placeholder:"Last name",value:u,onChange:w=>f(w.target.value),required:!0,className:"h-9 bg-transparent"})]}),b?s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:"email",value:b,readOnly:!0,className:"h-9 bg-muted/50 text-muted-foreground cursor-not-allowed"}),s.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"})]}):s.jsx(_e,{type:"email",placeholder:"Email",value:m,onChange:w=>p(w.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:x,onChange:w=>g(w.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),s.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?s.jsx(rc,{className:"h-4 w-4"}):s.jsx(Pi,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"pt-1",children:s.jsx(re,{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)&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-px flex-1 bg-border"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),s.jsx("div",{className:"h-px flex-1 bg-border"})]}),s.jsx(Cx,{flow:"invite",inviteToken:e,label:"Accept with Google"})]}),s.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",s.jsx(hr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}const FS={all:["reporting"],timeLogs:e=>[...FS.all,"time-logs",e]};function BS(e,t){return De({queryKey:FS.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,a])=>{a&&((n==="workspace_ids"||n==="user_ids"||n==="project_ids")&&Array.isArray(a)?a.length>0&&r.set(n,a.join(",")):typeof a=="boolean"?a&&r.set(n,"true"):typeof a=="string"?r.set(n,a):typeof a=="number"&&r.set(n,String(a)))}),oe.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)!==!1})}function $z(e,t,r){const n=(r==null?void 0:r.orgScope)??!1;return De({queryKey:["reporting","members",e.join(","),t.join(","),n],queryFn:()=>{const a=new URLSearchParams;return e.length&&a.set("workspace_ids",e.join(",")),t.length&&a.set("project_ids",t.join(",")),n&&a.set("org_scope","true"),oe.get(`/admin/reporting/members?${a}`)},select:a=>a.members})}function Wd({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return s.jsxs(Dt,{children:[s.jsx(Tt,{asChild:!0,children:s.jsxs(re,{variant:"outline",className:$("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[s.jsx(Ut,{className:"h-3.5 w-3.5 shrink-0"}),e?me(e,"MMM d, yyyy"):s.jsx("span",{children:r}),e&&s.jsx("span",{role:"button",className:"ml-auto hover:text-foreground",onClick:a=>{a.stopPropagation(),t(void 0)},children:s.jsx(We,{className:"h-3 w-3"})})]})}),s.jsx(Ct,{className:"w-auto p-0",align:"start",children:s.jsx(br,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}var Lz=["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 Jx(e){if(typeof e!="string")return!1;var t=Lz;return t.includes(e)}var zz=["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"],Fz=new Set(zz);function qS(e){return typeof e!="string"?!1:Fz.has(e)}function WS(e){return typeof e=="string"&&e.startsWith("data-")}function qs(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(qS(r)||WS(r))&&(t[r]=e[r]);return t}function eg(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return qs(t)}return typeof e=="object"&&!Array.isArray(e)?qs(e):null}function Xr(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(qS(r)||WS(r)||Jx(r))&&(t[r]=e[r]);return t}function Bre(e){return e==null?null:h.isValidElement(e)?Xr(e.props):typeof e=="object"&&!Array.isArray(e)?Xr(e):null}var Bz=["children","width","height","viewBox","className","style","title","desc"];function Kh(){return Kh=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},Kh.apply(null,arguments)}function qz(e,t){if(e==null)return{};var r,n,a=Wz(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)&&(a[r]=e[r])}return a}function Wz(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 US=h.forwardRef((e,t)=>{var{children:r,width:n,height:a,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=qz(e,Bz),f=i||{width:n,height:a,x:0,y:0},m=lt("recharts-surface",o);return h.createElement("svg",Kh({},Xr(u),{className:m,width:n,height:a,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,d),r)}),Uz=["children","className"];function Yh(){return Yh=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},Yh.apply(null,arguments)}function Hz(e,t){if(e==null)return{};var r,n,a=Kz(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)&&(a[r]=e[r])}return a}function Kz(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 Ws=h.forwardRef((e,t)=>{var{children:r,className:n}=e,a=Hz(e,Uz),i=lt("recharts-layer",n);return h.createElement("g",Yh({className:i},Xr(a),{ref:t}),r)}),Yz=h.createContext(null);function ut(e){return function(){return e}}const HS=Math.cos,Ud=Math.sin,Yn=Math.sqrt,Hd=Math.PI,yf=2*Hd,Gh=Math.PI,Vh=2*Gh,Va=1e-6,Gz=Vh-Va;function KS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Vz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KS;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class Xz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?KS:Vz(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,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,o){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,d=a-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>Va)if(!(Math.abs(f*c-d*u)>Va)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,x=a-l,g=c*c+d*d,v=p*p+x*x,y=Math.sqrt(g),b=Math.sqrt(m),N=i*Math.tan((Gh-Math.acos((g+m-v)/(2*y*b)))/2),w=N/b,k=N/y;Math.abs(w-1)>Va&&this._append`L${t+w*u},${r+w*f}`,this._append`A${i},${i},0,0,${+(f*p>u*x)},${this._x1=t+k*c},${this._y1=r+k*d}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),d=t+l,u=r+c,f=1^o,m=o?a-i:i-a;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Va||Math.abs(this._y1-u)>Va)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%Vh+Vh),m>Gz?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>Va&&this._append`A${n},${n},0,${+(m>=Gh)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function tg(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 Xz(t)}function rg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function YS(e){this._context=e}YS.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 bf(e){return new YS(e)}function GS(e){return e[0]}function VS(e){return e[1]}function XS(e,t){var r=ut(!0),n=null,a=bf,i=null,o=tg(l);e=typeof e=="function"?e:e===void 0?GS:ut(e),t=typeof t=="function"?t:t===void 0?VS:ut(t);function l(c){var d,u=(c=rg(c)).length,f,m=!1,p;for(n==null&&(i=a(p=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(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:ut(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:ut(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:ut(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Zc(e,t,r){var n=null,a=ut(!0),i=null,o=bf,l=null,c=tg(d);e=typeof e=="function"?e:e===void 0?GS:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?VS:ut(+r);function d(f){var m,p,x,g=(f=rg(f)).length,v,y=!1,b,N=new Array(g),w=new Array(g);for(i==null&&(l=o(b=c())),m=0;m<=g;++m){if(!(m<g&&a(v=f[m],m,f))===y)if(y=!y)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=p;--x)l.point(N[x],w[x]);l.lineEnd(),l.areaEnd()}y&&(N[m]=+e(v,m,f),w[m]=+t(v,m,f),l.point(n?+n(v,m,f):N[m],r?+r(v,m,f):w[m]))}if(b)return l=null,b+""||null}function u(){return XS().defined(a).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ut(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ut(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ut(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ut(+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?(a=typeof f=="function"?f:ut(!!f),d):a},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 QS{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 Qz(e){return new QS(e,!0)}function Zz(e){return new QS(e,!1)}const ng={draw(e,t){const r=Yn(t/Hd);e.moveTo(r,0),e.arc(0,0,r,0,yf)}},Jz={draw(e,t){const r=Yn(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()}},ZS=Yn(1/3),eF=ZS*2,tF={draw(e,t){const r=Yn(t/eF),n=r*ZS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},rF={draw(e,t){const r=Yn(t),n=-r/2;e.rect(n,n,r,r)}},nF=.8908130915292852,JS=Ud(Hd/10)/Ud(7*Hd/10),sF=Ud(yf/10)*JS,aF=-HS(yf/10)*JS,iF={draw(e,t){const r=Yn(t*nF),n=sF*r,a=aF*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=yf*i/5,l=HS(o),c=Ud(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},Zm=Yn(3),oF={draw(e,t){const r=-Yn(t/(Zm*3));e.moveTo(0,r*2),e.lineTo(-Zm*r,-r),e.lineTo(Zm*r,-r),e.closePath()}},yn=-.5,bn=Yn(3)/2,Xh=1/Yn(12),lF=(Xh/2+1)*3,cF={draw(e,t){const r=Yn(t/lF),n=r/2,a=r*Xh,i=n,o=r*Xh+r,l=-i,c=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(yn*n-bn*a,bn*n+yn*a),e.lineTo(yn*i-bn*o,bn*i+yn*o),e.lineTo(yn*l-bn*c,bn*l+yn*c),e.lineTo(yn*n+bn*a,yn*a-bn*n),e.lineTo(yn*i+bn*o,yn*o-bn*i),e.lineTo(yn*l+bn*c,yn*c-bn*l),e.closePath()}};function dF(e,t){let r=null,n=tg(a);e=typeof e=="function"?e:ut(e||ng),t=typeof t=="function"?t:ut(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:ut(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:ut(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Kd(){}function Yd(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 e2(e){this._context=e}e2.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:Yd(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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uF(e){return new e2(e)}function t2(e){this._context=e}t2.prototype={areaStart:Kd,areaEnd:Kd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fF(e){return new t2(e)}function r2(e){this._context=e}r2.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:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mF(e){return new r2(e)}function n2(e){this._context=e}n2.prototype={areaStart:Kd,areaEnd:Kd,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 hF(e){return new n2(e)}function ob(e){return e<0?-1:1}function lb(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(ob(i)+ob(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function cb(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Jm(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,o-l*r,i,o)}function Gd(e){this._context=e}Gd.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:Jm(this,this._t0,cb(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,Jm(this,cb(this,r=lb(this,e,t)),r);break;default:Jm(this,this._t0,r=lb(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function s2(e){this._context=new a2(e)}(s2.prototype=Object.create(Gd.prototype)).point=function(e,t){Gd.prototype.point.call(this,t,e)};function a2(e){this._context=e}a2.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,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function pF(e){return new Gd(e)}function xF(e){return new s2(e)}function i2(e){this._context=e}i2.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=db(e),a=db(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[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 db(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(a[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function gF(e){return new i2(e)}function wf(e,t){this._context=e,this._t=t}wf.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 vF(e){return new wf(e,.5)}function yF(e){return new wf(e,0)}function bF(e){return new wf(e,1)}function gi(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,l=i.length;r<o;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function Qh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function wF(e,t){return e[t]}function jF(e){const t=[];return t.key=e,t}function NF(){var e=ut([]),t=Qh,r=gi,n=wF;function a(i){var o=Array.from(e.apply(this,arguments),jF),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=rg(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ut(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:ut(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?Qh:typeof i=="function"?i:ut(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??gi,a):r},a}function kF(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=e[r][a][1]||0;if(o)for(r=0;r<n;++r)e[r][a][1]/=o}gi(e,t)}}function SF(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}gi(e,t)}}function CF(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,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,p=(f-m)/2,x=0;x<l;++x){var g=e[t[x]],v=g[n][1]||0,y=g[n-1][1]||0;p+=v-y}c+=f,d+=p*f}a[n-1][1]+=a[n-1][0]=r,c&&(r-=d/c)}a[n-1][1]+=a[n-1][0]=r,gi(e,t)}}var jf={},o2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(o2);var sg={};(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})(sg);var Nf={};(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})(Nf);var kf={},l2={};(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})(l2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l2,r=Nf;function n(a){if(Array.isArray(a))return a.map(r.toKey);if(typeof a=="symbol")return[a];a=t.toString(a);const i=[],o=a.length;if(o===0)return i;let l=0,c="",d="",u=!1;for(a.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const f=a[l];d?f==="\\"&&l+1<o?(l++,c+=a[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})(kf);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o2,r=sg,n=Nf,a=kf;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,a.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})(jf);var _F=jf.get;const fo=Qs(_F);var PF=4;function ga(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:PF,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Et(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((a,i,o)=>{var l=r[o-1];return typeof l=="string"?a+l+i:l!==void 0?a+ga(l)+i:a+i},"")}var Wr=e=>e===0?0:e>0?1:-1,ms=e=>typeof e=="number"&&e!=+e,vi=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!ms(e),hs=e=>Ce(e)||typeof e=="string",MF=0,Il=e=>{var t=++MF;return"".concat(e||"").concat(t)},Un=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&typeof t!="string")return n;var i;if(vi(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return ms(i)&&(i=n),a&&r!=null&&i>r&&(i=r),i},c2=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 ur(e,t,r){return Ce(e)&&Ce(t)?ga(e+r*(t-e)):t}function d2(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):fo(n,t))===r)}var Ft=e=>e===null||typeof e>"u",yc=e=>Ft(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ur(e){return e!=null}function zo(){}var OF=["type","size","sizeType"];function Zh(){return Zh=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},Zh.apply(null,arguments)}function ub(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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){EF(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 EF(e,t,r){return(t=AF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AF(e){var t=DF(e,"string");return typeof t=="symbol"?t:t+""}function DF(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 TF(e,t){if(e==null)return{};var r,n,a=IF(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)&&(a[r]=e[r])}return a}function IF(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 u2={symbolCircle:ng,symbolCross:Jz,symbolDiamond:tF,symbolSquare:rF,symbolStar:iF,symbolTriangle:oF,symbolWye:cF},RF=Math.PI/180,$F=e=>{var t="symbol".concat(yc(e));return u2[t]||ng},LF=(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*RF;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}},zF=(e,t)=>{u2["symbol".concat(yc(e))]=t},f2=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,a=TF(e,OF),i=fb(fb({},a),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=$F(o),p=dF().type(m).size(LF(r,n,o)),x=p();if(x!==null)return x},{className:c,cx:d,cy:u}=i,f=Xr(i);return Ce(d)&&Ce(u)&&Ce(r)?h.createElement("path",Zh({},f,{className:lt("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};f2.registerSymbol=zF;var m2=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,FF=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(a=>{Jx(a)&&(n[a]=i=>r[a](r,i))}),n},BF=(e,t,r)=>n=>(e(t,r,n),null),ag=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(a=>{var i=e[a];Jx(a)&&typeof i=="function"&&(n||(n={}),n[a]=BF(i,t,r))}),n};function mb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qF(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){WF(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 WF(e,t,r){return(t=UF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UF(e){var t=HF(e,"string");return typeof t=="symbol"?t:t+""}function HF(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 gn(e,t){var r=qF({},e),n=t,a=Object.keys(t),i=a.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return i}var h2={},p2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const a=new Map;for(let i=0;i<r.length;i++){const o=r[i],l=n(o,i,r);a.has(l)||a.set(l,o)}return Array.from(a.values())}e.uniqBy=t})(p2);var x2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...a){return r.apply(this,a.slice(0,n))}}e.ary=t})(x2);var ig={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(ig);var g2={},Sf={},v2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(v2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=v2;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(Sf);var y2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(y2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sf,r=y2;function n(a){return r.isObjectLike(a)&&t.isArrayLike(a)}e.isArrayLikeObject=n})(g2);var b2={},w2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jf;function r(n){return function(a){return t.get(a,n)}}e.property=r})(w2);var j2={},og={},N2={},lg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(lg);var cg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(cg);var dg={};(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})(dg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lg,r=cg,n=dg;function a(u,f,m){return typeof m!="function"?a(u,f,()=>{}):i(u,f,function p(x,g,v,y,b,N){const w=m(x,g,v,y,b,N);return w!==void 0?!!w:i(x,g,p,N)},new Map)}function i(u,f,m,p){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,m,p);case"function":return Object.keys(f).length>0?i(u,{...f},m,p):n.isEqualsSameValueZero(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(u,f)}}function o(u,f,m,p){if(f==null)return!0;if(Array.isArray(f))return c(u,f,m,p);if(f instanceof Map)return l(u,f,m,p);if(f instanceof Set)return d(u,f,m,p);const x=Object.keys(f);if(u==null||r.isPrimitive(u))return x.length===0;if(x.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===u;p==null||p.set(f,u);try{for(let g=0;g<x.length;g++){const v=x[g];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,p))return!1}return!0}finally{p==null||p.delete(f)}}function l(u,f,m,p){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[x,g]of f.entries()){const v=u.get(x);if(m(v,g,x,u,f,p)===!1)return!1}return!0}function c(u,f,m,p){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const x=new Set;for(let g=0;g<f.length;g++){const v=f[g];let y=!1;for(let b=0;b<u.length;b++){if(x.has(b))continue;const N=u[b];let w=!1;if(m(N,v,g,u,f,p)&&(w=!0),w){x.add(b),y=!0;break}}if(!y)return!1}return!0}function d(u,f,m,p){return f.size===0?!0:u instanceof Set?c([...u],[...f],m,p):!1}e.isMatchWith=a,e.isSetMatch=d})(N2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N2;function r(n,a){return t.isMatchWith(n,a,()=>{})}e.isMatch=r})(og);var k2={},ug={},S2={};(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})(S2);var Cf={};(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})(Cf);var fg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",a="[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]",p="[object Object]",x="[object Error]",g="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",b="[object Uint16Array]",N="[object Uint32Array]",w="[object BigUint64Array]",k="[object Int8Array]",j="[object Int16Array]",C="[object Int32Array]",P="[object BigInt64Array]",S="[object Float32Array]",_="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=w,e.booleanTag=a,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=S,e.float64ArrayTag=_,e.functionTag=f,e.int16ArrayTag=j,e.int32ArrayTag=C,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=n,e.objectTag=p,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=b,e.uint32ArrayTag=N,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=y})(fg);var C2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(C2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S2,r=Cf,n=fg,a=cg,i=C2;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,p=new Map,x=void 0){const g=x==null?void 0:x(u,f,m,p);if(g!==void 0)return g;if(a.isPrimitive(u))return u;if(p.has(u))return p.get(u);if(Array.isArray(u)){const v=new Array(u.length);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);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;p.set(u,v);for(const[y,b]of u)v.set(y,l(b,y,m,p,x));return v}if(u instanceof Set){const v=new Set;p.set(u,v);for(const y of u)v.add(l(y,void 0,m,p,x));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);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);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 p.set(u,v),c(v,u,m,p,x),v}if(typeof File<"u"&&u instanceof File){const v=new File([u],u.name,{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(typeof Blob<"u"&&u instanceof Blob){const v=new Blob([u],{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Error){const v=new u.constructor;return p.set(u,v),v.message=u.message,v.name=u.name,v.stack=u.stack,v.cause=u.cause,c(v,u,m,p,x),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Number){const v=new Number(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof String){const v=new String(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return p.set(u,v),c(v,u,m,p,x),v}return u}function c(u,f,m=u,p,x){const g=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<g.length;v++){const y=g[v],b=Object.getOwnPropertyDescriptor(u,y);(b==null||b.writable)&&(u[y]=l(f[y],y,m,p,x))}}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})(ug);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ug;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(k2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=og,r=k2;function n(a){return a=r.cloneDeep(a),i=>t.isMatch(i,a)}e.matches=n})(j2);var _2={},P2={},M2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ug,r=Cf,n=fg;function a(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=a})(M2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M2;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(P2);var O2={},mg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,a=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<a;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(mg);var E2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cf;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(E2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sg,r=mg,n=E2,a=kf;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=a.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})(O2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=og,r=Nf,n=P2,a=jf,i=O2;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=a.get(d,l);return u===void 0?i.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=o})(_2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ig,r=w2,n=j2,a=_2;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?a.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=i})(b2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p2,r=x2,n=ig,a=g2,i=b2;function o(l,c=n.identity){return a.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(h2);var KF=h2.uniqBy;const hb=Qs(KF);function YF(e,t,r){return t===!0?hb(e,r):typeof t=="function"?hb(e,t):e}var hg=h.createContext(null),GF=e=>e,Rt=()=>{var e=h.useContext(hg);return e?e.store.dispatch:GF},Nd=()=>{},VF=()=>Nd,XF=(e,t)=>e===t;function Ae(e){var t=h.useContext(hg),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Nd,[t,e]);return fA.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:VF,t?t.store.getState:Nd,t?t.store.getState:Nd,r,XF)}function QF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ZF(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function JF(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 pb=e=>Array.isArray(e)?e:[e];function e8(e){const t=Array.isArray(e[0])?e[0]:e;return JF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function t8(e,t){const r=[],{length:n}=e;for(let a=0;a<n;a++)r.push(e[a].apply(null,t));return r}var r8=class{constructor(e){this.value=e}deref(){return this.value}},n8=typeof WeakRef<"u"?WeakRef:r8,s8=0,xb=1;function Jc(){return{s:s8,v:void 0,o:null,p:null}}function A2(e,t={}){let r=Jc();const{resultEqualityCheck:n}=t;let a,i=0;function o(){var f;let l=r;const{length:c}=arguments;for(let m=0,p=c;m<p;m++){const x=arguments[m];if(typeof x=="function"||typeof x=="object"&&x!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(x);v===void 0?(l=Jc(),g.set(x,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(x);v===void 0?(l=Jc(),g.set(x,l)):l=v}}const d=l;let u;if(l.s===xb)u=l.v;else if(u=e.apply(null,arguments),i++,n){const m=((f=a==null?void 0:a.deref)==null?void 0:f.call(a))??a;m!=null&&n(m,u)&&(u=m,i!==0&&i--),a=typeof u=="object"&&u!==null||typeof u=="function"?new n8(u):u}return d.s=xb,d.v=u,u}return o.clearCache=()=>{r=Jc(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function a8(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let i=0,o=0,l,c={},d=a.pop();typeof d=="object"&&(c=d,d=a.pop()),QF(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:p=A2,argsMemoizeOptions:x=[]}=u,g=pb(m),v=pb(x),y=e8(a),b=f(function(){return i++,d.apply(null,arguments)},...g),N=p(function(){o++;const k=t8(y,arguments);return l=b.apply(null,k),l},...v);return Object.assign(N,{resultFunc:d,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var ae=a8(A2),i8=Object.assign((e,t=ae)=>{ZF(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:()=>i8}),D2={},T2={},I2={};(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,a,i)=>{if(n!==a){const o=t(n),l=t(a);if(o===l&&o===0){if(n<a)return i==="desc"?1:-1;if(n>a)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};e.compareValues=r})(I2);var R2={},pg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(pg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pg,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(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=a})(R2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I2,r=R2,n=kf;function a(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(p=>String(p));const d=(p,x)=>{let g=p;for(let v=0;v<x.length&&g!=null;++v)g=g[x[v]];return g},u=(p,x)=>x==null||p==null?x:typeof p=="object"&&"key"in p?Object.hasOwn(x,p.key)?x[p.key]:d(x,p.path):typeof p=="function"?p(x):Array.isArray(p)?d(x,p):typeof x=="object"?x[p]:x,f=o.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||r.isKey(p)?p:{key:p,path:n.toPath(p)}));return i.map(p=>({original:p,criteria:f.map(x=>u(x,p))})).slice().sort((p,x)=>{for(let g=0;g<f.length;g++){const v=t.compareValues(p.criteria[g],x.criteria[g],l[g]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=a})(T2);var $2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const a=[],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):a.push(u)}};return o(r,0),a}e.flatten=t})($2);var xg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mg,r=Sf,n=lg,a=dg;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)?a.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=i})(xg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T2,r=$2,n=xg;function a(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=a})(D2);var o8=D2.sortBy;const _f=Qs(o8);var L2=e=>e.legend.settings,l8=e=>e.legend.size,c8=e=>e.legend.payload;ae([c8,L2],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?_f(n,r):n});var ed=1;function d8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=h.useState({height:0,left:0,top:0,width:0}),n=h.useCallback(a=>{if(a!=null){var i=a.getBoundingClientRect(),o={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(o.height-t.height)>ed||Math.abs(o.left-t.left)>ed||Math.abs(o.top-t.top)>ed||Math.abs(o.width-t.width)>ed)&&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 cr(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 u8=typeof Symbol=="function"&&Symbol.observable||"@@observable",gb=u8,eh=()=>Math.random().toString(36).substring(7).split("").join("."),f8={INIT:`@@redux/INIT${eh()}`,REPLACE:`@@redux/REPLACE${eh()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${eh()}`},Vd=f8;function gg(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 z2(e,t,r){if(typeof e!="function")throw new Error(cr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(cr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(cr(1));return r(z2)(e,t)}let n=e,a=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(cr(3));return a}function f(v){if(typeof v!="function")throw new Error(cr(4));if(c)throw new Error(cr(5));let y=!0;d();const b=l++;return o.set(b,v),function(){if(y){if(c)throw new Error(cr(6));y=!1,d(),o.delete(b),i=null}}}function m(v){if(!gg(v))throw new Error(cr(7));if(typeof v.type>"u")throw new Error(cr(8));if(typeof v.type!="string")throw new Error(cr(17));if(c)throw new Error(cr(9));try{c=!0,a=n(a,v)}finally{c=!1}return(i=o).forEach(b=>{b()}),v}function p(v){if(typeof v!="function")throw new Error(cr(10));n=v,m({type:Vd.REPLACE})}function x(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(cr(11));function b(){const w=y;w.next&&w.next(u())}return b(),{unsubscribe:v(b)}},[gb](){return this}}}return m({type:Vd.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:p,[gb]:x}}function m8(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Vd.INIT})>"u")throw new Error(cr(12));if(typeof r(void 0,{type:Vd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(cr(13))})}function F2(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 a;try{m8(r)}catch(i){a=i}return function(o={},l){if(a)throw a;let c=!1;const d={};for(let u=0;u<n.length;u++){const f=n[u],m=r[f],p=o[f],x=m(p,l);if(typeof x>"u")throw l&&l.type,new Error(cr(14));d[f]=x,c=c||x!==p}return c=c||n.length!==Object.keys(o).length,c?d:o}}function Xd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function h8(...e){return t=>(r,n)=>{const a=t(r,n);let i=()=>{throw new Error(cr(15))};const o={getState:a.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=Xd(...l)(a.dispatch),{...a,dispatch:i}}}function B2(e){return gg(e)&&"type"in e&&typeof e.type=="string"}var q2=Symbol.for("immer-nothing"),vb=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function Rn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var on=Object,mo=on.getPrototypeOf,Qd="constructor",Pf="prototype",Jh="configurable",Zd="enumerable",kd="writable",Rl="value",Us=e=>!!e&&!!e[Ir];function Hn(e){var t;return e?W2(e)||Of(e)||!!e[vb]||!!((t=e[Qd])!=null&&t[vb])||Ef(e)||Af(e):!1}var p8=on[Pf][Qd].toString(),yb=new WeakMap;function W2(e){if(!e||!vg(e))return!1;const t=mo(e);if(t===null||t===on[Pf])return!0;const r=on.hasOwnProperty.call(t,Qd)&&t[Qd];if(r===Object)return!0;if(!Ki(r))return!1;let n=yb.get(r);return n===void 0&&(n=Function.toString.call(r),yb.set(r,n)),n===p8}function Mf(e,t,r=!0){bc(e)===0?(r?Reflect.ownKeys(e):on.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function bc(e){const t=e[Ir];return t?t.type_:Of(e)?1:Ef(e)?2:Af(e)?3:0}var bb=(e,t,r=bc(e))=>r===2?e.has(t):on[Pf].hasOwnProperty.call(e,t),ep=(e,t,r=bc(e))=>r===2?e.get(t):e[t],Jd=(e,t,r,n=bc(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function x8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Of=Array.isArray,Ef=e=>e instanceof Map,Af=e=>e instanceof Set,vg=e=>typeof e=="object",Ki=e=>typeof e=="function",th=e=>typeof e=="boolean";function g8(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ss=e=>e.copy_||e.base_,yg=e=>e.modified_?e.copy_:e.base_;function tp(e,t){if(Ef(e))return new Map(e);if(Af(e))return new Set(e);if(Of(e))return Array[Pf].slice.call(e);const r=W2(e);if(t===!0||t==="class_only"&&!r){const n=on.getOwnPropertyDescriptors(e);delete n[Ir];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const o=a[i],l=n[o];l[kd]===!1&&(l[kd]=!0,l[Jh]=!0),(l.get||l.set)&&(n[o]={[Jh]:!0,[kd]:!0,[Zd]:l[Zd],[Rl]:e[o]})}return on.create(mo(e),n)}else{const n=mo(e);if(n!==null&&r)return{...e};const a=on.create(n);return on.assign(a,e)}}function bg(e,t=!1){return Df(e)||Us(e)||!Hn(e)||(bc(e)>1&&on.defineProperties(e,{set:td,add:td,clear:td,delete:td}),on.freeze(e),t&&Mf(e,(r,n)=>{bg(n,!0)},!1)),e}function v8(){Rn(2)}var td={[Rl]:v8};function Df(e){return e===null||!vg(e)?!0:on.isFrozen(e)}var eu="MapSet",rp="Patches",wb="ArrayMethods",U2={};function yi(e){const t=U2[e];return t||Rn(0,e),t}var jb=e=>!!U2[e],$l,H2=()=>$l,y8=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:jb(eu)?yi(eu):void 0,arrayMethodsPlugin_:jb(wb)?yi(wb):void 0});function Nb(e,t){t&&(e.patchPlugin_=yi(rp),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function np(e){sp(e),e.drafts_.forEach(b8),e.drafts_=null}function sp(e){e===$l&&($l=e.parent_)}var kb=e=>$l=y8($l,e);function b8(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Sb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Ir].modified_&&(np(t),Rn(4)),Hn(e)&&(e=Cb(t,e));const{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(r[Ir].base_,e,t)}else e=Cb(t,r);return w8(t,e,!0),np(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==q2?e:void 0}function Cb(e,t){if(Df(t))return t;const r=t[Ir];if(!r)return tu(t,e.handledSet_,e);if(!Tf(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);G2(r,e)}return r.copy_}function w8(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bg(t,r)}function K2(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Tf=(e,t)=>e.scope_===t,j8=[];function Y2(e,t,r,n){const a=Ss(e),i=e.type_;if(n!==void 0&&ep(a,n,i)===t){Jd(a,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Mf(a,(c,d)=>{if(Us(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??j8;for(const l of o)Jd(a,l,r,i)}function N8(e,t,r){e.callbacks_.push(function(a){var l;const i=t;if(!i||!Tf(i,a))return;(l=a.mapSetPlugin_)==null||l.fixSetContents(i);const o=yg(i);Y2(e,i.draft_??i,o,r),G2(i,a)})}function G2(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_:a}=t;if(a){const i=a.getPath(e);i&&a.generatePatches_(e,i,t)}K2(e)}}function k8(e,t,r){const{scope_:n}=e;if(Us(r)){const a=r[Ir];Tf(a,n)&&a.callbacks_.push(function(){Sd(e);const o=yg(a);Y2(e,r,o,t)})}else Hn(r)&&e.callbacks_.push(function(){const i=Ss(e);e.type_===3?i.has(r)&&tu(r,n.handledSet_,n):ep(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&tu(ep(e.copy_,t,e.type_),n.handledSet_,n)})}function tu(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Us(e)||t.has(e)||!Hn(e)||Df(e)||(t.add(e),Mf(e,(n,a)=>{if(Us(a)){const i=a[Ir];if(Tf(i,r)){const o=yg(i);Jd(e,n,o,e.type_),K2(i)}}else Hn(a)&&tu(a,t,r)})),e}function S8(e,t){const r=Of(e),n={type_:r?1:0,scope_:t?t.scope_:H2(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,i=ru;r&&(a=[n],i=Ll);const{revoke:o,proxy:l}=Proxy.revocable(a,i);return n.draft_=l,n.revoke_=o,[l,n]}var ru={get(e,t){if(t===Ir)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 a=Ss(e);if(!bb(a,t,e.type_))return C8(e,a,t);const i=a[t];if(e.finalized_||!Hn(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&g8(t))return i;if(i===rh(e.base_,t)){Sd(e);const o=e.type_===1?+t:t,l=ip(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in Ss(e)},ownKeys(e){return Reflect.ownKeys(Ss(e))},set(e,t,r){const n=V2(Ss(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=rh(Ss(e),t),i=a==null?void 0:a[Ir];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(x8(r,a)&&(r!==void 0||bb(e.base_,t,e.type_)))return!0;Sd(e),ap(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),k8(e,t,r)),!0},deleteProperty(e,t){return Sd(e),rh(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ap(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Ss(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[kd]:!0,[Jh]:e.type_!==1||t!=="length",[Zd]:n[Zd],[Rl]:r[t]}},defineProperty(){Rn(11)},getPrototypeOf(e){return mo(e.base_)},setPrototypeOf(){Rn(12)}},Ll={};for(let e in ru){let t=ru[e];Ll[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Ll.deleteProperty=function(e,t){return Ll.set.call(this,e,t,void 0)};Ll.set=function(e,t,r){return ru.set.call(this,e[0],t,r,e[0])};function rh(e,t){const r=e[Ir];return(r?Ss(r):e)[t]}function C8(e,t,r){var a;const n=V2(t,r);return n?Rl in n?n[Rl]:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function V2(e,t){if(!(t in e))return;let r=mo(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=mo(r)}}function ap(e){e.modified_||(e.modified_=!0,e.parent_&&ap(e.parent_))}function Sd(e){e.copy_||(e.assigned_=new Map,e.copy_=tp(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _8=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,a)=>{if(Ki(r)&&!Ki(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}Ki(n)||Rn(6),a!==void 0&&!Ki(a)&&Rn(7);let i;if(Hn(r)){const o=kb(this),l=ip(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?np(o):sp(o)}return Nb(o,a),Sb(i,o)}else if(!r||!vg(r)){if(i=n(r),i===void 0&&(i=r),i===q2&&(i=void 0),this.autoFreeze_&&bg(i,!0),a){const o=[],l=[];yi(rp).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),a(o,l)}return i}else Rn(1,r)},this.produceWithPatches=(r,n)=>{if(Ki(r))return(l,...c)=>this.produceWithPatches(l,d=>r(d,...c));let a,i;return[this.produce(r,n,(l,c)=>{a=l,i=c}),a,i]},th(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),th(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),th(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Hn(t)||Rn(8),Us(t)&&(t=qn(t));const r=kb(this),n=ip(r,t,void 0);return n[Ir].isManual_=!0,sp(r),n}finishDraft(t,r){const n=t&&t[Ir];(!n||!n.isManual_)&&Rn(9);const{scope_:a}=n;return Nb(a,r),Sb(void 0,a)}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 a=yi(rp).applyPatches_;return Us(t)?a(t,r):this.produce(t,i=>a(i,r))}};function ip(e,t,r,n){const[a,i]=Ef(t)?yi(eu).proxyMap_(t,r):Af(t)?yi(eu).proxySet_(t,r):S8(t,r);return((r==null?void 0:r.scope_)??H2()).drafts_.push(a),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?N8(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)}),a}function qn(e){return Us(e)||Rn(10,e),X2(e)}function X2(e){if(!Hn(e)||Df(e))return e;const t=e[Ir];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=tp(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=tp(e,!0);return Mf(r,(a,i)=>{Jd(r,a,X2(i))},n),t&&(t.finalized_=!1),r}var P8=new _8,Q2=P8.produce;function Z2(e){return({dispatch:r,getState:n})=>a=>i=>typeof i=="function"?i(r,n,e):a(i)}var M8=Z2(),O8=Z2,E8=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Xd:Xd.apply(null,arguments)};function Pn(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(cn(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>B2(n)&&n.type===e,r}var J2=class jl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,jl.prototype)}static get[Symbol.species](){return jl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new jl(...t[0].concat(this)):new jl(...t.concat(this))}};function _b(e){return Hn(e)?Q2(e,()=>{}):e}function rd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function A8(e){return typeof e=="boolean"}var D8=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{};let o=new J2;return r&&(A8(r)?o.push(M8):o.push(O8(r.extraArgument))),o},eC="RTK_autoBatch",yt=()=>e=>({payload:e,meta:{[eC]:!0}}),Pb=e=>t=>{setTimeout(t,e)},tC=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let a=!0,i=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pb(10):e.type==="callback"?e.queueNotification:Pb(e.timeout),d=()=>{o=!1,i&&(i=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>a&&u(),m=n.subscribe(f);return l.add(u),()=>{m(),l.delete(u)}},dispatch(u){var f;try{return a=!((f=u==null?void 0:u.meta)!=null&&f[eC]),i=!a,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{a=!0}}})},T8=e=>function(r){const{autoBatch:n=!0}=r??{};let a=new J2(e);return n&&a.push(tC(typeof n=="object"?n:void 0)),a};function I8(e){const t=D8(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(gg(r))l=F2(r);else throw new Error(cn(1));let c;typeof n=="function"?c=n(t):c=t();let d=Xd;a&&(d=E8({trace:!1,...typeof a=="object"&&a}));const u=h8(...c),f=T8(u);let m=typeof o=="function"?o(f):f();const p=d(...m);return z2(l,i,p)}function rC(e){const t={},r=[];let n;const a={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(cn(28));if(l in t)throw new Error(cn(29));return t[l]=o,a},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}),a},addMatcher(i,o){return r.push({matcher:i,reducer:o}),a},addDefaultCase(i){return n=i,a}};return e(a),[t,r,n]}function R8(e){return typeof e=="function"}function $8(e,t){let[r,n,a]=rC(t),i;if(R8(e))i=()=>_b(e());else{const l=_b(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=[a]),d.reduce((u,f)=>{if(f)if(Us(u)){const p=f(u,c);return p===void 0?u:p}else{if(Hn(u))return Q2(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 L8="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",z8=(e=21)=>{let t="",r=e;for(;r--;)t+=L8[Math.random()*64|0];return t},F8=Symbol.for("rtk-slice-createasyncthunk");function B8(e,t){return`${e}/${t}`}function q8({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[F8];return function(a){const{name:i,reducerPath:o=i}=a;if(!i)throw new Error(cn(11));const l=(typeof a.reducers=="function"?a.reducers(U8()):a.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(w,k){const j=typeof w=="string"?w:w.type;if(!j)throw new Error(cn(12));if(j in d.sliceCaseReducersByType)throw new Error(cn(13));return d.sliceCaseReducersByType[j]=k,u},addMatcher(w,k){return d.sliceMatchers.push({matcher:w,reducer:k}),u},exposeAction(w,k){return d.actionCreators[w]=k,u},exposeCaseReducer(w,k){return d.sliceCaseReducersByName[w]=k,u}};c.forEach(w=>{const k=l[w],j={reducerName:w,type:B8(i,w),createNotation:typeof a.reducers=="function"};K8(k)?G8(j,k,u,t):H8(j,k,u)});function f(){const[w={},k=[],j=void 0]=typeof a.extraReducers=="function"?rC(a.extraReducers):[a.extraReducers],C={...w,...d.sliceCaseReducersByType};return $8(a.initialState,P=>{for(let S in C)P.addCase(S,C[S]);for(let S of d.sliceMatchers)P.addMatcher(S.matcher,S.reducer);for(let S of k)P.addMatcher(S.matcher,S.reducer);j&&P.addDefaultCase(j)})}const m=w=>w,p=new Map,x=new WeakMap;let g;function v(w,k){return g||(g=f()),g(w,k)}function y(){return g||(g=f()),g.getInitialState()}function b(w,k=!1){function j(P){let S=P[w];return typeof S>"u"&&k&&(S=rd(x,j,y)),S}function C(P=m){const S=rd(p,k,()=>new WeakMap);return rd(S,P,()=>{const _={};for(const[M,E]of Object.entries(a.selectors??{}))_[M]=W8(E,P,()=>rd(x,P,y),k);return _})}return{reducerPath:w,getSelectors:C,get selectors(){return C(j)},selectSlice:j}}const N={name:i,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:y,...b(o),injectInto(w,{reducerPath:k,...j}={}){const C=k??o;return w.inject({reducerPath:C,reducer:v},j),{...N,...b(C,!0)}}};return N}}function W8(e,t,r,n){function a(i,...o){let l=t(i);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return a.unwrapped=e,a}var Jr=q8();function U8(){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 H8({type:e,reducerName:t,createNotation:r},n,a){let i,o;if("reducer"in n){if(r&&!Y8(n))throw new Error(cn(17));i=n.reducer,o=n.prepare}else i=n;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?Pn(e,o):Pn(e))}function K8(e){return e._reducerDefinitionType==="asyncThunk"}function Y8(e){return e._reducerDefinitionType==="reducerWithPrepare"}function G8({type:e,reducerName:t},r,n,a){if(!a)throw new Error(cn(18));const{payloadCreator:i,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=a(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||nd,pending:l||nd,rejected:c||nd,settled:d||nd})}function nd(){}var V8="task",nC="listener",sC="completed",wg="cancelled",X8=`task-${wg}`,Q8=`task-${sC}`,op=`${nC}-${wg}`,Z8=`${nC}-${sC}`,If=class{constructor(e){jm(this,"name","TaskAbortError");jm(this,"message");this.code=e,this.message=`${V8} ${wg} (reason: ${e})`}},jg=(e,t)=>{if(typeof e!="function")throw new TypeError(cn(32))},nu=()=>{},aC=(e,t=nu)=>(e.catch(t),e),iC=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),li=e=>{if(e.aborted)throw new If(e.reason)};function oC(e,t){let r=nu;return new Promise((n,a)=>{const i=()=>a(new If(e.reason));if(e.aborted){i();return}r=iC(e,i),t.finally(()=>r()).then(n,a)}).finally(()=>{r=nu})}var J8=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof If?"cancelled":"rejected",error:r}}finally{t==null||t()}},su=e=>t=>aC(oC(e,t).then(r=>(li(e),r))),lC=e=>{const t=su(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Ji}=Object,Mb={},Rf="listenerMiddleware",eB=(e,t)=>{const r=n=>iC(e,()=>n.abort(e.reason));return(n,a)=>{jg(n);const i=new AbortController;r(i);const o=J8(async()=>{li(e),li(i.signal);const l=await n({pause:su(i.signal),delay:lC(i.signal),signal:i.signal});return li(i.signal),l},()=>i.abort(Q8));return a!=null&&a.autoJoin&&t.push(o.catch(nu)),{result:su(e)(o),cancel(){i.abort(X8)}}}},tB=(e,t)=>{const r=async(n,a)=>{li(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()}})];a!=null&&l.push(new Promise(c=>setTimeout(c,a,null)));try{const c=await oC(t,Promise.race(l));return li(t),c}finally{i()}};return(n,a)=>aC(r(n,a))},cC=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:i}=e;if(t)a=Pn(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(cn(21));return jg(i),{predicate:a,type:t,effect:i}},dC=Ji(e=>{const{type:t,predicate:r,effect:n}=cC(e);return{id:z8(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(cn(22))}}},{withTypes:()=>dC}),Ob=(e,t)=>{const{type:r,effect:n,predicate:a}=cC(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===a)&&i.effect===n)},lp=e=>{e.pending.forEach(t=>{t.abort(op)})},rB=(e,t)=>()=>{for(const r of t.keys())lp(r);e.clear()},Eb=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},uC=Ji(Pn(`${Rf}/add`),{withTypes:()=>uC}),nB=Pn(`${Rf}/removeAll`),fC=Ji(Pn(`${Rf}/remove`),{withTypes:()=>fC}),sB=(...e)=>{console.error(`${Rf}/error`,...e)},wc=(e={})=>{const t=new Map,r=new Map,n=p=>{const x=r.get(p)??0;r.set(p,x+1)},a=p=>{const x=r.get(p)??1;x===1?r.delete(p):r.set(p,x-1)},{extra:i,onError:o=sB}=e;jg(o);const l=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),x=>{p.unsubscribe(),x!=null&&x.cancelActive&&lp(p)}),c=p=>{const x=Ob(t,p)??dC(p);return l(x)};Ji(c,{withTypes:()=>c});const d=p=>{const x=Ob(t,p);return x&&(x.unsubscribe(),p.cancelActive&&lp(x)),!!x};Ji(d,{withTypes:()=>d});const u=async(p,x,g,v)=>{const y=new AbortController,b=tB(c,y.signal),N=[];try{p.pending.add(y),n(p),await Promise.resolve(p.effect(x,Ji({},g,{getOriginalState:v,condition:(w,k)=>b(w,k).then(Boolean),take:b,delay:lC(y.signal),pause:su(y.signal),extra:i,signal:y.signal,fork:eB(y.signal,N),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((w,k,j)=>{w!==y&&(w.abort(op),j.delete(w))})},cancel:()=>{y.abort(op),p.pending.delete(y)},throwIfCancelled:()=>{li(y.signal)}})))}catch(w){w instanceof If||Eb(o,w,{raisedBy:"effect"})}finally{await Promise.all(N),y.abort(Z8),a(p),p.pending.delete(y)}},f=rB(t,r);return{middleware:p=>x=>g=>{if(!B2(g))return x(g);if(uC.match(g))return c(g.payload);if(nB.match(g)){f();return}if(fC.match(g))return d(g.payload);let v=p.getState();const y=()=>{if(v===Mb)throw new Error(cn(23));return v};let b;try{if(b=x(g),t.size>0){const N=p.getState(),w=Array.from(t.values());for(const k of w){let j=!1;try{j=k.predicate(g,N,v)}catch(C){j=!1,Eb(o,C,{raisedBy:"predicate"})}j&&u(k,g,p,y)}}}finally{v=Mb}return b},startListening:c,stopListening:d,clearListeners:f}};function cn(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 aB={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},mC=Jr({name:"chartLayout",initialState:aB,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,a,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=(a=t.payload.bottom)!==null&&a!==void 0?a:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:iB,setLayout:oB,setChartSize:lB,setScale:cB}=mC.actions,dB=mC.reducer;function hC(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Ke(e){return Number.isFinite(e)}function ps(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Ab(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yi(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){uB(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 uB(e,t,r){return(t=fB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fB(e){var t=mB(e,"string");return typeof t=="symbol"?t:t+""}function mB(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 Zt(e,t,r){return Ft(e)||Ft(t)?r:hs(t)?fo(e,t,r):typeof t=="function"?t(e):r}var hB=(e,t,r)=>{if(t&&r){var{width:n,height:a}=r,{align:i,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&i!=="center"&&Ce(e[i]))return Yi(Yi({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&Ce(e[o]))return Yi(Yi({},e),{},{[o]:e[o]+(a||0)})}return e},La=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",pC=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var a,i,o=e.map(l=>(l.coordinate===t&&(a=!0),l.coordinate===r&&(i=!0),l.coordinate));return a||o.push(t),i||o.push(r),o},xC=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:a,range:i,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:m,axisType:p}=e;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,g=a==="category"&&o.bandwidth?o.bandwidth()/x:0;if(g=p==="angleAxis"&&i&&i.length>=2?Wr(i[0]-i[1])*2*g:g,f||m){var v=(f||m||[]).map((y,b)=>{var N=n?n.indexOf(y):y,w=o.map(N);return Ke(w)?{coordinate:w+g,value:y,offset:g,index:b}:null}).filter(Ur);return v}return c&&d?d.map((y,b)=>{var N=o.map(y);return Ke(N)?{coordinate:N+g,value:y,index:b,offset:g}:null}).filter(Ur):o.ticks&&u!=null?o.ticks(u).map((y,b)=>{var N=o.map(y);return Ke(N)?{coordinate:N+g,value:y,index:b,offset:g}:null}).filter(Ur):o.domain().map((y,b)=>{var N=o.map(y);return Ke(N)?{coordinate:N+g,value:n?n[y]:y,index:b,offset:g}:null}).filter(Ur)},pB=(e,t)=>{if(!t||t.length!==2||!Ce(t[0])||!Ce(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),a=[e[0],e[1]];return(!Ce(e[0])||e[0]<r)&&(a[0]=r),(!Ce(e[1])||e[1]>n)&&(a[1]=n),a[0]>n&&(a[0]=n),a[1]<r&&(a[1]=r),a},xB=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 a=0;a<n;++a)for(var i=0,o=0,l=0;l<r;++l){var c=e[l],d=c==null?void 0:c[a];if(d!=null){var u=d[1],f=d[0],m=ms(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},gB=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 a=0;a<n;++a)for(var i=0,o=0;o<r;++o){var l=e[o],c=l==null?void 0:l[a];if(c!=null){var d=ms(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},vB={sign:xB,expand:kF,none:gi,silhouette:SF,wiggle:CF,positive:gB},yB=(e,t,r)=>{var n,a=(n=vB[r])!==null&&n!==void 0?n:gi,i=NF().keys(t).value((l,c)=>Number(Zt(l,c,0))).order(Qh).offset(a),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=Zt(e[u],t[c],0);Array.isArray(f)&&f.length===2&&Ce(f[0])&&Ce(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function bB(e){return e==null?void 0:String(e)}function Wre(e){var{axis:t,ticks:r,bandSize:n,entry:a,index:i,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ft(a[t.dataKey])){var l=d2(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r!=null&&r[i]?r[i].coordinate+n/2:null}var c=Zt(a,Ft(o)?t.dataKey:o),d=t.scale.map(c);return Ce(d)?d:null}var Db=e=>{var{axis:t,ticks:r,offset:n,bandSize:a,entry:i,index:o}=e;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var l=Zt(i,t.dataKey,t.scale.domain()[o]);if(Ft(l))return null;var c=t.scale.map(l);return Ce(c)?c-a/2+n:null},wB=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return n<=0&&a>=0?0:a<0?a:n}return r[0]},jB=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},NB=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],kB=(e,t,r)=>{if(e!=null)return NB(Object.keys(e).reduce((n,a)=>{var i=e[a];if(!i)return n;var{stackedData:o}=i,l=o.reduce((c,d)=>{var u=hC(d,t,r),f=jB(u);return!Ke(f[0])||!Ke(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]))},Tb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ib=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,au=(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 a=_f(t,u=>u.coordinate),i=1/0,o=1,l=a.length;o<l;o++){var c=a[o],d=a[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 Rb(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:a,name:i}=e;return Yi(Yi({},t),{},{dataKey:r,payload:n,value:a,name:i})}function gC(e,t){if(e)return String(e);if(typeof t=="string")return t}var SB=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},CB=(e,t)=>t==="centric"?e.angle:e.radius,na=e=>e.layout.width,sa=e=>e.layout.height,_B=e=>e.layout.scale,vC=e=>e.layout.margin,$f=ae(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Lf=ae(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),PB="data-recharts-item-index",MB="data-recharts-item-id",jc=60;function $b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function sd(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){OB(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 OB(e,t,r){return(t=EB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EB(e){var t=AB(e,"string");return typeof t=="symbol"?t:t+""}function AB(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 DB=e=>e.brush.height;function TB(e){var t=Lf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:jc;return r+a}return r},0)}function IB(e){var t=Lf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:jc;return r+a}return r},0)}function RB(e){var t=$f(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function $B(e){var t=$f(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Jt=ae([na,sa,vC,DB,TB,IB,RB,$B,L2,l8],(e,t,r,n,a,i,o,l,c,d)=>{var u={left:(r.left||0)+a,right:(r.right||0)+i},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},m=sd(sd({},f),u),p=m.bottom;m.bottom+=n,m=hB(m,c,d);var x=e-m.left-m.right,g=t-m.top-m.bottom;return sd(sd({brushBottom:p},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),LB=ae(Jt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ng=ae(na,sa,(e,t)=>({x:0,y:0,width:e,height:t})),zB=h.createContext(null),en=()=>h.useContext(zB)!=null,zf=e=>e.brush,Ff=ae([zf,Jt,vC],(e,t,r)=>({height:e.height,x:Ce(e.x)?e.x:t.left,y:Ce(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ce(e.width)?e.width:t.width})),yC={},bC={},wC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:a,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(),g()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},x=()=>{m!==null&&(clearTimeout(m),m=null)},g=()=>{x(),o=void 0,l=null},v=()=>{u()},y=function(...b){if(a!=null&&a.aborted)return;o=this,l=b;const N=m==null;p(),c&&N&&u()};return y.schedule=p,y.cancel=g,y.flush=v,a==null||a.addEventListener("abort",g,{once:!0}),y}e.debounce=t})(wC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wC;function r(n,a=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(...g){u=n.apply(this,g),f=null},a,{edges:d}),p=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,g),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,g),u)},x=()=>(m.flush(),u);return p.cancel=m.cancel,p.flush=x,p}e.debounce=r})(bC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bC;function r(n,a=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return t.debounce(n,a,{leading:o,maxWait:a,trailing:l})}e.throttle=r})(yC);var FB=yC.throttle;const BB=Qs(FB);var iu=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[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,()=>a[o++]))}},as={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},jC=(e,t,r)=>{var{width:n=as.width,height:a=as.height,aspect:i,maxHeight:o}=r,l=vi(n)?e:Number(n),c=vi(a)?t:Number(a);return i&&i>0&&(l?c=l/i:c&&(l=c*i),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},qB={width:0,height:0,overflow:"visible"},WB={width:0,overflowX:"visible"},UB={height:0,overflowY:"visible"},HB={},KB=e=>{var{width:t,height:r}=e,n=vi(t),a=vi(r);return n&&a?qB:n?WB:a?UB:HB};function YB(e){var{width:t,height:r,aspect:n}=e,a=t,i=r;return a===void 0&&i===void 0?(a=as.width,i=as.height):a===void 0?a=n&&n>0?void 0:as.width:i===void 0&&(i=n&&n>0?void 0:as.height),{width:a,height:i}}function cp(){return cp=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},cp.apply(null,arguments)}function Lb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lb(Object(r),!0).forEach(function(n){GB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GB(e,t,r){return(t=VB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VB(e){var t=XB(e,"string");return typeof t=="symbol"?t:t+""}function XB(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 NC=h.createContext(as.initialDimension);function QB(e){return ps(e.width)&&ps(e.height)}function kC(e){var{children:t,width:r,height:n}=e,a=h.useMemo(()=>({width:r,height:n}),[r,n]);return QB(a)?h.createElement(NC.Provider,{value:a},t):null}var kg=()=>h.useContext(NC),ZB=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=as.initialDimension,width:a,height:i,minWidth:o=as.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=as.debounce,id:f,className:m,onResize:p,style:x={}}=e,g=h.useRef(null),v=h.useRef();v.current=p,h.useImperativeHandle(t,()=>g.current);var[y,b]=h.useState({containerWidth:n.width,containerHeight:n.height}),N=h.useCallback((P,S)=>{b(_=>{var M=Math.round(P),E=Math.round(S);return _.containerWidth===M&&_.containerHeight===E?_:{containerWidth:M,containerHeight:E}})},[]);h.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return zo;var P=E=>{var A,D=E[0];if(D!=null){var{width:Z,height:Q}=D.contentRect;N(Z,Q),(A=v.current)===null||A===void 0||A.call(v,Z,Q)}};u>0&&(P=BB(P,u,{trailing:!0,leading:!1}));var S=new ResizeObserver(P),{width:_,height:M}=g.current.getBoundingClientRect();return N(_,M),S.observe(g.current),()=>{S.disconnect()}},[N,u]);var{containerWidth:w,containerHeight:k}=y;iu(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:j,calculatedHeight:C}=jC(w,k,{width:a,height:i,aspect:r,maxHeight:c});return iu(j!=null&&j>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
588
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
589
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
590
|
-
height and width.`,j,C,a,i,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:lt("recharts-responsive-container",m),style:zb(zb({},x),{},{width:a,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:g},h.createElement("div",{style:KB({width:a,height:i})},h.createElement(kC,{width:j,height:C},d)))}),JB=h.forwardRef((e,t)=>{var r=kg();if(ps(r.width)&&ps(r.height))return e.children;var{width:n,height:a}=YB({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=jC(void 0,void 0,{width:n,height:a,aspect:e.aspect,maxHeight:e.maxHeight});return Ce(i)&&Ce(o)?h.createElement(kC,{width:i,height:o},e.children):h.createElement(ZB,cp({},e,{width:n,height:a,ref:t}))});function Sg(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 Bf=()=>{var e,t=en(),r=Ae(LB),n=Ae(Ff),a=(e=Ae(zf))===null||e===void 0?void 0:e.padding;return!t||!n||!a?r:{width:n.width-a.left-a.right,height:n.height-a.top-a.bottom,x:a.left,y:a.top}},eq={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},SC=()=>{var e;return(e=Ae(Jt))!==null&&e!==void 0?e:eq},CC=()=>Ae(na),_C=()=>Ae(sa),ct=e=>e.layout.layoutType,Fo=()=>Ae(ct),PC=()=>{var e=Fo();if(e==="horizontal"||e==="vertical")return e},MC=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},tq=()=>{var e=Fo();return e!==void 0},Nc=e=>{var t=Rt(),r=en(),{width:n,height:a}=e,i=kg(),o=n,l=a;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:a),h.useEffect(()=>{!r&&ps(o)&&ps(l)&&t(lB({width:o,height:l}))},[t,r,o,l]),null},OC=Symbol.for("immer-nothing"),Fb=Symbol.for("immer-draftable"),mn=Symbol.for("immer-state");function $n(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zl=Object.getPrototypeOf;function ho(e){return!!e&&!!e[mn]}function bi(e){var t;return e?EC(e)||Array.isArray(e)||!!e[Fb]||!!((t=e.constructor)!=null&&t[Fb])||kc(e)||Wf(e):!1}var rq=Object.prototype.constructor.toString(),Bb=new WeakMap;function EC(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=Bb.get(r);return n===void 0&&(n=Function.toString.call(r),Bb.set(r,n)),n===rq}function ou(e,t,r=!0){qf(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function qf(e){const t=e[mn];return t?t.type_:Array.isArray(e)?1:kc(e)?2:Wf(e)?3:0}function dp(e,t){return qf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function AC(e,t,r){const n=qf(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function nq(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function kc(e){return e instanceof Map}function Wf(e){return e instanceof Set}function Xa(e){return e.copy_||e.base_}function up(e,t){if(kc(e))return new Map(e);if(Wf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=EC(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[mn];let a=Reflect.ownKeys(n);for(let i=0;i<a.length;i++){const o=a[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(zl(e),n)}else{const n=zl(e);if(n!==null&&r)return{...e};const a=Object.create(n);return Object.assign(a,e)}}function Cg(e,t=!1){return Uf(e)||ho(e)||!bi(e)||(qf(e)>1&&Object.defineProperties(e,{set:ad,add:ad,clear:ad,delete:ad}),Object.freeze(e),t&&Object.values(e).forEach(r=>Cg(r,!0))),e}function sq(){$n(2)}var ad={value:sq};function Uf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var aq={};function wi(e){const t=aq[e];return t||$n(0,e),t}var Fl;function DC(){return Fl}function iq(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qb(e,t){t&&(wi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fp(e){mp(e),e.drafts_.forEach(oq),e.drafts_=null}function mp(e){e===Fl&&(Fl=e.parent_)}function Wb(e){return Fl=iq(Fl,e)}function oq(e){const t=e[mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ub(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[mn].modified_&&(fp(t),$n(4)),bi(e)&&(e=lu(t,e),t.parent_||cu(t,e)),t.patches_&&wi("Patches").generateReplacementPatches_(r[mn].base_,e,t.patches_,t.inversePatches_)):e=lu(t,r,[]),fp(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==OC?e:void 0}function lu(e,t,r){if(Uf(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[mn];if(!a)return ou(t,(i,o)=>Hb(e,a,t,i,o,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return cu(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const i=a.copy_;let o=i,l=!1;a.type_===3&&(o=new Set(i),i.clear(),l=!0),ou(o,(c,d)=>Hb(e,a,i,c,d,r,l),n),cu(e,i,!1),r&&e.patches_&&wi("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function Hb(e,t,r,n,a,i,o){if(a==null||typeof a!="object"&&!o)return;const l=Uf(a);if(!(l&&!o)){if(ho(a)){const c=i&&t&&t.type_!==3&&!dp(t.assigned_,n)?i.concat(n):void 0,d=lu(e,a,c);if(AC(r,n,d),ho(d))e.canAutoFreeze_=!1;else return}else o&&r.add(a);if(bi(a)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&l)return;lu(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(kc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&cu(e,a)}}}function cu(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Cg(t,r)}function lq(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:DC(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,i=_g;r&&(a=[n],i=Bl);const{revoke:o,proxy:l}=Proxy.revocable(a,i);return n.draft_=l,n.revoke_=o,l}var _g={get(e,t){if(t===mn)return e;const r=Xa(e);if(!dp(r,t))return cq(e,r,t);const n=r[t];return e.finalized_||!bi(n)?n:n===nh(e.base_,t)?(sh(e),e.copy_[t]=pp(n,e)):n},has(e,t){return t in Xa(e)},ownKeys(e){return Reflect.ownKeys(Xa(e))},set(e,t,r){const n=TC(Xa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=nh(Xa(e),t),i=a==null?void 0:a[mn];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(nq(r,a)&&(r!==void 0||dp(e.base_,t)))return!0;sh(e),hp(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 nh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,sh(e),hp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Xa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){$n(11)},getPrototypeOf(e){return zl(e.base_)},setPrototypeOf(){$n(12)}},Bl={};ou(_g,(e,t)=>{Bl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Bl.deleteProperty=function(e,t){return Bl.set.call(this,e,t,void 0)};Bl.set=function(e,t,r){return _g.set.call(this,e[0],t,r,e[0])};function nh(e,t){const r=e[mn];return(r?Xa(r):e)[t]}function cq(e,t,r){var a;const n=TC(t,r);return n?"value"in n?n.value:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function TC(e,t){if(!(t in e))return;let r=zl(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=zl(r)}}function hp(e){e.modified_||(e.modified_=!0,e.parent_&&hp(e.parent_))}function sh(e){e.copy_||(e.copy_=up(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dq=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"&&$n(6),n!==void 0&&typeof n!="function"&&$n(7);let a;if(bi(t)){const i=Wb(this),o=pp(t,void 0);let l=!0;try{a=r(o),l=!1}finally{l?fp(i):mp(i)}return qb(i,n),Ub(a,i)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===OC&&(a=void 0),this.autoFreeze_&&Cg(a,!0),n){const i=[],o=[];wi("Patches").generateReplacementPatches_(t,a,i,o),n(i,o)}return a}else $n(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,a;return[this.produce(t,r,(o,l)=>{n=o,a=l}),n,a]},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){bi(e)||$n(8),ho(e)&&(e=uq(e));const t=Wb(this),r=pp(e,void 0);return r[mn].isManual_=!0,mp(t),r}finishDraft(e,t){const r=e&&e[mn];(!r||!r.isManual_)&&$n(9);const{scope_:n}=r;return qb(n,t),Ub(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 a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=wi("Patches").applyPatches_;return ho(e)?n(e,t):this.produce(e,a=>n(a,t))}};function pp(e,t){const r=kc(e)?wi("MapSet").proxyMap_(e,t):Wf(e)?wi("MapSet").proxySet_(e,t):lq(e,t);return(t?t.scope_:DC()).drafts_.push(r),r}function uq(e){return ho(e)||$n(10,e),IC(e)}function IC(e){if(!bi(e)||Uf(e))return e;const t=e[mn];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=up(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=up(e,!0);return ou(r,(a,i)=>{AC(r,a,IC(i))},n),t&&(t.finalized_=!1),r}var fq=new dq;fq.produce;var mq={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},RC=Jr({name:"legend",initialState:mq,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:yt()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,a=qn(e).payload.indexOf(r);a>-1&&(e.payload[a]=n)},prepare:yt()},removeLegendPayload:{reducer(e,t){var r=qn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:yt()}}}),{setLegendSize:Ure,setLegendSettings:Hre,addLegendPayload:hq,replaceLegendPayload:pq,removeLegendPayload:xq}=RC.actions,gq=RC.reducer;function xp(){return xp=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},xp.apply(null,arguments)}function Kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ul(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(r),!0).forEach(function(n){vq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vq(e,t,r){return(t=yq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yq(e){var t=bq(e,"string");return typeof t=="symbol"?t:t+""}function bq(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 wq(e){return Array.isArray(e)&&hs(e[0])&&hs(e[1])?e.join(" ~ "):e}var Fi={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},jq=e=>{var{separator:t=Fi.separator,contentStyle:r,itemStyle:n,labelStyle:a=Fi.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=Fi.accessibilityLayer}=e,p=()=>{if(i&&i.length){var k={padding:0,margin:0},j=(l?_f(i,l):i).map((C,P)=>{if(C.type==="none")return null;var S=C.formatter||o||wq,{value:_,name:M}=C,E=_,A=M;if(S){var D=S(_,M,C,P,i);if(Array.isArray(D))[E,A]=D;else if(D!=null)E=D;else return null}var Z=ul(ul({},Fi.itemStyle),{},{color:C.color||Fi.itemStyle.color},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(P),style:Z},hs(A)?h.createElement("span",{className:"recharts-tooltip-item-name"},A):null,hs(A)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},E),h.createElement("span",{className:"recharts-tooltip-item-unit"},C.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:k},j)}return null},x=ul(ul({},Fi.contentStyle),r),g=ul({margin:0},a),v=!Ft(u),y=v?u:"",b=lt("recharts-default-tooltip",c),N=lt("recharts-tooltip-label",d);v&&f&&i!==void 0&&i!==null&&(y=f(u,i));var w=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",xp({className:b,style:x},w),h.createElement("p",{className:N,style:g},h.isValidElement(y)?y:"".concat(y)),p())},fl="recharts-tooltip-wrapper",Nq={visibility:"hidden"};function kq(e){var{coordinate:t,translateX:r,translateY:n}=e;return lt(fl,{["".concat(fl,"-right")]:Ce(r)&&t&&Ce(t.x)&&r>=t.x,["".concat(fl,"-left")]:Ce(r)&&t&&Ce(t.x)&&r<t.x,["".concat(fl,"-bottom")]:Ce(n)&&t&&Ce(t.y)&&n>=t.y,["".concat(fl,"-top")]:Ce(n)&&t&&Ce(t.y)&&n<t.y})}function Yb(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:a,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&Ce(i[n]))return i[n];var u=r[n]-l-(a>0?a:0),f=r[n]+a;if(t[n])return o[n]?u:f;var m=c[n];if(m==null)return 0;if(o[n]){var p=u,x=m;return p<x?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var g=f+l,v=m+d;return g>v?Math.max(u,m):Math.max(f,m)}function Sq(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 Cq(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:a,position:i,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,u,f,m;return l.height>0&&l.width>0&&r?(f=Yb({allowEscapeViewBox:t,coordinate:r,key:"x",offset:a,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=Yb({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=Sq({translateX:f,translateY:m,useTranslate3d:c})):u=Nq,{cssProperties:u,cssClasses:kq({translateX:f,translateY:m,coordinate:r})}}function Gb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function id(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gb(Object(r),!0).forEach(function(n){gp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gp(e,t,r){return(t=_q(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _q(e){var t=Pq(e,"string");return typeof t=="symbol"?t:t+""}function Pq(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 Mq extends h.PureComponent{constructor(){super(...arguments),gp(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),gp(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,a,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:(a=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&a!==void 0?a: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:a,children:i,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:m,viewBox:p,wrapperStyle:x,lastBoundingBox:g,innerRef:v,hasPortalFromProps:y}=this.props,b=typeof d=="number"?d:d.x,N=typeof d=="number"?d:d.y,{cssClasses:w,cssProperties:k}=Cq({allowEscapeViewBox:r,coordinate:o,offsetLeft:b,offsetTop:N,position:u,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:m,viewBox:p}),j=y?{}:id(id({transition:c&&t?"transform ".concat(n,"ms ").concat(a):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),C=id(id({},j),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:w,style:C,ref:v},i)}}var $C=()=>{var e;return(e=Ae(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function vp(){return vp=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},vp.apply(null,arguments)}function Vb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vb(Object(r),!0).forEach(function(n){Oq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oq(e,t,r){return(t=Eq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eq(e){var t=Aq(e,"string");return typeof t=="symbol"?t:t+""}function Aq(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 Qb={curveBasisClosed:fF,curveBasisOpen:mF,curveBasis:uF,curveBumpX:Qz,curveBumpY:Zz,curveLinearClosed:hF,curveLinear:bf,curveMonotoneX:pF,curveMonotoneY:xF,curveNatural:gF,curveStep:vF,curveStepAfter:bF,curveStepBefore:yF},du=e=>Ke(e.x)&&Ke(e.y),Zb=e=>e.base!=null&&du(e.base)&&du(e),ml=e=>e.x,hl=e=>e.y,Dq=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(yc(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Qb["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Qb[r]||bf},Jb={connectNulls:!1,type:"linear"},Tq=e=>{var{type:t=Jb.type,points:r=[],baseLine:n,layout:a,connectNulls:i=Jb.connectNulls}=e,o=Dq(t,a),l=i?r.filter(du):r;if(Array.isArray(n)){var c,d=r.map((x,g)=>Xb(Xb({},x),{},{base:n[g]}));a==="vertical"?c=Zc().y(hl).x1(ml).x0(x=>x.base.x):c=Zc().x(ml).y1(hl).y0(x=>x.base.y);var u=c.defined(Zb).curve(o),f=i?d.filter(Zb):d;return u(f)}var m;a==="vertical"&&Ce(n)?m=Zc().y(hl).x1(ml).x0(n):Ce(n)?m=Zc().x(ml).y1(hl).y0(n):m=XS().x(ml).y(hl);var p=m.defined(du).curve(o);return p(l)},LC=e=>{var{className:t,points:r,path:n,pathRef:a}=e,i=Fo();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?Tq(o):n;return h.createElement("path",vp({},qs(e),FF(e),{className:lt("recharts-curve",t),d:l===null?void 0:l,ref:a}))},Iq=["x","y","top","left","width","height","className"];function yp(){return yp=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},yp.apply(null,arguments)}function e0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Rq(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){$q(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 $q(e,t,r){return(t=Lq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lq(e){var t=zq(e,"string");return typeof t=="symbol"?t:t+""}function zq(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 Fq(e,t){if(e==null)return{};var r,n,a=Bq(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)&&(a[r]=e[r])}return a}function Bq(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 qq=(e,t,r,n,a,i)=>"M".concat(e,",").concat(a,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),Wq=e=>{var{x:t=0,y:r=0,top:n=0,left:a=0,width:i=0,height:o=0,className:l}=e,c=Fq(e,Iq),d=Rq({x:t,y:r,top:n,left:a,width:i,height:o},c);return!Ce(t)||!Ce(r)||!Ce(i)||!Ce(o)||!Ce(n)||!Ce(a)?null:h.createElement("path",yp({},Xr(d),{className:lt("recharts-cross",l),d:qq(t,r,i,o,n,a)}))};function Uq(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function t0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function r0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t0(Object(r),!0).forEach(function(n){Hq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hq(e,t,r){return(t=Kq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kq(e){var t=Yq(e,"string");return typeof t=="symbol"?t:t+""}function Yq(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 Gq=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),zC=(e,t,r)=>e.map(n=>"".concat(Gq(n)," ").concat(t,"ms ").concat(r)).join(","),Vq=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(a=>n.includes(a))),ql=(e,t)=>Object.keys(t).reduce((r,n)=>r0(r0({},r),{},{[n]:e(n,t[n])}),{});function n0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n0(Object(r),!0).forEach(function(n){Xq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xq(e,t,r){return(t=Qq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qq(e){var t=Zq(e,"string");return typeof t=="symbol"?t:t+""}function Zq(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 uu=(e,t,r)=>e+(t-e)*r,bp=e=>{var{from:t,to:r}=e;return t!==r},FC=(e,t,r)=>{var n=ql((a,i)=>{if(bp(i)){var[o,l]=e(i.from,i.to,i.velocity);return Wt(Wt({},i),{},{from:o,velocity:l})}return i},t);return r<1?ql((a,i)=>bp(i)&&n[a]!=null?Wt(Wt({},i),{},{velocity:uu(i.velocity,n[a].velocity,r),from:uu(i.from,n[a].from,r)}):i,t):FC(e,n,r-1)};function Jq(e,t,r,n,a,i){var o,l=n.reduce((m,p)=>Wt(Wt({},m),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>ql((m,p)=>p.from,l),d=()=>!Object.values(l).filter(bp).length,u=null,f=m=>{o||(o=m);var p=m-o,x=p/r.dt;l=FC(r,l,x),a(Wt(Wt(Wt({},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 eW(e,t,r,n,a,i,o){var l=null,c=a.reduce((f,m)=>{var p=e[m],x=t[m];return p==null||x==null?f:Wt(Wt({},f),{},{[m]:[p,x]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,p=ql((g,v)=>uu(...v,r(m)),c);if(i(Wt(Wt(Wt({},e),t),p)),m<1)l=o.setTimeout(u);else{var x=ql((g,v)=>uu(...v,r(1)),c);i(Wt(Wt(Wt({},e),t),x))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const tW=(e,t,r,n,a,i)=>{var o=Vq(e,t);return r==null?()=>(a(Wt(Wt({},e),t)),()=>{}):r.isStepper===!0?Jq(e,t,r,o,a,i):eW(e,t,r,n,o,a,i)};var fu=1e-4,BC=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],qC=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),s0=(e,t)=>r=>{var n=BC(e,t);return qC(n,r)},rW=(e,t)=>r=>{var n=BC(e,t),a=[...n.map((i,o)=>i*o).slice(1),0];return qC(a,r)},nW=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 a=n.map(i=>parseFloat(i));return[a[0],a[1],a[2],a[3]]},sW=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 a=nW(r[0]);if(a)return a}}return r.length===4?r:[0,0,1,1]},aW=(e,t,r,n)=>{var a=s0(e,r),i=s0(t,n),o=rW(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 p=a(f)-u,x=o(f);if(Math.abs(p-u)<fu||x<fu)return i(f);f=l(f-p/x)}return i(f)};return c.isStepper=!1,c},a0=function(){return aW(...sW(...arguments))},iW=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:a=17}=t,i=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*a/1e3,m=c*a/1e3+o;return Math.abs(m-l)<fu&&Math.abs(f)<fu?[l,0]:[m,f]};return i.isStepper=!0,i.dt=a,i},oW=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return a0(e);case"spring":return iW();default:if(e.split("(")[0]==="cubic-bezier")return a0(e)}return typeof e=="function"?e:null};function lW(e){var t,r=()=>null,n=!1,a=null,i=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){a=e.setTimeout(i.bind(null,d),c);return}i(c),a=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,a&&(a(),a=null),i(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class cW{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),a=null,i=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(i),()=>{a!=null&&cancelAnimationFrame(a)}}}function dW(){return lW(new cW)}var uW=h.createContext(dW);function fW(e,t){var r=h.useContext(uW);return h.useMemo(()=>t??r(e),[e,t,r])}var mW=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Hf={isSsr:mW()},hW={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},i0={t:0},ah={t:1};function Pg(e){var t=gn(e,hW),{isActive:r,canBegin:n,duration:a,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!Hf.isSsr:r,f=fW(t.animationId,t.animationManager),[m,p]=h.useState(u?i0:ah),x=h.useRef(null);return h.useEffect(()=>{u||p(ah)},[u]),h.useEffect(()=>{if(!u||!n)return zo;var g=tW(i0,ah,oW(i),a,p,f.getTimeoutController()),v=()=>{x.current=g()};return f.start([c,o,v,a,l]),()=>{f.stop(),x.current&&x.current(),l()}},[u,n,a,i,o,c,l,f]),d(m.t)}function Mg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(Il(t)),n=h.useRef(e);return n.current!==e&&(r.current=Il(t),n.current=e),r.current}var pW=["radius"],xW=["radius"],o0,l0,c0,d0,u0,f0,m0,h0,p0,x0;function g0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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){gW(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 gW(e,t,r){return(t=vW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vW(e){var t=yW(e,"string");return typeof t=="symbol"?t:t+""}function yW(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 mu(){return mu=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},mu.apply(null,arguments)}function y0(e,t){if(e==null)return{};var r,n,a=bW(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)&&(a[r]=e[r])}return a}function bW(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 Zn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var b0=(e,t,r,n,a)=>{var i=ga(r),o=ga(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(a)){for(var m=[0,0,0,0],p=0,x=4;p<x;p++){var g,v=(g=a[p])!==null&&g!==void 0?g:0;m[p]=v>l?l:v}f=Et(o0||(o0=Zn(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Et(l0||(l0=Zn(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=Et(c0||(c0=Zn(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=Et(d0||(d0=Zn(["A ",",",",0,0,",`,
|
|
591
|
-
`,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=Et(u0||(u0=Zn(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=Et(f0||(f0=Zn(["A ",",",",0,0,",`,
|
|
592
|
-
`,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=Et(m0||(m0=Zn(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=Et(h0||(h0=Zn(["A ",",",",0,0,",`,
|
|
593
|
-
`,",",""])),m[3],m[3],u,e,t+n-c*m[3])),f+="Z"}else if(l>0&&a===+a&&a>0){var y=Math.min(l,a);f=Et(p0||(p0=Zn(["M ",",",`
|
|
594
|
-
A `,",",",0,0,",",",",",`
|
|
595
|
-
L `,",",`
|
|
596
|
-
A `,",",",0,0,",",",",",`
|
|
597
|
-
L `,",",`
|
|
598
|
-
A `,",",",0,0,",",",",",`
|
|
599
|
-
L `,",",`
|
|
600
|
-
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=Et(x0||(x0=Zn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},w0={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},WC=e=>{var t=gn(e,w0),r=h.useRef(null),[n,a]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var q=r.current.getTotalLength();q&&a(q)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:p,isAnimationActive:x,isUpdateAnimationActive:g}=t,v=h.useRef(l),y=h.useRef(c),b=h.useRef(i),N=h.useRef(o),w=h.useMemo(()=>({x:i,y:o,width:l,height:c,radius:d}),[i,o,l,c,d]),k=Mg(w,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var j=lt("recharts-rectangle",u);if(!g){var C=Xr(t),{radius:P}=C,S=y0(C,pW);return h.createElement("path",mu({},S,{x:ga(i),y:ga(o),width:ga(l),height:ga(c),radius:typeof d=="number"?d:void 0,className:j,d:b0(i,o,l,c,d)}))}var _=v.current,M=y.current,E=b.current,A=N.current,D="0px ".concat(n===-1?1:n,"px"),Z="".concat(n,"px 0px"),Q=zC(["strokeDasharray"],m,typeof f=="string"?f:w0.animationEasing);return h.createElement(Pg,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:g,begin:p},q=>{var te=ur(_,l,q),ne=ur(M,c,q),I=ur(E,i,q),O=ur(A,o,q);r.current&&(v.current=te,y.current=ne,b.current=I,N.current=O);var L;x?q>0?L={transition:Q,strokeDasharray:Z}:L={strokeDasharray:D}:L={strokeDasharray:Z};var H=Xr(t),{radius:R}=H,Y=y0(H,xW);return h.createElement("path",mu({},Y,{radius:typeof d=="number"?d:void 0,className:j,d:b0(I,O,te,ne,d),ref:r,style:v0(v0({},L),t.style)}))})};function j0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function N0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j0(Object(r),!0).forEach(function(n){wW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wW(e,t,r){return(t=jW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jW(e){var t=NW(e,"string");return typeof t=="symbol"?t:t+""}function NW(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 hu=Math.PI/180,kW=e=>e*180/Math.PI,mr=(e,t,r,n)=>({x:e+Math.cos(-hu*n)*r,y:t+Math.sin(-hu*n)*r}),SW=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},CW=(e,t)=>{var{x:r,y:n}=e,{x:a,y:i}=t;return Math.sqrt((r-a)**2+(n-i)**2)},_W=(e,t)=>{var{x:r,y:n}=e,{cx:a,cy:i}=t,o=CW({x:r,y:n},{x:a,y:i});if(o<=0)return{radius:o,angle:0};var l=(r-a)/o,c=Math.acos(l);return n>i&&(c=2*Math.PI-c),{radius:o,angle:kW(c),angleInRadian:c}},PW=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),a=Math.floor(r/360),i=Math.min(n,a);return{startAngle:t-i*360,endAngle:r-i*360}},MW=(e,t)=>{var{startAngle:r,endAngle:n}=t,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return e+o*360},OW=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:a,angle:i}=_W({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(a<o||a>l||a===0)return null;var{startAngle:c,endAngle:d}=PW(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?N0(N0({},t),{},{radius:a,angle:MW(u,t)}):null};function UC(e){var{cx:t,cy:r,radius:n,startAngle:a,endAngle:i}=e,o=mr(t,r,n,a),l=mr(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}var k0,S0,C0,_0,P0,M0,O0;function wp(){return wp=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},wp.apply(null,arguments)}function ni(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var EW=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},od=e=>{var{cx:t,cy:r,radius:n,angle:a,sign:i,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/hu,f=c?a:a+i*u,m=mr(t,r,d,f),p=mr(t,r,n,f),x=c?a-i*u:a,g=mr(t,r,d*Math.cos(u*hu),x);return{center:m,circleTangency:p,lineTangency:g,theta:u}},HC=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:a,startAngle:i,endAngle:o}=e,l=EW(i,o),c=i+l,d=mr(t,r,a,i),u=mr(t,r,a,c),f=Et(k0||(k0=ni(["M ",",",`
|
|
601
|
-
A `,",",`,0,
|
|
602
|
-
`,",",`,
|
|
603
|
-
`,",",`
|
|
604
|
-
`])),d.x,d.y,a,a,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=mr(t,r,n,i),p=mr(t,r,n,c);f+=Et(S0||(S0=ni(["L ",",",`
|
|
605
|
-
A `,",",`,0,
|
|
606
|
-
`,",",`,
|
|
607
|
-
`,","," Z"])),p.x,p.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=Et(C0||(C0=ni(["L ",","," Z"])),t,r);return f},AW=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:a,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Wr(d-c),{circleTangency:f,lineTangency:m,theta:p}=od({cx:t,cy:r,radius:a,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:v}=od({cx:t,cy:r,radius:a,angle:d,sign:-u,cornerRadius:i,cornerIsExternal:l}),y=l?Math.abs(c-d):Math.abs(c-d)-p-v;if(y<0)return o?Et(_0||(_0=ni(["M ",",",`
|
|
608
|
-
a`,",",",0,0,1,",`,0
|
|
609
|
-
a`,",",",0,0,1,",`,0
|
|
610
|
-
`])),m.x,m.y,i,i,i*2,i,i,-i*2):HC({cx:t,cy:r,innerRadius:n,outerRadius:a,startAngle:c,endAngle:d});var b=Et(P0||(P0=ni(["M ",",",`
|
|
611
|
-
A`,",",",0,0,",",",",",`
|
|
612
|
-
A`,",",",0,",",",",",",",`
|
|
613
|
-
A`,",",",0,0,",",",",",`
|
|
614
|
-
`])),m.x,m.y,i,i,+(u<0),f.x,f.y,a,a,+(y>180),+(u<0),x.x,x.y,i,i,+(u<0),g.x,g.y);if(n>0){var{circleTangency:N,lineTangency:w,theta:k}=od({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:j,lineTangency:C,theta:P}=od({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),S=l?Math.abs(c-d):Math.abs(c-d)-k-P;if(S<0&&i===0)return"".concat(b,"L").concat(t,",").concat(r,"Z");b+=Et(M0||(M0=ni(["L",",",`
|
|
615
|
-
A`,",",",0,0,",",",",",`
|
|
616
|
-
A`,",",",0,",",",",",",",`
|
|
617
|
-
A`,",",",0,0,",",",",","Z"])),C.x,C.y,i,i,+(u<0),j.x,j.y,n,n,+(S>180),+(u>0),N.x,N.y,i,i,+(u<0),w.x,w.y)}else b+=Et(O0||(O0=ni(["L",",","Z"])),t,r);return b},DW={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},KC=e=>{var t=gn(e,DW),{cx:r,cy:n,innerRadius:a,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(i<a||d===u)return null;var m=lt("recharts-sector",f),p=i-a,x=Un(o,p,0,!0),g;return x>0&&Math.abs(d-u)<360?g=AW({cx:r,cy:n,innerRadius:a,outerRadius:i,cornerRadius:Math.min(x,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=HC({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:d,endAngle:u}),h.createElement("path",wp({},Xr(t),{className:m,d:g}))};function TW(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(m2(t)){if(e==="centric"){var{cx:n,cy:a,innerRadius:i,outerRadius:o,angle:l}=t,c=mr(n,a,i,l),d=mr(n,a,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return UC(t)}}var YC={},GC={},VC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pg;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(VC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VC;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})(GC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xg,r=GC;function n(a,i,o){o&&typeof o!="number"&&t.isIterateeCall(a,i,o)&&(i=o=void 0),a=r.toFinite(a),i===void 0?(i=a,a=0):i=r.toFinite(i),o=o===void 0?a<i?1:-1:r.toFinite(o);const l=Math.max(Math.ceil((i-a)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=a,a+=o;return c}e.range=n})(YC);var IW=YC.range;const XC=Qs(IW);function Pa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function RW(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Og(e){let t,r,n;e.length!==2?(t=Pa,r=(l,c)=>Pa(e(l),c),n=(l,c)=>e(l)-c):(t=e===Pa||e===RW?e:$W,r=e,n=e);function a(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=a(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function $W(){return 0}function QC(e){return e===null?NaN:+e}function*LW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const zW=Og(Pa),Sc=zW.right;Og(QC).center;class E0 extends Map{constructor(t,r=qW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(A0(this,t))}has(t){return super.has(A0(this,t))}set(t,r){return super.set(FW(this,t),r)}delete(t){return super.delete(BW(this,t))}}function A0({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function FW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function BW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function qW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function WW(e=Pa){if(e===Pa)return ZC;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 ZC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const UW=Math.sqrt(50),HW=Math.sqrt(10),KW=Math.sqrt(2);function pu(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=UW?10:i>=HW?5:i>=KW?2:1;let l,c,d;return a<0?(d=Math.pow(10,-a)/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,a)*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?pu(e,t,r*2):[l,c,d]}function jp(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,o]=n?pu(t,e,r):pu(e,t,r);if(!(i>=a))return[];const l=i-a+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]=(a+d)/-o;else for(let d=0;d<l;++d)c[d]=(a+d)*o;return c}function Np(e,t,r){return t=+t,e=+e,r=+r,pu(e,t,r)[2]}function kp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Np(t,e,r):Np(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function D0(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function T0(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function JC(e,t,r=0,n=1/0,a){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(a=a===void 0?ZC:WW(a);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),p=Math.max(r,Math.floor(t-d*f/c+m)),x=Math.min(n,Math.floor(t+(c-d)*f/c+m));JC(e,t,p,x,a)}const i=e[t];let o=r,l=n;for(pl(e,r,t),a(e[n],i)>0&&pl(e,r,n);o<l;){for(pl(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?pl(e,r,l):(++l,pl(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function pl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function YW(e,t,r){if(e=Float64Array.from(LW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return T0(e);if(t>=1)return D0(e);var n,a=(n-1)*t,i=Math.floor(a),o=D0(JC(e,i).subarray(0,i+1)),l=T0(e.subarray(i+1));return o+(l-o)*(a-i)}}function GW(e,t,r=QC){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,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function VW(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function On(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function aa(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 Sp=Symbol("implicit");function Eg(){var e=new E0,t=[],r=[],n=Sp;function a(i){let o=e.get(i);if(o===void 0){if(n!==Sp)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new E0;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return Eg(t,r).unknown(n)},On.apply(a,arguments),a}function Ag(){var e=Eg().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var m=t().length,p=a<n,x=p?a:n,g=p?n:a;i=(g-x)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),x+=(g-x-i*(m-c))*u,o=i*(1-c),l&&(x=Math.round(x),o=Math.round(o));var v=VW(m).map(function(y){return x+i*y});return r(p?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,a]=m,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(m){return[n,a]=m,n=+n,a=+a,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 Ag(t(),[n,a]).round(l).paddingInner(c).paddingOuter(d).align(u)},On.apply(f(),arguments)}function e_(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return e_(t())},e}function XW(){return e_(Ag.apply(null,arguments).paddingInner(1))}function Dg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function t_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Cc(){}var Wl=.7,xu=1/Wl,eo="\\s*([+-]?\\d+)\\s*",Ul="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",QW=/^#([0-9a-f]{3,8})$/,ZW=new RegExp(`^rgb\\(${eo},${eo},${eo}\\)$`),JW=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),e7=new RegExp(`^rgba\\(${eo},${eo},${eo},${Ul}\\)$`),t7=new RegExp(`^rgba\\(${ds},${ds},${ds},${Ul}\\)$`),r7=new RegExp(`^hsl\\(${Ul},${ds},${ds}\\)$`),n7=new RegExp(`^hsla\\(${Ul},${ds},${ds},${Ul}\\)$`),I0={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};Dg(Cc,Hl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:R0,formatHex:R0,formatHex8:s7,formatHsl:a7,formatRgb:$0,toString:$0});function R0(){return this.rgb().formatHex()}function s7(){return this.rgb().formatHex8()}function a7(){return r_(this).formatHsl()}function $0(){return this.rgb().formatRgb()}function Hl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=QW.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?L0(t):r===3?new Hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ld(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ld(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=ZW.exec(e))?new Hr(t[1],t[2],t[3],1):(t=JW.exec(e))?new Hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e7.exec(e))?ld(t[1],t[2],t[3],t[4]):(t=t7.exec(e))?ld(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=r7.exec(e))?B0(t[1],t[2]/100,t[3]/100,1):(t=n7.exec(e))?B0(t[1],t[2]/100,t[3]/100,t[4]):I0.hasOwnProperty(e)?L0(I0[e]):e==="transparent"?new Hr(NaN,NaN,NaN,0):null}function L0(e){return new Hr(e>>16&255,e>>8&255,e&255,1)}function ld(e,t,r,n){return n<=0&&(e=t=r=NaN),new Hr(e,t,r,n)}function i7(e){return e instanceof Cc||(e=Hl(e)),e?(e=e.rgb(),new Hr(e.r,e.g,e.b,e.opacity)):new Hr}function Cp(e,t,r,n){return arguments.length===1?i7(e):new Hr(e,t,r,n??1)}function Hr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Dg(Hr,Cp,t_(Cc,{brighter(e){return e=e==null?xu:Math.pow(xu,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hr(ci(this.r),ci(this.g),ci(this.b),gu(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:z0,formatHex:z0,formatHex8:o7,formatRgb:F0,toString:F0}));function z0(){return`#${si(this.r)}${si(this.g)}${si(this.b)}`}function o7(){return`#${si(this.r)}${si(this.g)}${si(this.b)}${si((isNaN(this.opacity)?1:this.opacity)*255)}`}function F0(){const e=gu(this.opacity);return`${e===1?"rgb(":"rgba("}${ci(this.r)}, ${ci(this.g)}, ${ci(this.b)}${e===1?")":`, ${e})`}`}function gu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ci(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function si(e){return e=ci(e),(e<16?"0":"")+e.toString(16)}function B0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ln(e,t,r,n)}function r_(e){if(e instanceof Ln)return new Ln(e.h,e.s,e.l,e.opacity);if(e instanceof Cc||(e=Hl(e)),!e)return new Ln;if(e instanceof Ln)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-a,c=(i+a)/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+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new Ln(o,l,c,e.opacity)}function l7(e,t,r,n){return arguments.length===1?r_(e):new Ln(e,t,r,n??1)}function Ln(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Dg(Ln,l7,t_(Cc,{brighter(e){return e=e==null?xu:Math.pow(xu,e),new Ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new Ln(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,a=2*r-n;return new Hr(ih(e>=240?e-240:e+120,a,n),ih(e,a,n),ih(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Ln(q0(this.h),cd(this.s),cd(this.l),gu(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=gu(this.opacity);return`${e===1?"hsl(":"hsla("}${q0(this.h)}, ${cd(this.s)*100}%, ${cd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function q0(e){return e=(e||0)%360,e<0?e+360:e}function cd(e){return Math.max(0,Math.min(1,e||0))}function ih(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 Tg=e=>()=>e;function c7(e,t){return function(r){return e+r*t}}function d7(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 u7(e){return(e=+e)==1?n_:function(t,r){return r-t?d7(t,r,e):Tg(isNaN(t)?r:t)}}function n_(e,t){var r=t-e;return r?c7(e,r):Tg(isNaN(e)?t:e)}const W0=function e(t){var r=u7(t);function n(a,i){var o=r((a=Cp(a)).r,(i=Cp(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),d=n_(a.opacity,i.opacity);return function(u){return a.r=o(u),a.g=l(u),a.b=c(u),a.opacity=d(u),a+""}}return n.gamma=e,n}(1);function f7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function m7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h7(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=Bo(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function p7(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function vu(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function x7(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=Bo(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var _p=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,oh=new RegExp(_p.source,"g");function g7(e){return function(){return e}}function v7(e){return function(t){return e(t)+""}}function y7(e,t){var r=_p.lastIndex=oh.lastIndex=0,n,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=_p.exec(e))&&(a=oh.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:vu(n,a)})),r=oh.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?v7(c[0].x):g7(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 Bo(e,t){var r=typeof t,n;return t==null||r==="boolean"?Tg(t):(r==="number"?vu:r==="string"?(n=Hl(t))?(t=n,W0):y7:t instanceof Hl?W0:t instanceof Date?p7:m7(t)?f7:Array.isArray(t)?h7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?x7:vu)(e,t)}function Ig(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function b7(e,t){t===void 0&&(t=e,e=Bo);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function w7(e){return function(){return e}}function yu(e){return+e}var U0=[0,1];function Pr(e){return e}function Pp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:w7(isNaN(t)?NaN:.5)}function j7(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function N7(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a<n?(n=Pp(a,n),i=r(o,i)):(n=Pp(n,a),i=r(i,o)),function(l){return i(n(l))}}function k7(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)a[o]=Pp(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=Sc(e,l,1,n)-1;return i[c](a[c](l))}}function _c(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kf(){var e=U0,t=U0,r=Bo,n,a,i,o=Pr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==Pr&&(o=j7(e[0],e[m-1])),l=m>2?k7:N7,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(a((d||(d=l(t,e.map(n),vu)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,yu),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=Ig,u()},f.clamp=function(m){return arguments.length?(o=m?!0:Pr,u()):o!==Pr},f.interpolate=function(m){return arguments.length?(r=m,u()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,p){return n=m,a=p,u()}}function Rg(){return Kf()(Pr,Pr)}function S7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function bu(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 po(e){return e=bu(Math.abs(e)),e?e[1]:NaN}function C7(e,t){return function(r,n){for(var a=r.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function _7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var P7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kl(e){if(!(t=P7.exec(e)))throw new Error("invalid format: "+e);var t;return new $g({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]})}Kl.prototype=$g.prototype;function $g(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+""}$g.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 M7(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var wu;function O7(e,t){var r=bu(e,t);if(!r)return wu=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(wu=Math.max(-8,Math.min(8,Math.floor(a/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")+bu(e,Math.max(0,t+i-1))[0]}function H0(e,t){var r=bu(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const K0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:S7,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)=>H0(e*100,t),r:H0,s:O7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Y0(e){return e}var G0=Array.prototype.map,V0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function E7(e){var t=e.grouping===void 0||e.thousands===void 0?Y0:C7(G0.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Y0:_7(G0.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=Kl(f);var p=f.fill,x=f.align,g=f.sign,v=f.symbol,y=f.zero,b=f.width,N=f.comma,w=f.precision,k=f.trim,j=f.type;j==="n"?(N=!0,j="g"):K0[j]||(w===void 0&&(w=12),k=!0,j="g"),(y||p==="0"&&x==="=")&&(y=!0,p="0",x="=");var C=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(v==="$"?n:/[%p]/.test(j)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),S=K0[j],_=/[defgprs%]/.test(j);w=w===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function M(E){var A=C,D=P,Z,Q,q;if(j==="c")D=S(E)+D,E="";else{E=+E;var te=E<0||1/E<0;if(E=isNaN(E)?c:S(Math.abs(E),w),k&&(E=M7(E)),te&&+E==0&&g!=="+"&&(te=!1),A=(te?g==="("?g:l:g==="-"||g==="("?"":g)+A,D=(j==="s"&&!isNaN(E)&&wu!==void 0?V0[8+wu/3]:"")+D+(te&&g==="("?")":""),_){for(Z=-1,Q=E.length;++Z<Q;)if(q=E.charCodeAt(Z),48>q||q>57){D=(q===46?a+E.slice(Z+1):E.slice(Z))+D,E=E.slice(0,Z);break}}}N&&!y&&(E=t(E,1/0));var ne=A.length+E.length+D.length,I=ne<b?new Array(b-ne+1).join(p):"";switch(N&&y&&(E=t(I+E,I.length?b-D.length:1/0),I=""),x){case"<":E=A+E+D+I;break;case"=":E=A+I+E+D;break;case"^":E=I.slice(0,ne=I.length>>1)+A+E+D+I.slice(ne);break;default:E=I+A+E+D;break}return i(E)}return M.toString=function(){return f+""},M}function u(f,m){var p=Math.max(-8,Math.min(8,Math.floor(po(m)/3)))*3,x=Math.pow(10,-p),g=d((f=Kl(f),f.type="f",f),{suffix:V0[8+p/3]});return function(v){return g(x*v)}}return{format:d,formatPrefix:u}}var dd,Lg,s_;A7({thousands:",",grouping:[3],currency:["$",""]});function A7(e){return dd=E7(e),Lg=dd.format,s_=dd.formatPrefix,dd}function D7(e){return Math.max(0,-po(Math.abs(e)))}function T7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(po(t)/3)))*3-po(Math.abs(e)))}function I7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,po(t)-po(e))+1}function a_(e,t,r,n){var a=kp(e,t,r),i;switch(n=Kl(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=T7(a,o))&&(n.precision=i),s_(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=I7(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=D7(a))&&(n.precision=i-(n.type==="%")*2);break}}return Lg(n)}function za(e){var t=e.domain;return e.ticks=function(r){var n=t();return jp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return a_(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],l=n[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=a,a=i,i=d);u-- >0;){if(d=Np(o,l,r),d===c)return n[a]=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 i_(){var e=Rg();return e.copy=function(){return _c(e,i_())},On.apply(e,arguments),za(e)}function o_(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,yu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return o_(e).unknown(t)},e=arguments.length?Array.from(e,yu):[0,1],za(r)}function l_(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),e[r]=t.floor(a),e[n]=t.ceil(i),e}function X0(e){return Math.log(e)}function Q0(e){return Math.exp(e)}function R7(e){return-Math.log(-e)}function $7(e){return-Math.exp(-e)}function L7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function z7(e){return e===10?L7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function F7(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 Z0(e){return(t,r)=>-e(-t,r)}function zg(e){const t=e(X0,Q0),r=t.domain;let n=10,a,i;function o(){return a=F7(n),i=z7(n),r()[0]<0?(a=Z0(a),i=Z0(i),e(R7,$7)):e(X0,Q0),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=a(d),p=a(u),x,g;const v=l==null?10:+l;let y=[];if(!(n%1)&&p-m<v){if(m=Math.floor(m),p=Math.ceil(p),d>0){for(;m<=p;++m)for(x=1;x<n;++x)if(g=m<0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}}else for(;m<=p;++m)for(x=n-1;x>=1;--x)if(g=m>0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}y.length*2<v&&(y=jp(d,u,v))}else y=jp(m,p,Math.min(p-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=Kl(c)).precision==null&&(c.trim=!0),c=Lg(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/i(Math.round(a(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(l_(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function c_(){const e=zg(Kf()).domain([1,10]);return e.copy=()=>_c(e,c_()).base(e.base()),On.apply(e,arguments),e}function J0(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function ew(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Fg(e){var t=1,r=e(J0(t),ew(t));return r.constant=function(n){return arguments.length?e(J0(t=+n),ew(t)):t},za(r)}function d_(){var e=Fg(Kf());return e.copy=function(){return _c(e,d_()).constant(e.constant())},On.apply(e,arguments)}function tw(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function B7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function q7(e){return e<0?-e*e:e*e}function Bg(e){var t=e(Pr,Pr),r=1;function n(){return r===1?e(Pr,Pr):r===.5?e(B7,q7):e(tw(r),tw(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},za(t)}function qg(){var e=Bg(Kf());return e.copy=function(){return _c(e,qg()).exponent(e.exponent())},On.apply(e,arguments),e}function W7(){return qg.apply(null,arguments).exponent(.5)}function rw(e){return Math.sign(e)*e*e}function U7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function u_(){var e=Rg(),t=[0,1],r=!1,n;function a(i){var o=U7(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(rw(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,yu)).map(rw)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return u_(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},On.apply(a,arguments),za(a)}function f_(){var e=[],t=[],r=[],n;function a(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=GW(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[Sc(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(Pa),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return f_().domain(e).range(t).unknown(n)},On.apply(i,arguments)}function m_(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[Sc(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=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var d=a.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 m_().domain([e,t]).range(a).unknown(i)},On.apply(za(o),arguments)}function h_(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Sc(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return h_().domain(e).range(t).unknown(r)},On.apply(a,arguments)}const lh=new Date,ch=new Date;function Kt(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.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},a.filter=i=>Kt(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&&(a.count=(i,o)=>(lh.setTime(+i),ch.setTime(+o),e(lh),e(ch),Math.floor(r(lh,ch))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const ju=Kt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ju.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ju);ju.range;const Es=1e3,Nn=Es*60,As=Nn*60,Hs=As*24,Wg=Hs*7,nw=Hs*30,dh=Hs*365,ai=Kt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getUTCSeconds());ai.range;const Ug=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Es)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getMinutes());Ug.range;const Hg=Kt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Nn)},(e,t)=>(t-e)/Nn,e=>e.getUTCMinutes());Hg.range;const Kg=Kt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Es-e.getMinutes()*Nn)},(e,t)=>{e.setTime(+e+t*As)},(e,t)=>(t-e)/As,e=>e.getHours());Kg.range;const Yg=Kt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*As)},(e,t)=>(t-e)/As,e=>e.getUTCHours());Yg.range;const Pc=Kt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Nn)/Hs,e=>e.getDate()-1);Pc.range;const Yf=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hs,e=>e.getUTCDate()-1);Yf.range;const p_=Kt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hs,e=>Math.floor(e/Hs));p_.range;function Ai(e){return Kt(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)/Wg)}const Gf=Ai(0),Nu=Ai(1),H7=Ai(2),K7=Ai(3),xo=Ai(4),Y7=Ai(5),G7=Ai(6);Gf.range;Nu.range;H7.range;K7.range;xo.range;Y7.range;G7.range;function Di(e){return Kt(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)/Wg)}const Vf=Di(0),ku=Di(1),V7=Di(2),X7=Di(3),go=Di(4),Q7=Di(5),Z7=Di(6);Vf.range;ku.range;V7.range;X7.range;go.range;Q7.range;Z7.range;const Gg=Kt(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());Gg.range;const Vg=Kt(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());Vg.range;const Ks=Kt(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());Ks.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(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)});Ks.range;const Ys=Kt(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());Ys.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kt(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)});Ys.range;function x_(e,t,r,n,a,i){const o=[[ai,1,Es],[ai,5,5*Es],[ai,15,15*Es],[ai,30,30*Es],[i,1,Nn],[i,5,5*Nn],[i,15,15*Nn],[i,30,30*Nn],[a,1,As],[a,3,3*As],[a,6,6*As],[a,12,12*As],[n,1,Hs],[n,2,2*Hs],[r,1,Wg],[t,1,nw],[t,3,3*nw],[e,1,dh]];function l(d,u,f){const m=u<d;m&&([d,u]=[u,d]);const p=f&&typeof f.range=="function"?f:c(d,u,f),x=p?p.range(d,+u+1):[];return m?x.reverse():x}function c(d,u,f){const m=Math.abs(u-d)/f,p=Og(([,,v])=>v).right(o,m);if(p===o.length)return e.every(kp(d/dh,u/dh,f));if(p===0)return ju.every(Math.max(kp(d,u,f),1));const[x,g]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return x.every(g)}return[l,c]}const[J7,e9]=x_(Ys,Vg,Vf,p_,Yg,Hg),[t9,r9]=x_(Ks,Gg,Gf,Pc,Kg,Ug);function uh(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 fh(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 xl(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function n9(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=gl(a),u=vl(a),f=gl(i),m=vl(i),p=gl(o),x=vl(o),g=gl(l),v=vl(l),y=gl(c),b=vl(c),N={a:q,A:te,b:ne,B:I,c:null,d:cw,e:cw,f:C9,g:R9,G:L9,H:N9,I:k9,j:S9,L:g_,m:_9,M:P9,p:O,q:L,Q:fw,s:mw,S:M9,u:O9,U:E9,V:A9,w:D9,W:T9,x:null,X:null,y:I9,Y:$9,Z:z9,"%":uw},w={a:H,A:R,b:Y,B:F,c:null,d:dw,e:dw,f:W9,g:J9,G:tU,H:F9,I:B9,j:q9,L:y_,m:U9,M:H9,p:T,q:G,Q:fw,s:mw,S:K9,u:Y9,U:G9,V:V9,w:X9,W:Q9,x:null,X:null,y:Z9,Y:eU,Z:rU,"%":uw},k={a:_,A:M,b:E,B:A,c:D,d:ow,e:ow,f:y9,g:iw,G:aw,H:lw,I:lw,j:p9,L:v9,m:h9,M:x9,p:S,q:m9,Q:w9,s:j9,S:g9,u:l9,U:c9,V:d9,w:o9,W:u9,x:Z,X:Q,y:iw,Y:aw,Z:f9,"%":b9};N.x=j(r,N),N.X=j(n,N),N.c=j(t,N),w.x=j(r,w),w.X=j(n,w),w.c=j(t,w);function j(z,se){return function(W){var X=[],ie=-1,V=0,J=z.length,ue,de,ee;for(W instanceof Date||(W=new Date(+W));++ie<J;)z.charCodeAt(ie)===37&&(X.push(z.slice(V,ie)),(de=sw[ue=z.charAt(++ie)])!=null?ue=z.charAt(++ie):de=ue==="e"?" ":"0",(ee=se[ue])&&(ue=ee(W,de)),X.push(ue),V=ie+1);return X.push(z.slice(V,ie)),X.join("")}}function C(z,se){return function(W){var X=xl(1900,void 0,1),ie=P(X,z,W+="",0),V,J;if(ie!=W.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(se&&!("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?(V=fh(xl(X.y,0,1)),J=V.getUTCDay(),V=J>4||J===0?ku.ceil(V):ku(V),V=Yf.offset(V,(X.V-1)*7),X.y=V.getUTCFullYear(),X.m=V.getUTCMonth(),X.d=V.getUTCDate()+(X.w+6)%7):(V=uh(xl(X.y,0,1)),J=V.getDay(),V=J>4||J===0?Nu.ceil(V):Nu(V),V=Pc.offset(V,(X.V-1)*7),X.y=V.getFullYear(),X.m=V.getMonth(),X.d=V.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),J="Z"in X?fh(xl(X.y,0,1)).getUTCDay():uh(xl(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(J+5)%7:X.w+X.U*7-(J+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,fh(X)):uh(X)}}function P(z,se,W,X){for(var ie=0,V=se.length,J=W.length,ue,de;ie<V;){if(X>=J)return-1;if(ue=se.charCodeAt(ie++),ue===37){if(ue=se.charAt(ie++),de=k[ue in sw?se.charAt(ie++):ue],!de||(X=de(z,W,X))<0)return-1}else if(ue!=W.charCodeAt(X++))return-1}return X}function S(z,se,W){var X=d.exec(se.slice(W));return X?(z.p=u.get(X[0].toLowerCase()),W+X[0].length):-1}function _(z,se,W){var X=p.exec(se.slice(W));return X?(z.w=x.get(X[0].toLowerCase()),W+X[0].length):-1}function M(z,se,W){var X=f.exec(se.slice(W));return X?(z.w=m.get(X[0].toLowerCase()),W+X[0].length):-1}function E(z,se,W){var X=y.exec(se.slice(W));return X?(z.m=b.get(X[0].toLowerCase()),W+X[0].length):-1}function A(z,se,W){var X=g.exec(se.slice(W));return X?(z.m=v.get(X[0].toLowerCase()),W+X[0].length):-1}function D(z,se,W){return P(z,t,se,W)}function Z(z,se,W){return P(z,r,se,W)}function Q(z,se,W){return P(z,n,se,W)}function q(z){return o[z.getDay()]}function te(z){return i[z.getDay()]}function ne(z){return c[z.getMonth()]}function I(z){return l[z.getMonth()]}function O(z){return a[+(z.getHours()>=12)]}function L(z){return 1+~~(z.getMonth()/3)}function H(z){return o[z.getUTCDay()]}function R(z){return i[z.getUTCDay()]}function Y(z){return c[z.getUTCMonth()]}function F(z){return l[z.getUTCMonth()]}function T(z){return a[+(z.getUTCHours()>=12)]}function G(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var se=j(z+="",N);return se.toString=function(){return z},se},parse:function(z){var se=C(z+="",!1);return se.toString=function(){return z},se},utcFormat:function(z){var se=j(z+="",w);return se.toString=function(){return z},se},utcParse:function(z){var se=C(z+="",!0);return se.toString=function(){return z},se}}}var sw={"-":"",_:" ",0:"0"},er=/^\s*\d+/,s9=/^%/,a9=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function i9(e){return e.replace(a9,"\\$&")}function gl(e){return new RegExp("^(?:"+e.map(i9).join("|")+")","i")}function vl(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function o9(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function l9(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function c9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function d9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function u9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function aw(e,t,r){var n=er.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function iw(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function f9(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 m9(e,t,r){var n=er.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function h9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function ow(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function p9(e,t,r){var n=er.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function lw(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function x9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function g9(e,t,r){var n=er.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function v9(e,t,r){var n=er.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function y9(e,t,r){var n=er.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function b9(e,t,r){var n=s9.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function w9(e,t,r){var n=er.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function j9(e,t,r){var n=er.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function cw(e,t){return Qe(e.getDate(),t,2)}function N9(e,t){return Qe(e.getHours(),t,2)}function k9(e,t){return Qe(e.getHours()%12||12,t,2)}function S9(e,t){return Qe(1+Pc.count(Ks(e),e),t,3)}function g_(e,t){return Qe(e.getMilliseconds(),t,3)}function C9(e,t){return g_(e,t)+"000"}function _9(e,t){return Qe(e.getMonth()+1,t,2)}function P9(e,t){return Qe(e.getMinutes(),t,2)}function M9(e,t){return Qe(e.getSeconds(),t,2)}function O9(e){var t=e.getDay();return t===0?7:t}function E9(e,t){return Qe(Gf.count(Ks(e)-1,e),t,2)}function v_(e){var t=e.getDay();return t>=4||t===0?xo(e):xo.ceil(e)}function A9(e,t){return e=v_(e),Qe(xo.count(Ks(e),e)+(Ks(e).getDay()===4),t,2)}function D9(e){return e.getDay()}function T9(e,t){return Qe(Nu.count(Ks(e)-1,e),t,2)}function I9(e,t){return Qe(e.getFullYear()%100,t,2)}function R9(e,t){return e=v_(e),Qe(e.getFullYear()%100,t,2)}function $9(e,t){return Qe(e.getFullYear()%1e4,t,4)}function L9(e,t){var r=e.getDay();return e=r>=4||r===0?xo(e):xo.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function z9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function dw(e,t){return Qe(e.getUTCDate(),t,2)}function F9(e,t){return Qe(e.getUTCHours(),t,2)}function B9(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function q9(e,t){return Qe(1+Yf.count(Ys(e),e),t,3)}function y_(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function W9(e,t){return y_(e,t)+"000"}function U9(e,t){return Qe(e.getUTCMonth()+1,t,2)}function H9(e,t){return Qe(e.getUTCMinutes(),t,2)}function K9(e,t){return Qe(e.getUTCSeconds(),t,2)}function Y9(e){var t=e.getUTCDay();return t===0?7:t}function G9(e,t){return Qe(Vf.count(Ys(e)-1,e),t,2)}function b_(e){var t=e.getUTCDay();return t>=4||t===0?go(e):go.ceil(e)}function V9(e,t){return e=b_(e),Qe(go.count(Ys(e),e)+(Ys(e).getUTCDay()===4),t,2)}function X9(e){return e.getUTCDay()}function Q9(e,t){return Qe(ku.count(Ys(e)-1,e),t,2)}function Z9(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function J9(e,t){return e=b_(e),Qe(e.getUTCFullYear()%100,t,2)}function eU(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function tU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?go(e):go.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function rU(){return"+0000"}function uw(){return"%"}function fw(e){return+e}function mw(e){return Math.floor(+e/1e3)}var Bi,w_,j_;nU({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 nU(e){return Bi=n9(e),w_=Bi.format,Bi.parse,j_=Bi.utcFormat,Bi.utcParse,Bi}function sU(e){return new Date(e)}function aU(e){return e instanceof Date?+e:+new Date(+e)}function Xg(e,t,r,n,a,i,o,l,c,d){var u=Rg(),f=u.invert,m=u.domain,p=d(".%L"),x=d(":%S"),g=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),b=d("%b %d"),N=d("%B"),w=d("%Y");function k(j){return(c(j)<j?p:l(j)<j?x:o(j)<j?g:i(j)<j?v:n(j)<j?a(j)<j?y:b:r(j)<j?N:w)(j)}return u.invert=function(j){return new Date(f(j))},u.domain=function(j){return arguments.length?m(Array.from(j,aU)):m().map(sU)},u.ticks=function(j){var C=m();return e(C[0],C[C.length-1],j??10)},u.tickFormat=function(j,C){return C==null?k:d(C)},u.nice=function(j){var C=m();return(!j||typeof j.range!="function")&&(j=t(C[0],C[C.length-1],j??10)),j?m(l_(C,j)):u},u.copy=function(){return _c(u,Xg(e,t,r,n,a,i,o,l,c,d))},u}function iU(){return On.apply(Xg(t9,r9,Ks,Gg,Gf,Pc,Kg,Ug,ai,w_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oU(){return On.apply(Xg(J7,e9,Ys,Vg,Vf,Yf,Yg,Hg,ai,j_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Xf(){var e=0,t=1,r,n,a,i,o=Pr,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-r)*a,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),a=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 p,x;return arguments.length?([p,x]=m,o=f(p,x),d):[o(0),o(1)]}}return d.range=u(Bo),d.rangeRound=u(Ig),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),d}}function Fa(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function N_(){var e=za(Xf()(Pr));return e.copy=function(){return Fa(e,N_())},aa.apply(e,arguments)}function k_(){var e=zg(Xf()).domain([1,10]);return e.copy=function(){return Fa(e,k_()).base(e.base())},aa.apply(e,arguments)}function S_(){var e=Fg(Xf());return e.copy=function(){return Fa(e,S_()).constant(e.constant())},aa.apply(e,arguments)}function Qg(){var e=Bg(Xf());return e.copy=function(){return Fa(e,Qg()).exponent(e.exponent())},aa.apply(e,arguments)}function lU(){return Qg.apply(null,arguments).exponent(.5)}function C_(){var e=[],t=Pr;function r(n){if(n!=null&&!isNaN(n=+n))return t((Sc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Pa),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>YW(e,i/n))},r.copy=function(){return C_(t).domain(e)},aa.apply(r,arguments)}function Qf(){var e=0,t=.5,r=1,n=1,a,i,o,l,c,d=Pr,u,f=!1,m;function p(g){return isNaN(g=+g)?m:(g=.5+((g=+u(g))-i)*(n*g<n*i?l:c),d(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,a=u(e=+e),i=u(t=+t),o=u(r=+r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(d=g,p):d};function x(g){return function(v){var y,b,N;return arguments.length?([y,b,N]=v,d=b7(g,[y,b,N]),p):[d(0),d(.5),d(1)]}}return p.range=x(Bo),p.rangeRound=x(Ig),p.unknown=function(g){return arguments.length?(m=g,p):m},function(g){return u=g,a=g(e),i=g(t),o=g(r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p}}function __(){var e=za(Qf()(Pr));return e.copy=function(){return Fa(e,__())},aa.apply(e,arguments)}function P_(){var e=zg(Qf()).domain([.1,1,10]);return e.copy=function(){return Fa(e,P_()).base(e.base())},aa.apply(e,arguments)}function M_(){var e=Fg(Qf());return e.copy=function(){return Fa(e,M_()).constant(e.constant())},aa.apply(e,arguments)}function Zg(){var e=Bg(Qf());return e.copy=function(){return Fa(e,Zg()).exponent(e.exponent())},aa.apply(e,arguments)}function cU(){return Zg.apply(null,arguments).exponent(.5)}const Nl=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ag,scaleDiverging:__,scaleDivergingLog:P_,scaleDivergingPow:Zg,scaleDivergingSqrt:cU,scaleDivergingSymlog:M_,scaleIdentity:o_,scaleImplicit:Sp,scaleLinear:i_,scaleLog:c_,scaleOrdinal:Eg,scalePoint:XW,scalePow:qg,scaleQuantile:f_,scaleQuantize:m_,scaleRadial:u_,scaleSequential:N_,scaleSequentialLog:k_,scaleSequentialPow:Qg,scaleSequentialQuantile:C_,scaleSequentialSqrt:lU,scaleSequentialSymlog:S_,scaleSqrt:W7,scaleSymlog:d_,scaleThreshold:h_,scaleTime:iU,scaleUtc:oU,tickFormat:a_},Symbol.toStringTag,{value:"Module"}));var ia=e=>e.chartData,O_=ae([ia],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),E_=(e,t,r,n)=>n?O_(e):ia(e),dU=(e,t,r)=>r?O_(e):ia(e);function Gs(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Ke(t)&&Ke(r))return!0}return!1}function hw(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function A_(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,a,i;if(Ke(r))a=r;else if(typeof r=="function")return;if(Ke(n))i=n;else if(typeof n=="function")return;var o=[a,i];if(Gs(o))return o}}function uU(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Gs(n))return hw(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[a,i]=e,o,l;if(a==="auto")t!=null&&(o=Math.min(...t));else if(Ce(a))o=a;else if(typeof a=="function")try{t!=null&&(o=a(t==null?void 0:t[0]))}catch{}else if(typeof a=="string"&&Tb.test(a)){var c=Tb.exec(a);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(Ce(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"&&Ib.test(i)){var u=Ib.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(Gs(m))return t==null?m:hw(m,t,r)}}}var qo=1e9,fU={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ev,bt=!0,Mn="[DecimalError] ",di=Mn+"Invalid argument: ",Jg=Mn+"Exponent out of range: ",Wo=Math.floor,Qa=Math.pow,mU=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,an,Qt=1e7,pt=7,D_=9007199254740991,Su=Wo(D_/pt),je={};je.absoluteValue=je.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};je.comparedTo=je.cmp=function(e){var t,r,n,a,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,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*pt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return Rs(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return it(Rs(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return zt(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(an))throw Error(Mn+"NaN");if(r.s<1)throw Error(Mn+(r.s?"NaN":"-Infinity"));return r.eq(an)?new n(0):(bt=!1,t=Rs(Yl(r,i),Yl(e,i),i),bt=!0,it(t,a))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?R_(t,e):T_(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Mn+"NaN");return r.s?(bt=!1,t=Rs(r,e,0,1).times(e),bt=!0,r.minus(t)):it(new n(r),a)};je.naturalExponential=je.exp=function(){return I_(this)};je.naturalLogarithm=je.ln=function(){return Yl(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?T_(t,e):R_(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(di+e);if(t=zt(a)+1,n=a.d.length-1,r=n*pt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Mn+"NaN")}for(e=zt(l),bt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=is(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Wo((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=o=r+3;;)if(i=n,n=i.plus(Rs(l,i,o+2)).times(.5),is(i.d).slice(0,o)===(t=is(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(it(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return bt=!0,it(n,r)};je.times=je.mul=function(e){var t,r,n,a,i,o,l,c,d,u=this,f=u.constructor,m=u.d,p=(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=p.length,c<d&&(i=m,m=p,p=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,a=c+n;a>n;)l=i[a]+p[n]*m[a-n-1]+t,i[a--]=l%Qt|0,t=l/Qt|0;i[a]=(i[a]+t)%Qt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,bt?it(e,f.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(xs(e,0,qo),t===void 0?t=n.rounding:xs(t,0,8),it(r,e+zt(r)+1,t))};je.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=ji(n,!0):(xs(e,0,qo),t===void 0?t=a.rounding:xs(t,0,8),n=it(new a(n),e+1,t),r=ji(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?ji(a):(xs(e,0,qo),t===void 0?t=i.rounding:xs(t,0,8),n=it(new i(a),e+zt(a)+1,t),r=ji(n.abs(),!1,e+zt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return it(new t(e),zt(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,a,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(an);if(l=new c(l),!l.s){if(e.s<1)throw Error(Mn+"Infinity");return l}if(l.eq(an))return l;if(n=c.precision,e.eq(an))return it(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=D_){for(a=new c(an),t=Math.ceil(n/pt+4),bt=!1;r%2&&(a=a.times(l),xw(a.d,t)),r=Wo(r/2),r!==0;)l=l.times(l),xw(l.d,t);return bt=!0,e.s<0?new c(an).div(a):it(a,n)}}else if(i<0)throw Error(Mn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,bt=!1,a=e.times(Yl(l,n+d)),bt=!0,a=I_(a),a.s=i,a};je.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=zt(a),n=ji(a,r<=i.toExpNeg||r>=i.toExpPos)):(xs(e,1,qo),t===void 0?t=i.rounding:xs(t,0,8),a=it(new i(a),e,t),r=zt(a),n=ji(a,e<=r||r<=i.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(xs(e,1,qo),t===void 0?t=n.rounding:xs(t,0,8)),it(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=zt(e),r=e.constructor;return ji(e,t<=r.toExpNeg||t>=r.toExpPos)};function T_(e,t){var r,n,a,i,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),bt?it(t,f):t;if(c=e.d,d=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(n=c,i=-i,l=d.length):(n=d,a=o,l=c.length),o=Math.ceil(f/pt),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)/Qt|0,c[i]%=Qt;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,bt?it(t,f):t}function xs(e,t,r){if(e!==~~e||e<t||e>r)throw Error(di+e)}function is(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)n=e[t]+"",r=pt-n.length,r&&(i+=ha(r)),i+=n;o=e[t],n=o+"",r=pt-n.length,r&&(i+=ha(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Rs=function(){function e(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%Qt|0,o=i/Qt|0;return o&&n.unshift(o),n}function t(n,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*Qt+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,c,d,u,f,m,p,x,g,v,y,b,N,w,k,j,C,P,S=n.constructor,_=n.s==a.s?1:-1,M=n.d,E=a.d;if(!n.s)return new S(n);if(!a.s)throw Error(Mn+"Division by zero");for(c=n.e-a.e,C=E.length,k=M.length,p=new S(_),x=p.d=[],d=0;E[d]==(M[d]||0);)++d;if(E[d]>(M[d]||0)&&--c,i==null?b=i=S.precision:o?b=i+(zt(n)-zt(a))+1:b=i,b<0)return new S(0);if(b=b/pt+2|0,d=0,C==1)for(u=0,E=E[0],b++;(d<k||u)&&b--;d++)N=u*Qt+(M[d]||0),x[d]=N/E|0,u=N%E|0;else{for(u=Qt/(E[0]+1)|0,u>1&&(E=e(E,u),M=e(M,u),C=E.length,k=M.length),w=C,g=M.slice(0,C),v=g.length;v<C;)g[v++]=0;P=E.slice(),P.unshift(0),j=E[0],E[1]>=Qt/2&&++j;do u=0,l=t(E,g,C,v),l<0?(y=g[0],C!=v&&(y=y*Qt+(g[1]||0)),u=y/j|0,u>1?(u>=Qt&&(u=Qt-1),f=e(E,u),m=f.length,v=g.length,l=t(f,g,m,v),l==1&&(u--,r(f,C<m?P:E,m))):(u==0&&(l=u=1),f=E.slice()),m=f.length,m<v&&f.unshift(0),r(g,f,v),l==-1&&(v=g.length,l=t(E,g,C,v),l<1&&(u++,r(g,C<v?P:E,v))),v=g.length):l===0&&(u++,g=[0]),x[d++]=u,l&&g[0]?g[v++]=M[w]||0:(g=[M[w]],v=1);while((w++<k||g[0]!==void 0)&&b--)}return x[0]||x.shift(),p.e=c,it(p,o?i+zt(p)+1:i)}}();function I_(e,t){var r,n,a,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(zt(e)>16)throw Error(Jg+zt(e));if(!e.s)return new u(an);for(bt=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(Qa(2,d))/Math.LN10*2+5|0,l+=n,r=a=i=new u(an),u.precision=l;;){if(a=it(a.times(e),l),r=r.times(++c),o=i.plus(Rs(a,r,l)),is(o.d).slice(0,l)===is(i.d).slice(0,l)){for(;d--;)i=it(i.times(i),l);return u.precision=f,t==null?(bt=!0,it(i,f)):i}i=o}}function zt(e){for(var t=e.e*pt,r=e.d[0];r>=10;r/=10)t++;return t}function mh(e,t,r){if(t>e.LN10.sd())throw bt=!0,r&&(e.precision=r),Error(Mn+"LN10 precision limit exceeded");return it(new e(e.LN10),t)}function ha(e){for(var t="";e--;)t+="0";return t}function Yl(e,t){var r,n,a,i,o,l,c,d,u,f=1,m=10,p=e,x=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(Mn+(p.s?"NaN":"-Infinity"));if(p.eq(an))return new g(0);if(t==null?(bt=!1,d=v):d=t,p.eq(10))return t==null&&(bt=!0),mh(g,d);if(d+=m,g.precision=d,r=is(x),n=r.charAt(0),i=zt(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=is(p.d),n=r.charAt(0),f++;i=zt(p),n>1?(p=new g("0."+r),i++):p=new g(n+"."+r.slice(1))}else return c=mh(g,d+2,v).times(i+""),p=Yl(new g(n+"."+r.slice(1)),d-m).plus(c),g.precision=v,t==null?(bt=!0,it(p,v)):p;for(l=o=p=Rs(p.minus(an),p.plus(an),d),u=it(p.times(p),d),a=3;;){if(o=it(o.times(u),d),c=l.plus(Rs(o,new g(a),d)),is(c.d).slice(0,d)===is(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(mh(g,d+2,v).times(i+""))),l=Rs(l,new g(f),d),g.precision=v,t==null?(bt=!0,it(l,v)):l;l=c,a+=2}}function pw(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Wo(r/pt),e.d=[],n=(r+1)%pt,r<0&&(n+=pt),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=pt;n<a;)e.d.push(+t.slice(n,n+=pt));t=t.slice(n),n=pt-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),bt&&(e.e>Su||e.e<-Su))throw Error(Jg+r)}else e.s=0,e.e=0,e.d=[0];return e}function it(e,t,r){var n,a,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+=pt,a=t,d=f[u=0];else{if(u=Math.ceil((n+1)/pt),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=pt,a=n-pt+o}if(r!==void 0&&(i=Qa(10,o-a-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?a>0?d/Qa(10,o-a):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=zt(e),f.length=1,t=t-i-1,f[0]=Qa(10,(pt-t%pt)%pt),e.e=Wo(-t/pt)||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=Qa(10,pt-n),f[u]=a>0?(d/Qa(10,o-a)%Qa(10,a)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Qt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Qt)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(bt&&(e.e>Su||e.e<-Su))throw Error(Jg+zt(e));return e}function R_(e,t){var r,n,a,i,o,l,c,d,u,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),bt?it(t,p):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),a=Math.max(Math.ceil(p/pt),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=f.length,u=a<l,u&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){u=c[a]<f[a];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=Qt-1;--c[i],c[a]+=Qt}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,bt?it(t,p):t):new m(0)}function ji(e,t,r){var n,a=zt(e),i=is(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+ha(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+ha(-a-1)+i,r&&(n=r-o)>0&&(i+=ha(n))):a>=o?(i+=ha(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+ha(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=ha(n))),e.s<0?"-"+i:i}function xw(e,t){if(e.length>t)return e.length=t,!0}function $_(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){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(di+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 pw(o,i.toString())}else if(typeof i!="string")throw Error(di+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,mU.test(i))pw(o,i);else throw Error(di+i)}if(a.prototype=je,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=$_,a.config=a.set=hU,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 a.config(e),a}function hU(e){if(!e||typeof e!="object")throw Error(Mn+"Object expected");var t,r,n,a=["precision",1,qo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(Wo(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(di+r+": "+n);return this}var ev=$_(fU);an=new ev(1);const tt=ev;function L_(e){var t;return e===0?t=1:t=Math.floor(new tt(e).abs().log(10).toNumber())+1,t}function z_(e,t,r){for(var n=new tt(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var F_=e=>{var[t,r]=e,[n,a]=[t,r];return t>r&&([n,a]=[r,t]),[n,a]},B_=(e,t,r)=>{if(e.lte(0))return new tt(0);var n=L_(e.toNumber()),a=new tt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,l=new tt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(a);return t?new tt(c.toNumber()):new tt(Math.ceil(c.toNumber()))},pU=(e,t,r)=>{var n=new tt(1),a=new tt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new tt(10).pow(L_(e)-1),a=new tt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new tt(Math.floor(e)))}else e===0?a=new tt(Math.floor((t-1)/2)):r||(a=new tt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(a.add(new tt(c-o).mul(n)).toNumber());return l},q_=function(t,r,n,a){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new tt(0),tickMin:new tt(0),tickMax:new tt(0)};var o=B_(new tt(r).sub(t).div(n-1),a,i),l;t<=0&&r>=0?l=new tt(0):(l=new tt(t).add(r).div(2),l=l.sub(new tt(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new tt(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?q_(t,r,n,a,i+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new tt(c).mul(o)),tickMax:l.add(new tt(d).mul(o))})},xU=function(t){var[r,n]=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),[l,c]=F_([r,n]);if(l===-1/0||c===1/0){var d=c===1/0?[l,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),c];return r>n?d.reverse():d}if(l===c)return pU(l,a,i);var{step:u,tickMin:f,tickMax:m}=q_(l,c,o,i,0),p=z_(f,m.add(new tt(.1).mul(u)),u);return r>n?p.reverse():p},gU=function(t,r){var[n,a]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=F_([n,a]);if(o===-1/0||l===1/0)return[n,a];if(o===l)return[o];var c=Math.max(r,2),d=B_(new tt(l).sub(o).div(c-1),i,0),u=[...z_(new tt(o),new tt(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>a?u.reverse():u},W_=e=>e.rootProps.maxBarSize,vU=e=>e.rootProps.barGap,U_=e=>e.rootProps.barCategoryGap,yU=e=>e.rootProps.barSize,Zf=e=>e.rootProps.stackOffset,H_=e=>e.rootProps.reverseStackOrder,tv=e=>e.options.chartName,rv=e=>e.rootProps.syncId,K_=e=>e.rootProps.syncMethod,nv=e=>e.options.eventEmitter,Kre=e=>e.rootProps.baseValue,Mr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ka={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Jn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Jf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function em(e,t,r){if(r!=="auto")return r;if(e!=null)return La(e,t)?"category":"number"}function gw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Cu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gw(Object(r),!0).forEach(function(n){bU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bU(e,t,r){return(t=wU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wU(e){var t=jU(e,"string");return typeof t=="symbol"?t:t+""}function jU(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 vw={allowDataOverflow:Ka.allowDataOverflow,allowDecimals:Ka.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ka.angleAxisId,includeHidden:!1,name:void 0,reversed:Ka.reversed,scale:Ka.scale,tick:Ka.tick,tickCount:void 0,ticks:void 0,type:Ka.type,unit:void 0},yw={allowDataOverflow:Jn.allowDataOverflow,allowDecimals:Jn.allowDecimals,allowDuplicatedCategory:Jn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Jn.radiusAxisId,includeHidden:Jn.includeHidden,name:void 0,reversed:Jn.reversed,scale:Jn.scale,tick:Jn.tick,tickCount:Jn.tickCount,ticks:void 0,type:Jn.type,unit:void 0},NU=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},sv=ae([NU,MC],(e,t)=>{var r;if(e!=null)return e;var n=(r=em(t,"angleAxis",vw.type))!==null&&r!==void 0?r:"category";return Cu(Cu({},vw),{},{type:n})}),kU=(e,t)=>e.polarAxis.radiusAxis[t],av=ae([kU,MC],(e,t)=>{var r;if(e!=null)return e;var n=(r=em(t,"radiusAxis",yw.type))!==null&&r!==void 0?r:"category";return Cu(Cu({},yw),{},{type:n})}),tm=e=>e.polarOptions,iv=ae([na,sa,Jt],SW),Y_=ae([tm,iv],(e,t)=>{if(e!=null)return Un(e.innerRadius,t,0)}),G_=ae([tm,iv],(e,t)=>{if(e!=null)return Un(e.outerRadius,t,t*.8)}),SU=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},V_=ae([tm],SU);ae([sv,V_],Jf);var X_=ae([iv,Y_,G_],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});ae([av,X_],Jf);var Q_=ae([ct,tm,Y_,G_,na,sa],(e,t,r,n,a,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Un(o,a,a/2),cy:Un(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),tr=(e,t)=>t,rm=(e,t,r)=>r;function ov(e){return e==null?void 0:e.id}function Z_(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:a,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=ov(l);d.forEach((f,m)=>{var p=i==null||a?m:String(Zt(f,i,null)),x=Zt(f,l.dataKey,0),g;o.has(p)?g=o.get(p):g={},Object.assign(g,{[u]:x}),o.set(p,g)})}}),Array.from(o.values())}function nm(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var sm=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function am(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function CU(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 rr=e=>{var t=ct(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Uo=e=>e.tooltip.settings.axisId;function _U(e){if(e in Nl)return Nl[e]();var t="scale".concat(yc(e));if(t in Nl)return Nl[t]()}function bw(e){var t=e.ticks,r=e.bandwidth,n=e.range(),a=[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}(()=>a),rangeMin:()=>a[0],rangeMax:()=>a[1],isInRange(i){var o=a[0],l=a[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 ww(e,t,r){if(typeof e=="function")return bw(e.copy().domain(t).range(r));if(e!=null){var n=_U(e);if(n!=null)return n.domain(t).range(r),bw(n)}}var PU=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Gs(t)){for(var r,n,a=0;a<t.length;a++){var i=t[a];Ke(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 jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jw(Object(r),!0).forEach(function(n){MU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MU(e,t,r){return(t=OU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OU(e){var t=EU(e,"string");return typeof t=="symbol"?t:t+""}function EU(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 Mp=[0,"auto"],Vt={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},J_=(e,t)=>e.cartesianAxis.xAxis[t],oa=(e,t)=>{var r=J_(e,t);return r??Vt},Xt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Mp,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:jc},eP=(e,t)=>e.cartesianAxis.yAxis[t],la=(e,t)=>{var r=eP(e,t);return r??Xt},AU={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:""},lv=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??AU},Rr=(e,t,r)=>{switch(t){case"xAxis":return oa(e,r);case"yAxis":return la(e,r);case"zAxis":return lv(e,r);case"angleAxis":return sv(e,r);case"radiusAxis":return av(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},DU=(e,t,r)=>{switch(t){case"xAxis":return oa(e,r);case"yAxis":return la(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Mc=(e,t,r)=>{switch(t){case"xAxis":return oa(e,r);case"yAxis":return la(e,r);case"angleAxis":return sv(e,r);case"radiusAxis":return av(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},tP=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function rP(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 cv=e=>e.graphicalItems.cartesianItems,TU=ae([tr,rm],rP),nP=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),Oc=ae([cv,Rr,TU],nP,{memoizeOptions:{resultEqualityCheck:am}}),sP=ae([Oc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(nm)),aP=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),IU=ae([Oc],aP),iP=e=>e.map(t=>t.data).filter(Boolean).flat(1),RU=ae([Oc],iP,{memoizeOptions:{resultEqualityCheck:am}}),oP=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:a}=t;return e.length>0?e:r.slice(n,a+1)},dv=ae([RU,E_],oP),lP=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Zt(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(a=>({value:Zt(a,n)}))):e.map(n=>({value:n})),im=ae([dv,Rr,Oc],lP);function cP(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Cd(e){if(hs(e)||e instanceof Date){var t=Number(e);if(Ke(t))return t}}function Nw(e){if(Array.isArray(e)){var t=[Cd(e[0]),Cd(e[1])];return Gs(t)?t:void 0}var r=Cd(e);if(r!=null)return[r,r]}function Vs(e){return e.map(Cd).filter(Ur)}function $U(e,t,r){return!r||typeof t!="number"||ms(t)?[]:r.length?Vs(r.flatMap(n=>{var a=Zt(e,n.dataKey),i,o;if(Array.isArray(a)?[i,o]=a:i=o=a,!(!Ke(i)||!Ke(o)))return[t-i,t+o]})):[]}var Yt=e=>{var t=rr(e),r=Uo(e);return Mc(e,t,r)},Ec=ae([Yt],e=>e==null?void 0:e.dataKey),LU=ae([sP,E_,Yt],Z_),dP=(e,t,r,n)=>{var a={},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},a);return Object.fromEntries(Object.entries(i).map(o=>{var[l,c]=o,d=n?[...c].reverse():c,u=d.map(ov);return[l,{stackedData:yB(e,u,r),graphicalItems:d}]}))},Op=ae([LU,sP,Zf,H_],dP),uP=(e,t,r,n)=>{var{dataStartIndex:a,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=kB(e,a,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},zU=ae([Rr],e=>e.allowDataOverflow),uv=e=>{var t;if(e==null||!("domain"in e))return Mp;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Vs(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:Mp},fP=ae([Rr],uv),mP=ae([fP,zU],A_),FU=ae([Op,ia,tr,mP],uP,{memoizeOptions:{resultEqualityCheck:sm}}),fv=e=>e.errorBars,BU=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>cP(r,n)),Pu=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r.filter(Boolean);if(a.length!==0){var i=a.flat(),o=Math.min(...i),l=Math.max(...i);return[o,l]}},hP=(e,t,r,n,a)=>{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=>cP(a,y)),m=Zt(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),p=$U(l,m,f);if(p.length>=2){var x=Math.min(...p),g=Math.max(...p);(i==null||x<i)&&(i=x),(o==null||g>o)&&(o=g)}var v=Nw(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=Nw(Zt(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]))}),Ke(i)&&Ke(o))return[i,o]},qU=ae([dv,Rr,IU,fv,tr],hP,{memoizeOptions:{resultEqualityCheck:sm}});function WU(e){var{value:t}=e;if(hs(t)||t instanceof Date)return t}var UU=(e,t,r)=>{var n=e.map(WU).filter(a=>a!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&c2(n))?XC(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},pP=e=>e.referenceElements.dots,Ho=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),HU=ae([pP,tr,rm],Ho),xP=e=>e.referenceElements.areas,KU=ae([xP,tr,rm],Ho),gP=e=>e.referenceElements.lines,YU=ae([gP,tr,rm],Ho),vP=(e,t)=>{if(e!=null){var r=Vs(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},GU=ae(HU,tr,vP),yP=(e,t)=>{if(e!=null){var r=Vs(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)]}},VU=ae([KU,tr],yP);function XU(e){var t;if(e.x!=null)return Vs([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Vs(r)}function QU(e){var t;if(e.y!=null)return Vs([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Vs(r)}var bP=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?XU(n):QU(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},ZU=ae([YU,tr],bP),JU=ae(GU,ZU,VU,(e,t,r)=>Pu(e,r,t)),wP=(e,t,r,n,a,i,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?Pu(n,i,a):Pu(i,a);return uU(t,d,e.allowDataOverflow)},eH=ae([Rr,fP,mP,FU,qU,JU,ct,tr],wP,{memoizeOptions:{resultEqualityCheck:sm}}),tH=[0,1],jP=(e,t,r,n,a,i,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=La(t,i);if(d&&l==null){var u;return XC(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?UU(n,e,d):a==="expand"?tH:o}},mv=ae([Rr,ct,dv,im,Zf,tr,eH],jP);function rH(e){return e in Nl}var NP=(e,t,r)=>{if(e!=null){var{scale:n,type:a}=e;if(n==="auto")return a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":a==="category"?"band":"linear";if(typeof n=="string"){var i="scale".concat(yc(n));return rH(i)?i:"point"}}},Ko=ae([Rr,tP,tv],NP);function hv(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?ww(e.scale,r,n):ww(t,r,n)}var kP=(e,t,r)=>{var n=uv(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Gs(e))return xU(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Gs(e))return gU(e,t.tickCount,t.allowDecimals)}},pv=ae([mv,Mc,Ko],kP),SP=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Gs(t)&&Array.isArray(r)&&r.length>0){var a,i,o=t[0],l=(a=r[0])!==null&&a!==void 0?a: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},nH=ae([Rr,mv,pv,tr],SP),sH=ae(im,Rr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Vs(e.map(f=>f.value))).sort((f,m)=>f-m),a=n[0],i=n[n.length-1];if(a==null||i==null)return 1/0;var o=i-a;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}}),CP=ae(sH,ct,U_,Jt,(e,t,r,n,a)=>a,(e,t,r,n,a)=>{if(!Ke(e))return 0;var i=t==="vertical"?n.height:n.width;if(a==="gap")return e*i/2;if(a==="no-gap"){var o=Un(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),aH=(e,t,r)=>{var n=oa(e,t);return n==null||typeof n.padding!="string"?0:CP(e,"xAxis",t,r,n.padding)},iH=(e,t,r)=>{var n=la(e,t);return n==null||typeof n.padding!="string"?0:CP(e,"yAxis",t,r,n.padding)},oH=ae(oa,aH,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:a}=e;return typeof a=="string"?{left:t,right:t}:{left:((r=a.left)!==null&&r!==void 0?r:0)+t,right:((n=a.right)!==null&&n!==void 0?n:0)+t}}),lH=ae(la,iH,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:a}=e;return typeof a=="string"?{top:t,bottom:t}:{top:((r=a.top)!==null&&r!==void 0?r:0)+t,bottom:((n=a.bottom)!==null&&n!==void 0?n:0)+t}}),cH=ae([Jt,oH,Ff,zf,(e,t,r)=>r],(e,t,r,n,a)=>{var{padding:i}=n;return a?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),dH=ae([Jt,ct,lH,Ff,zf,(e,t,r)=>r],(e,t,r,n,a,i)=>{var{padding:o}=a;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]}),Ac=(e,t,r,n)=>{var a;switch(t){case"xAxis":return cH(e,r,n);case"yAxis":return dH(e,r,n);case"zAxis":return(a=lv(e,r))===null||a===void 0?void 0:a.range;case"angleAxis":return V_(e);case"radiusAxis":return X_(e,r);default:return}},_P=ae([Rr,Ac],Jf),uH=ae([Ko,nH],PU),om=ae([Rr,Ko,uH,_P],hv);ae([Oc,fv,tr],BU);function PP(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var lm=(e,t)=>t,cm=(e,t,r)=>r,fH=ae($f,lm,cm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(PP)),mH=ae(Lf,lm,cm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(PP)),MP=(e,t)=>({width:e.width,height:t.height}),hH=(e,t)=>{var r=typeof t.width=="number"?t.width:jc;return{width:r,height:e.height}},OP=ae(Jt,oa,MP),pH=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},xH=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},gH=ae(sa,Jt,fH,lm,cm,(e,t,r,n,a)=>{var i={},o;return r.forEach(l=>{var c=MP(t,l);o==null&&(o=pH(t,n,e));var d=n==="top"&&!a||n==="bottom"&&a;i[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),i}),vH=ae(na,Jt,mH,lm,cm,(e,t,r,n,a)=>{var i={},o;return r.forEach(l=>{var c=hH(t,l);o==null&&(o=xH(t,n,e));var d=n==="left"&&!a||n==="right"&&a;i[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),i}),yH=(e,t)=>{var r=oa(e,t);if(r!=null)return gH(e,r.orientation,r.mirror)},bH=ae([Jt,oa,yH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:e.left,y:0}:{x:e.left,y:a}}}),wH=(e,t)=>{var r=la(e,t);if(r!=null)return vH(e,r.orientation,r.mirror)},jH=ae([Jt,la,wH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:0,y:e.top}:{x:a,y:e.top}}}),EP=ae(Jt,la,(e,t)=>{var r=typeof t.width=="number"?t.width:jc;return{width:r,height:e.height}}),kw=(e,t,r)=>{switch(t){case"xAxis":return OP(e,r).width;case"yAxis":return EP(e,r).height;default:return}},AP=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:a,type:i,dataKey:o}=r,l=La(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&a&&c2(c))return c}},xv=ae([ct,im,Rr,tr],AP),DP=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:a,scale:i}=r,o=La(e,n);if(o&&(a==="number"||i!=="auto"))return t.map(l=>l.value)}},gv=ae([ct,im,Mc,tr],DP),Sw=ae([ct,DU,Ko,om,xv,gv,Ac,pv,tr],(e,t,r,n,a,i,o,l,c)=>{if(t!=null){var d=La(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:a,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),NH=(e,t,r,n,a,i,o,l,c)=>{if(!(t==null||n==null)){var d=La(e,c),{type:u,ticks:f,tickCount:m}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,x=u==="category"&&n.bandwidth?n.bandwidth()/p:0;x=c==="angleAxis"&&i!=null&&i.length>=2?Wr(i[0]-i[1])*2*x:x;var g=f||a;return g?g.map((v,y)=>{var b=o?o.indexOf(v):v,N=n.map(b);return Ke(N)?{index:y,coordinate:N+x,value:v,offset:x}:null}).filter(Ur):d&&l?l.map((v,y)=>{var b=n.map(v);return Ke(b)?{coordinate:b+x,value:v,index:y,offset:x}:null}).filter(Ur):n.ticks?n.ticks(m).map((v,y)=>{var b=n.map(v);return Ke(b)?{coordinate:b+x,value:v,index:y,offset:x}:null}).filter(Ur):n.domain().map((v,y)=>{var b=n.map(v);return Ke(b)?{coordinate:b+x,value:o?o[v]:v,index:y,offset:x}:null}).filter(Ur)}},TP=ae([ct,Mc,Ko,om,pv,Ac,xv,gv,tr],NH),kH=(e,t,r,n,a,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=La(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Wr(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return Ke(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Ur):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return Ke(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Ur):r.domain().map((u,f)=>{var m=r.map(u);return Ke(m)?{coordinate:m+d,value:a?a[u]:u,index:f,offset:d}:null}).filter(Ur)}},vo=ae([ct,Mc,om,Ac,xv,gv,tr],kH),yo=ae(Rr,om,(e,t)=>{if(!(e==null||t==null))return _u(_u({},e),{},{scale:t})}),SH=ae([Rr,Ko,mv,_P],hv);ae((e,t,r)=>lv(e,r),SH,(e,t)=>{if(!(e==null||t==null))return _u(_u({},e),{},{scale:t})});var CH=ae([ct,$f,Lf],(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}}),IP=e=>e.options.defaultTooltipEventType,RP=e=>e.options.validateTooltipEventTypes;function $P(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function vv(e,t){var r=IP(e),n=RP(e);return $P(t,r,n)}function _H(e){return Ae(t=>vv(t,e))}var LP=(e,t)=>{var r,n=Number(t);if(!(ms(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},PH=e=>e.tooltip.settings,xa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},MH={itemInteraction:{click:xa,hover:xa},axisInteraction:{click:xa,hover:xa},keyboardInteraction:xa,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}},zP=Jr({name:"tooltip",initialState:MH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:yt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,a=qn(e).tooltipItemPayloads.indexOf(r);a>-1&&(e.tooltipItemPayloads[a]=n)},prepare:yt()},removeTooltipEntrySettings:{reducer(e,t){var r=qn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:yt()},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:OH,replaceTooltipEntrySettings:EH,removeTooltipEntrySettings:AH,setTooltipSettingsState:DH,setActiveMouseOverItemIndex:FP,mouseLeaveItem:TH,mouseLeaveChart:BP,setActiveClickItemIndex:IH,setMouseOverAxisIndex:qP,setMouseClickAxisIndex:RH,setSyncInteraction:Ep,setKeyboardInteraction:Ap}=zP.actions,$H=zP.reducer;function Cw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ud(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){LH(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 LH(e,t,r){return(t=zH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zH(e){var t=FH(e,"string");return typeof t=="symbol"?t:t+""}function FH(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,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function qH(e){return e.index!=null}var WP=(e,t,r,n)=>{if(t==null)return xa;var a=BH(e,t,r);if(a==null)return xa;if(a.active)return a;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(qH(a)){if(i)return ud(ud({},a),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return ud(ud({},xa),{},{coordinate:a.coordinate})};function WH(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 UH(e,t){var r=WH(e),n=t[0],a=t[1];if(r===void 0)return!1;var i=Math.min(n,a),o=Math.max(n,a);return r>=i&&r<=o}function HH(e,t,r){if(r==null||t==null)return!0;var n=Zt(e,t);return n==null||!Gs(r)?!0:UH(n,r)}var yv=(e,t,r,n)=>{var a=e==null?void 0:e.index;if(a==null)return null;var i=Number(a);if(!Ke(i))return a;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||HH(d,r,n)?String(c):null},UP=(e,t,r,n,a,i,o)=>{if(i!=null){var l=o[0],c=l==null?void 0:l.getPosition(i);if(c!=null)return c;var d=a==null?void 0:a[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}}}},HP=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;if(r==="hover"?a=e.itemInteraction.hover.graphicalItemId:a=e.itemInteraction.click.graphicalItemId,a==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)===a})},KP=e=>e.options.tooltipPayloadSearcher,Yo=e=>e.tooltip;function _w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Pw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_w(Object(r),!0).forEach(function(n){KH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_w(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KH(e,t,r){return(t=YH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YH(e){var t=GH(e,"string");return typeof t=="symbol"?t:t+""}function GH(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 VH(e,t){return e??t}var YP=(e,t,r,n,a,i,o)=>{if(!(t==null||i==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((m,p)=>{var x,{dataDefinedOnItem:g,settings:v}=p,y=VH(g,l),b=Array.isArray(y)?hC(y,d,u):y,N=(x=v==null?void 0:v.dataKey)!==null&&x!==void 0?x:n,w=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(b)&&!Array.isArray(b[0])&&o==="axis"?k=d2(b,n,a):k=i(b,t,c,w),Array.isArray(k))k.forEach(C=>{var P=Pw(Pw({},v),{},{name:C.name,unit:C.unit,color:void 0,fill:void 0});m.push(Rb({tooltipEntrySettings:P,dataKey:C.dataKey,payload:C.payload,value:Zt(C.payload,C.dataKey),name:C.name}))});else{var j;m.push(Rb({tooltipEntrySettings:v,dataKey:N,payload:k,value:Zt(k,N),name:(j=Zt(k,w))!==null&&j!==void 0?j:v==null?void 0:v.name}))}return m},f)}},bv=ae([Yt,tP,tv],NP),XH=ae([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),QH=ae([rr,Uo],rP),Go=ae([XH,Yt,QH],nP,{memoizeOptions:{resultEqualityCheck:am}}),ZH=ae([Go],e=>e.filter(nm)),JH=ae([Go],iP,{memoizeOptions:{resultEqualityCheck:am}}),Vo=ae([JH,ia],oP),eK=ae([ZH,ia,Yt],Z_),wv=ae([Vo,Yt,Go],lP),GP=ae([Yt],uv),tK=ae([Yt],e=>e.allowDataOverflow),VP=ae([GP,tK],A_),rK=ae([Go],e=>e.filter(nm)),nK=ae([eK,rK,Zf,H_],dP),sK=ae([nK,ia,rr,VP],uP),aK=ae([Go],aP),iK=ae([Vo,Yt,aK,fv,rr],hP,{memoizeOptions:{resultEqualityCheck:sm}}),oK=ae([pP,rr,Uo],Ho),lK=ae([oK,rr],vP),cK=ae([xP,rr,Uo],Ho),dK=ae([cK,rr],yP),uK=ae([gP,rr,Uo],Ho),fK=ae([uK,rr],bP),mK=ae([lK,fK,dK],Pu),hK=ae([Yt,GP,VP,sK,iK,mK,ct,rr],wP),Dc=ae([Yt,ct,Vo,wv,Zf,rr,hK],jP),pK=ae([Dc,Yt,bv],kP),xK=ae([Yt,Dc,pK,rr],SP),XP=e=>{var t=rr(e),r=Uo(e),n=!1;return Ac(e,t,r,n)},QP=ae([Yt,XP],Jf),ZP=ae([Yt,bv,xK,QP],hv),gK=ae([ct,wv,Yt,rr],AP),vK=ae([ct,wv,Yt,rr],DP),yK=(e,t,r,n,a,i,o,l)=>{if(t){var{type:c}=t,d=La(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"&&a!=null&&(a==null?void 0:a.length)>=2?Wr(a[0]-a[1])*2*f:f,d&&o?o.map((m,p)=>{var x=n.map(m);return Ke(x)?{coordinate:x+f,value:m,index:p,offset:f}:null}).filter(Ur):n.domain().map((m,p)=>{var x=n.map(m);return Ke(x)?{coordinate:x+f,value:i?i[m]:m,index:p,offset:f}:null}).filter(Ur)}}},ca=ae([ct,Yt,bv,ZP,XP,gK,vK,rr],yK),jv=ae([IP,RP,PH],(e,t,r)=>$P(r.shared,e,t)),JP=e=>e.tooltip.settings.trigger,Nv=e=>e.tooltip.settings.defaultIndex,Tc=ae([Yo,jv,JP,Nv],WP),bo=ae([Tc,Vo,Ec,Dc],yv),eM=ae([ca,bo],LP),tM=ae([Tc],e=>{if(e)return e.dataKey});ae([Tc],e=>{if(e)return e.graphicalItemId});var rM=ae([Yo,jv,JP,Nv],HP),bK=ae([na,sa,ct,Jt,ca,Nv,rM],UP),wK=ae([Tc,bK],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),jK=ae([Tc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),NK=ae([rM,bo,ia,Ec,eM,KP,jv],YP),kK=ae([NK],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Mw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ow(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){SK(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 SK(e,t,r){return(t=CK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CK(e){var t=_K(e,"string");return typeof t=="symbol"?t:t+""}function _K(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 PK=()=>Ae(Yt),MK=()=>{var e=PK(),t=Ae(ca),r=Ae(ZP);return au(!e||!r?void 0:Ow(Ow({},e),{},{scale:r}),t)};function Ew(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ew(Object(r),!0).forEach(function(n){OK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ew(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OK(e,t,r){return(t=EK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EK(e){var t=AK(e,"string");return typeof t=="symbol"?t:t+""}function AK(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 DK=(e,t,r,n)=>{var a=t.find(i=>i&&i.index===r);if(a){if(e==="horizontal")return{x:a.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:a.coordinate}}return{x:0,y:0}},TK=(e,t,r,n)=>{var a=t.find(d=>d&&d.index===r);if(a){if(e==="centric"){var i=a.coordinate,{radius:o}=n;return qi(qi(qi({},n),mr(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=a.coordinate,{angle:c}=n;return qi(qi(qi({},n),mr(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 IK(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 nM=(e,t,r,n,a)=>{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"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,d,u,f,m,p=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,x=(u=r[l])===null||u===void 0?void 0:u.coordinate,g=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(!(p==null||x==null||g==null))if(Wr(x-p)!==Wr(g-x)){var y=[];if(Wr(g-x)===Wr(a[1]-a[0])){v=g;var b=x+a[1]-a[0];y[0]=Math.min(b,(b+p)/2),y[1]=Math.max(b,(b+p)/2)}else{v=p;var N=g+a[1]-a[0];y[0]=Math.min(x,(N+x)/2),y[1]=Math.max(x,(N+x)/2)}var w=[Math.min(x,(v+x)/2),Math.max(x,(v+x)/2)];if(e>w[0]&&e<=w[1]||e>=y[0]&&e<=y[1]){var k;return(k=r[l])===null||k===void 0?void 0:k.index}}else{var j=Math.min(p,g),C=Math.max(p,g);if(e>(j+x)/2&&e<=(C+x)/2){var P;return(P=r[l])===null||P===void 0?void 0:P.index}}}else if(t)for(var S=0;S<o;S++){var _=t[S];if(_!=null){var M=t[S+1],E=t[S-1];if(S===0&&M!=null&&e<=(_.coordinate+M.coordinate)/2||S===o-1&&E!=null&&e>(_.coordinate+E.coordinate)/2||S>0&&S<o-1&&E!=null&&M!=null&&e>(_.coordinate+E.coordinate)/2&&e<=(_.coordinate+M.coordinate)/2)return _.index}}return-1},RK=()=>Ae(tv),kv=(e,t)=>t,sM=(e,t,r)=>r,Sv=(e,t,r,n)=>n,$K=ae(ca,e=>_f(e,t=>t.coordinate)),Cv=ae([Yo,kv,sM,Sv],WP),_v=ae([Cv,Vo,Ec,Dc],yv),LK=(e,t,r)=>{if(t!=null){var n=Yo(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},aM=ae([Yo,kv,sM,Sv],HP),Mu=ae([na,sa,ct,Jt,ca,Sv,aM],UP),zK=ae([Cv,Mu],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),iM=ae([ca,_v],LP),FK=ae([aM,_v,ia,Ec,iM,KP,kv],YP),BK=ae([Cv,_v],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qK=(e,t,r,n,a,i,o)=>{if(!(!e||!r||!n||!a)&&IK(e,o)){var l=SB(e,t),c=nM(l,i,a,r,n),d=DK(t,a,c,e);return{activeIndex:String(c),activeCoordinate:d}}},WK=(e,t,r,n,a,i,o)=>{if(!(!e||!n||!a||!i||!r)){var l=OW(e,r);if(l){var c=CB(l,t),d=nM(c,o,i,n,a),u=TK(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},UK=(e,t,r,n,a,i,o,l)=>{if(!(!e||!t||!n||!a||!i))return t==="horizontal"||t==="vertical"?qK(e,t,n,a,i,o,l):WK(e,t,r,n,a,i,o)},HK=ae(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}}),KK=ae(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Mr)),r=Array.from(new Set(t));return r.sort((n,a)=>n-a)},{memoizeOptions:{resultEqualityCheck:CU}});function Aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Dw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Aw(Object(r),!0).forEach(function(n){YK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YK(e,t,r){return(t=GK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GK(e){var t=VK(e,"string");return typeof t=="symbol"?t:t+""}function VK(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 XK={},QK={zIndexMap:Object.values(Mr).reduce((e,t)=>Dw(Dw({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),XK)},ZK=new Set(Object.values(Mr));function JK(e){return ZK.has(e)}var oM=Jr({name:"zIndex",initialState:QK,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:yt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!JK(r)&&delete e.zIndexMap[r])},prepare:yt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:a}=t.payload;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:a?void 0:n,panoramaElement:a?n:void 0}},prepare:yt()},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:yt()}}}),{registerZIndexPortal:eY,unregisterZIndexPortal:tY,registerZIndexPortalElement:rY,unregisterZIndexPortalElement:nY}=oM.actions,sY=oM.reducer;function da(e){var{zIndex:t,children:r}=e,n=tq(),a=n&&t!==void 0&&t!==0,i=en(),o=Rt();h.useLayoutEffect(()=>a?(o(eY({zIndex:t})),()=>{o(tY({zIndex:t}))}):zo,[o,t,a]);var l=Ae(c=>HK(c,t,i));return a?l?Vp.createPortal(r,l):null:r}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 Tw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tw(Object(r),!0).forEach(function(n){aY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aY(e,t,r){return(t=iY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iY(e){var t=oY(e,"string");return typeof t=="symbol"?t:t+""}function oY(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 lY(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return h.isValidElement(t)?h.cloneElement(t,n):h.createElement(r,n)}function cY(e){var t,{coordinate:r,payload:n,index:a,offset:i,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:u}=e,f=r,m=n,p=a;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var x,g,v;if(u==="ScatterChart")x=f,g=Wq,v=Mr.cursorLine;else if(u==="BarChart")x=Uq(l,f,i,o),g=WC,v=Mr.cursorRectangle;else if(l==="radial"&&m2(f)){var{cx:y,cy:b,radius:N,startAngle:w,endAngle:k}=UC(f);x={cx:y,cy:b,startAngle:w,endAngle:k,innerRadius:N,outerRadius:N},g=KC,v=Mr.cursorLine}else x={points:TW(l,f,i)},g=LC,v=Mr.cursorLine;var j=typeof c=="object"&&"className"in c?c.className:void 0,C=fd(fd(fd(fd({stroke:"#ccc",pointerEvents:"none"},i),x),eg(c)),{},{payload:m,payloadIndex:p,className:lt("recharts-tooltip-cursor",j)});return h.createElement(da,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},h.createElement(lY,{cursor:c,cursorComp:g,cursorProps:C}))}function dY(e){var t=MK(),r=SC(),n=Fo(),a=RK();return t==null||r==null||n==null||a==null?null:h.createElement(cY,Dp({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:a}))}var lM=h.createContext(null),uY=()=>h.useContext(lM),cM={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(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 p=new a(u,f||c,m),x=r?r+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,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,p=f.length,x=new Array(p);m<p;m++)x[m]=f[m].fn;return x},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,p,x){var g=r?r+d:d;if(!this._events[g])return!1;var v=this._events[g],y=arguments.length,b,N;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,p),!0;case 6:return v.fn.call(v.context,u,f,m,p,x),!0}for(N=1,b=new Array(y-1);N<y;N++)b[N-1]=arguments[N];v.fn.apply(v.context,b)}else{var w=v.length,k;for(N=0;N<w;N++)switch(v[N].once&&this.removeListener(d,v[N].fn,void 0,!0),y){case 1:v[N].fn.call(v[N].context);break;case 2:v[N].fn.call(v[N].context,u);break;case 3:v[N].fn.call(v[N].context,u,f);break;case 4:v[N].fn.call(v[N].context,u,f,m);break;default:if(!b)for(k=1,b=new Array(y-1);k<y;k++)b[k-1]=arguments[k];v[N].fn.apply(v[N].context,b)}}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 p=r?r+d:d;if(!this._events[p])return this;if(!u)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===u&&(!m||x.once)&&(!f||x.context===f)&&o(this,p);else{for(var g=0,v=[],y=x.length;g<y;g++)(x[g].fn!==u||m&&!x[g].once||f&&x[g].context!==f)&&v.push(x[g]);v.length?this._events[p]=v.length===1?v[0]:v:o(this,p)}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})(cM);var fY=cM.exports;const mY=Qs(fY);var Gl=new mY,Tp="recharts.syncEvent.tooltip",Iw="recharts.syncEvent.brush",hY=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!ms(r))return e[r]}},pY={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},dM=Jr({name:"options",initialState:pY,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),xY=dM.reducer,{createEventEmitter:gY}=dM.actions;function vY(e){return e.tooltip.syncInteraction}var yY={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},uM=Jr({name:"chartData",initialState:yY,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:Rw,setDataStartEndIndexes:bY,setComputedData:Yre}=uM.actions,wY=uM.reducer,jY=["x","y"];function $w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$w(Object(r),!0).forEach(function(n){NY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$w(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NY(e,t,r){return(t=kY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kY(e){var t=SY(e,"string");return typeof t=="symbol"?t:t+""}function SY(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 CY(e,t){if(e==null)return{};var r,n,a=_Y(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)&&(a[r]=e[r])}return a}function _Y(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 PY(){var e=Ae(rv),t=Ae(nv),r=Rt(),n=Ae(K_),a=Ae(ca),i=Fo(),o=Bf(),l=Ae(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return zo;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 p=u.payload.coordinate,{x,y:g}=p,v=CY(p,jY),{x:y,y:b,width:N,height:w}=u.payload.sourceViewBox,k=Wi(Wi({},v),{},{x:o.x+(N?(x-y)/N:0)*o.width,y:o.y+(w?(g-b)/w:0)*o.height});r(Wi(Wi({},u),{},{payload:Wi(Wi({},u.payload),{},{coordinate:k})}))}else r(u);return}if(a!=null){var j;if(typeof n=="function"){var C={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},P=n(a,C);j=a[P]}else n==="value"&&(j=a.find(Q=>String(Q.value)===u.payload.label));var{coordinate:S}=u.payload;if(j==null||u.payload.active===!1||S==null||o==null){r(Ep({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:_,y:M}=S,E=Math.min(_,o.x+o.width),A=Math.min(M,o.y+o.height),D={x:i==="horizontal"?j.coordinate:E,y:i==="horizontal"?A:j.coordinate},Z=Ep({active:u.payload.active,coordinate:D,dataKey:u.payload.dataKey,index:String(j.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(Z)}}};return Gl.on(Tp,c),()=>{Gl.off(Tp,c)}},[l,r,t,e,n,a,i,o])}function MY(){var e=Ae(rv),t=Ae(nv),r=Rt();h.useEffect(()=>{if(e==null)return zo;var n=(a,i,o)=>{t!==o&&e===a&&r(bY(i))};return Gl.on(Iw,n),()=>{Gl.off(Iw,n)}},[r,t,e])}function OY(){var e=Rt();h.useEffect(()=>{e(gY())},[e]),PY(),MY()}function EY(e,t,r,n,a,i){var o=Ae(p=>LK(p,e,t)),l=Ae(nv),c=Ae(rv),d=Ae(K_),u=Ae(vY),f=u==null?void 0:u.active,m=Bf();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var p=Ep({active:i,coordinate:r,dataKey:o,index:a,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});Gl.emit(Tp,c,p,l)}},[f,r,o,a,n,l,c,d,i,m])}function Lw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lw(Object(r),!0).forEach(function(n){AY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AY(e,t,r){return(t=DY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DY(e){var t=TY(e,"string");return typeof t=="symbol"?t:t+""}function TY(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 IY(e){return e.dataKey}function RY(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(jq,t)}var Fw=[],$Y={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 LY(e){var t,r,n=gn(e,$Y),{active:a,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:p,reverseDirection:x,useTranslate3d:g,wrapperStyle:v,cursor:y,shared:b,trigger:N,defaultIndex:w,portal:k,axisId:j}=n,C=Rt(),P=typeof w=="number"?String(w):w;h.useEffect(()=>{C(DH({shared:b,trigger:N,axisId:j,active:a,defaultIndex:P}))},[C,b,N,j,a,P]);var S=Bf(),_=$C(),M=_H(b),{activeIndex:E,isActive:A}=(t=Ae(T=>BK(T,M,N,P)))!==null&&t!==void 0?t:{},D=Ae(T=>FK(T,M,N,P)),Z=Ae(T=>iM(T,M,N,P)),Q=Ae(T=>zK(T,M,N,P)),q=D,te=uY(),ne=(r=a??A)!==null&&r!==void 0?r:!1,[I,O]=d8([q,ne]),L=M==="axis"?Z:void 0;EY(M,N,Q,L,E,ne);var H=k??te;if(H==null||S==null||M==null)return null;var R=q??Fw;ne||(R=Fw),d&&R.length&&(R=YF(R.filter(T=>T.value!=null&&(T.hide!==!0||n.includeHidden)),m,IY));var Y=R.length>0,F=h.createElement(Mq,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:ne,coordinate:Q,hasPayload:Y,offset:f,position:p,reverseDirection:x,useTranslate3d:g,viewBox:S,wrapperStyle:v,lastBoundingBox:I,innerRef:O,hasPortalFromProps:!!k},RY(c,zw(zw({},n),{},{payload:R,label:L,active:ne,activeIndex:E,coordinate:Q,accessibilityLayer:_})));return h.createElement(h.Fragment,null,Vp.createPortal(F,H),ne&&h.createElement(dY,{cursor:y,tooltipEventType:M,coordinate:Q,payload:R,index:E}))}var fM=e=>null;fM.displayName="Cell";function zY(e,t,r){return(t=FY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FY(e){var t=BY(e,"string");return typeof t=="symbol"?t:t+""}function BY(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 qY{constructor(t){zY(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 Bw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function WY(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bw(Object(r),!0).forEach(function(n){UY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UY(e,t,r){return(t=HY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HY(e){var t=KY(e,"string");return typeof t=="symbol"?t:t+""}function KY(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 YY={cacheSize:2e3,enableCache:!0},mM=WY({},YY),qw=new qY(mM.cacheSize),GY={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Ww="recharts_measurement_span";function VY(e,t){var r=t.fontSize||"",n=t.fontFamily||"",a=t.fontWeight||"",i=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(a,"|").concat(i,"|").concat(o,"|").concat(l)}var Uw=(e,t)=>{try{var r=document.getElementById(Ww);r||(r=document.createElement("span"),r.setAttribute("id",Ww),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,GY,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},Pl=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Hf.isSsr)return{width:0,height:0};if(!mM.enableCache)return Uw(t,r);var n=VY(t,r),a=qw.get(n);if(a)return a;var i=Uw(t,r);return qw.set(n,i),i},hM;function XY(e,t,r){return(t=QY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QY(e){var t=ZY(e,"string");return typeof t=="symbol"?t:t+""}function ZY(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 Hw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Kw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,JY=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,eG=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,tG={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},rG=["cm","mm","pt","pc","in","Q","px"];function nG(e){return rG.includes(e)}var Gi="NaN";function sG(e,t){return e*tG[t]}class dr{static parse(t){var r,[,n,a]=(r=eG.exec(t))!==null&&r!==void 0?r:[];return n==null?dr.NaN:new dr(parseFloat(n),a??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,ms(t)&&(this.unit=""),r!==""&&!JY.test(r)&&(this.num=NaN,this.unit=""),nG(r)&&(this.num=sG(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new dr(NaN,""):new dr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new dr(NaN,""):new dr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new dr(NaN,""):new dr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new dr(NaN,""):new dr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ms(this.num)}}hM=dr;XY(dr,"NaN",new hM(NaN,""));function pM(e){if(e==null||e.includes(Gi))return Gi;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,a,i]=(r=Hw.exec(t))!==null&&r!==void 0?r:[],o=dr.parse(n??""),l=dr.parse(i??""),c=a==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Gi;t=t.replace(Hw,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=Kw.exec(t))!==null&&d!==void 0?d:[],p=dr.parse(u??""),x=dr.parse(m??""),g=f==="+"?p.add(x):p.subtract(x);if(g.isNaN())return Gi;t=t.replace(Kw,g.toString())}return t}var Yw=/\(([^()]*)\)/;function aG(e){for(var t=e,r;(r=Yw.exec(t))!=null;){var[,n]=r;t=t.replace(Yw,pM(n))}return t}function iG(e){var t=e.replace(/\s+/g,"");return t=aG(t),t=pM(t),t}function oG(e){try{return iG(e)}catch{return Gi}}function hh(e){var t=oG(e.slice(5,-1));return t===Gi?"":t}var lG=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],cG=["dx","dy","angle","className","breakAll"];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 Gw(e,t){if(e==null)return{};var r,n,a=dG(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)&&(a[r]=e[r])}return a}function dG(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 xM=/[ \f\n\r\t\v\u2028\u2029]+/,gM=e=>{var{children:t,breakAll:r,style:n}=e;try{var a=[];Ft(t)||(r?a=t.toString().split(""):a=t.toString().split(xM));var i=a.map(l=>({word:l,width:Pl(l,n).width})),o=r?0:Pl(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function uG(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var vM=(e,t,r,n)=>e.reduce((a,i)=>{var{word:o,width:l}=i,c=a[a.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};a.push(d)}return a},[]),yM=e=>e.reduce((t,r)=>t.width>r.width?t:r),fG="…",Vw=(e,t,r,n,a,i,o,l)=>{var c=e.slice(0,t),d=gM({breakAll:r,style:n,children:c+fG});if(!d)return[!1,[]];var u=vM(d.wordsWithComputedWidth,i,o,l),f=u.length>a||yM(u).width>Number(i);return[f,u]},mG=(e,t,r,n,a)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=Ce(i),u=String(o),f=vM(t,n,r,a);if(!d||a)return f;var m=f.length>i||yM(f).width>Number(n);if(!m)return f;for(var p=0,x=u.length-1,g=0,v;p<=x&&g<=u.length-1;){var y=Math.floor((p+x)/2),b=y-1,[N,w]=Vw(u,b,c,l,i,n,r,a),[k]=Vw(u,y,c,l,i,n,r,a);if(!N&&!k&&(p=y+1),N&&k&&(x=y-1),!N&&k){v=w;break}g++}return v||f},Xw=e=>{var t=Ft(e)?[]:e.toString().split(xM);return[{words:t,width:void 0}]},hG=e=>{var{width:t,scaleToFit:r,children:n,style:a,breakAll:i,maxLines:o}=e;if((t||r)&&!Hf.isSsr){var l,c,d=gM({breakAll:i,children:n,style:a});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return Xw(n);return mG({breakAll:i,children:n,maxLines:o,style:a},l,c,t,!!r)}return Xw(n)},bM="#808080",pG={angle:0,breakAll:!1,capHeight:"0.71em",fill:bM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Pv=h.forwardRef((e,t)=>{var r=gn(e,pG),{x:n,y:a,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=Gw(r,lG),m=h.useMemo(()=>hG({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:p,dy:x,angle:g,className:v,breakAll:y}=f,b=Gw(f,cG);if(!hs(n)||!hs(a)||m.length===0)return null;var N=Number(n)+(Ce(p)?p:0),w=Number(a)+(Ce(x)?x:0);if(!Ke(N)||!Ke(w))return null;var k;switch(u){case"start":k=hh("calc(".concat(o,")"));break;case"middle":k=hh("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=hh("calc(".concat(m.length-1," * -").concat(i,")"));break}var j=[],C=m[0];if(c&&C!=null){var P=C.width,{width:S}=f;j.push("scale(".concat(Ce(S)&&Ce(P)?S/P:1,")"))}return g&&j.push("rotate(".concat(g,", ").concat(N,", ").concat(w,")")),j.length&&(b.transform=j.join(" ")),h.createElement("text",Ip({},Xr(b),{ref:t,x:N,y:w,className:lt("recharts-text",v),textAnchor:d,fill:l.includes("url")?bM:l}),m.map((_,M)=>{var E=_.words.join(y?"":" ");return h.createElement("tspan",{x:N,dy:M===0?k:i,key:"".concat(E,"-").concat(M)},E)}))});Pv.displayName="Text";function Qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function es(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){xG(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 xG(e,t,r){return(t=gG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gG(e){var t=vG(e,"string");return typeof t=="symbol"?t:t+""}function vG(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 yG=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:a}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=Sg(t),u=i,f=i+(c-d)/2,m=(u+f)/2,p=(c+d)/2,x=u+c/2,g=l>=0?1:-1,v=g*n,y=g>0?"end":"start",b=g>0?"start":"end",N=c>=0?1:-1,w=N*n,k=N>0?"end":"start",j=N>0?"start":"end",C=a;if(r==="top"){var P={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return C&&(P.height=Math.max(o-C.y,0),P.width=c),P}if(r==="bottom"){var S={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:b};return C&&(S.height=Math.max(C.y+C.height-(o+l),0),S.width=d),S}if(r==="left"){var _={x:m-w,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return C&&(_.width=Math.max(_.x-C.x,0),_.height=l),_}if(r==="right"){var M={x:m+p+w,y:o+l/2,horizontalAnchor:j,verticalAnchor:"middle"};return C&&(M.width=Math.max(C.x+C.width-M.x,0),M.height=l),M}var E=C?{width:p,height:l}:{};return r==="insideLeft"?es({x:m+w,y:o+l/2,horizontalAnchor:j,verticalAnchor:"middle"},E):r==="insideRight"?es({x:m+p-w,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},E):r==="insideTop"?es({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:b},E):r==="insideBottom"?es({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},E):r==="insideTopLeft"?es({x:u+w,y:o+v,horizontalAnchor:j,verticalAnchor:b},E):r==="insideTopRight"?es({x:u+c-w,y:o+v,horizontalAnchor:k,verticalAnchor:b},E):r==="insideBottomLeft"?es({x:f+w,y:o+l-v,horizontalAnchor:j,verticalAnchor:y},E):r==="insideBottomRight"?es({x:f+d-w,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},E):r&&typeof r=="object"&&(Ce(r.x)||vi(r.x))&&(Ce(r.y)||vi(r.y))?es({x:i+Un(r.x,p),y:o+Un(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},E):es({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},E)},bG=["labelRef"],wG=["content"];function Zw(e,t){if(e==null)return{};var r,n,a=jG(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)&&(a[r]=e[r])}return a}function jG(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 Jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jw(Object(r),!0).forEach(function(n){NG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NG(e,t,r){return(t=kG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kG(e){var t=SG(e,"string");return typeof t=="symbol"?t:t+""}function SG(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 _s(){return _s=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},_s.apply(null,arguments)}var wM=h.createContext(null),CG=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:a,width:i,height:o,children:l}=e,c=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:a,width:i,height:o}),[t,r,n,a,i,o]);return h.createElement(wM.Provider,{value:c},l)},jM=()=>{var e=h.useContext(wM),t=Bf();return e||(t?Sg(t):void 0)},_G=h.createContext(null),PG=()=>{var e=h.useContext(_G),t=Ae(Q_);return e||t},MG=e=>{var{value:t,formatter:r}=e,n=Ft(e.children)?t:e.children;return typeof r=="function"?r(n):n},Mv=e=>e!=null&&typeof e=="function",OG=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},EG=(e,t,r,n,a)=>{var{offset:i,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:m,clockWise:p}=a,x=(d+u)/2,g=OG(f,m),v=g>=0?1:-1,y,b;switch(t){case"insideStart":y=f+v*i,b=p;break;case"insideEnd":y=m-v*i,b=!p;break;case"end":y=m+v*i,b=p;break;default:throw new Error("Unsupported position ".concat(t))}b=g<=0?b:!b;var N=mr(l,c,x,y),w=mr(l,c,x,y+(b?1:-1)*359),k="M".concat(N.x,",").concat(N.y,`
|
|
618
|
-
A`).concat(x,",").concat(x,",0,1,").concat(b?0:1,`,
|
|
619
|
-
`).concat(w.x,",").concat(w.y),j=Ft(e.id)?Il("recharts-radial-line-"):e.id;return h.createElement("text",_s({},n,{dominantBaseline:"central",className:lt("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:j,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(j)},r))},AG=(e,t,r)=>{var{cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=mr(n,a,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(i+o)/2,{x:p,y:x}=mr(n,a,m,d);return{x:p,y:x,textAnchor:"middle",verticalAnchor:"middle"}},_d=e=>e!=null&&"cx"in e&&Ce(e.cx),DG={angle:0,offset:5,zIndex:Mr.label,position:"middle",textBreakAll:!1};function TG(e){if(!_d(e))return e;var{cx:t,cy:r,outerRadius:n}=e,a=n*2;return{x:t-n,y:r-n,width:a,upperWidth:a,lowerWidth:a,height:a}}function pa(e){var t=gn(e,DG),{viewBox:r,parentViewBox:n,position:a,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=PG(),m=jM(),p=a==="center"?m:f??m,x,g,v;r==null?x=p:_d(r)?x=r:x=Sg(r);var y=TG(x);if(!x||Ft(i)&&Ft(o)&&!h.isValidElement(l)&&typeof l!="function")return null;var b=kl(kl({},t),{},{viewBox:x});if(h.isValidElement(l)){var{labelRef:N}=b,w=Zw(b,bG);return h.cloneElement(l,w)}if(typeof l=="function"){var{content:k}=b,j=Zw(b,wG);if(g=h.createElement(l,j),h.isValidElement(g))return g}else g=MG(t);var C=Xr(t);if(_d(x)){if(a==="insideStart"||a==="insideEnd"||a==="end")return EG(t,a,g,C,x);v=AG(x,t.offset,t.position)}else{if(!y)return null;var P=yG({viewBox:y,position:a,offset:t.offset,parentViewBox:_d(n)?void 0:n});v=kl(kl({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return h.createElement(da,{zIndex:t.zIndex},h.createElement(Pv,_s({ref:u,className:lt("recharts-label",c)},C,v,{textAnchor:uG(C.textAnchor)?C.textAnchor:v.textAnchor,breakAll:d}),g))}pa.displayName="Label";var IG=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(pa,_s({key:"label-implicit"},n)):hs(e)?h.createElement(pa,_s({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===pa?h.cloneElement(e,kl({key:"label-implicit"},n)):h.createElement(pa,_s({key:"label-implicit",content:e},n)):Mv(e)?h.createElement(pa,_s({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(pa,_s({},e,{key:"label-implicit"},n)):null};function RG(e){var{label:t,labelRef:r}=e,n=jM();return IG(t,n,r)||null}var NM={},kM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(kM);var SM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(SM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kM,r=SM,n=Sf;function a(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=a})(NM);var $G=NM.last;const LG=Qs($G);var zG=["valueAccessor"],FG=["dataKey","clockWise","id","textBreakAll","zIndex"];function Ou(){return Ou=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},Ou.apply(null,arguments)}function ej(e,t){if(e==null)return{};var r,n,a=BG(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)&&(a[r]=e[r])}return a}function BG(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 qG=e=>Array.isArray(e.value)?LG(e.value):e.value,CM=h.createContext(void 0),WG=CM.Provider,_M=h.createContext(void 0);_M.Provider;function UG(){return h.useContext(CM)}function HG(){return h.useContext(_M)}function Pd(e){var{valueAccessor:t=qG}=e,r=ej(e,zG),{dataKey:n,clockWise:a,id:i,textBreakAll:o,zIndex:l}=r,c=ej(r,FG),d=UG(),u=HG(),f=d||u;return!f||!f.length?null:h.createElement(da,{zIndex:l??Mr.label},h.createElement(Ws,{className:"recharts-label-list"},f.map((m,p)=>{var x,g=Ft(n)?t(m,p):Zt(m.payload,n),v=Ft(i)?{}:{id:"".concat(i,"-").concat(p)};return h.createElement(pa,Ou({key:"label-".concat(p)},Xr(m),c,v,{fill:(x=r.fill)!==null&&x!==void 0?x:m.fill,parentViewBox:m.parentViewBox,value:g,textBreakAll:o,viewBox:m.viewBox,index:p,zIndex:0}))})))}Pd.displayName="LabelList";function KG(e){var{label:t}=e;return t?t===!0?h.createElement(Pd,{key:"labelList-implicit"}):h.isValidElement(t)||Mv(t)?h.createElement(Pd,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(Pd,Ou({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var YG={radiusAxis:{},angleAxis:{}},PM=Jr({name:"polarAxis",initialState:YG,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:Gre,removeRadiusAxis:Vre,addAngleAxis:Xre,removeAngleAxis:Qre}=PM.actions,GG=PM.reducer;function VG(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var MM={exports:{}},dt={};/**
|
|
620
|
-
* @license React
|
|
621
|
-
* react-is.production.js
|
|
622
|
-
*
|
|
623
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
624
|
-
*
|
|
625
|
-
* This source code is licensed under the MIT license found in the
|
|
626
|
-
* LICENSE file in the root directory of this source tree.
|
|
627
|
-
*/var Ov=Symbol.for("react.transitional.element"),Ev=Symbol.for("react.portal"),dm=Symbol.for("react.fragment"),um=Symbol.for("react.strict_mode"),fm=Symbol.for("react.profiler"),mm=Symbol.for("react.consumer"),hm=Symbol.for("react.context"),pm=Symbol.for("react.forward_ref"),xm=Symbol.for("react.suspense"),gm=Symbol.for("react.suspense_list"),vm=Symbol.for("react.memo"),ym=Symbol.for("react.lazy"),XG=Symbol.for("react.view_transition"),QG=Symbol.for("react.client.reference");function En(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ov:switch(e=e.type,e){case dm:case fm:case um:case xm:case gm:case XG:return e;default:switch(e=e&&e.$$typeof,e){case hm:case pm:case ym:case vm:return e;case mm:return e;default:return t}}case Ev:return t}}}dt.ContextConsumer=mm;dt.ContextProvider=hm;dt.Element=Ov;dt.ForwardRef=pm;dt.Fragment=dm;dt.Lazy=ym;dt.Memo=vm;dt.Portal=Ev;dt.Profiler=fm;dt.StrictMode=um;dt.Suspense=xm;dt.SuspenseList=gm;dt.isContextConsumer=function(e){return En(e)===mm};dt.isContextProvider=function(e){return En(e)===hm};dt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ov};dt.isForwardRef=function(e){return En(e)===pm};dt.isFragment=function(e){return En(e)===dm};dt.isLazy=function(e){return En(e)===ym};dt.isMemo=function(e){return En(e)===vm};dt.isPortal=function(e){return En(e)===Ev};dt.isProfiler=function(e){return En(e)===fm};dt.isStrictMode=function(e){return En(e)===um};dt.isSuspense=function(e){return En(e)===xm};dt.isSuspenseList=function(e){return En(e)===gm};dt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===dm||e===fm||e===um||e===xm||e===gm||typeof e=="object"&&e!==null&&(e.$$typeof===ym||e.$$typeof===vm||e.$$typeof===hm||e.$$typeof===mm||e.$$typeof===pm||e.$$typeof===QG||e.getModuleId!==void 0)};dt.typeOf=En;MM.exports=dt;var ZG=MM.exports,tj=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",rj=null,ph=null,OM=e=>{if(e===rj&&Array.isArray(ph))return ph;var t=[];return h.Children.forEach(e,r=>{Ft(r)||(ZG.isFragment(r)?t=t.concat(OM(r.props.children)):t.push(r))}),ph=t,rj=e,t};function JG(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(a=>tj(a)):n=[tj(t)],OM(e).forEach(a=>{var i=fo(a,"type.displayName")||fo(a,"type.name");i&&n.indexOf(i)!==-1&&r.push(a)}),r}var Zre=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,EM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var a;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||!((a=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&a.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})(EM);var eV=EM.isPlainObject;const tV=Qs(eV);var nj,sj,aj,ij,oj;function lj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lj(Object(r),!0).forEach(function(n){rV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rV(e,t,r){return(t=nV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nV(e){var t=sV(e,"string");return typeof t=="symbol"?t:t+""}function sV(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 Eu(){return Eu=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},Eu.apply(null,arguments)}function yl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var dj=(e,t,r,n,a)=>{var i=r-n,o;return o=Et(nj||(nj=yl(["M ",",",""])),e,t),o+=Et(sj||(sj=yl(["L ",",",""])),e+r,t),o+=Et(aj||(aj=yl(["L ",",",""])),e+r-i/2,t+a),o+=Et(ij||(ij=yl(["L ",",",""])),e+r-i/2-n,t+a),o+=Et(oj||(oj=yl(["L ",","," Z"])),e,t),o},aV={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},iV=e=>{var t=gn(e,aV),{x:r,y:n,upperWidth:a,lowerWidth:i,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,m=h.useRef(null),[p,x]=h.useState(-1),g=h.useRef(a),v=h.useRef(i),y=h.useRef(o),b=h.useRef(r),N=h.useRef(n),w=Mg(e,"trapezoid-");if(h.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var D=m.current.getTotalLength();D&&x(D)}catch{}},[]),r!==+r||n!==+n||a!==+a||i!==+i||o!==+o||a===0&&i===0||o===0)return null;var k=lt("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",Eu({},Xr(t),{className:k,d:dj(r,n,a,i,o)})));var j=g.current,C=v.current,P=y.current,S=b.current,_=N.current,M="0px ".concat(p===-1?1:p,"px"),E="".concat(p,"px 0px"),A=zC(["strokeDasharray"],d,c);return h.createElement(Pg,{animationId:w,key:w,canBegin:p>0,duration:d,easing:c,isActive:f,begin:u},D=>{var Z=ur(j,a,D),Q=ur(C,i,D),q=ur(P,o,D),te=ur(S,r,D),ne=ur(_,n,D);m.current&&(g.current=Z,v.current=Q,y.current=q,b.current=te,N.current=ne);var I=D>0?{transition:A,strokeDasharray:E}:{strokeDasharray:M};return h.createElement("path",Eu({},Xr(t),{className:k,d:dj(te,ne,Z,Q,q),ref:m,style:cj(cj({},I),t.style)}))})},oV=["option","shapeType","activeClassName"];function lV(e,t){if(e==null)return{};var r,n,a=cV(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)&&(a[r]=e[r])}return a}function cV(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 uj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Au(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uj(Object(r),!0).forEach(function(n){dV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dV(e,t,r){return(t=uV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(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 mV(e,t){return Au(Au({},t),e)}function hV(e,t){return e==="symbols"}function fj(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return h.createElement(WC,r);case"trapezoid":return h.createElement(iV,r);case"sector":return h.createElement(KC,r);case"symbols":if(hV(t))return h.createElement(f2,r);break;case"curve":return h.createElement(LC,r);default:return null}}function pV(e){return h.isValidElement(e)?e.props:e}function xV(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,a=lV(e,oV),i;if(h.isValidElement(t))i=h.cloneElement(t,Au(Au({},a),pV(t)));else if(typeof t=="function")i=t(a,a.index);else if(tV(t)&&typeof t!="boolean"){var o=mV(t,a);i=h.createElement(fj,{shapeType:r,elementProps:o})}else{var l=a;i=h.createElement(fj,{shapeType:r,elementProps:l})}return a.isActive?h.createElement(Ws,{className:n},i):i}var AM=(e,t,r)=>{var n=Rt();return(a,i)=>o=>{e==null||e(a,i,o),n(FP({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:r}))}},DM=e=>{var t=Rt();return(r,n)=>a=>{e==null||e(r,n,a),t(TH())}},TM=(e,t,r)=>{var n=Rt();return(a,i)=>o=>{e==null||e(a,i,o),n(IH({activeIndex:String(i),activeDataKey:t,activeCoordinate:a.tooltipPosition,activeGraphicalItemId:r}))}};function gV(e){var{tooltipEntrySettings:t}=e,r=Rt(),n=en(),a=h.useRef(null);return h.useLayoutEffect(()=>{n||(a.current===null?r(OH(t)):a.current!==t&&r(EH({prev:a.current,next:t})),a.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{a.current&&(r(AH(a.current)),a.current=null)},[r]),null}function vV(e){var{legendPayload:t}=e,r=Rt(),n=en(),a=h.useRef(null);return h.useLayoutEffect(()=>{n||(a.current===null?r(hq(t)):a.current!==t&&r(pq({prev:a.current,next:t})),a.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{a.current&&(r(xq(a.current)),a.current=null)},[r]),null}var xh,yV=()=>{var[e]=h.useState(()=>Il("uid-"));return e},bV=(xh=oE.useId)!==null&&xh!==void 0?xh:yV;function wV(e,t){var r=bV();return t||(e?"".concat(e,"-").concat(r):r)}var jV=h.createContext(void 0),NV=e=>{var{id:t,type:r,children:n}=e,a=wV("recharts-".concat(r),t);return h.createElement(jV.Provider,{value:a},n(a))},kV={cartesianItems:[],polarItems:[]},IM=Jr({name:"graphicalItems",initialState:kV,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:yt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,a=qn(e).cartesianItems.indexOf(r);a>-1&&(e.cartesianItems[a]=n)},prepare:yt()},removeCartesianGraphicalItem:{reducer(e,t){var r=qn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:yt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:yt()},removePolarGraphicalItem:{reducer(e,t){var r=qn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:yt()}}}),{addCartesianGraphicalItem:SV,replaceCartesianGraphicalItem:CV,removeCartesianGraphicalItem:_V,addPolarGraphicalItem:Jre,removePolarGraphicalItem:ene}=IM.actions,PV=IM.reducer,MV=e=>{var t=Rt(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(SV(e)):r.current!==e&&t(CV({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(_V(r.current)),r.current=null)},[t]),null},OV=h.memo(MV);function mj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mj(Object(r),!0).forEach(function(n){EV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EV(e,t,r){return(t=AV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AV(e){var t=DV(e,"string");return typeof t=="symbol"?t:t+""}function DV(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 RM=0,TV={xAxis:{},yAxis:{},zAxis:{}},$M=Jr({name:"cartesianAxis",initialState:TV,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:yt()},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:yt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:yt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:yt()},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:yt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:yt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:yt()},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:yt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:yt()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,a=e.yAxis[r];if(a){var i,o=a.widthHistory||[];if(o.length===3&&o[0]===o[2]&&n===o[1]&&n!==a.width&&Math.abs(n-((i=o[0])!==null&&i!==void 0?i:0))<=1)return;var l=[...o,n].slice(-3);e.yAxis[r]=hj(hj({},a),{},{width:n,widthHistory:l})}}}}),{addXAxis:IV,replaceXAxis:RV,removeXAxis:$V,addYAxis:LV,replaceYAxis:zV,removeYAxis:FV,addZAxis:tne,replaceZAxis:rne,removeZAxis:nne,updateYAxisWidth:BV}=$M.actions,qV=$M.reducer,WV=ae([Jt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),UV=ae([WV,na,sa],(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)}}),LM=()=>Ae(UV),sne=()=>Ae(kK),pj=(e,t,r)=>{var n=r??e;if(!Ft(n))return Un(n,t,0)},HV=(e,t,r)=>{var n={},a=e.filter(nm),i=e.filter(d=>d.stackId==null),o=a.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,p=m.map(g=>g.dataKey),x=pj(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:p,barSize:x}}),c=i.map(d=>{var u=[d.dataKey].filter(m=>m!=null),f=pj(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]};function xj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function md(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xj(Object(r),!0).forEach(function(n){KV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KV(e,t,r){return(t=YV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YV(e){var t=GV(e,"string");return typeof t=="symbol"?t:t+""}function GV(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 VV(e,t,r,n,a){var i,o=n.length;if(!(o<1)){var l=Un(e,r,0,!0),c,d=[];if(Ke((i=n[0])===null||i===void 0?void 0:i.barSize)){var u=!1,f=r/o,m=n.reduce((b,N)=>b+(N.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 p=(r-m)/2>>0,x={offset:p-l,size:0};c=n.reduce((b,N)=>{var w,k={stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:x.offset+x.size+l,size:u?f:(w=N.barSize)!==null&&w!==void 0?w:0}},j=[...b,k];return x=k.position,j},d)}else{var g=Un(t,r,0,!0);r-2*g-(o-1)*l<=0&&(l=0);var v=(r-2*g-(o-1)*l)/o;v>1&&(v>>=0);var y=Ke(a)?Math.min(v,a):v;c=n.reduce((b,N,w)=>[...b,{stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:g+(v+l)*w+(v-y)/2,size:y}}],d)}return c}}var XV=(e,t,r,n,a,i,o)=>{var l=Ft(o)?t:o,c=VV(r,n,a!==i?a:i,e,l);return a!==i&&c!=null&&(c=c.map(d=>md(md({},d),{},{position:md(md({},d.position),{},{offset:d.position.offset-a/2})}))),c},QV=(e,t)=>{var r=ov(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var a=e[n];if(a){var{stackedData:i}=a;if(i)return i.find(o=>o.key===r)}}}},ZV=(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 JV(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ke(e.zIndex)?e.zIndex:t}var eX=e=>{var{chartData:t}=e,r=Rt(),n=en();return h.useEffect(()=>n?()=>{}:(r(Rw(t)),()=>{r(Rw(void 0))}),[t,r,n]),null},gj={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},zM=Jr({name:"brush",initialState:gj,reducers:{setBrushSettings(e,t){return t.payload==null?gj:t.payload}}}),{setBrushSettings:ane}=zM.actions,tX=zM.reducer;function rX(e){return(e%180+180)%180}var nX=function(t){var{width:r,height:n}=t,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=rX(a),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)},sX={dots:[],areas:[],lines:[]},FM=Jr({name:"referenceElements",initialState:sX,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=qn(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=qn(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=qn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:ine,removeDot:one,addArea:lne,removeArea:cne,addLine:dne,removeLine:une}=FM.actions,aX=FM.reducer,iX=h.createContext(void 0),oX=e=>{var{children:t}=e,[r]=h.useState("".concat(Il("recharts"),"-clip")),n=LM();if(n==null)return null;var{x:a,y:i,width:o,height:l}=n;return h.createElement(iX.Provider,{value:r},h.createElement("defs",null,h.createElement("clipPath",{id:r},h.createElement("rect",{x:a,y:i,height:l,width:o}))),t)};function BM(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var a=e[n];a!==void 0&&r.push(a)}return r}function lX(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return nX(n,r)}function cX(e,t,r){var n=r==="width",{x:a,y:i,width:o,height:l}=e;return t===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function Vl(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function dX(e,t){return BM(e,t+1)}function uX(e,t,r,n,a){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:BM(n,d)};var g=c,v,y=()=>(v===void 0&&(v=r(x,g)),v),b=x.coordinate,N=c===0||Vl(e,b,y,u,l);N||(c=0,u=o,d+=1),N&&(u=b+e*(y()/2+a),c+=d)},m;d<=i.length;)if(m=f(),m)return m.v;return[]}function fX(e,t,r,n,a){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,p=function(){var w=n[g];if(w==null)return 0;var k=g,j,C=()=>(j===void 0&&(j=r(w,k)),j),P=w.coordinate,S=g===u||Vl(e,P,C,f,c);if(!S)return m=!1,1;S&&(f=P+e*(C()/2+a))},x,g=u;g<o&&(x=p(),!(x!==0&&x===1));g+=d);if(m){for(var v=[],y=u;y<o;y+=d){var b=n[y];b!=null&&v.push(b)}return v}}return[]}function vj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vj(Object(r),!0).forEach(function(n){mX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mX(e,t,r){return(t=hX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hX(e){var t=pX(e,"string");return typeof t=="symbol"?t:t+""}function pX(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 xX(e,t,r,n,a){for(var i=(n||[]).slice(),o=i.length,{start:l}=t,{end:c}=t,d=function(m){var p=i[m];if(p==null)return 1;var x=p,g,v=()=>(g===void 0&&(g=r(p,m)),g);if(m===o-1){var y=e*(x.coordinate+e*v()/2-c);i[m]=x=gr(gr({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else i[m]=x=gr(gr({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var b=Vl(e,x.tickCoord,v,l,c);b&&(c=x.tickCoord-e*(v()/2+a),i[m]=gr(gr({},x),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function gX(e,t,r,n,a,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=gr(gr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var p=Vl(e,u.tickCoord,()=>f,c,d);p&&(d=u.tickCoord-e*(f/2+a),o[l-1]=gr(gr({},u),{},{isShow:!0}))}}}for(var x=i?l-1:l,g=function(b){var N=o[b];if(N==null)return 1;var w=N,k,j=()=>(k===void 0&&(k=r(N,b)),k);if(b===0){var C=e*(w.coordinate-e*j()/2-c);o[b]=w=gr(gr({},w),{},{tickCoord:C<0?w.coordinate-C*e:w.coordinate})}else o[b]=w=gr(gr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var P=Vl(e,w.tickCoord,j,c,d);P&&(c=w.tickCoord+e*(j()/2+a),o[b]=gr(gr({},w),{},{isShow:!0}))}},v=0;v<x;v++)g(v);return o}function Av(e,t,r){var{tick:n,ticks:a,viewBox:i,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!a||!a.length||!n)return[];if(Ce(c)||Hf.isSsr){var m;return(m=dX(a,Ce(c)?c:0))!==null&&m!==void 0?m:[]}var p=[],x=l==="top"||l==="bottom"?"width":"height",g=u&&x==="width"?Pl(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,j)=>{var C=typeof d=="function"?d(k.value,j):k.value;return x==="width"?lX(Pl(C,{fontSize:t,letterSpacing:r}),g,f):Pl(C,{fontSize:t,letterSpacing:r})[x]},y=a[0],b=a[1],N=a.length>=2&&y!=null&&b!=null?Wr(b.coordinate-y.coordinate):1,w=cX(i,N,x);return c==="equidistantPreserveStart"?uX(N,w,v,a,o):c==="equidistantPreserveEnd"?fX(N,w,v,a,o):(c==="preserveStart"||c==="preserveStartEnd"?p=gX(N,w,v,a,o,c==="preserveStartEnd"):p=xX(N,w,v,a,o),p.filter(k=>k.isShow))}var vX=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:a=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=a+i,d=o+c+l+(r?n:0);return Math.round(d)}return 0},yX=["axisLine","width","height","className","hide","ticks","axisType"];function bX(e,t){if(e==null)return{};var r,n,a=wX(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)&&(a[r]=e[r])}return a}function wX(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 Ni(){return Ni=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},Ni.apply(null,arguments)}function yj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yj(Object(r),!0).forEach(function(n){jX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jX(e,t,r){return(t=NX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NX(e){var t=kX(e,"string");return typeof t=="symbol"?t:t+""}function kX(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 $s={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:Mr.axis};function SX(e){var{x:t,y:r,width:n,height:a,orientation:i,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=Ot(Ot(Ot({},c),qs(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=Ot(Ot({},d),{},{x1:t,y1:r+u*a,x2:t+n,y2:r+u*a})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=Ot(Ot({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+a})}return h.createElement("line",Ni({},d,{className:lt("recharts-cartesian-axis-line",fo(l,"className"))}))}function CX(e,t,r,n,a,i,o,l,c){var d,u,f,m,p,x,g=l?-1:1,v=e.tickSize||o,y=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*a,f=m-g*v,x=f-g*c,p=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-g*v,p=d-g*c,x=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+g*v,p=d+g*c,x=y;break;default:d=u=e.coordinate,m=r+ +l*a,f=m+g*v,x=f+g*c,p=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:p,y:x}}}function _X(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function PX(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function MX(e){var{option:t,tickProps:r,value:n}=e,a,i=lt(r.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))a=h.cloneElement(t,Ot(Ot({},r),{},{className:i}));else if(typeof t=="function")a=t(Ot(Ot({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=lt(o,VG(t))),a=h.createElement(Pv,Ni({},r,{className:o}),n)}return a}var OX=h.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:a,stroke:i,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:m,y:p,width:x,height:g,tickSize:v,tickMargin:y,fontSize:b,letterSpacing:N,getTicksConfig:w,events:k,axisType:j}=e,C=Av(Ot(Ot({},w),{},{ticks:r}),b,N),P=_X(u,f),S=PX(u,f),_=qs(w),M=eg(n),E={};typeof a=="object"&&(E=a);var A=Ot(Ot({},_),{},{fill:"none"},E),D=C.map(q=>Ot({entry:q},CX(q,m,p,x,g,u,v,f,y))),Z=D.map(q=>{var{entry:te,line:ne}=q;return h.createElement(Ws,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},a&&h.createElement("line",Ni({},A,ne,{className:lt("recharts-cartesian-axis-tick-line",fo(a,"className"))})))}),Q=D.map((q,te)=>{var ne,I,{entry:O,tick:L}=q,H=Ot(Ot(Ot(Ot({verticalAnchor:S},_),{},{textAnchor:P,stroke:"none",fill:i},L),{},{index:te,payload:O,visibleTicksCount:C.length,tickFormatter:o,padding:c},d),{},{angle:(ne=(I=d==null?void 0:d.angle)!==null&&I!==void 0?I:_.angle)!==null&&ne!==void 0?ne:0}),R=Ot(Ot({},H),M);return h.createElement(Ws,Ni({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},ag(k,O,te)),n&&h.createElement(MX,{option:n,tickProps:R,value:"".concat(typeof o=="function"?o(O.value,te):O.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(j,"-ticks")},Q.length>0&&h.createElement(da,{zIndex:Mr.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(j,"-tick-labels"),ref:t},Q)),Z.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(j,"-tick-lines")},Z))}),EX=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:a,className:i,hide:o,ticks:l,axisType:c}=e,d=bX(e,yX),[u,f]=h.useState(""),[m,p]=h.useState(""),x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return vX({ticks:x.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var g=h.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=y;var b=y[0];if(b){var N=window.getComputedStyle(b),w=N.fontSize,k=N.letterSpacing;(w!==u||k!==m)&&(f(w),p(k))}}},[u,m]);return o||n!=null&&n<=0||a!=null&&a<=0?null:h.createElement(da,{zIndex:e.zIndex},h.createElement(Ws,{className:lt("recharts-cartesian-axis",i)},h.createElement(SX,{x:e.x,y:e.y,width:n,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:qs(e)}),h.createElement(OX,{ref:g,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}),h.createElement(CG,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(RG,{label:e.label,labelRef:e.labelRef}),e.children)))}),Dv=h.forwardRef((e,t)=>{var r=gn(e,$s);return h.createElement(EX,Ni({},r,{ref:t}))});Dv.displayName="CartesianAxis";var AX=["x1","y1","x2","y2","key"],DX=["offset"],TX=["xAxisId","yAxisId"],IX=["xAxisId","yAxisId"];function bj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bj(Object(r),!0).forEach(function(n){RX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RX(e,t,r){return(t=$X(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $X(e){var t=LX(e,"string");return typeof t=="symbol"?t:t+""}function LX(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 ii(){return ii=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},ii.apply(null,arguments)}function Du(e,t){if(e==null)return{};var r,n,a=zX(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)&&(a[r]=e[r])}return a}function zX(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 FX=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:a,width:i,height:o,ry:l}=e;return h.createElement("rect",{x:n,y:a,ry:l,width:i,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function qM(e){var{option:t,lineItemProps:r}=e,n;if(h.isValidElement(t))n=h.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var a,{x1:i,y1:o,x2:l,y2:c,key:d}=r,u=Du(r,AX),f=(a=qs(u))!==null&&a!==void 0?a:{},{offset:m}=f,p=Du(f,DX);n=h.createElement("line",ii({},p,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function BX(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:a}=e;if(!n||!a||!a.length)return null;var{xAxisId:i,yAxisId:o}=e,l=Du(e,TX),c=a.map((d,u)=>{var f=yr(yr({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(qM,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function qX(e){var{y:t,height:r,vertical:n=!0,verticalPoints:a}=e;if(!n||!a||!a.length)return null;var{xAxisId:i,yAxisId:o}=e,l=Du(e,IX),c=a.map((d,u)=>{var f=yr(yr({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(qM,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function WX(e){var{horizontalFill:t,fillOpacity:r,x:n,y:a,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+a-a)).sort((f,m)=>f-m);a!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var p=d[m+1],x=p==null,g=x?a+o-f:p-f;if(g<=0)return null;var v=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function UX(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:a,y:i,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+a-a)).sort((f,m)=>f-m);a!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var p=d[m+1],x=p==null,g=x?a+o-f:p-f;if(g<=0)return null;var v=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:g,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var HX=(e,t)=>{var{xAxis:r,width:n,height:a,offset:i}=e;return pC(Av(yr(yr(yr({},$s),r),{},{ticks:xC(r),viewBox:{x:0,y:0,width:n,height:a}})),i.left,i.left+i.width,t)},KX=(e,t)=>{var{yAxis:r,width:n,height:a,offset:i}=e;return pC(Av(yr(yr(yr({},$s),r),{},{ticks:xC(r),viewBox:{x:0,y:0,width:n,height:a}})),i.top,i.top+i.height,t)},YX={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Mr.grid};function WM(e){var t=CC(),r=_C(),n=SC(),a=yr(yr({},gn(e,YX)),{},{x:Ce(e.x)?e.x:n.left,y:Ce(e.y)?e.y:n.top,width:Ce(e.width)?e.width:n.width,height:Ce(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:m,verticalValues:p}=a,x=en(),g=Ae(S=>Sw(S,"xAxis",i,x)),v=Ae(S=>Sw(S,"yAxis",o,x));if(!ps(d)||!ps(u)||!Ce(l)||!Ce(c))return null;var y=a.verticalCoordinatesGenerator||HX,b=a.horizontalCoordinatesGenerator||KX,{horizontalPoints:N,verticalPoints:w}=a;if((!N||!N.length)&&typeof b=="function"){var k=m&&m.length,j=b({yAxis:v?yr(yr({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);iu(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(N=j)}if((!w||!w.length)&&typeof y=="function"){var C=p&&p.length,P=y({xAxis:g?yr(yr({},g),{},{ticks:C?p:g.ticks}):void 0,width:t??d,height:r??u,offset:n},C?!0:f);iu(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(w=P)}return h.createElement(da,{zIndex:a.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(FX,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),h.createElement(WX,ii({},a,{horizontalPoints:N})),h.createElement(UX,ii({},a,{verticalPoints:w})),h.createElement(BX,ii({},a,{offset:n,horizontalPoints:N,xAxis:g,yAxis:v})),h.createElement(qX,ii({},a,{offset:n,verticalPoints:w,xAxis:g,yAxis:v}))))}WM.displayName="CartesianGrid";var GX={},UM=Jr({name:"errorBars",initialState:GX,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:a}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?a:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==n.dataKey||a.direction!==n.direction))}}}),{addErrorBar:fne,replaceErrorBar:mne,removeErrorBar:hne}=UM.actions,VX=UM.reducer,XX=["children"];function QX(e,t){if(e==null)return{};var r,n,a=ZX(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)&&(a[r]=e[r])}return a}function ZX(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 JX={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},eQ=h.createContext(JX);function tQ(e){var{children:t}=e,r=QX(e,XX);return h.createElement(eQ.Provider,{value:r},t)}function HM(e,t){var r,n,a=Ae(d=>oa(d,e)),i=Ae(d=>la(d,t)),o=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Vt.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Xt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function rQ(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,a=LM(),{needClipX:i,needClipY:o,needClip:l}=HM(t,r);if(!l||!a)return null;var{x:c,y:d,width:u,height:f}=a;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.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 nQ={};/**
|
|
628
|
-
* @license React
|
|
629
|
-
* use-sync-external-store-with-selector.production.js
|
|
630
|
-
*
|
|
631
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
632
|
-
*
|
|
633
|
-
* This source code is licensed under the MIT license found in the
|
|
634
|
-
* LICENSE file in the root directory of this source tree.
|
|
635
|
-
*/var Ic=h;function sQ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var aQ=typeof Object.is=="function"?Object.is:sQ,iQ=Ic.useSyncExternalStore,oQ=Ic.useRef,lQ=Ic.useEffect,cQ=Ic.useMemo,dQ=Ic.useDebugValue;nQ.useSyncExternalStoreWithSelector=function(e,t,r,n,a){var i=oQ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=cQ(function(){function c(p){if(!d){if(d=!0,u=p,p=n(p),a!==void 0&&o.hasValue){var x=o.value;if(a(x,p))return f=x}return f=p}if(x=f,aQ(u,p))return x;var g=n(p);return a!==void 0&&a(x,g)?(u=p,x):(u=p,f=g)}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,a]);var l=iQ(e,i[0],i[1]);return lQ(function(){o.hasValue=!0,o.value=l},[l]),dQ(l),l};function uQ(e){e()}function fQ(){let e=null,t=null;return{clear(){e=null,t=null},notify(){uQ(()=>{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 a=t={callback:r,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!n||e===null||(n=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var wj={notify(){},get:()=>[]};function mQ(e,t){let r,n=wj,a=0,i=!1;function o(g){u();const v=n.subscribe(g);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){x.onStateChange&&x.onStateChange()}function d(){return i}function u(){a++,r||(r=e.subscribe(c),n=fQ())}function f(){a--,r&&a===0&&(r(),r=void 0,n.clear(),n=wj)}function m(){i||(i=!0,u())}function p(){i&&(i=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:p,getListeners:()=>n};return x}var hQ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pQ=hQ(),xQ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",gQ=xQ(),vQ=()=>pQ||gQ?h.useLayoutEffect:h.useEffect,yQ=vQ();function jj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function bQ(e,t){if(jj(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 a=0;a<r.length;a++)if(!Object.prototype.hasOwnProperty.call(t,r[a])||!jj(e[r[a]],t[r[a]]))return!1;return!0}var gh=Symbol.for("react-redux-context"),vh=typeof globalThis<"u"?globalThis:{};function wQ(){if(!h.createContext)return{};const e=vh[gh]??(vh[gh]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var jQ=wQ();function NQ(e){const{children:t,context:r,serverState:n,store:a}=e,i=h.useMemo(()=>{const c=mQ(a);return{store:a,subscription:c,getServerState:n?()=>n:void 0}},[a,n]),o=h.useMemo(()=>a.getState(),[a]);yQ(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==a.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,o]);const l=r||jQ;return h.createElement(l.Provider,{value:i},t)}var kQ=NQ,SQ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function CQ(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Tv(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(SQ.has(n)){if(e[n]==null&&t[n]==null)continue;if(!bQ(e[n],t[n]))return!1}else if(!CQ(e[n],t[n]))return!1;return!0}function Ti(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:RM}function Ii(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:RM}var _Q="Invariant failed";function PQ(e,t){throw new Error(_Q)}function Rp(){return Rp=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},Rp.apply(null,arguments)}function Tu(e){return h.createElement(xV,Rp({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var MQ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,a)=>{if(Ce(t))return t;var i=Ce(n)||Ft(n);return i?t(n,a):(i||PQ(),r)}},OQ=(e,t,r)=>r,EQ=(e,t)=>t,Rc=ae([cv,EQ],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),AQ=ae([Rc],e=>e==null?void 0:e.maxBarSize),DQ=(e,t,r,n)=>n,TQ=ae([ct,cv,Ti,Ii,OQ],(e,t,r,n,a)=>t.filter(i=>e==="horizontal"?i.xAxisId===r:i.yAxisId===n).filter(i=>i.isPanorama===a).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),IQ=(e,t,r)=>{var n=ct(e),a=Ti(e,t),i=Ii(e,t);if(!(a==null||i==null))return n==="horizontal"?Op(e,"yAxis",i,r):Op(e,"xAxis",a,r)},RQ=(e,t)=>{var r=ct(e),n=Ti(e,t),a=Ii(e,t);if(!(n==null||a==null))return r==="horizontal"?kw(e,"xAxis",n):kw(e,"yAxis",a)},$Q=ae([TQ,yU,RQ],HV),LQ=(e,t,r)=>{var n,a,i=Rc(e,t);if(i==null)return 0;var o=Ti(e,t),l=Ii(e,t);if(o==null||l==null)return 0;var c=ct(e),d=W_(e),{maxBarSize:u}=i,f=Ft(u)?d:u,m,p;return c==="horizontal"?(m=yo(e,"xAxis",o,r),p=vo(e,"xAxis",o,r)):(m=yo(e,"yAxis",l,r),p=vo(e,"yAxis",l,r)),(n=(a=au(m,p,!0))!==null&&a!==void 0?a:f)!==null&&n!==void 0?n:0},KM=(e,t,r)=>{var n=ct(e),a=Ti(e,t),i=Ii(e,t);if(!(a==null||i==null)){var o,l;return n==="horizontal"?(o=yo(e,"xAxis",a,r),l=vo(e,"xAxis",a,r)):(o=yo(e,"yAxis",i,r),l=vo(e,"yAxis",i,r)),au(o,l)}},zQ=ae([$Q,W_,vU,U_,LQ,KM,AQ],XV),FQ=(e,t,r)=>{var n=Ti(e,t);if(n!=null)return yo(e,"xAxis",n,r)},BQ=(e,t,r)=>{var n=Ii(e,t);if(n!=null)return yo(e,"yAxis",n,r)},qQ=(e,t,r)=>{var n=Ti(e,t);if(n!=null)return vo(e,"xAxis",n,r)},WQ=(e,t,r)=>{var n=Ii(e,t);if(n!=null)return vo(e,"yAxis",n,r)},UQ=ae([zQ,Rc],ZV),HQ=ae([IQ,Rc],QV),KQ=ae([Jt,Ng,FQ,BQ,qQ,WQ,UQ,ct,dU,KM,HQ,Rc,DQ],(e,t,r,n,a,i,o,l,c,d,u,f,m)=>{var{chartData:p,dataStartIndex:x,dataEndIndex:g}=c;if(!(f==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||a==null||i==null||d==null)){var{data:v}=f,y;if(v!=null&&v.length>0?y=v:y=p==null?void 0:p.slice(x,g+1),y!=null)return bZ({layout:l,barSettings:f,pos:o,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:a,yAxisTicks:i,stackedData:u,displayedData:y,offset:e,cells:m,dataStartIndex:x})}}),YQ=["index"];function $p(){return $p=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},$p.apply(null,arguments)}function GQ(e,t){if(e==null)return{};var r,n,a=VQ(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)&&(a[r]=e[r])}return a}function VQ(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 YM=h.createContext(void 0),XQ=e=>{var t=h.useContext(YM);if(t!=null)return t.stackId;if(e!=null)return bB(e)},QQ=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),ZQ=e=>{var t=h.useContext(YM);if(t!=null){var{stackId:r}=t;return"url(#".concat(QQ(r,e),")")}},GM=e=>{var{index:t}=e,r=GQ(e,YQ),n=ZQ(t);return h.createElement(Ws,$p({className:"recharts-bar-stack-layer",clipPath:n},r))},JQ=["onMouseEnter","onMouseLeave","onClick"],eZ=["value","background","tooltipPosition"],tZ=["id"],rZ=["onMouseEnter","onClick","onMouseLeave"];function Xs(){return Xs=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},Xs.apply(null,arguments)}function Nj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nj(Object(r),!0).forEach(function(n){nZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nZ(e,t,r){return(t=sZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sZ(e){var t=aZ(e,"string");return typeof t=="symbol"?t:t+""}function aZ(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){if(e==null)return{};var r,n,a=iZ(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)&&(a[r]=e[r])}return a}function iZ(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 oZ=e=>{var{dataKey:t,name:r,fill:n,legendType:a,hide:i}=e;return[{inactive:i,dataKey:t,type:a,color:n,value:gC(r,t),payload:e}]},lZ=h.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:a,name:i,hide:o,unit:l,tooltipType:c,id:d}=e,u={dataDefinedOnItem:void 0,getPosition:zo,settings:{stroke:r,strokeWidth:n,fill:a,dataKey:t,nameKey:void 0,name:gC(i,t),hide:o,type:c,color:a,unit:l,graphicalItemId:d}};return h.createElement(gV,{tooltipEntrySettings:u})});function cZ(e){var t=Ae(bo),{data:r,dataKey:n,background:a,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=Iu(i,JQ),u=AM(o,n,i.id),f=DM(l),m=TM(c,n,i.id);if(!a||r==null)return null;var p=eg(a);return h.createElement(da,{zIndex:JV(a,Mr.barBackground)},r.map((x,g)=>{var{value:v,background:y,tooltipPosition:b}=x,N=Iu(x,eZ);if(!y)return null;var w=u(x,g),k=f(x,g),j=m(x,g),C=Sr(Sr(Sr(Sr(Sr({option:a,isActive:String(g)===t},N),{},{fill:"#eee"},y),p),ag(d,x,g)),{},{onMouseEnter:w,onMouseLeave:k,onClick:j,dataKey:n,index:g,className:"recharts-bar-background-rectangle"});return h.createElement(Tu,Xs({key:"background-bar-".concat(g)},C))}))}function dZ(e){var{showLabels:t,children:r,rects:n}=e,a=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 Sr(Sr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return h.createElement(WG,{value:t?a:void 0},r)}function uZ(e){var{shape:t,activeBar:r,baseProps:n,entry:a,index:i,dataKey:o}=e,l=Ae(bo),c=Ae(tM),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?h.createElement(da,{zIndex:Mr.activeBar},h.createElement(GM,{index:i},h.createElement(Tu,Xs({},n,{name:String(n.name)},a,{isActive:d,option:u,index:i,dataKey:o})))):h.createElement(Tu,Xs({},n,{name:String(n.name)},a,{isActive:d,option:u,index:i,dataKey:o}))}function fZ(e){var{shape:t,baseProps:r,entry:n,index:a,dataKey:i}=e;return h.createElement(Tu,Xs({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:a,dataKey:i}))}function mZ(e){var t,{data:r,props:n}=e,a=(t=qs(n))!==null&&t!==void 0?t:{},{id:i}=a,o=Iu(a,tZ),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,p=Iu(n,rZ),x=AM(u,c,i),g=DM(m),v=TM(f,c,i);return r?h.createElement(h.Fragment,null,r.map((y,b)=>h.createElement(GM,Xs({index:b,key:"rectangle-".concat(y==null?void 0:y.x,"-").concat(y==null?void 0:y.y,"-").concat(y==null?void 0:y.value,"-").concat(b),className:"recharts-bar-rectangle"},ag(p,y,b),{onMouseEnter:x(y,b),onMouseLeave:g(y,b),onClick:v(y,b)}),d?h.createElement(uZ,{shape:l,activeBar:d,baseProps:o,entry:y,index:b,dataKey:c}):h.createElement(fZ,{shape:l,baseProps:o,entry:y,index:b,dataKey:c})))):null}function hZ(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:a,isAnimationActive:i,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,m=Mg(t,"recharts-bar-"),[p,x]=h.useState(!1),g=!p,v=h.useCallback(()=>{typeof d=="function"&&d(),x(!1)},[d]),y=h.useCallback(()=>{typeof u=="function"&&u(),x(!0)},[u]);return h.createElement(dZ,{showLabels:g,rects:n},h.createElement(Pg,{animationId:m,begin:o,duration:l,isActive:i,easing:c,onAnimationEnd:v,onAnimationStart:y,key:m},b=>{var N=b===1?n:n==null?void 0:n.map((w,k)=>{var j=f&&f[k];if(j)return Sr(Sr({},w),{},{x:ur(j.x,w.x,b),y:ur(j.y,w.y,b),width:ur(j.width,w.width,b),height:ur(j.height,w.height,b)});if(a==="horizontal"){var C=ur(0,w.height,b),P=ur(w.stackedBarStart,w.y,b);return Sr(Sr({},w),{},{y:P,height:C})}var S=ur(0,w.width,b),_=ur(w.stackedBarStart,w.x,b);return Sr(Sr({},w),{},{width:S,x:_})});return b>0&&(r.current=N??null),N==null?null:h.createElement(Ws,null,h.createElement(mZ,{props:t,data:N}))}),h.createElement(KG,{label:t.label}),t.children)}function pZ(e){var t=h.useRef(null);return h.createElement(hZ,{previousRectanglesRef:t,props:e})}var VM=0,xZ=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:Zt(e,t)}};class gZ extends h.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:a,xAxisId:i,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=lt("recharts-bar",a),f=d;return h.createElement(Ws,{className:u,id:d},l&&h.createElement("defs",null,h.createElement(rQ,{clipPathId:f,xAxisId:i,yAxisId:o})),h.createElement(Ws,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},h.createElement(cZ,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),h.createElement(pZ,this.props)))}}var vZ={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:VM,xAxisId:0,yAxisId:0,zIndex:Mr.bar};function yZ(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:a,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=HM(t,r),m=Fo(),p=en(),x=JG(e.children,fM),g=Ae(b=>KQ(b,e.id,p,x));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=g==null?void 0:g[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,h.createElement(tQ,{xAxisId:t,yAxisId:r,data:g,dataPointFormatter:xZ,errorBarOffset:v},h.createElement(gZ,Xs({},e,{layout:m,needClip:f,data:g,xAxisId:t,yAxisId:r,hide:n,legendType:a,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function bZ(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:a,bandSize:i,xAxis:o,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:m,cells:p,parentViewBox:x,dataStartIndex:g}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,b=wB({numericAxis:v}),N=v.scale.map(b);return f.map((w,k)=>{var j,C,P,S,_,M;if(u){var E=u[k+g];if(E==null)return null;j=pB(E,y)}else j=Zt(w,r),Array.isArray(j)||(j=[b,j]);var A=MQ(n,VM)(j[1],k);if(t==="horizontal"){var D,Z=l.scale.map(j[0]),Q=l.scale.map(j[1]);if(Z==null||Q==null)return null;C=Db({axis:o,ticks:c,bandSize:i,offset:a.offset,entry:w,index:k}),P=(D=Q??Z)!==null&&D!==void 0?D:void 0,S=a.size;var q=Z-Q;if(_=ms(q)?0:q,M={x:C,y:m.top,width:S,height:m.height},Math.abs(A)>0&&Math.abs(_)<Math.abs(A)){var te=Wr(_||A)*(Math.abs(A)-Math.abs(_));P-=te,_+=te}}else{var ne=o.scale.map(j[0]),I=o.scale.map(j[1]);if(ne==null||I==null)return null;if(C=ne,P=Db({axis:l,ticks:d,bandSize:i,offset:a.offset,entry:w,index:k}),S=I-ne,_=a.size,M={x:m.left,y:P,width:m.width,height:_},Math.abs(A)>0&&Math.abs(S)<Math.abs(A)){var O=Wr(S||A)*(Math.abs(A)-Math.abs(S));S+=O}}if(C==null||P==null||S==null||_==null)return null;var L=Sr(Sr({},w),{},{stackedBarStart:N,x:C,y:P,width:S,height:_,value:u?j:j[1],payload:w,background:M,tooltipPosition:{x:C+S/2,y:P+_/2},parentViewBox:x},p&&p[k]&&p[k].props);return L}).filter(Boolean)}function wZ(e){var t=gn(e,vZ),r=XQ(t.stackId),n=en();return h.createElement(NV,{id:t.id,type:"bar"},a=>h.createElement(h.Fragment,null,h.createElement(vV,{legendPayload:oZ(t)}),h.createElement(lZ,{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:a}),h.createElement(OV,{type:"bar",id:a,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}),h.createElement(da,{zIndex:t.zIndex},h.createElement(yZ,Xs({},t,{id:a})))))}var XM=h.memo(wZ,Tv);XM.displayName="Bar";var jZ=["domain","range"],NZ=["domain","range"];function kj(e,t){if(e==null)return{};var r,n,a=kZ(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)&&(a[r]=e[r])}return a}function kZ(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 Sj(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 QM(e,t){if(e===t)return!0;var{domain:r,range:n}=e,a=kj(e,jZ),{domain:i,range:o}=t,l=kj(t,NZ);return!Sj(r,i)||!Sj(n,o)?!1:Tv(a,l)}var SZ=["type"],CZ=["dangerouslySetInnerHTML","ticks","scale"],_Z=["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 Cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _j(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cj(Object(r),!0).forEach(function(n){PZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PZ(e,t,r){return(t=MZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MZ(e){var t=OZ(e,"string");return typeof t=="symbol"?t:t+""}function OZ(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 zp(e,t){if(e==null)return{};var r,n,a=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)&&(a[r]=e[r])}return a}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}function AZ(e){var t=Rt(),r=h.useRef(null),n=PC(),{type:a}=e,i=zp(e,SZ),o=em(n,"xAxis",a),l=h.useMemo(()=>{if(o!=null)return _j(_j({},i),{},{type:o})},[i,o]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(IV(l)):r.current!==l&&t(RV({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t($V(r.current)),r.current=null)},[t]),null}var DZ=e=>{var{xAxisId:t,className:r}=e,n=Ae(Ng),a=en(),i="xAxis",o=Ae(y=>TP(y,i,t,a)),l=Ae(y=>OP(y,t)),c=Ae(y=>bH(y,t)),d=Ae(y=>J_(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,p=zp(e,CZ),{id:x,scale:g}=d,v=zp(d,_Z);return h.createElement(Dv,Lp({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:lt("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},TZ={allowDataOverflow:Vt.allowDataOverflow,allowDecimals:Vt.allowDecimals,allowDuplicatedCategory:Vt.allowDuplicatedCategory,angle:Vt.angle,axisLine:$s.axisLine,height:Vt.height,hide:!1,includeHidden:Vt.includeHidden,interval:Vt.interval,label:!1,minTickGap:Vt.minTickGap,mirror:Vt.mirror,orientation:Vt.orientation,padding:Vt.padding,reversed:Vt.reversed,scale:Vt.scale,tick:Vt.tick,tickCount:Vt.tickCount,tickLine:$s.tickLine,tickSize:$s.tickSize,type:Vt.type,xAxisId:0},IZ=e=>{var t=gn(e,TZ);return h.createElement(h.Fragment,null,h.createElement(AZ,{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}),h.createElement(DZ,t))},ZM=h.memo(IZ,QM);ZM.displayName="XAxis";var RZ=["type"],$Z=["dangerouslySetInnerHTML","ticks","scale"],LZ=["id","scale"];function Fp(){return Fp=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},Fp.apply(null,arguments)}function Pj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Mj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pj(Object(r),!0).forEach(function(n){zZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zZ(e,t,r){return(t=FZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FZ(e){var t=BZ(e,"string");return typeof t=="symbol"?t:t+""}function BZ(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 Bp(e,t){if(e==null)return{};var r,n,a=qZ(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)&&(a[r]=e[r])}return a}function qZ(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 WZ(e){var t=Rt(),r=h.useRef(null),n=PC(),{type:a}=e,i=Bp(e,RZ),o=em(n,"yAxis",a),l=h.useMemo(()=>{if(o!=null)return Mj(Mj({},i),{},{type:o})},[o,i]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(LV(l)):r.current!==l&&t(zV({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(FV(r.current)),r.current=null)},[t]),null}function UZ(e){var{yAxisId:t,className:r,width:n,label:a}=e,i=h.useRef(null),o=h.useRef(null),l=Ae(Ng),c=en(),d=Rt(),u="yAxis",f=Ae(j=>EP(j,t)),m=Ae(j=>jH(j,t)),p=Ae(j=>TP(j,u,t,c)),x=Ae(j=>eP(j,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Mv(a)||h.isValidElement(a)||x==null)){var j=i.current;if(j){var C=j.getCalculatedWidth();Math.round(f.width)!==Math.round(C)&&d(BV({id:t,width:C}))}}},[p,f,d,a,t,n,x]),f==null||m==null||x==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:y}=e,b=Bp(e,$Z),{id:N,scale:w}=x,k=Bp(x,LZ);return h.createElement(Dv,Fp({},b,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:lt("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:p,axisType:u}))}var HZ={allowDataOverflow:Xt.allowDataOverflow,allowDecimals:Xt.allowDecimals,allowDuplicatedCategory:Xt.allowDuplicatedCategory,angle:Xt.angle,axisLine:$s.axisLine,hide:!1,includeHidden:Xt.includeHidden,interval:Xt.interval,label:!1,minTickGap:Xt.minTickGap,mirror:Xt.mirror,orientation:Xt.orientation,padding:Xt.padding,reversed:Xt.reversed,scale:Xt.scale,tick:Xt.tick,tickCount:Xt.tickCount,tickLine:$s.tickLine,tickSize:$s.tickSize,type:Xt.type,width:Xt.width,yAxisId:0},KZ=e=>{var t=gn(e,HZ);return h.createElement(h.Fragment,null,h.createElement(WZ,{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}),h.createElement(UZ,t))},JM=h.memo(KZ,QM);JM.displayName="YAxis";var YZ=(e,t)=>t,Iv=ae([YZ,ct,Q_,rr,QP,ca,$K,Jt],UK),Rv=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)}},eO=Pn("mouseClick"),tO=wc();tO.startListening({actionCreator:eO,effect:(e,t)=>{var r=e.payload,n=Iv(t.getState(),Rv(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(RH({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var qp=Pn("mouseMove"),rO=wc(),hd=null;rO.startListening({actionCreator:qp,effect:(e,t)=>{var r=e.payload;hd!==null&&cancelAnimationFrame(hd);var n=Rv(r);hd=requestAnimationFrame(()=>{var a=t.getState(),i=vv(a,a.tooltip.settings.shared);if(i==="axis"){var o=Iv(a,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(qP({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(BP())}hd=null})}});function GZ(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 Oj={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},nO=Jr({name:"rootProps",initialState:Oj,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:Oj.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}}}),VZ=nO.reducer,{updateOptions:XZ}=nO.actions,QZ=null,ZZ={updatePolarOptions:(e,t)=>t.payload},sO=Jr({name:"polarOptions",initialState:QZ,reducers:ZZ}),{updatePolarOptions:pne}=sO.actions,JZ=sO.reducer,aO=Pn("keyDown"),iO=Pn("focus"),$v=wc();$v.startListening({actionCreator:aO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:a}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var o=yv(a,Vo(r),Ec(r),Dc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=ca(r);if(i==="Enter"){var d=Mu(r,"axis","hover",String(a.index));t.dispatch(Ap({active:!a.active,activeIndex:a.index,activeCoordinate:d}));return}var u=CH(r),f=u==="left-to-right"?1:-1,m=i==="ArrowRight"?1:-1,p=l+m*f;if(!(c==null||p>=c.length||p<0)){var x=Mu(r,"axis","hover",String(p));t.dispatch(Ap({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}}}}}});$v.startListening({actionCreator:iO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:a}=r.tooltip;if(!a.active&&a.index==null){var i="0",o=Mu(r,"axis","hover",String(i));t.dispatch(Ap({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var wn=Pn("externalEvent"),oO=wc(),yh=new Map;oO.startListening({actionCreator:wn,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var a=n.type,i=yh.get(a);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:wK(l),activeDataKey:tM(l),activeIndex:bo(l),activeLabel:eM(l),activeTooltipIndex:bo(l),isTooltipActive:jK(l)};r(c,n)}finally{yh.delete(a)}});yh.set(a,o)}}});var eJ=ae([Yo],e=>e.tooltipItemPayloads),tJ=ae([eJ,(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:a}=n;if(a!=null)return a(t)}}}),lO=Pn("touchMove"),cO=wc();cO.startListening({actionCreator:lO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),a=vv(n,n.tooltip.settings.shared);if(a==="axis"){var i=r.touches[0];if(i==null)return;var o=Iv(n,Rv({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(qP({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(a==="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(PB),f=(l=d.getAttribute(MB))!==null&&l!==void 0?l:void 0,m=Go(n).find(g=>g.id===f);if(u==null||m==null||f==null)return;var{dataKey:p}=m,x=tJ(n,u,f);t.dispatch(FP({activeDataKey:p,activeIndex:u,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var rJ=F2({brush:tX,cartesianAxis:qV,chartData:wY,errorBars:VX,graphicalItems:PV,layout:dB,legend:gq,options:xY,polarAxis:GG,polarOptions:JZ,referenceElements:aX,rootProps:VZ,tooltip:$H,zIndex:sY}),nJ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return I8({reducer:rJ,preloadedState:t,middleware:n=>{var a;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([tO.middleware,rO.middleware,$v.middleware,oO.middleware,cO.middleware])},enhancers:n=>{var a=n;return typeof n=="function"&&(a=n()),a.concat(tC({type:"raf"}))},devTools:{serialize:{replacer:GZ},name:"recharts-".concat(r)}})};function sJ(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,a=en(),i=h.useRef(null);if(a)return r;i.current==null&&(i.current=nJ(t,n));var o=hg;return h.createElement(kQ,{context:o,store:i.current},r)}function aJ(e){var{layout:t,margin:r}=e,n=Rt(),a=en();return h.useEffect(()=>{a||(n(oB(t)),n(iB(r)))},[n,a,t,r]),null}var iJ=h.memo(aJ,Tv);function oJ(e){var t=Rt();return h.useEffect(()=>{t(XZ(e))},[t,e]),null}function Ej(e){var{zIndex:t,isPanorama:r}=e,n=h.useRef(null),a=Rt();return h.useLayoutEffect(()=>(n.current&&a(rY({zIndex:t,element:n.current,isPanorama:r})),()=>{a(nY({zIndex:t,isPanorama:r}))}),[a,t,r]),h.createElement("g",{tabIndex:-1,ref:n})}function Aj(e){var{children:t,isPanorama:r}=e,n=Ae(KK);if(!n||n.length===0)return t;var a=n.filter(o=>o<0),i=n.filter(o=>o>0);return h.createElement(h.Fragment,null,a.map(o=>h.createElement(Ej,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>h.createElement(Ej,{key:o,zIndex:o,isPanorama:r})))}var lJ=["children"];function cJ(e,t){if(e==null)return{};var r,n,a=dJ(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)&&(a[r]=e[r])}return a}function dJ(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 Ru(){return Ru=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},Ru.apply(null,arguments)}var uJ={width:"100%",height:"100%",display:"block"},fJ=h.forwardRef((e,t)=>{var r=CC(),n=_C(),a=$C();if(!ps(r)||!ps(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=a?0:void 0,typeof o.role=="string"?u=o.role:u=a?"application":void 0),h.createElement(US,Ru({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:uJ,ref:t}),i)}),mJ=e=>{var{children:t}=e,r=Ae(Ff);if(!r)return null;var{width:n,height:a,y:i,x:o}=r;return h.createElement(US,{width:n,height:a,x:o,y:i},t)},Dj=h.forwardRef((e,t)=>{var{children:r}=e,n=cJ(e,lJ),a=en();return a?h.createElement(mJ,null,h.createElement(Aj,{isPanorama:!0},r)):h.createElement(fJ,Ru({ref:t},n),h.createElement(Aj,{isPanorama:!1},r))});function hJ(){var e=Rt(),[t,r]=h.useState(null),n=Ae(_B);return h.useEffect(()=>{if(t!=null){var a=t.getBoundingClientRect(),i=a.width/t.offsetWidth;Ke(i)&&i!==n&&e(cB(i))}},[t,e,n]),r}function Tj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function pJ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tj(Object(r),!0).forEach(function(n){xJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xJ(e,t,r){return(t=gJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gJ(e){var t=vJ(e,"string");return typeof t=="symbol"?t:t+""}function vJ(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 Ma(){return Ma=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},Ma.apply(null,arguments)}var yJ=()=>(OY(),null);function $u(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var bJ=h.forwardRef((e,t)=>{var r,n,a=h.useRef(null),[i,o]=h.useState({containerWidth:$u((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:$u((n=e.style)===null||n===void 0?void 0:n.height)}),l=h.useCallback((d,u)=>{o(f=>{var m=Math.round(d),p=Math.round(u);return f.containerWidth===m&&f.containerHeight===p?f:{containerWidth:m,containerHeight:p}})},[]),c=h.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=x=>{var g=x[0];if(g!=null){var{width:v,height:y}=g.contentRect;l(v,y)}},p=new ResizeObserver(m);p.observe(d),a.current=p}},[t,l]);return h.useEffect(()=>()=>{var d=a.current;d!=null&&d.disconnect()},[l]),h.createElement(h.Fragment,null,h.createElement(Nc,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",Ma({ref:c},e)))}),wJ=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[a,i]=h.useState({containerWidth:$u(r),containerHeight:$u(n)}),o=h.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=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return h.createElement(h.Fragment,null,h.createElement(Nc,{width:a.containerWidth,height:a.containerHeight}),h.createElement("div",Ma({ref:l},e)))}),jJ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(Nc,{width:r,height:n}),h.createElement("div",Ma({ref:t},e)))}),NJ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?h.createElement(wJ,Ma({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(jJ,Ma({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(Nc,{width:r,height:n}),h.createElement("div",Ma({ref:t},e)))});function kJ(e){return e?bJ:NJ}var SJ=h.forwardRef((e,t)=>{var{children:r,className:n,height:a,onClick:i,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:m,onTouchEnd:p,onTouchMove:x,onTouchStart:g,style:v,width:y,responsive:b,dispatchTouchEvents:N=!0}=e,w=h.useRef(null),k=Rt(),[j,C]=h.useState(null),[P,S]=h.useState(null),_=hJ(),M=kg(),E=(M==null?void 0:M.width)>0?M.width:y,A=(M==null?void 0:M.height)>0?M.height:a,D=h.useCallback(z=>{_(z),typeof t=="function"&&t(z),C(z),S(z),z!=null&&(w.current=z)},[_,t,C,S]),Z=h.useCallback(z=>{k(eO(z)),k(wn({handler:i,reactEvent:z}))},[k,i]),Q=h.useCallback(z=>{k(qp(z)),k(wn({handler:d,reactEvent:z}))},[k,d]),q=h.useCallback(z=>{k(BP()),k(wn({handler:u,reactEvent:z}))},[k,u]),te=h.useCallback(z=>{k(qp(z)),k(wn({handler:f,reactEvent:z}))},[k,f]),ne=h.useCallback(()=>{k(iO())},[k]),I=h.useCallback(z=>{k(aO(z.key))},[k]),O=h.useCallback(z=>{k(wn({handler:o,reactEvent:z}))},[k,o]),L=h.useCallback(z=>{k(wn({handler:l,reactEvent:z}))},[k,l]),H=h.useCallback(z=>{k(wn({handler:c,reactEvent:z}))},[k,c]),R=h.useCallback(z=>{k(wn({handler:m,reactEvent:z}))},[k,m]),Y=h.useCallback(z=>{k(wn({handler:g,reactEvent:z}))},[k,g]),F=h.useCallback(z=>{N&&k(lO(z)),k(wn({handler:x,reactEvent:z}))},[k,N,x]),T=h.useCallback(z=>{k(wn({handler:p,reactEvent:z}))},[k,p]),G=kJ(b);return h.createElement(lM.Provider,{value:j},h.createElement(Yz.Provider,{value:P},h.createElement(G,{width:E??(v==null?void 0:v.width),height:A??(v==null?void 0:v.height),className:lt("recharts-wrapper",n),style:pJ({position:"relative",cursor:"default",width:E,height:A},v),onClick:Z,onContextMenu:O,onDoubleClick:L,onFocus:ne,onKeyDown:I,onMouseDown:H,onMouseEnter:Q,onMouseLeave:q,onMouseMove:te,onMouseUp:R,onTouchEnd:T,onTouchMove:F,onTouchStart:Y,ref:D},h.createElement(yJ,null),r)))}),CJ=["width","height","responsive","children","className","style","compact","title","desc"];function _J(e,t){if(e==null)return{};var r,n,a=PJ(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)&&(a[r]=e[r])}return a}function PJ(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 MJ=h.forwardRef((e,t)=>{var{width:r,height:n,responsive:a,children:i,className:o,style:l,compact:c,title:d,desc:u}=e,f=_J(e,CJ),m=qs(f);return c?h.createElement(h.Fragment,null,h.createElement(Nc,{width:r,height:n}),h.createElement(Dj,{otherAttributes:m,title:d,desc:u},i)):h.createElement(SJ,{className:o,style:l,width:r,height:n,responsive:a??!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},h.createElement(Dj,{otherAttributes:m,title:d,desc:u,ref:t},h.createElement(oX,null,i)))});function Wp(){return Wp=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},Wp.apply(null,arguments)}var OJ={top:5,right:5,bottom:5,left:5},EJ={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:OJ,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},AJ=h.forwardRef(function(t,r){var n,a=gn(t.categoricalChartProps,EJ),{chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(sJ,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},h.createElement(eX,{chartData:d.data}),h.createElement(iJ,{layout:a.layout,margin:a.margin}),h.createElement(oJ,{baseValue:a.baseValue,accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className,reverseStackOrder:a.reverseStackOrder}),h.createElement(MJ,Wp({},a,{ref:r})))}),DJ=["axis","item"],TJ=h.forwardRef((e,t)=>h.createElement(AJ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:DJ,tooltipPayloadSearcher:hY,categoricalChartProps:e,ref:t}));function ui(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function IJ({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:s.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[s.jsx("p",{className:"font-medium mb-0.5",children:r}),s.jsx("p",{className:"text-muted-foreground",children:ui(((n=t[0])==null?void 0:n.value)??0)})]})}function Lu({data:e,icon:t,title:r,barColor:n="#6366f1",yAxisWidth:a=100,rightMargin:i=40,minRowHeight:o=80}){return e.length===0?null:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t,s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:r})]}),s.jsx(JB,{width:"100%",height:Math.max(o,e.length*36),children:s.jsxs(TJ,{data:e,layout:"vertical",margin:{left:0,right:i,top:0,bottom:0},children:[s.jsx(WM,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),s.jsx(ZM,{type:"number",tickFormatter:l=>ui(l),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),s.jsx(JM,{type:"category",dataKey:"name",width:a,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),s.jsx(LY,{content:s.jsx(IJ,{}),cursor:{fill:"hsl(var(--muted))"}}),s.jsx(XM,{dataKey:"minutes",fill:n,radius:[0,4,4,0]})]})})]})}const Ui=20;function dO({workspaceId:e,orgScope:t=!1}){const[r,n]=h.useState(void 0),[a,i]=h.useState(void 0),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[m,p]=h.useState(0),{workspace:x}=Te(),g=(x==null?void 0:x.slug)??"",{data:v=[],isLoading:y}=sc(e?void 0:t?{allWorkspaces:!0,orgScope:!0}:u.length>0?{workspaceIds:u}:{allWorkspaces:!0}),{data:b=[],isLoading:N}=$z(e?[e]:u,c,{orgScope:t}),{data:w=[],isLoading:k}=Wn(t?{orgScope:!0}:!0),{data:j}=$a();h.useEffect(()=>{const G=new Set(v.map(z=>z.id));d(z=>{const se=z.filter(W=>G.has(W));return se.length===z.length?z:se})},[v]),h.useEffect(()=>{const G=new Set(b.map(z=>z.id));l(z=>{const se=z.filter(W=>G.has(W));return se.length===z.length?z:se})},[b]),h.useEffect(()=>{p(0)},[r,a,o,c,u]);const C=r?me(r,"yyyy-MM-dd"):void 0,P=a?me(a,"yyyy-MM-dd"):void 0,S=h.useMemo(()=>new Map(v.map(G=>[G.id,G])),[v]),_=h.useMemo(()=>new Map(w.map(G=>[G.id,G])),[w]),M=e?[e]:u.length>0?u:void 0,{data:E,isLoading:A}=BS({from:C,to:P,workspace_id:e,workspace_ids:M,org_scope:t||void 0,user_ids:o.length>0?o:void 0,project_ids:c.length>0?c:void 0,limit:Ui,offset:m},{enabled:!0}),D=(E==null?void 0:E.time_logs)??[],Z=(E==null?void 0:E.total_minutes)??0,Q=(E==null?void 0:E.total_employees)??0,q=(E==null?void 0:E.total_projects)??0,te=(E==null?void 0:E.count)??0,ne=h.useMemo(()=>{const G=new Map;for(const z of D)G.set(z.user_id,(G.get(z.user_id)??0)+(z.duration_minutes??0));return Array.from(G.entries()).map(([z,se])=>{var W;return{name:((W=j==null?void 0:j.get(z))==null?void 0:W.name)??"Unknown",minutes:se}}).sort((z,se)=>se.minutes-z.minutes).slice(0,8)},[D,j]),I=h.useMemo(()=>{const G=new Map;for(const z of D){const se=z.project_id??"__none__";G.set(se,(G.get(se)??0)+(z.duration_minutes??0))}return Array.from(G.entries()).map(([z,se])=>{var W;return{name:z==="__none__"?"No project":((W=S.get(z))==null?void 0:W.name)??"Unknown",minutes:se}}).sort((z,se)=>se.minutes-z.minutes).slice(0,8)},[D,S]),O=h.useMemo(()=>b.map(G=>({value:G.id,label:[G.first_name,G.last_name].filter(Boolean).join(" ")||G.email})),[b]),L=h.useMemo(()=>w.map(G=>({value:G.id,label:G.name})),[w]),H=h.useMemo(()=>v.map(G=>({value:G.id,label:G.name})),[v]),R=m+Ui<te,Y=m>0,F=Math.floor(m/Ui)+1,T=Math.max(1,Math.ceil(te/Ui));return s.jsxs("div",{className:"p-2 space-y-2",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-6 py-4 flex items-center gap-3",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:s.jsx(Ls,{className:"h-4 w-4 text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold",children:"Time Logs"}),s.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."})]})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(mi,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Date range"})]}),s.jsx(Wd,{value:r,onChange:n,placeholder:"From"}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),s.jsx(Wd,{value:a,onChange:i,placeholder:"To"})]}),!e&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(Od,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Workspaces"})]}),k?s.jsx(le,{className:"h-8 w-40"}):s.jsx(Is,{options:L,selected:u,onSelectionChange:f,placeholder:"All workspaces",className:"w-44"})]})]}),s.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(Ps,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Employees"})]}),N?s.jsx(le,{className:"h-8 w-40"}):s.jsx(Is,{options:O,selected:o,onSelectionChange:l,placeholder:"All employees",className:"w-44"})]}),s.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(Yr,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Projects"})]}),y?s.jsx(le,{className:"h-8 w-40"}):s.jsx(Is,{options:H,selected:c,onSelectionChange:d,placeholder:"All projects",className:"w-44"})]})]}),A?s.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(G=>s.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[s.jsx(le,{className:"h-4 w-24"}),s.jsx(le,{className:"h-4 w-32"}),s.jsx(le,{className:"h-4 w-48"})]},G))}):D.length===0&&m===0?s.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:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(dn,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logs found"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:C||P||o.length>0||c.length>0||u.length>0?"Try adjusting your filters.":"No time has been logged yet."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Total time"}),s.jsx("p",{className:"text-2xl font-bold tabular-nums",children:ui(Z)})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Employees"}),s.jsx("p",{className:"text-2xl font-bold tabular-nums",children:Q})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Projects"}),s.jsx("p",{className:"text-2xl font-bold tabular-nums",children:q})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx(Lu,{data:ne,icon:s.jsx(Ps,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by employee"}),s.jsx(Lu,{data:I,icon:s.jsx(Yr,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by project"})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Workspace"}),s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Employee"}),s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Project"}),s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Date"}),s.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Description"}),s.jsx("th",{className:"text-right px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Duration"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:D.map(G=>{var X,ie,V;const z=G.project_id?S.get(G.project_id):void 0,se=((X=_.get(G.workspace_id))==null?void 0:X.slug)??g,W=((ie=j==null?void 0:j.get(G.user_id))==null?void 0:ie.name)??G.user_id.slice(0,8)+"…";return s.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[s.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:((V=_.get(G.workspace_id))==null?void 0:V.name)??"—"}),s.jsx("td",{className:"px-6 py-3 text-xs font-medium",children:W}),s.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(z==null?void 0:z.name)??(G.project_id?"Unknown":"—")}),s.jsx("td",{className:"px-6 py-3",children:G.issue_identifier?s.jsx(hr,{to:`/${se}/projects/${z==null?void 0:z.identifier}/issues/${G.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:G.issue_identifier}):s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[G.issue_id.slice(0,8),"…"]})}),s.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:G.logged_date?me(new Date(G.logged_date),"MMM d, yyyy"):"—"}),s.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:G.description??s.jsx("span",{className:"italic",children:"—"})}),s.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:G.duration_minutes!=null?ui(G.duration_minutes):"Running…"})]},G.id)})})]}),T>1&&s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border bg-muted/10",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[te," total log",te!==1?"s":""]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{type:"button",disabled:!Y,onClick:()=>p(Math.max(0,m-Ui)),className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md border border-border hover:bg-accent disabled:opacity-40 disabled:pointer-events-none transition-colors",children:[s.jsx(us,{className:"h-3.5 w-3.5"}),"Prev"]}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:["Page ",F," of ",T]}),s.jsxs("button",{type:"button",disabled:!R,onClick:()=>p(m+Ui),className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md border border-border hover:bg-accent disabled:opacity-40 disabled:pointer-events-none transition-colors",children:["Next",s.jsx(pr,{className:"h-3.5 w-3.5"})]})]})]})]})]})]})}function RJ(){const{projectKey:e,workspace:t}=It(),[r,n]=h.useState(void 0),[a,i]=h.useState(void 0),[o,l]=h.useState([]),{data:c}=ea(e??""),{data:d}=$a(),{data:u=[]}=Ck(),f=r?me(r,"yyyy-MM-dd"):void 0,m=a?me(a,"yyyy-MM-dd"):void 0,{data:p,isLoading:x}=BS({project_id:c==null?void 0:c.id,from:f,to:m}),g=(p==null?void 0:p.time_logs)??[],v=h.useMemo(()=>o.length>0?g.filter(P=>o.includes(P.user_id)):g,[g,o]),y=h.useMemo(()=>v.reduce((P,S)=>P+(S.duration_minutes??0),0),[v]),b=h.useMemo(()=>{const P=new Map;for(const S of v){P.has(S.user_id)||P.set(S.user_id,{logs:[],totalMinutes:0});const _=P.get(S.user_id);_.logs.push(S),_.totalMinutes+=S.duration_minutes??0}return P},[v]),N=h.useMemo(()=>{const P=new Map;for(const S of v){P.has(S.issue_id)||P.set(S.issue_id,{logs:[],totalMinutes:0});const _=P.get(S.issue_id);_.logs.push(S),_.totalMinutes+=S.duration_minutes??0}return P},[v]),w=Array.from(b.entries()).sort((P,S)=>S[1].totalMinutes-P[1].totalMinutes).slice(0,8).map(([P,{totalMinutes:S}])=>{var _;return{name:((_=d==null?void 0:d.get(P))==null?void 0:_.name)??"Unknown",minutes:S}}),k=Array.from(N.entries()).sort((P,S)=>S[1].totalMinutes-P[1].totalMinutes).slice(0,8).map(([P,{totalMinutes:S,logs:_}])=>{var M;return{name:((M=_[0])==null?void 0:M.issue_identifier)??P.slice(0,8),minutes:S}}),j=h.useMemo(()=>u.map(P=>({value:P.id,label:[P.first_name,P.last_name].filter(Boolean).join(" ")||P.email})),[u]),C=v.length>0;return s.jsxs("div",{className:"p-2 pb-24 md:pb-2 space-y-2",children:[s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(mi,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Date range"})]}),s.jsx(Wd,{value:r,onChange:n,placeholder:"From"}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),s.jsx(Wd,{value:a,onChange:i,placeholder:"To"})]}),s.jsx("div",{className:"hidden md:block w-px h-4 bg-border"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[s.jsx(Ps,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"font-medium",children:"Employee"})]}),s.jsx(Is,{options:j,selected:o,onSelectionChange:l,placeholder:"All employees",className:"w-44"})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"Total logged",value:y>0?ui(y):"—",icon:dn},{label:"Contributors",value:b.size>0?String(b.size):"—",icon:Ps},{label:"Issues tracked",value:N.size>0?String(N.size):"—",icon:cs}].map(({label:P,value:S,icon:_})=>s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-3 md:px-5 py-3 md:py-4 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[s.jsx(_,{className:"h-3.5 w-3.5 text-muted-foreground hidden md:block shrink-0"}),s.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium break-all",children:P})]}),s.jsx("p",{className:"text-xl md:text-2xl font-bold tabular-nums",children:S})]},P))}),x?s.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:s.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(P=>s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[s.jsx(le,{className:"h-7 w-7 rounded-full"}),s.jsx(le,{className:"h-4 w-40"}),s.jsx("div",{className:"flex-1"}),s.jsx(le,{className:"h-4 w-20"})]},P))})}):c!=null&&c.id?C?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[s.jsx(Lu,{data:w,icon:s.jsx(Ps,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by user",yAxisWidth:88,rightMargin:32,minRowHeight:100}),s.jsx(Lu,{data:k,icon:s.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by issue",barColor:"#818cf8",yAxisWidth:64,rightMargin:32,minRowHeight:100})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[s.jsx(Ps,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[s.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"User"}),s.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issues"}),s.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:Array.from(b.entries()).sort((P,S)=>S[1].totalMinutes-P[1].totalMinutes).map(([P,{logs:S,totalMinutes:_}])=>{const M=d==null?void 0:d.get(P),E=new Set(S.map(A=>A.issue_id)).size;return s.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[s.jsx("td",{className:"px-6 py-3 text-sm font-medium",children:(M==null?void 0:M.name)??P.slice(0,8)+"…"}),s.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:E}),s.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ui(_)})]},P)})})]})]}),s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[s.jsx(cs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[s.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),s.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Last logged"}),s.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Contributors"}),s.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:Array.from(N.entries()).sort((P,S)=>S[1].totalMinutes-P[1].totalMinutes).map(([P,{logs:S,totalMinutes:_}])=>{var Z,Q;const M=new Set(S.map(q=>q.user_id)).size,E=S.reduce((q,te)=>te.logged_date&&(!q||new Date(te.logged_date)>new Date(q))?te.logged_date:q,null),A=(Z=S[0])==null?void 0:Z.issue_identifier,D=(Q=S[0])==null?void 0:Q.issue_title;return s.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[s.jsx("td",{className:"px-6 py-3",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[A?s.jsx(hr,{to:`/${t}/projects/${e}/issues/${P}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:A}):s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[P.slice(0,8),"…"]}),D&&s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:D})]})}),s.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:E?me(new Date(E),"MMM d, yyyy"):"—"}),s.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:M}),s.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ui(_)})]},P)})})]})]})]}):s.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:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:s.jsx(Ls,{className:"h-5 w-5 text-muted-foreground"})}),s.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logged"}),s.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."})]}):s.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex items-center justify-center py-12",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading project…"})})]})}const $J={share_enabled:{icon:Oh,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:eD,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:ln,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,a=r?((l=t.get(r))==null?void 0:l.name)??r:"a user";return n?`Added ${a} as ${n}`:`Added ${a}`}},member_removed:{icon:fN,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:(e,t)=>{var a,i;const r=(a=e==null?void 0:e.user_id)==null?void 0:a.from;return`Removed ${r?((i=t.get(r))==null?void 0:i.name)??r:"a user"}`}},team_added:{icon:Ps,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:Ah,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:uD,color:"text-violet-500",bg:"bg-violet-50 dark:bg-violet-950/40",label:e=>{var n,a;const t=(n=e==null?void 0:e.name)==null?void 0:n.from,r=(a=e==null?void 0:e.name)==null?void 0:a.to;return t&&r?`Renamed status "${t}" to "${r}"`:"Updated status"}},status_deleted:{icon:wr,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"}},health_update_updated:{icon:Fs,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:e=>{var r;const t=(r=e==null?void 0:e.title)==null?void 0:r.to;return t?`Edited status update "${t}"`:"Edited a status update"}},health_update_deleted:{icon:wr,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.title)==null?void 0:r.from;return t?`Deleted status update "${t}"`:"Deleted a status update"}},updated:{icon:Fs,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:ot,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"},transferred:{icon:Md,color:"text-sky-500",bg:"bg-sky-50 dark:bg-sky-950/40",label:e=>{var n,a;const t=(n=e==null?void 0:e.from_workspace_name)==null?void 0:n.from,r=(a=e==null?void 0:e.to_workspace_name)==null?void 0:a.to;return t&&r?`Transferred project from "${t}" to "${r}"`:r?`Transferred project to "${r}"`:"Transferred project"}},access_requested:{icon:ln,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40",label:(e,t)=>{var a;const r=e==null?void 0:e.user_id;return`${r?((a=t.get(r))==null?void 0:a.name)??r:"a user"} requested access`}},access_request_approved:{icon:ln,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:(e,t)=>{var a;const r=e==null?void 0:e.user_id;return`Approved access request from ${r?((a=t.get(r))==null?void 0:a.name)??r:"a user"}`}},access_request_denied:{icon:Ah,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:(e,t)=>{var a;const r=e==null?void 0:e.user_id;return`Denied access request from ${r?((a=t.get(r))==null?void 0:a.name)??r:"a user"}`}}},LJ={icon:Ml,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function zJ({activity:e,userMap:t,teamMap:r}){const n=$J[e.action]??LJ,a=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?s.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono break-all",children:m}):null}return null})();return s.jsxs("div",{className:"flex items-start md:items-center gap-3 md:gap-4 px-4 md:px-6 py-4 hover:bg-muted/30 transition-colors",children:[s.jsx("div",{className:$("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:s.jsx(a,{className:$("h-4 w-4",n.color)})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-x-2 gap-y-0.5",children:[s.jsx(_t,{className:"h-5 w-5 shrink-0",children:s.jsx(Pt,{className:"text-[10px] font-medium",children:l})}),s.jsx("span",{className:"text-sm font-medium truncate",children:o}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:c})]}),s.jsx("time",{className:"md:hidden text-[11px] text-muted-foreground/70 mt-1 block",children:me(new Date(e.created_at),"MMM d, yyyy · h:mm a")}),d&&s.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),s.jsx("time",{className:"hidden md:block text-xs text-muted-foreground shrink-0",children:me(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function FJ(){const{projectKey:e}=It(),{workspace:t}=Te(),{data:r}=ea(e??""),{data:n,isLoading:a}=fT((r==null?void 0:r.id)??""),{data:i=new Map}=$a(),{data:o=[]}=Vu((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 s.jsx("div",{className:"p-2 pb-24 md:pb-2",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold",children:"Activity"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"A log of share access changes, member updates, and project edits."})]}),!a&&c>0&&s.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[c," event",c!==1?"s":""]})]}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Log"})}),a?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(d=>s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[s.jsx(le,{className:"h-8 w-8 rounded-full shrink-0"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(le,{className:"h-4 w-48"}),s.jsx(le,{className:"h-3 w-64"})]}),s.jsx(le,{className:"h-3 w-32 shrink-0"})]},d))}):!n||n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx(Ml,{className:"h-8 w-8 text-muted-foreground/20 mb-3"}),s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No activity yet"}),s.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Actions like sharing the project or adding members will appear here."})]}):s.jsx("div",{className:"divide-y divide-border",children:n.map(d=>s.jsx(zJ,{activity:d,userMap:i,teamMap:l},d.id))})]})})}function uO(){return De({queryKey:["me"],queryFn:()=>oe.get("/admin/users/me")})}function BJ(){const e=ye(),{updateLocalUser:t}=Te();return xe({mutationFn:r=>oe.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 qJ(){const e=ye(),{updateLocalUser:t}=Te();return xe({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),oe.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function WJ(){const e=ye(),{updateLocalUser:t}=Te();return xe({mutationFn:()=>oe.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function UJ(){return xe({mutationFn:()=>oe.post("/admin/users/me/password/send-otp",{})})}function HJ(){const e=ye();return xe({mutationFn:t=>oe.post("/admin/users/me/password",t),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function KJ(){const e=ye();return xe({mutationFn:()=>oe.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}const YJ=[{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"}],GJ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function VJ({open:e,onClose:t,holiday:r}){const[n,a]=h.useState((r==null?void 0:r.name)??""),[i,o]=h.useState(r!=null&&r.date?r.date.split("T")[0]:""),[l,c]=h.useState((r==null?void 0:r.recurring)??!1);h.useEffect(()=>{e&&(a((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=LR(),u=zR(),f=d.isPending||u.isPending,m=p=>{if(p.preventDefault(),!n.trim()){B.error("Holiday name is required");return}if(!i){B.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{B.success("Holiday updated"),t()},onError:()=>B.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{B.success("Holiday added"),t()},onError:()=>B.error("Failed to add holiday")})};return s.jsx(hn,{open:e,onOpenChange:p=>!p&&t(),children:s.jsxs(Qr,{className:"sm:max-w-md",children:[s.jsxs(pn,{children:[s.jsx(xn,{children:r?"Edit holiday":"Add holiday"}),s.jsx(Eo,{children:"Holidays are excluded from business day calculations across the app."})]}),s.jsxs("form",{onSubmit:m,className:"space-y-4 pt-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),s.jsx(_e,{value:n,onChange:p=>a(p.target.value),placeholder:"e.g. New Year's Day",className:"h-9",autoFocus:!0,required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Date"}),s.jsx(_e,{type:"date",value:i,onChange:p=>o(p.target.value),className:"h-9",required:!0})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Lo,{checked:l,onCheckedChange:p=>c(p)}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Recurring annually (applies every year on the same date)"})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),s.jsx(re,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function XJ(){const{data:e,isLoading:t}=Bx(),r=$R(),n=(e==null?void 0:e.working_days)??GJ,a=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>B.success("Working days updated"),onError:()=>B.error("Failed to update working days")})};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 min-h-[45px] flex items-center",children:s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Working days"})}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure which days count as business days. This affects duration calculations across the app."})}),t?s.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3,4,5,6,7].map(i=>s.jsx(le,{className:"h-8 w-full"},i))}):YJ.map(({key:i,label:o})=>{const l=n[i];return s.jsxs("div",{className:"grid grid-cols-[180px_1fr_auto] items-center gap-4 px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),s.jsx("span",{className:$("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),s.jsx(Lo,{checked:l,onCheckedChange:c=>a(i,c),disabled:r.isPending})]},i)})]})}function QJ(){const[e,t]=h.useState(new Date().getFullYear()),[r,n]=h.useState(!1),[a,i]=h.useState(null),[o,l]=h.useState(null),{data:c=[],isLoading:d}=qx(e),u=FR(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{B.success("Holiday removed"),l(null)},onError:()=>B.error("Failed to remove holiday")})},m=[...c].sort((p,x)=>{const g=new Date(p.date).getMonth()*100+new Date(p.date).getDate(),v=new Date(x.date).getMonth()*100+new Date(x.date).getDate();return g-v});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Holidays"}),s.jsxs(re,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}),s.jsxs("div",{className:"flex items-center gap-1 px-6 py-3 border-b border-border bg-muted/10",children:[s.jsxs("p",{className:"text-xs text-muted-foreground flex-1",children:["Showing holidays for"," ",s.jsx("span",{className:"font-medium text-foreground",children:e}),". Recurring holidays appear every year."]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>t(p=>p-1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsx("span",{className:"text-xs font-medium tabular-nums w-10 text-center",children:e}),s.jsx("button",{onClick:()=>t(p=>p+1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"hidden md:grid grid-cols-[160px_1fr_120px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Date"}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Name"}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Recurrence"}),s.jsx("span",{})]}),d?s.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(p=>s.jsx(le,{className:"h-8 w-full"},p))}):m.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center",children:[s.jsx(Z1,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),s.jsxs("p",{className:"text-sm font-medium mb-1",children:["No holidays for ",e]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Add a holiday or use the year navigation to view other years."}),s.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(p=>{const x=new Date(p.date),g=s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.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:s.jsx(zs,{className:"h-3.5 w-3.5"})})}),s.jsxs(Ar,{align:"end",className:"w-36",children:[s.jsxs(Ye,{className:"gap-2 cursor-pointer",onClick:()=>{i(p),n(!0)},children:[s.jsx(Fs,{className:"h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Ye,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(p),children:[s.jsx(wr,{className:"h-3.5 w-3.5"}),"Remove"]})]})]});return s.jsxs("div",{children:[s.jsxs("div",{className:"hidden md: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:[s.jsx("span",{className:"text-sm tabular-nums text-muted-foreground",children:me(x,"MMM d, yyyy")}),s.jsx("span",{className:"text-sm font-medium truncate",children:p.name}),s.jsx("span",{className:"text-sm",children:p.recurring?s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ro,{className:"h-3 w-3"}),"Every year"]}):s.jsx("span",{className:"text-xs text-muted-foreground/60",children:"One-time"})}),s.jsx("div",{className:"flex justify-end",children:g})]}),s.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 border-b border-border hover:bg-muted/20 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:p.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:me(x,"MMM d, yyyy")}),p.recurring&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ro,{className:"h-3 w-3"}),"Recurring"]})]})]}),g]})]},p.id)}),s.jsx(VJ,{open:r,onClose:()=>{n(!1),i(null)},holiday:a}),s.jsx(oi,{open:!!o,onOpenChange:p=>!p&&l(null),children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsxs(ka,{children:['Remove "',o==null?void 0:o.name,'"?']}),s.jsx(Sa,{children:"This holiday will no longer be excluded from business day calculations."})]}),s.jsxs(Na,{children:[s.jsx(_a,{children:"Cancel"}),s.jsx(Ca,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}const Ij=["super-admin","admin","member"],bh={"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"},pd={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 Rj({value:e}){const[t,r]=h.useState(!1),n=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return s.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Copy",children:t?s.jsx(At,{className:"h-3.5 w-3.5 text-emerald-500"}):s.jsx(cx,{className:"h-3.5 w-3.5"})})}const wh={"super-admin":3,admin:2,moderator:1,member:0},Br=20;function ZJ(){const{data:e}=uO(),t=wh[(e==null?void 0:e.role)??"member"]??0,[r,n]=h.useState(""),[a,i]=h.useState(""),[o,l]=h.useState(0),[c,d]=h.useState(0);h.useEffect(()=>{const R=setTimeout(()=>{i(r.trim()),l(0),d(0)},400);return()=>clearTimeout(R)},[r]);const{data:u,isLoading:f}=Sk({limit:Br,offset:o*Br,q:a}),m=(u==null?void 0:u.users)??[],p=(u==null?void 0:u.count)??0,{data:x,isLoading:g}=gR({limit:Br,offset:c*Br,q:a}),v=(x==null?void 0:x.invitations)??[],y=(x==null?void 0:x.count)??0,{data:b=[]}=vf(),N=zS(),w=wR(),k=jR(),j=NR(),C=vR(),P=yR(),S=bR(),[_,M]=h.useState(null),[E,A]=h.useState(null),[D,Z]=h.useState(null),[Q,q]=h.useState(!1),[te,ne]=h.useState(""),[I,O]=h.useState("member"),L=R=>{R.preventDefault(),te.trim()&&S.mutate({email:te.trim().toLowerCase(),role:I},{onSuccess:()=>{B.success(`Invitation sent to ${te.trim()}`),q(!1),ne(""),O("member")},onError:Y=>B.error((Y==null?void 0:Y.message)??"Failed to send invitation")})},H=()=>{_&&k.mutate(_,{onSuccess:()=>{B.success("User deactivated"),M(null)},onError:()=>B.error("Failed to deactivate user")})};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["All users",!f&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:p})]}),s.jsxs(re,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>q(!0),children:[s.jsx(ot,{className:"h-3.5 w-3.5"}),"Invite member"]})]}),s.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/10 flex items-center gap-3",children:[s.jsx("p",{className:"text-xs text-muted-foreground flex-1",children:"View and manage all platform users. Change a user's custom role or remove them from the system."}),s.jsx(_e,{value:r,onChange:R=>n(R.target.value),placeholder:"Search by email or name…",className:"h-8 text-xs w-56 shrink-0"})]}),s.jsx(hn,{open:Q,onOpenChange:R=>{R||(q(!1),ne(""),O("member"))},children:s.jsxs(Qr,{className:"sm:max-w-md",children:[s.jsx(pn,{children:s.jsx(xn,{children:"Invite member"})}),s.jsxs("form",{onSubmit:L,className:"space-y-4 pt-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Email"}),s.jsx(_e,{type:"email",value:te,onChange:R=>ne(R.target.value),placeholder:"name@example.com",className:"h-9",autoFocus:!0,required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),s.jsxs(Be,{value:I,onValueChange:O,children:[s.jsx(ze,{className:"h-9 text-sm",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Ij.map(R=>s.jsx(ke,{value:R,className:"text-sm capitalize",children:R},R))})]})]}),s.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."}),s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>q(!1),children:"Cancel"}),s.jsx(re,{type:"submit",size:"sm",disabled:S.isPending,children:S.isPending?"Sending…":"Send invite"})]})]})]})}),s.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_100px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"User"}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Global role"}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom role"}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Joined"}),s.jsx("span",{})]}),f?s.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(R=>s.jsx(le,{className:"h-10 w-full"},R))}):m.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Ps,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),s.jsx("p",{className:"text-sm font-medium",children:a?"No users match your search":"No users found"}),a&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Try a different search term."})]}):s.jsxs(s.Fragment,{children:[m.map(R=>{var ue;const Y=R.first_name??"",F=R.last_name??"",T=`${Y} ${F}`.trim()||R.email,G=(Y[0]??F[0]??((ue=R.email)==null?void 0:ue[0])??"U").toUpperCase(),z=wh[R.role??"member"]??0,se=R.id===(e==null?void 0:e.id),W=!se&&z<t,X=W?s.jsxs(Be,{value:R.role??"member",onValueChange:de=>w.mutate({userId:R.id,role:de},{onSuccess:()=>B.success("Global role updated"),onError:ee=>B.error((ee==null?void 0:ee.message)??"Failed to update global role")}),children:[s.jsx(ze,{className:"h-7 text-xs w-full",children:s.jsx(Ve,{})}),s.jsx(Fe,{children:Ij.filter(de=>(wh[de]??0)<=t).map(de=>s.jsx(ke,{value:de,className:"text-xs",children:s.jsx("span",{className:$("inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",bh[de]),children:de})},de))})]}):s.jsx("span",{className:$("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",bh[R.role??"member"]??bh.member),children:R.role??"member"}),ie=s.jsxs(Be,{value:R.app_role_id??"none",disabled:!W,onValueChange:de=>N.mutate({userId:R.id,appRoleId:de==="none"?null:de},{onSuccess:()=>B.success("Custom role updated"),onError:()=>B.error("Failed to update custom role")}),children:[s.jsx(ze,{className:$("h-7 text-xs w-full",!W&&"opacity-60 cursor-not-allowed"),children:s.jsx(Ve,{placeholder:"No role"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"none",className:"text-xs",children:"No role"}),b.map(de=>s.jsx(ke,{value:de.id,className:"text-xs",children:de.name},de.id))]})]}),V=R.is_active!==!1,J=W?s.jsxs(Gr,{children:[s.jsx(Vr,{asChild:!0,children:s.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:s.jsx(zs,{className:"h-3.5 w-3.5"})})}),s.jsx(Ar,{align:"end",className:"w-40",children:V?s.jsxs(Ye,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>M(R.id),children:[s.jsx(Ah,{className:"h-3.5 w-3.5"}),"Deactivate user"]}):s.jsxs(Ye,{className:"gap-2 cursor-pointer",onClick:()=>{j.mutate(R.id,{onSuccess:()=>B.success("User reactivated"),onError:()=>B.error("Failed to reactivate user")})},children:[s.jsx(gD,{className:"h-3.5 w-3.5"}),"Reactivate user"]})})]}):null;return s.jsxs("div",{className:"border-b border-border hover:bg-muted/20 transition-colors group",children:[s.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_100px_40px] gap-4 items-center px-6 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.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:G}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium truncate",children:[T,se&&s.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!V&&s.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:R.email})]})]}),X,ie,s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:R.created_at?me(new Date(R.created_at),"MMM d, yyyy"):"—"}),s.jsx("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:J})]}),s.jsxs("div",{className:"md:hidden px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 mb-2",children:[s.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:G}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"text-sm font-medium truncate",children:[T,se&&s.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!V&&s.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:R.email})]}),J]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1",children:X}),s.jsx("div",{className:"flex-1",children:ie})]})]})]},R.id)}),p>Br&&s.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[o*Br+1,"–",Math.min((o+1)*Br,p)," of ",p]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>l(R=>R-1),disabled:o===0,children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[o+1," / ",Math.ceil(p/Br)]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>l(R=>R+1),disabled:(o+1)*Br>=p,children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]})]}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 mt-2",children:s.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Invitations",!g&&y>0&&s.jsx(Cn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:y})]})}),g?s.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(R=>s.jsx(le,{className:"h-8 w-full"},R))}):v.length===0?s.jsx("div",{className:"px-6 py-6 text-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:a?"No invitations match your search.":"No pending invitations."})}):v.map(R=>{const Y=`${window.location.origin}/invite/${R.token}`;return s.jsxs("div",{className:"px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors group",children:[s.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[s.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(Oa,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:R.email??"Shareable link"}),s.jsx("span",{className:$("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",R.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":R.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:R.role==="super-admin"?"Super Admin":R.role==="admin"?"Admin":"Member"}),R.workspace_name&&s.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:["· ",R.workspace_name]})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[320px]",children:Y}),s.jsx(Rj,{value:Y})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[s.jsx("span",{className:$("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",pd[R.status]??pd.revoked),children:R.status}),s.jsx("span",{className:"text-xs text-muted-foreground",children:me(new Date(R.created_at),"MMM d")}),R.status==="pending"&&R.email&&s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>Z(R),disabled:P.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:s.jsx(Ad,{className:$("h-3.5 w-3.5",P.isPending&&"animate-spin")})})}),s.jsx(Bn,{children:"Resend invite"})]}),R.status==="pending"&&s.jsx("button",{onClick:()=>A(R),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"md:hidden space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(Oa,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:R.email??"Shareable link"}),s.jsx("span",{className:$("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",R.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":R.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:R.role==="super-admin"?"Super Admin":R.role==="admin"?"Admin":"Member"})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx("span",{className:$("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",pd[R.status]??pd.revoked),children:R.status}),R.status==="pending"&&R.email&&s.jsx("button",{onClick:()=>Z(R),disabled:P.isPending,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:s.jsx(Ad,{className:$("h-3.5 w-3.5",P.isPending&&"animate-spin")})}),R.status==="pending"&&s.jsx("button",{onClick:()=>A(R),className:"text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:s.jsx(We,{className:"h-3.5 w-3.5"})})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pl-10",children:[s.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate flex-1 min-w-0",children:Y}),s.jsx(Rj,{value:Y}),R.workspace_name&&s.jsx("span",{className:"text-[11px] text-muted-foreground truncate shrink-0 max-w-[80px]",children:R.workspace_name}),s.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:me(new Date(R.created_at),"MMM d")})]})]})]},R.id)}),y>Br&&s.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[c*Br+1,"–",Math.min((c+1)*Br,y)," of ",y]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>d(R=>R-1),disabled:c===0,children:s.jsx(us,{className:"h-3.5 w-3.5"})}),s.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[c+1," / ",Math.ceil(y/Br)]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>d(R=>R+1),disabled:(c+1)*Br>=y,children:s.jsx(pr,{className:"h-3.5 w-3.5"})})]})]}),s.jsx(oi,{open:!!_,onOpenChange:R=>!R&&M(null),children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsx(ka,{children:"Deactivate this user?"}),s.jsx(Sa,{children:"The user will lose access immediately and be hidden from member lists. You can reactivate them later."})]}),s.jsxs(Na,{children:[s.jsx(_a,{children:"Cancel"}),s.jsx(Ca,{onClick:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Deactivate"})]})]})}),s.jsx(oi,{open:!!E,onOpenChange:R=>!R&&A(null),children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsx(ka,{children:"Revoke this invitation?"}),s.jsxs(Sa,{children:["The invite link sent to ",s.jsx("span",{className:"font-medium",children:E==null?void 0:E.email})," will no longer work."]})]}),s.jsxs(Na,{children:[s.jsx(_a,{children:"Cancel"}),s.jsx(Ca,{onClick:()=>{E&&C.mutate(E.id,{onSuccess:()=>{B.success("Invitation revoked"),A(null)},onError:()=>B.error("Failed to revoke invitation")})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke"})]})]})}),s.jsx(oi,{open:!!D,onOpenChange:R=>!R&&Z(null),children:s.jsxs(wa,{children:[s.jsxs(ja,{children:[s.jsx(ka,{children:"Resend invitation?"}),s.jsxs(Sa,{children:["A new invitation email will be sent to ",s.jsx("span",{className:"font-medium",children:D==null?void 0:D.email}),"."]})]}),s.jsxs(Na,{children:[s.jsx(_a,{children:"Cancel"}),s.jsx(Ca,{onClick:()=>{D&&P.mutate(D.id,{onSuccess:()=>{B.success("Invitation resent"),Z(null)},onError:()=>B.error("Failed to resend invitation")})},children:"Resend"})]})]})})]})}const JJ=["working-days","holidays","members"];function eee(){const[e,t]=Zl(),r=e.get("tab"),n=r&&JJ.includes(r)?r:"working-days",a=o=>t({tab:o},{replace:!0}),i=[{id:"working-days",label:"Working Days"},{id:"holidays",label:"Holidays"},{id:"members",label:"Members"}];return s.jsx("div",{className:"p-2 md:pb-2 h-full",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[s.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Z1,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-semibold",children:"Organization Settings"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Global configuration that applies across the entire Meridian deployment."})]})]})}),s.jsx("div",{className:"flex border-b border-border shrink-0 px-6",children:i.map(o=>s.jsx("button",{onClick:()=>a(o.id),className:$("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))}),s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n==="working-days"&&s.jsx(XJ,{}),n==="holidays"&&s.jsx(QJ,{}),n==="members"&&s.jsx(ZJ,{})]})]})})}function tee(){return s.jsx(dO,{orgScope:!0})}const jh=e=>{let{transform:t}=e;return{...t,y:0}};function Lv(){const[e,t]=h.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),r=h.useRef(null);return h.useLayoutEffect(()=>{const n=a=>{var o;let i={x:a.pageX,y:a.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=a.pageX-d,m=a.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 ree(e,t=500){const[r,n]=h.useState(e),a=h.useRef(null);return h.useEffect(()=>{const i=Date.now();if(a.current&&i>=a.current+t)a.current=i,n(e);else{const o=window.setTimeout(()=>{a.current=i,n(e)},t);return()=>window.clearTimeout(o)}},[e,t]),r}function nee(){const[e,t]=h.useState({x:null,y:null}),r=h.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 h.useLayoutEffect(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),[e,r]}const ns={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function fO(e){return"init"in e}function Up(e){return!!e.write}function $j(e){return"v"in e||"e"in e}function zu(e){if("e"in e)throw e.e;if((ns?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function Fu(e){return typeof(e==null?void 0:e.then)=="function"}function mO(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function hO(e,t,r){var n;const a=new Set;for(const i of((n=r.get(e))==null?void 0:n.t)||[])a.add(i);for(const i of t.p)a.add(i);return a}const see=(e,t,...r)=>t.read(...r),aee=(e,t,...r)=>t.write(...r),iee=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},oee=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},lee=(e,t)=>{var r;const n=Ht(e),a=n[0],i=n[6],o=n[9];if((ns?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let l=a.get(t);return l||(l={d:new Map,p:new Set,n:0},a.set(t,l),(r=i.i)==null||r.call(i,t),o==null||o(e,t)),l},cee=e=>{const t=Ht(e),r=t[1],n=t[3],a=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 p;return(p=r.get(m))==null?void 0:p.l.forEach(f)}),n.clear(),i.forEach(f),i.clear(),a.forEach(f),a.clear(),u.forEach(d),n.size&&l(e)}while(n.size||i.size||a.size);if(c.length)throw new AggregateError(c)},dee=e=>{const t=Ht(e),r=t[1],n=t[2],a=t[3],i=t[11],o=t[14],l=t[17],c=[],d=new WeakSet,u=new WeakSet,f=Array.from(a);for(;f.length;){const m=f[f.length-1],p=i(e,m);if(u.has(m)){f.pop();continue}if(d.has(m)){if(n.get(m)===p.n)c.push([m,p]);else if((ns?"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 x of hO(m,p,r))d.has(x)||f.push(x)}for(let m=c.length-1;m>=0;--m){const[p,x]=c[m];let g=!1;for(const v of x.d.keys())if(v!==p&&a.has(v)){g=!0;break}g&&(o(e,p),l(e,p)),n.delete(p)}},Hp=new WeakSet,uee=(e,t)=>{var r,n;const a=Ht(e),i=a[1],o=a[2],l=a[3],c=a[6],d=a[7],u=a[11],f=a[12],m=a[13],p=a[14],x=a[16],g=a[17],v=a[20],y=a[26],b=u(e,t);if($j(b)){if(i.has(t)&&o.get(t)!==b.n)return b;let A=!1;for(const[D,Z]of b.d)if(p(e,D).n!==Z){A=!0;break}if(!A)return b}let N=!0;const w=new Set(b.d.keys()),k=new Map,j=()=>{for(const A of w)k.has(A)||b.d.delete(A)},C=()=>{if(i.has(t)){const A=!l.size;g(e,t),A&&(m(e),f(e))}},P=A=>{var D;if(A===t){const Q=u(e,A);if(!$j(Q))if(fO(A))v(e,A,A.init);else throw new Error("no atom init");return zu(Q)}const Z=p(e,A);try{return zu(Z)}finally{k.set(A,Z.n),b.d.set(A,Z.n),Fu(b.v)&&mO(t,b.v,Z),i.has(t)&&((D=i.get(A))==null||D.t.add(t)),N||C()}};let S,_;const M={get signal(){return S||(S=new AbortController),S.signal},get setSelf(){return(ns?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(ns?"production":void 0)!=="production"&&!Up(t)&&console.warn("setSelf function cannot be used with read-only atom"),!_&&Up(t)&&(_=(...A)=>{if((ns?"production":void 0)!=="production"&&N&&console.warn("setSelf function cannot be called in sync"),!N)try{return x(e,t,...A)}finally{m(e),f(e)}}),_}},E=b.n;try{(ns?"production":void 0)!=="production"&&Hp.delete(e);const A=d(e,t,P,M);if((ns?"production":void 0)!=="production"&&Hp.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,A),Fu(A)){y(e,A,()=>S==null?void 0:S.abort());const D=()=>{j(),C()};A.then(D,D)}else j();return(r=c.r)==null||r.call(c,t),b}catch(A){return delete b.v,b.e=A,++b.n,b}finally{N=!1,E!==b.n&&o.get(t)===E&&(o.set(t,b.n),l.add(t),(n=c.c)==null||n.call(c,t))}},fee=(e,t)=>{const r=Ht(e),n=r[1],a=r[2],i=r[11],o=[t];for(;o.length;){const l=o.pop(),c=i(e,l);for(const d of hO(l,c,n)){const u=i(e,d);a.get(d)!==u.n&&(a.set(d,u.n),o.push(d))}}},mee=(e,t,...r)=>{const n=Ht(e),a=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],p=n[17],x=n[20];let g=!0;const v=b=>zu(u(e,b)),y=(b,...N)=>{var w;const k=l(e,b);try{if(b===t){if(!fO(b))throw new Error("atom not writable");(ns?"production":void 0)!=="production"&&Hp.add(e);const j=k.n,C=N[0];x(e,b,C),p(e,b),j!==k.n&&(a.add(b),f(e,b),(w=i.c)==null||w.call(i,b));return}else return m(e,b,...N)}finally{g||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{g=!1}},hee=(e,t)=>{var r;const n=Ht(e),a=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=a.get(t);if(m){for(const[p,x]of f.d)if(!m.d.has(p)){const g=l(e,p);d(e,p).t.add(t),m.d.add(p),x!==g.n&&(i.add(p),c(e,p),(r=o.c)==null||r.call(o,p))}for(const p of m.d)if(!f.d.has(p)){m.d.delete(p);const x=u(e,p);x==null||x.t.delete(t)}}},pee=(e,t)=>{var r;const n=Ht(e),a=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],p=n[18],x=c(e,t);let g=a.get(t);if(!g){f(e,t);for(const v of x.d.keys())p(e,v).t.add(t);if(g={l:new Set,d:new Set(x.d.keys()),t:new Set},a.set(t,g),Up(t)){const v=()=>{let y=!0;const b=(...N)=>{try{return m(e,t,...N)}finally{y||(u(e),d(e))}};try{const N=l(e,t,b);N&&(g.u=()=>{y=!0;try{N()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return g},xee=(e,t)=>{var r,n;const a=Ht(e),i=a[1],o=a[5],l=a[6],c=a[11],d=a[19],u=c(e,t);let f=i.get(t);if(!f||f.l.size)return f;let m=!1;for(const p of f.t)if((r=i.get(p))!=null&&r.d.has(t)){m=!0;break}if(!m){f.u&&o.add(f.u),f=void 0,i.delete(t);for(const p of u.d.keys()){const x=d(e,p);x==null||x.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},gee=(e,t,r)=>{const n=Ht(e),a=n[11],i=n[27],o=a(e,t),l="v"in o,c=o.v;if(Fu(r))for(const d of o.d.keys())mO(t,r,a(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,Fu(c)&&i(e,c))},vee=(e,t)=>{const r=Ht(e)[14];return zu(r(e,t))},yee=(e,t,...r)=>{const n=Ht(e),a=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),a(e)}},bee=(e,t,r)=>{const n=Ht(e),a=n[12],i=n[18],o=n[19],c=i(e,t).l;return c.add(r),a(e),()=>{c.delete(r),o(e,t),a(e)}},wee=(e,t,r)=>{const a=Ht(e)[25];let i=a.get(t);if(!i){i=new Set,a.set(t,i);const o=()=>a.delete(t);t.then(o,o)}i.add(r)},jee=(e,t)=>{const a=Ht(e)[25].get(t);a==null||a.forEach(i=>i())},pO=new WeakMap,Ht=e=>{const t=pO.get(e);if((ns?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function Nee(e){const t=Ht(e),r=t[24];return r?r(t):t}function kee(...e){const t={get(n){const a=Ht(t)[21];return a(t,n)},set(n,...a){const i=Ht(t)[22];return i(t,n,...a)},sub(n,a){const i=Ht(t)[23];return i(t,n,a)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},see,aee,iee,oee,lee,cee,dee,uee,fee,mee,hee,pee,xee,gee,vee,yee,bee,void 0,new WeakMap,wee,jee].map((n,a)=>e[a]||n);return pO.set(t,Object.freeze(r)),t}const xO={};let See=0;function gO(e,t){const r=`atom${++See}`,n={toString(){return(xO?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=Cee,n.write=_ee),n}function Cee(e){return e(this)}function _ee(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function Pee(){return kee()}let bl;function Mee(){return bl||(bl=Pee(),(xO?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=bl),globalThis.__JOTAI_DEFAULT_STORE__!==bl&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),bl}const Oee={},Eee=h.createContext(void 0);function vO(e){return h.useContext(Eee)||Mee()}const Kp=e=>typeof(e==null?void 0:e.then)=="function",Yp=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Aee=U.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Yp(e),e)}),Nh=new WeakMap,Lj=(e,t,r)=>{const a=Nee(e)[26];let i=Nh.get(t);return i||(i=new Promise((o,l)=>{let c=t;const d=m=>p=>{c===m&&o(p)},u=m=>p=>{c===m&&l(p)},f=()=>{try{const m=r();Kp(m)?(Nh.set(m,i),c=m,m.then(d(m),u(m)),a(e,m,f)):o(m)}catch(m){l(m)}};t.then(d(t),u(t)),a(e,t,f)}),Nh.set(t,i)),i};function Dee(e,t){const{delay:r,unstable_promiseStatus:n=!U.use}={},a=vO(),[[i,o,l],c]=h.useReducer(u=>{const f=a.get(e);return Object.is(u[0],f)&&u[1]===a&&u[2]===e?u:[f,a,e]},void 0,()=>[a.get(e),a,e]);let d=i;if((o!==a||l!==e)&&(c(),d=a.get(e)),h.useEffect(()=>{const u=a.sub(e,()=>{if(n)try{const f=a.get(e);Kp(f)&&Yp(Lj(a,f,()=>a.get(e)))}catch{}if(typeof r=="number"){setTimeout(c,r);return}c()});return c(),u},[a,e,r,n]),h.useDebugValue(d),Kp(d)){const u=Lj(a,d,()=>a.get(e));return n&&Yp(u),Aee(u)}return d}function Tee(e,t){const r=vO();return h.useCallback((...a)=>{if((Oee?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...a)},[r,e])}function yO(e,t){return[Dee(e),Tee(e)]}var bO="Expected a function",zj=NaN,Iee="[object Symbol]",Ree=/^\s+|\s+$/g,$ee=/^[-+]0x[0-9a-f]+$/i,Lee=/^0b[01]+$/i,zee=/^0o[0-7]+$/i,Fee=parseInt,Bee=typeof Lc=="object"&&Lc&&Lc.Object===Object&&Lc,qee=typeof self=="object"&&self&&self.Object===Object&&self,Wee=Bee||qee||Function("return this")(),Uee=Object.prototype,Hee=Uee.toString,Kee=Math.max,Yee=Math.min,kh=function(){return Wee.Date.now()};function Gee(e,t,r){var n,a,i,o,l,c,d=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(bO);t=Fj(t)||0,Bu(r)&&(u=!!r.leading,f="maxWait"in r,i=f?Kee(Fj(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function p(j){var C=n,P=a;return n=a=void 0,d=j,o=e.apply(P,C),o}function x(j){return d=j,l=setTimeout(y,t),u?p(j):o}function g(j){var C=j-c,P=j-d,S=t-C;return f?Yee(S,i-P):S}function v(j){var C=j-c,P=j-d;return c===void 0||C>=t||C<0||f&&P>=i}function y(){var j=kh();if(v(j))return b(j);l=setTimeout(y,g(j))}function b(j){return l=void 0,m&&n?p(j):(n=a=void 0,o)}function N(){l!==void 0&&clearTimeout(l),d=0,n=c=a=l=void 0}function w(){return l===void 0?o:b(kh())}function k(){var j=kh(),C=v(j);if(n=arguments,a=this,c=j,C){if(l===void 0)return x(c);if(f)return l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return k.cancel=N,k.flush=w,k}function Vee(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(bO);return Bu(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),Gee(e,t,{leading:n,maxWait:t,trailing:a})}function Bu(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Xee(e){return!!e&&typeof e=="object"}function Qee(e){return typeof e=="symbol"||Xee(e)&&Hee.call(e)==Iee}function Fj(e){if(typeof e=="number")return e;if(Qee(e))return zj;if(Bu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ree,"");var r=Lee.test(e);return r||zee.test(e)?Fee(e.slice(2),r?2:8):$ee.test(e)?zj:+e}var Zee=Vee;const Jee=Qs(Zee),wO=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:$("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));wO.displayName="Card";const ete=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:$("flex flex-col space-y-1.5 p-6",e),...t}));ete.displayName="CardHeader";const tte=h.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:$("text-2xl font-semibold leading-none tracking-tight",e),...t}));tte.displayName="CardTitle";const rte=h.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:$("text-sm text-muted-foreground",e),...t}));rte.displayName="CardDescription";const nte=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:$("p-6 pt-0",e),...t}));nte.displayName="CardContent";const ste=h.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:$("flex items-center p-6 pt-0",e),...t}));ste.displayName="CardFooter";function ate(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return s.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const a=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,ite(a,...t)]}function ite(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function ote(e){const t=lte(e),r=h.forwardRef((n,a)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(dte);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return s.jsx(t,{...o,ref:a,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function lte(e){const t=h.forwardRef((r,n)=>{const{children:a,...i}=r;if(h.isValidElement(a)){const o=fte(a),l=ute(i,a.props);return a.type!==h.Fragment&&(l.ref=n?Qp(n,o):o),h.cloneElement(a,l)}return h.Children.count(a)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cte=Symbol("radix.slottable");function dte(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cte}function ute(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function fte(e){var n,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var mte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hte=mte.reduce((e,t)=>{const r=ote(`Primitive.${t}`),n=h.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),zv="ContextMenu",[pte]=ate(zv,[N1]),$r=N1(),[xte,jO]=pte(zv),NO=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:a,modal:i=!0}=e,[o,l]=h.useState(!1),c=$r(t),d=WE(n),u=h.useCallback(f=>{l(f),d(f)},[d]);return s.jsx(xte,{scope:t,open:o,onOpenChange:u,modal:i,children:s.jsx(UE,{...c,dir:a,open:o,onOpenChange:u,modal:i,children:r})})};NO.displayName=zv;var kO="ContextMenuTrigger",SO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...a}=e,i=jO(kO,r),o=$r(r),l=h.useRef({x:0,y:0}),c=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=h.useRef(0),u=h.useCallback(()=>window.clearTimeout(d.current),[]),f=m=>{l.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return h.useEffect(()=>u,[u]),h.useEffect(()=>void(n&&u()),[n,u]),s.jsxs(s.Fragment,{children:[s.jsx(HE,{...o,virtualRef:c}),s.jsx(hte.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Cs(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:Cs(e.onPointerDown,xd(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:Cs(e.onPointerMove,xd(u)),onPointerCancel:n?e.onPointerCancel:Cs(e.onPointerCancel,xd(u)),onPointerUp:n?e.onPointerUp:Cs(e.onPointerUp,xd(u))})]})});SO.displayName=kO;var gte="ContextMenuPortal",CO=e=>{const{__scopeContextMenu:t,...r}=e,n=$r(t);return s.jsx(IE,{...n,...r})};CO.displayName=gte;var _O="ContextMenuContent",PO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=jO(_O,r),i=$r(r),o=h.useRef(!1);return s.jsx(RE,{...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&&!a.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)"}})});PO.displayName=_O;var vte="ContextMenuGroup",yte=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(KE,{...a,...n,ref:t})});yte.displayName=vte;var bte="ContextMenuLabel",MO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(BE,{...a,...n,ref:t})});MO.displayName=bte;var wte="ContextMenuItem",OO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx($E,{...a,...n,ref:t})});OO.displayName=wte;var jte="ContextMenuCheckboxItem",EO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(LE,{...a,...n,ref:t})});EO.displayName=jte;var Nte="ContextMenuRadioGroup",kte=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(YE,{...a,...n,ref:t})});kte.displayName=Nte;var Ste="ContextMenuRadioItem",AO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(FE,{...a,...n,ref:t})});AO.displayName=Ste;var Cte="ContextMenuItemIndicator",DO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(zE,{...a,...n,ref:t})});DO.displayName=Cte;var _te="ContextMenuSeparator",TO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(qE,{...a,...n,ref:t})});TO.displayName=_te;var Pte="ContextMenuArrow",Mte=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(GE,{...a,...n,ref:t})});Mte.displayName=Pte;var Ote="ContextMenuSubTrigger",IO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(DE,{...a,...n,ref:t})});IO.displayName=Ote;var Ete="ContextMenuSubContent",RO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,a=$r(r);return s.jsx(TE,{...a,...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)"}})});RO.displayName=Ete;function xd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Ate=NO,Dte=SO,Tte=CO,$O=PO,LO=MO,zO=OO,FO=EO,BO=AO,qO=DO,WO=TO,UO=IO,HO=RO;const Ite=Ate,Rte=Dte,$te=h.forwardRef(({className:e,inset:t,children:r,...n},a)=>s.jsxs(UO,{ref:a,className:$("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,s.jsx(pr,{className:"ml-auto h-4 w-4"})]}));$te.displayName=UO.displayName;const Lte=h.forwardRef(({className:e,...t},r)=>s.jsx(HO,{ref:r,className:$("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}));Lte.displayName=HO.displayName;const KO=h.forwardRef(({className:e,...t},r)=>s.jsx(Tte,{children:s.jsx($O,{ref:r,className:$("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})}));KO.displayName=$O.displayName;const YO=h.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(zO,{ref:n,className:$("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}));YO.displayName=zO.displayName;const zte=h.forwardRef(({className:e,children:t,checked:r,...n},a)=>s.jsxs(FO,{ref:a,className:$("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(qO,{children:s.jsx(At,{className:"h-4 w-4"})})}),t]}));zte.displayName=FO.displayName;const Fte=h.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(BO,{ref:n,className:$("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(qO,{children:s.jsx(Er,{className:"h-2 w-2 fill-current"})})}),t]}));Fte.displayName=BO.displayName;const Bte=h.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(LO,{ref:n,className:$("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));Bte.displayName=LO.displayName;const qte=h.forwardRef(({className:e,...t},r)=>s.jsx(WO,{ref:r,className:$("-mx-1 my-1 h-px bg-border",e),...t}));qte.displayName=WO.displayName;const Wte=gO(!1),Ute=gO(0),Fv=()=>yO(Wte),Bv=()=>yO(Ute),Hte=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=Ta),t},$c=e=>{let t=hk;return(e==="monthly"||e==="quarterly")&&(t=gk),t},qv=e=>{let t=ZI;return(e==="monthly"||e==="quarterly")&&(t=hk),t},Xl=e=>{let t=ao;return(e==="monthly"||e==="quarterly")&&(t=yk),t},Kte=e=>{let t=xk;return(e==="monthly"||e==="quarterly")&&(t=$x),t},GO=e=>{let t=Kr;return(e==="monthly"||e==="quarterly")&&(t=Tx),t},Sl=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,a=Math.floor(t/n),i=Hte(e.range),l=GO(e.range)(r,a),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Kr(l,u)},Yte=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,a)=>({months:new Array(3).fill(null).map((i,o)=>{const l=a*3+o;return{days:Ta(new Date(r.year,l,1))}})}));return t},VO=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,a=$c(r.range),i=Xl(r.range),o=a(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=Ta(e),d=n/c;return o*n+l*d},Gte=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const a=$c(r.range);if(r.range==="daily"){const x=a(t,e);return n*(x||1)}const i=Ta(e),o=n/i;if(io(e,t))return o;const l=qv(r.range),c=Xl(r.range);if(io(c(e),c(t)))return l(t,e)*o;const d=i-_l(e),u=_l(t),f=a(c(t),c(e)),m=Ta(t),p=n/m;return(f-1)*n+d*o+u*p},XO=(e,t,r)=>{const n=Xl(t),a=Kte(t),i=qv(t),o=n(e),l=a(e),c=i(l,o);return e.getDate()/c*r},Gn=h.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),Wv=({title:e,columns:t,renderHeaderItem:r})=>{const n=h.useId();return s.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:[s.jsx("div",{children:s.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:s.jsx("p",{children:e})})}),s.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((a,i)=>s.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:r(i)},`${n}-${i}`))})]})},Vte=()=>h.useContext(Gn).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>s.jsxs("div",{className:"relative flex flex-col",children:[s.jsx(Wv,{columns:r.days,renderHeaderItem:a=>s.jsxs("div",{className:"flex items-center justify-center gap-1",children:[s.jsx("p",{children:me(Kr(new Date(t.year,n,1),a),"d")}),s.jsx("p",{className:"text-muted-foreground",children:me(Kr(new Date(t.year,n,1),a),"EEEEE")})]}),title:me(new Date(t.year,n,1),"MMMM yyyy")}),s.jsx(Uv,{columns:r.days,isColumnSecondary:a=>[0,6].includes(Kr(new Date(t.year,n,1),a).getDay())})]},`${t.year}-${n}`))),Xte=()=>h.useContext(Gn).timelineData.map(t=>s.jsxs("div",{className:"relative flex flex-col",children:[s.jsx(Wv,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>s.jsx("p",{children:me(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),s.jsx(Uv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),Qte=()=>h.useContext(Gn).timelineData.map(t=>t.quarters.map((r,n)=>s.jsxs("div",{className:"relative flex flex-col",children:[s.jsx(Wv,{columns:r.months.length,renderHeaderItem:a=>s.jsx("p",{children:me(new Date(t.year,n*3+a,1),"MMM")}),title:`Q${n+1} ${t.year}`}),s.jsx(Uv,{columns:r.months.length})]},`${t.year}-${n}`))),Zte={daily:Vte,monthly:Xte,quarterly:Qte},Jte=({className:e})=>{const t=h.useContext(Gn),r=Zte[t.range];return s.jsx("div",{className:$("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:s.jsx(r,{})})},Sh=({feature:e,onSelectItem:t,className:r,duration:n})=>{const a=h.useContext(Gn),i=e.endAt&&io(e.startAt,e.endAt)?Kr(e.endAt,1):e.endAt,o=n??(i?$h(e.startAt,i):`${$h(e.startAt,new Date)} so far`),l=d=>{var u;d.target===d.currentTarget&&((u=a.scrollToFeature)==null||u.call(a,e),t==null||t(e.id))},c=d=>{var u;d.key==="Enter"&&((u=a.scrollToFeature)==null||u.call(a,e),t==null||t(e.id))};return s.jsxs("div",{className:$("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:[s.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),s.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),s.jsx("p",{className:"pointer-events-none text-muted-foreground",children:o})]},e.id)},ere=()=>s.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:[s.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),s.jsx("p",{className:"shrink-0",children:"Duration"})]}),Ch=({children:e,name:t,className:r})=>s.jsxs("div",{className:r,children:[s.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}),s.jsx("div",{className:"divide-y divide-border/50",children:e})]}),tre=({children:e,className:t})=>s.jsxs("div",{className:$("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:[s.jsx(ere,{}),s.jsx("div",{className:"space-y-4",children:e})]}),rre=({top:e,className:t})=>{const[r]=Bv(),n=h.useContext(Gn),[a,i]=Lv(),o=()=>{var u,f,m;const l=(f=(u=n.ref)==null?void 0:u.current)==null?void 0:f.getBoundingClientRect(),c=a.x-((l==null?void 0:l.left)??0)+r-n.sidebarWidth,d=Sl(n,c);(m=n.onAddItem)==null||m.call(n,d)};return s.jsx("div",{className:$("absolute top-0 w-full px-0.5",t),ref:i,style:{marginTop:-n.rowHeight/2,transform:`translateY(${e}px)`},children:s.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:o,type:"button",children:s.jsx(ot,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},nre=({index:e,isColumnSecondary:t})=>{var m;const r=h.useContext(Gn),[n]=Fv(),[a,i]=Lv(),[o,l]=h.useState(!1),[c]=nee(),d=()=>l(!0),u=()=>l(!1),f=ree(a.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return s.jsx("div",{className:$("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?s.jsx(rre,{top:f}):null})},Uv=({columns:e,isColumnSecondary:t})=>{const r=h.useId();return s.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,a)=>s.jsx(nre,{index:a,isColumnSecondary:t},`${r}-${a}`))})},Bj=({direction:e,featureId:t,date:r})=>{const[,n]=Fv(),{attributes:a,listeners:i,setNodeRef:o}=_1({id:`feature-drag-helper-${t}`}),l=!!a["aria-pressed"];return h.useEffect(()=>n(l),[l,n]),s.jsxs("div",{className:$("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,...a,...i,children:[s.jsx("div",{className:$("-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&&s.jsx("div",{className:$("-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:me(r,"MMM dd, yyyy")})]})},sre=({id:e,children:t})=>{const[,r]=Fv(),{attributes:n,listeners:a,setNodeRef:i}=_1({id:e}),o=!!n["aria-pressed"];return h.useEffect(()=>r(o),[o,r]),s.jsx(wO,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:s.jsx("div",{className:$("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...a,ref:i,children:t})})},qj=({onMove:e,children:t,className:r,...n})=>{const[a]=Bv(),i=h.useContext(Gn),o=h.useMemo(()=>{var M;return new Date(((M=i.timelineData.at(0))==null?void 0:M.year)??0,0,1)},[i.timelineData]),[l,c]=h.useState(n.startAt),[d,u]=h.useState(n.endAt),f=h.useMemo(()=>Gte(l,d,i),[l,d,i]),m=h.useMemo(()=>VO(l,o,i),[l,o,i]),p=h.useMemo(()=>GO(i.range),[i.range]),[x]=Lv(),[g,v]=h.useState(0),[y,b]=h.useState(l),[N,w]=h.useState(d),k=Zp(tA,{activationConstraint:{distance:10}}),j=h.useCallback(()=>{v(x.x),b(l),w(d)},[x.x,l,d]),C=h.useCallback(()=>{const M=Sl(i,x.x),E=Sl(i,g),A=i.range==="daily"?$c(i.range)(M,E):qv(i.range)(M,E),D=Kr(y,A),Z=N?Kr(N,A):null;c(D),u(Z)},[i,x.x,g,y,N]),P=h.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),S=h.useCallback(()=>{var Z,Q;const M=(Q=(Z=i.ref)==null?void 0:Z.current)==null?void 0:Q.getBoundingClientRect(),E=x.x-((M==null?void 0:M.left)??0)+a-i.sidebarWidth,D=Xl(i.range)(Sl(i,E));c(D)},[i,x.x,a]),_=h.useCallback(()=>{var Z,Q;const M=(Q=(Z=i.ref)==null?void 0:Z.current)==null?void 0:Q.getBoundingClientRect(),E=x.x-((M==null?void 0:M.left)??0)+a-i.sidebarWidth,D=Xl(i.range)(Sl(i,E));u(D)},[i,x.x,a]);return s.jsx("div",{className:$("relative flex w-max min-w-full py-0.5",r),style:{height:"var(--gantt-row-height)"},children:s.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&&s.jsx(Cl,{modifiers:[jh],onDragEnd:P,onDragMove:S,sensors:[k],children:s.jsx(Bj,{date:l,direction:"left",featureId:n.id})}),s.jsx(Cl,{modifiers:[jh],onDragEnd:P,onDragMove:C,onDragStart:j,sensors:[k],children:s.jsx(sre,{id:n.id,children:t??s.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&s.jsx(Cl,{modifiers:[jh],onDragEnd:P,onDragMove:_,sensors:[k],children:s.jsx(Bj,{date:d?kk(d,1):p(l,1),direction:"right",featureId:n.id})})]})})},_h=({children:e,className:t})=>s.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),are=({className:e,children:t})=>s.jsx("div",{className:$("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),QO=h.memo(({label:e,date:t,id:r,onRemove:n,className:a})=>{const i=h.useContext(Gn),o=h.useMemo(()=>$c(i.range),[i.range]),l=h.useMemo(()=>{var f;return new Date(((f=i.timelineData.at(0))==null?void 0:f.year)??0,0,1)},[i.timelineData]),c=h.useMemo(()=>o(t,l),[o,t,l]),d=h.useMemo(()=>XO(t,i.range,i.columnWidth*i.zoom/100),[t,i.range,i.columnWidth,i.zoom]),u=h.useCallback(()=>n==null?void 0:n(r),[n,r]);return s.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:[s.jsxs(Ite,{children:[s.jsx(Rte,{asChild:!0,children:s.jsxs("div",{className:$("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",a),children:[e,s.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:me(t,"MMM dd, yyyy")})]})}),s.jsx(KO,{children:n?s.jsxs(YO,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[s.jsx(mD,{size:16}),"Remove marker"]}):null})]}),s.jsx("div",{className:$("h-full w-px bg-card",a)})]})});QO.displayName="GanttMarker";const ire=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:a})=>{const i=h.useRef(null),[o,l]=h.useState(Yte(new Date)),[,c]=Bv(),[d,u]=h.useState(0),f=60,m=36;let p=50;t==="monthly"?p=150:t==="quarterly"&&(p=100);const x=h.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*p}px`,"--gantt-header-height":`${f}px`,"--gantt-row-height":`${m}px`,"--gantt-sidebar-width":`${d}px`}),[e,p,d]);h.useEffect(()=>{i.current&&(i.current.scrollLeft=i.current.scrollWidth/2-i.current.clientWidth/2,c(i.current.scrollLeft))},[c]),h.useEffect(()=>{const y=()=>{var k;const w=((k=i.current)==null?void 0:k.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;u(w)};y();const b=new MutationObserver(y);return i.current&&b.observe(i.current,{childList:!0,subtree:!0}),()=>{b.disconnect()}},[]);const g=h.useCallback(Jee(()=>{var k,j;const y=i.current;if(!y)return;const{scrollLeft:b,scrollWidth:N,clientWidth:w}=y;if(c(b),b===0){const C=(k=o[0])==null?void 0:k.year;if(!C)return;const P=[...o];P.unshift({year:C-1,quarters:new Array(4).fill(null).map((S,_)=>({months:new Array(3).fill(null).map((M,E)=>{const A=_*3+E;return{days:Ta(new Date(C,A,1))}})}))}),l(P),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(b+w>=N){const C=(j=o.at(-1))==null?void 0:j.year;if(!C)return;const P=[...o];P.push({year:C+1,quarters:new Array(4).fill(null).map((S,_)=>({months:new Array(3).fill(null).map((M,E)=>{const A=_*3+E;return{days:Ta(new Date(C,A,1))}})}))}),l(P),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);h.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",g),()=>{y&&y.removeEventListener("scroll",g)}},[g]);const v=h.useCallback(y=>{const b=i.current;if(!b)return;const N=new Date(o[0].year,0,1),w=VO(y.startAt,N,{zoom:e,range:t,columnWidth:p}),k=Math.max(0,w);b.scrollTo({left:k,behavior:"smooth"})},[o,e,t,p,d,r]);return s.jsx(Gn.Provider,{value:{zoom:e,range:t,headerHeight:f,columnWidth:p,sidebarWidth:d,rowHeight:m,onAddItem:r,timelineData:o,placeholderLength:2,ref:i,scrollToFeature:v},children:s.jsx("div",{className:$("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,a),ref:i,style:{...x,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},ore=({children:e,className:t})=>s.jsx("div",{className:$("relative flex h-full w-max flex-none overflow-clip",t),children:e}),lre=({className:e})=>{const t="Today",r=h.useMemo(()=>new Date,[]),n=h.useContext(Gn),a=h.useMemo(()=>$c(n.range),[n.range]),i=h.useMemo(()=>{var c;return new Date(((c=n.timelineData.at(0))==null?void 0:c.year)??0,0,1)},[n.timelineData]),o=h.useMemo(()=>a(r,i),[a,r,i]),l=h.useMemo(()=>XO(r,n.range,n.columnWidth*n.zoom/100),[r,n.range,n.columnWidth,n.zoom]);return s.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:[s.jsxs("div",{className:$("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,s.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:me(r,"MMM dd, yyyy")})]}),s.jsx("div",{className:$("h-full w-px bg-card",e)})]})};function cre(e){return De({queryKey:["public","share",e],queryFn:()=>oe.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function Hv(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 De({queryKey:["public","share",e,"issues",t],queryFn:()=>oe.get(`/public/share/${e}/issues${n}`),select:a=>a.issues,enabled:!!e,retry:!1})}function ZO(e){return De({queryKey:["public","share",e,"sprints"],queryFn:()=>oe.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function dre({priority:e,className:t}){const r=$("h-3.5 w-3.5 shrink-0",hc[e],t);switch(e){case"urgent":return s.jsx(gs,{className:r});case"high":return s.jsx(_i,{className:r});case"medium":return s.jsx(Js,{className:r});case"low":return s.jsx(Ci,{className:r});default:return s.jsx(Er,{className:$("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const Gp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function JO({issue:e,statuses:t,statusLabels:r,statusColorMap:n,sprints:a,isChild:i=!1,children:o=[],childrenMap:l}){const[c,d]=h.useState(!1),u=o.length>0,f=n[e.status]??"#94a3b8",m=a.find(p=>p.id===e.sprint_id);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:$(`group grid ${Gp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[s.jsx("span",{className:$("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}),s.jsxs("div",{className:$("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?s.jsxs(os,{children:[s.jsx(ls,{asChild:!0,children:s.jsx("button",{onClick:()=>d(!c),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:c?s.jsx(Zs,{className:"h-3.5 w-3.5"}):s.jsx(pr,{className:"h-3.5 w-3.5"})})}),s.jsx(Bn,{side:"top",children:c?"Collapse":"Expand"})]}):i?s.jsx(Ds,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):s.jsx("span",{className:"w-4 shrink-0"}),s.jsx("span",{className:$("text-sm text-foreground truncate",i&&"text-muted-foreground"),children:e.title}),u&&s.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:[s.jsx(Ds,{className:"h-2.5 w-2.5"}),o.length]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[s.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:f}}),s.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[s.jsx(dre,{priority:e.priority}),s.jsx("span",{className:"text-xs text-muted-foreground",children:un[e.priority]??e.priority})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[s.jsx(Yr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),s.jsx("span",{className:$("text-xs truncate",m?"text-foreground":"text-muted-foreground/50"),children:(m==null?void 0:m.name)??"—"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[s.jsx(Ut,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),s.jsx("span",{className:$("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?me(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),s.jsx("div",{className:"flex items-center px-1.5",children:s.jsx("div",{className:"flex -space-x-1.5",children:(e.assignees??[]).slice(0,3).map(p=>s.jsx("div",{title:p.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:p.initials},p.id))})})]}),c&&o.map(p=>s.jsx(JO,{issue:p,statuses:t,statusLabels:r,statusColorMap:n,sprints:a,isChild:!0,children:(l==null?void 0:l[p.id])??[],childrenMap:l},p.id))]})}function ure({issues:e,childrenMap:t,statuses:r,statusLabels:n,statusColorMap:a,sprints:i,totalCount:o}){const[l,c]=h.useState(!1);return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border",children:[s.jsx("button",{onClick:()=>c(!l),className:"text-muted-foreground hover:text-foreground transition-colors",children:l?s.jsx(pr,{className:"h-3.5 w-3.5"}):s.jsx(Zs,{className:"h-3.5 w-3.5"})}),s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Issues"}),s.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:o})]}),!l&&s.jsx("div",{className:"divide-y divide-border/60",children:e.length===0?s.jsx("div",{className:"px-14 py-5 text-xs text-muted-foreground/50 italic",children:"No issues match your filters"}):e.map(d=>s.jsx(JO,{issue:d,statuses:r,statusLabels:n,statusColorMap:a,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function fre({token:e,statuses:t}){const[r,n]=h.useState("all"),[a,i]=h.useState("all"),[o,l]=h.useState("all"),[c,d]=h.useState(""),{data:u=[],isLoading:f}=Hv(e),{data:m=[]}=ZO(e),p=Object.fromEntries(t.map(N=>[N.key,N.name])),x=Object.fromEntries(t.map(N=>[N.key,N.color])),g={};for(const N of u)N.parent_id&&(g[N.parent_id]||(g[N.parent_id]=[]),g[N.parent_id].push(N));const v=u.filter(N=>!N.parent_id).filter(N=>{const w=c.toLowerCase(),k=!c||N.title.toLowerCase().includes(w)||N.identifier.toLowerCase().includes(w),j=r==="all"||N.status===r,C=a==="all"||N.priority===a,P=o==="all"?!0:o==="none"?!N.sprint_id:N.sprint_id===o;return k&&j&&C&&P}).sort((N,w)=>{const k=parseInt(N.identifier.split("-")[1]??"0",10),j=parseInt(w.identifier.split("-")[1]??"0",10);return k-j}),y=v.reduce((N,w)=>{var k;return N+(((k=g[w.id])==null?void 0:k.length)??0)},0),b=v.length+y;return s.jsx("div",{className:"p-2",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Be,{value:o,onValueChange:l,children:[s.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:s.jsx(Ve,{placeholder:"Sprint"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),s.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(N=>s.jsx(ke,{value:N.id,className:"text-xs",children:N.name},N.id))]})]}),s.jsxs(Be,{value:r,onValueChange:n,children:[s.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:s.jsx(Ve,{placeholder:"Status"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:N,name:w})=>s.jsx(ke,{value:N,className:"text-xs",children:w},N))]})]}),s.jsxs(Be,{value:a,onValueChange:i,children:[s.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:s.jsx(Ve,{placeholder:"Priority"})}),s.jsxs(Fe,{children:[s.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(un).map(([N,w])=>s.jsx(ke,{value:N,className:"text-xs",children:w},N))]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ra,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),s.jsx(_e,{placeholder:"Search...",value:c,onChange:N=>d(N.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"min-w-[900px]",children:[s.jsxs("div",{className:$("grid items-center py-2.5 border-b border-border",Gp),children:[s.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),s.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"})]}),f?s.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(N=>s.jsxs("div",{className:$("grid items-center px-6 py-3 gap-4",Gp),children:[s.jsx(le,{className:"h-4 w-14"}),s.jsx(le,{className:"h-4 w-56"}),s.jsx(le,{className:"h-5 w-20"}),s.jsx(le,{className:"h-4 w-16"}),s.jsx(le,{className:"h-4 w-20"}),s.jsx(le,{className:"h-4 w-24"}),s.jsx(le,{className:"h-6 w-16"})]},N))}):u.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:s.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"})}):s.jsx(Uu,{delayDuration:200,children:s.jsx(ure,{issues:v,childrenMap:g,statuses:t,statusLabels:p,statusColorMap:x,sprints:m,totalCount:b})})]})}),!f&&b>0&&s.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:s.jsxs("span",{className:"text-xs text-muted-foreground",children:[b," issue",b!==1?"s":""]})})]})})}function gd(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Kr(new Date(e.due_date),1):Kr(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 mre({token:e,statuses:t}){const[r,n]=h.useState("monthly"),a=h.useRef(null),{data:i=[]}=Hv(e),{data:o=[]}=ZO(e);h.useEffect(()=>{const m=requestAnimationFrame(()=>{var b;const p=(b=a.current)==null?void 0:b.querySelector(".gantt");if(!p)return;const x=new Date,g=x.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((x.getTime()-new Date(g,0,1).getTime())/864e5)*50;else{const N=r==="monthly"?150:100,w=(x.getFullYear()-g)*12+x.getMonth(),k=new Date(x.getFullYear(),x.getMonth()+1,0).getDate();y=w*N+(x.getDate()-1)/k*N}p.scrollLeft=Math.max(0,y-(p.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 s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:s.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>s.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))})}),s.jsx("div",{ref:a,className:"flex-1 min-h-0 overflow-hidden",children:s.jsxs(ire,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[s.jsxs(tre,{children:[o.map(m=>{const p=u[m.id]??[];return s.jsx(Ch,{name:m.name,children:p.map(x=>s.jsx(Sh,{feature:gd(x,l[x.status]??"#94a3b8")},x.id))},m.id)}),f.length>0&&s.jsx(Ch,{name:"No Sprint",children:f.map(m=>s.jsx(Sh,{feature:gd(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&s.jsx(Ch,{name:"Unscheduled",children:d.map(m=>s.jsx(Sh,{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))})]}),s.jsxs(ore,{children:[s.jsx(Jte,{}),s.jsxs(are,{children:[o.map(m=>s.jsx(_h,{children:(u[m.id]??[]).map(p=>s.jsx("div",{className:"flex",children:s.jsx(qj,{...gd(p,l[p.status]??"#94a3b8")})},p.id))},m.id)),f.length>0&&s.jsx(_h,{children:f.map(m=>s.jsx("div",{className:"flex",children:s.jsx(qj,{...gd(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&s.jsx(_h,{children:d.map(m=>s.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),o.filter(m=>m.end_date).map(m=>s.jsx(QO,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),s.jsx(lre,{})]})]})})]})}function hre(){const{token:e}=It(),[t,r]=h.useState("board"),{data:n,isLoading:a,isError:i}=cre(e??""),{data:o}=Hv(e??"");if(!e)return null;if(a)return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading…"})});if(i||!n)return s.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[s.jsx("p",{className:"text-lg font-semibold",children:"Link not found"}),s.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 s.jsxs("div",{className:"h-screen flex flex-col bg-background overflow-hidden",children:[s.jsx("header",{className:"border-b border-border px-6 py-3 bg-white dark:bg-card shrink-0",children:s.jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&s.jsx("span",{className:"text-xl",children:n.icon}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.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}),s.jsx("h1",{className:"text-sm font-semibold",children:n.name})]}),s.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"Read-only view"})]})}),s.jsx("div",{className:"border-b border-border bg-white dark:bg-card px-6 shrink-0",children:s.jsx("div",{className:"flex -mb-px",children:l.map(({key:c,label:d})=>s.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))})}),s.jsxs("div",{className:`flex-1 min-h-0 ${t==="timeline"?"overflow-hidden":"overflow-auto"}`,children:[t==="board"&&s.jsx(Pk,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&s.jsx(fre,{token:e,statuses:n.statuses}),t==="timeline"&&s.jsx(mre,{token:e,statuses:n.statuses})]})]})}const pre=new URLSearchParams(window.location.search);function xre(){const[e,t]=h.useState(null),r=ft(),n=Te(),a=h.useRef(!1);if(h.useEffect(()=>{if(a.current)return;a.current=!0;const i=pre;if(history.replaceState(null,"",window.location.pathname),i.get("linked")==="true"){r("/profile?linked=true",{replace:!0});return}const l=i.get("error");if(l){t(decodeURIComponent(l));return}const c=i.get("code");if(!c){t("No authorization code received from Google sign-in");return}(async()=>{const u=await fetch(`${to}/auth/google/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:c})});if(!u.ok)throw new Error(`Code exchange failed (${u.status}). Please try signing in again.`);const{token:f}=await u.json(),m=await fetch(`${to}/admin/users/me`,{headers:{Authorization:`Bearer ${f}`}});if(!m.ok)throw new Error(`Failed to load user profile (${m.status})`);const p=await m.json();n.login({id:p.id,email:p.email,first_name:p.first_name??"",last_name:p.last_name??"",avatar_url:p.avatar_url},f),r("/",{replace:!0})})().catch(u=>t(u.message??"Failed to complete sign-in"))},[]),e){const i=e.startsWith("GOOGLE_NOT_LINKED:"),o=i?e.replace("GOOGLE_NOT_LINKED: ",""):e;return s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[400px] bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-4",children:[s.jsx("p",{className:"text-sm font-medium",children:i?"Google account not connected":"Sign-in failed"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:o}),i?s.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[s.jsx(hr,{to:"/login",children:s.jsx(re,{className:"w-full",size:"sm",children:"Sign in with email & password"})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["After signing in, go to ",s.jsx("strong",{children:"Profile"})," → ",s.jsx("strong",{children:"Connections"})," to link your Google account."]})]}):s.jsx(hr,{to:"/login",children:s.jsx(re,{variant:"outline",size:"sm",children:"Back to login"})})]})})}return s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("span",{className:"text-sm text-muted-foreground",children:"Completing sign-in..."})})}function Wj({className:e}){return s.jsxs("svg",{className:e??"size-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[s.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"}),s.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"}),s.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"}),s.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 gre(){var z,se,W,X;const[e,t]=Zl(),{user:r}=Te(),{data:n,isLoading:a}=uO(),i=BJ(),o=qJ(),l=WJ(),c=KJ(),d=UJ(),u=HJ(),f=h.useRef(null),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(""),[b,N]=h.useState(""),[w,k]=h.useState(!1),[j,C]=h.useState(!1),[P,S]=h.useState(""),[_,M]=h.useState(""),[E,A]=h.useState(""),[D,Z]=h.useState(!1),[Q,q]=h.useState(0),te=h.useRef(null);h.useEffect(()=>{n&&(p(n.first_name??""),g(n.last_name??""),y(n.designation??""),N(n.phone_number??""))},[n]),h.useEffect(()=>{e.get("linked")==="true"&&(B.success("Google account connected successfully"),t(ie=>(ie.delete("linked"),ie),{replace:!0}))},[e,t]);const ne=r&&(`${((z=r.first_name)==null?void 0:z[0])??""}${((se=r.last_name)==null?void 0:se[0])??""}`.toUpperCase()||((X=(W=r.email)==null?void 0:W[0])==null?void 0:X.toUpperCase()))||"?",I=ie=>{var J;const V=(J=ie.target.files)==null?void 0:J[0];V&&(o.mutate(V,{onSuccess:()=>B.success("Avatar updated"),onError:ue=>B.error(ue.message??"Failed to upload avatar")}),ie.target.value="")},O=()=>{l.mutate(void 0,{onSuccess:()=>B.success("Avatar removed"),onError:ie=>B.error(ie.message??"Failed to remove avatar")})},L=()=>{i.mutate({first_name:m,last_name:x,designation:v||null,phone_number:b||null},{onSuccess:()=>B.success("Profile updated"),onError:ie=>B.error(ie.message??"Failed to update profile")})},H=()=>{const ie=localStorage.getItem("meridian_token");if(!ie){B.error("You must be logged in to connect Google");return}window.location.href=`${to}/auth/google/link?token=${encodeURIComponent(ie)}`},R=()=>{c.mutate(void 0,{onSuccess:()=>B.success("Google account disconnected"),onError:ie=>B.error(ie.message??"Failed to unlink Google account")})},Y=h.useCallback(()=>{q(30),te.current&&clearInterval(te.current),te.current=setInterval(()=>{q(ie=>ie<=1?(te.current&&clearInterval(te.current),0):ie-1)},1e3)},[]);h.useEffect(()=>()=>{te.current&&clearInterval(te.current)},[]);const F=()=>{d.mutate(void 0,{onSuccess:()=>{C(!0),Y(),B.success("Verification code sent to your email")},onError:ie=>B.error(ie.message??"Failed to send verification code")})},T=()=>{if(_.length<8){B.error("New password must be at least 8 characters");return}if(_!==E){B.error("Passwords do not match");return}u.mutate({otp:P,new_password:_},{onSuccess:()=>{B.success("Password updated"),G()},onError:ie=>B.error(ie.message??"Failed to set password")})},G=()=>{k(!1),C(!1),S(""),M(""),A(""),Z(!1),q(0),te.current&&clearInterval(te.current)};return s.jsx("div",{className:"p-2 md:h-full",children:s.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col md:h-full",children:[s.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(nc,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-semibold",children:"Profile"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Manage your personal details and account connections."})]})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between px-4 md:px-6 py-4 border-b border-border gap-3",children:[s.jsx("span",{className:"text-sm text-muted-foreground shrink-0",children:"Profile photo"}),s.jsxs("div",{className:"flex flex-1 items-center gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsxs(_t,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?s.jsx(El,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,s.jsx(Pt,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:ne})]}),o.isPending&&s.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 flex items-center justify-center",children:s.jsx("span",{className:"text-white text-[10px]",children:"…"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var ie;return(ie=f.current)==null?void 0:ie.click()},disabled:o.isPending,children:[s.jsx(q5,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&s.jsxs(re,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:O,disabled:l.isPending,children:[s.jsx(wr,{className:"size-3.5"}),"Remove"]})]}),s.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:I})]})]}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Personal information"})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"First name"}),a?s.jsx(le,{className:"h-8 w-56"}):s.jsx(_e,{value:m,onChange:ie=>p(ie.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"First name"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Last name"}),a?s.jsx(le,{className:"h-8 w-56"}):s.jsx(_e,{value:x,onChange:ie=>g(ie.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"Last name"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),a?s.jsx(le,{className:"h-4 w-48"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.email)??"—"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Designation"}),a?s.jsx(le,{className:"h-8 w-56"}):s.jsx(_e,{value:v,onChange:ie=>y(ie.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"e.g. Software Engineer"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Phone number"}),a?s.jsx(le,{className:"h-8 w-56"}):s.jsx(_e,{value:b,onChange:ie=>N(ie.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"+1 555 000 0000"})]}),s.jsx("div",{className:"flex justify-end px-6 py-4 border-b border-border",children:s.jsx(re,{size:"sm",onClick:L,disabled:i.isPending,children:i.isPending?"Saving…":"Save changes"})}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Connections"})}),s.jsx("div",{className:"px-4 md:px-6 py-3.5 border-b border-border",children:a?s.jsx(le,{className:"h-8 w-48"}):n!=null&&n.google_id?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Wj,{className:"size-3.5 shrink-0"}),s.jsx("span",{className:"text-foreground font-medium",children:"Google"}),s.jsx(kn,{className:"size-3.5 text-emerald-500 shrink-0"}),s.jsx("span",{className:"text-foreground font-medium",children:"Connected"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-sm text-muted-foreground truncate flex-1",children:n.email}),s.jsxs(re,{size:"sm",className:"h-7 gap-1.5 bg-red-600 hover:bg-red-700 text-white shrink-0",onClick:R,disabled:c.isPending,children:[s.jsx(lx,{className:"size-3.5"}),"Disconnect"]})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Wj,{className:"size-3.5 shrink-0"}),s.jsx("span",{className:"text-sm font-medium",children:"Google"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"}),s.jsx(re,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:H,children:"Connect"})]})}),s.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Security"})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-4 border-b border-border",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Password"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.has_password)===!1?"No password set":"••••••••"}),s.jsxs(re,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:()=>k(!0),children:[s.jsx(J5,{className:"size-3.5"}),(n==null?void 0:n.has_password)===!1?"Create password":"Change password"]})]})]}),s.jsx(hn,{open:w,onOpenChange:ie=>{ie||G()},children:s.jsxs(Qr,{className:"sm:max-w-md",children:[s.jsxs(pn,{children:[s.jsx(xn,{children:(n==null?void 0:n.has_password)===!1?"Create password":"Change password"}),s.jsxs(Eo,{children:["We'll send a 6-digit verification code to ",s.jsx("span",{className:"font-medium text-foreground",children:n==null?void 0:n.email})]})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(at,{className:"text-sm",children:"Verification code"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(_x,{maxLength:6,value:P,onChange:S,children:[s.jsxs(Ld,{children:[s.jsx(nn,{index:0}),s.jsx(nn,{index:1}),s.jsx(nn,{index:2})]}),s.jsx(qN,{}),s.jsxs(Ld,{children:[s.jsx(nn,{index:3}),s.jsx(nn,{index:4}),s.jsx(nn,{index:5})]})]}),j?Q>0?s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums w-16 text-center",children:["Resend in ",Q,"s"]}):s.jsx(re,{variant:"ghost",size:"sm",className:"h-8 shrink-0 text-indigo-500 hover:text-indigo-600",onClick:F,disabled:d.isPending,children:d.isPending?"Sending…":"Resend"}):s.jsx(re,{variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:F,disabled:d.isPending,children:d.isPending?"Sending…":"Send code"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(at,{className:"text-sm",children:"New password"}),s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:D?"text":"password",value:_,onChange:ie=>M(ie.target.value),className:"h-9 text-sm pr-9",placeholder:"At least 8 characters",autoComplete:"new-password"}),s.jsx("button",{type:"button",onClick:()=>Z(!D),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:D?s.jsx(rc,{className:"size-3.5"}):s.jsx(Pi,{className:"size-3.5"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(at,{className:"text-sm",children:"Confirm password"}),s.jsx(_e,{type:"password",value:E,onChange:ie=>A(ie.target.value),className:"h-9 text-sm",placeholder:"Re-enter new password",autoComplete:"new-password"})]})]}),s.jsxs(Oo,{children:[s.jsx(re,{variant:"ghost",size:"sm",onClick:G,children:"Cancel"}),s.jsx(re,{size:"sm",onClick:T,disabled:u.isPending||P.length!==6||!_||!E,children:u.isPending?"Saving…":(n==null?void 0:n.has_password)===!1?"Create password":"Update password"})]})]})})]})]})})}function vre(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),a=qD(),i=o=>{o.preventDefault(),a.mutate({email:e},{onSuccess:()=>n(!0),onError:l=>B.error(l.message??"Something went wrong")})};return s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[360px]",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[s.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:s.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:s.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:s.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-lg font-semibold text-foreground",children:r?"Check your email":"Forgot password?"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r?"If an account exists with that email, we've sent a reset link.":"Enter your email and we'll send you a reset link."})]})]}),r?s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Didn't receive an email? Check your spam folder or try again."}),s.jsx(re,{variant:"outline",className:"w-full h-10",onClick:()=>{n(!1),t("")},children:"Try again"})]}):s.jsxs("form",{onSubmit:i,className:"space-y-2",children:[s.jsx(_e,{type:"email",placeholder:"Email",value:e,onChange:o=>t(o.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10",autoFocus:!0}),s.jsx("div",{className:"pt-1",children:s.jsx(re,{type:"submit",className:"w-full h-10 font-medium",disabled:a.isPending,children:a.isPending?"Sending...":"Send reset link"})})]}),s.jsx("div",{className:"mt-6 text-center",children:s.jsxs(hr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Co,{className:"size-3.5"}),"Back to login"]})})]})})}function yre(){const[e]=Zl(),t=e.get("token")??"",r=ft(),n=WD(),[a,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=f=>{if(f.preventDefault(),a.length<8){B.error("Password must be at least 8 characters");return}if(a!==o){B.error("Passwords do not match");return}n.mutate({token:t,password:a},{onSuccess:()=>{B.success("Password has been reset. Please sign in."),r("/login",{replace:!0})},onError:m=>B.error(m.message??"Failed to reset password")})};return t?s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[360px]",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[s.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:s.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:s.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:s.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Set new password"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Enter your new password below."})]})]}),s.jsxs("form",{onSubmit:u,className:"space-y-2",children:[s.jsxs("div",{className:"relative",children:[s.jsx(_e,{type:c?"text":"password",placeholder:"New password",value:a,onChange:f=>i(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10",autoFocus:!0}),s.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?s.jsx(rc,{className:"h-4 w-4"}):s.jsx(Pi,{className:"h-4 w-4"})})]}),s.jsx(_e,{type:"password",placeholder:"Confirm password",value:o,onChange:f=>l(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10"}),s.jsx("div",{className:"pt-1",children:s.jsx(re,{type:"submit",className:"w-full h-10 font-medium",disabled:n.isPending,children:n.isPending?"Resetting...":"Reset password"})})]}),s.jsx("div",{className:"mt-6 text-center",children:s.jsxs(hr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Co,{className:"size-3.5"}),"Back to login"]})})]})}):s.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-[360px] text-center space-y-4",children:[s.jsx("p",{className:"text-sm font-medium",children:"Invalid reset link"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This link is missing or expired."}),s.jsx(hr,{to:"/forgot-password",children:s.jsx(re,{variant:"outline",size:"sm",children:"Request a new link"})})]})})}const bre=h.lazy(()=>Wu(()=>import("./ProjectTimelinePage-DxWw_hGr.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),wre=h.lazy(()=>Wu(()=>import("./ProjectHealthPage-D4tymjdG.js"),__vite__mapDeps([6,1,2,7,3,4,5])).then(e=>({default:e.ProjectHealthPage}))),jre=h.lazy(()=>Wu(()=>import("./HealthReportDetailPage-DKpFR2W0.js"),__vite__mapDeps([8,1,2,7,3,4,5])).then(e=>({default:e.HealthReportDetailPage}))),Nre=h.lazy(()=>Wu(()=>import("./WorkspaceReportingPage-Bg9_S-oI.js"),__vite__mapDeps([9,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function Ya({children:e}){const{isAuthenticated:t}=Te();return t?s.jsx(s.Fragment,{children:e}):s.jsx(Fn,{to:"/login",replace:!0})}function Uj({children:e}){var r;const{user:t}=Te();return(r=t==null?void 0:t.roles)!=null&&r.includes("super-admin")?s.jsx(s.Fragment,{children:e}):s.jsx(Fn,{to:"/",replace:!0})}function Hj({children:e}){var a,i,o;const{user:t}=Te(),r=((a=t==null?void 0:t.roles)==null?void 0:a.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?s.jsx(s.Fragment,{children:e}):s.jsx(Fn,{to:"/",replace:!0})}function vd({children:e}){const{isAuthenticated:t}=Te(),{data:r}=Xu(),n=wo();return t?s.jsx(Fn,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?s.jsx(Fn,{to:"/register",replace:!0}):r&&!r.needsSetup&&!r.registrationEnabled&&n.pathname==="/register"?s.jsx(Fn,{to:"/login",replace:!0}):s.jsx(s.Fragment,{children:e})}function kre(){const{workspace:e,setWorkspace:t,user:r}=Te(),n=ft(),{data:a,isLoading:i}=Wn();return h.useEffect(()=>{if(!i&&a!==void 0){if(e){if(a.some(l=>l.id===e.id)){n(`/${e.slug}/projects`,{replace:!0});return}t(null)}if(a.length>0){const o=a[0];t({id:o.id,name:o.name,slug:o.slug,logo_url:o.logo_url}),n(`/${o.slug}/projects`,{replace:!0})}else n("/awaiting-access",{replace:!0})}},[a,i,n,t,r,e]),s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})})}function Sre(){var p,x;const{workspace:e}=It(),{workspace:t,setWorkspace:r,user:n}=Te();KD();const a=ft(),{data:i,isLoading:o,isFetching:l}=Wn(),c=((p=n==null?void 0:n.roles)==null?void 0:p.includes("super-admin"))||((x=n==null?void 0:n.roles)==null?void 0:x.includes("admin")),d=!o&&i&&!i.find(g=>g.slug===e)&&c,{data:u,isLoading:f}=Wn(d?{orgScope:!0}:!1);return h.useEffect(()=>{if(o||!i)return;const g=i.find(v=>v.slug===e);if(g){g.id!==(t==null?void 0:t.id)&&r({id:g.id,name:g.name,slug:g.slug,logo_url:g.logo_url});return}if(c){if(f||!u)return;const v=u.find(y=>y.slug===e);if(v){v.id!==(t==null?void 0:t.id)&&r({id:v.id,name:v.name,slug:v.slug,logo_url:v.logo_url});return}}l||(i.length>0?(r({id:i[0].id,name:i[0].name,slug:i[0].slug,logo_url:i[0].logo_url}),a(`/${i[0].slug}/projects`,{replace:!0})):(r(null),a("/awaiting-access",{replace:!0})))},[i,u,e,o,l,f,c,t==null?void 0:t.id,a,r,n]),o||d&&f||!t||t.slug!==e?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})}):s.jsxs(s.Fragment,{children:[s.jsx(FT,{}),s.jsx(C3,{})]})}function Cre(){const{isAuthenticated:e}=Te(),t=ye(),r=h.useRef(e);h.useEffect(()=>{r.current&&!e&&t.clear(),r.current=e},[e,t])}function _re(){return Cre(),s.jsxs(lE,{children:[s.jsx($e,{path:"/login",element:s.jsx(vd,{children:s.jsx(P3,{})})}),s.jsx($e,{path:"/register",element:s.jsx(vd,{children:s.jsx(q3,{})})}),s.jsx($e,{path:"/forgot-password",element:s.jsx(vd,{children:s.jsx(vre,{})})}),s.jsx($e,{path:"/reset-password",element:s.jsx(vd,{children:s.jsx(yre,{})})}),s.jsx($e,{path:"/invite/:token",element:s.jsx(Rz,{})}),s.jsx($e,{path:"/oauth/google/callback",element:s.jsx(xre,{})}),s.jsx($e,{path:"/share/:token",element:s.jsx(hre,{})}),s.jsx($e,{path:"/reporting",element:s.jsx(Ya,{children:s.jsx(Hj,{children:s.jsx(GT,{})})}),children:s.jsx($e,{index:!0,element:s.jsx(dO,{})})}),s.jsxs($e,{path:"/org",element:s.jsx(Ya,{children:s.jsx(Hj,{children:s.jsx(QT,{})})}),children:[s.jsx($e,{index:!0,element:s.jsx(Fn,{to:"settings",replace:!0})}),s.jsx($e,{path:"settings",element:s.jsx(eee,{})}),s.jsx($e,{path:"reports",element:s.jsx(Uj,{children:s.jsx(tee,{})})})]}),s.jsx($e,{path:"/profile",element:s.jsx(Ya,{children:s.jsx(e3,{})}),children:s.jsx($e,{index:!0,element:s.jsx(gre,{})})}),s.jsx($e,{path:"/setup",element:s.jsx(Ya,{children:s.jsx(W3,{})})}),s.jsx($e,{path:"/awaiting-access",element:s.jsx(Ya,{children:s.jsx(U3,{})})}),s.jsx($e,{index:!0,element:s.jsx(Ya,{children:s.jsx(kre,{})})}),s.jsxs($e,{path:"/:workspace",element:s.jsx(Ya,{children:s.jsx(Sre,{})}),children:[s.jsx($e,{index:!0,element:s.jsx(Fn,{to:"projects",replace:!0})}),s.jsx($e,{path:"projects",element:s.jsx(fR,{})}),s.jsxs($e,{path:"projects/:projectKey",element:s.jsx(HT,{}),children:[s.jsx($e,{path:"board",element:s.jsx(KL,{})}),s.jsx($e,{path:"issues",element:s.jsx(YL,{})}),s.jsx($e,{path:"issues/new",element:s.jsx(az,{})}),s.jsx($e,{path:"issues/:issueId",element:s.jsx(ez,{})}),s.jsx($e,{path:"sprints",element:s.jsx(yz,{})}),s.jsx($e,{path:"timeline",element:s.jsx(h.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:s.jsx(bre,{})})}),s.jsx($e,{path:"access",element:s.jsx(XL,{})}),s.jsx($e,{path:"reports",element:s.jsx(RJ,{})}),s.jsx($e,{path:"activity",element:s.jsx(FJ,{})}),s.jsx($e,{path:"health",element:s.jsx(h.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:s.jsx(wre,{})})}),s.jsx($e,{path:"health/:reportId",element:s.jsx(h.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:s.jsx(jre,{})})})]}),s.jsx($e,{path:"my-tasks",element:s.jsx(mz,{})}),s.jsx($e,{path:"notifications",element:s.jsx(pz,{})}),s.jsx($e,{path:"reporting",element:s.jsx(h.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:s.jsx(Nre,{})})}),s.jsx($e,{path:"settings",element:s.jsx(Ez,{})}),s.jsx($e,{path:"roles",element:s.jsx(Uj,{children:s.jsx(Tz,{})})})]}),s.jsx($e,{path:"*",element:s.jsx(Fn,{to:"/",replace:!0})})]})}window.__React=U;window.__ReactJsxRuntime=nE;const Pre=new sE({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{}T1(document.getElementById("root")).render(s.jsx(h.StrictMode,{children:s.jsx(T5,{widgets:[...bD,...e],children:s.jsx(JA,{children:s.jsxs(aE,{client:Pre,children:[s.jsx(e5,{children:s.jsx(t5,{children:s.jsx(cE,{children:s.jsxs(Uu,{delayDuration:300,children:[s.jsx(_re,{}),s.jsx(qA,{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"}}})]})})})}),s.jsx(pA,{initialIsOpen:!1})]})})})}))})();export{yo as $,ce as A,re as B,gf as C,dx as D,lt as E,Ce as F,ire as G,FF as H,IS as I,qs as J,Mr as K,Zre as L,Bre as M,Ws as N,Ae as O,ot as P,bo as Q,sne as R,Ft as S,eg as T,ae as U,ct as V,Or as W,dU as X,Kre as Y,da as Z,Wu as _,Kr as a,ZM as a$,Ti as a0,Ii as a1,vo as a2,ov as a3,La as a4,au as a5,cv as a6,Op as a7,Tv as a8,gn as a9,AJ as aA,hY as aB,Kn as aC,WT as aD,Rre as aE,$re as aF,Lre as aG,zre as aH,DS as aI,$ as aJ,ux as aK,_e as aL,Be as aM,ze as aN,Ve as aO,Fe as aP,ke as aQ,xc as aR,Mo as aS,mf as aT,Fs as aU,wr as aV,oD as aW,Yx as aX,co as aY,JB as aZ,WM as a_,en as aa,NV as ab,vV as ac,OV as ad,bB as ae,gC as af,gV as ag,zo as ah,Fo as ai,RK as aj,HM as ak,LM as al,rQ as am,Zt as an,Wre as ao,Mg as ap,PC as aq,Pg as ar,ur as as,ms as at,KG as au,WG as av,Xr as aw,LC as ax,Ke as ay,Hf as az,ea as b,JM as b0,LY as b1,Ire as b2,le as b3,Ue as b4,Mt as b5,UI as b6,Fre as b7,Te as b8,dO as b9,Lh as c,Hu as d,Ro as e,me as f,$o as g,Bx as h,qR as i,qx as j,$a as k,tre as l,Ch as m,Sh as n,ore as o,Jte as p,are as q,_h as r,kk as s,qj as t,PN as u,QO as v,lre as w,B as x,xt as y,oe as z};
|