@meridianjs/admin-dashboard 0.1.5 → 0.1.6
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.
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import{j as t,u as he,a as fe,b as Ne,Q as hd,c as xd}from"./vendor-query-BxDNdxq_.js";import{a as pd,c as y,r as p,b as gd,u as Ke,d as Lr,N as rn,e as Ve,L as ln,O as Mo,f as bd,g as Ie,h as Ms,B as yd}from"./vendor-react-CfHM_tz4.js";import{C as Do,R as vd,T as jd,P as wd,S as Hr,a as Eo,O as As,b as qn,c as Rs,d as Ur,e as fn,D as hn,f as Bn,g as _o,h as Oo,i as Nd,j as To,I as Po,k as $o,l as Ao,m as Ro,L as Io,n as Fo,o as kd,p as Sd,q as Wo,r as zo,F as qo,u as Ds,t as Yt,s as Cd,v as Bo,w as Yo,x as Md,y as Lo,z as Ho,A as Dd,B as Uo,V as Ed,E as Ko,G as Vo,H as _d,J as Od,K as Go,M as Td,N as Pd,Q as $d,U as Qo,W as Ad,X as Rd,Y as Xo,Z as Id,_ as Fd,$ as Jo,a0 as Wd}from"./vendor-radix-DmippTD7.js";import{u as Zo,a as ei,D as ti,S as Kr,h as si,b as Fn,P as ni,c as Vr,C as Gr,d as zd,v as qd,e as Bd,f as Yd}from"./vendor-dnd-dQurpOJF.js";import{E as Ld,u as ri,i as ai,a as oi,b as ii,c as li,d as Hd,e as Ud}from"./vendor-editor-DYN2JaBa.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var di,za=pd;di=za.createRoot,za.hydrateRoot;var Kd=function(){return null},Vd=e=>{switch(e){case"success":return Xd;case"info":return Zd;case"warning":return Jd;case"error":return ec;default:return null}},Gd=Array(12).fill(0),Qd=({visible:e,className:s})=>y.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":e},y.createElement("div",{className:"sonner-spinner"},Gd.map((n,r)=>y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Xd=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.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"})),Jd=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},y.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"})),Zd=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.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"})),ec=y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},y.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"})),tc=y.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"},y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),sc=()=>{let[e,s]=y.useState(document.hidden);return y.useEffect(()=>{let n=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Rr=1,nc=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let s=this.subscribers.indexOf(e);this.subscribers.splice(s,1)}),this.publish=e=>{this.subscribers.forEach(s=>s(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var s;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((s=e.id)==null?void 0:s.length)>0?e.id:Rr++,o=this.toasts.find(l=>l.id===a),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:i,title:n}):l):this.addToast({title:n,...r,dismissible:i,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(s=>{this.subscribers.forEach(n=>n({id:s.id,dismiss:!0}))}),this.subscribers.forEach(s=>s({id:e,dismiss:!0})),e),this.message=(e,s)=>this.create({...s,message:e}),this.error=(e,s)=>this.create({...s,message:e,type:"error"}),this.success=(e,s)=>this.create({...s,type:"success",message:e}),this.info=(e,s)=>this.create({...s,type:"info",message:e}),this.warning=(e,s)=>this.create({...s,type:"warning",message:e}),this.loading=(e,s)=>this.create({...s,type:"loading",message:e}),this.promise=(e,s)=>{if(!s)return;let n;s.loading!==void 0&&(n=this.create({...s,promise:e,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,o,i=r.then(async d=>{if(o=["resolve",d],y.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(ac(d)&&!d.ok){a=!1;let c=typeof s.error=="function"?await s.error(`HTTP error! status: ${d.status}`):s.error,u=typeof s.description=="function"?await s.description(`HTTP error! status: ${d.status}`):s.description;this.create({id:n,type:"error",message:c,description:u})}else if(s.success!==void 0){a=!1;let c=typeof s.success=="function"?await s.success(d):s.success,u=typeof s.description=="function"?await s.description(d):s.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async d=>{if(o=["reject",d],s.error!==void 0){a=!1;let c=typeof s.error=="function"?await s.error(d):s.error,u=typeof s.description=="function"?await s.description(d):s.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var d;a&&(this.dismiss(n),n=void 0),(d=s.finally)==null||d.call(s)}),l=()=>new Promise((d,c)=>i.then(()=>o[0]==="reject"?c(o[1]):d(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,s)=>{let n=(s==null?void 0:s.id)||Rr++;return this.create({jsx:e(n),id:n,...s}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ue=new nc,rc=(e,s)=>{let n=(s==null?void 0:s.id)||Rr++;return Ue.addToast({title:e,...s,id:n}),n},ac=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oc=rc,ic=()=>Ue.toasts,lc=()=>Ue.getActiveToasts(),F=Object.assign(oc,{success:Ue.success,info:Ue.info,warning:Ue.warning,error:Ue.error,custom:Ue.custom,message:Ue.message,promise:Ue.promise,dismiss:Ue.dismiss,loading:Ue.loading},{getHistory:ic,getToasts:lc});function dc(e,{insertAt:s}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",s==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}dc(`: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%)}
|
|
2
|
+
`);function Pn(e){return e.label!==void 0}var cc=3,uc="32px",mc="16px",qa=4e3,fc=356,hc=14,xc=20,pc=200;function at(...e){return e.filter(Boolean).join(" ")}function gc(e){let[s,n]=e.split("-"),r=[];return s&&r.push(s),n&&r.push(n),r}var bc=e=>{var s,n,r,a,o,i,l,d,c,u,m;let{invert:f,toast:h,unstyled:g,interacting:v,setHeights:k,visibleToasts:b,heights:j,index:N,toasts:C,expanded:S,removeToast:x,defaultRichColors:w,closeButton:D,style:_,cancelButtonStyle:A,actionButtonStyle:z,className:R="",descriptionClassName:W="",duration:$,position:G,gap:O,loadingIcon:L,expandByDefault:Z,classNames:I,icons:M,closeButtonAriaLabel:X="Close toast",pauseWhenPageIsHidden:E}=e,[q,K]=y.useState(null),[U,ae]=y.useState(null),[P,oe]=y.useState(!1),[be,_e]=y.useState(!1),[qe,Dt]=y.useState(!1),[Ht,ie]=y.useState(!1),[Ut,Kt]=y.useState(!1),[Vt,Gt]=y.useState(0),[Us,rt]=y.useState(0),ut=y.useRef(h.duration||$||qa),vs=y.useRef(null),Be=y.useRef(null),Qt=N===0,Et=N+1<=b,Ye=h.type,mt=h.dismissible!==!1,_t=h.className||"",Ks=h.descriptionClassName||"",Nt=y.useMemo(()=>j.findIndex(B=>B.toastId===h.id)||0,[j,h.id]),Vs=y.useMemo(()=>{var B;return(B=h.closeButton)!=null?B:D},[h.closeButton,D]),ft=y.useMemo(()=>h.duration||$||qa,[h.duration,$]),Ot=y.useRef(0),ht=y.useRef(0),js=y.useRef(0),xt=y.useRef(null),[ws,Gs]=G.split("-"),re=y.useMemo(()=>j.reduce((B,ue,me)=>me>=Nt?B:B+ue.height,0),[j,Nt]),Q=sc(),te=h.invert||f,Y=Ye==="loading";ht.current=y.useMemo(()=>Nt*O+re,[Nt,re]),y.useEffect(()=>{ut.current=ft},[ft]),y.useEffect(()=>{oe(!0)},[]),y.useEffect(()=>{let B=Be.current;if(B){let ue=B.getBoundingClientRect().height;return rt(ue),k(me=>[{toastId:h.id,height:ue,position:h.position},...me]),()=>k(me=>me.filter(Pe=>Pe.toastId!==h.id))}},[k,h.id]),y.useLayoutEffect(()=>{if(!P)return;let B=Be.current,ue=B.style.height;B.style.height="auto";let me=B.getBoundingClientRect().height;B.style.height=ue,rt(me),k(Pe=>Pe.find(Ce=>Ce.toastId===h.id)?Pe.map(Ce=>Ce.toastId===h.id?{...Ce,height:me}:Ce):[{toastId:h.id,height:me,position:h.position},...Pe])},[P,h.title,h.description,k,h.id]);let ee=y.useCallback(()=>{_e(!0),Gt(ht.current),k(B=>B.filter(ue=>ue.toastId!==h.id)),setTimeout(()=>{x(h)},pc)},[h,x,k,ht]);y.useEffect(()=>{if(h.promise&&Ye==="loading"||h.duration===1/0||h.type==="loading")return;let B;return S||v||E&&Q?(()=>{if(js.current<Ot.current){let ue=new Date().getTime()-Ot.current;ut.current=ut.current-ue}js.current=new Date().getTime()})():ut.current!==1/0&&(Ot.current=new Date().getTime(),B=setTimeout(()=>{var ue;(ue=h.onAutoClose)==null||ue.call(h,h),ee()},ut.current)),()=>clearTimeout(B)},[S,v,h,Ye,E,Q,ee]),y.useEffect(()=>{h.delete&&ee()},[ee,h.delete]);function pe(){var B,ue,me;return M!=null&&M.loading?y.createElement("div",{className:at(I==null?void 0:I.loader,(B=h==null?void 0:h.classNames)==null?void 0:B.loader,"sonner-loader"),"data-visible":Ye==="loading"},M.loading):L?y.createElement("div",{className:at(I==null?void 0:I.loader,(ue=h==null?void 0:h.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":Ye==="loading"},L):y.createElement(Qd,{className:at(I==null?void 0:I.loader,(me=h==null?void 0:h.classNames)==null?void 0:me.loader),visible:Ye==="loading"})}return y.createElement("li",{tabIndex:0,ref:Be,className:at(R,_t,I==null?void 0:I.toast,(s=h==null?void 0:h.classNames)==null?void 0:s.toast,I==null?void 0:I.default,I==null?void 0:I[Ye],(n=h==null?void 0:h.classNames)==null?void 0:n[Ye]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:w,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":P,"data-promise":!!h.promise,"data-swiped":Ut,"data-removed":be,"data-visible":Et,"data-y-position":ws,"data-x-position":Gs,"data-index":N,"data-front":Qt,"data-swiping":qe,"data-dismissible":mt,"data-type":Ye,"data-invert":te,"data-swipe-out":Ht,"data-swipe-direction":U,"data-expanded":!!(S||Z&&P),style:{"--index":N,"--toasts-before":N,"--z-index":C.length-N,"--offset":`${be?Vt:ht.current}px`,"--initial-height":Z?"auto":`${Us}px`,..._,...h.style},onDragEnd:()=>{Dt(!1),K(null),xt.current=null},onPointerDown:B=>{Y||!mt||(vs.current=new Date,Gt(ht.current),B.target.setPointerCapture(B.pointerId),B.target.tagName!=="BUTTON"&&(Dt(!0),xt.current={x:B.clientX,y:B.clientY}))},onPointerUp:()=>{var B,ue,me,Pe;if(Ht||!mt)return;xt.current=null;let Ce=Number(((B=Be.current)==null?void 0:B.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Me=Number(((ue=Be.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ze=new Date().getTime()-((me=vs.current)==null?void 0:me.getTime()),He=q==="x"?Ce:Me,Tt=Math.abs(He)/Ze;if(Math.abs(He)>=xc||Tt>.11){Gt(ht.current),(Pe=h.onDismiss)==null||Pe.call(h,h),ae(q==="x"?Ce>0?"right":"left":Me>0?"down":"up"),ee(),ie(!0),Kt(!1);return}Dt(!1),K(null)},onPointerMove:B=>{var ue,me,Pe,Ce;if(!xt.current||!mt||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Me=B.clientY-xt.current.y,Ze=B.clientX-xt.current.x,He=(me=e.swipeDirections)!=null?me:gc(G);!q&&(Math.abs(Ze)>1||Math.abs(Me)>1)&&K(Math.abs(Ze)>Math.abs(Me)?"x":"y");let Tt={x:0,y:0};q==="y"?(He.includes("top")||He.includes("bottom"))&&(He.includes("top")&&Me<0||He.includes("bottom")&&Me>0)&&(Tt.y=Me):q==="x"&&(He.includes("left")||He.includes("right"))&&(He.includes("left")&&Ze<0||He.includes("right")&&Ze>0)&&(Tt.x=Ze),(Math.abs(Tt.x)>0||Math.abs(Tt.y)>0)&&Kt(!0),(Pe=Be.current)==null||Pe.style.setProperty("--swipe-amount-x",`${Tt.x}px`),(Ce=Be.current)==null||Ce.style.setProperty("--swipe-amount-y",`${Tt.y}px`)}},Vs&&!h.jsx?y.createElement("button",{"aria-label":X,"data-disabled":Y,"data-close-button":!0,onClick:Y||!mt?()=>{}:()=>{var B;ee(),(B=h.onDismiss)==null||B.call(h,h)},className:at(I==null?void 0:I.closeButton,(a=h==null?void 0:h.classNames)==null?void 0:a.closeButton)},(o=M==null?void 0:M.close)!=null?o:tc):null,h.jsx||p.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:y.createElement(y.Fragment,null,Ye||h.icon||h.promise?y.createElement("div",{"data-icon":"",className:at(I==null?void 0:I.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||pe():null,h.type!=="loading"?h.icon||(M==null?void 0:M[Ye])||Vd(Ye):null):null,y.createElement("div",{"data-content":"",className:at(I==null?void 0:I.content,(l=h==null?void 0:h.classNames)==null?void 0:l.content)},y.createElement("div",{"data-title":"",className:at(I==null?void 0:I.title,(d=h==null?void 0:h.classNames)==null?void 0:d.title)},typeof h.title=="function"?h.title():h.title),h.description?y.createElement("div",{"data-description":"",className:at(W,Ks,I==null?void 0:I.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),p.isValidElement(h.cancel)?h.cancel:h.cancel&&Pn(h.cancel)?y.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:B=>{var ue,me;Pn(h.cancel)&&mt&&((me=(ue=h.cancel).onClick)==null||me.call(ue,B),ee())},className:at(I==null?void 0:I.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,p.isValidElement(h.action)?h.action:h.action&&Pn(h.action)?y.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||z,onClick:B=>{var ue,me;Pn(h.action)&&((me=(ue=h.action).onClick)==null||me.call(ue,B),!B.defaultPrevented&&ee())},className:at(I==null?void 0:I.actionButton,(m=h==null?void 0:h.classNames)==null?void 0:m.actionButton)},h.action.label):null))};function Ba(){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 yc(e,s){let n={};return[e,s].forEach((r,a)=>{let o=a===1,i=o?"--mobile-offset":"--offset",l=o?mc:uc;function d(c){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=l:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):d(l)}),n}var vc=p.forwardRef(function(e,s){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:i,className:l,offset:d,mobileOffset:c,theme:u="light",richColors:m,duration:f,style:h,visibleToasts:g=cc,toastOptions:v,dir:k=Ba(),gap:b=hc,loadingIcon:j,icons:N,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:S}=e,[x,w]=y.useState([]),D=y.useMemo(()=>Array.from(new Set([r].concat(x.filter(E=>E.position).map(E=>E.position)))),[x,r]),[_,A]=y.useState([]),[z,R]=y.useState(!1),[W,$]=y.useState(!1),[G,O]=y.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=y.useRef(null),Z=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=y.useRef(null),M=y.useRef(!1),X=y.useCallback(E=>{w(q=>{var K;return(K=q.find(U=>U.id===E.id))!=null&&K.delete||Ue.dismiss(E.id),q.filter(({id:U})=>U!==E.id)})},[]);return y.useEffect(()=>Ue.subscribe(E=>{if(E.dismiss){w(q=>q.map(K=>K.id===E.id?{...K,delete:!0}:K));return}setTimeout(()=>{gd.flushSync(()=>{w(q=>{let K=q.findIndex(U=>U.id===E.id);return K!==-1?[...q.slice(0,K),{...q[K],...E},...q.slice(K+1)]:[E,...q]})})})}),[]),y.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let E=window.matchMedia("(prefers-color-scheme: dark)");try{E.addEventListener("change",({matches:q})=>{O(q?"dark":"light")})}catch{E.addListener(({matches:K})=>{try{O(K?"dark":"light")}catch(U){console.error(U)}})}},[u]),y.useEffect(()=>{x.length<=1&&R(!1)},[x]),y.useEffect(()=>{let E=q=>{var K,U;a.every(ae=>q[ae]||q.code===ae)&&(R(!0),(K=L.current)==null||K.focus()),q.code==="Escape"&&(document.activeElement===L.current||(U=L.current)!=null&&U.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[a]),y.useEffect(()=>{if(L.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,M.current=!1)}},[L.current]),y.createElement("section",{ref:s,"aria-label":`${C} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((E,q)=>{var K;let[U,ae]=E.split("-");return x.length?y.createElement("ol",{key:E,dir:k==="auto"?Ba():k,tabIndex:-1,ref:L,className:l,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":U,"data-lifted":z&&x.length>1&&!o,"data-x-position":ae,style:{"--front-toast-height":`${((K=_[0])==null?void 0:K.height)||0}px`,"--width":`${fc}px`,"--gap":`${b}px`,...h,...yc(d,c)},onBlur:P=>{M.current&&!P.currentTarget.contains(P.relatedTarget)&&(M.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||M.current||(M.current=!0,I.current=P.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{W||R(!1)},onDragEnd:()=>R(!1),onPointerDown:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},x.filter(P=>!P.position&&q===0||P.position===E).map((P,oe)=>{var be,_e;return y.createElement(bc,{key:P.id,icons:N,index:oe,toast:P,defaultRichColors:m,duration:(be=v==null?void 0:v.duration)!=null?be:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:g,closeButton:(_e=v==null?void 0:v.closeButton)!=null?_e:i,interacting:W,position:E,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:X,toasts:x.filter(qe=>qe.position==P.position),heights:_.filter(qe=>qe.position==P.position),setHeights:A,expandByDefault:o,gap:b,loadingIcon:j,expanded:z,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))}),jc=(e,s,n,r,a,o,i,l)=>{let d=document.documentElement,c=["light","dark"];function u(h){(Array.isArray(e)?e:[e]).forEach(g=>{let v=g==="class",k=v&&o?a.map(b=>o[b]||b):a;v?(d.classList.remove(...k),d.classList.add(o&&o[h]?o[h]:h)):d.setAttribute(g,h)}),m(h)}function m(h){l&&c.includes(h)&&(d.style.colorScheme=h)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let h=localStorage.getItem(s)||n,g=i&&h==="system"?f():h;u(g)}catch{}},Ya=["light","dark"],ci="(prefers-color-scheme: dark)",wc=typeof window>"u",Qr=p.createContext(void 0),Nc={setTheme:e=>{},themes:[]},kc=()=>{var e;return(e=p.useContext(Qr))!=null?e:Nc},Sc=e=>p.useContext(Qr)?p.createElement(p.Fragment,null,e.children):p.createElement(Mc,{...e}),Cc=["light","dark"],Mc=({forcedTheme:e,disableTransitionOnChange:s=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:a="theme",themes:o=Cc,defaultTheme:i=n?"system":"light",attribute:l="data-theme",value:d,children:c,nonce:u,scriptProps:m})=>{let[f,h]=p.useState(()=>Ec(a,i)),[g,v]=p.useState(()=>f==="system"?dr():f),k=d?Object.values(d):o,b=p.useCallback(S=>{let x=S;if(!x)return;S==="system"&&n&&(x=dr());let w=d?d[x]:x,D=s?_c(u):null,_=document.documentElement,A=z=>{z==="class"?(_.classList.remove(...k),w&&_.classList.add(w)):z.startsWith("data-")&&(w?_.setAttribute(z,w):_.removeAttribute(z))};if(Array.isArray(l)?l.forEach(A):A(l),r){let z=Ya.includes(i)?i:null,R=Ya.includes(x)?x:z;_.style.colorScheme=R}D==null||D()},[u]),j=p.useCallback(S=>{let x=typeof S=="function"?S(f):S;h(x);try{localStorage.setItem(a,x)}catch{}},[f]),N=p.useCallback(S=>{let x=dr(S);v(x),f==="system"&&n&&!e&&b("system")},[f,e]);p.useEffect(()=>{let S=window.matchMedia(ci);return S.addListener(N),N(S),()=>S.removeListener(N)},[N]),p.useEffect(()=>{let S=x=>{x.key===a&&(x.newValue?h(x.newValue):j(i))};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[j]),p.useEffect(()=>{b(e??f)},[e,f]);let C=p.useMemo(()=>({theme:f,setTheme:j,forcedTheme:e,resolvedTheme:f==="system"?g:f,themes:n?[...o,"system"]:o,systemTheme:n?g:void 0}),[f,j,e,g,n,o]);return p.createElement(Qr.Provider,{value:C},p.createElement(Dc,{forcedTheme:e,storageKey:a,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:d,themes:o,nonce:u,scriptProps:m}),c)},Dc=p.memo(({forcedTheme:e,storageKey:s,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:o,value:i,themes:l,nonce:d,scriptProps:c})=>{let u=JSON.stringify([n,s,o,e,l,i,r,a]).slice(1,-1);return p.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${jc.toString()})(${u})`}})}),Ec=(e,s)=>{if(wc)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||s},_c=e=>{let s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.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(s),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(s)},1)}},dr=e=>(e||(e=window.matchMedia(ci)),e.matches?"dark":"light");function Oc({children:e}){return t.jsx(Sc,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const ui=p.createContext(null),cr="meridian_token",ur="meridian_user",$n="meridian_workspace";function Tc({children:e}){const[s,n]=p.useState(()=>{try{const u=localStorage.getItem(ur);return u?JSON.parse(u):null}catch{return null}}),[r,a]=p.useState(()=>localStorage.getItem(cr)),[o,i]=p.useState(()=>{try{const u=localStorage.getItem($n);return u?JSON.parse(u):null}catch{return null}}),l=(u,m)=>{n(u),a(m),localStorage.setItem(cr,m),localStorage.setItem(ur,JSON.stringify(u))},d=()=>{n(null),a(null),i(null),localStorage.removeItem(cr),localStorage.removeItem(ur),localStorage.removeItem($n)},c=u=>{i(u),u?localStorage.setItem($n,JSON.stringify(u)):localStorage.removeItem($n)};return p.useEffect(()=>{r&&!s&&d()},[]),t.jsx(ui.Provider,{value:{user:s,token:r,workspace:o,isAuthenticated:!!r&&!!s,login:l,logout:d,setWorkspace:c},children:e})}function Se(){const e=p.useContext(ui);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const mi=p.createContext(null);function Pc({children:e}){const[s,n]=p.useState(!1);return p.useEffect(()=>{const r=a=>{(a.metaKey||a.ctrlKey)&&a.key==="k"&&(a.preventDefault(),n(o=>!o))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[]),t.jsx(mi.Provider,{value:{open:s,setOpen:n,toggle:()=>n(r=>!r)},children:e})}function fi(){const e=p.useContext(mi);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function hi(e){var s,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(s=0;s<a;s++)e[s]&&(n=hi(e[s]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function xi(){for(var e,s,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(s=hi(e))&&(r&&(r+=" "),r+=s);return r}const Xr="-",$c=e=>{const s=Rc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const l=i.split(Xr);return l[0]===""&&l.length!==1&&l.shift(),pi(l,s)||Ac(i)},getConflictingClassGroupIds:(i,l)=>{const d=n[i]||[];return l&&r[i]?[...d,...r[i]]:d}}},pi=(e,s)=>{var i;if(e.length===0)return s.classGroupId;const n=e[0],r=s.nextPart.get(n),a=r?pi(e.slice(1),r):void 0;if(a)return a;if(s.validators.length===0)return;const o=e.join(Xr);return(i=s.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId},La=/^\[(.+)\]$/,Ac=e=>{if(La.test(e)){const s=La.exec(e)[1],n=s==null?void 0:s.substring(0,s.indexOf(":"));if(n)return"arbitrary.."+n}},Rc=e=>{const{theme:s,prefix:n}=e,r={nextPart:new Map,validators:[]};return Fc(Object.entries(e.classGroups),n).forEach(([o,i])=>{Ir(i,r,o,s)}),r},Ir=(e,s,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?s:Ha(s,a);o.classGroupId=n;return}if(typeof a=="function"){if(Ic(a)){Ir(a(r),s,n,r);return}s.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,i])=>{Ir(i,Ha(s,o),n,r)})})},Ha=(e,s)=>{let n=e;return s.split(Xr).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ic=e=>e.isThemeGetter,Fc=(e,s)=>s?e.map(([n,r])=>{const a=r.map(o=>typeof o=="string"?s+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[s+i,l])):o);return[n,a]}):e,Wc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let s=0,n=new Map,r=new Map;const a=(o,i)=>{n.set(o,i),s++,s>e&&(s=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return a(o,i),i},set(o,i){n.has(o)?n.set(o,i):a(o,i)}}},gi="!",zc=e=>{const{separator:s,experimentalParseClassName:n}=e,r=s.length===1,a=s[0],o=s.length,i=l=>{const d=[];let c=0,u=0,m;for(let k=0;k<l.length;k++){let b=l[k];if(c===0){if(b===a&&(r||l.slice(k,k+o)===s)){d.push(l.slice(u,k)),u=k+o;continue}if(b==="/"){m=k;continue}}b==="["?c++:b==="]"&&c--}const f=d.length===0?l:l.substring(u),h=f.startsWith(gi),g=h?f.substring(1):f,v=m&&m>u?m-u:void 0;return{modifiers:d,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:i}):i},qc=e=>{if(e.length<=1)return e;const s=[];let n=[];return e.forEach(r=>{r[0]==="["?(s.push(...n.sort(),r),n=[]):n.push(r)}),s.push(...n.sort()),s},Bc=e=>({cache:Wc(e.cacheSize),parseClassName:zc(e),...$c(e)}),Yc=/\s+/,Lc=(e,s)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=s,o=[],i=e.trim().split(Yc);let l="";for(let d=i.length-1;d>=0;d-=1){const c=i[d],{modifiers:u,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:h}=n(c);let g=!!h,v=r(g?f.substring(0,h):f);if(!v){if(!g){l=c+(l.length>0?" "+l:l);continue}if(v=r(f),!v){l=c+(l.length>0?" "+l:l);continue}g=!1}const k=qc(u).join(":"),b=m?k+gi:k,j=b+v;if(o.includes(j))continue;o.push(j);const N=a(v,g);for(let C=0;C<N.length;++C){const S=N[C];o.push(b+S)}l=c+(l.length>0?" "+l:l)}return l};function Hc(){let e=0,s,n,r="";for(;e<arguments.length;)(s=arguments[e++])&&(n=bi(s))&&(r&&(r+=" "),r+=n);return r}const bi=e=>{if(typeof e=="string")return e;let s,n="";for(let r=0;r<e.length;r++)e[r]&&(s=bi(e[r]))&&(n&&(n+=" "),n+=s);return n};function Uc(e,...s){let n,r,a,o=i;function i(d){const c=s.reduce((u,m)=>m(u),e());return n=Bc(c),r=n.cache.get,a=n.cache.set,o=l,l(d)}function l(d){const c=r(d);if(c)return c;const u=Lc(d,n);return a(d,u),u}return function(){return o(Hc.apply(null,arguments))}}const ke=e=>{const s=n=>n[e]||[];return s.isThemeGetter=!0,s},yi=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kc=/^\d+\/\d+$/,Vc=new Set(["px","full","screen"]),Gc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qc=/\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$/,Xc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kt=e=>Es(e)||Vc.has(e)||Kc.test(e),Pt=e=>Is(e,"length",iu),Es=e=>!!e&&!Number.isNaN(Number(e)),mr=e=>Is(e,"number",Es),Qs=e=>!!e&&Number.isInteger(Number(e)),eu=e=>e.endsWith("%")&&Es(e.slice(0,-1)),de=e=>yi.test(e),$t=e=>Gc.test(e),tu=new Set(["length","size","percentage"]),su=e=>Is(e,tu,vi),nu=e=>Is(e,"position",vi),ru=new Set(["image","url"]),au=e=>Is(e,ru,du),ou=e=>Is(e,"",lu),Xs=()=>!0,Is=(e,s,n)=>{const r=yi.exec(e);return r?r[1]?typeof s=="string"?r[1]===s:s.has(r[1]):n(r[2]):!1},iu=e=>Qc.test(e)&&!Xc.test(e),vi=()=>!1,lu=e=>Jc.test(e),du=e=>Zc.test(e),cu=()=>{const e=ke("colors"),s=ke("spacing"),n=ke("blur"),r=ke("brightness"),a=ke("borderColor"),o=ke("borderRadius"),i=ke("borderSpacing"),l=ke("borderWidth"),d=ke("contrast"),c=ke("grayscale"),u=ke("hueRotate"),m=ke("invert"),f=ke("gap"),h=ke("gradientColorStops"),g=ke("gradientColorStopPositions"),v=ke("inset"),k=ke("margin"),b=ke("opacity"),j=ke("padding"),N=ke("saturate"),C=ke("scale"),S=ke("sepia"),x=ke("skew"),w=ke("space"),D=ke("translate"),_=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",de,s],R=()=>[de,s],W=()=>["",kt,Pt],$=()=>["auto",Es,de],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",de],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Es,de];return{cacheSize:500,separator:":",theme:{colors:[Xs],spacing:[kt,Pt],blur:["none","",$t,de],brightness:X(),borderColor:[e],borderRadius:["none","","full",$t,de],borderSpacing:R(),borderWidth:W(),contrast:X(),grayscale:I(),hueRotate:X(),invert:I(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[eu,Pt],inset:z(),margin:z(),opacity:X(),padding:R(),saturate:X(),scale:X(),sepia:I(),skew:X(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[$t]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:[...G(),de]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qs,de]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Qs,de]}],"grid-cols":[{"grid-cols":[Xs]}],"col-start-end":[{col:["auto",{span:["full",Qs,de]},de]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Xs]}],"row-start-end":[{row:["auto",{span:[Qs,de]},de]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,s]}],"min-w":[{"min-w":[de,s,"min","max","fit"]}],"max-w":[{"max-w":[de,s,"none","full","min","max","fit","prose",{screen:[$t]},$t]}],h:[{h:[de,s,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,s,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,s,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,s,"auto","min","max","fit"]}],"font-size":[{text:["base",$t,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mr]}],"font-family":[{font:[Xs]}],"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",de]}],"line-clamp":[{"line-clamp":["none",Es,mr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kt,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kt,Pt]}],"underline-offset":[{"underline-offset":["auto",kt,de]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],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",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),nu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",su]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},au]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"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":[b]}],"border-style":[{border:[...O(),"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":[b]}],"divide-style":[{divide:O()}],"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:["",...O()]}],"outline-offset":[{"outline-offset":[kt,de]}],"outline-w":[{outline:[kt,Pt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[kt,Pt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$t,ou]}],"shadow-color":[{shadow:[Xs]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",$t,de]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[N]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Qs,de]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],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",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kt,Pt,mr]}],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"]}}},uu=Uc(cu);function T(...e){return uu(xi(e))}const Jr=wd,rs=vd,as=jd,Ft=p.forwardRef(({className:e,sideOffset:s=4,...n},r)=>t.jsx(Do,{ref:r,sideOffset:s,className:T("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),...n}));Ft.displayName=Do.displayName;var So;const ji=((So=window.__MERIDIAN_CONFIG__)==null?void 0:So.apiUrl)??void 0??"";class wi extends Error{constructor(s,n,r){super(n),this.status=s,this.data=r,this.name="ApiError"}}function Ni(){return localStorage.getItem("meridian_token")}async function Js(e,s={}){var o;const n=Ni(),r={"Content-Type":"application/json",...s.headers};n&&(r.Authorization=`Bearer ${n}`);const a=await fetch(`${ji}${e}`,{...s,headers:r});if(!a.ok){let i;try{i=await a.json()}catch{i=null}const l=((o=i==null?void 0:i.error)==null?void 0:o.message)??`HTTP ${a.status}`;throw new wi(a.status,l,i)}if(a.status!==204)return a.json()}const J={get:e=>Js(e,{method:"GET"}),post:(e,s)=>Js(e,{method:"POST",body:JSON.stringify(s)}),put:(e,s)=>Js(e,{method:"PUT",body:JSON.stringify(s)}),patch:(e,s)=>Js(e,{method:"PATCH",body:JSON.stringify(s)}),delete:e=>Js(e,{method:"DELETE"}),upload:async(e,s)=>{var o;const n=Ni(),r={};n&&(r.Authorization=`Bearer ${n}`);const a=await fetch(`${ji}${e}`,{method:"POST",headers:r,body:s});if(!a.ok){let i;try{i=await a.json()}catch{i=null}const l=((o=i==null?void 0:i.error)==null?void 0:o.message)??`HTTP ${a.status}`;throw new wi(a.status,l,i)}if(a.status!==204)return a.json()}};function Yn(e=!0){return Ne({queryKey:["workspaces"],queryFn:()=>J.get("/admin/workspaces"),select:s=>s.workspaces,enabled:e})}function mu(){const e=he();return fe({mutationFn:s=>J.post("/admin/workspaces",s),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function fu(e){const s=he();return fe({mutationFn:n=>J.put(`/admin/workspaces/${e}`,n),onSuccess:()=>{s.invalidateQueries({queryKey:["workspaces"]})}})}const Zr={list:e=>["workspaces",e,"invitations"]};function hu(e){return Ne({queryKey:Zr.list(e),queryFn:()=>J.get(`/admin/workspaces/${e}/invitations`),select:s=>s.invitations,enabled:!!e})}function xu(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/workspaces/${e}/invitations`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Zr.list(e)})}})}function pu(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/workspaces/${e}/invitations/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Zr.list(e)})}})}const ea={list:e=>["workspaces",e,"members"]};function Ln(e){return Ne({queryKey:ea.list(e),queryFn:()=>J.get(`/admin/workspaces/${e}/members`),select:s=>s.members,enabled:!!e})}function gu(e){const s=he();return fe({mutationFn:({userId:n,role:r})=>J.patch(`/admin/workspaces/${e}/members/${n}`,{role:r}),onSuccess:()=>{s.invalidateQueries({queryKey:ea.list(e)})}})}function bu(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/workspaces/${e}/members/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:ea.list(e)})}})}const Wt={list:e=>["workspaces",e,"teams"],members:(e,s)=>["workspaces",e,"teams",s,"members"]};function ta(e){return Ne({queryKey:Wt.list(e),queryFn:()=>J.get(`/admin/workspaces/${e}/teams`),select:s=>s.teams,enabled:!!e})}function yu(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/workspaces/${e}/teams`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Wt.list(e)})}})}function vu(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/workspaces/${e}/teams/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Wt.list(e)})}})}function ju(e,s){return Ne({queryKey:Wt.members(e,s),queryFn:()=>J.get(`/admin/workspaces/${e}/teams/${s}/members`),select:n=>n.members,enabled:!!(e&&s)})}function wu(e,s){const n=he();return fe({mutationFn:r=>J.post(`/admin/workspaces/${e}/teams/${s}/members`,{user_id:r}),onSuccess:()=>{n.invalidateQueries({queryKey:Wt.members(e,s)}),n.invalidateQueries({queryKey:Wt.list(e)})}})}function Nu(e,s){const n=he();return fe({mutationFn:r=>J.delete(`/admin/workspaces/${e}/teams/${s}/members/${r}`),onSuccess:()=>{n.invalidateQueries({queryKey:Wt.members(e,s)}),n.invalidateQueries({queryKey:Wt.list(e)})}})}function ki(){return Ne({queryKey:["setup-status"],queryFn:()=>J.get("/auth/setup"),staleTime:6e4,retry:!1})}function ku(){const{login:e}=Se();return fe({mutationFn:s=>J.post("/auth/login",s),onSuccess:s=>{e(s.user,s.token)}})}function Su(){const{login:e}=Se();return fe({mutationFn:s=>J.post("/auth/register",s),onSuccess:s=>{e(s.user,s.token)}})}function Cu(e){const{login:s}=Se();return fe({mutationFn:n=>J.post(`/auth/invite/${e}`,n),onSuccess:n=>{s(n.user,n.token)}})}var Co;const Mu=((Co=window.__MERIDIAN_CONFIG__)==null?void 0:Co.apiUrl)??void 0??"";function Du(e,s){const n=`${Mu}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(s)}`;return new EventSource(n)}function Eu(){const{token:e,workspace:s}=Se(),n=he(),r=p.useRef(null);p.useEffect(()=>{if(!e||!s)return;const a=Du(e,s.id);r.current=a;const o=i=>{i.forEach(l=>n.invalidateQueries({queryKey:l}))};return a.addEventListener("issue.created",()=>{o([["issues"],["notifications"]])}),a.addEventListener("issue.status_changed",()=>{o([["issues"]])}),a.addEventListener("issue.assigned",()=>{o([["issues"],["notifications"]])}),a.addEventListener("comment.created",()=>{o([["issues"],["notifications"]])}),a.onerror=()=>{},()=>{a.close(),r.current=null}},[e,s==null?void 0:s.id,n])}const Ua=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ka=xi,xn=(e,s)=>n=>{var r;if((s==null?void 0:s.variants)==null)return Ka(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=s,i=Object.keys(a).map(c=>{const u=n==null?void 0:n[c],m=o==null?void 0:o[c];if(u===null)return null;const f=Ua(u)||Ua(m);return a[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[m,f]=u;return f===void 0||(c[m]=f),c},{}),d=s==null||(r=s.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:m,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,k]=g;return Array.isArray(k)?k.includes({...o,...l}[v]):{...o,...l}[v]===k})?[...c,m,f]:c},[]);return Ka(e,i,d,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
3
|
+
* @license lucide-react v0.468.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const _u=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Si=(...e)=>e.filter((s,n,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===n).join(" ").trim();/**
|
|
8
|
+
* @license lucide-react v0.468.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/var Ou={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"};/**
|
|
13
|
+
* @license lucide-react v0.468.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const Tu=p.forwardRef(({color:e="currentColor",size:s=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...l},d)=>p.createElement("svg",{ref:d,...Ou,width:s,height:s,stroke:e,strokeWidth:r?Number(n)*24/Number(s):n,className:Si("lucide",a),...l},[...i.map(([c,u])=>p.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
|
18
|
+
* @license lucide-react v0.468.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const H=(e,s)=>{const n=p.forwardRef(({className:r,...a},o)=>p.createElement(Tu,{ref:o,iconNode:s,className:Si(`lucide-${_u(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
|
|
23
|
+
* @license lucide-react v0.468.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const Hn=H("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
28
|
+
* @license lucide-react v0.468.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const sa=H("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
33
|
+
* @license lucide-react v0.468.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/const Un=H("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
38
|
+
* @license lucide-react v0.468.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const pn=H("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"}]]);/**
|
|
43
|
+
* @license lucide-react v0.468.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const Ci=H("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"}]]);/**
|
|
48
|
+
* @license lucide-react v0.468.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/const Mi=H("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"}]]);/**
|
|
53
|
+
* @license lucide-react v0.468.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/const Pu=H("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"}]]);/**
|
|
58
|
+
* @license lucide-react v0.468.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const Di=H("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"}]]);/**
|
|
63
|
+
* @license lucide-react v0.468.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const ls=H("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"}]]);/**
|
|
68
|
+
* @license lucide-react v0.468.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const $u=H("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
73
|
+
* @license lucide-react v0.468.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const gt=H("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
78
|
+
* @license lucide-react v0.468.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const Fs=H("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
83
|
+
* @license lucide-react v0.468.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const na=H("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
88
|
+
* @license lucide-react v0.468.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Ws=H("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
93
|
+
* @license lucide-react v0.468.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const ra=H("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
98
|
+
* @license lucide-react v0.468.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Ei=H("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
103
|
+
* @license lucide-react v0.468.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const ms=H("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
108
|
+
* @license lucide-react v0.468.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const _i=H("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"}]]);/**
|
|
113
|
+
* @license lucide-react v0.468.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Oi=H("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"}]]);/**
|
|
118
|
+
* @license lucide-react v0.468.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const yt=H("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
123
|
+
* @license lucide-react v0.468.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const Au=H("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"}]]);/**
|
|
128
|
+
* @license lucide-react v0.468.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Lt=H("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
133
|
+
* @license lucide-react v0.468.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const Ti=H("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"}]]);/**
|
|
138
|
+
* @license lucide-react v0.468.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Pi=H("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
143
|
+
* @license lucide-react v0.468.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const Ru=H("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"}]]);/**
|
|
148
|
+
* @license lucide-react v0.468.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const $i=H("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
|
|
153
|
+
* @license lucide-react v0.468.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const aa=H("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"}]]);/**
|
|
158
|
+
* @license lucide-react v0.468.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Kn=H("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"}]]);/**
|
|
163
|
+
* @license lucide-react v0.468.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const oa=H("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"}]]);/**
|
|
168
|
+
* @license lucide-react v0.468.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const ia=H("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"}]]);/**
|
|
173
|
+
* @license lucide-react v0.468.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const gn=H("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"}]]);/**
|
|
178
|
+
* @license lucide-react v0.468.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const Iu=H("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"}]]);/**
|
|
183
|
+
* @license lucide-react v0.468.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const Fu=H("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"}]]);/**
|
|
188
|
+
* @license lucide-react v0.468.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const Wu=H("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"}]]);/**
|
|
193
|
+
* @license lucide-react v0.468.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const zu=H("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"}]]);/**
|
|
198
|
+
* @license lucide-react v0.468.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const qu=H("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"}]]);/**
|
|
203
|
+
* @license lucide-react v0.468.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const la=H("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"}]]);/**
|
|
208
|
+
* @license lucide-react v0.468.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Vn=H("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"}]]);/**
|
|
213
|
+
* @license lucide-react v0.468.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const Ai=H("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"}]]);/**
|
|
218
|
+
* @license lucide-react v0.468.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const Bu=H("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"}]]);/**
|
|
223
|
+
* @license lucide-react v0.468.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const Yu=H("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"}]]);/**
|
|
228
|
+
* @license lucide-react v0.468.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const Lu=H("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"}]]);/**
|
|
233
|
+
* @license lucide-react v0.468.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const Ri=H("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"}]]);/**
|
|
238
|
+
* @license lucide-react v0.468.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const vt=H("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"}]]);/**
|
|
243
|
+
* @license lucide-react v0.468.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const zn=H("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"}]]);/**
|
|
248
|
+
* @license lucide-react v0.468.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const Ii=H("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"}]]);/**
|
|
253
|
+
* @license lucide-react v0.468.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const Hu=H("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"}]]);/**
|
|
258
|
+
* @license lucide-react v0.468.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const Fi=H("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"}]]);/**
|
|
263
|
+
* @license lucide-react v0.468.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const Uu=H("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"}]]);/**
|
|
268
|
+
* @license lucide-react v0.468.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const Wi=H("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"}]]);/**
|
|
273
|
+
* @license lucide-react v0.468.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const zi=H("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"}]]);/**
|
|
278
|
+
* @license lucide-react v0.468.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const Ku=H("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"}]]);/**
|
|
283
|
+
* @license lucide-react v0.468.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const bn=H("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
288
|
+
* @license lucide-react v0.468.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Vu=H("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
293
|
+
* @license lucide-react v0.468.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const Gu=H("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
298
|
+
* @license lucide-react v0.468.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const qi=H("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"}]]);/**
|
|
303
|
+
* @license lucide-react v0.468.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const Gn=H("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"}]]);/**
|
|
308
|
+
* @license lucide-react v0.468.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const Qn=H("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
313
|
+
* @license lucide-react v0.468.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const Fe=H("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
318
|
+
* @license lucide-react v0.468.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const Qu=H("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"}]]);/**
|
|
323
|
+
* @license lucide-react v0.468.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const Xu=H("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"}]]);/**
|
|
328
|
+
* @license lucide-react v0.468.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const Xn=H("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
333
|
+
* @license lucide-react v0.468.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const Ju=H("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"}]]);/**
|
|
338
|
+
* @license lucide-react v0.468.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const da=H("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"}]]);/**
|
|
343
|
+
* @license lucide-react v0.468.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const ca=H("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"}]]);/**
|
|
348
|
+
* @license lucide-react v0.468.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const Bi=H("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"}]]);/**
|
|
353
|
+
* @license lucide-react v0.468.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const Yi=H("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"}]]);/**
|
|
358
|
+
* @license lucide-react v0.468.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const Zu=H("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
363
|
+
* @license lucide-react v0.468.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const Li=H("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"}]]);/**
|
|
368
|
+
* @license lucide-react v0.468.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const em=H("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"}]]);/**
|
|
373
|
+
* @license lucide-react v0.468.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const tm=H("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"}]]);/**
|
|
378
|
+
* @license lucide-react v0.468.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const sm=H("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"}]]);/**
|
|
383
|
+
* @license lucide-react v0.468.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const fs=H("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"}]]);/**
|
|
388
|
+
* @license lucide-react v0.468.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const nm=H("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
393
|
+
* @license lucide-react v0.468.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const rm=H("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"}]]);/**
|
|
398
|
+
* @license lucide-react v0.468.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const am=H("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"}]]);/**
|
|
403
|
+
* @license lucide-react v0.468.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const om=H("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"}]]);/**
|
|
408
|
+
* @license lucide-react v0.468.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const yn=H("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"}]]);/**
|
|
413
|
+
* @license lucide-react v0.468.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const ua=H("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
418
|
+
* @license lucide-react v0.468.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const Ts=H("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"}]]);/**
|
|
423
|
+
* @license lucide-react v0.468.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const im=H("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"}]]);/**
|
|
428
|
+
* @license lucide-react v0.468.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const We=H("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
433
|
+
* @license lucide-react v0.468.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const vn=H("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"}]]),fr=768;function lm(){const[e,s]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${fr-1}px)`),r=()=>{s(window.innerWidth<fr)};return n.addEventListener("change",r),s(window.innerWidth<fr),()=>n.removeEventListener("change",r)},[]),!!e}const Wn=xn("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"}}),V=p.forwardRef(({className:e,variant:s,size:n,asChild:r=!1,...a},o)=>{const i=r?Hr:"button";return t.jsx(i,{className:T(Wn({variant:s,size:n,className:e})),ref:o,...a})});V.displayName="Button";const xe=p.forwardRef(({className:e,type:s,...n},r)=>t.jsx("input",{type:s,className:T("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:r,...n}));xe.displayName="Input";const ma=p.forwardRef(({className:e,orientation:s="horizontal",decorative:n=!0,...r},a)=>t.jsx(Eo,{ref:a,decorative:n,orientation:s,className:T("shrink-0 bg-border",s==="horizontal"?"h-px w-full":"h-full w-px",e),...r}));ma.displayName=Eo.displayName;const dm=Bn,cm=qn,Hi=p.forwardRef(({className:e,...s},n)=>t.jsx(As,{className:T("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),...s,ref:n}));Hi.displayName=As.displayName;const um=xn("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"}}),Ui=p.forwardRef(({side:e="right",className:s,children:n,...r},a)=>t.jsxs(cm,{children:[t.jsx(Hi,{}),t.jsxs(Rs,{ref:a,className:T(um({side:e}),s),...r,children:[n,t.jsxs(Ur,{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:[t.jsx(We,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ui.displayName=Rs.displayName;const Ki=({className:e,...s})=>t.jsx("div",{className:T("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...s});Ki.displayName="SheetHeader";const Vi=p.forwardRef(({className:e,...s},n)=>t.jsx(fn,{ref:n,className:T("text-base font-semibold text-foreground",e),...s}));Vi.displayName=fn.displayName;const Gi=p.forwardRef(({className:e,...s},n)=>t.jsx(hn,{ref:n,className:T("text-sm text-muted-foreground",e),...s}));Gi.displayName=hn.displayName;function se({className:e,...s}){return t.jsx("div",{className:T("animate-pulse rounded-md bg-muted",e),...s})}const mm="sidebar_state",fm=60*60*24*7,hm="16rem",xm="18rem",pm="3rem",gm="b",Qi=p.createContext(null);function fa(){const e=p.useContext(Qi);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function bm({defaultOpen:e=!0,open:s,onOpenChange:n,className:r,style:a,children:o,...i}){const l=lm(),[d,c]=p.useState(!1),[u,m]=p.useState(e),f=s??u,h=p.useCallback(b=>{const j=typeof b=="function"?b(f):b;n?n(j):m(j),document.cookie=`${mm}=${j}; path=/; max-age=${fm}`},[n,f]),g=p.useCallback(()=>l?c(b=>!b):h(b=>!b),[l,h,c]);p.useEffect(()=>{const b=j=>{j.key===gm&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),g())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[g]);const v=f?"expanded":"collapsed",k=p.useMemo(()=>({state:v,open:f,setOpen:h,isMobile:l,openMobile:d,setOpenMobile:c,toggleSidebar:g}),[v,f,h,l,d,c,g]);return t.jsx(Qi.Provider,{value:k,children:t.jsx(Jr,{delayDuration:0,children:t.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":hm,"--sidebar-width-icon":pm,...a},className:T("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",r),...i,children:o})})})}function ym({side:e="left",variant:s="sidebar",collapsible:n="offcanvas",className:r,children:a,...o}){const{isMobile:i,state:l,openMobile:d,setOpenMobile:c}=fa();return n==="none"?t.jsx("div",{"data-slot":"sidebar",className:T("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",r),...o,children:a}):i?t.jsx(dm,{open:d,onOpenChange:c,...o,children:t.jsxs(Ui,{"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":xm},side:e,children:[t.jsxs(Ki,{className:"sr-only",children:[t.jsx(Vi,{children:"Sidebar"}),t.jsx(Gi,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):t.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":s,"data-side":e,"data-slot":"sidebar",children:[t.jsx("div",{"data-slot":"sidebar-gap",className:T("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",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),t.jsx("div",{"data-slot":"sidebar-container",className:T("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)]",s==="floating"||s==="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",r),...o,children:t.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 vm({className:e,onClick:s,...n}){const{toggleSidebar:r}=fa();return t.jsxs(V,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:T("size-7",e),onClick:a=>{s==null||s(a),r()},...n,children:[t.jsx(Gu,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function jm({className:e,...s}){return t.jsx("main",{"data-slot":"sidebar-inset",className:T("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),...s})}function wm({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:T("flex flex-col gap-2 p-2",e),...s})}function Nm({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:T("flex flex-col gap-2 p-2",e),...s})}function km({className:e,...s}){return t.jsx(ma,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:T("bg-sidebar-border mx-2 w-auto",e),...s})}function Sm({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:T("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...s})}function hr({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:T("relative flex w-full min-w-0 flex-col p-2",e),...s})}function Cm({className:e,asChild:s=!1,...n}){const r=s?Hr:"div";return t.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:T("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),...n})}function xr({className:e,...s}){return t.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:T("w-full text-sm",e),...s})}function on({className:e,...s}){return t.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:T("flex w-full min-w-0 flex-col gap-1",e),...s})}function ts({className:e,...s}){return t.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:T("group/menu-item relative",e),...s})}const Mm=xn("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"}}),It=p.forwardRef(function({asChild:s=!1,isActive:n=!1,variant:r="default",size:a="default",tooltip:o,className:i,...l},d){const c=s?Hr:"button",{isMobile:u,state:m}=fa(),f=t.jsx(c,{ref:d,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":n,className:T(Mm({variant:r,size:a}),i),...l});return o?(typeof o=="string"&&(o={children:o}),t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:f}),t.jsx(Ft,{side:"right",align:"center",hidden:m!=="collapsed"||u,...o})]})):f});It.displayName="SidebarMenuButton";const Dm=250,Em=300,os={all:["projects"],list:()=>[...os.all,"list"],detail:e=>[...os.all,e],byKey:e=>[...os.all,"key",e]};function Jn(){const{workspace:e}=Se();return Ne({queryKey:[...os.list(),e==null?void 0:e.id],queryFn:()=>{const s=e!=null&&e.id?`?workspace_id=${e.id}`:"";return J.get(`/admin/projects${s}`)},select:s=>s.projects,enabled:!!(e!=null&&e.id)})}function hs(e){return Ne({queryKey:os.byKey(e),queryFn:()=>J.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:s=>s.project,enabled:!!e})}function _m(e,s={}){const[n,r]=p.useState(e),a=s.enabled!==!1;return p.useEffect(()=>{if(!a)return;const l=setTimeout(()=>r(e),Dm);return()=>clearTimeout(l)},[e,a]),{...Ne({queryKey:["projects","suggest-identifier",n],queryFn:()=>J.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(n)}`),select:l=>l.identifier,enabled:a&&n.trim().length>0}),flush:()=>r(e)}}function Om(e,s={}){const n=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[r,a]=p.useState(n),o=s.enabled!==!1&&n.length>=3;p.useEffect(()=>{if(!n){a("");return}const l=setTimeout(()=>a(n),Em);return()=>clearTimeout(l)},[n]);const i=Ne({queryKey:["projects","check-identifier",r],queryFn:()=>J.get(`/admin/projects/check-identifier/${encodeURIComponent(r)}`),select:l=>l.available,enabled:o&&r.length>=3});return{available:i.data,isLoading:i.isLoading,isFetching:i.isFetching}}function Tm(){const e=he();return fe({mutationFn:s=>J.post("/admin/projects",s),onSuccess:()=>{e.invalidateQueries({queryKey:os.list()})}})}function Pm(){const e=he();return fe({mutationFn:s=>J.delete(`/admin/projects/${s}`),onSuccess:()=>{e.invalidateQueries({queryKey:os.list()})}})}const zs=kd,qs=Sd,$m=p.forwardRef(({className:e,inset:s,children:n,...r},a)=>t.jsxs(_o,{ref:a,className:T("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",s&&"pl-8",e),...r,children:[n,t.jsx(Ws,{className:"ml-auto"})]}));$m.displayName=_o.displayName;const Am=p.forwardRef(({className:e,...s},n)=>t.jsx(Oo,{ref:n,className:T("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),...s}));Am.displayName=Oo.displayName;const xs=p.forwardRef(({className:e,sideOffset:s=4,...n},r)=>t.jsx(Nd,{children:t.jsx(To,{ref:r,sideOffset:s,className:T("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),...n})}));xs.displayName=To.displayName;const Xe=p.forwardRef(({className:e,inset:s,...n},r)=>t.jsx(Po,{ref:r,className:T("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",s&&"pl-8",e),...n}));Xe.displayName=Po.displayName;const Rm=p.forwardRef(({className:e,children:s,checked:n,...r},a)=>t.jsxs($o,{ref:a,className:T("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:n,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ao,{children:t.jsx(gt,{className:"h-4 w-4"})})}),s]}));Rm.displayName=$o.displayName;const Im=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Ro,{ref:r,className:T("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),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ao,{children:t.jsx(yt,{className:"h-2 w-2 fill-current"})})}),s]}));Im.displayName=Ro.displayName;const ha=p.forwardRef(({className:e,inset:s,...n},r)=>t.jsx(Io,{ref:r,className:T("px-2 py-1.5 text-xs font-medium text-muted-foreground",s&&"pl-8",e),...n}));ha.displayName=Io.displayName;const jn=p.forwardRef(({className:e,...s},n)=>t.jsx(Fo,{ref:n,className:T("-mx-1 my-1 h-px bg-border",e),...s}));jn.displayName=Fo.displayName;const st=p.forwardRef(({className:e,...s},n)=>t.jsx(Wo,{ref:n,className:T("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...s}));st.displayName=Wo.displayName;const Fm=p.forwardRef(({className:e,...s},n)=>t.jsx(zo,{ref:n,className:T("aspect-square h-full w-full",e),...s}));Fm.displayName=zo.displayName;const nt=p.forwardRef(({className:e,...s},n)=>t.jsx(qo,{ref:n,className:T("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...s}));nt.displayName=qo.displayName;function Wm(){var a;const{workspace:e,setWorkspace:s}=Se(),{data:n}=Yn(),r=Ve();return t.jsx(on,{children:t.jsx(ts,{children:t.jsxs(zs,{children:[t.jsx(qs,{asChild:!0,children:t.jsxs(It,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[t.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:t.jsx("span",{className:"text-[13px] font-bold",children:(((a=e==null?void 0:e.name)==null?void 0:a[0])??"M").toUpperCase()})}),t.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[t.jsx("span",{className:"truncate font-semibold",children:(e==null?void 0:e.name)??"Meridian"}),t.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.slug)??""})]}),t.jsx(Ei,{className:"ml-auto size-4 shrink-0"})]})}),t.jsxs(xs,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[t.jsx(ha,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),n==null?void 0:n.map(o=>t.jsxs(Xe,{className:"cursor-pointer gap-2 p-2",onClick:()=>{s({id:o.id,name:o.name,slug:o.slug}),r(`/${o.slug}/projects`)},children:[t.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-foreground text-background shrink-0",children:t.jsx("span",{className:"text-[10px] font-bold",children:o.name[0].toUpperCase()})}),t.jsx("span",{className:"flex-1 truncate",children:o.name}),o.id===(e==null?void 0:e.id)&&t.jsx(gt,{className:"size-3.5 text-muted-foreground shrink-0"})]},o.id)),t.jsx(jn,{}),t.jsxs(Xe,{className:"cursor-pointer gap-2 p-2 text-muted-foreground",onClick:()=>r("/setup"),children:[t.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:t.jsx("span",{className:"text-xs font-semibold",children:"+"})}),t.jsx("span",{children:"Create workspace"})]})]})]})})})}function zm(){var a,o;const{user:e,logout:s}=Se(),n=e?`${((a=e.first_name)==null?void 0:a[0])??""}${((o=e.last_name)==null?void 0:o[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",r=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return t.jsx(on,{children:t.jsx(ts,{children:t.jsxs(zs,{children:[t.jsx(qs,{asChild:!0,children:t.jsxs(It,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[t.jsx(st,{className:"h-8 w-8 rounded-lg shrink-0",children:t.jsx(nt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})}),t.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[t.jsx("span",{className:"truncate font-semibold",children:r}),t.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),t.jsx(Ei,{className:"ml-auto size-4 shrink-0"})]})}),t.jsxs(xs,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[t.jsx(ha,{className:"p-0 font-normal",children:t.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[t.jsx(st,{className:"h-8 w-8 rounded-lg",children:t.jsx(nt,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})}),t.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[t.jsx("span",{className:"truncate font-semibold",children:r}),t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:(e==null?void 0:e.email)??""})]})]})}),t.jsx(jn,{}),t.jsxs(Xe,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:s,children:[t.jsx(Ku,{className:"size-4"}),"Sign out"]})]})]})})})}function qm({...e}){const{workspace:s,projectKey:n}=Ke(),{data:r}=Jn(),{toggle:a}=fi(),o=Lr(),i=s??"",l=o.pathname===`/${i}/projects`,d=o.pathname.includes("/notifications"),c=o.pathname.includes("/settings");return t.jsxs(ym,{collapsible:"offcanvas",...e,children:[t.jsx(wm,{children:t.jsx(Wm,{})}),t.jsxs(Sm,{children:[t.jsx(hr,{children:t.jsx(xr,{children:t.jsxs(on,{children:[t.jsx(ts,{children:t.jsxs(It,{onClick:a,tooltip:"Search",children:[t.jsx(Xn,{}),t.jsx("span",{children:"Search"}),t.jsx("kbd",{className:"ml-auto hidden text-[10px] text-sidebar-foreground/40 font-mono sm:inline-flex",children:"⌘K"})]})}),t.jsx(ts,{children:t.jsx(It,{asChild:!0,isActive:l,tooltip:"Projects",children:t.jsxs(rn,{to:`/${i}/projects`,end:!0,children:[t.jsx(vt,{}),t.jsx("span",{children:"Projects"})]})})}),t.jsx(ts,{children:t.jsx(It,{asChild:!0,isActive:d,tooltip:"Notifications",children:t.jsxs(rn,{to:`/${i}/notifications`,children:[t.jsx(pn,{}),t.jsx("span",{children:"Notifications"})]})})})]})})}),r&&r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(km,{}),t.jsxs(hr,{children:[t.jsx(Cm,{children:"Recent"}),t.jsx(xr,{children:t.jsx(on,{children:r.slice(0,5).map(u=>t.jsx(ts,{children:t.jsx(It,{asChild:!0,isActive:u.identifier===n,tooltip:u.name,children:t.jsxs(rn,{to:`/${i}/projects/${u.identifier}/board`,children:[t.jsx("span",{className:"font-mono text-[11px] text-sidebar-foreground/50 shrink-0",children:u.identifier}),t.jsx("span",{className:"truncate",children:u.name})]})})},u.id))})})]})]}),t.jsx(hr,{className:"mt-auto",children:t.jsx(xr,{children:t.jsx(on,{children:t.jsx(ts,{children:t.jsx(It,{asChild:!0,isActive:c,tooltip:"Settings",children:t.jsxs(rn,{to:`/${i}/settings`,children:[t.jsx(da,{}),t.jsx("span",{children:"Settings"})]})})})})})})]}),t.jsx(Nm,{children:t.jsx(zm,{})})]})}function Bm(){const{theme:e,setTheme:s}=kc();return t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsxs(V,{variant:"ghost",size:"icon-sm",onClick:()=>s(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[t.jsx(em,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),t.jsx(Vu,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),t.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),t.jsx(Ft,{children:"Toggle theme"})]})}const wn={all:["notifications"],list:()=>[...wn.all,"list"]};function Ym(){return Ne({queryKey:wn.list(),queryFn:()=>J.get("/admin/notifications"),select:e=>e.notifications})}function Lm(){return Ne({queryKey:[...wn.list(),"unread"],queryFn:()=>J.get("/admin/notifications?read=false"),select:e=>e.count})}function Hm(){const e=he();return fe({mutationFn:s=>J.post(`/admin/notifications/${s}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:wn.list()})}})}function Um(){const e=he();return fe({mutationFn:()=>J.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:wn.list()})}})}function Km(){const e=Lr(),{projectKey:s}=Ke(),{data:n}=Jn(),r=n==null?void 0:n.find(o=>o.identifier===s),a=e.pathname;return a.includes("/board")?{icon:vt,label:r?`${r.name} / Board`:"Board"}:a.includes("/issues")?{icon:Vn,label:r?`${r.name} / Issues`:"Issues"}:a.endsWith("/projects")?{icon:zn,label:"Projects"}:a.includes("/notifications")?{icon:pn,label:"Notifications"}:a.includes("/settings")?{icon:da,label:"Settings"}:{icon:zn,label:"Meridian"}}function Vm(){const{data:e=0}=Lm(),{icon:s,label:n}=Km(),{workspace:r}=Se(),a=(r==null?void 0:r.slug)??"";return t.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear w-full",children:t.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[t.jsx(vm,{className:"-ml-1"}),t.jsx(ma,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx(s,{className:"h-4 w-4 text-muted-foreground",strokeWidth:1.5}),t.jsx("span",{className:"font-medium",children:n})]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx(Bm,{}),t.jsx(V,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:t.jsxs(ln,{to:`/${a}/notifications`,children:[t.jsx(pn,{className:"h-4 w-4",strokeWidth:1.5}),e>0&&t.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 Gm(){return t.jsxs(bm,{children:[t.jsx(qm,{variant:"inset"}),t.jsxs(jm,{className:"flex flex-col min-w-0",children:[t.jsx(Vm,{}),t.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:t.jsx(Mo,{})})]})]})}function Qm(){const{projectKey:e,workspace:s}=Ke(),{data:n}=hs(e??""),r=`/${s}/projects/${e}`,a=[{to:`${r}/board`,label:"Board",icon:zn,end:!0},{to:`${r}/issues`,label:"Issues",icon:Vn,end:!1},{to:`${r}/sprints`,label:"Sprints",icon:vn,end:!0},{to:`${r}/access`,label:"Access",icon:zi,end:!0}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"px-6 pt-5 border-b border-border bg-white dark:bg-card shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-2.5 mb-4",children:[n&&t.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted border border-border px-2 py-0.5 rounded",children:n.identifier}),t.jsx("h1",{className:"text-sm font-semibold",children:(n==null?void 0:n.name)??""})]}),t.jsx("div",{className:"flex -mb-px",children:a.map(({to:o,label:i,icon:l,end:d})=>t.jsxs(rn,{to:o,end:d,className:({isActive:c})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${c?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[t.jsx(l,{className:"h-3.5 w-3.5",strokeWidth:1.5}),i]},o))})]}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:t.jsx(Mo,{})})]})}var Va=1,Xm=.9,Jm=.8,Zm=.17,pr=.1,gr=.999,ef=.9999,tf=.99,sf=/[\\\/_+.#"@\[\(\{&]/,nf=/[\\\/_+.#"@\[\(\{&]/g,rf=/[\s-]/,Xi=/[\s-]/g;function Fr(e,s,n,r,a,o,i){if(o===s.length)return a===e.length?Va:tf;var l=`${a},${o}`;if(i[l]!==void 0)return i[l];for(var d=r.charAt(o),c=n.indexOf(d,a),u=0,m,f,h,g;c>=0;)m=Fr(e,s,n,r,c+1,o+1,i),m>u&&(c===a?m*=Va:sf.test(e.charAt(c-1))?(m*=Jm,h=e.slice(a,c-1).match(nf),h&&a>0&&(m*=Math.pow(gr,h.length))):rf.test(e.charAt(c-1))?(m*=Xm,g=e.slice(a,c-1).match(Xi),g&&a>0&&(m*=Math.pow(gr,g.length))):(m*=Zm,a>0&&(m*=Math.pow(gr,c-a))),e.charAt(c)!==s.charAt(o)&&(m*=ef)),(m<pr&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(f=Fr(e,s,n,r,c+1,o+2,i),f*pr>m&&(m=f*pr)),m>u&&(u=m),c=n.indexOf(d,c+1);return i[l]=u,u}function Ga(e){return e.toLowerCase().replace(Xi," ")}function af(e,s,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Fr(e,s,Ga(e),Ga(s),0,0,{})}var Zs='[cmdk-group=""]',br='[cmdk-group-items=""]',of='[cmdk-group-heading=""]',xa='[cmdk-item=""]',Qa=`${xa}:not([aria-disabled="true"])`,Wr="cmdk-item-select",ss="data-value",lf=(e,s,n)=>af(e,s,n),Ji=p.createContext(void 0),Nn=()=>p.useContext(Ji),Zi=p.createContext(void 0),pa=()=>p.useContext(Zi),el=p.createContext(void 0),tl=p.forwardRef((e,s)=>{let n=Ss(()=>{var E,q;return{search:"",value:(q=(E=e.value)!=null?E:e.defaultValue)!=null?q:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Ss(()=>new Set),a=Ss(()=>new Map),o=Ss(()=>new Map),i=Ss(()=>new Set),l=sl(e),{label:d,children:c,value:u,onValueChange:m,filter:f,shouldFilter:h,loop:g,disablePointerSelection:v=!1,vimBindings:k=!0,...b}=e,j=Ds(),N=Ds(),C=Ds(),S=p.useRef(null),x=yf();ds(()=>{if(u!==void 0){let E=u.trim();n.current.value=E,w.emit()}},[u]),ds(()=>{x(6,W)},[]);let w=p.useMemo(()=>({subscribe:E=>(i.current.add(E),()=>i.current.delete(E)),snapshot:()=>n.current,setState:(E,q,K)=>{var U,ae,P;if(!Object.is(n.current[E],q)){if(n.current[E]=q,E==="search")R(),A(),x(1,z);else if(E==="value"&&(K||x(5,W),((U=l.current)==null?void 0:U.value)!==void 0)){let oe=q??"";(P=(ae=l.current).onValueChange)==null||P.call(ae,oe);return}w.emit()}},emit:()=>{i.current.forEach(E=>E())}}),[]),D=p.useMemo(()=>({value:(E,q,K)=>{var U;q!==((U=o.current.get(E))==null?void 0:U.value)&&(o.current.set(E,{value:q,keywords:K}),n.current.filtered.items.set(E,_(q,K)),x(2,()=>{A(),w.emit()}))},item:(E,q)=>(r.current.add(E),q&&(a.current.has(q)?a.current.get(q).add(E):a.current.set(q,new Set([E]))),x(3,()=>{R(),A(),n.current.value||z(),w.emit()}),()=>{o.current.delete(E),r.current.delete(E),n.current.filtered.items.delete(E);let K=$();x(4,()=>{R(),(K==null?void 0:K.getAttribute("id"))===E&&z(),w.emit()})}),group:E=>(a.current.has(E)||a.current.set(E,new Set),()=>{o.current.delete(E),a.current.delete(E)}),filter:()=>l.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:C,labelId:N,listInnerRef:S}),[]);function _(E,q){var K,U;let ae=(U=(K=l.current)==null?void 0:K.filter)!=null?U:lf;return E?ae(E,n.current.search,q):0}function A(){if(!n.current.search||l.current.shouldFilter===!1)return;let E=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(U=>{let ae=a.current.get(U),P=0;ae.forEach(oe=>{let be=E.get(oe);P=Math.max(be,P)}),q.push([U,P])});let K=S.current;G().sort((U,ae)=>{var P,oe;let be=U.getAttribute("id"),_e=ae.getAttribute("id");return((P=E.get(_e))!=null?P:0)-((oe=E.get(be))!=null?oe:0)}).forEach(U=>{let ae=U.closest(br);ae?ae.appendChild(U.parentElement===ae?U:U.closest(`${br} > *`)):K.appendChild(U.parentElement===K?U:U.closest(`${br} > *`))}),q.sort((U,ae)=>ae[1]-U[1]).forEach(U=>{var ae;let P=(ae=S.current)==null?void 0:ae.querySelector(`${Zs}[${ss}="${encodeURIComponent(U[0])}"]`);P==null||P.parentElement.appendChild(P)})}function z(){let E=G().find(K=>K.getAttribute("aria-disabled")!=="true"),q=E==null?void 0:E.getAttribute(ss);w.setState("value",q||void 0)}function R(){var E,q,K,U;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let P of r.current){let oe=(q=(E=o.current.get(P))==null?void 0:E.value)!=null?q:"",be=(U=(K=o.current.get(P))==null?void 0:K.keywords)!=null?U:[],_e=_(oe,be);n.current.filtered.items.set(P,_e),_e>0&&ae++}for(let[P,oe]of a.current)for(let be of oe)if(n.current.filtered.items.get(be)>0){n.current.filtered.groups.add(P);break}n.current.filtered.count=ae}function W(){var E,q,K;let U=$();U&&(((E=U.parentElement)==null?void 0:E.firstChild)===U&&((K=(q=U.closest(Zs))==null?void 0:q.querySelector(of))==null||K.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function $(){var E;return(E=S.current)==null?void 0:E.querySelector(`${xa}[aria-selected="true"]`)}function G(){var E;return Array.from(((E=S.current)==null?void 0:E.querySelectorAll(Qa))||[])}function O(E){let q=G()[E];q&&w.setState("value",q.getAttribute(ss))}function L(E){var q;let K=$(),U=G(),ae=U.findIndex(oe=>oe===K),P=U[ae+E];(q=l.current)!=null&&q.loop&&(P=ae+E<0?U[U.length-1]:ae+E===U.length?U[0]:U[ae+E]),P&&w.setState("value",P.getAttribute(ss))}function Z(E){let q=$(),K=q==null?void 0:q.closest(Zs),U;for(;K&&!U;)K=E>0?gf(K,Zs):bf(K,Zs),U=K==null?void 0:K.querySelector(Qa);U?w.setState("value",U.getAttribute(ss)):L(E)}let I=()=>O(G().length-1),M=E=>{E.preventDefault(),E.metaKey?I():E.altKey?Z(1):L(1)},X=E=>{E.preventDefault(),E.metaKey?O(0):E.altKey?Z(-1):L(-1)};return p.createElement(Yt.div,{ref:s,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:E=>{var q;if((q=b.onKeyDown)==null||q.call(b,E),!E.defaultPrevented)switch(E.key){case"n":case"j":{k&&E.ctrlKey&&M(E);break}case"ArrowDown":{M(E);break}case"p":case"k":{k&&E.ctrlKey&&X(E);break}case"ArrowUp":{X(E);break}case"Home":{E.preventDefault(),O(0);break}case"End":{E.preventDefault(),I();break}case"Enter":if(!E.nativeEvent.isComposing&&E.keyCode!==229){E.preventDefault();let K=$();if(K){let U=new Event(Wr);K.dispatchEvent(U)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:jf},d),Zn(e,E=>p.createElement(Zi.Provider,{value:w},p.createElement(Ji.Provider,{value:D},E))))}),df=p.forwardRef((e,s)=>{var n,r;let a=Ds(),o=p.useRef(null),i=p.useContext(el),l=Nn(),d=sl(e),c=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;ds(()=>{if(!c)return l.item(a,i==null?void 0:i.id)},[c]);let u=nl(a,o,[e.value,e.children,o],e.keywords),m=pa(),f=cs(x=>x.value&&x.value===u.current),h=cs(x=>c||l.filter()===!1?!0:x.search?x.filtered.items.get(a)>0:!0);p.useEffect(()=>{let x=o.current;if(!(!x||e.disabled))return x.addEventListener(Wr,g),()=>x.removeEventListener(Wr,g)},[h,e.onSelect,e.disabled]);function g(){var x,w;v(),(w=(x=d.current).onSelect)==null||w.call(x,u.current)}function v(){m.setState("value",u.current,!0)}if(!h)return null;let{disabled:k,value:b,onSelect:j,forceMount:N,keywords:C,...S}=e;return p.createElement(Yt.div,{ref:dn([o,s]),...S,id:a,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!f,"data-disabled":!!k,"data-selected":!!f,onPointerMove:k||l.getDisablePointerSelection()?void 0:v,onClick:k?void 0:g},e.children)}),cf=p.forwardRef((e,s)=>{let{heading:n,children:r,forceMount:a,...o}=e,i=Ds(),l=p.useRef(null),d=p.useRef(null),c=Ds(),u=Nn(),m=cs(h=>a||u.filter()===!1?!0:h.search?h.filtered.groups.has(i):!0);ds(()=>u.group(i),[]),nl(i,l,[e.value,e.heading,d]);let f=p.useMemo(()=>({id:i,forceMount:a}),[a]);return p.createElement(Yt.div,{ref:dn([l,s]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&p.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Zn(e,h=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},p.createElement(el.Provider,{value:f},h))))}),uf=p.forwardRef((e,s)=>{let{alwaysRender:n,...r}=e,a=p.useRef(null),o=cs(i=>!i.search);return!n&&!o?null:p.createElement(Yt.div,{ref:dn([a,s]),...r,"cmdk-separator":"",role:"separator"})}),mf=p.forwardRef((e,s)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=pa(),i=cs(u=>u.search),l=cs(u=>u.value),d=Nn(),c=p.useMemo(()=>{var u;let m=(u=d.listInnerRef.current)==null?void 0:u.querySelector(`${xa}[${ss}="${encodeURIComponent(l)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return p.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),p.createElement(Yt.input,{ref:s,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:a?e.value:i,onChange:u=>{a||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),ff=p.forwardRef((e,s)=>{let{children:n,label:r="Suggestions",...a}=e,o=p.useRef(null),i=p.useRef(null),l=Nn();return p.useEffect(()=>{if(i.current&&o.current){let d=i.current,c=o.current,u,m=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let f=d.offsetHeight;c.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return m.observe(d),()=>{cancelAnimationFrame(u),m.unobserve(d)}}},[]),p.createElement(Yt.div,{ref:dn([o,s]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Zn(e,d=>p.createElement("div",{ref:dn([i,l.listInnerRef]),"cmdk-list-sizer":""},d)))}),hf=p.forwardRef((e,s)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:i,...l}=e;return p.createElement(Bn,{open:n,onOpenChange:r},p.createElement(qn,{container:i},p.createElement(As,{"cmdk-overlay":"",className:a}),p.createElement(Rs,{"aria-label":e.label,"cmdk-dialog":"",className:o},p.createElement(tl,{ref:s,...l}))))}),xf=p.forwardRef((e,s)=>cs(n=>n.filtered.count===0)?p.createElement(Yt.div,{ref:s,...e,"cmdk-empty":"",role:"presentation"}):null),pf=p.forwardRef((e,s)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return p.createElement(Yt.div,{ref:s,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Zn(e,i=>p.createElement("div",{"aria-hidden":!0},i)))}),Ge=Object.assign(tl,{List:ff,Item:df,Input:mf,Group:cf,Separator:uf,Dialog:hf,Empty:xf,Loading:pf});function gf(e,s){let n=e.nextElementSibling;for(;n;){if(n.matches(s))return n;n=n.nextElementSibling}}function bf(e,s){let n=e.previousElementSibling;for(;n;){if(n.matches(s))return n;n=n.previousElementSibling}}function sl(e){let s=p.useRef(e);return ds(()=>{s.current=e}),s}var ds=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Ss(e){let s=p.useRef();return s.current===void 0&&(s.current=e()),s}function dn(e){return s=>{e.forEach(n=>{typeof n=="function"?n(s):n!=null&&(n.current=s)})}}function cs(e){let s=pa(),n=()=>e(s.snapshot());return Cd.useSyncExternalStore(s.subscribe,n,n)}function nl(e,s,n,r=[]){let a=p.useRef(),o=Nn();return ds(()=>{var i;let l=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():a.current}})(),d=r.map(c=>c.trim());o.value(e,l,d),(i=s.current)==null||i.setAttribute(ss,l),a.current=l}),a}var yf=()=>{let[e,s]=p.useState(),n=Ss(()=>new Map);return ds(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),s({})}};function vf(e){let s=e.type;return typeof s=="function"?s(e.props):"render"in s?s.render(e.props):e}function Zn({asChild:e,children:s},n){return e&&p.isValidElement(s)?p.cloneElement(vf(s),{ref:s.ref},n(s.props.children)):n(s)}var jf={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ga=Bn,wf=qn,rl=p.forwardRef(({className:e,...s},n)=>t.jsx(As,{ref:n,className:T("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),...s}));rl.displayName=As.displayName;const er=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(wf,{children:[t.jsx(rl,{}),t.jsxs(Rs,{ref:r,className:T("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),...n,children:[s,t.jsxs(Ur,{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:[t.jsx(We,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));er.displayName=Rs.displayName;const ba=({className:e,...s})=>t.jsx("div",{className:T("flex flex-col space-y-1.5",e),...s});ba.displayName="DialogHeader";const ya=p.forwardRef(({className:e,...s},n)=>t.jsx(fn,{ref:n,className:T("text-base font-semibold leading-none tracking-tight",e),...s}));ya.displayName=fn.displayName;const Nf=p.forwardRef(({className:e,...s},n)=>t.jsx(hn,{ref:n,className:T("text-sm text-muted-foreground",e),...s}));Nf.displayName=hn.displayName;const _s=p.forwardRef(({className:e,...s},n)=>t.jsx(Ge,{ref:n,className:T("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...s}));_s.displayName=Ge.displayName;const kf=({children:e,open:s,onOpenChange:n})=>t.jsx(ga,{open:s,onOpenChange:n,children:t.jsx(er,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:t.jsx(_s,{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})})}),va=p.forwardRef(({className:e,...s},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(Xn,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(Ge.Input,{ref:n,className:T("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),...s})]}));va.displayName=Ge.Input.displayName;const Os=p.forwardRef(({className:e,...s},n)=>t.jsx(Ge.List,{ref:n,className:T("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...s}));Os.displayName=Ge.List.displayName;const ja=p.forwardRef((e,s)=>t.jsx(Ge.Empty,{ref:s,className:"py-6 text-center text-sm text-muted-foreground",...e}));ja.displayName=Ge.Empty.displayName;const is=p.forwardRef(({className:e,...s},n)=>t.jsx(Ge.Group,{ref:n,className:T("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),...s}));is.displayName=Ge.Group.displayName;const al=p.forwardRef(({className:e,...s},n)=>t.jsx(Ge.Separator,{ref:n,className:T("-mx-1 h-px bg-border",e),...s}));al.displayName=Ge.Separator.displayName;const it=p.forwardRef(({className:e,...s},n)=>t.jsx(Ge.Item,{ref:n,className:T("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),...s}));it.displayName=Ge.Item.displayName;function Sf(){const{open:e,setOpen:s}=fi(),n=Ve(),{data:r}=Jn(),{workspace:a}=Se(),o=(a==null?void 0:a.slug)??"",i=l=>{s(!1),l()};return t.jsxs(kf,{open:e,onOpenChange:s,children:[t.jsx(va,{placeholder:"Search or jump to..."}),t.jsxs(Os,{children:[t.jsx(ja,{children:"No results found."}),t.jsxs(is,{heading:"Navigation",children:[t.jsxs(it,{onSelect:()=>i(()=>n(`/${o}/projects`)),children:[t.jsx(zn,{className:"text-muted-foreground"}),t.jsx("span",{children:"Projects"})]}),t.jsxs(it,{onSelect:()=>i(()=>n(`/${o}/notifications`)),children:[t.jsx(pn,{className:"text-muted-foreground"}),t.jsx("span",{children:"Notifications"})]}),t.jsxs(it,{onSelect:()=>i(()=>n(`/${o}/settings`)),children:[t.jsx(da,{className:"text-muted-foreground"}),t.jsx("span",{children:"Settings"})]})]}),r&&r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(al,{}),t.jsxs(is,{heading:"Projects",children:[r.map(l=>t.jsxs(it,{value:`${l.name} board`,onSelect:()=>i(()=>n(`/${o}/projects/${l.identifier}/board`)),children:[t.jsx(vt,{className:"text-muted-foreground"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),t.jsx("span",{className:"truncate",children:l.name}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Board"})]})]},`${l.id}-board`)),r.map(l=>t.jsxs(it,{value:`${l.name} issues`,onSelect:()=>i(()=>n(`/${o}/projects/${l.identifier}/issues`)),children:[t.jsx(Vn,{className:"text-muted-foreground"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),t.jsx("span",{className:"truncate",children:l.name}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Issues"})]})]},`${l.id}-issues`))]})]})]})]})}function Cf(){const[e,s]=p.useState(""),[n,r]=p.useState(""),[a,o]=p.useState(!1),i=Ve(),l=ku(),d=c=>{c.preventDefault(),l.mutate({email:e,password:n},{onSuccess:()=>i("/"),onError:u=>F.error(u.message??"Invalid email or password")})};return t.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"w-full max-w-[360px]",children:[t.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[t.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:t.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:t.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:t.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Welcome to Meridian"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Sign in to access the admin area"})]})]}),t.jsxs("form",{onSubmit:d,className:"space-y-2",children:[t.jsx(xe,{type:"email",placeholder:"Email",value:e,onChange:c=>s(c.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),t.jsxs("div",{className:"relative",children:[t.jsx(xe,{type:a?"text":"password",placeholder:"Password",value:n,onChange:c=>r(c.target.value),autoComplete:"current-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),t.jsx("button",{type:"button",onClick:()=>o(!a),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:a?t.jsx(ia,{className:"h-4 w-4"}):t.jsx(gn,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(V,{type:"submit",className:"w-full h-10 font-medium",disabled:l.isPending,children:l.isPending?"Signing in...":"Continue with Email"})})]}),t.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",t.jsx(ln,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]})]})})}function Mf(){const[e,s]=p.useState(""),[n,r]=p.useState(""),[a,o]=p.useState(""),[i,l]=p.useState(""),[d,c]=p.useState(!1),u=Ve(),m=Su(),{data:f}=ki(),h=(f==null?void 0:f.needsSetup)===!0,g=v=>{v.preventDefault(),m.mutate({email:a,password:i,first_name:e,last_name:n},{onSuccess:()=>u("/"),onError:k=>F.error(k.message??"Registration failed")})};return t.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"w-full max-w-[360px]",children:[t.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[t.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:t.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:t.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:t.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-lg font-semibold text-foreground",children:h?"Set up your account":"Create your account"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:h?"You're the first user — you'll be the super admin.":"Get started with Meridian"})]})]}),t.jsxs("form",{onSubmit:g,className:"space-y-2",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(xe,{placeholder:"First name",value:e,onChange:v=>s(v.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),t.jsx(xe,{placeholder:"Last name",value:n,onChange:v=>r(v.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),t.jsx(xe,{type:"email",placeholder:"Email",value:a,onChange:v=>o(v.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),t.jsxs("div",{className:"relative",children:[t.jsx(xe,{type:d?"text":"password",placeholder:"Password",value:i,onChange:v=>l(v.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),t.jsx("button",{type:"button",onClick:()=>c(!d),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:d?t.jsx(ia,{className:"h-4 w-4"}):t.jsx(gn,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(V,{type:"submit",className:"w-full h-10 font-medium",disabled:m.isPending,children:m.isPending?"Creating account...":"Create Account"})})]}),t.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Already have an account?"," ",t.jsx(ln,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function Df(){const[e,s]=p.useState(""),n=Ve(),{setWorkspace:r}=Se(),a=mu(),o=i=>{i.preventDefault(),e.trim()&&a.mutate({name:e.trim()},{onSuccess:l=>{const d={id:l.workspace.id,name:l.workspace.name,slug:l.workspace.slug};r(d),n(`/${d.slug}/projects`,{replace:!0})},onError:l=>F.error(l.message??"Failed to create workspace")})};return t.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"w-full max-w-[380px]",children:[t.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[t.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:t.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:t.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:t.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Create your workspace"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"A workspace is where your team's projects and issues live."})]})]}),t.jsxs("form",{onSubmit:o,className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(xe,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:i=>s(i.target.value),autoFocus:!0,required:!0,className:"bg-white dark:bg-card h-10"}),t.jsx("p",{className:"text-xs text-muted-foreground px-0.5",children:"You can rename it later from settings."})]}),t.jsx(V,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||a.isPending,children:a.isPending?"Creating workspace...":"Create workspace"})]})]})})}function Ef(e){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const ol=y.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}),kn=()=>{const e=y.useContext(ol);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Ef(`[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(
|
|
438
|
+
[data-state=closed]
|
|
439
|
+
){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 _f(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Of(){return wa(/^Mac/)}function Tf(){return wa(/^iPhone/)}function Xa(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Pf(){return wa(/^iPad/)||Of()&&navigator.maxTouchPoints>1}function il(){return Tf()||Pf()}function wa(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const $f=24,Af=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Ja(...e){return(...s)=>{for(let n of e)typeof n=="function"&&n(...s)}}const yr=typeof document<"u"&&window.visualViewport;function Za(e){let s=window.getComputedStyle(e);return/(auto|scroll)/.test(s.overflow+s.overflowX+s.overflowY)}function ll(e){for(Za(e)&&(e=e.parentElement);e&&!Za(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Rf=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let An=0,vr;function If(e={}){let{isDisabled:s}=e;Af(()=>{if(!s)return An++,An===1&&il()&&(vr=Ff()),()=>{An--,An===0&&(vr==null||vr())}},[s])}function Ff(){let e,s=0,n=m=>{e=ll(m.target),!(e===document.documentElement&&e===document.body)&&(s=m.changedTouches[0].pageY)},r=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let f=m.changedTouches[0].pageY,h=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((h<=0&&f>s||h>=g&&f<s)&&m.preventDefault(),s=f)},a=m=>{let f=m.target;zr(f)&&f!==document.activeElement&&(m.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},o=m=>{let f=m.target;zr(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",yr&&(yr.height<window.innerHeight?requestAnimationFrame(()=>{eo(f)}):yr.addEventListener("resize",()=>eo(f),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},l=window.pageXOffset,d=window.pageYOffset,c=Ja(Wf(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Ja(en(document,"touchstart",n,{passive:!1,capture:!0}),en(document,"touchmove",r,{passive:!1,capture:!0}),en(document,"touchend",a,{passive:!1,capture:!0}),en(document,"focus",o,!0),en(window,"scroll",i));return()=>{c(),u(),window.scrollTo(l,d)}}function Wf(e,s,n){let r=e.style[s];return e.style[s]=n,()=>{e.style[s]=r}}function en(e,s,n,r){return e.addEventListener(s,n,r),()=>{e.removeEventListener(s,n,r)}}function eo(e){let s=document.scrollingElement||document.documentElement;for(;e&&e!==s;){let n=ll(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,a=e.getBoundingClientRect().top,o=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+$f;o>i&&(n.scrollTop+=a-r)}e=n.parentElement}}function zr(e){return e instanceof HTMLInputElement&&!Rf.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function zf(e,s){typeof e=="function"?e(s):e!=null&&(e.current=s)}function qf(...e){return s=>e.forEach(n=>zf(n,s))}function dl(...e){return p.useCallback(qf(...e),e)}const cl=new WeakMap;function Re(e,s,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(s).forEach(([a,o])=>{if(a.startsWith("--")){e.style.setProperty(a,o);return}r[a]=e.style[a],e.style[a]=o}),!n&&cl.set(e,r)}function Bf(e,s){if(!e||!(e instanceof HTMLElement))return;let n=cl.get(e);n&&(e.style[s]=n[s])}const $e=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Rn(e,s){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[$e(s)?13:12]):(a=r.match(/^matrix\((.+)\)$/),a?parseFloat(a[1].split(", ")[$e(s)?5:4]):null)}function Yf(e){return 8*(Math.log(e+1)-2)}function jr(e,s){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,s),()=>{e.style.cssText=n}}function Lf(...e){return(...s)=>{for(const n of e)typeof n=="function"&&n(...s)}}const De={DURATION:.5,EASE:[.32,.72,0,1]},ul=.4,Hf=.25,Uf=100,ml=8,Xt=16,qr=26,wr="vaul-dragging";function fl(e){const s=y.useRef(e);return y.useEffect(()=>{s.current=e}),y.useMemo(()=>(...n)=>s.current==null?void 0:s.current.call(s,...n),[])}function Kf({defaultProp:e,onChange:s}){const n=y.useState(e),[r]=n,a=y.useRef(r),o=fl(s);return y.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}function hl({prop:e,defaultProp:s,onChange:n=()=>{}}){const[r,a]=Kf({defaultProp:s,onChange:n}),o=e!==void 0,i=o?e:r,l=fl(n),d=y.useCallback(c=>{if(o){const m=typeof c=="function"?c(e):c;m!==e&&l(m)}else a(c)},[o,e,a,l]);return[i,d]}function Vf({activeSnapPointProp:e,setActiveSnapPointProp:s,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:o,onSnapPointChange:i,direction:l="bottom",container:d,snapToSequentialPoint:c}){const[u,m]=hl({prop:e,defaultProp:n==null?void 0:n[0],onChange:s}),[f,h]=y.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);y.useEffect(()=>{function w(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]);const g=y.useMemo(()=>u===(n==null?void 0:n[n.length-1])||null,[n,u]),v=y.useMemo(()=>{var w;return(w=n==null?void 0:n.findIndex(D=>D===u))!=null?w:null},[n,u]),k=n&&n.length>0&&(o||o===0)&&!Number.isNaN(o)&&n[o]===u||!n,b=y.useMemo(()=>{const w=d?{width:d.getBoundingClientRect().width,height:d.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var D;return(D=n==null?void 0:n.map(_=>{const A=typeof _=="string";let z=0;if(A&&(z=parseInt(_,10)),$e(l)){const W=A?z:f?_*w.height:0;return f?l==="bottom"?w.height-W:-w.height+W:W}const R=A?z:f?_*w.width:0;return f?l==="right"?w.width-R:-w.width+R:R}))!=null?D:[]},[n,f,d]),j=y.useMemo(()=>v!==null?b==null?void 0:b[v]:null,[b,v]),N=y.useCallback(w=>{var D;const _=(D=b==null?void 0:b.findIndex(A=>A===w))!=null?D:null;i(_),Re(r.current,{transition:`transform ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,transform:$e(l)?`translate3d(0, ${w}px, 0)`:`translate3d(${w}px, 0, 0)`}),b&&_!==b.length-1&&o!==void 0&&_!==o&&_<o?Re(a.current,{transition:`opacity ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,opacity:"0"}):Re(a.current,{transition:`opacity ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,opacity:"1"}),m(n==null?void 0:n[Math.max(_,0)])},[r.current,n,b,o,a,m]);y.useEffect(()=>{if(u||e){var w;const D=(w=n==null?void 0:n.findIndex(_=>_===e||_===u))!=null?w:-1;b&&D!==-1&&typeof b[D]=="number"&&N(b[D])}},[u,e,n,b,N]);function C({draggedDistance:w,closeDrawer:D,velocity:_,dismissible:A}){if(o===void 0)return;const z=l==="bottom"||l==="right"?(j??0)-w:(j??0)+w,R=v===o-1,W=v===0,$=w>0;if(R&&Re(a.current,{transition:`opacity ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`}),!c&&_>2&&!$){A?D():N(b[0]);return}if(!c&&_>2&&$&&b&&n){N(b[n.length-1]);return}const G=b==null?void 0:b.reduce((L,Z)=>typeof L!="number"||typeof Z!="number"?L:Math.abs(Z-z)<Math.abs(L-z)?Z:L),O=$e(l)?window.innerHeight:window.innerWidth;if(_>ul&&Math.abs(w)<O*.4){const L=$?1:-1;if(L>0&&g&&n){N(b[n.length-1]);return}if(W&&L<0&&A&&D(),v===null)return;N(b[v+L]);return}N(G)}function S({draggedDistance:w}){if(j===null)return;const D=l==="bottom"||l==="right"?j-w:j+w;(l==="bottom"||l==="right")&&D<b[b.length-1]||(l==="top"||l==="left")&&D>b[b.length-1]||Re(r.current,{transform:$e(l)?`translate3d(0, ${D}px, 0)`:`translate3d(${D}px, 0, 0)`})}function x(w,D){if(!n||typeof v!="number"||!b||o===void 0)return null;const _=v===o-1;if(v>=o&&D)return 0;if(_&&!D)return 1;if(!k&&!_)return null;const z=_?v+1:v-1,R=_?b[z]-b[z-1]:b[z+1]-b[z],W=w/Math.abs(R);return _?1-W:W}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:k,getPercentageDragged:x,setActiveSnapPoint:m,activeSnapPointIndex:v,onRelease:C,onDrag:S,snapPointsOffset:b}}const Gf=()=>()=>{};function Qf(){const{direction:e,isOpen:s,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=kn(),o=y.useRef(null),i=p.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-qr)/window.innerWidth}y.useEffect(()=>{if(s&&n){o.current&&clearTimeout(o.current);const d=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!d)return;Lf(r&&!a?jr(document.body,{background:"black"}):Gf,jr(d,{transformOrigin:$e(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${De.DURATION}s`,transitionTimingFunction:`cubic-bezier(${De.EASE.join(",")})`}));const c=jr(d,{borderRadius:`${ml}px`,overflow:"hidden",...$e(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()=>{c(),o.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},De.DURATION*1e3)}}},[s,n,i])}let tn=null;function Xf({isOpen:e,modal:s,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:o}){const[i,l]=y.useState(()=>typeof window<"u"?window.location.href:""),d=y.useRef(0),c=y.useCallback(()=>{if(Xa()&&tn===null&&e&&!o){tn={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&d.current>=f&&(document.body.style.top=`${-(d.current+h)}px`)}),300)}},[e]),u=y.useCallback(()=>{if(Xa()&&tn!==null&&!o){const m=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,tn),window.requestAnimationFrame(()=>{if(a&&i!==window.location.href){l(window.location.href);return}window.scrollTo(f,m)}),tn=null}},[i]);return y.useEffect(()=>{function m(){d.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),y.useEffect(()=>{if(s)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[s,u]),y.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),s||window.setTimeout(()=>{u()},500)):u())},[e,r,i,s,n,c,u]),{restorePositionSetting:u}}function Jf({open:e,onOpenChange:s,children:n,onDrag:r,onRelease:a,snapPoints:o,shouldScaleBackground:i=!1,setBackgroundColorOnScale:l=!0,closeThreshold:d=Hf,scrollLockTimeout:c=Uf,dismissible:u=!0,handleOnly:m=!1,fadeFromIndex:f=o&&o.length-1,activeSnapPoint:h,setActiveSnapPoint:g,fixed:v,modal:k=!0,onClose:b,nested:j,noBodyStyles:N=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:x=!0,snapToSequentialPoint:w=!1,preventScrollRestoration:D=!1,repositionInputs:_=!0,onAnimationEnd:A,container:z,autoFocus:R=!1}){var W,$;const[G=!1,O]=hl({defaultProp:S,prop:e,onChange:re=>{s==null||s(re),!re&&!j&&mt(),setTimeout(()=>{A==null||A(re)},De.DURATION*1e3),re&&!k&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),re||(document.body.style.pointerEvents="auto")}}),[L,Z]=y.useState(!1),[I,M]=y.useState(!1),[X,E]=y.useState(!1),q=y.useRef(null),K=y.useRef(null),U=y.useRef(null),ae=y.useRef(null),P=y.useRef(null),oe=y.useRef(!1),be=y.useRef(null),_e=y.useRef(0),qe=y.useRef(!1),Dt=y.useRef(!S),Ht=y.useRef(0),ie=y.useRef(null),Ut=y.useRef(((W=ie.current)==null?void 0:W.getBoundingClientRect().height)||0),Kt=y.useRef((($=ie.current)==null?void 0:$.getBoundingClientRect().width)||0),Vt=y.useRef(0),Gt=y.useCallback(re=>{o&&re===Be.length-1&&(K.current=new Date)},[]),{activeSnapPoint:Us,activeSnapPointIndex:rt,setActiveSnapPoint:ut,onRelease:vs,snapPointsOffset:Be,onDrag:Qt,shouldFade:Et,getPercentageDragged:Ye}=Vf({snapPoints:o,activeSnapPointProp:h,setActiveSnapPointProp:g,drawerRef:ie,fadeFromIndex:f,overlayRef:q,onSnapPointChange:Gt,direction:C,container:z,snapToSequentialPoint:w});If({isDisabled:!G||I||!k||X||!L||!_||!x});const{restorePositionSetting:mt}=Xf({isOpen:G,modal:k,nested:j??!1,hasBeenOpened:L,preventScrollRestoration:D,noBodyStyles:N});function _t(){return(window.innerWidth-qr)/window.innerWidth}function Ks(re){var Q,te;!u&&!o||ie.current&&!ie.current.contains(re.target)||(Ut.current=((Q=ie.current)==null?void 0:Q.getBoundingClientRect().height)||0,Kt.current=((te=ie.current)==null?void 0:te.getBoundingClientRect().width)||0,M(!0),U.current=new Date,il()&&window.addEventListener("touchend",()=>oe.current=!1,{once:!0}),re.target.setPointerCapture(re.pointerId),_e.current=$e(C)?re.pageY:re.pageX)}function Nt(re,Q){var te;let Y=re;const ee=(te=window.getSelection())==null?void 0:te.toString(),pe=ie.current?Rn(ie.current,C):null,B=new Date;if(Y.tagName==="SELECT"||Y.hasAttribute("data-vaul-no-drag")||Y.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&B.getTime()-K.current.getTime()<500)return!1;if(pe!==null&&(C==="bottom"?pe>0:pe<0))return!0;if(ee&&ee.length>0)return!1;if(P.current&&B.getTime()-P.current.getTime()<c&&pe===0||Q)return P.current=B,!1;for(;Y;){if(Y.scrollHeight>Y.clientHeight){if(Y.scrollTop!==0)return P.current=new Date,!1;if(Y.getAttribute("role")==="dialog")return!0}Y=Y.parentNode}return!0}function Vs(re){if(ie.current&&I){const Q=C==="bottom"||C==="right"?1:-1,te=(_e.current-($e(C)?re.pageY:re.pageX))*Q,Y=te>0,ee=o&&!u&&!Y;if(ee&&rt===0)return;const pe=Math.abs(te),B=document.querySelector("[data-vaul-drawer-wrapper]"),ue=C==="bottom"||C==="top"?Ut.current:Kt.current;let me=pe/ue;const Pe=Ye(pe,Y);if(Pe!==null&&(me=Pe),ee&&me>=1||!oe.current&&!Nt(re.target,Y))return;if(ie.current.classList.add(wr),oe.current=!0,Re(ie.current,{transition:"none"}),Re(q.current,{transition:"none"}),o&&Qt({draggedDistance:te}),Y&&!o){const Me=Yf(te),Ze=Math.min(Me*-1,0)*Q;Re(ie.current,{transform:$e(C)?`translate3d(0, ${Ze}px, 0)`:`translate3d(${Ze}px, 0, 0)`});return}const Ce=1-me;if((Et||f&&rt===f-1)&&(r==null||r(re,me),Re(q.current,{opacity:`${Ce}`,transition:"none"},!0)),B&&q.current&&i){const Me=Math.min(_t()+me*(1-_t()),1),Ze=8-me*8,He=Math.max(0,14-me*14);Re(B,{borderRadius:`${Ze}px`,transform:$e(C)?`scale(${Me}) translate3d(0, ${He}px, 0)`:`scale(${Me}) translate3d(${He}px, 0, 0)`,transition:"none"},!0)}if(!o){const Me=pe*Q;Re(ie.current,{transform:$e(C)?`translate3d(0, ${Me}px, 0)`:`translate3d(${Me}px, 0, 0)`})}}}y.useEffect(()=>{window.requestAnimationFrame(()=>{Dt.current=!0})},[]),y.useEffect(()=>{var re;function Q(){if(!ie.current||!_)return;const te=document.activeElement;if(zr(te)||qe.current){var Y;const ee=((Y=window.visualViewport)==null?void 0:Y.height)||0,pe=window.innerHeight;let B=pe-ee;const ue=ie.current.getBoundingClientRect().height||0,me=ue>pe*.8;Vt.current||(Vt.current=ue);const Pe=ie.current.getBoundingClientRect().top;if(Math.abs(Ht.current-B)>60&&(qe.current=!qe.current),o&&o.length>0&&Be&&rt){const Ce=Be[rt]||0;B+=Ce}if(Ht.current=B,ue>ee||qe.current){const Ce=ie.current.getBoundingClientRect().height;let Me=Ce;Ce>ee&&(Me=ee-(me?Pe:qr)),v?ie.current.style.height=`${Ce-Math.max(B,0)}px`:ie.current.style.height=`${Math.max(Me,ee-Pe)}px`}else _f()||(ie.current.style.height=`${Vt.current}px`);o&&o.length>0&&!qe.current?ie.current.style.bottom="0px":ie.current.style.bottom=`${Math.max(B,0)}px`}}return(re=window.visualViewport)==null||re.addEventListener("resize",Q),()=>{var te;return(te=window.visualViewport)==null?void 0:te.removeEventListener("resize",Q)}},[rt,o,Be]);function ft(re){ht(),b==null||b(),re||O(!1),setTimeout(()=>{o&&ut(o[0])},De.DURATION*1e3)}function Ot(){if(!ie.current)return;const re=document.querySelector("[data-vaul-drawer-wrapper]"),Q=Rn(ie.current,C);Re(ie.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`}),Re(q.current,{transition:`opacity ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,opacity:"1"}),i&&Q&&Q>0&&G&&Re(re,{borderRadius:`${ml}px`,overflow:"hidden",...$e(C)?{transform:`scale(${_t()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${_t()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${De.DURATION}s`,transitionTimingFunction:`cubic-bezier(${De.EASE.join(",")})`},!0)}function ht(){!I||!ie.current||(ie.current.classList.remove(wr),oe.current=!1,M(!1),ae.current=new Date)}function js(re){if(!I||!ie.current)return;ie.current.classList.remove(wr),oe.current=!1,M(!1),ae.current=new Date;const Q=Rn(ie.current,C);if(!re||!Nt(re.target,!1)||!Q||Number.isNaN(Q)||U.current===null)return;const te=ae.current.getTime()-U.current.getTime(),Y=_e.current-($e(C)?re.pageY:re.pageX),ee=Math.abs(Y)/te;if(ee>.05&&(E(!0),setTimeout(()=>{E(!1)},200)),o){vs({draggedDistance:Y*(C==="bottom"||C==="right"?1:-1),closeDrawer:ft,velocity:ee,dismissible:u}),a==null||a(re,!0);return}if(C==="bottom"||C==="right"?Y>0:Y<0){Ot(),a==null||a(re,!0);return}if(ee>ul){ft(),a==null||a(re,!1);return}var pe;const B=Math.min((pe=ie.current.getBoundingClientRect().height)!=null?pe:0,window.innerHeight);var ue;const me=Math.min((ue=ie.current.getBoundingClientRect().width)!=null?ue:0,window.innerWidth),Pe=C==="left"||C==="right";if(Math.abs(Q)>=(Pe?me:B)*d){ft(),a==null||a(re,!1);return}a==null||a(re,!0),Ot()}y.useEffect(()=>(G&&(Re(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{Bf(document.documentElement,"scrollBehavior")}),[G]);function xt(re){const Q=re?(window.innerWidth-Xt)/window.innerWidth:1,te=re?-Xt:0;be.current&&window.clearTimeout(be.current),Re(ie.current,{transition:`transform ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,transform:$e(C)?`scale(${Q}) translate3d(0, ${te}px, 0)`:`scale(${Q}) translate3d(${te}px, 0, 0)`}),!re&&ie.current&&(be.current=setTimeout(()=>{const Y=Rn(ie.current,C);Re(ie.current,{transition:"none",transform:$e(C)?`translate3d(0, ${Y}px, 0)`:`translate3d(${Y}px, 0, 0)`})},500))}function ws(re,Q){if(Q<0)return;const te=(window.innerWidth-Xt)/window.innerWidth,Y=te+Q*(1-te),ee=-Xt+Q*Xt;Re(ie.current,{transform:$e(C)?`scale(${Y}) translate3d(0, ${ee}px, 0)`:`scale(${Y}) translate3d(${ee}px, 0, 0)`,transition:"none"})}function Gs(re,Q){const te=$e(C)?window.innerHeight:window.innerWidth,Y=Q?(te-Xt)/te:1,ee=Q?-Xt:0;Q&&Re(ie.current,{transition:`transform ${De.DURATION}s cubic-bezier(${De.EASE.join(",")})`,transform:$e(C)?`scale(${Y}) translate3d(0, ${ee}px, 0)`:`scale(${Y}) translate3d(${ee}px, 0, 0)`})}return y.useEffect(()=>{k||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[k]),y.createElement(Bn,{defaultOpen:S,onOpenChange:re=>{!u&&!re||(re?Z(!0):ft(!0),O(re))},open:G},y.createElement(ol.Provider,{value:{activeSnapPoint:Us,snapPoints:o,setActiveSnapPoint:ut,drawerRef:ie,overlayRef:q,onOpenChange:s,onPress:Ks,onRelease:js,onDrag:Vs,dismissible:u,shouldAnimate:Dt,handleOnly:m,isOpen:G,isDragging:I,shouldFade:Et,closeDrawer:ft,onNestedDrag:ws,onNestedOpenChange:xt,onNestedRelease:Gs,keyboardIsOpen:qe,modal:k,snapPointsOffset:Be,activeSnapPointIndex:rt,direction:C,shouldScaleBackground:i,setBackgroundColorOnScale:l,noBodyStyles:N,container:z,autoFocus:R}},n))}const xl=y.forwardRef(function({...e},s){const{overlayRef:n,snapPoints:r,onRelease:a,shouldFade:o,isOpen:i,modal:l,shouldAnimate:d}=kn(),c=dl(s,n),u=r&&r.length>0;if(!l)return null;const m=y.useCallback(f=>a(f),[a]);return y.createElement(As,{onMouseUp:m,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&o?"true":"false","data-vaul-animate":d!=null&&d.current?"true":"false",...e})});xl.displayName="Drawer.Overlay";const pl=y.forwardRef(function({onPointerDownOutside:e,style:s,onOpenAutoFocus:n,...r},a){const{drawerRef:o,onPress:i,onRelease:l,onDrag:d,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:m,modal:f,isOpen:h,direction:g,snapPoints:v,container:k,handleOnly:b,shouldAnimate:j,autoFocus:N}=kn(),[C,S]=y.useState(!1),x=dl(a,o),w=y.useRef(null),D=y.useRef(null),_=y.useRef(!1),A=v&&v.length>0;Qf();const z=(W,$,G=0)=>{if(_.current)return!0;const O=Math.abs(W.y),L=Math.abs(W.x),Z=L>O,I=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(W.x*I<0)&&L>=0&&L<=G)return Z}else if(!(W.y*I<0)&&O>=0&&O<=G)return!Z;return _.current=!0,!0};y.useEffect(()=>{A&&window.requestAnimationFrame(()=>{S(!0)})},[]);function R(W){w.current=null,_.current=!1,l(W)}return y.createElement(Rs,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&A?"true":"false","data-vaul-custom-container":k?"true":"false","data-vaul-animate":j!=null&&j.current?"true":"false",...r,ref:x,style:u&&u.length>0?{"--snap-point-height":`${u[m??0]}px`,...s}:s,onPointerDown:W=>{b||(r.onPointerDown==null||r.onPointerDown.call(r,W),w.current={x:W.pageX,y:W.pageY},i(W))},onOpenAutoFocus:W=>{n==null||n(W),N||W.preventDefault()},onPointerDownOutside:W=>{if(e==null||e(W),!f||W.defaultPrevented){W.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:W=>{if(!f){W.preventDefault();return}},onPointerMove:W=>{if(D.current=W,b||(r.onPointerMove==null||r.onPointerMove.call(r,W),!w.current))return;const $=W.pageY-w.current.y,G=W.pageX-w.current.x,O=W.pointerType==="touch"?10:2;z({x:G,y:$},g,O)?d(W):(Math.abs(G)>O||Math.abs($)>O)&&(w.current=null)},onPointerUp:W=>{r.onPointerUp==null||r.onPointerUp.call(r,W),w.current=null,_.current=!1,l(W)},onPointerOut:W=>{r.onPointerOut==null||r.onPointerOut.call(r,W),R(D.current)},onContextMenu:W=>{r.onContextMenu==null||r.onContextMenu.call(r,W),D.current&&R(D.current)}})});pl.displayName="Drawer.Content";const Zf=250,eh=120,th=y.forwardRef(function({preventCycle:e=!1,children:s,...n},r){const{closeDrawer:a,isDragging:o,snapPoints:i,activeSnapPoint:l,setActiveSnapPoint:d,dismissible:c,handleOnly:u,isOpen:m,onPress:f,onDrag:h}=kn(),g=y.useRef(null),v=y.useRef(!1);function k(){if(v.current){N();return}window.setTimeout(()=>{b()},eh)}function b(){if(o||e||v.current){N();return}if(N(),!i||i.length===0){c||a();return}if(l===i[i.length-1]&&c){a();return}const S=i.findIndex(w=>w===l);if(S===-1)return;const x=i[S+1];d(x)}function j(){g.current=window.setTimeout(()=>{v.current=!0},Zf)}function N(){g.current&&window.clearTimeout(g.current),v.current=!1}return y.createElement("div",{onClick:k,onPointerCancel:N,onPointerDown:C=>{u&&f(C),j()},onPointerMove:C=>{u&&h(C)},ref:r,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},y.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},s))});th.displayName="Drawer.Handle";function sh(e){const s=kn(),{container:n=s.container,...r}=e;return y.createElement(qn,{container:n,...r})}const jt={Root:Jf,Content:pl,Overlay:xl,Portal:sh,Close:Ur,Title:fn,Description:hn},ps=({shouldScaleBackground:e=!1,direction:s="right",...n})=>t.jsx(jt.Root,{shouldScaleBackground:e,direction:s,...n});ps.displayName="Drawer";const nh=jt.Portal,gl=p.forwardRef(({className:e,...s},n)=>t.jsx(jt.Overlay,{ref:n,className:T("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),...s}));gl.displayName=jt.Overlay.displayName;const gs=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(nh,{children:[t.jsx(gl,{}),t.jsxs(jt.Content,{ref:r,className:T("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),...n,children:[s,t.jsxs(jt.Close,{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:[t.jsx(We,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gs.displayName="DrawerContent";const bs=({className:e,...s})=>t.jsx("div",{className:T("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...s});bs.displayName="DrawerHeader";const Bs=({className:e,...s})=>t.jsx("div",{className:T("flex-1 overflow-y-auto px-6 py-4",e),...s});Bs.displayName="DrawerBody";const Sn=({className:e,...s})=>t.jsx("div",{className:T("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),...s});Sn.displayName="DrawerFooter";const ys=p.forwardRef(({className:e,...s},n)=>t.jsx(jt.Title,{ref:n,className:T("text-base font-semibold text-foreground",e),...s}));ys.displayName=jt.Title.displayName;const rh=p.forwardRef(({className:e,...s},n)=>t.jsx(jt.Description,{ref:n,className:T("text-sm text-muted-foreground",e),...s}));rh.displayName=jt.Description.displayName;const ah=xn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ze=p.forwardRef(({className:e,...s},n)=>t.jsx(Bo,{ref:n,className:T(ah(),e),...s}));ze.displayName=Bo.displayName;const tr=p.forwardRef(({className:e,...s},n)=>t.jsx("textarea",{className:T("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:n,...s}));tr.displayName="Textarea";const to=[{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}],Nr=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function oh(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function ih({chip:e,onRemove:s}){const{attributes:n,listeners:r,setNodeRef:a,transform:o,transition:i,isDragging:l}=Vr({id:e.key});return t.jsxs("div",{ref:a,style:{transform:Gr.Transform.toString(o),transition:i},className:T("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:[t.jsx("span",{...n,...r,className:"text-muted-foreground/50 hover:text-muted-foreground cursor-grab touch-none",children:t.jsx(Ai,{className:"h-3 w-3"})}),t.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),t.jsx("span",{className:"text-[11px]",children:e.name}),t.jsx("button",{type:"button",onClick:s,className:"ml-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:t.jsx(We,{className:"h-3 w-3"})})]})}const lh=3;function dh({open:e,onClose:s}){var G;const[n,r]=p.useState(""),[a,o]=p.useState(""),[i,l]=p.useState(""),[d,c]=p.useState(!1),[u,m]=p.useState(!1),[f,h]=p.useState(to),[g,v]=p.useState(""),[k,b]=p.useState(Nr[2]),{workspace:j}=Se(),N=Tm(),C=_m(n,{enabled:e}),S=Om(a,{enabled:e});p.useEffect(()=>{e&&C.data&&!d&&o(C.data)},[e,C.data,d]);const x=S.available===!1||N.isError&&((G=N.error)==null?void 0:G.status)===409,w=a.trim().length>=lh&&/^[A-Z0-9]+$/i.test(a.trim()),D=Zo(ei(ni,{activationConstraint:{distance:5}})),_=O=>{r(O)},A=()=>{n.trim()&&!d&&C.flush()},z=()=>{r(""),o(""),l(""),c(!1),m(!1),h(to),v(""),b(Nr[2]),N.reset(),s()},R=()=>{if(!g.trim())return;const O=oh(g.trim());if(f.some(L=>L.key===O)){F.error("A status with this name already exists");return}h(L=>[...L,{name:g.trim(),key:O,color:k,category:"started",position:L.length}]),v("")},W=O=>{const{active:L,over:Z}=O;!Z||L.id===Z.id||h(I=>{const M=I.findIndex(E=>E.key===L.id),X=I.findIndex(E=>E.key===Z.id);return Fn(I,M,X).map((E,q)=>({...E,position:q}))})},$=O=>{O.preventDefault(),!(!n.trim()||!a.trim()||!w||x)&&N.mutate({name:n.trim(),identifier:a.trim().toUpperCase(),description:i.trim()||void 0,workspace_id:j.id,initial_statuses:f},{onSuccess:()=>{F.success("Project created"),z()},onError:L=>{(L==null?void 0:L.status)===409?F.error("This project key is already in use."):F.error(L.message??"Failed to create project")}})};return t.jsx(ps,{open:e,onOpenChange:O=>!O&&z(),children:t.jsxs(gs,{className:"max-w-md",children:[t.jsx(bs,{children:t.jsx(ys,{children:"New project"})}),t.jsxs("form",{onSubmit:$,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Bs,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{htmlFor:"project-name",children:"Name"}),t.jsx(xe,{id:"project-name",placeholder:"My Project",value:n,onChange:O=>_(O.target.value),onBlur:A,autoFocus:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Project key below will auto-fill when you finish typing; you can change it."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{htmlFor:"project-id",children:["Identifier",t.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Used as issue prefix (e.g. PROJ-1)"})]}),t.jsx(xe,{id:"project-id",placeholder:"PROJ",value:a,onChange:O=>{o(O.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),c(!0)},maxLength:5,className:T("font-mono",x&&"border-destructive"),"aria-invalid":x}),x&&t.jsx("p",{className:"text-xs text-destructive",children:"This project key is already in use."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{htmlFor:"project-desc",children:["Description",t.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(tr,{id:"project-desc",placeholder:"What is this project about?",value:i,onChange:O=>l(O.target.value),className:"min-h-[80px]"})]}),t.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[t.jsx("button",{type:"button",onClick:()=>m(!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:t.jsxs("span",{className:"flex items-center gap-1.5",children:[u?t.jsx(Fs,{className:"h-3.5 w-3.5"}):t.jsx(Ws,{className:"h-3.5 w-3.5"}),"Statuses",t.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",f.length,")"]})]})}),u&&t.jsxs("div",{className:"px-3 pb-3 border-t border-border space-y-3 pt-3",children:[t.jsx(ti,{sensors:D,onDragEnd:W,children:t.jsx(Kr,{items:f.map(O=>O.key),strategy:si,children:t.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(O=>t.jsx(ih,{chip:O,onRemove:()=>h(L=>L.filter(Z=>Z.key!==O.key).map((Z,I)=>({...Z,position:I})))},O.key))})})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:Nr.map(O=>t.jsx("button",{type:"button",onClick:()=>b(O),className:T("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",k===O?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:O}},O))}),t.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[t.jsx(xe,{placeholder:"Status name…",value:g,onChange:O=>v(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),R())},className:"h-7 text-xs flex-1"}),t.jsx(V,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:R,disabled:!g.trim(),children:t.jsx(Fe,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),t.jsxs(Sn,{children:[t.jsx(V,{type:"button",variant:"ghost",onClick:z,children:"Cancel"}),t.jsx(V,{type:"submit",disabled:!n.trim()||!a.trim()||!w||x||N.isPending,children:N.isPending?"Creating...":"Create project"})]})]})]})})}const we=Td,Te=Pd,ve=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Yo,{ref:r,className:T("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),...n,children:[s,t.jsx(Md,{asChild:!0,children:t.jsx(Fs,{className:"h-4 w-4 opacity-50"})})]}));ve.displayName=Yo.displayName;const bl=p.forwardRef(({className:e,...s},n)=>t.jsx(Lo,{ref:n,className:T("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(ra,{className:"h-4 w-4"})}));bl.displayName=Lo.displayName;const yl=p.forwardRef(({className:e,...s},n)=>t.jsx(Ho,{ref:n,className:T("flex cursor-default items-center justify-center py-1",e),...s,children:t.jsx(Fs,{className:"h-4 w-4"})}));yl.displayName=Ho.displayName;const je=p.forwardRef(({className:e,children:s,position:n="popper",...r},a)=>t.jsx(Dd,{children:t.jsxs(Uo,{ref:a,className:T("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",n==="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:n,...r,children:[t.jsx(bl,{}),t.jsx(Ed,{className:T("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),t.jsx(yl,{})]})}));je.displayName=Uo.displayName;const ch=p.forwardRef(({className:e,...s},n)=>t.jsx(Ko,{ref:n,className:T("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...s}));ch.displayName=Ko.displayName;const ce=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Vo,{ref:r,className:T("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),...n,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(_d,{children:t.jsx(gt,{className:"h-4 w-4"})})}),t.jsx(Od,{children:s})]}));ce.displayName=Vo.displayName;const uh=p.forwardRef(({className:e,...s},n)=>t.jsx(Go,{ref:n,className:T("-mx-1 my-1 h-px bg-border",e),...s}));uh.displayName=Go.displayName;const Cn={project:e=>["projects",e,"access"]};function vl(e){return Ne({queryKey:Cn.project(e),queryFn:()=>J.get(`/admin/projects/${e}/access`),enabled:!!e})}function jl(e){const s=he();return fe({mutationFn:({userId:n,role:r})=>J.post(`/admin/projects/${e}/members`,{user_id:n,role:r}),onSuccess:()=>{s.invalidateQueries({queryKey:Cn.project(e)})}})}function wl(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/projects/${e}/members/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Cn.project(e)})}})}function Nl(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/projects/${e}/teams`,{team_id:n}),onSuccess:()=>{s.invalidateQueries({queryKey:Cn.project(e)})}})}function kl(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/projects/${e}/teams/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Cn.project(e)})}})}function mh({open:e,onClose:s,projectId:n,projectName:r}){const{workspace:a}=Se(),o=(a==null?void 0:a.id)??"",{data:i,isLoading:l}=vl(n),{data:d}=Ln(o),{data:c}=ta(o),u=jl(n),m=wl(n),f=Nl(n),h=kl(n),[g,v]=p.useState(""),[k,b]=p.useState(""),j=new Set((i==null?void 0:i.members.map(x=>x.user_id))??[]),N=new Set((i==null?void 0:i.teams.map(x=>x.team_id))??[]),C=(d??[]).filter(x=>!j.has(x.user_id)),S=(c??[]).filter(x=>!N.has(x.id));return t.jsx(ga,{open:e,onOpenChange:x=>!x&&s(),children:t.jsxs(er,{className:"sm:max-w-[480px]",children:[t.jsx(ba,{children:t.jsxs(ya,{children:["Access — ",r]})}),t.jsxs("div",{className:"space-y-5 pt-1",children:[t.jsxs("div",{children:[t.jsx("div",{className:"flex items-center justify-between mb-2",children:t.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),l?t.jsx("div",{className:"space-y-2",children:[1,2].map(x=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"h-7 w-7 rounded-full"}),t.jsx(se,{className:"h-3.5 w-32"})]},x))}):(i==null?void 0:i.members.length)===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):t.jsx("div",{className:"space-y-1",children:i==null?void 0:i.members.map(x=>{var R;const w=x.user,D=(w==null?void 0:w.first_name)??"",_=(w==null?void 0:w.last_name)??"",A=`${D} ${_}`.trim()||(w==null?void 0:w.email)||"Unknown",z=(D[0]??_[0]??((R=w==null?void 0:w.email)==null?void 0:R[0])??"U").toUpperCase();return t.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[t.jsx(st,{className:"h-7 w-7 shrink-0",children:t.jsx(nt,{className:"text-[11px] font-medium",children:z})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:A}),t.jsx("span",{className:T("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",x.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:x.role}),t.jsx("button",{onClick:()=>m.mutate(x.user_id,{onSuccess:()=>F.success("Access removed"),onError:()=>F.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(We,{className:"h-3.5 w-3.5"})})]},x.id)})}),C.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsx(yn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(we,{value:g,onValueChange:v,children:[t.jsx(ve,{className:"h-8 text-xs flex-1",children:t.jsx(Te,{placeholder:"Add person…"})}),t.jsx(je,{children:C.map(x=>{const w=x.user,D=(w==null?void 0:w.first_name)??"",_=(w==null?void 0:w.last_name)??"",A=`${D} ${_}`.trim()||(w==null?void 0:w.email)||"Unknown";return t.jsx(ce,{value:x.user_id,children:A},x.user_id)})})]}),g&&t.jsx(V,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:g},{onSuccess:()=>{F.success("Access granted"),v("")},onError:()=>F.error("Failed to grant access")}),children:"Add"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"flex items-center justify-between mb-2",children:t.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),l?t.jsx("div",{className:"space-y-2",children:[1].map(x=>t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"h-7 w-7 rounded-lg"}),t.jsx(se,{className:"h-3.5 w-28"})]},x))}):(i==null?void 0:i.teams.length)===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):t.jsx("div",{className:"space-y-1",children:i==null?void 0:i.teams.map(x=>{const w=x.team;return t.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[t.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:t.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground"})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:(w==null?void 0:w.name)??"Unknown team"}),w&&t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[w.member_count," ",w.member_count===1?"member":"members"]}),t.jsx("button",{onClick:()=>h.mutate(x.team_id,{onSuccess:()=>F.success("Team access removed"),onError:()=>F.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(We,{className:"h-3.5 w-3.5"})})]},x.id)})}),S.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(we,{value:k,onValueChange:b,children:[t.jsx(ve,{className:"h-8 text-xs flex-1",children:t.jsx(Te,{placeholder:"Add team…"})}),t.jsx(je,{children:S.map(x=>t.jsx(ce,{value:x.id,children:x.name},x.id))})]}),k&&t.jsx(V,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:f.isPending,onClick:()=>f.mutate(k,{onSuccess:()=>{F.success("Team access granted"),b("")},onError:()=>F.error("Failed to add team")}),children:"Add"})]})]}),t.jsx("div",{className:"flex justify-end pt-1",children:t.jsx(V,{variant:"outline",size:"sm",onClick:s,children:"Close"})})]})]})})}const Sl=6048e5,fh=864e5,so=Symbol.for("constructDateFrom");function Ae(e,s){return typeof e=="function"?e(s):e&&typeof e=="object"&&so in e?e[so](s):e instanceof Date?new e.constructor(s):new Date(s)}function ye(e,s){return Ae(s||e,e)}function Cl(e,s,n){const r=ye(e,n==null?void 0:n.in);return isNaN(s)?Ae(e,NaN):(s&&r.setDate(r.getDate()+s),r)}function Ml(e,s,n){const r=ye(e,n==null?void 0:n.in);if(isNaN(s))return Ae(e,NaN);if(!s)return r;const a=r.getDate(),o=Ae(e,r.getTime());o.setMonth(r.getMonth()+s+1,0);const i=o.getDate();return a>=i?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let hh={};function Mn(){return hh}function Ps(e,s){var l,d,c,u;const n=Mn(),r=(s==null?void 0:s.weekStartsOn)??((d=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,a=ye(e,s==null?void 0:s.in),o=a.getDay(),i=(o<r?7:0)+o-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function cn(e,s){return Ps(e,{...s,weekStartsOn:1})}function Dl(e,s){const n=ye(e,s==null?void 0:s.in),r=n.getFullYear(),a=Ae(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=cn(a),i=Ae(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=cn(i);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function no(e){const s=ye(e),n=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return n.setUTCFullYear(s.getFullYear()),+e-+n}function Ys(e,...s){const n=Ae.bind(null,s.find(r=>typeof r=="object"));return s.map(n)}function un(e,s){const n=ye(e,s==null?void 0:s.in);return n.setHours(0,0,0,0),n}function Na(e,s,n){const[r,a]=Ys(n==null?void 0:n.in,e,s),o=un(r),i=un(a),l=+o-no(o),d=+i-no(i);return Math.round((l-d)/fh)}function xh(e,s){const n=Dl(e,s),r=Ae(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),cn(r)}function ph(e,s,n){return Cl(e,s*7,n)}function gh(e,s,n){return Ml(e,s*12,n)}function bh(e,s){let n,r=s==null?void 0:s.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Ae.bind(null,a));const o=ye(a,r);(!n||n<o||isNaN(+o))&&(n=o)}),Ae(r,n||NaN)}function yh(e,s){let n,r=s==null?void 0:s.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=Ae.bind(null,a));const o=ye(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),Ae(r,n||NaN)}function vh(e,s,n){const[r,a]=Ys(n==null?void 0:n.in,e,s);return+un(r)==+un(a)}function El(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function jh(e){return!(!El(e)&&typeof e!="number"||isNaN(+ye(e)))}function _l(e,s,n){const[r,a]=Ys(n==null?void 0:n.in,e,s),o=r.getFullYear()-a.getFullYear(),i=r.getMonth()-a.getMonth();return o*12+i}function wh(e,s){const n=ye(e,s==null?void 0:s.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Ol(e,s){const[n,r]=Ys(e,s.start,s.end);return{start:n,end:r}}function Nh(e,s){const{start:n,end:r}=Ol(s==null?void 0:s.in,e);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setDate(1);let l=1;const d=[];for(;+i<=o;)d.push(Ae(n,i)),i.setMonth(i.getMonth()+l);return a?d.reverse():d}function kh(e,s){const n=ye(e,s==null?void 0:s.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Sh(e,s){const n=ye(e,s==null?void 0:s.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Tl(e,s){const n=ye(e,s==null?void 0:s.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ch(e,s){const{start:n,end:r}=Ol(s==null?void 0:s.in,e);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let l=1;const d=[];for(;+i<=o;)d.push(Ae(n,i)),i.setFullYear(i.getFullYear()+l);return a?d.reverse():d}function Pl(e,s){var l,d,c,u;const n=Mn(),r=(s==null?void 0:s.weekStartsOn)??((d=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,a=ye(e,s==null?void 0:s.in),o=a.getDay(),i=(o<r?-7:0)+6-(o-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function Mh(e,s){return Pl(e,{...s,weekStartsOn:1})}const Dh={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"}},Eh=(e,s,n)=>{let r;const a=Dh[e];return typeof a=="string"?r=a:s===1?r=a.one:r=a.other.replace("{{count}}",s.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function kr(e){return(s={})=>{const n=s.width?String(s.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _h={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Oh={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Th={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ph={date:kr({formats:_h,defaultWidth:"full"}),time:kr({formats:Oh,defaultWidth:"full"}),dateTime:kr({formats:Th,defaultWidth:"full"})},$h={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ah=(e,s,n,r)=>$h[e];function sn(e){return(s,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):i;a=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(s):s;return a[o]}}const Rh={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ih={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fh={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"]},Wh={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"]},zh={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"}},qh={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"}},Bh=(e,s)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Yh={ordinalNumber:Bh,era:sn({values:Rh,defaultWidth:"wide"}),quarter:sn({values:Ih,defaultWidth:"wide",argumentCallback:e=>e-1}),month:sn({values:Fh,defaultWidth:"wide"}),day:sn({values:Wh,defaultWidth:"wide"}),dayPeriod:sn({values:zh,defaultWidth:"wide",formattingValues:qh,defaultFormattingWidth:"wide"})};function nn(e){return(s,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=s.match(a);if(!o)return null;const i=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(l)?Hh(l,m=>m.test(i)):Lh(l,m=>m.test(i));let c;c=e.valueCallback?e.valueCallback(d):d,c=n.valueCallback?n.valueCallback(c):c;const u=s.slice(i.length);return{value:c,rest:u}}}function Lh(e,s){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&s(e[n]))return n}function Hh(e,s){for(let n=0;n<e.length;n++)if(s(e[n]))return n}function Uh(e){return(s,n={})=>{const r=s.match(e.matchPattern);if(!r)return null;const a=r[0],o=s.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const l=s.slice(a.length);return{value:i,rest:l}}}const Kh=/^(\d+)(th|st|nd|rd)?/i,Vh=/\d+/i,Gh={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},Qh={any:[/^b/i,/^(a|c)/i]},Xh={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Jh={any:[/1/i,/2/i,/3/i,/4/i]},Zh={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},ex={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]},tx={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},sx={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]},nx={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},rx={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}},ax={ordinalNumber:Uh({matchPattern:Kh,parsePattern:Vh,valueCallback:e=>parseInt(e,10)}),era:nn({matchPatterns:Gh,defaultMatchWidth:"wide",parsePatterns:Qh,defaultParseWidth:"any"}),quarter:nn({matchPatterns:Xh,defaultMatchWidth:"wide",parsePatterns:Jh,defaultParseWidth:"any",valueCallback:e=>e+1}),month:nn({matchPatterns:Zh,defaultMatchWidth:"wide",parsePatterns:ex,defaultParseWidth:"any"}),day:nn({matchPatterns:tx,defaultMatchWidth:"wide",parsePatterns:sx,defaultParseWidth:"any"}),dayPeriod:nn({matchPatterns:nx,defaultMatchWidth:"any",parsePatterns:rx,defaultParseWidth:"any"})},Cs={code:"en-US",formatDistance:Eh,formatLong:Ph,formatRelative:Ah,localize:Yh,match:ax,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ox(e,s){const n=ye(e,s==null?void 0:s.in);return Na(n,Tl(n))+1}function ka(e,s){const n=ye(e,s==null?void 0:s.in),r=+cn(n)-+xh(n);return Math.round(r/Sl)+1}function $l(e,s){var u,m,f,h;const n=ye(e,s==null?void 0:s.in),r=n.getFullYear(),a=Mn(),o=(s==null?void 0:s.firstWeekContainsDate)??((m=(u=s==null?void 0:s.locale)==null?void 0:u.options)==null?void 0:m.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(f=a.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=Ae((s==null?void 0:s.in)||e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const l=Ps(i,s),d=Ae((s==null?void 0:s.in)||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const c=Ps(d,s);return+n>=+l?r+1:+n>=+c?r:r-1}function ix(e,s){var l,d,c,u;const n=Mn(),r=(s==null?void 0:s.firstWeekContainsDate)??((d=(l=s==null?void 0:s.locale)==null?void 0:l.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,a=$l(e,s),o=Ae((s==null?void 0:s.in)||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),Ps(o,s)}function Sa(e,s){const n=ye(e,s==null?void 0:s.in),r=+Ps(n,s)-+ix(n,s);return Math.round(r/Sl)+1}function ge(e,s){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(s,"0");return n+r}const At={y(e,s){const n=e.getFullYear(),r=n>0?n:1-n;return ge(s==="yy"?r%100:r,s.length)},M(e,s){const n=e.getMonth();return s==="M"?String(n+1):ge(n+1,2)},d(e,s){return ge(e.getDate(),s.length)},a(e,s){const n=e.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,s){return ge(e.getHours()%12||12,s.length)},H(e,s){return ge(e.getHours(),s.length)},m(e,s){return ge(e.getMinutes(),s.length)},s(e,s){return ge(e.getSeconds(),s.length)},S(e,s){const n=s.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return ge(a,s.length)}},Ns={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ro={G:function(e,s,n){const r=e.getFullYear()>0?1:0;switch(s){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,s,n){if(s==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return At.y(e,s)},Y:function(e,s,n,r){const a=$l(e,r),o=a>0?a:1-a;if(s==="YY"){const i=o%100;return ge(i,2)}return s==="Yo"?n.ordinalNumber(o,{unit:"year"}):ge(o,s.length)},R:function(e,s){const n=Dl(e);return ge(n,s.length)},u:function(e,s){const n=e.getFullYear();return ge(n,s.length)},Q:function(e,s,n){const r=Math.ceil((e.getMonth()+1)/3);switch(s){case"Q":return String(r);case"QQ":return ge(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,s,n){const r=Math.ceil((e.getMonth()+1)/3);switch(s){case"q":return String(r);case"qq":return ge(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,s,n){const r=e.getMonth();switch(s){case"M":case"MM":return At.M(e,s);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,s,n){const r=e.getMonth();switch(s){case"L":return String(r+1);case"LL":return ge(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,s,n,r){const a=Sa(e,r);return s==="wo"?n.ordinalNumber(a,{unit:"week"}):ge(a,s.length)},I:function(e,s,n){const r=ka(e);return s==="Io"?n.ordinalNumber(r,{unit:"week"}):ge(r,s.length)},d:function(e,s,n){return s==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):At.d(e,s)},D:function(e,s,n){const r=ox(e);return s==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ge(r,s.length)},E:function(e,s,n){const r=e.getDay();switch(s){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,s,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(s){case"e":return String(o);case"ee":return ge(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,s,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(s){case"c":return String(o);case"cc":return ge(o,s.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,s,n){const r=e.getDay(),a=r===0?7:r;switch(s){case"i":return String(a);case"ii":return ge(a,s.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,s,n){const a=e.getHours()/12>=1?"pm":"am";switch(s){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,s,n){const r=e.getHours();let a;switch(r===12?a=Ns.noon:r===0?a=Ns.midnight:a=r/12>=1?"pm":"am",s){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,s,n){const r=e.getHours();let a;switch(r>=17?a=Ns.evening:r>=12?a=Ns.afternoon:r>=4?a=Ns.morning:a=Ns.night,s){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,s,n){if(s==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return At.h(e,s)},H:function(e,s,n){return s==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):At.H(e,s)},K:function(e,s,n){const r=e.getHours()%12;return s==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ge(r,s.length)},k:function(e,s,n){let r=e.getHours();return r===0&&(r=24),s==="ko"?n.ordinalNumber(r,{unit:"hour"}):ge(r,s.length)},m:function(e,s,n){return s==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):At.m(e,s)},s:function(e,s,n){return s==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):At.s(e,s)},S:function(e,s){return At.S(e,s)},X:function(e,s,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(s){case"X":return oo(r);case"XXXX":case"XX":return es(r);case"XXXXX":case"XXX":default:return es(r,":")}},x:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"x":return oo(r);case"xxxx":case"xx":return es(r);case"xxxxx":case"xxx":default:return es(r,":")}},O:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"O":case"OO":case"OOO":return"GMT"+ao(r,":");case"OOOO":default:return"GMT"+es(r,":")}},z:function(e,s,n){const r=e.getTimezoneOffset();switch(s){case"z":case"zz":case"zzz":return"GMT"+ao(r,":");case"zzzz":default:return"GMT"+es(r,":")}},t:function(e,s,n){const r=Math.trunc(+e/1e3);return ge(r,s.length)},T:function(e,s,n){return ge(+e,s.length)}};function ao(e,s=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+s+ge(o,2)}function oo(e,s){return e%60===0?(e>0?"-":"+")+ge(Math.abs(e)/60,2):es(e,s)}function es(e,s=""){const n=e>0?"-":"+",r=Math.abs(e),a=ge(Math.trunc(r/60),2),o=ge(r%60,2);return n+a+s+o}const io=(e,s)=>{switch(e){case"P":return s.date({width:"short"});case"PP":return s.date({width:"medium"});case"PPP":return s.date({width:"long"});case"PPPP":default:return s.date({width:"full"})}},Al=(e,s)=>{switch(e){case"p":return s.time({width:"short"});case"pp":return s.time({width:"medium"});case"ppp":return s.time({width:"long"});case"pppp":default:return s.time({width:"full"})}},lx=(e,s)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return io(e,s);let o;switch(r){case"P":o=s.dateTime({width:"short"});break;case"PP":o=s.dateTime({width:"medium"});break;case"PPP":o=s.dateTime({width:"long"});break;case"PPPP":default:o=s.dateTime({width:"full"});break}return o.replace("{{date}}",io(r,s)).replace("{{time}}",Al(a,s))},dx={p:Al,P:lx},cx=/^D+$/,ux=/^Y+$/,mx=["D","DD","YY","YYYY"];function fx(e){return cx.test(e)}function hx(e){return ux.test(e)}function xx(e,s,n){const r=px(e,s,n);if(console.warn(r),mx.includes(e))throw new RangeError(r)}function px(e,s,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${s}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yx=/^'([^]*?)'?$/,vx=/''/g,jx=/[a-zA-Z]/;function le(e,s,n){var u,m,f,h,g,v,k,b;const r=Mn(),a=(n==null?void 0:n.locale)??r.locale??Cs,o=(n==null?void 0:n.firstWeekContainsDate)??((m=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=(n==null?void 0:n.weekStartsOn)??((v=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((b=(k=r.locale)==null?void 0:k.options)==null?void 0:b.weekStartsOn)??0,l=ye(e,n==null?void 0:n.in);if(!jh(l))throw new RangeError("Invalid time value");let d=s.match(bx).map(j=>{const N=j[0];if(N==="p"||N==="P"){const C=dx[N];return C(j,a.formatLong)}return j}).join("").match(gx).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const N=j[0];if(N==="'")return{isToken:!1,value:wx(j)};if(ro[N])return{isToken:!0,value:j};if(N.match(jx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:j}});a.localize.preprocessor&&(d=a.localize.preprocessor(l,d));const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return d.map(j=>{if(!j.isToken)return j.value;const N=j.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&hx(N)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&fx(N))&&xx(N,s,String(e));const C=ro[N[0]];return C(l,N,a.localize,c)}).join("")}function wx(e){const s=e.match(yx);return s?s[1].replace(vx,"'"):e}function Nx(e,s){const n=ye(e,s==null?void 0:s.in),r=n.getFullYear(),a=n.getMonth(),o=Ae(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function kx(e,s){return ye(e,s==null?void 0:s.in).getMonth()}function Sx(e,s){return ye(e,s==null?void 0:s.in).getFullYear()}function Cx(e,s){return+ye(e)>+ye(s)}function Mx(e,s){return+ye(e)<+ye(s)}function Dx(e,s,n){const[r,a]=Ys(n==null?void 0:n.in,e,s);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Ex(e,s,n){const[r,a]=Ys(n==null?void 0:n.in,e,s);return r.getFullYear()===a.getFullYear()}function _x(e,s,n){const r=ye(e,n==null?void 0:n.in),a=r.getFullYear(),o=r.getDate(),i=Ae(e,0);i.setFullYear(a,s,15),i.setHours(0,0,0,0);const l=Nx(i);return r.setMonth(s,Math.min(o,l)),r}function Ox(e,s,n){const r=ye(e,n==null?void 0:n.in);return isNaN(+r)?Ae(e,NaN):(r.setFullYear(s),r)}function Tx(){const[e,s]=p.useState(!1),[n,r]=p.useState(null),[a,o]=p.useState(""),{workspace:i}=Ke(),{data:l,isLoading:d}=Jn(),c=Pm(),u=Ve(),m=(l??[]).filter(f=>!a||f.name.toLowerCase().includes(a.toLowerCase())||f.identifier.toLowerCase().includes(a.toLowerCase()));return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[t.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),t.jsxs(V,{size:"sm",onClick:()=>s(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Create"]})]}),t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(V,{variant:"outline",size:"sm",className:"text-xs h-8",children:"Add filter"})}),t.jsxs("div",{className:"relative",children:[t.jsx(Xn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),t.jsx(xe,{placeholder:"Search...",value:a,onChange:f=>o(f.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),t.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-2.5 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Identifier"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Created"}),t.jsx("span",{})]}),d?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(f=>t.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[t.jsx(se,{className:"h-4 w-48"}),t.jsx(se,{className:"h-4 w-12"}),t.jsx(se,{className:"h-5 w-16 rounded-full"}),t.jsx(se,{className:"h-4 w-24"}),t.jsx("div",{})]},f))}):m.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(vt,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:a?"No projects match":"No projects yet"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a?"Try a different search term.":"Create your first project to get started."}),!a&&t.jsxs(V,{size:"sm",onClick:()=>s(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Create project"]})]}):t.jsx("div",{className:"divide-y divide-border",children:m.map(f=>t.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors group",onClick:()=>u(`/${i}/projects/${f.identifier}/board`),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.name}),f.description&&t.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:f.description})]}),t.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:f.identifier}),t.jsx("div",{children:t.jsxs("span",{className:T("inline-flex items-center gap-1.5 text-xs",f.status==="active"&&"text-emerald-600",f.status==="paused"&&"text-amber-600",f.status==="archived"&&"text-muted-foreground"),children:[t.jsx("span",{className:T("h-1.5 w-1.5 rounded-full shrink-0",f.status==="active"&&"bg-emerald-500",f.status==="paused"&&"bg-amber-500",f.status==="archived"&&"bg-zinc-400")}),f.status.charAt(0).toUpperCase()+f.status.slice(1)]})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:le(new Date(f.created_at),"MMM d, yyyy")}),t.jsx("div",{className:"flex justify-end",onClick:h=>h.stopPropagation(),children:t.jsxs(zs,{children:[t.jsx(qs,{asChild:!0,children:t.jsx(V,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(Kn,{className:"h-4 w-4"})})}),t.jsxs(xs,{align:"end",children:[t.jsxs(Xe,{onClick:()=>u(`/${i}/projects/${f.identifier}/board`),children:[t.jsx(vt,{className:"h-4 w-4"}),"Open board"]}),t.jsxs(Xe,{onClick:()=>u(`/${i}/projects/${f.identifier}/issues`),children:[t.jsx(Vn,{className:"h-4 w-4"}),"View issues"]}),t.jsxs(Xe,{onClick:()=>r({id:f.id,name:f.name}),children:[t.jsx(zi,{className:"h-4 w-4"}),"Manage access"]}),t.jsx(jn,{}),t.jsxs(Xe,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${f.name}"? This cannot be undone.`)&&c.mutate(f.id,{onSuccess:()=>F.success("Project deleted"),onError:()=>F.error("Failed to delete project")})},children:[t.jsx(fs,{className:"h-4 w-4"}),"Delete"]})]})]})})]},f.id))}),!d&&m.length>0&&t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["1 — ",m.length," of ",m.length," result",m.length!==1?"s":""]}),t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsx("span",{children:"1 of 1 pages"}),t.jsx(V,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),t.jsx(V,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),t.jsx(dh,{open:e,onClose:()=>s(!1)}),n&&t.jsx(mh,{open:!!n,onClose:()=>r(null),projectId:n.id,projectName:n.name})]})}const Oe={all:["issues"],byProject:e=>[...Oe.all,"project",e],detail:e=>[...Oe.all,e],comments:e=>[...Oe.all,e,"comments"],activities:e=>[...Oe.all,e,"activities"]};function Dn(e){return Ne({queryKey:e?Oe.byProject(e):Oe.all,queryFn:()=>{const s=e?`/admin/issues?project_id=${e}`:"/admin/issues";return J.get(s)},select:s=>s.issues})}function Px(e){return Ne({queryKey:Oe.detail(e),queryFn:()=>J.get(`/admin/issues/${e}`),select:s=>s.issue,enabled:!!e})}function $x(e){return Ne({queryKey:Oe.comments(e),queryFn:()=>J.get(`/admin/issues/${e}/comments`),select:s=>s.comments,enabled:!!e})}function Rl(){const e=he();return fe({mutationFn:s=>J.post("/admin/issues",s),onSuccess:(s,n)=>{e.invalidateQueries({queryKey:Oe.byProject(n.project_id)})}})}function Ca(e,s){const n=he();return fe({mutationFn:r=>J.put(`/admin/issues/${e}`,r),onMutate:async r=>{await n.cancelQueries({queryKey:Oe.byProject(s)});const a=n.getQueryData(Oe.byProject(s));return n.setQueryData(Oe.byProject(s),o=>o&&{...o,issues:o.issues.map(i=>i.id===e?{...i,...r}:i)}),{previous:a}},onError:(r,a,o)=>{o!=null&&o.previous&&n.setQueryData(Oe.byProject(s),o.previous)},onSettled:()=>{n.invalidateQueries({queryKey:Oe.byProject(s)}),n.invalidateQueries({queryKey:Oe.detail(e)})}})}function Ax(e){return Ne({queryKey:Oe.activities(e),queryFn:()=>J.get(`/admin/issues/${e}/activities`),select:s=>s.activities,enabled:!!e})}function Rx(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/issues/${e}/comments`,{body:n}),onSuccess:()=>{s.invalidateQueries({queryKey:Oe.comments(e)})}})}const Ma={byProject:e=>["projects",e,"statuses"]};function Ls(e){return Ne({queryKey:Ma.byProject(e??""),queryFn:()=>J.get(`/admin/projects/${e}/statuses`),select:s=>s.statuses,enabled:!!e})}function Ix(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/projects/${e}/statuses`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Ma.byProject(e)})}})}function Fx(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:n}),onSuccess:()=>{s.invalidateQueries({queryKey:Ma.byProject(e)})}})}const Da={all:["users"],list:()=>[...Da.all,"list"]};function Wx(){return Ne({queryKey:Da.list(),queryFn:()=>J.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}function Il(){return Ne({queryKey:[...Da.list(),"map"],queryFn:()=>J.get("/admin/users"),select:e=>new Map(e.users.map(s=>{var i;const n=s.first_name??"",r=s.last_name??"",a=`${n} ${r}`.trim()||s.email,o=(n[0]??r[0]??((i=s.email)==null?void 0:i[0])??"U").toUpperCase();return[s.id,{name:a,initials:o}]})),staleTime:1e3*60*5})}const us={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},Mt={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},Fl={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},zt={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},zx=({priority:e})=>{const s=T("h-3 w-3 shrink-0",Fl[e]);switch(e){case"urgent":return t.jsx(vn,{className:s});case"high":return t.jsx(Un,{className:s});case"medium":return t.jsx(bn,{className:s});case"low":return t.jsx(Hn,{className:s});default:return t.jsx(yt,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function Wl({issue:e,onClick:s}){var u,m;const{data:n}=Il(),{attributes:r,listeners:a,setNodeRef:o,transform:i,transition:l,isDragging:d}=Vr({id:e.id}),c={transform:Gr.Transform.toString(i),transition:l};return t.jsxs("div",{ref:o,style:c,...r,...a,onClick:s,className:T("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:[t.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:e.identifier}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&t.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(f=>{const h=n==null?void 0:n.get(f);return t.jsx(st,{className:"h-4 w-4 border border-background",children:t.jsx(nt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(h==null?void 0:h.initials)??"?"})},f)}),(((u=e.assignee_ids)==null?void 0:u.length)??0)>2&&t.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]})]}),t.jsx(zx,{priority:e.priority})]})]})]})}function Sr(e,s){const n=e.replace("#",""),r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return isNaN(r)||isNaN(a)||isNaN(o)?`rgba(148,163,184,${s})`:`rgba(${r},${a},${o},${s})`}const qx=({category:e,color:s})=>{const n="h-3.5 w-3.5 shrink-0",r={color:s};switch(e){case"completed":return t.jsx(ms,{className:n,style:r});case"started":return t.jsx(Lt,{className:n,style:r});default:return t.jsx(yt,{className:n,style:r})}};function Bx({id:e,label:s,color:n,category:r,issues:a,sortable:o,onIssueClick:i}){const{setNodeRef:l,isOver:d}=zd({id:e}),{attributes:c,listeners:u,setNodeRef:m,transform:f,transition:h,isDragging:g}=Vr({id:e,disabled:!o}),v=o?{transform:Gr.Transform.toString(f),transition:h}:void 0,k=Sr(n,.08),b=Sr(n,.16),j=Sr(n,.35);return t.jsxs("div",{ref:m,style:v,className:T("flex flex-col min-w-[260px] max-w-[280px] w-full",g&&"opacity-50"),children:[t.jsxs("div",{className:T("flex items-center gap-2 mb-2 px-1",o&&"cursor-grab"),children:[o&&t.jsx("span",{...c,...u,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:t.jsx(Ai,{className:"h-3.5 w-3.5"})}),t.jsx(qx,{category:r,color:n}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:s}),t.jsx("span",{className:"ml-1 text-[11px] text-muted-foreground bg-muted rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",children:a.length})]}),t.jsxs("div",{ref:l,className:T("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:d?b:k,boxShadow:d?`inset 0 0 0 1px ${j}`:void 0},children:[t.jsx(Kr,{items:a.map(N=>N.id),strategy:qd,children:a.map(N=>t.jsx(Wl,{issue:N,onClick:()=>i==null?void 0:i(N)},N.id))}),a.length===0&&t.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:t.jsx("p",{className:"text-xs text-muted-foreground/40",children:"Drop here"})})]})]})}const Cr=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],Yx=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function Lx({open:e,onClose:s,projectId:n}){const[r,a]=p.useState(""),[o,i]=p.useState(Cr[0]),[l,d]=p.useState(""),[c,u]=p.useState("started"),m=Ix(n),f=l||o,h=()=>{r.trim()&&m.mutate({name:r.trim(),color:f,category:c},{onSuccess:()=>{F.success("Status created"),a(""),i(Cr[0]),d(""),u("started"),s()},onError:()=>F.error("Failed to create status")})};return t.jsx(ps,{open:e,onOpenChange:g=>!g&&s(),children:t.jsxs(gs,{className:"sm:max-w-sm",children:[t.jsx(bs,{children:t.jsx(ys,{className:"text-sm font-medium",children:"New Status"})}),t.jsx(Bs,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Name"}),t.jsx(xe,{placeholder:"e.g. In Review",value:r,onChange:g=>a(g.target.value),onKeyDown:g=>g.key==="Enter"&&h(),autoFocus:!0,className:"h-8 text-sm"})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Color"}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Cr.map(g=>t.jsx("button",{onClick:()=>{i(g),d("")},className:T("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",o===g&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:g}},g)),t.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[t.jsx("div",{className:"h-6 w-6 rounded-full border border-border shrink-0",style:{backgroundColor:l||"#e5e7eb"}}),t.jsx(xe,{placeholder:"#hex",value:l,onChange:g=>d(g.target.value),className:"h-6 w-20 text-xs px-1.5"})]})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Category"}),t.jsxs(we,{value:c,onValueChange:g=>u(g),children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{})}),t.jsx(je,{children:Yx.map(g=>t.jsx(ce,{value:g.value,className:"text-xs",children:g.label},g.value))})]})]})]})}),t.jsxs(Sn,{className:"mt-2",children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:s,className:"text-xs",children:"Cancel"}),t.jsx(V,{size:"sm",onClick:h,disabled:!r.trim()||m.isPending,className:"text-xs",children:"Create"})]})]})})}function Hx({projectId:e}){const[s,n]=p.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:t.jsxs("button",{onClick:()=>n(!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:[t.jsx(Fe,{className:"h-3.5 w-3.5"}),"Add status"]})}),t.jsx(Lx,{open:s,onClose:()=>n(!1),projectId:e})]})}function Mr(e,s){var r;const n={};for(const a of s)n[a.key]=[];for(const a of e)if(n[a.status]!==void 0)n[a.status].push(a);else{const o=((r=s[0])==null?void 0:r.key)??"backlog";n[o]=[...n[o]??[],a]}return n}function Ux(e,s,n){var o;const r=new Map(s.map(i=>[i.id,i])),a={};for(const i of n)a[i.key]=[];for(const i of n)for(const l of e[i.key]??[]){const d=r.get(l.id);d&&d.status===i.key&&(a[i.key].push(d),r.delete(l.id))}for(const i of r.values()){const l=a[i.status];if(l)l.push(i);else{const d=(o=n[0])==null?void 0:o.key;d&&a[d].push(i)}}return a}function Kx({issues:e,projectId:s,statuses:n,onIssueClick:r,onColumnsReorder:a}){const[o,i]=p.useState(()=>n.map(D=>D.id)),[l,d]=p.useState(()=>Mr(e,n)),[c,u]=p.useState(null),[m,f]=p.useState(null),h=p.useRef(null),g=p.useRef(!1),v=he();p.useEffect(()=>{g.current||d(D=>Ux(D,e,n))},[e,n]);const k=[...n].sort((D,_)=>{const A=o.indexOf(D.id),z=o.indexOf(_.id);return A===-1&&z===-1?D.position-_.position:A===-1?1:z===-1?-1:A-z}),b=Zo(ei(ni,{activationConstraint:{distance:5}})),j=p.useCallback(D=>{for(const[_,A]of Object.entries(l))if(A.some(z=>z.id===D))return _;return null},[l]),N=p.useCallback(D=>n.some(_=>_.id===D),[n]),C=D=>{const _=D.active.id;if(g.current=!0,N(_)){f(_);return}for(const[A,z]of Object.entries(l)){const R=z.find(W=>W.id===_);if(R){u(R),h.current=A;return}}},S=D=>{const{active:_,over:A}=D;if(!A||m)return;const z=_.id,R=A.id;if(N(z))return;const W=j(z),$=n.find(O=>O.key===R||O.id===R),G=($==null?void 0:$.key)??j(R);!W||!G||W===G||d(O=>{const L=[...O[W]??[]],Z=[...O[G]??[]],I=L.findIndex(E=>E.id===z);if(I===-1)return O;const[M]=L.splice(I,1),X={...M,status:G};if($)Z.push(X);else{const E=Z.findIndex(q=>q.id===R);if(E===-1)Z.push(X);else{const q=_.rect.current.translated!=null&&_.rect.current.translated.top>A.rect.top+A.rect.height/2;Z.splice(q?E+1:E,0,X)}}return{...O,[W]:L,[G]:Z}})},x=D=>{var O;const{active:_,over:A}=D;if(u(null),g.current=!1,m){if(f(null),!A||_.id===A.id)return;const L=o.indexOf(_.id),Z=o.indexOf(A.id);if(L===-1||Z===-1||L===Z)return;const I=Fn(o,L,Z);i(I),a==null||a(I);return}if(!A){const L=h.current;h.current=null,L&&d(Mr(e,n));return}const z=_.id,R=A.id,W=h.current;h.current=null;const $=n.find(L=>L.key===R||L.id===R),G=($==null?void 0:$.key)??j(R);if(!(!W||!G))if(W===G)d(L=>{const Z=L[W]??[],I=Z.findIndex(X=>X.id===z),M=Z.findIndex(X=>X.id===R);return I===-1||M===-1||I===M?L:{...L,[W]:Fn(Z,I,M)}});else{if(!n.find(I=>I.key===R||I.id===R))d(I=>{const M=[...I[G]??[]],X=M.findIndex(ae=>ae.id===z);if(X===-1)return I;const E=D.active.rect.current.translated!=null&&D.active.rect.current.translated.top>D.over.rect.top+D.over.rect.height/2,[q]=M.splice(X,1),K=M.findIndex(ae=>ae.id===R);if(K===-1)return M.splice(X,0,q),I;const U=E?K+1:K;return M.splice(U,0,q),{...I,[G]:M}});else{const I=((O=D.active.rect.current.translated)==null?void 0:O.top)??1/0,M=D.over.rect.top+D.over.rect.height/2;I<M&&d(X=>{const E=X[G]??[],q=E.findIndex(K=>K.id===z);return q<=0?X:{...X,[G]:Fn(E,q,0)}})}const Z=v.getQueryData(Oe.byProject(s));v.setQueryData(Oe.byProject(s),I=>I&&{...I,issues:I.issues.map(M=>M.id===z?{...M,status:G}:M)}),J.put(`/admin/issues/${z}`,{status:G}).then(()=>{v.invalidateQueries({queryKey:Oe.byProject(s)})}).catch(()=>{Z&&v.setQueryData(Oe.byProject(s),Z),d(Mr((Z==null?void 0:Z.issues)??e,n)),F.error("Failed to update issue status")})}},w=m?n.find(D=>D.id===m):null;return t.jsxs(ti,{sensors:b,collisionDetection:Bd,onDragStart:C,onDragOver:S,onDragEnd:x,children:[t.jsxs("div",{className:"flex gap-4 h-full overflow-x-auto px-6 py-4 pb-6",children:[t.jsx(Kr,{items:o,strategy:si,children:k.map(D=>t.jsx(Bx,{id:D.id,label:D.name,color:D.color,category:D.category,issues:l[D.key]??[],sortable:!0,onIssueClick:r},D.id))}),t.jsx(Hx,{projectId:s})]}),t.jsxs(Yd,{children:[c&&t.jsx(Wl,{issue:c}),w&&t.jsx("div",{className:"opacity-80 min-w-[260px] max-w-[280px]",children:t.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:[t.jsx("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:w.color}}),w.name]})})]})]})}const $s={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function Hs(e){return Ne({queryKey:e?$s.byProject(e):$s.all,queryFn:()=>{const s=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return J.get(s)},select:s=>s.sprints,enabled:!!e})}function Vx(e){const s=he();return fe({mutationFn:n=>J.post("/admin/sprints",{...n,project_id:e}),onSuccess:()=>{s.invalidateQueries({queryKey:$s.byProject(e)})}})}function Gx(e,s){const n=he();return fe({mutationFn:r=>J.put(`/admin/sprints/${e}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:$s.byProject(s)}),n.invalidateQueries({queryKey:$s.detail(e)})}})}function Qx(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/sprints/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:$s.byProject(e)})}})}const sr={byProject:e=>["task-lists","project",e]};function En(e){return Ne({queryKey:e?sr.byProject(e):["task-lists"],queryFn:()=>J.get(`/admin/projects/${e}/task-lists`),select:s=>s.task_lists,enabled:!!e})}function Xx(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/projects/${e}/task-lists`,n),onSuccess:()=>{s.invalidateQueries({queryKey:sr.byProject(e)})}})}function Jx(e){const s=he();return fe({mutationFn:({id:n,...r})=>J.put(`/admin/task-lists/${n}`,r),onSuccess:()=>{s.invalidateQueries({queryKey:sr.byProject(e)})}})}function Zx(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/task-lists/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:sr.byProject(e)}),s.invalidateQueries({queryKey:Oe.byProject(e)})}})}const lt=Ad,dt=Rd,tt=p.forwardRef(({className:e,align:s="center",sideOffset:n=4,...r},a)=>t.jsx($d,{children:t.jsx(Qo,{ref:a,align:s,sideOffset:n,className:T("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),...r})}));tt.displayName=Qo.displayName;function lo(e,s,n){const r=(e==null?void 0:e[0])??"",a=(s==null?void 0:s[0])??"";return(r+a).toUpperCase()||((n==null?void 0:n[0])??"U").toUpperCase()}function co(e,s,n){return`${e??""} ${s??""}`.trim()||n}function _n({value:e,onChange:s,disabled:n}){const[r,a]=p.useState(!1),[o,i]=p.useState(e),{data:l}=Wx(),d=e.slice().sort().join(",");p.useEffect(()=>{i(e)},[d]);const c=m=>{const f=o.includes(m)?o.filter(h=>h!==m):[...o,m];i(f),s(f)},u=(l??[]).filter(m=>o.includes(m.id));return t.jsxs(lt,{open:r,onOpenChange:a,children:[t.jsx(dt,{asChild:!0,disabled:n,children:t.jsx("button",{type:"button",className:T("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",n&&"pointer-events-none opacity-50"),children:u.length===0?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(yn,{className:"h-3.5 w-3.5"}),"Assign"]}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("div",{className:"flex -space-x-1.5",children:u.slice(0,3).map(m=>t.jsx(st,{className:"h-5 w-5 border border-background ring-0",children:t.jsx(nt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:lo(m.first_name,m.last_name,m.email)})},m.id))}),u.length>3&&t.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",u.length-3]}),t.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:u.length===1?co(u[0].first_name,u[0].last_name,u[0].email):`${u.length} assignees`})]})})}),t.jsx(tt,{className:"w-60 p-0",align:"start",children:t.jsxs(_s,{children:[t.jsx(va,{placeholder:"Search users...",className:"h-8 text-xs"}),t.jsxs(Os,{children:[t.jsx(ja,{className:"text-xs py-4",children:"No users found."}),t.jsx(is,{children:(l??[]).map(m=>{const f=o.includes(m.id),h=co(m.first_name,m.last_name,m.email),g=lo(m.first_name,m.last_name,m.email);return t.jsxs(it,{value:h,onSelect:()=>c(m.id),className:"gap-2 py-1.5",children:[t.jsx(st,{className:"h-5 w-5 shrink-0",children:t.jsx(nt,{className:"text-[9px] bg-muted text-muted-foreground",children:g})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs font-medium truncate",children:h}),t.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:m.email})]}),t.jsx(gt,{className:T("h-3.5 w-3.5 shrink-0",f?"opacity-100 text-indigo-500":"opacity-0")})]},m.id)})})]})]})})]})}function ep(e,s,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(s).split(/\s/g).slice(2).join(" ")}const Dr={},an={};function ns(e,s){try{const r=(Dr[e]||(Dr[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(s).split("GMT")[1];return r in an?an[r]:uo(r,r.split(":"))}catch{if(e in an)return an[e];const n=e==null?void 0:e.match(tp);return n?uo(e,n.slice(1)):NaN}}const tp=/([+-]\d\d):?(\d\d)?/;function uo(e,s){const n=+(s[0]||0),r=+(s[1]||0),a=+(s[2]||0)/60;return an[e]=n*60+r>0?n*60+r+a:n*60-r-a}class bt extends Date{constructor(...s){super(),s.length>1&&typeof s[s.length-1]=="string"&&(this.timeZone=s.pop()),this.internal=new Date,isNaN(ns(this.timeZone,this))?this.setTime(NaN):s.length?typeof s[0]=="number"&&(s.length===1||s.length===2&&typeof s[1]!="number")?this.setTime(s[0]):typeof s[0]=="string"?this.setTime(+new Date(s[0])):s[0]instanceof Date?this.setTime(+s[0]):(this.setTime(+new Date(...s)),zl(this),Br(this)):this.setTime(Date.now())}static tz(s,...n){return n.length?new bt(...n,s):new bt(Date.now(),s)}withTimeZone(s){return new bt(+this,s)}getTimezoneOffset(){const s=-ns(this.timeZone,this);return s>0?Math.floor(s):Math.ceil(s)}setTime(s){return Date.prototype.setTime.apply(this,arguments),Br(this),+this}[Symbol.for("constructDateFrom")](s){return new bt(+new Date(s),this.timeZone)}}const mo=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!mo.test(e))return;const s=e.replace(mo,"$1UTC");bt.prototype[s]&&(e.startsWith("get")?bt.prototype[e]=function(){return this.internal[s]()}:(bt.prototype[e]=function(){return Date.prototype[s].apply(this.internal,arguments),sp(this),+this},bt.prototype[s]=function(){return Date.prototype[s].apply(this,arguments),Br(this),+this}))});function Br(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ns(e.timeZone,e)*60))}function sp(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()),zl(e)}function zl(e){const s=ns(e.timeZone,e),n=s>0?Math.floor(s):Math.ceil(s),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),i=a-o,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();i&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+i);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const c=new Date(+e);c.setUTCSeconds(0);const u=a>0?c.getSeconds():(c.getSeconds()-60)%60,m=Math.round(-(ns(e.timeZone,e)*60))%60;(m||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+m+u));const f=ns(e.timeZone,e),h=f>0?Math.floor(f):Math.ceil(f),v=-new Date(+e).getTimezoneOffset()-h,k=h!==n,b=v-d;if(k&&b){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b);const j=ns(e.timeZone,e),N=j>0?Math.floor(j):Math.ceil(j),C=h-N;C&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+C),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+C))}}class Le extends bt{static tz(s,...n){return n.length?new Le(...n,s):new Le(Date.now(),s)}toISOString(){const[s,n,r]=this.tzComponents(),a=`${s}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[s,n,r,a]=this.internal.toUTCString().split(" ");return`${s==null?void 0:s.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const s=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${s} GMT${n}${r}${a} (${ep(this.timeZone,this)})`}toLocaleString(s,n){return Date.prototype.toLocaleString.call(this,s,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(s,n){return Date.prototype.toLocaleDateString.call(this,s,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(s,n){return Date.prototype.toLocaleTimeString.call(this,s,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const s=this.getTimezoneOffset(),n=s>0?"-":"+",r=String(Math.floor(Math.abs(s)/60)).padStart(2,"0"),a=String(Math.abs(s)%60).padStart(2,"0");return[n,r,a]}withTimeZone(s){return new Le(+this,s)}[Symbol.for("constructDateFrom")](s){return new Le(+new Date(s),this.timeZone)}}const fo=5,np=4;function rp(e,s){const n=s.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=s.addDays(e,-r+1),o=s.addDays(a,fo*7-1);return s.getMonth(e)===s.getMonth(o)?fo:np}function ql(e,s){const n=s.startOfMonth(e),r=n.getDay();return r===1?n:r===0?s.addDays(n,-1*6):s.addDays(n,-1*(r-1))}function ap(e,s){const n=ql(e,s),r=rp(e,s);return s.addDays(n,r*7-1)}const Bl={...Cs,labels:{labelDayButton:(e,s,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(i,l)=>le(i,l,{locale:Cs,...n});let o=a(e,"PPPP");return s.today&&(o=`Today, ${o}`),s.selected&&(o=`${o}, selected`),o},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,s,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>le(a,o,{locale:Cs,...s}),r(e,"LLLL yyyy")},labelGridcell:(e,s,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(i,l)=>le(i,l,{locale:Cs,...n});let o=a(e,"PPPP");return s!=null&&s.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,s,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>le(a,o,{locale:Cs,...s}),r(e,"cccc")}}};class Je{constructor(s,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Le.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,o)=>{var i;return(i=this.overrides)!=null&&i.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new Le(r,a,o,this.options.timeZone):new Date(r,a,o)},this.addDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,a):Cl(r,a)},this.addMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,a):Ml(r,a)},this.addWeeks=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,a):ph(r,a)},this.addYears=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,a):gh(r,a)},this.differenceInCalendarDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):Na(r,a)},this.differenceInCalendarMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):_l(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Nh(r)},this.eachYearOfInterval=r=>{var l;const a=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Ch(r),o=new Set(a.map(d=>this.getYear(d)));if(o.size===a.length)return a;const i=[];return o.forEach(d=>{i.push(new Date(d,0,1))}),i},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):ap(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):Mh(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):wh(r)},this.endOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,a):Pl(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):Sh(r)},this.format=(r,a,o)=>{var l;const i=(l=this.overrides)!=null&&l.format?this.overrides.format(r,a,this.options):le(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):ka(r)},this.getMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):kx(r,this.options)},this.getYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):Sx(r,this.options)},this.getWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):Sa(r,this.options)},this.isAfter=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,a):Cx(r,a)},this.isBefore=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,a):Mx(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):El(r)},this.isSameDay=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,a):vh(r,a)},this.isSameMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,a):Dx(r,a)},this.isSameYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,a):Ex(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):bh(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):yh(r)},this.setMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,a):_x(r,a)},this.setYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,a):Ox(r,a)},this.startOfBroadcastWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):ql(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):un(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):cn(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):kh(r)},this.startOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(r,this.options):Ps(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):Tl(r)},this.options={locale:Bl,...s},this.overrides=n}getDigitMap(){const{numerals:s="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:s}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(s){const n=this.getDigitMap();return s.replace(/\d/g,r=>n[r]||r)}formatNumber(s){return this.replaceDigits(s.toString())}getMonthYearOrder(){var n;const s=(n=this.options.locale)==null?void 0:n.code;return s&&Je.yearFirstLocales.has(s)?"year-first":"month-first"}formatMonthYear(s){const{locale:n,timeZone:r,numerals:a}=this.options,o=n==null?void 0:n.code;if(o&&Je.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(s)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(s,i)}}Je.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 wt=new Je;class Yl{constructor(s,n,r=wt){this.date=s,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(s,n)),this.dateLib=r,this.isoDate=r.format(s,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(s,"yyyy-MM")}isEqualTo(s){return this.dateLib.isSameDay(s.date,this.date)&&this.dateLib.isSameMonth(s.displayMonth,this.displayMonth)}}class op{constructor(s,n){this.date=s,this.weeks=n}}class ip{constructor(s,n){this.days=n,this.weekNumber=s}}function lp(e){return y.createElement("button",{...e})}function dp(e){return y.createElement("span",{...e})}function cp(e){const{size:s=24,orientation:n="left",className:r}=e;return y.createElement("svg",{className:r,width:s,height:s,viewBox:"0 0 24 24"},n==="up"&&y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function up(e){const{day:s,modifiers:n,...r}=e;return y.createElement("td",{...r})}function mp(e){const{day:s,modifiers:n,...r}=e,a=y.useRef(null);return y.useEffect(()=>{var o;n.focused&&((o=a.current)==null||o.focus())},[n.focused]),y.createElement("button",{ref:a,...r})}var ne;(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"})(ne||(ne={}));var Ee;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Ee||(Ee={}));var ct;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ct||(ct={}));var Qe;(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"})(Qe||(Qe={}));function fp(e){const{options:s,className:n,components:r,classNames:a,...o}=e,i=[a[ne.Dropdown],n].join(" "),l=s==null?void 0:s.find(({value:d})=>d===o.value);return y.createElement("span",{"data-disabled":o.disabled,className:a[ne.DropdownRoot]},y.createElement(r.Select,{className:i,...o},s==null?void 0:s.map(({value:d,label:c,disabled:u})=>y.createElement(r.Option,{key:d,value:d,disabled:u},c))),y.createElement("span",{className:a[ne.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,y.createElement(r.Chevron,{orientation:"down",size:18,className:a[ne.Chevron]})))}function hp(e){return y.createElement("div",{...e})}function xp(e){return y.createElement("div",{...e})}function pp(e){const{calendarMonth:s,displayIndex:n,...r}=e;return y.createElement("div",{...r},e.children)}function gp(e){const{calendarMonth:s,displayIndex:n,...r}=e;return y.createElement("div",{...r})}function bp(e){return y.createElement("table",{...e})}function yp(e){return y.createElement("div",{...e})}const Ll=p.createContext(void 0);function On(){const e=p.useContext(Ll);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function vp(e){const{components:s}=On();return y.createElement(s.Dropdown,{...e})}function jp(e){const{onPreviousClick:s,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:i,classNames:l,labels:{labelPrevious:d,labelNext:c}}=On(),u=p.useCallback(f=>{a&&(n==null||n(f))},[a,n]),m=p.useCallback(f=>{r&&(s==null||s(f))},[r,s]);return y.createElement("nav",{...o},y.createElement(i.PreviousMonthButton,{type:"button",className:l[ne.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:m},y.createElement(i.Chevron,{disabled:r?void 0:!0,className:l[ne.Chevron],orientation:"left"})),y.createElement(i.NextMonthButton,{type:"button",className:l[ne.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":c(a),onClick:u},y.createElement(i.Chevron,{disabled:a?void 0:!0,orientation:"right",className:l[ne.Chevron]})))}function wp(e){const{components:s}=On();return y.createElement(s.Button,{...e})}function Np(e){return y.createElement("option",{...e})}function kp(e){const{components:s}=On();return y.createElement(s.Button,{...e})}function Sp(e){const{rootRef:s,...n}=e;return y.createElement("div",{...n,ref:s})}function Cp(e){return y.createElement("select",{...e})}function Mp(e){const{week:s,...n}=e;return y.createElement("tr",{...n})}function Dp(e){return y.createElement("th",{...e})}function Ep(e){return y.createElement("thead",{"aria-hidden":!0},y.createElement("tr",{...e}))}function _p(e){const{week:s,...n}=e;return y.createElement("th",{...n})}function Op(e){return y.createElement("th",{...e})}function Tp(e){return y.createElement("tbody",{...e})}function Pp(e){const{components:s}=On();return y.createElement(s.Dropdown,{...e})}const $p=Object.freeze(Object.defineProperty({__proto__:null,Button:lp,CaptionLabel:dp,Chevron:cp,Day:up,DayButton:mp,Dropdown:fp,DropdownNav:hp,Footer:xp,Month:pp,MonthCaption:gp,MonthGrid:bp,Months:yp,MonthsDropdown:vp,Nav:jp,NextMonthButton:wp,Option:Np,PreviousMonthButton:kp,Root:Sp,Select:Cp,Week:Mp,WeekNumber:_p,WeekNumberHeader:Op,Weekday:Dp,Weekdays:Ep,Weeks:Tp,YearsDropdown:Pp},Symbol.toStringTag,{value:"Module"}));function St(e,s,n=!1,r=wt){let{from:a,to:o}=e;const{differenceInCalendarDays:i,isSameDay:l}=r;return a&&o?(i(o,a)<0&&([a,o]=[o,a]),i(s,a)>=(n?1:0)&&i(o,s)>=(n?1:0)):!n&&o?l(o,s):!n&&a?l(a,s):!1}function Ea(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function nr(e){return!!(e&&typeof e=="object"&&"from"in e)}function _a(e){return!!(e&&typeof e=="object"&&"after"in e)}function Oa(e){return!!(e&&typeof e=="object"&&"before"in e)}function Hl(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Ul(e,s){return Array.isArray(e)&&e.every(s.isDate)}function Ct(e,s,n=wt){const r=Array.isArray(s)?s:[s],{isSameDay:a,differenceInCalendarDays:o,isAfter:i}=n;return r.some(l=>{if(typeof l=="boolean")return l;if(n.isDate(l))return a(e,l);if(Ul(l,n))return l.some(d=>a(e,d));if(nr(l))return St(l,e,!1,n);if(Hl(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(Ea(l)){const d=o(l.before,e),c=o(l.after,e),u=d>0,m=c<0;return i(l.before,l.after)?m&&u:u||m}return _a(l)?o(e,l.after)>0:Oa(l)?o(l.before,e)>0:typeof l=="function"?l(e):!1})}function Ap(e,s,n,r,a){const{disabled:o,hidden:i,modifiers:l,showOutsideDays:d,broadcastCalendar:c,today:u=a.today()}=s,{isSameDay:m,isSameMonth:f,startOfMonth:h,isBefore:g,endOfMonth:v,isAfter:k}=a,b=n&&h(n),j=r&&v(r),N={[Ee.focused]:[],[Ee.outside]:[],[Ee.disabled]:[],[Ee.hidden]:[],[Ee.today]:[]},C={};for(const S of e){const{date:x,displayMonth:w}=S,D=!!(w&&!f(x,w)),_=!!(b&&g(x,b)),A=!!(j&&k(x,j)),z=!!(o&&Ct(x,o,a)),R=!!(i&&Ct(x,i,a))||_||A||!c&&!d&&D||c&&d===!1&&D,W=m(x,u);D&&N.outside.push(S),z&&N.disabled.push(S),R&&N.hidden.push(S),W&&N.today.push(S),l&&Object.keys(l).forEach($=>{const G=l==null?void 0:l[$];G&&Ct(x,G,a)&&(C[$]?C[$].push(S):C[$]=[S])})}return S=>{const x={[Ee.focused]:!1,[Ee.disabled]:!1,[Ee.hidden]:!1,[Ee.outside]:!1,[Ee.today]:!1},w={};for(const D in N){const _=N[D];x[D]=_.some(A=>A===S)}for(const D in C)w[D]=C[D].some(_=>_===S);return{...x,...w}}}function Rp(e,s,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):s[Ee[o]]?a.push(s[Ee[o]]):s[ct[o]]&&a.push(s[ct[o]]),a),[s[ne.Day]])}function Ip(e){return{...$p,...e}}function Fp(e){const s={"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(([n,r])=>{n.startsWith("data-")&&(s[n]=r)}),s}function Wp(){const e={};for(const s in ne)e[ne[s]]=`rdp-${ne[s]}`;for(const s in Ee)e[Ee[s]]=`rdp-${Ee[s]}`;for(const s in ct)e[ct[s]]=`rdp-${ct[s]}`;for(const s in Qe)e[Qe[s]]=`rdp-${Qe[s]}`;return e}function Kl(e,s,n){return(n??new Je(s)).formatMonthYear(e)}const zp=Kl;function qp(e,s,n){return(n??new Je(s)).format(e,"d")}function Bp(e,s=wt){return s.format(e,"LLLL")}function Yp(e,s,n){return(n??new Je(s)).format(e,"cccccc")}function Lp(e,s=wt){return e<10?s.formatNumber(`0${e.toLocaleString()}`):s.formatNumber(`${e.toLocaleString()}`)}function Hp(){return""}function Vl(e,s=wt){return s.format(e,"yyyy")}const Up=Vl,Kp=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Kl,formatDay:qp,formatMonthCaption:zp,formatMonthDropdown:Bp,formatWeekNumber:Lp,formatWeekNumberHeader:Hp,formatWeekdayName:Yp,formatYearCaption:Up,formatYearDropdown:Vl},Symbol.toStringTag,{value:"Module"}));function Vp(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Kp,...e}}function Ta(e,s,n,r){let a=(r??new Je(n)).format(e,"PPPP");return s.today&&(a=`Today, ${a}`),s.selected&&(a=`${a}, selected`),a}const Gp=Ta;function Pa(e,s,n){return(n??new Je(s)).formatMonthYear(e)}const Qp=Pa;function Gl(e,s,n,r){let a=(r??new Je(n)).format(e,"PPPP");return s!=null&&s.today&&(a=`Today, ${a}`),a}function Ql(e){return"Choose the Month"}function Xl(){return""}const Xp="Go to the Next Month";function Jl(e,s){return Xp}function Zl(e){return"Go to the Previous Month"}function ed(e,s,n){return(n??new Je(s)).format(e,"cccc")}function td(e,s){return`Week ${e}`}function sd(e){return"Week Number"}function nd(e){return"Choose the Year"}const Jp=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Qp,labelDay:Gp,labelDayButton:Ta,labelGrid:Pa,labelGridcell:Gl,labelMonthDropdown:Ql,labelNav:Xl,labelNext:Jl,labelPrevious:Zl,labelWeekNumber:td,labelWeekNumberHeader:sd,labelWeekday:ed,labelYearDropdown:nd},Symbol.toStringTag,{value:"Module"})),ot=(e,s,n)=>s||(n?typeof n=="function"?n:(...r)=>n:e);function Zp(e,s){var r;const n=((r=s.locale)==null?void 0:r.labels)??{};return{...Jp,...e??{},labelDayButton:ot(Ta,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:ot(Ql,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:ot(Jl,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:ot(Zl,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:ot(td,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:ot(nd,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:ot(Pa,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:ot(Gl,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:ot(Xl,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:ot(sd,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:ot(ed,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function eg(e,s,n,r,a){const{startOfMonth:o,startOfYear:i,endOfYear:l,eachMonthOfInterval:d,getMonth:c}=a;return d({start:i(e),end:l(e)}).map(f=>{const h=r.formatMonthDropdown(f,a),g=c(f),v=s&&f<o(s)||n&&f>o(n)||!1;return{value:g,label:h,disabled:v}})}function tg(e,s={},n={}){let r={...s==null?void 0:s[ne.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function sg(e,s,n,r){const a=r??e.today(),o=n?e.startOfBroadcastWeek(a,e):s?e.startOfISOWeek(a):e.startOfWeek(a),i=[];for(let l=0;l<7;l++){const d=e.addDays(o,l);i.push(d)}return i}function ng(e,s,n,r,a=!1){if(!e||!s)return;const{startOfYear:o,endOfYear:i,eachYearOfInterval:l,getYear:d}=r,c=o(e),u=i(s),m=l({start:c,end:u});return a&&m.reverse(),m.map(f=>{const h=n.formatYearDropdown(f,r);return{value:d(f),label:h,disabled:!1}})}function rg(e,s={}){var l;const{weekStartsOn:n,locale:r}=s,a=n??((l=r==null?void 0:r.options)==null?void 0:l.weekStartsOn)??0,o=d=>{const c=typeof d=="number"||typeof d=="string"?new Date(d):d;return new Le(c.getFullYear(),c.getMonth(),c.getDate(),12,0,0,e)},i=d=>{const c=o(d);return new Date(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0,0)};return{today:()=>o(Le.tz(e)),newDate:(d,c,u)=>new Le(d,c,u,12,0,0,e),startOfDay:d=>o(d),startOfWeek:(d,c)=>{const u=o(d),m=(c==null?void 0:c.weekStartsOn)??a,f=(u.getDay()-m+7)%7;return u.setDate(u.getDate()-f),u},startOfISOWeek:d=>{const c=o(d),u=(c.getDay()-1+7)%7;return c.setDate(c.getDate()-u),c},startOfMonth:d=>{const c=o(d);return c.setDate(1),c},startOfYear:d=>{const c=o(d);return c.setMonth(0,1),c},endOfWeek:(d,c)=>{const u=o(d),h=((((c==null?void 0:c.weekStartsOn)??a)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+h),u},endOfISOWeek:d=>{const c=o(d),u=(7-c.getDay())%7;return c.setDate(c.getDate()+u),c},endOfMonth:d=>{const c=o(d);return c.setMonth(c.getMonth()+1,0),c},endOfYear:d=>{const c=o(d);return c.setMonth(11,31),c},eachMonthOfInterval:d=>{const c=o(d.start),u=o(d.end),m=[],f=new Le(c.getFullYear(),c.getMonth(),1,12,0,0,e),h=u.getFullYear()*12+u.getMonth();for(;f.getFullYear()*12+f.getMonth()<=h;)m.push(new Le(f,e)),f.setMonth(f.getMonth()+1,1);return m},addDays:(d,c)=>{const u=o(d);return u.setDate(u.getDate()+c),u},addWeeks:(d,c)=>{const u=o(d);return u.setDate(u.getDate()+c*7),u},addMonths:(d,c)=>{const u=o(d);return u.setMonth(u.getMonth()+c),u},addYears:(d,c)=>{const u=o(d);return u.setFullYear(u.getFullYear()+c),u},eachYearOfInterval:d=>{const c=o(d.start),u=o(d.end),m=[],f=new Le(c.getFullYear(),0,1,12,0,0,e);for(;f.getFullYear()<=u.getFullYear();)m.push(new Le(f,e)),f.setFullYear(f.getFullYear()+1,0,1);return m},getWeek:(d,c)=>{var m;const u=i(d);return Sa(u,{weekStartsOn:(c==null?void 0:c.weekStartsOn)??a,firstWeekContainsDate:(c==null?void 0:c.firstWeekContainsDate)??((m=r==null?void 0:r.options)==null?void 0:m.firstWeekContainsDate)??1})},getISOWeek:d=>{const c=i(d);return ka(c)},differenceInCalendarDays:(d,c)=>{const u=i(d),m=i(c);return Na(u,m)},differenceInCalendarMonths:(d,c)=>{const u=i(d),m=i(c);return _l(u,m)}}}const Tn=e=>e instanceof HTMLElement?e:null,Er=e=>[...e.querySelectorAll("[data-animated-month]")??[]],ag=e=>Tn(e.querySelector("[data-animated-month]")),_r=e=>Tn(e.querySelector("[data-animated-caption]")),Or=e=>Tn(e.querySelector("[data-animated-weeks]")),og=e=>Tn(e.querySelector("[data-animated-nav]")),ig=e=>Tn(e.querySelector("[data-animated-weekdays]"));function lg(e,s,{classNames:n,months:r,focused:a,dateLib:o}){const i=p.useRef(null),l=p.useRef(r),d=p.useRef(!1);p.useLayoutEffect(()=>{const c=l.current;if(l.current=r,!s||!e.current||!(e.current instanceof HTMLElement)||r.length===0||c.length===0||r.length!==c.length)return;const u=o.isSameMonth(r[0].date,c[0].date),m=o.isAfter(r[0].date,c[0].date),f=m?n[Qe.caption_after_enter]:n[Qe.caption_before_enter],h=m?n[Qe.weeks_after_enter]:n[Qe.weeks_before_enter],g=i.current,v=e.current.cloneNode(!0);if(v instanceof HTMLElement?(Er(v).forEach(N=>{if(!(N instanceof HTMLElement))return;const C=ag(N);C&&N.contains(C)&&N.removeChild(C);const S=_r(N);S&&S.classList.remove(f);const x=Or(N);x&&x.classList.remove(h)}),i.current=v):i.current=null,d.current||u||a)return;const k=g instanceof HTMLElement?Er(g):[],b=Er(e.current);if(b!=null&&b.every(j=>j instanceof HTMLElement)&&k&&k.every(j=>j instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const j=og(e.current);j&&(j.style.zIndex="1"),b.forEach((N,C)=>{const S=k[C];if(!S)return;N.style.position="relative",N.style.overflow="hidden";const x=_r(N);x&&x.classList.add(f);const w=Or(N);w&&w.classList.add(h);const D=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),j&&(j.style.zIndex=""),x&&x.classList.remove(f),w&&w.classList.remove(h),N.style.position="",N.style.overflow="",N.contains(S)&&N.removeChild(S)};S.style.pointerEvents="none",S.style.position="absolute",S.style.overflow="hidden",S.setAttribute("aria-hidden","true");const _=ig(S);_&&(_.style.opacity="0");const A=_r(S);A&&(A.classList.add(m?n[Qe.caption_before_exit]:n[Qe.caption_after_exit]),A.addEventListener("animationend",D));const z=Or(S);z&&z.classList.add(m?n[Qe.weeks_before_exit]:n[Qe.weeks_after_exit]),N.insertBefore(S,N.firstChild)})}})}function dg(e,s,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:i,fixedWeeks:l,broadcastCalendar:d}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:m,endOfBroadcastWeek:f,endOfISOWeek:h,endOfMonth:g,endOfWeek:v,isAfter:k,startOfBroadcastWeek:b,startOfISOWeek:j,startOfWeek:N}=r,C=d?b(a,r):i?j(a):N(a),S=d?f(o):i?h(g(o)):v(g(o)),x=s&&(d?f(s):i?h(s):v(s)),w=x&&k(S,x)?x:S,D=u(w,C),_=m(o,a)+1,A=[];for(let W=0;W<=D;W++){const $=c(C,W);A.push($)}const R=(d?35:42)*_;if(l&&A.length<R){const W=R-A.length;for(let $=0;$<W;$++){const G=c(A[A.length-1],1);A.push(G)}}return A}function cg(e){const s=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((o,i)=>o.concat(i.days.slice()),s.slice());return n.concat(a.slice())},s.slice())}function ug(e,s,n,r){const{numberOfMonths:a=1}=n,o=[];for(let i=0;i<a;i++){const l=r.addMonths(e,i);if(s&&l>s)break;o.push(l)}return o}function ho(e,s,n,r){const{month:a,defaultMonth:o,today:i=r.today(),numberOfMonths:l=1}=e;let d=a||o||i;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:m}=r;if(n&&c(n,d)<l-1){const f=-1*(l-1);d=u(n,f)}return s&&c(d,s)<0&&(d=s),m(d)}function mg(e,s,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:i,endOfMonth:l,endOfWeek:d,getISOWeek:c,getWeek:u,startOfBroadcastWeek:m,startOfISOWeek:f,startOfWeek:h}=r,g=e.reduce((v,k)=>{const b=n.broadcastCalendar?m(k,r):n.ISOWeek?f(k):h(k),j=n.broadcastCalendar?o(k):n.ISOWeek?i(l(k)):d(l(k)),N=s.filter(w=>w>=b&&w<=j),C=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length<C){const w=s.filter(D=>{const _=C-N.length;return D>j&&D<=a(j,_)});N.push(...w)}const S=N.reduce((w,D)=>{const _=n.ISOWeek?c(D):u(D),A=w.find(R=>R.weekNumber===_),z=new Yl(D,k,r);return A?A.days.push(z):w.push(new ip(_,[z])),w},[]),x=new op(k,S);return v.push(x),v},[]);return n.reverseMonths?g.reverse():g}function fg(e,s){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:i,endOfMonth:l,addYears:d,endOfYear:c,newDate:u,today:m}=s,{fromYear:f,toYear:h,fromMonth:g,toMonth:v}=e;!n&&g&&(n=g),!n&&f&&(n=s.newDate(f,0,1)),!r&&v&&(r=v),!r&&h&&(r=u(h,11,31));const k=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=i(n):f?n=u(f,0,1):!n&&k&&(n=a(d(e.today??m(),-100))),r?r=l(r):h?r=u(h,11,31):!r&&k&&(r=c(e.today??m())),[n&&o(n),r&&o(r)]}function hg(e,s,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:d}=r,c=a?o:1,u=i(e);if(!s)return l(u,c);if(!(d(s,e)<o))return l(u,c)}function xg(e,s,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:i,addMonths:l,differenceInCalendarMonths:d}=r,c=a?o??1:1,u=i(e);if(!s)return l(u,-c);if(!(d(u,s)<=0))return l(u,-c)}function pg(e){const s=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),s.slice())}function rr(e,s){const[n,r]=p.useState(e);return[s===void 0?n:s,r]}function gg(e,s){var C;const[n,r]=fg(e,s),{startOfMonth:a,endOfMonth:o}=s,i=ho(e,n,r,s),[l,d]=rr(i,e.month?i:void 0);p.useEffect(()=>{const S=ho(e,n,r,s);d(S)},[e.timeZone]);const{months:c,weeks:u,days:m,previousMonth:f,nextMonth:h}=p.useMemo(()=>{const S=ug(l,r,{numberOfMonths:e.numberOfMonths},s),x=dg(S,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},s),w=mg(S,x,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},s),D=pg(w),_=cg(w),A=xg(l,n,e,s),z=hg(l,r,e,s);return{months:w,weeks:D,days:_,previousMonth:A,nextMonth:z}},[s,l.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(C=e.endMonth)==null?void 0:C.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:g,onMonthChange:v}=e,k=S=>u.some(x=>x.days.some(w=>w.isEqualTo(S))),b=S=>{if(g)return;let x=a(S);n&&x<a(n)&&(x=a(n)),r&&x>a(r)&&(x=a(r)),d(x),v==null||v(x)};return{months:c,weeks:u,days:m,navStart:n,navEnd:r,previousMonth:f,nextMonth:h,goToMonth:b,goToDay:S=>{k(S)||b(S.date)}}}var pt;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(pt||(pt={}));function xo(e){return!e[Ee.disabled]&&!e[Ee.hidden]&&!e[Ee.outside]}function bg(e,s,n,r){let a,o=-1;for(const i of e){const l=s(i);xo(l)&&(l[Ee.focused]&&o<pt.FocusedModifier?(a=i,o=pt.FocusedModifier):r!=null&&r.isEqualTo(i)&&o<pt.LastFocused?(a=i,o=pt.LastFocused):n(i.date)&&o<pt.Selected?(a=i,o=pt.Selected):l[Ee.today]&&o<pt.Today&&(a=i,o=pt.Today))}return a||(a=e.find(i=>xo(s(i)))),a}function yg(e,s,n,r,a,o,i){const{ISOWeek:l,broadcastCalendar:d}=o,{addDays:c,addMonths:u,addWeeks:m,addYears:f,endOfBroadcastWeek:h,endOfISOWeek:g,endOfWeek:v,max:k,min:b,startOfBroadcastWeek:j,startOfISOWeek:N,startOfWeek:C}=i;let x={day:c,week:m,month:u,year:f,startOfWeek:w=>d?j(w,i):l?N(w):C(w),endOfWeek:w=>d?h(w):l?g(w):v(w)}[e](n,s==="after"?1:-1);return s==="before"&&r?x=k([r,x]):s==="after"&&a&&(x=b([a,x])),x}function rd(e,s,n,r,a,o,i,l=0){if(l>365)return;const d=yg(e,s,n.date,r,a,o,i),c=!!(o.disabled&&Ct(d,o.disabled,i)),u=!!(o.hidden&&Ct(d,o.hidden,i)),m=d,f=new Yl(d,m,i);return!c&&!u?f:rd(e,s,f,r,a,o,i,l+1)}function vg(e,s,n,r,a){const{autoFocus:o}=e,[i,l]=p.useState(),d=bg(s.days,n,r||(()=>!1),i),[c,u]=p.useState(o?d:void 0);return{isFocusTarget:v=>!!(d!=null&&d.isEqualTo(v)),setFocused:u,focused:c,blur:()=>{l(c),u(void 0)},moveFocus:(v,k)=>{if(!c)return;const b=rd(v,k,c,s.navStart,s.navEnd,e,a);b&&(e.disableNavigation&&!s.days.some(N=>N.isEqualTo(b))||(s.goToDay(b),u(b)))}}}function jg(e,s){const{selected:n,required:r,onSelect:a}=e,[o,i]=rr(n,a?n:void 0),l=a?n:o,{isSameDay:d}=s,c=h=>(l==null?void 0:l.some(g=>d(g,h)))??!1,{min:u,max:m}=e;return{selected:l,select:(h,g,v)=>{let k=[...l??[]];if(c(h)){if((l==null?void 0:l.length)===u||r&&(l==null?void 0:l.length)===1)return;k=l==null?void 0:l.filter(b=>!d(b,h))}else(l==null?void 0:l.length)===m?k=[h]:k=[...k,h];return a||i(k),a==null||a(k,h,g,v),k},isSelected:c}}function wg(e,s,n=0,r=0,a=!1,o=wt){const{from:i,to:l}=s||{},{isSameDay:d,isAfter:c,isBefore:u}=o;let m;if(!i&&!l)m={from:e,to:n>0?void 0:e};else if(i&&!l)d(i,e)?n===0?m={from:i,to:e}:a?m={from:i,to:void 0}:m=void 0:u(e,i)?m={from:e,to:i}:m={from:i,to:e};else if(i&&l)if(d(i,e)&&d(l,e))a?m={from:i,to:l}:m=void 0;else if(d(i,e))m={from:i,to:n>0?void 0:e};else if(d(l,e))m={from:e,to:n>0?void 0:e};else if(u(e,i))m={from:e,to:l};else if(c(e,i))m={from:i,to:e};else if(c(e,l))m={from:i,to:e};else throw new Error("Invalid range");if(m!=null&&m.from&&(m!=null&&m.to)){const f=o.differenceInCalendarDays(m.to,m.from);r>0&&f>r?m={from:e,to:void 0}:n>1&&f<n&&(m={from:e,to:void 0})}return m}function Ng(e,s,n=wt){const r=Array.isArray(s)?s:[s];let a=e.from;const o=n.differenceInCalendarDays(e.to,e.from),i=Math.min(o,6);for(let l=0;l<=i;l++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function po(e,s,n=wt){return St(e,s.from,!1,n)||St(e,s.to,!1,n)||St(s,e.from,!1,n)||St(s,e.to,!1,n)}function kg(e,s,n=wt){const r=Array.isArray(s)?s:[s];if(r.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:n.isDate(l)?St(e,l,!1,n):Ul(l,n)?l.some(d=>St(e,d,!1,n)):nr(l)?l.from&&l.to?po(e,{from:l.from,to:l.to},n):!1:Hl(l)?Ng(e,l.dayOfWeek,n):Ea(l)?n.isAfter(l.before,l.after)?po(e,{from:n.addDays(l.after,1),to:n.addDays(l.before,-1)},n):Ct(e.from,l,n)||Ct(e.to,l,n):_a(l)||Oa(l)?Ct(e.from,l,n)||Ct(e.to,l,n):!1))return!0;const i=r.filter(l=>typeof l=="function");if(i.length){let l=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let c=0;c<=d;c++){if(i.some(u=>u(l)))return!0;l=n.addDays(l,1)}}return!1}function Sg(e,s){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:i}=e,[l,d]=rr(a,i?a:void 0),c=i?a:l;return{selected:c,select:(f,h,g)=>{const{min:v,max:k}=e,b=f?wg(f,c,v,k,o,s):void 0;return r&&n&&(b!=null&&b.from)&&b.to&&kg({from:b.from,to:b.to},n,s)&&(b.from=f,b.to=void 0),i||d(b),i==null||i(b,f,h,g),b},isSelected:f=>c&&St(c,f,!1,s)}}function Cg(e,s){const{selected:n,required:r,onSelect:a}=e,[o,i]=rr(n,a?n:void 0),l=a?n:o,{isSameDay:d}=s;return{selected:l,select:(m,f,h)=>{let g=m;return!r&&l&&l&&d(m,l)&&(g=void 0),a||i(g),a==null||a(g,m,f,h),g},isSelected:m=>l?d(l,m):!1}}function Mg(e,s){const n=Cg(e,s),r=jg(e,s),a=Sg(e,s);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function et(e,s){return e instanceof Le&&e.timeZone===s?e:new Le(e,s)}function ks(e,s,n){return et(e,s)}function go(e,s,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?ks(e,s):Array.isArray(e)?e.map(r=>r instanceof Date?ks(r,s):r):nr(e)?{...e,from:e.from?et(e.from,s):e.from,to:e.to?et(e.to,s):e.to}:Ea(e)?{before:ks(e.before,s),after:ks(e.after,s)}:_a(e)?{after:ks(e.after,s)}:Oa(e)?{before:ks(e.before,s)}:e}function Tr(e,s,n){return e&&(Array.isArray(e)?e.map(r=>go(r,s)):go(e,s))}function Dg(e){var re;let s=e;const n=s.timeZone;if(n&&(s={...e,timeZone:n},s.today&&(s.today=et(s.today,n)),s.month&&(s.month=et(s.month,n)),s.defaultMonth&&(s.defaultMonth=et(s.defaultMonth,n)),s.startMonth&&(s.startMonth=et(s.startMonth,n)),s.endMonth&&(s.endMonth=et(s.endMonth,n)),s.mode==="single"&&s.selected?s.selected=et(s.selected,n):s.mode==="multiple"&&s.selected?s.selected=(re=s.selected)==null?void 0:re.map(Q=>et(Q,n)):s.mode==="range"&&s.selected&&(s.selected={from:s.selected.from?et(s.selected.from,n):s.selected.from,to:s.selected.to?et(s.selected.to,n):s.selected.to}),s.disabled!==void 0&&(s.disabled=Tr(s.disabled,n)),s.hidden!==void 0&&(s.hidden=Tr(s.hidden,n)),s.modifiers)){const Q={};Object.keys(s.modifiers).forEach(te=>{var Y;Q[te]=Tr((Y=s.modifiers)==null?void 0:Y[te],n)}),s.modifiers=Q}const{components:r,formatters:a,labels:o,dateLib:i,locale:l,classNames:d}=p.useMemo(()=>{const Q={...Bl,...s.locale},te=s.broadcastCalendar?1:s.weekStartsOn,Y=s.noonSafe&&s.timeZone?rg(s.timeZone,{weekStartsOn:te,locale:Q}):void 0,ee=s.dateLib&&Y?{...Y,...s.dateLib}:s.dateLib??Y,pe=new Je({locale:Q,weekStartsOn:te,firstWeekContainsDate:s.firstWeekContainsDate,useAdditionalWeekYearTokens:s.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:s.useAdditionalDayOfYearTokens,timeZone:s.timeZone,numerals:s.numerals},ee);return{dateLib:pe,components:Ip(s.components),formatters:Vp(s.formatters),labels:Zp(s.labels,pe.options),locale:Q,classNames:{...Wp(),...s.classNames}}},[s.locale,s.broadcastCalendar,s.weekStartsOn,s.firstWeekContainsDate,s.useAdditionalWeekYearTokens,s.useAdditionalDayOfYearTokens,s.timeZone,s.numerals,s.dateLib,s.noonSafe,s.components,s.formatters,s.labels,s.classNames]);s.today||(s={...s,today:i.today()});const{captionLayout:c,mode:u,navLayout:m,numberOfMonths:f=1,onDayBlur:h,onDayClick:g,onDayFocus:v,onDayKeyDown:k,onDayMouseEnter:b,onDayMouseLeave:j,onNextClick:N,onPrevClick:C,showWeekNumber:S,styles:x}=s,{formatCaption:w,formatDay:D,formatMonthDropdown:_,formatWeekNumber:A,formatWeekNumberHeader:z,formatWeekdayName:R,formatYearDropdown:W}=a,$=gg(s,i),{days:G,months:O,navStart:L,navEnd:Z,previousMonth:I,nextMonth:M,goToMonth:X}=$,E=Ap(G,s,L,Z,i),{isSelected:q,select:K,selected:U}=Mg(s,i)??{},{blur:ae,focused:P,isFocusTarget:oe,moveFocus:be,setFocused:_e}=vg(s,$,E,q??(()=>!1),i),{labelDayButton:qe,labelGridcell:Dt,labelGrid:Ht,labelMonthDropdown:ie,labelNav:Ut,labelPrevious:Kt,labelNext:Vt,labelWeekday:Gt,labelWeekNumber:Us,labelWeekNumberHeader:rt,labelYearDropdown:ut}=o,vs=p.useMemo(()=>sg(i,s.ISOWeek,s.broadcastCalendar,s.today),[i,s.ISOWeek,s.broadcastCalendar,s.today]),Be=u!==void 0||g!==void 0,Qt=p.useCallback(()=>{I&&(X(I),C==null||C(I))},[I,X,C]),Et=p.useCallback(()=>{M&&(X(M),N==null||N(M))},[X,M,N]),Ye=p.useCallback((Q,te)=>Y=>{Y.preventDefault(),Y.stopPropagation(),_e(Q),!te.disabled&&(K==null||K(Q.date,te,Y),g==null||g(Q.date,te,Y))},[K,g,_e]),mt=p.useCallback((Q,te)=>Y=>{_e(Q),v==null||v(Q.date,te,Y)},[v,_e]),_t=p.useCallback((Q,te)=>Y=>{ae(),h==null||h(Q.date,te,Y)},[ae,h]),Ks=p.useCallback((Q,te)=>Y=>{const ee={ArrowLeft:[Y.shiftKey?"month":"day",s.dir==="rtl"?"after":"before"],ArrowRight:[Y.shiftKey?"month":"day",s.dir==="rtl"?"before":"after"],ArrowDown:[Y.shiftKey?"year":"week","after"],ArrowUp:[Y.shiftKey?"year":"week","before"],PageUp:[Y.shiftKey?"year":"month","before"],PageDown:[Y.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ee[Y.key]){Y.preventDefault(),Y.stopPropagation();const[pe,B]=ee[Y.key];be(pe,B)}k==null||k(Q.date,te,Y)},[be,k,s.dir]),Nt=p.useCallback((Q,te)=>Y=>{b==null||b(Q.date,te,Y)},[b]),Vs=p.useCallback((Q,te)=>Y=>{j==null||j(Q.date,te,Y)},[j]),ft=p.useCallback(Q=>te=>{const Y=Number(te.target.value),ee=i.setMonth(i.startOfMonth(Q),Y);X(ee)},[i,X]),Ot=p.useCallback(Q=>te=>{const Y=Number(te.target.value),ee=i.setYear(i.startOfMonth(Q),Y);X(ee)},[i,X]),{className:ht,style:js}=p.useMemo(()=>({className:[d[ne.Root],s.className].filter(Boolean).join(" "),style:{...x==null?void 0:x[ne.Root],...s.style}}),[d,s.className,s.style,x]),xt=Fp(s),ws=p.useRef(null);lg(ws,!!s.animate,{classNames:d,months:O,focused:P,dateLib:i});const Gs={dayPickerProps:s,selected:U,select:K,isSelected:q,months:O,nextMonth:M,previousMonth:I,goToMonth:X,getModifiers:E,components:r,classNames:d,styles:x,labels:o,formatters:a};return y.createElement(Ll.Provider,{value:Gs},y.createElement(r.Root,{rootRef:s.animate?ws:void 0,className:ht,style:js,dir:s.dir,id:s.id,lang:s.lang,nonce:s.nonce,title:s.title,role:s.role,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"],...xt},y.createElement(r.Months,{className:d[ne.Months],style:x==null?void 0:x[ne.Months]},!s.hideNavigation&&!m&&y.createElement(r.Nav,{"data-animated-nav":s.animate?"true":void 0,className:d[ne.Nav],style:x==null?void 0:x[ne.Nav],"aria-label":Ut(),onPreviousClick:Qt,onNextClick:Et,previousMonth:I,nextMonth:M}),O.map((Q,te)=>y.createElement(r.Month,{"data-animated-month":s.animate?"true":void 0,className:d[ne.Month],style:x==null?void 0:x[ne.Month],key:te,displayIndex:te,calendarMonth:Q},m==="around"&&!s.hideNavigation&&te===0&&y.createElement(r.PreviousMonthButton,{type:"button",className:d[ne.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":Kt(I),onClick:Qt,"data-animated-button":s.animate?"true":void 0},y.createElement(r.Chevron,{disabled:I?void 0:!0,className:d[ne.Chevron],orientation:s.dir==="rtl"?"right":"left"})),y.createElement(r.MonthCaption,{"data-animated-caption":s.animate?"true":void 0,className:d[ne.MonthCaption],style:x==null?void 0:x[ne.MonthCaption],calendarMonth:Q,displayIndex:te},c!=null&&c.startsWith("dropdown")?y.createElement(r.DropdownNav,{className:d[ne.Dropdowns],style:x==null?void 0:x[ne.Dropdowns]},(()=>{const Y=c==="dropdown"||c==="dropdown-months"?y.createElement(r.MonthsDropdown,{key:"month",className:d[ne.MonthsDropdown],"aria-label":ie(),classNames:d,components:r,disabled:!!s.disableNavigation,onChange:ft(Q.date),options:eg(Q.date,L,Z,a,i),style:x==null?void 0:x[ne.Dropdown],value:i.getMonth(Q.date)}):y.createElement("span",{key:"month"},_(Q.date,i)),ee=c==="dropdown"||c==="dropdown-years"?y.createElement(r.YearsDropdown,{key:"year",className:d[ne.YearsDropdown],"aria-label":ut(i.options),classNames:d,components:r,disabled:!!s.disableNavigation,onChange:Ot(Q.date),options:ng(L,Z,a,i,!!s.reverseYears),style:x==null?void 0:x[ne.Dropdown],value:i.getYear(Q.date)}):y.createElement("span",{key:"year"},W(Q.date,i));return i.getMonthYearOrder()==="year-first"?[ee,Y]:[Y,ee]})(),y.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"}},w(Q.date,i.options,i))):y.createElement(r.CaptionLabel,{className:d[ne.CaptionLabel],role:"status","aria-live":"polite"},w(Q.date,i.options,i))),m==="around"&&!s.hideNavigation&&te===f-1&&y.createElement(r.NextMonthButton,{type:"button",className:d[ne.NextMonthButton],tabIndex:M?void 0:-1,"aria-disabled":M?void 0:!0,"aria-label":Vt(M),onClick:Et,"data-animated-button":s.animate?"true":void 0},y.createElement(r.Chevron,{disabled:M?void 0:!0,className:d[ne.Chevron],orientation:s.dir==="rtl"?"left":"right"})),te===f-1&&m==="after"&&!s.hideNavigation&&y.createElement(r.Nav,{"data-animated-nav":s.animate?"true":void 0,className:d[ne.Nav],style:x==null?void 0:x[ne.Nav],"aria-label":Ut(),onPreviousClick:Qt,onNextClick:Et,previousMonth:I,nextMonth:M}),y.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":Ht(Q.date,i.options,i)||void 0,className:d[ne.MonthGrid],style:x==null?void 0:x[ne.MonthGrid]},!s.hideWeekdays&&y.createElement(r.Weekdays,{"data-animated-weekdays":s.animate?"true":void 0,className:d[ne.Weekdays],style:x==null?void 0:x[ne.Weekdays]},S&&y.createElement(r.WeekNumberHeader,{"aria-label":rt(i.options),className:d[ne.WeekNumberHeader],style:x==null?void 0:x[ne.WeekNumberHeader],scope:"col"},z()),vs.map(Y=>y.createElement(r.Weekday,{"aria-label":Gt(Y,i.options,i),className:d[ne.Weekday],key:String(Y),style:x==null?void 0:x[ne.Weekday],scope:"col"},R(Y,i.options,i)))),y.createElement(r.Weeks,{"data-animated-weeks":s.animate?"true":void 0,className:d[ne.Weeks],style:x==null?void 0:x[ne.Weeks]},Q.weeks.map(Y=>y.createElement(r.Week,{className:d[ne.Week],key:Y.weekNumber,style:x==null?void 0:x[ne.Week],week:Y},S&&y.createElement(r.WeekNumber,{week:Y,style:x==null?void 0:x[ne.WeekNumber],"aria-label":Us(Y.weekNumber,{locale:l}),className:d[ne.WeekNumber],scope:"row",role:"rowheader"},A(Y.weekNumber,i)),Y.days.map(ee=>{const{date:pe}=ee,B=E(ee);if(B[Ee.focused]=!B.hidden&&!!(P!=null&&P.isEqualTo(ee)),B[ct.selected]=(q==null?void 0:q(pe))||B.selected,nr(U)){const{from:Ce,to:Me}=U;B[ct.range_start]=!!(Ce&&Me&&i.isSameDay(pe,Ce)),B[ct.range_end]=!!(Ce&&Me&&i.isSameDay(pe,Me)),B[ct.range_middle]=St(U,pe,!0,i)}const ue=tg(B,x,s.modifiersStyles),me=Rp(B,d,s.modifiersClassNames),Pe=!Be&&!B.hidden?Dt(pe,B,i.options,i):void 0;return y.createElement(r.Day,{key:`${ee.isoDate}_${ee.displayMonthId}`,day:ee,modifiers:B,className:me.join(" "),style:ue,role:"gridcell","aria-selected":B.selected||void 0,"aria-label":Pe,"data-day":ee.isoDate,"data-month":ee.outside?ee.dateMonthId:void 0,"data-selected":B.selected||void 0,"data-disabled":B.disabled||void 0,"data-hidden":B.hidden||void 0,"data-outside":ee.outside||void 0,"data-focused":B.focused||void 0,"data-today":B.today||void 0},!B.hidden&&Be?y.createElement(r.DayButton,{className:d[ne.DayButton],style:x==null?void 0:x[ne.DayButton],type:"button",day:ee,modifiers:B,disabled:!B.focused&&B.disabled||void 0,"aria-disabled":B.focused&&B.disabled||void 0,tabIndex:oe(ee)?0:-1,"aria-label":qe(pe,B,i.options,i),onClick:Ye(ee,B),onBlur:_t(ee,B),onFocus:mt(ee,B),onKeyDown:Ks(ee,B),onMouseEnter:Nt(ee,B),onMouseLeave:Vs(ee,B)},D(pe,i.options,i)):!B.hidden&&D(ee.date,i.options,i))})))))))),s.footer&&y.createElement(r.Footer,{className:d[ne.Footer],style:x==null?void 0:x[ne.Footer],role:"status","aria-live":"polite"},s.footer)))}function qt({className:e,classNames:s,showOutsideDays:n=!0,...r}){return t.jsx(Dg,{showOutsideDays:n,className:T("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",nav:"flex items-center gap-1",button_previous:T(Wn({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),button_next:T(Wn({variant:"outline"}),"absolute right-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),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:T(Wn({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",...s},components:{Chevron:({orientation:a})=>a==="left"?t.jsx(na,{className:"h-4 w-4"}):t.jsx(Ws,{className:"h-4 w-4"})},...r})}qt.displayName="Calendar";function Eg(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?le(new Date(e.start_date),"MMM d"):"—",n=e.end_date?le(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function ar({open:e,onClose:s,projectId:n,defaultStatus:r="backlog",defaultTaskListId:a,defaultParentId:o}){const i=Ve(),{workspace:l,projectKey:d}=Ke(),{workspace:c}=Se(),[u,m]=p.useState(""),[f,h]=p.useState(""),[g,v]=p.useState(r),[k,b]=p.useState("medium"),[j,N]=p.useState("task"),[C,S]=p.useState([]),[x,w]=p.useState(""),[D,_]=p.useState(a??""),[A,z]=p.useState(void 0),R=Rl(),{data:W}=Ls(n),{data:$}=Hs(n||void 0),{data:G}=En(n||void 0),O=($??[]).filter(M=>M.status!=="completed"),L=W&&W.length>0?Object.fromEntries(W.map(M=>[M.key,M.name])):us,Z=()=>{m(""),h(""),v(r),b("medium"),N("task"),S([]),w(""),_(a??""),z(void 0),s()},I=M=>{M.preventDefault(),u.trim()&&R.mutate({title:u.trim(),description:f.trim()||void 0,status:g,priority:k,type:j,project_id:n,workspace_id:c.id,assignee_ids:C.length>0?C:void 0,sprint_id:x||null,task_list_id:D||null,parent_id:o||null,due_date:A?le(A,"yyyy-MM-dd"):null},{onSuccess:()=>{F.success("Issue created"),Z()},onError:X=>F.error(X.message??"Failed to create issue")})};return t.jsx(ps,{open:e,onOpenChange:M=>!M&&Z(),children:t.jsxs(gs,{className:"max-w-md",children:[t.jsx(bs,{children:t.jsx(ys,{children:"New issue"})}),t.jsxs("form",{onSubmit:I,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Bs,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{htmlFor:"issue-title",children:"Title"}),t.jsx(xe,{id:"issue-title",placeholder:"Issue title",value:u,onChange:M=>m(M.target.value),autoFocus:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{htmlFor:"issue-desc",children:["Description ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(tr,{id:"issue-desc",placeholder:"Add more context...",value:f,onChange:M=>h(M.target.value)})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{children:"Status"}),t.jsxs(we,{value:g,onValueChange:v,children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(L).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{children:"Priority"}),t.jsxs(we,{value:k,onValueChange:b,children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(Mt).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{children:"Type"}),t.jsxs(we,{value:j,onValueChange:N,children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(zt).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]})]}),o&&t.jsx("div",{className:"rounded-md bg-muted/50 border border-border px-3 py-2 text-xs text-muted-foreground",children:"Will be created as a child issue"}),(G??[]).length>0&&!o&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{children:["List ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(we,{value:D||"none",onValueChange:M=>_(M==="none"?"":M),children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{placeholder:"No list"})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs",children:t.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(G??[]).map(M=>t.jsx(ce,{value:M.id,className:"text-xs",children:M.name},M.id))]})]})]}),O.length>0&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{children:["Sprint ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(we,{value:x||"none",onValueChange:M=>w(M==="none"?"":M),children:[t.jsx(ve,{className:"h-8 text-xs",children:t.jsx(Te,{placeholder:"No sprint"})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs",children:t.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),O.map(M=>{const X=Eg(M);return t.jsx(ce,{value:M.id,className:"text-xs",children:t.jsxs("div",{children:[t.jsx("span",{children:M.name}),X&&t.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:X})]})},M.id)})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{children:["Assignees ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsx(_n,{value:C,onChange:S})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{children:["Due Date ",t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),t.jsxs(lt,{children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(ls,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t.jsx("span",{className:A?"text-foreground":"text-muted-foreground",children:A?le(A,"MMM d, yyyy"):"No due date"}),A&&t.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),z(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(We,{className:"h-3.5 w-3.5"})})]})}),t.jsx(tt,{className:"w-auto p-0",align:"start",children:t.jsx(qt,{mode:"single",selected:A,onSelect:z,initialFocus:!0})})]})]})]}),t.jsxs(Sn,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[t.jsxs(V,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{Z(),i(`/${l}/projects/${d}/issues/new`)},children:[t.jsx(oa,{className:"h-3.5 w-3.5"}),"Open full form"]}),t.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[t.jsx(V,{type:"button",variant:"ghost",onClick:Z,children:"Cancel"}),t.jsx(V,{type:"submit",disabled:!u.trim()||R.isPending,children:R.isPending?"Creating...":"Create issue"})]})]})]})]})})}const $a={byIssue:e=>["attachments",e]};function ad(e){return Ne({queryKey:$a.byIssue(e),queryFn:()=>J.get(`/admin/issues/${e}/attachments`),select:s=>s.attachments,enabled:!!e})}function od(e){const s=he();return fe({mutationFn:({file:n,commentId:r})=>{const a=new FormData;return a.append("file",n),r&&a.append("comment_id",r),J.upload(`/admin/issues/${e}/attachments`,a)},onSuccess:()=>{s.invalidateQueries({queryKey:$a.byIssue(e)})}})}function _g(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/issues/${e}/attachments/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:$a.byIssue(e)})}})}function mn(e){return e.startsWith("image/")}function or(e){return e.startsWith("video/")}function ir(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Aa(e,s){const n=document.createElement("a");n.href=e,n.download=s,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Ra({mimeType:e,className:s}){return mn(e)?t.jsx(Wu,{className:s}):or(e)?t.jsx(Qn,{className:s}):e.startsWith("text/")||e.includes("json")?t.jsx(Fu,{className:s}):e.includes("zip")||e.includes("tar")||e.includes("gz")?t.jsx(Iu,{className:s}):e.includes("pdf")||e.includes("word")||e.includes("document")?t.jsx(zu,{className:s}):t.jsx(qu,{className:s})}function id({attachment:e,onClose:s}){return e?t.jsx(ps,{open:!0,onOpenChange:n=>!n&&s(),children:t.jsxs(gs,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[t.jsxs(bs,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[t.jsx(ys,{className:"text-sm font-medium truncate",children:e.original_name}),t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>Aa(e.url,e.original_name),children:[t.jsx(aa,{className:"h-3.5 w-3.5"}),"Download"]})]}),t.jsxs(Bs,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[mn(e.mime_type)&&t.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),or(e.mime_type)&&t.jsx("video",{src:e.url,controls:!0,className:"max-w-full max-h-[75vh]"})]}),t.jsxs("div",{className:"px-4 py-2 border-t border-border text-[11px] text-muted-foreground flex items-center gap-3 shrink-0",children:[t.jsx("span",{children:ir(e.size)}),t.jsx("span",{children:"·"}),t.jsx("span",{children:e.mime_type}),t.jsx("span",{children:"·"}),t.jsxs("span",{children:["Uploaded ",le(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function Og({attachment:e}){const[s,n]=p.useState(null),r=mn(e.mime_type)||or(e.mime_type),a=()=>{r?n(e):Aa(e.url,e.original_name)};return t.jsxs(t.Fragment,{children:[mn(e.mime_type)?t.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:t.jsx("img",{src:e.url,alt:e.original_name,className:"max-h-48 max-w-xs object-cover"})}):t.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:r?"View":"Download",children:[t.jsx(Ra,{mimeType:e.mime_type,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-xs text-foreground truncate",children:e.original_name}),t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:ir(e.size)}),!r&&t.jsx(aa,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),s&&t.jsx(id,{attachment:s,onClose:()=>n(null)})]})}function Tg({attachment:e,onOpen:s,onDelete:n,isDeleting:r}){const a=mn(e.mime_type)||or(e.mime_type),o=()=>{a?s(e):Aa(e.url,e.original_name)};return t.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[t.jsx("button",{type:"button",onClick:o,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:t.jsx(Ra,{mimeType:e.mime_type,className:"h-4 w-4"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("button",{type:"button",onClick:o,className:"text-xs font-medium text-foreground truncate block text-left w-full hover:underline",children:e.original_name}),t.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[t.jsx("span",{children:ir(e.size)}),t.jsx("span",{children:"·"}),t.jsx("span",{children:le(new Date(e.created_at),"MMM d, yyyy")}),e.comment_id&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"·"}),t.jsx("span",{className:"italic",children:"from comment"})]}),!a&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"·"}),t.jsxs("span",{className:"flex items-center gap-0.5",children:[t.jsx(aa,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),t.jsx(V,{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:()=>n(e.id),disabled:r,children:t.jsx(fs,{className:"h-3.5 w-3.5"})})]})}function Pg({onFiles:e,isUploading:s}){const[n,r]=p.useState(!1),a=p.useRef(null),o=p.useCallback(i=>{i.preventDefault(),r(!1);const l=Array.from(i.dataTransfer.files);l.length>0&&e(l)},[e]);return t.jsxs("div",{onDragOver:i=>{i.preventDefault(),r(!0)},onDragLeave:()=>r(!1),onDrop:o,onClick:()=>{var i;return!s&&((i=a.current)==null?void 0:i.click())},className:T("flex flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6","cursor-pointer transition-colors",n?"border-primary/60 bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30",s&&"opacity-60 cursor-wait"),children:[t.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted",children:t.jsx(am,{className:"h-4 w-4 text-muted-foreground"})}),t.jsx("p",{className:"text-xs font-medium text-foreground",children:s?"Uploading…":"Drop files or click to browse"}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to 50 MB per file"}),t.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:i=>{const l=Array.from(i.target.files??[]);l.length>0&&e(l),i.target.value=""}})]})}function $g({issueId:e,className:s}){const[n,r]=p.useState(null),{data:a,isLoading:o}=ad(e),i=od(e),l=_g(e),d=u=>{u.forEach(m=>{i.mutate({file:m},{onSuccess:()=>F.success(`${m.name} uploaded`),onError:()=>F.error(`Failed to upload ${m.name}`)})})},c=u=>{l.mutate(u,{onSuccess:()=>F.success("Attachment removed"),onError:()=>F.error("Failed to remove attachment")})};return t.jsxs("div",{className:T("px-6 py-4 space-y-4",s),children:[t.jsx(Pg,{onFiles:d,isUploading:i.isPending}),o?t.jsx("div",{className:"space-y-2",children:[1,2].map(u=>t.jsxs("div",{className:"flex items-center gap-3 px-3",children:[t.jsx(se,{className:"h-8 w-8 rounded-md shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(se,{className:"h-3 w-2/3"}),t.jsx(se,{className:"h-2.5 w-1/3"})]})]},u))}):a&&a.length>0?t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[t.jsx(qi,{className:"h-3 w-3 text-muted-foreground"}),t.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[a.length," ",a.length===1?"file":"files"]})]}),t.jsx("div",{children:a.map(u=>t.jsx(Tg,{attachment:u,onOpen:r,onDelete:c,isDeleting:l.isPending},u.id))})]}):t.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No attachments yet."}),t.jsx(id,{attachment:n,onClose:()=>r(null)})]})}const Bt={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function Ag(e){return Ne({queryKey:Bt.byIssue(e),queryFn:()=>J.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function Rg(e){return Ne({queryKey:Bt.activeTimer(e),queryFn:()=>J.get(`/admin/issues/${e}/time-logs/timer`),select:s=>s.active_timer,enabled:!!e,refetchInterval:1e4})}function Ig(e){const s=he();return fe({mutationFn:n=>J.post(`/admin/issues/${e}/time-logs`,n),onSuccess:()=>{s.invalidateQueries({queryKey:Bt.byIssue(e)})}})}function Fg(e){const s=he();return fe({mutationFn:()=>J.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{s.invalidateQueries({queryKey:Bt.activeTimer(e)}),s.invalidateQueries({queryKey:Bt.byIssue(e)})}})}function Wg(e){const s=he();return fe({mutationFn:()=>J.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{s.invalidateQueries({queryKey:Bt.activeTimer(e)}),s.invalidateQueries({queryKey:Bt.byIssue(e)})}})}function zg(e){const s=he();return fe({mutationFn:n=>J.delete(`/admin/issues/${e}/time-logs/${n}`),onSuccess:()=>{s.invalidateQueries({queryKey:Bt.byIssue(e)})}})}const qg=xn("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 lr({className:e,variant:s,...n}){return t.jsx("div",{className:T(qg({variant:s}),e),...n})}function Yr(e){const s=Math.floor(e/60),n=e%60;return s===0?`${n}m`:n===0?`${s}h`:`${s}h ${n}m`}function bo(e){const s=Date.now()-new Date(e).getTime(),n=Math.floor(s/1e3),r=Math.floor(n/3600),a=Math.floor(n%3600/60),o=n%60,i=String(a).padStart(2,"0"),l=String(o).padStart(2,"0");return r>0?`${r}:${i}:${l}`:`${i}:${l}`}function Bg({startedAt:e}){const[s,n]=p.useState(()=>bo(e));return p.useEffect(()=>{const r=setInterval(()=>n(bo(e)),1e3);return()=>clearInterval(r)},[e]),t.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:s})}function Yg({onSubmit:e,isPending:s,onCancel:n}){const[r,a]=p.useState(""),[o,i]=p.useState(""),[l,d]=p.useState(""),[c,u]=p.useState(new Date().toISOString().split("T")[0]),m=f=>{f.preventDefault();const h=parseInt(r||"0",10),g=parseInt(o||"0",10),v=h*60+g;if(v<=0){F.error("Please enter a duration greater than 0.");return}e({duration_minutes:v,description:l.trim()||void 0,logged_date:c||void 0})};return t.jsxs("form",{onSubmit:m,className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[t.jsx("p",{className:"text-xs font-medium text-foreground",children:"Log time manually"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Hours"}),t.jsx(xe,{type:"number",min:"0",max:"999",placeholder:"0",value:r,onChange:f=>a(f.target.value),className:"h-8 text-sm"})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Minutes"}),t.jsx(xe,{type:"number",min:"0",max:"59",placeholder:"0",value:o,onChange:f=>i(f.target.value),className:"h-8 text-sm"})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Date"}),t.jsx(xe,{type:"date",value:c,onChange:f=>u(f.target.value),className:"h-8 text-sm"})]})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:["Description ",t.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),t.jsx(xe,{placeholder:"What did you work on?",value:l,onChange:f=>d(f.target.value),className:"h-8 text-sm"})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"h-7 text-xs",children:"Cancel"}),t.jsx(V,{type:"submit",size:"sm",disabled:s,className:"h-7 text-xs",children:s?"Saving…":"Log time"})]})]})}function Lg({entry:e,onDelete:s,isDeleting:n}){const r=e.started_at!=null&&e.stopped_at==null;return t.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[t.jsx("div",{className:T("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",r?"bg-emerald-50 dark:bg-emerald-950/40":"bg-muted"),children:r?t.jsx(sm,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?t.jsx(Lt,{className:"h-3.5 w-3.5 text-muted-foreground"}):t.jsx(Au,{className:"h-3.5 w-3.5 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[r?t.jsx(Bg,{startedAt:e.started_at}):t.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:Yr(e.duration_minutes??0)}),t.jsx(lr,{variant:"muted",className:T("text-[10px] px-1.5 py-0",r?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":""),children:r?"Running":e.source==="timer"?"Timer":"Manual"})]}),e.description&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!r&&t.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:le(new Date(e.logged_date),"MMM d, yyyy")})]}),!r&&t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all mt-0.5",onClick:()=>s(e.id),disabled:n,children:t.jsx(fs,{className:"h-3.5 w-3.5"})})]})}function Hg({issueId:e,className:s}){const[n,r]=p.useState(!1),{data:a,isLoading:o}=Ag(e),{data:i}=Rg(e),l=Ig(e),d=Fg(e),c=Wg(e),u=zg(e),m=(a==null?void 0:a.time_logs)??[],f=(a==null?void 0:a.total_minutes)??0,h=i!=null,g=j=>{l.mutate(j,{onSuccess:()=>{r(!1),F.success("Time logged")},onError:()=>F.error("Failed to log time")})},v=()=>{d.mutate(void 0,{onSuccess:()=>F.success("Timer started"),onError:j=>F.error(j.message??"Failed to start timer")})},k=()=>{c.mutate(void 0,{onSuccess:j=>{const N=j.time_log.duration_minutes??0;F.success(`Timer stopped — ${Yr(N)} logged`)},onError:()=>F.error("Failed to stop timer")})},b=j=>{u.mutate(j,{onSuccess:()=>F.success("Time entry removed"),onError:()=>F.error("Failed to remove entry")})};return t.jsxs("div",{className:T("px-6 py-4 space-y-4",s),children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Total logged"}),t.jsx("p",{className:"text-xl font-bold text-foreground tabular-nums",children:f>0?Yr(f):"—"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[!n&&t.jsxs(V,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>r(!0),children:[t.jsx(Fe,{className:"h-3.5 w-3.5"}),"Log time"]}),h?t.jsxs(V,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:k,disabled:c.isPending,children:[t.jsx(Zu,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):t.jsxs(V,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:v,disabled:d.isPending,children:[t.jsx(Qn,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),n&&t.jsx(Yg,{onSubmit:g,isPending:l.isPending,onCancel:()=>r(!1)}),o?t.jsx("div",{className:"space-y-2",children:[1,2].map(j=>t.jsxs("div",{className:"flex items-center gap-3 px-3",children:[t.jsx(se,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(se,{className:"h-3 w-1/3"}),t.jsx(se,{className:"h-2.5 w-1/4"})]})]},j))}):m.length>0?t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[t.jsx(Lt,{className:"h-3 w-3 text-muted-foreground"}),t.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[m.length," ",m.length===1?"entry":"entries"]})]}),t.jsx("div",{children:m.map(j=>t.jsx(Lg,{entry:j,onDelete:b,isDeleting:u.isPending},j.id))})]}):t.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function Jt({onClick:e,active:s,title:n,children:r}){return t.jsx("button",{type:"button",title:n,onMouseDown:a=>{a.preventDefault(),e()},className:T("flex h-6 w-6 items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted",s&&"bg-muted text-foreground"),children:r})}function yo(){return t.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}function ld({issueId:e,compact:s,className:n,onSuccess:r}){var w,D;const[a,o]=p.useState(!0),[i,l]=p.useState([]),[d,c]=p.useState(!1),u=p.useRef(null),m=p.useRef(async()=>{}),{user:f}=Se(),h=Rx(e),g=od(e),v=f&&`${((w=f.first_name)==null?void 0:w[0])??""}${((D=f.last_name)==null?void 0:D[0])??""}`.toUpperCase()||"?",k=p.useMemo(()=>Ld.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(m.current(),!0)}}}),[]),b=ri({extensions:[ai,oi,ii.configure({placeholder:"Leave a comment…"}),k],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:_}){o(_.isEmpty)}}),j=!a||i.length>0,N=_=>{l(A=>{const z=new Set(A.map(R=>`${R.name}-${R.size}`));return[...A,..._.filter(R=>!z.has(`${R.name}-${R.size}`))]})},C=_=>{l(A=>A.filter((z,R)=>R!==_))},S=async()=>{if(!(!j||d)){c(!0);try{const _=b!=null&&b.isEmpty?"":(b==null?void 0:b.getHTML())??"",z=(await h.mutateAsync(_||" ")).comment.id;for(const R of i)await g.mutateAsync({file:R,commentId:z});b==null||b.commands.clearContent(),o(!0),l([]),F.success("Comment added"),r==null||r()}catch{F.error("Failed to add comment")}finally{c(!1)}}};m.current=S;const x="h-3 w-3";return t.jsxs("div",{className:T("flex gap-3 items-start",n),children:[t.jsx(st,{className:"h-7 w-7 shrink-0 mt-1",children:t.jsx(nt,{className:"text-[11px] bg-muted text-muted-foreground",children:v})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:T("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[b&&t.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border/70 bg-muted/30",children:[t.jsx(Jt,{title:"Bold (⌘B)",active:b.isActive("bold"),onClick:()=>b.chain().focus().toggleBold().run(),children:t.jsx(Ci,{className:x})}),t.jsx(Jt,{title:"Italic (⌘I)",active:b.isActive("italic"),onClick:()=>b.chain().focus().toggleItalic().run(),children:t.jsx(Ri,{className:x})}),t.jsx(Jt,{title:"Strikethrough",active:b.isActive("strike"),onClick:()=>b.chain().focus().toggleStrike().run(),children:t.jsx(Li,{className:x})}),t.jsx(Jt,{title:"Inline code",active:b.isActive("code"),onClick:()=>b.chain().focus().toggleCode().run(),children:t.jsx(Pi,{className:x})}),t.jsx(yo,{}),t.jsx(Jt,{title:"Bullet list",active:b.isActive("bulletList"),onClick:()=>b.chain().focus().toggleBulletList().run(),children:t.jsx(Wi,{className:x})}),t.jsx(Jt,{title:"Ordered list",active:b.isActive("orderedList"),onClick:()=>b.chain().focus().toggleOrderedList().run(),children:t.jsx(Fi,{className:x})}),t.jsx(yo,{}),t.jsx(Jt,{title:"Code block",active:b.isActive("codeBlock"),onClick:()=>b.chain().focus().toggleCodeBlock().run(),children:t.jsx(Ti,{className:x})})]}),t.jsx(li,{editor:b,className:T("px-3 py-2.5 text-sm",s?"min-h-[68px]":"min-h-[80px]")})]}),i.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:i.map((_,A)=>t.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:[t.jsx(Ra,{mimeType:_.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",children:_.name}),t.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",ir(_.size),")"]}),t.jsx("button",{type:"button",onClick:()=>C(A),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:t.jsx(We,{className:"h-3 w-3"})})]},A))}),t.jsxs("div",{className:"flex items-center justify-between mt-2",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var _;return(_=u.current)==null?void 0:_.click()},disabled:d,title:"Attach files",children:t.jsx(qi,{className:"h-3.5 w-3.5"})}),t.jsxs("span",{className:"text-[11px] text-muted-foreground/50 hidden sm:block",children:[t.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})]}),t.jsx(V,{size:"icon",className:"h-8 w-8",onClick:S,disabled:!j||d,children:t.jsx(Ju,{className:"h-3.5 w-3.5"})})]}),t.jsx("input",{ref:u,type:"file",multiple:!0,className:"hidden",onChange:_=>{const A=Array.from(_.target.files??[]);A.length>0&&N(A),_.target.value=""}})]})]})}function Ug({onClick:e,active:s,disabled:n,title:r,children:a}){return t.jsx("button",{type:"button",title:r,disabled:n,onMouseDown:o=>{o.preventDefault(),e()},className:T("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",s&&"bg-muted text-foreground"),children:a})}function In(){return t.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function Ia({content:e="",onChange:s,placeholder:n="Add a description…",className:r,toolbarClassName:a,editorClassName:o}){const i=ri({extensions:[ai.configure({heading:{levels:[1,2,3]}}),oi,Hd,Ud.configure({nested:!0}),ii.configure({placeholder:n})],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:c}){s&&s(c.isEmpty?"":c.getHTML())}});if(!i)return null;const l=(c,u,m,f,h)=>t.jsx(Ug,{title:c,onClick:m,active:f,disabled:h,children:u},c),d="h-3.5 w-3.5";return t.jsxs("div",{className:T("flex flex-col overflow-hidden",r),children:[t.jsxs("div",{className:T("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",a),children:[l("Undo",t.jsx(rm,{className:d}),()=>i.chain().focus().undo().run(),!1,!i.can().undo()),l("Redo",t.jsx(Xu,{className:d}),()=>i.chain().focus().redo().run(),!1,!i.can().redo()),t.jsx(In,{}),l("Bold (⌘B)",t.jsx(Ci,{className:d}),()=>i.chain().focus().toggleBold().run(),i.isActive("bold")),l("Italic (⌘I)",t.jsx(Ri,{className:d}),()=>i.chain().focus().toggleItalic().run(),i.isActive("italic")),l("Underline (⌘U)",t.jsx(nm,{className:d}),()=>i.chain().focus().toggleUnderline().run(),i.isActive("underline")),l("Strikethrough",t.jsx(Li,{className:d}),()=>i.chain().focus().toggleStrike().run(),i.isActive("strike")),l("Inline code",t.jsx(Pi,{className:d}),()=>i.chain().focus().toggleCode().run(),i.isActive("code")),t.jsx(In,{}),l("Heading 1",t.jsx(Bu,{className:d}),()=>i.chain().focus().toggleHeading({level:1}).run(),i.isActive("heading",{level:1})),l("Heading 2",t.jsx(Yu,{className:d}),()=>i.chain().focus().toggleHeading({level:2}).run(),i.isActive("heading",{level:2})),l("Heading 3",t.jsx(Lu,{className:d}),()=>i.chain().focus().toggleHeading({level:3}).run(),i.isActive("heading",{level:3})),t.jsx(In,{}),l("Bullet list",t.jsx(Wi,{className:d}),()=>i.chain().focus().toggleBulletList().run(),i.isActive("bulletList")),l("Ordered list",t.jsx(Fi,{className:d}),()=>i.chain().focus().toggleOrderedList().run(),i.isActive("orderedList")),l("Task list",t.jsx(Hu,{className:d}),()=>i.chain().focus().toggleTaskList().run(),i.isActive("taskList")),t.jsx(In,{}),l("Blockquote",t.jsx(Qu,{className:d}),()=>i.chain().focus().toggleBlockquote().run(),i.isActive("blockquote")),l("Code block",t.jsx(Ti,{className:d}),()=>i.chain().focus().toggleCodeBlock().run(),i.isActive("codeBlock")),l("Divider line",t.jsx(bn,{className:d}),()=>i.chain().focus().setHorizontalRule().run())]}),t.jsx(li,{editor:i,className:T("flex-1 px-5 py-4",o)})]})}function Fa({html:e,className:s}){return e?t.jsx("div",{className:T("meridian-editor",s),dangerouslySetInnerHTML:{__html:e}}):null}function Kg({body:e}){const s=e.trim();return s?/^<[a-z][\s\S]*>/i.test(s)?t.jsx(Fa,{html:s,className:"text-xs"}):t.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:s}):null}const vo={created:{icon:Fe,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:sa,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:yn,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:om,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:Gn,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function Vg(e,s){var a,o,i,l;const{action:n,changes:r}=e;if(n==="created")return"created this issue";if(n==="status_changed"){const d=(a=r==null?void 0:r.status)==null?void 0:a.from,c=(o=r==null?void 0:r.status)==null?void 0:o.to;return t.jsxs(t.Fragment,{children:["changed status",d&&t.jsxs(t.Fragment,{children:[" from ",t.jsx("strong",{className:"font-medium text-foreground",children:us[d]??d})]}),c&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:us[c]??c})]})]})}if(n==="assigned"||n==="unassigned"){const d=((i=r==null?void 0:r.assignee_ids)==null?void 0:i.to)??[],c=((l=r==null?void 0:r.assignee_ids)==null?void 0:l.from)??[],u=d.filter(h=>!c.includes(h)),m=c.filter(h=>!d.includes(h)),f=h=>{var g;return((g=s==null?void 0:s.get(h))==null?void 0:g.name)??h.slice(0,8)+"…"};return u.length>0&&m.length>0?t.jsx(t.Fragment,{children:"updated assignees"}):u.length>0?t.jsxs(t.Fragment,{children:["assigned ",t.jsx("strong",{className:"font-medium text-foreground",children:u.map(f).join(", ")})]}):m.length>0?t.jsxs(t.Fragment,{children:["unassigned ",t.jsx("strong",{className:"font-medium text-foreground",children:m.map(f).join(", ")})]}):"updated assignees"}if(n==="updated"&&r){const d=[];for(const[c,u]of Object.entries(r)){const{from:m,to:f}=u;c==="title"||c==="description"?d.push(t.jsxs("span",{children:["updated ",t.jsx("strong",{className:"font-medium text-foreground",children:c})]},c)):c==="priority"?d.push(t.jsxs("span",{children:["changed ",t.jsx("strong",{className:"font-medium text-foreground",children:"priority"}),m!=null&&t.jsxs(t.Fragment,{children:[" from ",t.jsx("strong",{className:"font-medium text-foreground",children:Mt[m]??String(m)})]}),f!=null&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:Mt[f]??String(f)})]})]},c)):c==="type"?d.push(t.jsxs("span",{children:["changed ",t.jsx("strong",{className:"font-medium text-foreground",children:"type"}),m!=null&&t.jsxs(t.Fragment,{children:[" from ",t.jsx("strong",{className:"font-medium text-foreground",children:zt[m]??String(m)})]}),f!=null&&t.jsxs(t.Fragment,{children:[" to ",t.jsx("strong",{className:"font-medium text-foreground",children:zt[f]??String(f)})]})]},c)):d.push(t.jsxs("span",{children:["updated ",t.jsx("strong",{className:"font-medium text-foreground",children:c.replace(/_/g," ")})]},c))}return d.length===0?"made changes":t.jsx(t.Fragment,{children:d.reduce((c,u,m)=>m===0?[u]:[...c,t.jsx("span",{children:" and "},`sep-${m}`),u],[])})}return n.replace(/_/g," ")}function dd({issueId:e,className:s,compact:n,onViewMore:r,onTabChange:a,hideCommentInput:o}){const[i,l]=p.useState("comments"),d=b=>{l(b),a==null||a(b)},{user:c}=Se(),{data:u}=Il(),{data:m,isLoading:f}=$x(e),{data:h,isLoading:g}=Ax(e),{data:v}=ad(e),k=b=>{var j;if(c&&b===c.id){const N=c.first_name??"",C=c.last_name??"",S=`${N} ${C}`.trim()||c.email,x=(N[0]??C[0]??((j=c.email)==null?void 0:j[0])??"U").toUpperCase();return{name:S,initials:x}}return(u==null?void 0:u.get(b))??{name:"Unknown",initials:"?"}};return t.jsxs("div",{className:s,children:[t.jsx("div",{className:"flex items-center gap-0.5 px-6 pt-4 pb-2 flex-wrap",children:["comments","activity","attachments","time"].map(b=>{const j=b==="comments"?(m==null?void 0:m.length)??0:b==="activity"?(h==null?void 0:h.length)??0:void 0,N=b==="comments"?"Comments":b==="activity"?"Activity":b==="attachments"?"Attachments":"Time";return t.jsxs("button",{onClick:()=>d(b),className:T("px-3 py-1.5 text-xs font-medium rounded-md transition-colors",i===b?"bg-foreground/5 text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[N,j!=null&&j>0&&t.jsx("span",{className:"ml-1.5 text-[10px] tabular-nums text-muted-foreground",children:j})]},b)})}),i==="comments"&&t.jsxs("div",{className:"px-6 pb-5",children:[t.jsx("div",{className:"space-y-5 mb-5",children:f?t.jsxs("div",{className:"flex gap-3",children:[t.jsx(se,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsx(se,{className:"h-16 flex-1"})]}):m&&m.length>0?(n?m.slice(-5):m).map(b=>{const j=k(b.author_id),N=(v??[]).filter(C=>C.comment_id===b.id);return t.jsxs("div",{className:"flex gap-3",children:[t.jsx(st,{className:"h-7 w-7 mt-0.5 shrink-0",children:t.jsx(nt,{className:"text-[11px] bg-muted text-muted-foreground",children:j.initials})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[t.jsx("span",{className:"text-xs font-medium text-foreground",children:j.name}),t.jsx("span",{className:"text-[11px] text-muted-foreground",children:le(new Date(b.created_at),"MMM d, h:mm a")})]}),t.jsx(Kg,{body:b.body}),N.length>0&&t.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:N.map(C=>t.jsx(Og,{attachment:C},C.id))})]})]},b.id)}):t.jsx("p",{className:"text-sm text-muted-foreground/50 py-2",children:"No comments yet."})}),n&&m&&m.length>5&&r&&t.jsxs("button",{onClick:r,className:"text-xs text-muted-foreground hover:text-foreground mb-4 underline underline-offset-2",children:["View all ",m.length," comments"]}),!o&&t.jsx(ld,{issueId:e})]}),i==="activity"&&t.jsx("div",{className:"px-6 pb-6",children:g?t.jsx("div",{className:"space-y-4 pt-1",children:[1,2,3].map(b=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(se,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),t.jsx(se,{className:"h-4 flex-1 mt-1"})]},b))}):h&&h.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-border"}),t.jsx("div",{className:"space-y-0",children:(n?h.slice(-5):h).map((b,j,N)=>{var D;const C=vo[b.action]??vo.updated,S=C.icon,x=((D=u==null?void 0:u.get(b.actor_id))==null?void 0:D.name)??"System",w=j===N.length-1;return t.jsxs("div",{className:T("relative flex gap-3",w?"pb-0":"pb-4"),children:[t.jsx("div",{className:T("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",C.bg),children:t.jsx(S,{className:T("h-3 w-3",C.color)})}),t.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[t.jsxs("p",{className:"text-xs text-foreground leading-relaxed",children:[t.jsx("span",{className:"font-medium",children:x})," ",t.jsx("span",{className:"text-muted-foreground",children:Vg(b,u)})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:le(new Date(b.created_at),"MMM d, yyyy · h:mm a")})]})]},b.id)})})]}),n&&h.length>5&&r&&t.jsxs("button",{onClick:r,className:"text-xs text-muted-foreground hover:text-foreground mt-3 underline underline-offset-2",children:["View all ",h.length," events"]})]}):t.jsx("p",{className:"text-sm text-muted-foreground/50 py-2",children:"No activity yet."})}),i==="attachments"&&t.jsx($g,{issueId:e}),i==="time"&&t.jsx(Hg,{issueId:e})]})}const cd=p.forwardRef(({className:e,children:s,...n},r)=>t.jsxs(Xo,{ref:r,className:T("relative overflow-hidden",e),...n,children:[t.jsx(Id,{className:"h-full w-full rounded-[inherit]",children:s}),t.jsx(ud,{}),t.jsx(Fd,{})]}));cd.displayName=Xo.displayName;const ud=p.forwardRef(({className:e,orientation:s="vertical",...n},r)=>t.jsx(Jo,{ref:r,orientation:s,className:T("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(Wd,{className:"relative flex-1 rounded-full bg-border"})}));ud.displayName=Jo.displayName;function Gg(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?le(new Date(e.start_date),"MMM d"):"—",n=e.end_date?le(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function md({issue:e,projectId:s,open:n,onClose:r}){const a=Ve(),{workspace:o,projectKey:i}=Ke(),[l,d]=p.useState(!1),[c,u]=p.useState(""),[m,f]=p.useState(""),[h,g]=p.useState("comments"),[v,k]=p.useState(!1),b=Ca((e==null?void 0:e.id)??"",s),{data:j}=Ls(s),{data:N}=Hs(s||void 0),{data:C}=En(s||void 0),{data:S}=Dn(s||void 0),x=(N??[]).filter(M=>M.status!=="completed"),w=e!=null&&e.parent_id?S==null?void 0:S.find(M=>M.id===e.parent_id):null,D=(S==null?void 0:S.filter(M=>M.parent_id===(e==null?void 0:e.id)))??[],_=e!=null&&e.task_list_id?C==null?void 0:C.find(M=>M.id===e.task_list_id):null,A=j&&j.length>0?Object.fromEntries(j.map(M=>[M.key,M.name])):us;if(p.useEffect(()=>{e&&(u(e.title),f(e.description??"")),d(!1)},[e==null?void 0:e.id]),!e)return null;const z=()=>{c.trim()&&b.mutate({title:c.trim(),description:m.trim()||void 0},{onSuccess:()=>{d(!1),F.success("Issue updated")},onError:()=>F.error("Failed to update issue")})},R=()=>{u(e.title),f(e.description??""),d(!1)},W=M=>{b.mutate({status:M},{onSuccess:()=>F.success("Status updated"),onError:()=>F.error("Failed to update status")})},$=M=>{b.mutate({priority:M},{onSuccess:()=>F.success("Priority updated"),onError:()=>F.error("Failed to update priority")})},G=M=>{b.mutate({type:M},{onSuccess:()=>F.success("Type updated"),onError:()=>F.error("Failed to update type")})},O=M=>{b.mutate({assignee_ids:M},{onSuccess:()=>F.success("Assignees updated"),onError:()=>F.error("Failed to update assignees")})},L=M=>{b.mutate({sprint_id:M},{onSuccess:()=>F.success(M?"Sprint assigned":"Removed from sprint"),onError:()=>F.error("Failed to update sprint")})},Z=M=>{b.mutate({task_list_id:M},{onSuccess:()=>F.success(M?"Moved to list":"Removed from list"),onError:()=>F.error("Failed to update list")})},I=M=>{b.mutate({due_date:M?le(M,"yyyy-MM-dd"):null},{onSuccess:()=>F.success(M?"Due date set":"Due date cleared"),onError:()=>F.error("Failed to update due date")})};return t.jsxs(t.Fragment,{children:[t.jsx(ps,{open:n,onOpenChange:M=>!M&&r(),children:t.jsxs(gs,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden [&>button]:right-4",children:[t.jsxs(bs,{className:"pr-10",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:e.identifier}),t.jsx(lr,{variant:"muted",className:"text-[10px]",children:zt[e.type]??e.type})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>{r(),a(`/${o}/projects/${i}/issues/${e.id}`)},children:[t.jsx(oa,{className:"h-3.5 w-3.5"}),"Open"]}),l?t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground",onClick:R,children:[t.jsx(We,{className:"h-3.5 w-3.5"}),"Cancel"]}),t.jsxs(V,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:z,disabled:!c.trim()||b.isPending,children:[t.jsx(gt,{className:"h-3.5 w-3.5"}),"Save"]})]}):t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>d(!0),children:[t.jsx(Gn,{className:"h-3.5 w-3.5"}),"Edit"]})]})]}),l?t.jsx(xe,{value:c,onChange:M=>u(M.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):t.jsx(ys,{className:"text-base font-medium leading-snug text-left",children:e.title})]}),t.jsxs(cd,{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"px-6 py-4 space-y-5 min-w-0",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-1",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Status"}),t.jsxs(we,{value:e.status,onValueChange:W,children:[t.jsx(ve,{className:"h-8 text-xs bg-transparent min-w-0",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(A).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Priority"}),t.jsxs(we,{value:e.priority,onValueChange:$,children:[t.jsx(ve,{className:"h-8 text-xs bg-transparent min-w-0",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(Mt).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Type"}),t.jsxs(we,{value:e.type,onValueChange:G,children:[t.jsx(ve,{className:"h-8 text-xs bg-transparent min-w-0",children:t.jsx(Te,{})}),t.jsx(je,{children:Object.entries(zt).map(([M,X])=>t.jsx(ce,{value:M,className:"text-xs",children:X},M))})]})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Assignees"}),t.jsx(_n,{value:e.assignee_ids??[],onChange:O,disabled:b.isPending})]}),t.jsxs("div",{className:"flex gap-3 items-start min-w-0",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Sprint"}),t.jsxs(we,{value:e.sprint_id??"none",onValueChange:M=>L(M==="none"?null:M),children:[t.jsx(ve,{className:"h-8 text-xs bg-transparent min-w-0",children:t.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[t.jsx(vt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Te,{placeholder:"No sprint"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),x.map(M=>{const X=Gg(M);return t.jsx(ce,{value:M.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:M.name}),X&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:X})]})},M.id)})]})]})]}),(C??[]).length>0&&t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"List"}),t.jsxs(we,{value:e.task_list_id??"none",onValueChange:M=>Z(M==="none"?null:M),children:[t.jsx(ve,{className:"h-8 text-xs bg-transparent min-w-0",children:t.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[t.jsx(la,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Te,{placeholder:"No list",children:_?_.name:"No list"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(C??[]).map(M=>t.jsx(ce,{value:M.id,className:"text-xs",children:M.name},M.id))]})]})]}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Due Date"}),t.jsxs(lt,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs bg-transparent hover:bg-accent transition-colors overflow-hidden",children:[t.jsx(ls,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:`truncate ${e.due_date?"text-foreground":"text-muted-foreground"}`,children:e.due_date?le(new Date(e.due_date),"MMM d, yyyy"):"No date"})]})}),t.jsxs(tt,{className:"w-auto p-0",align:"start",children:[t.jsx(qt,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:I,initialFocus:!0}),e.due_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>I(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),!e.parent_id&&t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:"Child Issues"}),t.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Fe,{className:"h-3 w-3"}),"Add"]})]}),w&&t.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.jsx(ra,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-muted-foreground shrink-0",children:"Parent:"}),t.jsx("button",{onClick:()=>a(`/${o}/projects/${i}/issues/${w.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:w.identifier}),t.jsx("span",{className:"text-foreground truncate",children:w.title})]}),D.length===0&&!w?t.jsx("p",{className:"text-xs text-muted-foreground/40 italic",children:"No child issues yet"}):t.jsx("div",{className:"space-y-1",children:D.map(M=>t.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.jsx($i,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("button",{onClick:()=>{r(),a(`/${o}/projects/${i}/issues/${M.id}`)},className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:M.identifier}),t.jsx("button",{onClick:()=>{r(),a(`/${o}/projects/${i}/issues/${M.id}`)},className:"text-muted-foreground truncate hover:text-foreground transition-colors text-left",children:M.title})]},M.id))})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Description"}),l?t.jsx(Ia,{content:m,onChange:f,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input"},`${e.id}-edit`):e.description?t.jsx(Fa,{html:e.description,className:"text-sm"}):t.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})]})]}),t.jsx(dd,{issueId:e.id,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:g,onViewMore:()=>{r(),a(`/${o}/projects/${i}/issues/${e.id}`)}})]}),h==="comments"&&t.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:t.jsx(ld,{issueId:e.id,compact:!0})})]})}),t.jsx(ar,{open:v,onClose:()=>k(!1),projectId:s,defaultParentId:e.id,defaultTaskListId:e.task_list_id})]})}function Qg(){const{projectKey:e}=Ke(),[s,n]=p.useState(null),[r,a]=p.useState(!1),{data:o}=hs(e??""),i=(o==null?void 0:o.id)??"",{data:l,isLoading:d}=Dn(i||void 0),{data:c,isLoading:u}=Ls(i||void 0),m=Fx(i);if(!e)return null;const f=d||u||!o,h=g=>{m.mutate(g)};return t.jsxs("div",{className:"flex flex-col h-full gap-0",children:[t.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[t.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border shrink-0",children:t.jsxs(V,{size:"sm",onClick:()=>a(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Create"]})}),t.jsx("div",{className:"flex-1 min-h-0",children:f?t.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(g=>t.jsxs("div",{className:"min-w-[260px]",children:[t.jsx(se,{className:"h-5 w-24 mb-3 rounded"}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(se,{className:"h-[82px] w-full rounded-lg"}),t.jsx(se,{className:"h-[82px] w-full rounded-lg"})]})]},g))}):t.jsx(Kx,{issues:l??[],projectId:i,statuses:c??[],onIssueClick:n,onColumnsReorder:h})})]}),t.jsx(md,{issue:s,projectId:i,open:!!s,onClose:()=>n(null)}),t.jsx(ar,{open:r,onClose:()=>a(!1),projectId:i})]})}const jo=({priority:e,className:s})=>{const n=T("h-3.5 w-3.5 shrink-0",Fl[e],s);switch(e){case"urgent":return t.jsx(vn,{className:n});case"high":return t.jsx(Un,{className:n});case"medium":return t.jsx(bn,{className:n});case"low":return t.jsx(Hn,{className:n});default:return t.jsx(yt,{className:T("h-3.5 w-3.5 shrink-0 text-zinc-300",s)})}};function fd({issue:e,projectId:s,statuses:n,statusLabels:r,statusColorMap:a,sprints:o,workspace:i,projectKey:l,onOpen:d,isChild:c=!1,children:u=[],onAddChild:m}){const f=Ve(),[h,g]=p.useState(null),[v,k]=p.useState(!1),b=Ca(e.id,s);function j(x){b.mutate(x),g(null)}const N=(a==null?void 0:a[e.status])??"#94a3b8",C=o.find(x=>x.id===e.sprint_id),S=u.length>0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{onClick:()=>d(e),className:T("group grid grid-cols-[70px_1fr_150px_120px_130px_140px_130px_32px] items-center px-6 py-3","hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",c&&"pl-14 bg-muted/10",b.isPending&&"opacity-70"),children:[t.jsx("span",{className:T("text-xs font-mono text-muted-foreground truncate",c&&"text-muted-foreground/60"),children:e.identifier}),t.jsxs("div",{className:"flex items-center gap-1 min-w-0 pr-3",children:[!c&&S&&t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsx("button",{onClick:x=>{x.stopPropagation(),k(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?t.jsx(Fs,{className:"h-3.5 w-3.5"}):t.jsx(Ws,{className:"h-3.5 w-3.5"})})}),t.jsx(Ft,{side:"top",children:v?"Collapse":"Expand"})]}),!c&&!S&&t.jsx("span",{className:"w-4 shrink-0"}),c&&t.jsx("span",{className:"text-muted-foreground/40 shrink-0 text-xs",children:"↳"}),t.jsx("span",{className:T("text-sm text-foreground truncate",c&&"text-muted-foreground"),children:e.title}),!c&&S&&t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground/60 ml-1 font-mono",children:u.length})]}),t.jsx("div",{onClick:x=>x.stopPropagation(),children:t.jsxs(lt,{open:h==="status",onOpenChange:x=>g(x?"status":null),children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:N}}),t.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]})}),t.jsx(tt,{className:"w-52 p-1",align:"start",onClick:x=>x.stopPropagation(),children:t.jsx(_s,{children:t.jsx(Os,{children:t.jsx(is,{children:n.map(x=>t.jsxs(it,{value:x.name,onSelect:()=>j({status:x.key}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:x.color}}),t.jsx("span",{className:"text-xs flex-1",children:x.name}),e.status===x.key&&t.jsx(gt,{className:"h-3.5 w-3.5 text-indigo-500"})]},x.key))})})})})]})}),t.jsx("div",{onClick:x=>x.stopPropagation(),children:t.jsxs(lt,{open:h==="priority",onOpenChange:x=>g(x?"priority":null),children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(jo,{priority:e.priority}),t.jsx("span",{className:"text-xs text-muted-foreground",children:Mt[e.priority]??e.priority})]})}),t.jsx(tt,{className:"w-44 p-1",align:"start",onClick:x=>x.stopPropagation(),children:t.jsx(_s,{children:t.jsx(Os,{children:t.jsx(is,{children:Object.entries(Mt).map(([x,w])=>t.jsxs(it,{value:w,onSelect:()=>j({priority:x}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx(jo,{priority:x}),t.jsx("span",{className:"text-xs flex-1",children:w}),e.priority===x&&t.jsx(gt,{className:"h-3.5 w-3.5 text-indigo-500"})]},x))})})})})]})}),t.jsx("div",{onClick:x=>x.stopPropagation(),children:t.jsxs(lt,{open:h==="sprint",onOpenChange:x=>g(x?"sprint":null),children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(vt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("span",{className:T("text-xs truncate",C?"text-foreground":"text-muted-foreground"),children:(C==null?void 0:C.name)??"No sprint"})]})}),t.jsx(tt,{className:"w-56 p-1",align:"start",onClick:x=>x.stopPropagation(),children:t.jsx(_s,{children:t.jsx(Os,{children:t.jsxs(is,{children:[t.jsxs(it,{value:"no-sprint",onSelect:()=>j({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsx("span",{className:"text-xs flex-1 text-muted-foreground",children:"No sprint"}),!e.sprint_id&&t.jsx(gt,{className:"h-3.5 w-3.5 text-indigo-500"})]}),o.filter(x=>x.status!=="completed").map(x=>t.jsxs(it,{value:x.name,onSelect:()=>j({sprint_id:x.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[t.jsx(vt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs truncate",children:x.name}),(x.start_date||x.end_date)&&t.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[x.start_date?le(new Date(x.start_date),"MMM d"):"—"," → ",x.end_date?le(new Date(x.end_date),"MMM d"):"—"]})]}),e.sprint_id===x.id&&t.jsx(gt,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},x.id))]})})})})]})}),t.jsx("div",{onClick:x=>x.stopPropagation(),children:t.jsxs(lt,{open:h==="due",onOpenChange:x=>g(x?"due":null),children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(ls,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("span",{className:T("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?le(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),t.jsxs(tt,{className:"w-auto p-0",align:"start",onClick:x=>x.stopPropagation(),children:[t.jsx(qt,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:x=>j({due_date:x?le(x,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>j({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),t.jsx("div",{onClick:x=>x.stopPropagation(),children:t.jsx(_n,{value:e.assignee_ids??[],onChange:x=>b.mutate({assignee_ids:x})})}),t.jsxs("div",{className:"flex items-center gap-1",onClick:x=>x.stopPropagation(),children:[!c&&m&&t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsx("button",{onClick:()=>m(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:t.jsx(Uu,{className:"h-3.5 w-3.5"})})}),t.jsx(Ft,{side:"top",children:"Add child issue"})]}),t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsx("button",{onClick:()=>f(`/${i}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:t.jsx(oa,{className:"h-3.5 w-3.5"})})}),t.jsx(Ft,{side:"top",children:"Open full page"})]})]})]}),!c&&v&&u.map(x=>t.jsx(fd,{issue:x,projectId:s,statuses:n,statusLabels:r,statusColorMap:a,sprints:o,workspace:i,projectKey:l,onOpen:d,isChild:!0},x.id))]})}function wo({taskList:e,issues:s,childrenMap:n,projectId:r,statuses:a,statusLabels:o,statusColorMap:i,sprints:l,workspace:d,projectKey:c,onOpen:u,onAddIssue:m,onAddChild:f,onRenameList:h,onDeleteList:g}){const[v,k]=p.useState(!1),[b,j]=p.useState(!1),[N,C]=p.useState((e==null?void 0:e.name)??""),S=s.reduce((D,_)=>{var A;return D+(((A=n[_.id])==null?void 0:A.length)??0)},0),x=s.length+S,w=()=>{e&&N.trim()&&h&&h(e.id,N.trim()),j(!1)};return t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border group/header",children:[t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsx("button",{onClick:()=>k(!v),className:"text-muted-foreground hover:text-foreground transition-colors",children:v?t.jsx(Ws,{className:"h-3.5 w-3.5"}):t.jsx(Fs,{className:"h-3.5 w-3.5"})})}),t.jsx(Ft,{side:"right",children:v?"Expand":"Collapse"})]}),e?b?t.jsx("input",{autoFocus:!0,value:N,onChange:D=>C(D.target.value),onBlur:w,onKeyDown:D=>{D.key==="Enter"&&w(),D.key==="Escape"&&(j(!1),C(e.name))},className:"text-xs font-semibold text-foreground bg-transparent border-b border-indigo-400 outline-none px-0.5"}):t.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.name}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"No List"}),t.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:x}),t.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[t.jsxs("button",{onClick:()=>m((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:[t.jsx(Fe,{className:"h-3 w-3"}),"Add issue"]}),e&&t.jsxs(zs,{children:[t.jsxs(rs,{children:[t.jsx(as,{asChild:!0,children:t.jsx(qs,{asChild:!0,children:t.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(Kn,{className:"h-3.5 w-3.5"})})})}),t.jsx(Ft,{side:"top",children:"More options"})]}),t.jsxs(xs,{align:"end",className:"w-36",children:[t.jsxs(Xe,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{j(!0),C(e.name)},children:[t.jsx(Gn,{className:"h-3.5 w-3.5"}),"Rename"]}),t.jsxs(Xe,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g==null?void 0:g(e.id),children:[t.jsx(fs,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!v&&t.jsx("div",{className:"divide-y divide-border/60",children:s.length===0?t.jsx("div",{className:"px-14 py-3 text-xs text-muted-foreground/50 italic",children:"No issues in this list"}):s.map(D=>t.jsx(fd,{issue:D,projectId:r,statuses:a,statusLabels:o,statusColorMap:i,sprints:l,workspace:d,projectKey:c,onOpen:u,children:n[D.id]??[],onAddChild:f},D.id))})]})}function Xg(){var ae;const{workspace:e,projectKey:s}=Ke(),[n,r]=p.useState(null),[a,o]=p.useState({open:!1}),[i,l]=p.useState(""),[d,c]=p.useState(!1),[u,m]=p.useState(""),[f,h]=p.useState("all"),[g,v]=p.useState("all"),[k,b]=p.useState("all"),{data:j}=hs(s??""),N=(j==null?void 0:j.id)??"",{data:C,isLoading:S}=Dn(N||void 0),{data:x}=Ls(N||void 0),{data:w}=Hs(N||void 0),{data:D}=En(N||void 0),_=Xx(N),A=Jx(N),z=Zx(N),R=x&&x.length>0?x:Object.entries(us).map(([P,oe],be)=>({id:P,project_id:N,key:P,name:oe,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[P]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[P]??"backlog",position:be})),W=Object.fromEntries(R.map(P=>[P.key,P.name])),$=Object.fromEntries(R.map(P=>[P.key,P.color])),G=w??[];if(!s||!e)return null;const O=(C??[]).filter(P=>{const oe=!u||P.title.toLowerCase().includes(u.toLowerCase())||P.identifier.toLowerCase().includes(u.toLowerCase()),be=f==="all"||P.status===f,_e=g==="all"||P.priority===g,qe=k==="all"||(k==="none"?!P.sprint_id:P.sprint_id===k);return oe&&be&&_e&&qe}).sort((P,oe)=>{const be=parseInt(P.identifier.split("-")[1]??"0",10),_e=parseInt(oe.identifier.split("-")[1]??"0",10);return be-_e}),L={};for(const P of C??[])P.parent_id&&(L[P.parent_id]||(L[P.parent_id]=[]),L[P.parent_id].push(P));const Z=O.filter(P=>!P.parent_id),I=O.length,M=new Set((D??[]).map(P=>P.id)),X={__none__:[]};for(const P of D??[])X[P.id]=[];for(const P of Z){const oe=P.task_list_id&&M.has(P.task_list_id)?P.task_list_id:"__none__";X[oe].push(P)}function E(){i.trim()&&_.mutate({name:i.trim()},{onSuccess:()=>{l(""),c(!1),F.success("List created")},onError:()=>F.error("Failed to create list")})}function q(P,oe){A.mutate({id:P,name:oe},{onError:()=>F.error("Failed to rename list")})}function K(P){const oe=D==null?void 0:D.find(be=>be.id===P);confirm(`Delete list "${oe==null?void 0:oe.name}"? Issues in this list will be moved to No List.`)&&z.mutate(P,{onSuccess:()=>F.success("List deleted"),onError:()=>F.error("Failed to delete list")})}const U="grid-cols-[70px_1fr_150px_120px_130px_140px_130px_32px]";return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-2",children:[d?t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xe,{autoFocus:!0,placeholder:"List name...",value:i,onChange:P=>l(P.target.value),onKeyDown:P=>{P.key==="Enter"&&E(),P.key==="Escape"&&(c(!1),l(""))},className:"h-8 text-xs w-36"}),t.jsx(V,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:E,disabled:!i.trim()||_.isPending,children:"Add"}),t.jsx(V,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{c(!1),l("")},children:"Cancel"})]}):t.jsxs(V,{size:"sm",variant:"outline",onClick:()=>c(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"New List"]}),t.jsxs(V,{size:"sm",onClick:()=>o({open:!0}),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Create"]})]})}),t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(we,{value:k,onValueChange:b,children:[t.jsx(ve,{className:"h-8 text-xs w-[140px] bg-transparent",children:t.jsx(Te,{placeholder:"Sprint"})}),t.jsxs(je,{children:[t.jsx(ce,{value:"all",className:"text-xs",children:"All sprints"}),t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),G.map(P=>t.jsx(ce,{value:P.id,className:"text-xs",children:P.name},P.id))]})]}),t.jsxs(we,{value:f,onValueChange:h,children:[t.jsx(ve,{className:"h-8 text-xs w-[130px] bg-transparent",children:t.jsx(Te,{placeholder:"Status"})}),t.jsxs(je,{children:[t.jsx(ce,{value:"all",className:"text-xs",children:"All statuses"}),R.map(({key:P,name:oe})=>t.jsx(ce,{value:P,className:"text-xs",children:oe},P))]})]}),t.jsxs(we,{value:g,onValueChange:v,children:[t.jsx(ve,{className:"h-8 text-xs w-[130px] bg-transparent",children:t.jsx(Te,{placeholder:"Priority"})}),t.jsxs(je,{children:[t.jsx(ce,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(Mt).map(([P,oe])=>t.jsx(ce,{value:P,className:"text-xs",children:oe},P))]})]})]}),t.jsxs("div",{className:"relative",children:[t.jsx(Xn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),t.jsx(xe,{placeholder:"Search...",value:u,onChange:P=>m(P.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),t.jsxs("div",{className:T("grid items-center px-6 py-2.5 border-b border-border",U),children:[t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"ID"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Title"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),t.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"}),t.jsx("span",{})]}),S?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(P=>t.jsxs("div",{className:T("grid items-center px-6 py-3 gap-4",U),children:[t.jsx(se,{className:"h-4 w-14"}),t.jsx(se,{className:"h-4 w-56"}),t.jsx(se,{className:"h-5 w-20"}),t.jsx(se,{className:"h-4 w-16"}),t.jsx(se,{className:"h-4 w-20"}),t.jsx(se,{className:"h-4 w-24"}),t.jsx(se,{className:"h-6 w-16"}),t.jsx("span",{})]},P))}):I===0&&(C??[]).length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[t.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first issue to start tracking work."}),t.jsxs(V,{size:"sm",onClick:()=>o({open:!0}),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Create issue"]})]}):Z.length===0&&(C??[]).length>0?t.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No issues match your filters."})}):t.jsx(Jr,{delayDuration:200,children:t.jsxs("div",{className:"divide-y divide-border",children:[(D??[]).map(P=>t.jsx(wo,{taskList:P,issues:X[P.id]??[],childrenMap:L,projectId:N,statuses:R,statusLabels:W,statusColorMap:$,sprints:G,workspace:e,projectKey:s,onOpen:r,onAddIssue:oe=>o({open:!0,defaultTaskListId:oe}),onAddChild:oe=>o({open:!0,defaultParentId:oe}),onRenameList:q,onDeleteList:K},P.id)),(((ae=X.__none__)==null?void 0:ae.length)>0||(D??[]).length===0)&&t.jsx(wo,{taskList:null,issues:X.__none__??[],childrenMap:L,projectId:N,statuses:R,statusLabels:W,statusColorMap:$,sprints:G,workspace:e,projectKey:s,onOpen:r,onAddIssue:P=>o({open:!0,defaultTaskListId:P}),onAddChild:P=>o({open:!0,defaultParentId:P})})]})}),!S&&I>0&&t.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:t.jsxs("span",{className:"text-xs text-muted-foreground",children:[I," issue",I!==1?"s":""]})})]}),t.jsx(md,{issue:n,projectId:N,open:!!n,onClose:()=>r(null)}),t.jsx(ar,{open:a.open,onClose:()=>o({open:!1}),projectId:N,defaultTaskListId:a.defaultTaskListId,defaultParentId:a.defaultParentId})]})}function Jg(){const{projectKey:e}=Ke(),{workspace:s}=Se(),n=(s==null?void 0:s.id)??"",{data:r}=hs(e??""),a=(r==null?void 0:r.id)??"",{data:o,isLoading:i}=vl(a),{data:l}=Ln(n),{data:d}=ta(n),c=jl(a),u=wl(a),m=Nl(a),f=kl(a),[h,g]=p.useState(""),[v,k]=p.useState(""),b=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))??[]),N=(l??[]).filter(S=>!b.has(S.user_id)),C=(d??[]).filter(S=>!j.has(S.id));return t.jsx("div",{className:"p-6 max-w-2xl",children:t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"px-6 py-4 border-b border-border",children:[t.jsx("h2",{className:"text-sm font-semibold",children:"Access"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Manage who has access to this project."})]}),t.jsxs("div",{className:"p-6 space-y-8",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"People"}),i?t.jsx("div",{className:"space-y-2.5",children:[1,2].map(S=>t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx(se,{className:"h-8 w-8 rounded-full"}),t.jsx(se,{className:"h-4 w-36"})]},S))}):(o==null?void 0:o.members.length)===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):t.jsx("div",{className:"space-y-1",children:o==null?void 0:o.members.map(S=>{var z;const x=S.user,w=(x==null?void 0:x.first_name)??"",D=(x==null?void 0:x.last_name)??"",_=`${w} ${D}`.trim()||(x==null?void 0:x.email)||"Unknown",A=(w[0]??D[0]??((z=x==null?void 0:x.email)==null?void 0:z[0])??"U").toUpperCase();return t.jsxs("div",{className:"flex items-center gap-3 py-1.5 group",children:[t.jsx(st,{className:"h-8 w-8 shrink-0",children:t.jsx(nt,{className:"text-xs font-medium",children:A})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:_}),(x==null?void 0:x.email)&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.email})]}),t.jsx("span",{className:T("text-[11px] px-2 py-0.5 rounded font-medium shrink-0",S.role==="manager"?"bg-indigo-50 text-indigo-600 dark:bg-indigo-950 dark:text-indigo-400":"bg-muted text-muted-foreground"),children:S.role}),t.jsx("button",{onClick:()=>u.mutate(S.user_id,{onSuccess:()=>F.success("Access removed"),onError:()=>F.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive ml-1",children:t.jsx(We,{className:"h-4 w-4"})})]},S.id)})}),N.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[t.jsx(yn,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t.jsxs(we,{value:h,onValueChange:g,children:[t.jsx(ve,{className:"h-9 text-sm flex-1",children:t.jsx(Te,{placeholder:"Add person…"})}),t.jsx(je,{children:N.map(S=>{const x=S.user,w=(x==null?void 0:x.first_name)??"",D=(x==null?void 0:x.last_name)??"",_=`${w} ${D}`.trim()||(x==null?void 0:x.email)||"Unknown";return t.jsx(ce,{value:S.user_id,children:_},S.user_id)})})]}),h&&t.jsx(V,{size:"sm",className:"h-9 px-4 shrink-0",disabled:c.isPending,onClick:()=>c.mutate({userId:h},{onSuccess:()=>{F.success("Access granted"),g("")},onError:()=>F.error("Failed to grant access")}),children:"Add"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Teams"}),i?t.jsx("div",{className:"space-y-2.5",children:[1].map(S=>t.jsxs("div",{className:"flex items-center gap-2.5",children:[t.jsx(se,{className:"h-8 w-8 rounded-lg"}),t.jsx(se,{className:"h-4 w-32"})]},S))}):(o==null?void 0:o.teams.length)===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):t.jsx("div",{className:"space-y-1",children:o==null?void 0:o.teams.map(S=>{const x=S.team;return t.jsxs("div",{className:"flex items-center gap-3 py-1.5 group",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:t.jsx(Ts,{className:"h-4 w-4 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:(x==null?void 0:x.name)??"Unknown team"}),x&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.member_count," ",x.member_count===1?"member":"members"]})]}),t.jsx("button",{onClick:()=>f.mutate(S.team_id,{onSuccess:()=>F.success("Team access removed"),onError:()=>F.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:t.jsx(We,{className:"h-4 w-4"})})]},S.id)})}),C.length>0&&t.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[t.jsx(Ts,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t.jsxs(we,{value:v,onValueChange:k,children:[t.jsx(ve,{className:"h-9 text-sm flex-1",children:t.jsx(Te,{placeholder:"Add team…"})}),t.jsx(je,{children:C.map(S=>t.jsx(ce,{value:S.id,children:S.name},S.id))})]}),v&&t.jsx(V,{size:"sm",className:"h-9 px-4 shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{F.success("Team access granted"),k("")},onError:()=>F.error("Failed to add team")}),children:"Add"})]})]})]})]})})}function No(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?le(new Date(e.start_date),"MMM d"):"—",n=e.end_date?le(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function Rt({label:e,children:s}){return t.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),t.jsx("div",{className:"flex-1 min-w-0",children:s})]})}const Zg={backlog:t.jsx(yt,{className:"h-3 w-3 text-zinc-400"}),todo:t.jsx(yt,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:t.jsx(Lt,{className:"h-3 w-3 text-indigo-500"}),in_review:t.jsx(gn,{className:"h-3 w-3 text-amber-500"}),done:t.jsx(ms,{className:"h-3 w-3 text-emerald-500"}),cancelled:t.jsx(Oi,{className:"h-3 w-3 text-zinc-400"})},eb={urgent:t.jsx(vn,{className:"h-3 w-3 text-red-500"}),high:t.jsx(Un,{className:"h-3 w-3 text-orange-500"}),medium:t.jsx(bn,{className:"h-3 w-3 text-yellow-500"}),low:t.jsx(Hn,{className:"h-3 w-3 text-blue-400"})},tb={bug:t.jsx(Mi,{className:"h-3 w-3 text-red-500"}),feature:t.jsx(Bi,{className:"h-3 w-3 text-purple-500"}),task:t.jsx(Yi,{className:"h-3 w-3 text-blue-500"}),chore:t.jsx(sa,{className:"h-3 w-3 text-zinc-500"})};function Pr({value:e,onValueChange:s,options:n,icons:r,placeholder:a}){return t.jsxs(we,{value:e,onValueChange:s,children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5",children:[r[e]??t.jsx(_i,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{children:n[e]??a??""})]})}),t.jsx(je,{children:Object.entries(n).map(([o,i])=>t.jsx(ce,{value:o,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-2",children:[r[o],i]})},o))})]})}function sb(){const{workspace:e,projectKey:s,issueId:n}=Ke(),r=Ve(),[a,o]=p.useState(!1),[i,l]=p.useState(""),[d,c]=p.useState(""),[u,m]=p.useState(!1),{data:f}=hs(s??""),h=(f==null?void 0:f.id)??"",{data:g,isLoading:v}=Px(n??""),k=Ca(n??"",h),{data:b}=Ls(h||void 0),{data:j}=Hs(h||void 0),{data:N}=En(h||void 0),{data:C}=Dn(h||void 0),S=(j??[]).filter($=>$.status!=="completed"),x=g!=null&&g.parent_id?C==null?void 0:C.find($=>$.id===g.parent_id):null,w=(C==null?void 0:C.filter($=>$.parent_id===n))??[],D=g!=null&&g.task_list_id?N==null?void 0:N.find($=>$.id===g.task_list_id):null,_=b&&b.length>0?Object.fromEntries(b.map($=>[$.key,$.name])):us,A=b&&b.length>0?Object.fromEntries(b.map($=>[$.key,$.category==="completed"?t.jsx(ms,{className:"h-3 w-3",style:{color:$.color}}):$.category==="started"?t.jsx(Lt,{className:"h-3 w-3",style:{color:$.color}}):t.jsx(yt,{className:"h-3 w-3",style:{color:$.color}})])):Zg;if(p.useEffect(()=>{g&&(l(g.title),c(g.description??"")),o(!1)},[g==null?void 0:g.id]),!s||!n)return null;const z=()=>{i.trim()&&k.mutate({title:i.trim(),description:d.trim()||void 0},{onSuccess:()=>{o(!1),F.success("Issue updated")},onError:()=>F.error("Failed to update issue")})},R=()=>{g&&(l(g.title),c(g.description??"")),o(!1)},W=($,G)=>{k.mutate($,{onSuccess:()=>F.success(`${G} updated`),onError:()=>F.error(`Failed to update ${G.toLowerCase()}`)})};return v||!g?t.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[t.jsx("div",{className:"sticky top-0 z-10 h-[57px] bg-white dark:bg-card border-b border-border"}),t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 space-y-4 shadow-sm",children:[t.jsx(se,{className:"h-7 w-3/4"}),t.jsx(se,{className:"h-32 w-full"})]}),t.jsx(se,{className:"h-24 w-full rounded-xl"}),t.jsx(se,{className:"h-48 w-full rounded-xl"})]}),t.jsx(se,{className:"h-[280px] w-full rounded-xl"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[t.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:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>r(`/${e}/projects/${s}/issues`),children:[t.jsx(na,{className:"h-3.5 w-3.5"}),(f==null?void 0:f.name)??"Issues"]}),t.jsx("span",{className:"text-border",children:"/"}),t.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g.identifier}),t.jsx(lr,{variant:"muted",className:"text-[10px] ml-1",children:zt[g.type]??g.type})]}),t.jsx("div",{className:"flex items-center gap-2",children:a?t.jsxs(t.Fragment,{children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:R,children:"Discard"}),t.jsx(V,{size:"sm",onClick:z,disabled:!i.trim()||k.isPending,className:"px-4",children:k.isPending?"Saving…":"Save changes"})]}):t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>o(!0),children:[t.jsx(Gn,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[t.jsx("div",{className:"px-6 pt-6 pb-3",children:a?t.jsx("input",{autoFocus:!0,value:i,onChange:$=>l($.target.value),onKeyDown:$=>{$.key==="Enter"&&$.preventDefault()},className:T("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")}):t.jsx("h1",{className:"text-xl font-semibold text-foreground leading-snug",children:g.title})}),t.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:t.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),a?t.jsx(Ia,{content:d,onChange:c,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]"}):g.description?t.jsx("div",{className:"border-t border-border/50",children:t.jsx(Fa,{html:g.description,className:"px-5 py-4"})}):t.jsx("div",{className:"border-t border-border/50 px-6 py-4",children:t.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})})]}),!g.parent_id&&t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[t.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Child Issues"}),t.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Fe,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),w.length===0?t.jsx("div",{className:"px-5 py-4 text-xs text-muted-foreground/50 italic",children:"No child issues yet"}):t.jsx("div",{className:"px-5 py-2 divide-y divide-border/40",children:w.map($=>t.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[t.jsx($i,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsx("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${$.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:$.identifier}),t.jsx("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${$.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:$.title})]},$.id))})]}),t.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:t.jsx(dd,{issueId:n})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),t.jsxs("div",{className:"px-4 py-1",children:[t.jsx(Rt,{label:"Status",children:t.jsx(Pr,{value:g.status,onValueChange:$=>W({status:$},"Status"),options:_,icons:A})}),t.jsx(Rt,{label:"Priority",children:t.jsx(Pr,{value:g.priority,onValueChange:$=>W({priority:$},"Priority"),options:Mt,icons:eb})}),t.jsx(Rt,{label:"Type",children:t.jsx(Pr,{value:g.type,onValueChange:$=>W({type:$},"Type"),options:zt,icons:tb})}),t.jsx(Rt,{label:"Assignees",children:t.jsx(_n,{value:g.assignee_ids??[],onChange:$=>W({assignee_ids:$},"Assignees"),disabled:k.isPending})}),t.jsx(Rt,{label:"Sprint",children:t.jsxs(we,{value:g.sprint_id??"none",onValueChange:$=>W({sprint_id:$==="none"?null:$},"Sprint"),children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.jsx(vt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),g.sprint_id?(()=>{const $=S.find(O=>O.id===g.sprint_id)??(j==null?void 0:j.find(O=>O.id===g.sprint_id));if(!$)return t.jsxs("span",{className:"truncate",children:[g.sprint_id.slice(0,8),"…"]});const G=No($);return t.jsxs("span",{className:"truncate",children:[$.name,G&&t.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",G]})]})})():t.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),S.map($=>{const G=No($);return t.jsx(ce,{value:$.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:$.name}),G&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:G})]})},$.id)})]})]})}),(N??[]).length>0&&t.jsx(Rt,{label:"List",children:t.jsxs(we,{value:g.task_list_id??"none",onValueChange:$=>W({task_list_id:$==="none"?null:$},"List"),children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.jsx(la,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:D?"truncate":"text-muted-foreground",children:(D==null?void 0:D.name)??"No list"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(N??[]).map($=>t.jsx(ce,{value:$.id,className:"text-xs",children:$.name},$.id))]})]})}),t.jsx(Rt,{label:"Due Date",children:t.jsxs(lt,{children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(ls,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:g.due_date?"text-foreground":"text-muted-foreground",children:g.due_date?le(new Date(g.due_date),"MMM d, yyyy"):"No due date"})]})}),t.jsxs(tt,{className:"w-auto p-0",align:"start",children:[t.jsx(qt,{mode:"single",selected:g.due_date?new Date(g.due_date):void 0,onSelect:$=>W({due_date:$?le($,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),g.due_date&&t.jsx("div",{className:"border-t px-3 py-2",children:t.jsxs("button",{onClick:()=>W({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[t.jsx(We,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),x&&t.jsx(Rt,{label:"Parent",children:t.jsxs("button",{onClick:()=>r(`/${e}/projects/${s}/issues/${x.id}`),className:"flex items-center gap-1.5 text-xs hover:text-foreground transition-colors text-left w-full min-w-0",children:[t.jsx(ra,{className:"h-3 w-3 text-muted-foreground shrink-0"}),t.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:x.identifier}),t.jsx("span",{className:"text-foreground truncate",children:x.title})]})})]})]}),t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Details"})}),t.jsxs("div",{className:"px-4 pt-3 pb-4 space-y-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsx("span",{className:"text-muted-foreground",children:"Created"}),t.jsx("span",{className:"text-foreground",children:le(new Date(g.created_at),"MMM d, yyyy")})]}),t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsx("span",{className:"text-muted-foreground",children:"Updated"}),t.jsx("span",{className:"text-foreground",children:le(new Date(g.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),t.jsx(ar,{open:u,onClose:()=>m(!1),projectId:h,defaultParentId:n,defaultTaskListId:g.task_list_id})]})}function Zt({label:e,children:s}){return t.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),t.jsx("div",{className:"flex-1 min-w-0",children:s})]})}const nb={backlog:t.jsx(yt,{className:"h-3 w-3 text-zinc-400"}),todo:t.jsx(yt,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:t.jsx(Lt,{className:"h-3 w-3 text-indigo-500"}),in_review:t.jsx(gn,{className:"h-3 w-3 text-amber-500"}),done:t.jsx(ms,{className:"h-3 w-3 text-emerald-500"}),cancelled:t.jsx(Oi,{className:"h-3 w-3 text-zinc-400"})},rb={urgent:t.jsx(vn,{className:"h-3 w-3 text-red-500"}),high:t.jsx(Un,{className:"h-3 w-3 text-orange-500"}),medium:t.jsx(bn,{className:"h-3 w-3 text-yellow-500"}),low:t.jsx(Hn,{className:"h-3 w-3 text-blue-400"})},ab={bug:t.jsx(Mi,{className:"h-3 w-3 text-red-500"}),feature:t.jsx(Bi,{className:"h-3 w-3 text-purple-500"}),task:t.jsx(Yi,{className:"h-3 w-3 text-blue-500"}),chore:t.jsx(sa,{className:"h-3 w-3 text-zinc-500"})};function $r({value:e,onValueChange:s,options:n,icons:r,placeholder:a}){return t.jsxs(we,{value:e,onValueChange:s,children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5",children:[r[e]??t.jsx(_i,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{children:n[e]??a??""})]})}),t.jsx(je,{children:Object.entries(n).map(([o,i])=>t.jsx(ce,{value:o,className:"text-xs",children:t.jsxs("div",{className:"flex items-center gap-2",children:[r[o],i]})},o))})]})}function ob(e){if(!e.start_date&&!e.end_date)return null;const s=e.start_date?le(new Date(e.start_date),"MMM d"):"—",n=e.end_date?le(new Date(e.end_date),"MMM d"):"—";return`${s} – ${n}`}function ib(){const{workspace:e,projectKey:s}=Ke(),n=Ve(),{workspace:r}=Se(),[a,o]=p.useState(""),[i,l]=p.useState(""),[d,c]=p.useState("backlog"),[u,m]=p.useState("medium"),[f,h]=p.useState("task"),[g,v]=p.useState([]),[k,b]=p.useState(""),[j,N]=p.useState(""),[C,S]=p.useState(void 0),{data:x}=hs(s??""),w=(x==null?void 0:x.id)??"",D=Rl(),{data:_}=Ls(w||void 0),{data:A}=Hs(w||void 0),{data:z}=En(w||void 0),R=(A??[]).filter(O=>O.status!=="completed"),W=_&&_.length>0?Object.fromEntries(_.map(O=>[O.key,O.name])):us,$=_&&_.length>0?Object.fromEntries(_.map(O=>[O.key,O.category==="completed"?t.jsx(ms,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?t.jsx(Lt,{className:"h-3 w-3",style:{color:O.color}}):t.jsx(yt,{className:"h-3 w-3",style:{color:O.color}})])):nb;if(!s||!w)return null;const G=()=>{if(!a.trim()){F.error("Title is required");return}D.mutate({title:a.trim(),description:i||void 0,status:d,priority:u,type:f,project_id:w,workspace_id:r.id,assignee_ids:g.length>0?g:void 0,sprint_id:k||null,task_list_id:j||null,due_date:C?le(C,"yyyy-MM-dd"):null},{onSuccess:O=>{F.success("Issue created"),n(`/${e}/projects/${s}/issues/${O.issue.id}`,{replace:!0})},onError:O=>F.error(O.message??"Failed to create issue")})};return t.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[t.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:[t.jsxs(V,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>n(`/${e}/projects/${s}/issues`),children:[t.jsx(na,{className:"h-3.5 w-3.5"}),(x==null?void 0:x.name)??"Issues"]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:()=>n(`/${e}/projects/${s}/issues`),children:"Discard"}),t.jsx(V,{size:"sm",onClick:G,disabled:!a.trim()||D.isPending,className:"px-4",children:D.isPending?"Creating…":"Create issue"})]})]}),t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[t.jsx("div",{className:"px-6 pt-6 pb-3",children:t.jsx("input",{autoFocus:!0,value:a,onChange:O=>o(O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()},placeholder:"Issue title…",className:T("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")})}),t.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:t.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),t.jsx(Ia,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]"})]}),t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:t.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),t.jsxs("div",{className:"px-4 py-1",children:[t.jsx(Zt,{label:"Status",children:t.jsx($r,{value:d,onValueChange:c,options:W,icons:$})}),t.jsx(Zt,{label:"Priority",children:t.jsx($r,{value:u,onValueChange:m,options:Mt,icons:rb})}),t.jsx(Zt,{label:"Type",children:t.jsx($r,{value:f,onValueChange:h,options:zt,icons:ab})}),t.jsx(Zt,{label:"Assignees",children:t.jsx(_n,{value:g,onChange:v})}),R.length>0&&t.jsx(Zt,{label:"Sprint",children:t.jsxs(we,{value:k||"none",onValueChange:O=>b(O==="none"?"":O),children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.jsx(vt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Te,{placeholder:"No sprint"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),R.map(O=>{const L=ob(O);return t.jsx(ce,{value:O.id,className:"text-xs",children:t.jsxs("div",{className:"flex items-baseline gap-1.5",children:[t.jsx("span",{children:O.name}),L&&t.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:L})]})},O.id)})]})]})}),(z??[]).length>0&&t.jsx(Zt,{label:"List",children:t.jsxs(we,{value:j||"none",onValueChange:O=>N(O==="none"?"":O),children:[t.jsx(ve,{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:t.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[t.jsx(la,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx(Te,{placeholder:"No list"})]})}),t.jsxs(je,{children:[t.jsx(ce,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(z??[]).map(O=>t.jsx(ce,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),t.jsx(Zt,{label:"Due Date",children:t.jsxs(lt,{children:[t.jsx(dt,{asChild:!0,children:t.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:[t.jsx(ls,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),t.jsx("span",{className:C?"text-foreground":"text-muted-foreground",children:C?le(C,"MMM d, yyyy"):"No due date"}),C&&t.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),S(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:t.jsx(We,{className:"h-3 w-3"})})]})}),t.jsx(tt,{className:"w-auto p-0",align:"start",children:t.jsx(qt,{mode:"single",selected:C,onSelect:S,initialFocus:!0})})]})})]}),t.jsx("div",{className:"px-4 pt-2 pb-3 mt-1 border-t border-border/60",children:t.jsxs("p",{className:"text-[11px] text-muted-foreground/50 leading-relaxed",children:["Press ",t.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})})]})]})})]})}function lb(){const{data:e,isLoading:s}=Ym(),n=Hm(),r=Um(),a=(e==null?void 0:e.filter(o=>!o.read).length)??0;return t.jsxs("div",{className:"p-6 max-w-[800px]",children:[t.jsxs("div",{className:"flex items-center justify-between mb-6",children:[t.jsx("h1",{className:"text-xl font-semibold",children:"Notifications"}),a>0&&t.jsxs(V,{variant:"outline",size:"sm",onClick:()=>r.mutate(void 0,{onSuccess:()=>F.success("All marked as read"),onError:()=>F.error("Failed")}),disabled:r.isPending,children:[t.jsx($u,{className:"h-4 w-4"}),"Mark all read"]})]}),t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[s?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(o=>t.jsxs("div",{className:"flex items-start gap-4 px-6 py-4",children:[t.jsx(se,{className:"h-4 w-4 rounded-full mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx(se,{className:"h-4 w-3/4"}),t.jsx(se,{className:"h-3 w-24"})]})]},o))}):e!=null&&e.length?t.jsx("div",{className:"divide-y divide-border",children:e.map(o=>t.jsxs("div",{className:T("flex items-start gap-4 px-6 py-4 transition-colors",!o.read&&"bg-[#eff6ff] dark:bg-[hsl(var(--indigo-subtle))]","hover:bg-[#f9fafb] dark:hover:bg-muted/30"),children:[t.jsx("div",{className:"mt-1.5 shrink-0 w-4 flex justify-center",children:!o.read&&t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:T("text-sm",!o.read&&"font-medium"),children:o.message}),t.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:o.entity_type}),t.jsx("span",{className:"text-[11px] text-muted-foreground",children:le(new Date(o.created_at),"MMM d, h:mm a")})]})]}),!o.read&&t.jsx(V,{variant:"ghost",size:"sm",className:"shrink-0 h-7 text-xs text-muted-foreground",onClick:()=>n.mutate(o.id,{onError:()=>F.error("Failed")}),children:"Mark read"})]},o.id))}):t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(pn,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"No notifications"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"You're all caught up."})]}),!s&&e&&e.length>0&&t.jsx("div",{className:"px-6 py-3 border-t border-border",children:t.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.length," notification",e.length!==1?"s":"",a>0?` · ${a} unread`:""]})})]})]})}function db({open:e,onClose:s,projectId:n}){const[r,a]=p.useState(""),[o,i]=p.useState(""),[l,d]=p.useState(),[c,u]=p.useState(),[m,f]=p.useState(!1),[h,g]=p.useState(!1),v=Vx(n);function k(){a(""),i(""),d(void 0),u(void 0),s()}async function b(j){j.preventDefault(),r.trim()&&v.mutate({name:r.trim(),goal:o.trim()||void 0,start_date:l?le(l,"yyyy-MM-dd"):null,end_date:c?le(c,"yyyy-MM-dd"):null},{onSuccess:()=>{F.success("Sprint created"),k()},onError:()=>F.error("Failed to create sprint")})}return t.jsx(ps,{open:e,onOpenChange:j=>!j&&k(),children:t.jsxs(gs,{className:"sm:max-w-md",children:[t.jsx(bs,{children:t.jsx(ys,{children:"New Sprint"})}),t.jsxs("form",{onSubmit:b,className:"flex flex-col flex-1 overflow-hidden",children:[t.jsxs(Bs,{className:"space-y-4 py-1",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{htmlFor:"sprint-name",children:["Name ",t.jsx("span",{className:"text-destructive",children:"*"})]}),t.jsx(xe,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:r,onChange:j=>a(j.target.value),autoFocus:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs(ze,{htmlFor:"sprint-goal",children:["Goal ",t.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),t.jsx(tr,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:o,onChange:j=>i(j.target.value),className:"resize-none text-sm",rows:2})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{children:"Start Date"}),t.jsxs(lt,{open:m,onOpenChange:f,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(V,{variant:"outline",className:T("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[t.jsx(ls,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?le(l,"MMM d, yyyy"):"Pick date"]})}),t.jsx(tt,{className:"w-auto p-0",align:"start",children:t.jsx(qt,{mode:"single",selected:l,onSelect:j=>{d(j),f(!1)},disabled:j=>c?j>c:!1,initialFocus:!0})})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ze,{children:"End Date"}),t.jsxs(lt,{open:h,onOpenChange:g,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(V,{variant:"outline",className:T("w-full justify-start text-left font-normal text-sm h-9",!c&&"text-muted-foreground"),children:[t.jsx(ls,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),c?le(c,"MMM d, yyyy"):"Pick date"]})}),t.jsx(tt,{className:"w-auto p-0",align:"start",children:t.jsx(qt,{mode:"single",selected:c,onSelect:j=>{u(j),g(!1)},disabled:j=>l?j<l:!1,initialFocus:!0})})]})]})]})]}),t.jsxs(Sn,{children:[t.jsx(V,{type:"button",variant:"ghost",onClick:k,children:"Cancel"}),t.jsx(V,{type:"submit",disabled:!r.trim()||v.isPending,children:v.isPending?"Creating…":"Create Sprint"})]})]})]})})}const cb={active:{label:"Active",icon:Qn,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:Lt,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:ms,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function ub({sprint:e,projectId:s,issueCount:n}){const r=Gx(e.id,s),a=Qx(s),o=cb[e.status],i=o.icon;function l(){r.mutate({status:"active"},{onSuccess:()=>F.success(`"${e.name}" started`),onError:()=>F.error("Failed to start sprint")})}function d(){r.mutate({status:"completed"},{onSuccess:()=>F.success(`"${e.name}" completed`),onError:f=>F.error((f==null?void 0:f.message)??"Failed to complete sprint")})}function c(){confirm(`Delete sprint "${e.name}"? This cannot be undone.`)&&a.mutate(e.id,{onSuccess:()=>F.success("Sprint deleted"),onError:()=>F.error("Failed to delete sprint")})}const u=!!e.start_date,m=!!e.end_date;return t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx("div",{className:T("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:t.jsx(i,{className:T("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")})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e.name}),e.goal&&t.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5 flex items-center gap-1",children:[t.jsx(tm,{className:"h-3 w-3 shrink-0"}),e.goal]})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0 w-52",children:[t.jsx(Di,{className:"h-3.5 w-3.5 shrink-0"}),u||m?t.jsxs("span",{children:[u?le(new Date(e.start_date),"MMM d"):"—"," → ",m?le(new Date(e.end_date),"MMM d, yyyy"):"—"]}):t.jsx("span",{className:"italic",children:"No dates set"})]}),t.jsxs("div",{className:"text-xs text-muted-foreground shrink-0 w-20 text-right",children:[n," issue",n!==1?"s":""]}),t.jsx(lr,{className:T("shrink-0 text-[11px] border-0 w-20 justify-center",o.badge),children:o.label}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="planned"&&t.jsxs(V,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:l,disabled:r.isPending,children:[t.jsx(Qn,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&t.jsxs(V,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:r.isPending,children:[t.jsx(ms,{className:"h-3 w-3"}),"Complete"]}),t.jsx(V,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:c,disabled:a.isPending,children:t.jsx(fs,{className:"h-3.5 w-3.5"})})]})]})}function mb(){const{projectKey:e}=Ke(),[s,n]=p.useState(!1),{data:r}=hs(e??""),a=(r==null?void 0:r.id)??"",{data:o,isLoading:i}=Hs(a||void 0),{data:l}=Dn(a||void 0),d=(l??[]).reduce((m,f)=>(f.sprint_id&&(m[f.sprint_id]=(m[f.sprint_id]??0)+1),m),{}),c={active:(o??[]).filter(m=>m.status==="active"),planned:(o??[]).filter(m=>m.status==="planned"),completed:(o??[]).filter(m=>m.status==="completed")},u=[{key:"active",label:"Active Sprint",items:c.active},{key:"planned",label:"Planned",items:c.planned},{key:"completed",label:"Completed",items:c.completed}];return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:t.jsxs(V,{size:"sm",onClick:()=>n(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"New Sprint"]})}),i?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(m=>t.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[t.jsx(se,{className:"h-7 w-7 rounded-full"}),t.jsx(se,{className:"h-4 w-40"}),t.jsx("div",{className:"flex-1"}),t.jsx(se,{className:"h-4 w-32"}),t.jsx(se,{className:"h-5 w-20"})]},m))}):(o??[]).length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(Di,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"No sprints yet"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a sprint to start planning your work in time-boxed iterations."}),t.jsxs(V,{size:"sm",onClick:()=>n(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"New Sprint"]})]}):t.jsx("div",{children:u.map(({key:m,label:f,items:h})=>h.length===0?null:t.jsxs("div",{children:[t.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:t.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:f})}),t.jsx("div",{className:"divide-y divide-border",children:h.map(g=>t.jsx(ub,{sprint:g,projectId:a,issueCount:d[g.id]??0},g.id))})]},m))})]}),t.jsx(db,{open:s,onClose:()=>n(!1),projectId:a})]})}function Wa({value:e,className:s}){const[n,r]=p.useState(!1),a=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return t.jsx("button",{onClick:a,className:T("text-muted-foreground hover:text-foreground transition-colors",s),title:"Copy",children:n?t.jsx(gt,{className:"h-3.5 w-3.5 text-emerald-500"}):t.jsx(Ru,{className:"h-3.5 w-3.5"})})}function fb({open:e,onClose:s,workspaceId:n}){const[r,a]=p.useState(""),[o,i]=p.useState("member"),[l,d]=p.useState(null),c=xu(n);p.useEffect(()=>{e&&(a(""),i("member"),d(null))},[e]);const u=l?`${window.location.origin}/invite/${l.token}`:null,m=f=>{f.preventDefault(),c.mutate({email:r.trim()||void 0,role:o},{onSuccess:h=>{d(h.invitation),F.success("Invitation created")},onError:h=>F.error(h.message||"Failed to create invitation")})};return t.jsx(ga,{open:e,onOpenChange:f=>!f&&s(),children:t.jsxs(er,{className:"sm:max-w-[520px]",children:[t.jsx(ba,{children:t.jsx(ya,{children:"Invite member"})}),u?t.jsxs("div",{className:"space-y-4 pt-1",children:[t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",l!=null&&l.email?t.jsx("span",{className:"font-medium text-foreground",children:l.email}):"anyone you want to invite",". They will join as"," ",t.jsx("span",{className:"font-medium text-foreground capitalize",children:l==null?void 0:l.role}),"."]}),t.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[t.jsx(Ii,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),t.jsx("span",{className:"text-xs font-mono text-foreground flex-1 min-w-0 break-all",children:u}),t.jsx(Wa,{value:u,className:"shrink-0"})]}),t.jsxs("div",{className:"flex items-center justify-between pt-1",children:[t.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>d(null),children:"Create another"}),t.jsx(V,{size:"sm",onClick:s,children:"Done"})]})]}):t.jsxs("form",{onSubmit:m,className:"space-y-4 pt-1",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",t.jsx("span",{className:"font-normal",children:"(optional)"})]}),t.jsx(xe,{type:"email",placeholder:"colleague@example.com",value:r,onChange:f=>a(f.target.value),className:"h-9",autoFocus:!0}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),t.jsxs(we,{value:o,onValueChange:f=>i(f),children:[t.jsx(ve,{className:"h-9",children:t.jsx(Te,{})}),t.jsxs(je,{children:[t.jsx(ce,{value:"member",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ua,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsx("span",{children:"Member"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"— Can view and edit"})]})}),t.jsx(ce,{value:"admin",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ca,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsx("span",{children:"Admin"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"— Full access"})]})})]})]})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:s,children:"Cancel"}),t.jsx(V,{type:"submit",size:"sm",disabled:c.isPending,children:c.isPending?"Creating…":"Create invitation"})]})]})]})})}function hb({invitation:e,workspaceId:s}){const n=pu(s),r=`${window.location.origin}/invite/${e.token}`;return t.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:[t.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(Ii,{className:"h-3.5 w-3.5 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),t.jsx("span",{className:T("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",e.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:e.role==="admin"?"Admin":"Member"})]}),t.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[280px]",children:r}),t.jsx(Wa,{value:r})]})]}),t.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:le(new Date(e.created_at),"MMM d")}),t.jsx("button",{onClick:()=>n.mutate(e.id,{onSuccess:()=>F.success("Invitation revoked"),onError:()=>F.error("Failed to revoke")}),disabled:n.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:t.jsx(We,{className:"h-3.5 w-3.5"})})]})]})}function xb({workspaceId:e}){const{workspace:s,setWorkspace:n}=Se(),{data:r,isLoading:a}=Yn(),o=r==null?void 0:r.find(m=>m.id===(s==null?void 0:s.id)),i=fu(e),[l,d]=p.useState("");p.useEffect(()=>{o&&d(o.name)},[o==null?void 0:o.name]);const c=o?l.trim()!==o.name:!1,u=()=>{!l.trim()||!o||i.mutate({name:l.trim()},{onSuccess:m=>{n({id:m.workspace.id,name:m.workspace.name,slug:m.workspace.slug}),F.success("Workspace updated")},onError:()=>F.error("Failed to update workspace")})};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:t.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Workspace details"})}),t.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),a?t.jsx(se,{className:"h-8 w-64"}):t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(xe,{value:l,onChange:m=>d(m.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),c&&t.jsx(V,{size:"sm",className:"h-8",onClick:u,disabled:!l.trim()||i.isPending,children:i.isPending?"Saving…":"Save"})]})]}),t.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"URL slug"}),a?t.jsx(se,{className:"h-4 w-40"}):t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"font-mono text-foreground",children:o==null?void 0:o.slug}),t.jsx(Wa,{value:(o==null?void 0:o.slug)??""})]})]}),t.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),a?t.jsx(se,{className:"h-4 w-16"}):t.jsx("span",{className:"text-sm capitalize",children:(o==null?void 0:o.plan)??"free"})]}),t.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),a?t.jsx(se,{className:"h-4 w-28"}):t.jsx("span",{className:"text-sm text-muted-foreground",children:o!=null&&o.created_at?le(new Date(o.created_at),"MMMM d, yyyy"):"—"})]})]})}function pb({workspaceId:e,onInvite:s}){const{data:n,isLoading:r}=Ln(e),{data:a,isLoading:o}=hu(e),i=gu(e),l=bu(e),{user:d}=Se(),c=(a==null?void 0:a.filter(u=>u.status==="pending"))??[];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Members",!r&&n&&t.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",n.length]})]})}),r?t.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(u=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(se,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(se,{className:"h-3.5 w-32"}),t.jsx(se,{className:"h-3 w-48"})]})]},u))}):n!=null&&n.length?t.jsx("div",{className:"divide-y divide-border",children:n.map(u=>{var b;const m=u.user,f=(m==null?void 0:m.first_name)??"",h=(m==null?void 0:m.last_name)??"",g=`${f} ${h}`.trim()||(m==null?void 0:m.email)||"Unknown",v=(f[0]??h[0]??((b=m==null?void 0:m.email)==null?void 0:b[0])??"U").toUpperCase(),k=(m==null?void 0:m.id)===(d==null?void 0:d.id);return t.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:[t.jsx(st,{className:"h-7 w-7 shrink-0",children:t.jsx(nt,{className:"text-[11px] font-medium",children:v})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:g}),k&&t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(m==null?void 0:m.email)&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:m.email})]}),t.jsx("span",{className:T("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",u.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:u.role==="admin"?"Admin":"Member"}),!k&&t.jsxs(zs,{children:[t.jsx(qs,{asChild:!0,children:t.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:t.jsx(Kn,{className:"h-4 w-4"})})}),t.jsxs(xs,{align:"end",className:"w-40",children:[t.jsx(Xe,{onClick:()=>i.mutate({userId:u.user_id,role:u.role==="admin"?"member":"admin"},{onSuccess:()=>F.success("Role updated"),onError:()=>F.error("Failed to update role")}),children:u.role==="admin"?t.jsxs(t.Fragment,{children:[t.jsx(ua,{className:"h-3.5 w-3.5 mr-2"}),"Make member"]}):t.jsxs(t.Fragment,{children:[t.jsx(ca,{className:"h-3.5 w-3.5 mr-2"}),"Make admin"]})}),t.jsx(jn,{}),t.jsxs(Xe,{className:"text-destructive focus:text-destructive",onClick:()=>l.mutate(u.user_id,{onSuccess:()=>F.success("Member removed"),onError:()=>F.error("Failed to remove member")}),children:[t.jsx(fs,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},u.id)})}):t.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(im,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"No members yet"}),t.jsx("button",{onClick:s,className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}),t.jsxs("div",{className:"px-6 py-2 border-t border-b border-border bg-muted/20 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Pending invitations",!o&&c.length>0&&t.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",c.length]})]}),t.jsxs("button",{onClick:s,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Fe,{className:"h-3 w-3"}),"Invite"]})]}),o?t.jsx("div",{className:"divide-y divide-border",children:[1,2].map(u=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(se,{className:"h-7 w-7 rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx(se,{className:"h-3.5 w-48"}),t.jsx(se,{className:"h-3 w-64"})]})]},u))}):c.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending invitations."}),t.jsx("button",{onClick:s,className:"mt-2 text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}):t.jsx("div",{className:"divide-y divide-border",children:c.map(u=>t.jsx(hb,{invitation:u,workspaceId:e},u.id))})]})}function gb({workspaceId:e,teamId:s,allMembers:n}){const{data:r,isLoading:a}=ju(e,s),o=wu(e,s),i=Nu(e,s),[l,d]=p.useState(""),c=new Set((r==null?void 0:r.map(m=>m.user_id))??[]),u=n.filter(m=>!c.has(m.user_id));return t.jsxs("div",{className:"bg-muted/10 border-t border-border",children:[a?t.jsx("div",{className:"px-8 py-3",children:t.jsx(se,{className:"h-3 w-40"})}):(r==null?void 0:r.length)===0?t.jsx("p",{className:"px-8 py-3 text-xs text-muted-foreground",children:"No members in this team yet."}):t.jsx("div",{className:"divide-y divide-border/50",children:r==null?void 0:r.map(m=>{var b;const f=m.user,h=(f==null?void 0:f.first_name)??"",g=(f==null?void 0:f.last_name)??"",v=`${h} ${g}`.trim()||(f==null?void 0:f.email)||"Unknown",k=(h[0]??g[0]??((b=f==null?void 0:f.email)==null?void 0:b[0])??"U").toUpperCase();return t.jsxs("div",{className:"flex items-center gap-3 px-8 py-2.5 group hover:bg-muted/20 transition-colors",children:[t.jsx(st,{className:"h-6 w-6 shrink-0",children:t.jsx(nt,{className:"text-[10px] font-medium",children:k})}),t.jsx("span",{className:"flex-1 text-sm truncate",children:v}),t.jsx("button",{onClick:()=>i.mutate(m.user_id,{onSuccess:()=>F.success("Removed from team"),onError:()=>F.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:t.jsx(We,{className:"h-3.5 w-3.5"})})]},m.id)})}),u.length>0&&t.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[t.jsx(yn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs(we,{value:l,onValueChange:d,children:[t.jsx(ve,{className:"h-7 text-xs flex-1 max-w-[200px]",children:t.jsx(Te,{placeholder:"Add member…"})}),t.jsx(je,{children:u.map(m=>{const f=m.user,h=(f==null?void 0:f.first_name)??"",g=(f==null?void 0:f.last_name)??"",v=`${h} ${g}`.trim()||(f==null?void 0:f.email)||"Unknown";return t.jsx(ce,{value:m.user_id,children:v},m.user_id)})})]}),l&&t.jsx(V,{size:"sm",className:"h-7 text-xs px-2",disabled:o.isPending,onClick:()=>o.mutate(l,{onSuccess:()=>{F.success("Added to team"),d("")},onError:()=>F.error("Failed to add")}),children:"Add"})]})]})}function bb({workspaceId:e}){const{data:s,isLoading:n}=ta(e),{data:r}=Ln(e),a=yu(e),o=vu(e),[i,l]=p.useState(new Set),[d,c]=p.useState(!1),[u,m]=p.useState(""),f=g=>{l(v=>{const k=new Set(v);return k.has(g)?k.delete(g):k.add(g),k})},h=g=>{g.preventDefault(),u.trim()&&a.mutate({name:u.trim()},{onSuccess:()=>{F.success("Team created"),m(""),c(!1)},onError:()=>F.error("Failed to create team")})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Teams",!n&&s&&t.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",s.length]})]}),t.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Fe,{className:"h-3 w-3"}),"New team"]})]}),d&&t.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:t.jsxs("form",{onSubmit:h,className:"flex items-center gap-2",children:[t.jsx(xe,{autoFocus:!0,placeholder:"Team name",value:u,onChange:g=>m(g.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),t.jsx(V,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||a.isPending,children:a.isPending?"Creating…":"Create"}),t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{c(!1),m("")},children:"Cancel"})]})}),n?t.jsx("div",{className:"divide-y divide-border",children:[1,2].map(g=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[t.jsx(se,{className:"h-7 w-7 rounded-lg shrink-0"}),t.jsx(se,{className:"h-3.5 w-32"})]},g))}):s!=null&&s.length?t.jsx("div",{className:"divide-y divide-border",children:s.map(g=>{const v=i.has(g.id);return t.jsxs("div",{children:[t.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:[t.jsx("button",{onClick:()=>f(g.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:v?t.jsx(Fs,{className:"h-4 w-4"}):t.jsx(Ws,{className:"h-4 w-4"})}),t.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:t.jsx(Ts,{className:"h-3.5 w-3.5 text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:g.name}),g.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g.description})]}),t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[g.member_count," ",g.member_count===1?"member":"members"]}),t.jsxs(zs,{children:[t.jsx(qs,{asChild:!0,children:t.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:t.jsx(Kn,{className:"h-4 w-4"})})}),t.jsx(xs,{align:"end",className:"w-36",children:t.jsxs(Xe,{className:"text-destructive focus:text-destructive",onClick:()=>o.mutate(g.id,{onSuccess:()=>F.success("Team deleted"),onError:()=>F.error("Failed to delete team")}),children:[t.jsx(fs,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),v&&t.jsx(gb,{workspaceId:e,teamId:g.id,allMembers:r??[]})]},g.id)})}):t.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[t.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:t.jsx(Ts,{className:"h-5 w-5 text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium mb-1",children:"No teams yet"}),t.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Teams make it easy to grant project access to groups of people."}),t.jsx(V,{variant:"outline",size:"sm",onClick:()=>c(!0),children:"Create a team"})]})]})}function yb(){const{workspace:e}=Se(),s=(e==null?void 0:e.id)??"",[n,r]=p.useState("general"),[a,o]=p.useState(!1);return t.jsxs("div",{className:"p-2",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2",children:[t.jsx("div",{className:"flex",children:["general","members","teams"].map(i=>t.jsx("button",{onClick:()=>r(i),className:T("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize",n===i?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:i},i))}),n==="members"&&t.jsxs(V,{size:"sm",onClick:()=>o(!0),children:[t.jsx(Fe,{className:"h-4 w-4"}),"Invite member"]})]}),n==="general"&&t.jsx(xb,{workspaceId:s}),n==="members"&&t.jsx(pb,{workspaceId:s,onInvite:()=>o(!0)}),n==="teams"&&t.jsx(bb,{workspaceId:s})]}),t.jsx(fb,{open:a,onClose:()=>o(!1),workspaceId:s})]})}function vb(e){return Ne({queryKey:["invite",e],queryFn:()=>J.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function jb(){const{token:e}=Ke(),{isAuthenticated:s}=Se(),n=Ve(),{data:r,isLoading:a,error:o}=vb(e??""),i=Cu(e??""),[l,d]=p.useState(""),[c,u]=p.useState(""),[m,f]=p.useState(""),[h,g]=p.useState(""),[v,k]=p.useState(!1);if(s&&r)return n(`/${r.workspace.slug}/projects`,{replace:!0}),null;const b=(r==null?void 0:r.invitation.email)??null,j=N=>{N.preventDefault();const C=b??m.trim();if(!C){F.error("Email is required");return}i.mutate({email:C,password:h,first_name:l,last_name:c},{onSuccess:()=>{n(`/${r.workspace.slug}/projects`,{replace:!0})},onError:S=>F.error(S.message??"Registration failed")})};return t.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:t.jsxs("div",{className:"w-full max-w-[380px]",children:[t.jsx("div",{className:"flex justify-center mb-8",children:t.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:t.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:t.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:t.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})})}),a?t.jsxs("div",{className:"space-y-3",children:[t.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-48 mx-auto"}),t.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-32 mx-auto"})]}):o?t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Invalid or expired invitation"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is no longer valid. Ask for a new one."}),t.jsx(ln,{to:"/login",children:t.jsx(V,{variant:"outline",size:"sm",className:"mt-2",children:"Go to login"})})]}):r?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"px-5 py-4 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(Pu,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"You've been invited to"})]}),t.jsx("p",{className:"text-base font-semibold",children:r.workspace.name})]}),t.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[r.invitation.role==="admin"?t.jsx(ca,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):t.jsx(ua,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Joining as"," ",t.jsx("span",{className:"font-medium text-foreground capitalize",children:r.invitation.role}),r.invitation.role==="admin"?" — full access":" — can view and edit"]})]})]}),t.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-5",children:[t.jsx("p",{className:"text-sm font-medium mb-4",children:"Create your account"}),t.jsxs("form",{onSubmit:j,className:"space-y-2",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(xe,{placeholder:"First name",value:l,onChange:N=>d(N.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),t.jsx(xe,{placeholder:"Last name",value:c,onChange:N=>u(N.target.value),required:!0,className:"h-9 bg-transparent"})]}),b?t.jsxs("div",{className:"relative",children:[t.jsx(xe,{type:"email",value:b,readOnly:!0,className:"h-9 bg-muted/50 text-muted-foreground cursor-not-allowed"}),t.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"})]}):t.jsx(xe,{type:"email",placeholder:"Email",value:m,onChange:N=>f(N.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),t.jsxs("div",{className:"relative",children:[t.jsx(xe,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:h,onChange:N=>g(N.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),t.jsx("button",{type:"button",onClick:()=>k(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:v?t.jsx(ia,{className:"h-4 w-4"}):t.jsx(gn,{className:"h-4 w-4"})})]}),t.jsx("div",{className:"pt-1",children:t.jsx(V,{type:"submit",className:"w-full h-9 font-medium",disabled:i.isPending,children:i.isPending?"Creating account…":"Accept invitation"})})]})]}),t.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",t.jsx(ln,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}function Ar({children:e}){const{isAuthenticated:s}=Se();return s?t.jsx(t.Fragment,{children:e}):t.jsx(Ms,{to:"/login",replace:!0})}function ko({children:e}){const{isAuthenticated:s}=Se(),{data:n}=ki(),r=Lr();return s?t.jsx(Ms,{to:"/",replace:!0}):n!=null&&n.needsSetup&&r.pathname==="/login"?t.jsx(Ms,{to:"/register",replace:!0}):n&&!n.needsSetup&&r.pathname==="/register"?t.jsx(Ms,{to:"/login",replace:!0}):t.jsx(t.Fragment,{children:e})}function wb(){const{workspace:e,setWorkspace:s}=Se(),n=Ve(),{data:r,isLoading:a}=Yn(!e);return p.useEffect(()=>{if(e){n(`/${e.slug}/projects`,{replace:!0});return}if(!a&&r!==void 0)if(r.length>0){const o=r[0];s({id:o.id,name:o.name,slug:o.slug}),n(`/${o.slug}/projects`,{replace:!0})}else n("/setup",{replace:!0})},[e,r,a,n,s]),t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})})}function Nb(){const{workspace:e}=Ke(),{workspace:s,setWorkspace:n}=Se();Eu();const r=Ve(),{data:a,isLoading:o,isFetching:i}=Yn();return p.useEffect(()=>{if(o||!a)return;const l=a.find(d=>d.slug===e);l?l.id!==(s==null?void 0:s.id)&&n({id:l.id,name:l.name,slug:l.slug}):a.length>0?r(`/${a[0].slug}/projects`,{replace:!0}):!s&&!i&&r("/setup",{replace:!0})},[a,e,o,i,s==null?void 0:s.id,r,n]),o||!s||s.slug!==e?t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})}):t.jsxs(t.Fragment,{children:[t.jsx(Gm,{}),t.jsx(Sf,{})]})}function kb(){return t.jsxs(bd,{children:[t.jsx(Ie,{path:"/login",element:t.jsx(ko,{children:t.jsx(Cf,{})})}),t.jsx(Ie,{path:"/register",element:t.jsx(ko,{children:t.jsx(Mf,{})})}),t.jsx(Ie,{path:"/invite/:token",element:t.jsx(jb,{})}),t.jsx(Ie,{path:"/setup",element:t.jsx(Ar,{children:t.jsx(Df,{})})}),t.jsx(Ie,{index:!0,element:t.jsx(Ar,{children:t.jsx(wb,{})})}),t.jsxs(Ie,{path:"/:workspace",element:t.jsx(Ar,{children:t.jsx(Nb,{})}),children:[t.jsx(Ie,{index:!0,element:t.jsx(Ms,{to:"projects",replace:!0})}),t.jsx(Ie,{path:"projects",element:t.jsx(Tx,{})}),t.jsxs(Ie,{path:"projects/:projectKey",element:t.jsx(Qm,{}),children:[t.jsx(Ie,{path:"board",element:t.jsx(Qg,{})}),t.jsx(Ie,{path:"issues",element:t.jsx(Xg,{})}),t.jsx(Ie,{path:"issues/new",element:t.jsx(ib,{})}),t.jsx(Ie,{path:"issues/:issueId",element:t.jsx(sb,{})}),t.jsx(Ie,{path:"sprints",element:t.jsx(mb,{})}),t.jsx(Ie,{path:"access",element:t.jsx(Jg,{})})]}),t.jsx(Ie,{path:"notifications",element:t.jsx(lb,{})}),t.jsx(Ie,{path:"settings",element:t.jsx(yb,{})})]}),t.jsx(Ie,{path:"*",element:t.jsx(Ms,{to:"/",replace:!0})})]})}const Sb=new hd({defaultOptions:{queries:{staleTime:1e3*30,retry:1}}});di(document.getElementById("root")).render(t.jsx(p.StrictMode,{children:t.jsx(Oc,{children:t.jsxs(xd,{client:Sb,children:[t.jsx(Tc,{children:t.jsx(Pc,{children:t.jsx(yd,{children:t.jsxs(Jr,{delayDuration:300,children:[t.jsx(kb,{}),t.jsx(vc,{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"}}})]})})})}),t.jsx(Kd,{initialIsOpen:!1})]})})}));
|